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