-
Notifications
You must be signed in to change notification settings - Fork 4
/
mltcontroller.h
73 lines (56 loc) · 1.67 KB
/
mltcontroller.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef MLTCONTROLLER_H
#define MLTCONTROLLER_H
#include <QObject>
#include <QImage>
#include <Mlt.h>
class MltController : public QObject
{
Q_OBJECT
public:
explicit MltController (QObject *parent = 0);
~MltController ();
/** Initialize the controller.
*/
void init ();
/** Open a media file, device, or stream.
* @param[in] url string of file/device/stream
* @param[in] profile MLT profile
* @return 0 if no error. Error code if error.
*/
int open (const char* url, const char* profile = 0);
/** Close the media.
*/
void close ();
/** Start playback.
*/
void play ();
/** Pause playback.
*/
void pause ();
/** Set the SDL audio output level.
* @param volume audio volume in the range [0..1]
*/
void setVolume (double volume);
/** Get a QImage for a MLT frame.
* This is primarily used within a slot connected to the frameReceived signal.
* @param frame a mlt_frame
* @return a QImage containing the RGBA image for the frame
*/
QImage getImage (void* frame);
Mlt::Profile* profile () const
{ return m_profile; }
signals:
/** This method will be called each time a new frame is available.
* @param frame pass this opaque frame pointer to getImage()
* @param position the frame number of this frame representing time
*/
void frameReceived (void* frame, unsigned position);
public slots:
void onWindowResize ();
private:
Mlt::Profile* m_profile;
Mlt::Producer* m_producer;
Mlt::Consumer* m_consumer;
static void on_frame_show (mlt_consumer, void* self, mlt_frame frame);
};
#endif // MLTCONTROLLER_H