VLCInstance.cpp 1.97 KB
Newer Older
1 2 3
/*****************************************************************************
 * VLCInstance.cpp: Binding for libvlc instances
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

23
#include "VLCInstance.h"
24
#include "vlc/vlc.h"
25 26 27

using namespace LibVLCpp;

28
Instance::Instance( QObject* parent /*= NULL*/ ) : QObject( parent )
29 30 31
{
    char const *argv[] =
    {
32
//        "-vvvvv",
33
//        "--ffmpeg-debug", "3",
34
        "--no-skip-frames",
35
//        "--intf", "dummy",
36
        "--text-renderer", "dummy",
37
        //"--no-audio",
38
        //"--plugin-path", VLC_TREE "/modules",
39
        "--no-disable-screensaver", //No need to disable the screensaver, and save a thread.
40
        "--ignore-config", //Don't use VLC's config files
41
        "--no-overlay",
42 43 44
    };
    int argc = sizeof( argv ) / sizeof( *argv );

45
    m_internalPtr = libvlc_new( argc, argv );
46 47
    Q_ASSERT_X( m_internalPtr != NULL, "LibVLCpp::Instance::Instance()",
                "Can't launch VLMC without a valid LibVLC instance. Please check your VLC installation" );
48 49
}

50
Instance::~Instance()
51
{
52
    libvlc_release( m_internalPtr );
53
}