summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/abstractplayer.h
Commit message (Collapse)AuthorAgeFilesLines
* Added support to Phonon MMF backend for playback of Qt resource filesGareth Stockwell2010-08-021-3/+1
| | | | | | | | | | | | | | | | | | | | | The backend accesses the resource file path via MediaSource::url(). A small patch to Phonon was required to enable this, because by default, Phonon passes a QIODevice, rather than the resource file path, to the backend. The backend uses this path to create a QResource object, through which the memory buffer into which the resource file has been read can be accessed. This buffer is wrapped in a Symbian 8-bit descriptor and passed to the OpenDesL() function of the appropriate MMF client utility API. Playback only works for certain file formats, as the Symbian MIME type recognizer does not always work. For example, playback of an audio WAV resource file works, while playback of an MP3 resource file does not. Task-number: QTBUG-6562 Reviewed-by: Justin McPherson
* Close media clip before creating new player objectGareth Stockwell2010-07-071-0/+1
| | | | | | | | | | Failure to Close() an existing MMF player utility object before creating a new one - which happens in the MMF backend's implementation of Phonon::MediaObject::setCurrentSource() - causes intialization of the newly-created utility to fail later on. Task-number: QTBUG-11377 Reviewed-by: Thierry Bastian
* Phonon MMF: calling pause() when in StoppedState triggers stateChanged()Gareth Stockwell2010-04-151-1/+1
| | | | | | | | Previously, the MMF backend simply swallowed a call to pause() when in StoppedState. However, the stopToPause step in tst_mediaobject requires the backend to emit a stateChanged signal when this happens. Reviewed-by: Frans Englich
* Added support for video surfaces to Phonon MMF backendGareth Stockwell2010-03-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian^3 introduces a new compositing graphics subsystem in which non-UI content such as video is provided by client applications via graphics surfaces. This patch modifies the video playback part of the Phonon MMF backend so that, on devices which use the new graphics architecture (NGA), video is rendered to a surface. On devices which use the legacy graphics architecture, the existing video rendering path, which uses Direct Screen Access (DSA) is maintained. On NGA devices, video playback applications do not deal with surfaces directly; instead, they use a new MMF client API called CVideoPlayerUtility2. The implementation of this API takes care of creating a graphics surface, registering it with the window manager, and directing the output of the video decoder into this surface. CVideoPlayerUtility2 inherits from the legacy video playback API, CVideoPlayerUtility, deprecating certain functions and adding new ones. The main changes involved in modifying CVideoPlayerUtility client code to instead use CVideoPlayerUtility2 are: 1. CVideoPlayerUtility requires a window handle to be provided at object construction time. The CVideoPlayerUtility2 constructor does not take a window handle; it is provided by the client later via the SetDisplayWindowL function. 2. CVideoPlayerUtility requires the client to provide an absolute screen rectangle at construction time, and then to call SetDisplayWindowL whenever this rectangle changes due to either window repositioning or resizing. CVideoPlayerUtility2 requires the client to provide a display rectangle which is relative to the display window. This rectangle must be updated via SetVideoExtentL / SetWindowClipRectL when the window is resized, but no update is required when the window is repositioned - the compositing window system takes care of repositioning the video content on the screen. 3. CVideoPlayerUtility requires the client to paint transparent black into the region of the window in which video will be displayed. CVideoPlayerUtility2 does not require the client to paint the video window. In order to accomodate these differences, the existing VideoPlayer and VideoOutput classes are replaced with AbstractVideoPlayer and AbstractVideoOutput respectively. These abstract base classes encapsulate functionality which is common between the DSA and surface rendering client code. Because CVideoPlayerUtility2 inherits from CVideoPlayerUtility, AbstractVideoPlayer is able to hold a pointer to CVideoPlayerUtility, via which it controls functionality which is not affected by the details of the rendering path, such as play/pause/stop, seek and metadata access. The three areas of divergence listed above are encapsulated in the derived classes DsaVideoOutput/SurfaceVideoOutput and DsaVideoPlayer/ SurfaceVideoPlayer. Of the three, (1) and (3) are fairly straightforward. For DSA video playback, the need to respond to changes in video widget absolute screen position in (2) necessitated the AncestorMoveMonitor class, which installs an event filter on each ancestor of the video widget. This class is not required for surface video playback and is therefore removed from the surface-rendering code path. Selection of either the DSA- or surface-rendering code path is done at qmake time, via the exists(...) check introduced in mmf.pro. This checks for existence of the header in which CVideoPlayerUtility2 is defined; if this file is found, surface rendering is selected, otherwise the DSA rendering version of the backend is built. Note that this approach is not completely robust, since it is possible for an environment to include the videoplayer2.h header and yet be configured to use the legacy graphics subsystem. This could be dealt with by instead performing the check for surface support at configuration time, building and executing a small Symbian program which will return different output according to which of the two graphics subsystems is in use. Task-number: QTBUG-8919 Reviewed-by: Frans Englich
* Workaround for compiler error with MWCC (Symbian emulator)Shane Kearns2010-01-181-2/+2
| | | | | | | Recent changes to phonon and syncqt cause problems with the default search path for #include with this compiler. Reviewed-by: Gareth Stockwell
* Corrected parameter name ordering in internal Phonon MMF function signaturesGareth Stockwell2010-01-081-2/+2
| | | | | | | | Some instances of the changeState signal declaration had the newState and oldState parameters in the wrong order. While this has no effect on the behaviour of the code, it can be confusing to developers reading it. Reviewed-by: trustme
* Implemented support for playlist handling in Phonon MMF backendGareth Stockwell2009-12-081-8/+5
| | | | | | | | | | The main changes are: 1. MediaObject emits prefinishMark at the appropriate instant 2. MediaObject emits aboutToFinish at the appropriate instant 3. MediaObject switches to next source when playback completes Task-number: QTBUG-6214 Reviewed-by: Frans Englich
* Implemented buffer status notifications in Phonon MMF backendGareth Stockwell2009-12-081-0/+1
| | | | | | | | | | | | When clips are buffering (either at the start of playback, or during playback, when buffer levels drop due to e.g. CPU, file system or network load), the backend receives notification from the MMF. While buffering is ongoing, the backend periodically queries the filling status and emits a signal. Task-number: QTBUG-4660 Reviewed-by: Frans Englich
* Symbian: More i18n strings work.Frans Englich2009-12-071-1/+3
| | | | | | | | * Consistently capitalize error sentences * Simplify & fix code/documentation. Task-number: QTBUG-4994 Reviewed-by: TrustMe
* Added error strings to Phonon MMF backendGareth Stockwell2009-12-021-3/+13
| | | | | | | | | | Note that changing Utils from a namespace into a class, and then using Q_DECLARE_TR_FUNCTIONS in the class declaration, was necessary in order to be able to call tr(...) from the implementation of Utils::symbianErrorToString. Task-number: QTBUG-4994 Reviewed-by: Oswald Buddenhagen
* Implemented aspect ratio and scale mode handling in Phonon MMF backendGareth Stockwell2009-11-131-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced VolumeObserver and VideoOutputObserver interfaces with signals. - Added signals for propagating changes in aspect ratio and scale mode from VideoOutput to VideoPlayer. - Removed VideoPlayer::getNativeWindowSystemHandles. Interaction with window system is moved into VideoOutput, so that VideoPlayer is better focussed on its main task: interacting with CVideoPlayerUtility. - WId changes, resize and move events received by the VideoOutput widget cause it to emit a videoWindowChanged signal. This is received by the VideoPlayer, which triggers a call to updateVideoRect. The main task of this function is to calculate the scale factors which are provided to the MMF via CVideoPlayerUtility::SetScaleFactorL. Note that: i) This function must be called both before and after the call to SetDisplayWindowL. For changes in aspect ratio or scale mode, setting the scale mode after updating the display window is sufficient. However, testing showed that, when switching in or out of full-screen mode, two calls were necessary in order to preserve the correct aspect ratio. ii) The screen rectangle passed to the MMF is still the full window extent; it is not the region in which video will actually be rendered. The post-processor will fill in the remainder of the window with a background colour (typically black). If, on the other hand, we passed in the actual video display rectangle, we would need to do this background painting in the widget. This in turn would require a change to QtGui: at present, we can only disable blitting on a per-widget basis (by setting QWExtra::disableBlit). If we needed to paint the borders of the video window, disableBlit would need to contain the actual DSA region, rather than just a single boolean flag. Task-number: QTBUG-5585 Reviewed-by: Frans Englich
* Implemented metadata handling in Phonon MMF backendGareth Stockwell2009-11-041-1/+2
| | | | | Task-number: QTBUG-4662 Reviewed-by: Frans Englich
* Improve error handling.Frans Englich2009-10-231-2/+7
| | | | | | | | | | | | | Errors reported via: * the DummyPlayer didn't work due to it not doing the usual state transitions/emission * MediaObject::setSource() due to errors being emitted before connections being set up. * A general state bug. Task-number: QTBUG-4752 Reviewed-by: Gareth Stockwell
* Remove trailing whitespace.Frans Englich2009-10-151-3/+3
|
* Fixed compilation error and one warning, when building with RVCTGareth Stockwell2009-09-301-1/+1
|
* Merge branch 'mmfphonon' of scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Frans Englich2009-09-291-1/+6
|\ | | | | | | | | | | | | mmfphonon Conflicts: src/3rdparty/phonon/mmf/abstractplayer.cpp
| * Fixed problem which caused playback to always start at default volume.Gareth Stockwell2009-09-291-1/+6
| | | | | | | | Volume changes made before playback starts are now correctly propagated.
* | Changes for fixing media object.Frans Englich2009-09-291-3/+43
|/ | | | | | | | | | | This brings tst_MediaObject to 15/7, from previously not running. Changes involves: * Skipping .qrc related tests * Loading/mimetype detction from file:/ URIs * State fixes * As part of previous point, move state and error handling down in AbstractPlayer.
* Improve signal connections between MediaObject and AbstractPlayer.Frans Englich2009-09-091-0/+8
| | | | | MediaObject deals with an AbstractPlayer, so make sure we have the signals declared in that base class, instead of individually in each sub-class.
* Work on extending the framework for accomodating effects.Frans Englich2009-09-091-2/+2
| | | | | | | | | This extends the framework for being able to handle audio effects, largely affecting how the audio chain is set up, connected and disconnected, and therefore the Backend has been refactored slightly, and the class MediaNode introduced, see its documentation. In addition two effects has been written: BassBoost and AudioEqualizer.
* Reformatted code to comply with Qt styleGareth Stockwell2009-08-281-71/+71
|
* Wrapped code using QT_BEGIN/END_NAMESPACE macrosGareth Stockwell2009-08-281-0/+4
|
* Implemented connection between MediaOutput and VideoWidgetGareth Stockwell2009-08-211-3/+15
| | | | | Video is still not visible; need to debug the initialization of the VideoOutput object to determine whether DSA is being aborted.
* Further tidied up volume handlingGareth Stockwell2009-08-211-12/+6
|
* Implemented parameter copying between AbstractPlayer instancesGareth Stockwell2009-08-201-9/+30
|
* Added VolumeControlInterface to abstract details of path between MediaObject ↵Gareth Stockwell2009-08-201-8/+15
| | | | and AudioOutput
* Merged in DummyPlayer changesGareth Stockwell2009-08-191-2/+1
|\
| * Add the DummyPlayer, as discussed with Gareth.Frans Englich2009-08-181-2/+1
| |
* | Refactored AudioPlayer and VideoPlayer to separate out common code into ↵Gareth Stockwell2009-08-181-0/+4
|/ | | | AbstractMediaPlayer
* Merged recognizer changes with abstraction for audio / video playback.Gareth Stockwell2009-08-181-1/+9
| | | | | | | | | | | | | | Audio playback now working to the same extent as prior to the abstraction, with one regression: the initial volume level in the UI is set to zero, although playback is audible. Some cleanup is required: - Functionality common to AudioPlayer and VideoPlayer (e.g. tick timer, changeState function) should be moved into AbstractPlayer. - Files may be opened by multiple instances of MediaObject at at time. For example, the musicplayer example app uses one instance to read file metadata, and one for the actual playback. In order to avoid KErrInUse errors from the file server, files must be opened with an EShare* flag and passed around by handle. At present this is done in a slightly hacky way (i.e. AbstractPlayer::setSource is renamed to setFileSource). - The pointer held by MediaObject::m_player must be checked for nullness in many of the public API calls. This could be made cleaner by implementing a stub derivation of AbstractPlayer, which returns sensible default values. Note that, if functionality such as tick timer handling is going to be pushed upwards from AudioPlayer / VideoPlayer, we should add an intermediate class to the hierarchy so that the overhead of constructing DummyPlayer objects is minimised. At present, media type (audio / video) is only recognised from file streams - this needs to be extended to include HTTP streaming aswell.
* More delegation, basic plumbing.Frans Englich2009-08-171-3/+1
|
* Delegate from MediaObject.Frans Englich2009-08-171-0/+13
|
* Refactor the media object such that we can do both video and sound.Frans Englich2009-08-171-0/+53
As per discussions with Gareth.