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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/*
* This file is part of libmeegotouch *
*
* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* Contact: Tomas Junnonen <tomas.junnonen@nokia.com>
*
* This software, including documentation, is protected by copyright
* controlled by Nokia Corporation. All rights are reserved. Copying,
* including reproducing, storing, adapting or translating, any or all of
* this material requires the prior written consent of Nokia Corporation.
* This material also contains confidential information which may not be
* disclosed to others without the prior written consent of Nokia.
*/
#ifndef MVIDEO_H
#define MVIDEO_H
#include <QObject>
#include <QSize>
#include <MExport>
class M_CORE_EXPORT MVideo : public QObject
{
Q_OBJECT
public:
//! Supported raw video data formats.
enum DataFormat {
//! 24bit RGB
RGB = 0,
//BGR,
//RGBx,
//BGRx,
//! 12bit YUV (YV12, I420)
YUV
};
//! States for the video playback
enum State {
//! Video is not ready yet, playback cannot be started.
NotReady = 0,
//! Video is paused.
Paused,
//! Video is playing.
Playing,
//! Video is stopped.
Stopped
};
virtual bool open(const QString& filename) = 0;
virtual bool isReady() const = 0;
virtual void setVideoState(MVideo::State state) = 0;
virtual MVideo::State videoState() const = 0;
virtual void seek(quint64 time) = 0;
virtual quint64 position() const = 0;
virtual quint64 length() const = 0;
virtual void setMuted(bool muted) = 0;
virtual bool isMuted() const = 0;
virtual void setVolume(qreal volume) = 0;
virtual qreal volume() const = 0;
virtual void setLooping(bool enabled) = 0;
virtual bool isLooping() const = 0;
virtual QSize resolution() const = 0;
virtual uchar* frameData() const = 0;
virtual MVideo::DataFormat frameDataFormat() const = 0;
virtual bool lockFrameData() = 0;
virtual void unlockFrameData() = 0;
Q_SIGNALS:
void videoReady();
void frameReady();
void stateChanged();
};
#endif
|