summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/mediaobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Phonon MMF: Emit tick() signalGareth Stockwell2010-04-151-0/+1
| | | | | | | Fixes testTickSignal step in tst_mediaobject. Task-number: QTBUG-9339 Reviewed-by: Frans Englich
* Phonon MMF: Emit prefinishMarkReached(), finished() signalsGareth Stockwell2010-04-151-2/+14
| | | | | | | Fixes testPrefinishMark step in tst_mediaobject. Task-number: QTBUG-9339 Reviewed-by: Frans Englich
* Added support for video surfaces to Phonon MMF backendGareth Stockwell2010-03-181-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Delayed creation of audio effect object until audio is initializedGareth Stockwell2010-01-111-0/+3
| | | | | | | | | | | | | | | | | | When applying effects to an audio stream, we must ensure that the MMF utility API (CMdaAudioPlayerUtility or CVideoPlayerUtility) instance has loaded a controller before calling attempting to create a CAudioEffect- derived object. If the controller has not been loaded, construction of the effect object will fail. Even if we mitigate against this, calling CAudioEffect::ApplyL() will only have an effect if there is a controller object - or more precisely, a DevSound instance - on which to apply the effect. This patch delays construction of the effect object until the MediaObject has transitioned out of the LoadingState, indicating that an underlying DevSound instance will have been created. Task-number: QTBUG-4659 Reviewed-by: Espen Riskedal
* Implemented node disconnection in Phonon MMF backendGareth Stockwell2009-12-081-6/+19
| | | | | Task-number: QTBUG-4663 Reviewed-by: Frans Englich
* Implemented support for playlist handling in Phonon MMF backendGareth Stockwell2009-12-081-24/+30
| | | | | | | | | | 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
* Added support for streaming playback to Phonon MMF backendGareth Stockwell2009-12-081-1/+4
| | | | | | | | | | | | | | | | Because the MIME type of the stream cannot always be deduced from the URL, we assume that it is a video stream. This is based on the assumption that the video controllers will be capable of parsing the container formats for audio-only, as well as video clips. Note that this assumption may not hold on all devices. Note that most implementations of the MMF client APIs do not support HTTP streaming (a.k.a. progressive download). The backend has therefore only been tested with RTSP streams - see the JIRA entry for further details. Task-number: QTBUG-4660 Reviewed-by: Frans Englich
* Added error strings to Phonon MMF backendGareth Stockwell2009-12-021-8/+4
| | | | | | | | | | 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
* Ran the script utils/normalizeOlivier Goffart2009-11-181-2/+2
| | | | Over src/ tools/ examples/ and demos/
* Implemented aspect ratio and scale mode handling in Phonon MMF backendGareth Stockwell2009-11-131-5/+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-0/+1
| | | | | Task-number: QTBUG-4662 Reviewed-by: Frans Englich
* Improve error handling.Frans Englich2009-10-231-5/+9
| | | | | | | | | | | | | 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-1/+1
|
* qdoc: Marked some undocumented Phonon classes internalMartin Smith2009-10-011-0/+4
|
* Fixed compilation error and one warning, when building with RVCTGareth Stockwell2009-09-301-8/+9
|
* Changes for fixing media object.Frans Englich2009-09-291-20/+20
| | | | | | | | | | | 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.
* Essentially do 's/NULL/0/g', to adhere to Qt coding style.Frans Englich2009-09-241-2/+2
| | | | Addresses review comment.
* Rename videoplayer, to avoid clash with Symbian's headers.Frans Englich2009-09-231-1/+1
|
* Fixed problems with compiling for ARMV5Gareth Stockwell2009-09-101-2/+2
| | | | | | - Forward declaration of QScopedPointer containee type was causing an error - Audio effect libraries were declared in the .pro file as e.g. -lBassBoostEffect.lib, causing toolchain to try to link statically - Added several missing MMF:: namespace qualifiers
* Make the MediaObject propagation generic for all kinds of nodes.Frans Englich2009-09-091-29/+3
| | | | | Previously the MediaObject propagation was only done for effects, but now it's for all kinds of nodes. This is needed for AudioOutput.
* Work on extending the framework for accomodating effects.Frans Englich2009-09-091-3/+43
| | | | | | | | | 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.
* Modified file-loading code to use QDir::toNativeSeparatorsGareth Stockwell2009-09-071-1/+4
|
* Reformatted code to comply with Qt styleGareth Stockwell2009-08-281-184/+159
|
* Wrapped code using QT_BEGIN/END_NAMESPACE macrosGareth Stockwell2009-08-281-0/+3
|
* Removed over-riding signal declaration from VideoPlayer.Gareth Stockwell2009-08-261-6/+6
| | | | | | | | This was causing the stateChanged signal not to propagate up to the Phonon client. In the case of the mediaplayer demo, this causes the app not to show() the ancestor of the VideoWidget, resulting in the layout not being updated when the clip has been loaded. This means that the hack to explicitly call show() on this ancestor from the backend has been removed. Now the layout is correctly updated, but the size of VideoOutput::winId()->Rect() is still incorrect, so the hack to hard-code the screen rectangle passed to CVideoPlayerUtility is left in place.
* Added some missing signals in MediaObject; fixed seek slider in musicplayer.exeGareth Stockwell2009-08-251-1/+21
|
* Implemented Backend::availableMimeTypesGareth Stockwell2009-08-251-23/+3
|
* Implemented connection between MediaOutput and VideoWidgetGareth Stockwell2009-08-211-0/+10
| | | | | 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-8/+4
|
* Tidied up trace statementsGareth Stockwell2009-08-211-0/+17
|
* Started fleshing out the VideoPlayer implementationGareth Stockwell2009-08-201-2/+2
| | | | | | Now loads, prepares and plays a clip, but the video is not visible because it's not yet wired up to a VideoWidget. Video 'playback' can be tested using the demos/mediaplayer application, but the menus are not displayed properly, so a video clip filename must be hardcoded in main.cpp and passed to the MediaPlayer constructor.
* Implemented parameter copying between AbstractPlayer instancesGareth Stockwell2009-08-201-4/+35
|
* Added VolumeControlInterface to abstract details of path between MediaObject ↵Gareth Stockwell2009-08-201-5/+1
| | | | and AudioOutput
* Tidying up: removing commented-out codeGareth Stockwell2009-08-191-13/+0
|
* Merged in DummyPlayer changesGareth Stockwell2009-08-191-135/+45
|\
| * Add the DummyPlayer, as discussed with Gareth.Frans Englich2009-08-181-123/+31
| |
* | Started work on VideoPlayer implementationGareth Stockwell2009-08-181-30/+50
|/
* Merged recognizer changes with abstraction for audio / video playback.Gareth Stockwell2009-08-181-482/+215
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Rename mmf_videoplayer back to videoplayer, apparently the includes can beFrans Englich2009-08-171-1/+1
| | | | | | | | resolved anyway.
| * More delegation, basic plumbing.Frans Englich2009-08-171-1/+18
| |
| * Delegate from MediaObject.Frans Englich2009-08-171-1/+24
| |
| * Refactor the media object such that we can do both video and sound.Frans Englich2009-08-171-497/+2
| | | | | | | | As per discussions with Gareth.
* | Added recognizer code to determine if file is audio or videoGareth Stockwell2009-08-171-0/+58
|/
* Commit patch by Gareth.Frans Englich2009-08-121-70/+453
| | | | | The patch originally contained all changed done to MMF Phonon, but this commit contains the changes only Gareth did.
* Work.Frans Englich2009-07-211-10/+20
|
* Build fixes, debug code.Frans Englich2009-07-131-32/+32
|
* Pouring.Frans Englich2009-07-031-22/+76
|
* Pouring.Frans Englich2009-07-021-0/+184