Media.h 858 Bytes
Newer Older
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#ifndef MEDIA_H
#define MEDIA_H

#include <QString>
#include <QImage>

#include "VLCMedia.h"
#include "VLCInstance.h"
#include "VLCMediaPlayer.h"

#include "Image.h"

class       Media
{
public:
    Media(const QString& mrl);
    ~Media();

    static void             lock(LibVLCpp::Media::DataCtx* dataCtx, void **pp_ret);
    static void             unlock(LibVLCpp::Media::DataCtx* dataCtx);
    Image*                  takeSnapshot(unsigned int width, unsigned int heigth);

    QImage&                 getImage();

private:
    LibVLCpp::Media*            _vlcMedia;
    LibVLCpp::MediaPlayer*      _vlcMediaPlayer;
    LibVLCpp::Instance*         _instance;
    QString                     _mrl;

    Image*                      _snapshot;

    uchar*                      _pixelBuffer;
    QImage*                     _image;


};

#endif // MEDIA_H