author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 11:15:19 +0300 | |
branch | RCL_3 |
changeset 11 | 25a739ee40f4 |
parent 7 | 3f74d0d4af4c |
child 13 | c0432d11811c |
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 |
#include "audiooutput.h" |
|
20 |
#include "audioplayer.h" |
|
21 |
#include "defs.h" |
|
22 |
#include "dummyplayer.h" |
|
23 |
#include "utils.h" |
|
24 |
#include "utils.h" |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
25 |
|
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
26 |
#ifdef PHONON_MMF_VIDEO_SURFACES |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
27 |
#include "videoplayer_surface.h" |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
28 |
#else |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
29 |
#include "videoplayer_dsa.h" |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
30 |
#endif |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
31 |
|
0 | 32 |
#include "videowidget.h" |
33 |
||
34 |
#include "mediaobject.h" |
|
35 |
||
36 |
#include <QDir> |
|
37 |
#include <QUrl> |
|
38 |
||
39 |
QT_BEGIN_NAMESPACE |
|
40 |
||
41 |
using namespace Phonon; |
|
42 |
using namespace Phonon::MMF; |
|
43 |
||
44 |
/*! \class MMF::MediaObject |
|
45 |
\internal |
|
46 |
*/ |
|
47 |
||
48 |
//----------------------------------------------------------------------------- |
|
49 |
// Constructor / destructor |
|
50 |
//----------------------------------------------------------------------------- |
|
51 |
||
52 |
MMF::MediaObject::MediaObject(QObject *parent) : MMF::MediaNode::MediaNode(parent) |
|
53 |
, m_recognizerOpened(false) |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
54 |
, m_nextSourceSet(false) |
0 | 55 |
{ |
56 |
m_player.reset(new DummyPlayer()); |
|
57 |
||
58 |
TRACE_CONTEXT(MediaObject::MediaObject, EAudioApi); |
|
59 |
TRACE_ENTRY_0(); |
|
60 |
||
61 |
Q_UNUSED(parent); |
|
62 |
||
63 |
TRACE_EXIT_0(); |
|
64 |
} |
|
65 |
||
66 |
MMF::MediaObject::~MediaObject() |
|
67 |
{ |
|
68 |
TRACE_CONTEXT(MediaObject::~MediaObject, EAudioApi); |
|
69 |
TRACE_ENTRY_0(); |
|
70 |
||
71 |
m_file.Close(); |
|
72 |
m_fileServer.Close(); |
|
73 |
m_recognizer.Close(); |
|
74 |
||
75 |
TRACE_EXIT_0(); |
|
76 |
} |
|
77 |
||
78 |
||
79 |
//----------------------------------------------------------------------------- |
|
80 |
// Recognizer |
|
81 |
//----------------------------------------------------------------------------- |
|
82 |
||
83 |
bool MMF::MediaObject::openRecognizer() |
|
84 |
{ |
|
85 |
TRACE_CONTEXT(MediaObject::openRecognizer, EAudioInternal); |
|
86 |
||
87 |
if (!m_recognizerOpened) { |
|
88 |
TInt err = m_recognizer.Connect(); |
|
89 |
if (KErrNone != err) { |
|
90 |
TRACE("RApaLsSession::Connect error %d", err); |
|
91 |
return false; |
|
92 |
} |
|
93 |
||
94 |
err = m_fileServer.Connect(); |
|
95 |
if (KErrNone != err) { |
|
96 |
TRACE("RFs::Connect error %d", err); |
|
97 |
return false; |
|
98 |
} |
|
99 |
||
100 |
// This must be called in order to be able to share file handles with |
|
101 |
// the recognizer server (see fileMediaType function). |
|
102 |
err = m_fileServer.ShareProtected(); |
|
103 |
if (KErrNone != err) { |
|
104 |
TRACE("RFs::ShareProtected error %d", err); |
|
105 |
return false; |
|
106 |
} |
|
107 |
||
108 |
m_recognizerOpened = true; |
|
109 |
} |
|
110 |
||
111 |
return true; |
|
112 |
} |
|
113 |
||
114 |
MMF::MediaType MMF::MediaObject::fileMediaType |
|
115 |
(const QString& fileName) |
|
116 |
{ |
|
117 |
TRACE_CONTEXT(MediaObject::fileMediaType, EAudioInternal); |
|
118 |
||
119 |
MediaType result = MediaTypeUnknown; |
|
120 |
||
121 |
if (openRecognizer()) { |
|
122 |
||
123 |
const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName)); |
|
124 |
||
125 |
m_file.Close(); |
|
126 |
TInt err = m_file.Open(m_fileServer, *fileNameSymbian, EFileRead | EFileShareReadersOnly); |
|
127 |
||
128 |
if (KErrNone == err) { |
|
129 |
TDataRecognitionResult recognizerResult; |
|
130 |
err = m_recognizer.RecognizeData(m_file, recognizerResult); |
|
131 |
if (KErrNone == err) { |
|
132 |
const TPtrC mimeType = recognizerResult.iDataType.Des(); |
|
133 |
result = Utils::mimeTypeToMediaType(mimeType); |
|
134 |
} else { |
|
135 |
TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err); |
|
136 |
} |
|
137 |
} else { |
|
138 |
TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err); |
|
139 |
} |
|
140 |
} |
|
141 |
||
142 |
return result; |
|
143 |
} |
|
144 |
||
145 |
||
146 |
//----------------------------------------------------------------------------- |
|
147 |
// MediaObjectInterface |
|
148 |
//----------------------------------------------------------------------------- |
|
149 |
||
150 |
void MMF::MediaObject::play() |
|
151 |
{ |
|
152 |
m_player->play(); |
|
153 |
} |
|
154 |
||
155 |
void MMF::MediaObject::pause() |
|
156 |
{ |
|
157 |
m_player->pause(); |
|
158 |
} |
|
159 |
||
160 |
void MMF::MediaObject::stop() |
|
161 |
{ |
|
162 |
m_player->stop(); |
|
163 |
} |
|
164 |
||
165 |
void MMF::MediaObject::seek(qint64 ms) |
|
166 |
{ |
|
167 |
m_player->seek(ms); |
|
168 |
||
169 |
if (state() == PausedState or state() == PlayingState) { |
|
170 |
emit tick(currentTime()); |
|
171 |
} |
|
172 |
} |
|
173 |
||
174 |
qint32 MMF::MediaObject::tickInterval() const |
|
175 |
{ |
|
176 |
return m_player->tickInterval(); |
|
177 |
} |
|
178 |
||
179 |
void MMF::MediaObject::setTickInterval(qint32 interval) |
|
180 |
{ |
|
181 |
m_player->setTickInterval(interval); |
|
182 |
} |
|
183 |
||
184 |
bool MMF::MediaObject::hasVideo() const |
|
185 |
{ |
|
186 |
return m_player->hasVideo(); |
|
187 |
} |
|
188 |
||
189 |
bool MMF::MediaObject::isSeekable() const |
|
190 |
{ |
|
191 |
return m_player->isSeekable(); |
|
192 |
} |
|
193 |
||
194 |
Phonon::State MMF::MediaObject::state() const |
|
195 |
{ |
|
196 |
return m_player->state(); |
|
197 |
} |
|
198 |
||
199 |
qint64 MMF::MediaObject::currentTime() const |
|
200 |
{ |
|
201 |
return m_player->currentTime(); |
|
202 |
} |
|
203 |
||
204 |
QString MMF::MediaObject::errorString() const |
|
205 |
{ |
|
206 |
return m_player->errorString(); |
|
207 |
} |
|
208 |
||
209 |
Phonon::ErrorType MMF::MediaObject::errorType() const |
|
210 |
{ |
|
211 |
return m_player->errorType(); |
|
212 |
} |
|
213 |
||
214 |
qint64 MMF::MediaObject::totalTime() const |
|
215 |
{ |
|
216 |
return m_player->totalTime(); |
|
217 |
} |
|
218 |
||
219 |
MediaSource MMF::MediaObject::source() const |
|
220 |
{ |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
221 |
return m_source; |
0 | 222 |
} |
223 |
||
224 |
void MMF::MediaObject::setSource(const MediaSource &source) |
|
225 |
{ |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
226 |
switchToSource(source); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
227 |
} |
0 | 228 |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
229 |
void MMF::MediaObject::switchToSource(const MediaSource &source) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
230 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
231 |
createPlayer(source); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
232 |
m_source = source; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
233 |
m_player->open(m_source, m_file); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
234 |
emit currentSourceChanged(m_source); |
0 | 235 |
} |
236 |
||
237 |
void MMF::MediaObject::createPlayer(const MediaSource &source) |
|
238 |
{ |
|
239 |
TRACE_CONTEXT(MediaObject::createPlayer, EAudioApi); |
|
240 |
TRACE_ENTRY("state %d source.type %d", state(), source.type()); |
|
241 |
TRACE_ENTRY("source.type %d", source.type()); |
|
242 |
||
243 |
MediaType mediaType = MediaTypeUnknown; |
|
244 |
||
245 |
AbstractPlayer* oldPlayer = m_player.data(); |
|
246 |
||
247 |
const bool oldPlayerHasVideo = oldPlayer->hasVideo(); |
|
248 |
const bool oldPlayerSeekable = oldPlayer->isSeekable(); |
|
249 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
250 |
QString errorMessage; |
0 | 251 |
|
252 |
// Determine media type |
|
253 |
switch (source.type()) { |
|
254 |
case MediaSource::LocalFile: |
|
255 |
mediaType = fileMediaType(source.fileName()); |
|
256 |
break; |
|
257 |
||
258 |
case MediaSource::Url: |
|
259 |
{ |
|
260 |
const QUrl url(source.url()); |
|
261 |
if (url.scheme() == QLatin1String("file")) { |
|
262 |
mediaType = fileMediaType(url.toLocalFile()); |
|
263 |
} |
|
264 |
else { |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
265 |
// Streaming playback is generally not supported by the implementation |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
266 |
// of the audio player API, so we use CVideoPlayerUtility for both |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
267 |
// audio and video streaming. |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
268 |
mediaType = MediaTypeVideo; |
0 | 269 |
} |
270 |
} |
|
271 |
break; |
|
272 |
||
273 |
case MediaSource::Invalid: |
|
274 |
case MediaSource::Disc: |
|
275 |
case MediaSource::Stream: |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
276 |
errorMessage = tr("Error opening source: type not supported"); |
0 | 277 |
break; |
278 |
||
279 |
case MediaSource::Empty: |
|
280 |
TRACE_0("Empty media source"); |
|
281 |
break; |
|
282 |
} |
|
283 |
||
284 |
AbstractPlayer* newPlayer = 0; |
|
285 |
||
286 |
// Construct newPlayer using oldPlayer (if not 0) in order to copy |
|
287 |
// parameters (volume, prefinishMark, transitionTime) which may have |
|
288 |
// been set on oldPlayer. |
|
289 |
||
290 |
switch (mediaType) { |
|
291 |
case MediaTypeUnknown: |
|
292 |
TRACE_0("Media type could not be determined"); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
293 |
newPlayer = new DummyPlayer(oldPlayer); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
294 |
errorMessage = tr("Error opening source: media type could not be determined"); |
0 | 295 |
break; |
296 |
||
297 |
case MediaTypeAudio: |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
298 |
newPlayer = new AudioPlayer(this, oldPlayer); |
0 | 299 |
break; |
300 |
||
301 |
case MediaTypeVideo: |
|
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
302 |
#ifdef PHONON_MMF_VIDEO_SURFACES |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
303 |
newPlayer = SurfaceVideoPlayer::create(this, oldPlayer); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
304 |
#else |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
305 |
newPlayer = DsaVideoPlayer::create(this, oldPlayer); |
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
306 |
#endif |
0 | 307 |
break; |
308 |
} |
|
309 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
310 |
if (oldPlayer) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
311 |
emit abstractPlayerChanged(0); |
0 | 312 |
m_player.reset(newPlayer); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
313 |
emit abstractPlayerChanged(newPlayer); |
0 | 314 |
|
315 |
if (oldPlayerHasVideo != hasVideo()) { |
|
316 |
emit hasVideoChanged(hasVideo()); |
|
317 |
} |
|
318 |
||
319 |
if (oldPlayerSeekable != isSeekable()) { |
|
320 |
emit seekableChanged(isSeekable()); |
|
321 |
} |
|
322 |
||
323 |
connect(m_player.data(), SIGNAL(totalTimeChanged(qint64)), SIGNAL(totalTimeChanged(qint64))); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
324 |
connect(m_player.data(), SIGNAL(stateChanged(Phonon::State,Phonon::State)), SIGNAL(stateChanged(Phonon::State,Phonon::State))); |
0 | 325 |
connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); |
326 |
connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
327 |
connect(m_player.data(), SIGNAL(bufferStatus(int)), SIGNAL(bufferStatus(int))); |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
328 |
connect(m_player.data(), SIGNAL(metaDataChanged(QMultiMap<QString,QString>)), SIGNAL(metaDataChanged(QMultiMap<QString,QString>))); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
329 |
connect(m_player.data(), SIGNAL(aboutToFinish()), SIGNAL(aboutToFinish())); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
330 |
connect(m_player.data(), SIGNAL(prefinishMarkReached(qint32)), SIGNAL(tick(qint32))); |
0 | 331 |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
332 |
// We need to call setError() after doing the connects, otherwise the |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
333 |
// error won't be received. |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
334 |
if (!errorMessage.isEmpty()) { |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
335 |
Q_ASSERT(m_player); |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
336 |
m_player->setError(errorMessage); |
0 | 337 |
} |
338 |
||
339 |
TRACE_EXIT_0(); |
|
340 |
} |
|
341 |
||
342 |
void MMF::MediaObject::setNextSource(const MediaSource &source) |
|
343 |
{ |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
344 |
m_nextSource = source; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
345 |
m_nextSourceSet = true; |
0 | 346 |
} |
347 |
||
348 |
qint32 MMF::MediaObject::prefinishMark() const |
|
349 |
{ |
|
350 |
return m_player->prefinishMark(); |
|
351 |
} |
|
352 |
||
353 |
void MMF::MediaObject::setPrefinishMark(qint32 mark) |
|
354 |
{ |
|
355 |
m_player->setPrefinishMark(mark); |
|
356 |
} |
|
357 |
||
358 |
qint32 MMF::MediaObject::transitionTime() const |
|
359 |
{ |
|
360 |
return m_player->transitionTime(); |
|
361 |
} |
|
362 |
||
363 |
void MMF::MediaObject::setTransitionTime(qint32 time) |
|
364 |
{ |
|
365 |
m_player->setTransitionTime(time); |
|
366 |
} |
|
367 |
||
368 |
void MMF::MediaObject::volumeChanged(qreal volume) |
|
369 |
{ |
|
370 |
m_player->volumeChanged(volume); |
|
371 |
} |
|
372 |
||
373 |
//----------------------------------------------------------------------------- |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
374 |
// MediaNode |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
375 |
//----------------------------------------------------------------------------- |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
376 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
377 |
void MMF::MediaObject::connectMediaObject(MediaObject * /*mediaObject*/) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
378 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
379 |
// This function should never be called - see MediaNode::setMediaObject() |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
380 |
Q_ASSERT_X(false, Q_FUNC_INFO, |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
381 |
"Connection of MediaObject to MediaObject"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
382 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
383 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
384 |
void MMF::MediaObject::disconnectMediaObject(MediaObject * /*mediaObject*/) |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
385 |
{ |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
386 |
// This function should never be called - see MediaNode::setMediaObject() |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
387 |
Q_ASSERT_X(false, Q_FUNC_INFO, |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
388 |
"Disconnection of MediaObject from MediaObject"); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
389 |
} |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
390 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
391 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
392 |
//----------------------------------------------------------------------------- |
0 | 393 |
// Video output |
394 |
//----------------------------------------------------------------------------- |
|
395 |
||
7
3f74d0d4af4c
qt:70947f0f93d948bc89b3b43d00da758a51f1ef84
Eckhart Koeppen <eckhart.koppen@nokia.com>
parents:
4
diff
changeset
|
396 |
void MMF::MediaObject::setVideoOutput(AbstractVideoOutput* videoOutput) |
0 | 397 |
{ |
398 |
m_player->setVideoOutput(videoOutput); |
|
399 |
} |
|
400 |
||
401 |
||
402 |
AbstractPlayer *MMF::MediaObject::abstractPlayer() const |
|
403 |
{ |
|
404 |
return m_player.data(); |
|
405 |
} |
|
406 |
||
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
407 |
//----------------------------------------------------------------------------- |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
408 |
// Playlist support |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
409 |
//----------------------------------------------------------------------------- |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
410 |
|
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
411 |
void MMF::MediaObject::switchToNextSource() |
0 | 412 |
{ |
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
413 |
if (m_nextSourceSet) { |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
414 |
m_nextSourceSet = false; |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
415 |
switchToSource(m_nextSource); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
416 |
play(); |
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
417 |
} |
0 | 418 |
} |
419 |
||
420 |
QT_END_NAMESPACE |
|
421 |