author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:43:10 +0200 | |
changeset 3 | 41300fa6a67c |
parent 0 | 1918ee327afb |
child 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project. |
2 |
||
3 |
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
||
5 |
This library is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Lesser General Public License as published by |
|
7 |
the Free Software Foundation, either version 2.1 or 3 of the License. |
|
8 |
||
9 |
This library is distributed in the hope that it will be useful, |
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
GNU Lesser General Public License for more details. |
|
13 |
||
14 |
You should have received a copy of the GNU Lesser General Public License |
|
15 |
along with this library. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
||
17 |
*/ |
|
18 |
||
19 |
#ifndef PHONON_MMF_VIDEOPLAYER_H |
|
20 |
#define PHONON_MMF_VIDEOPLAYER_H |
|
21 |
||
22 |
#include <videoplayer.h> // from epoc32/include |
|
23 |
||
24 |
#include "abstractmediaplayer.h" |
|
25 |
#include "videooutput.h" |
|
26 |
||
27 |
QT_BEGIN_NAMESPACE |
|
28 |
||
29 |
namespace Phonon |
|
30 |
{ |
|
31 |
namespace MMF |
|
32 |
{ |
|
33 |
/** |
|
34 |
* @short Wrapper over MMF video client utility |
|
35 |
* |
|
36 |
* See |
|
37 |
* <a href="http://wiki.forum.nokia.com/index.php/How_to_play_a_video_file_using_CVideoPlayerUtility">How to |
|
38 |
* play a video file using CVideoPlayerUtility</a> |
|
39 |
*/ |
|
40 |
class VideoPlayer : public AbstractMediaPlayer |
|
41 |
, public MVideoPlayerUtilityObserver |
|
42 |
{ |
|
43 |
Q_OBJECT |
|
44 |
||
45 |
public: |
|
46 |
VideoPlayer(); |
|
47 |
explicit VideoPlayer(const AbstractPlayer& player); |
|
48 |
virtual ~VideoPlayer(); |
|
49 |
||
50 |
// AbstractPlayer |
|
51 |
virtual void doPlay(); |
|
52 |
virtual void doPause(); |
|
53 |
virtual void doStop(); |
|
54 |
virtual void doSeek(qint64 milliseconds); |
|
55 |
virtual int setDeviceVolume(int mmfVolume); |
|
56 |
virtual int openFile(RFile& file); |
|
57 |
virtual void close(); |
|
58 |
||
59 |
// MediaObjectInterface |
|
60 |
virtual bool hasVideo() const; |
|
61 |
virtual qint64 currentTime() const; |
|
62 |
virtual qint64 totalTime() const; |
|
63 |
||
64 |
// MVideoPlayerUtilityObserver |
|
65 |
virtual void MvpuoOpenComplete(TInt aError); |
|
66 |
virtual void MvpuoPrepareComplete(TInt aError); |
|
67 |
virtual void MvpuoFrameReady(CFbsBitmap &aFrame, TInt aError); |
|
68 |
virtual void MvpuoPlayComplete(TInt aError); |
|
69 |
virtual void MvpuoEvent(const TMMFEvent &aEvent); |
|
70 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
71 |
public Q_SLOTS: |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
72 |
void videoWindowChanged(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
73 |
void aspectRatioChanged(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
74 |
void scaleModeChanged(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
75 |
void suspendDirectScreenAccess(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
76 |
void resumeDirectScreenAccess(); |
0 | 77 |
|
78 |
private: |
|
79 |
void construct(); |
|
80 |
||
81 |
void doPrepareCompleteL(TInt aError); |
|
82 |
||
83 |
// AbstractPlayer |
|
84 |
virtual void videoOutputChanged(); |
|
85 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
86 |
void getVideoWindow(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
void initVideoOutput(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
88 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
89 |
void updateVideoRect(); |
0 | 90 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
91 |
void applyPendingChanges(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
92 |
void applyVideoWindowChange(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
93 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
94 |
void startDirectScreenAccess(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
95 |
bool stopDirectScreenAccess(); |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
96 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
97 |
// AbstractMediaPlayer |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
virtual int numberOfMetaDataEntries() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
99 |
virtual QPair<QString, QString> metaDataEntry(int index) const; |
0 | 100 |
|
101 |
private: |
|
102 |
QScopedPointer<CVideoPlayerUtility> m_player; |
|
103 |
||
104 |
// Not owned |
|
105 |
RWsSession& m_wsSession; |
|
106 |
CWsScreenDevice& m_screenDevice; |
|
107 |
RWindowBase* m_window; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
108 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
109 |
/* Extent of the video display - will be clipped to m_windowRect */ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
TRect m_videoRect; |
0 | 111 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
112 |
TReal32 m_scaleWidth; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
TReal32 m_scaleHeight; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
114 |
|
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
115 |
QSize m_videoFrameSize; |
0 | 116 |
qint64 m_totalTime; |
117 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
118 |
bool m_pendingChanges; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
119 |
bool m_dsaActive; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
120 |
bool m_dsaWasActive; |
0 | 121 |
|
122 |
}; |
|
123 |
||
124 |
} |
|
125 |
} |
|
126 |
||
127 |
QT_END_NAMESPACE |
|
128 |
||
129 |
#endif |