VLCMedia.h 2.39 KB
Newer Older
1 2 3
/*****************************************************************************
 * VLCMedia.h: Binding for libvlc_media
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
5
 *
6
 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 *
 * 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.
 *****************************************************************************/

Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
23 24 25 26 27 28 29 30 31 32 33
#ifndef VLCMEDIA_H
#define VLCMEDIA_H

#include "vlc/vlc.h"

#include <QString>

#include "VLCpp.hpp"

namespace LibVLCpp
{
34 35
    class Instance;

36
    class   Media : public Internal< libvlc_media_t >
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
37 38 39
    {
    public:

40 41
        Media( Instance* instance, const QString& filename );
        Media(Media &media );
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
42
        ~Media();
43
        void                addOption( const char* opt );
44
        void                addOption( const QString& opt );
45 46 47 48 49 50
        void                setVideoLockCallback( void* );
        void                setVideoUnlockCallback( void* );
        void                setAudioLockCallback( void* );
        void                setAudioUnlockCallback( void* );
        void                setVideoDataCtx( void* dataCtx );
        void                setAudioDataCtx( void* dataCtx );
51
        const QString&      getFileName() const;
52 53 54 55
        void                parse();
        void                fetchTrackInfo();
        unsigned int videoCodec() const;
        unsigned int audioCodec() const;
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
56

57
    private:
58
        QString                     m_fileName;
59
        libvlc_media_track_t        **m_tracks;
60 61 62
        // this has not to be equal to nb video tracks + nb audio tracks.
        // it is only meant to use when iterating over m_tracksInfo
        int                         m_nbTracks;
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
63 64 65 66
    };
}

#endif // VLCMEDIA_H