summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/videooutput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added support for video surfaces to Phonon MMF backendGareth Stockwell2010-03-181-303/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Suspend DSA while drawing is in progressGareth Stockwell2009-11-261-0/+16
| | | | | | | | | In order to prevent flicker or - on some versions of the platform - video disappearing from the screen altogether, the video controller's DSA session must be suspended while the window control is redrawn. Task-number: QTBUG-5467 Reviewed-by: Jason Barron
* Changed video widget native paint mode to zero-fill native windowGareth Stockwell2009-11-261-6/+1
| | | | | | | | | Certain S60 video stacks require the screen region in which video will be rendered to be painted with a zero brush (opaque black for EColor16MU displays; transparent black for EColor16MA / EColor16MAP). Task-number: QTBUG-5467 Reviewed-by: Jason Barron
* Merge commit 's60/4.6' into mmfphononFrans Englich2009-11-161-1/+1
|\
| * Merge branch '4.6-api-review' into 4.6Marius Storm-Olsen2009-11-091-1/+1
| |\
| | * API review: Rename numRects() -> rectCount()Marius Storm-Olsen2009-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | QRegion::numRects() is marked obsolete. Removed all usage of the old function inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* | | Implemented aspect ratio and scale mode handling in Phonon MMF backendGareth Stockwell2009-11-131-28/+107
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Video screen region is updated in response to ancestors of video widgetGareth Stockwell2009-10-231-3/+27
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | being moved. Because QWidget::moveEvent is only called when a widget moves relative to its parent, a widget's absolute screen position may change without it receiving a moveEvent (for example, as a result of its parent being moved). The MMF video playback API on Symbian v9.4 requires, in addition to a window handle, an absolute screen rectangle. Changes in the video widget's absolute screen position therefore need to be propagated into the MMF. This change introduces a new object, AncestorMoveMonitor, which installs an event filter on the QCoreApplication instance. A VideoOutput object registers with the AncestorMoveMonitor, which listens on its behalf for MoveEvents and ParentChangeEvents directed at any of the ancestors of the VideoOutput. MoveEvents trigger a callback to the VideoOutput instance, which then notifies the MMF of the new screen rectangle. ParentChangeEvents cause the AncestorMoveMonitor to update the ancestor list associated with the target VideoOutput instance. The video position now tracks that of the associated widget, but there are two problems which require further investigation: 1. The video window lags behind. This may be an unavoidable consequence of the fact that setting a new screen rectangle causes the MMF to tear down its DSA session and start a new one; this is known to block the window server and take some time to complete. 2. Artifacts are visible around the edges of the moving video widget. Task-number: QTBUG-4787 Reviewed-by: Frans Englich
* Replace tabs with whitespace.Frans Englich2009-10-151-10/+10
| | | | | sed -i -e 's/\t/ /g' `find -name "*.cpp" -or -name "*.h" -or -name "*.pro"`
* sed -i -e 's/if(/if (/g' `find -name "*.cpp" -or -name "*.h" -or -nameFrans Englich2009-10-151-1/+1
| | | | "*.pro"`
* Use QT_NO_DEBUG, not _DEBUG.Frans Englich2009-10-151-2/+2
|
* Modified video widget to respond to WinIdChange eventsGareth Stockwell2009-10-091-0/+11
| | | | | Task-number: QTBUG-4664 Reviewed-by: Frans Englich
* Refactored event-handling code in video widgetGareth Stockwell2009-10-091-12/+13
| | | | | | Moved common code into videoOutputRegionChanged() Reviewed-by: Frans Englich
* qdoc: Marked some undocumented Phonon classes internalMartin Smith2009-10-011-0/+4
|
* Revert "Disable code, as we don't have the required code in QtGui."Frans Englich2009-09-281-8/+6
| | | | This reverts commit 1062bbbcd6c30844d9ade10de80f27a3afd4dacf.
* Disable code, as we don't have the required code in QtGui.Frans Englich2009-09-241-6/+8
|
* Essentially do 's/NULL/0/g', to adhere to Qt coding style.Frans Englich2009-09-241-1/+1
| | | | Addresses review comment.
* Modified video widget to set disableBlit flagGareth Stockwell2009-09-231-0/+8
|
* Removed transparency-blitting / -painting code from video widgetGareth Stockwell2009-09-231-104/+1
|
* Experimenting to make video visible.Gareth Stockwell2009-09-231-3/+33
| | | | | | | | | | | | | | | | | | | | | | Removed the hack to set translucent window background in the mediaplayer. Then tried the following: 1. Direct write to backing store: does not work (backing bitmap is 16MU) 2. Set window background color: does not work (is over-written by control's Draw function) 3. Brush using CWindowGc from widget's paint event: does not work (is over-written by control's Draw function) 4. Hack QSymbianControl to blit a transparent bitmap from the Draw function: does work 5. Hack QSymbianControl to brush using CWindowGc from the Draw function: does work Configuration 5 is the one being committed. Other things we could try: 6. Trigger switch to 16MA backing store if child widgets have been created. This could be tested by calling RWindowTreeNode::Child on the TLW's window. - Maybe we could test whether the child window's display mode is 16MA? 7. Somehow tell QSymbianControl not to draw anything at all - Based on setting Qt::WA_PaintOnScreen? - Then we either: - (Ideally) do nothing, and rely on video stack to paint the necessary transparency - Brush using CWindowGc from widget's paint event
* Added extra trace for investigation of 16MU blitting behaviourGareth Stockwell2009-09-231-1/+16
|
* Removed temporary hacks used during initial development of video widgetGareth Stockwell2009-09-231-10/+0
|
* Modified transparentFill to allow RGBA color to be specified more easily, ↵Gareth Stockwell2009-09-231-2/+4
| | | | for testing
* Added function for writing transparent pixels directly to the backing storeGareth Stockwell2009-09-231-0/+47
| | | | | | See VideoOutput::transparentFill. This should be called from the paintEvent, having removed the TranslucentWindowBackground hack from the mediaplayer demo. As yet this has not been tested.
* Modified video output widget to make video visible on target deviceGareth Stockwell2009-09-231-6/+10
|
* Fixes to include paths, required due to objectdump renamingGareth Stockwell2009-09-151-1/+1
|
* Rename objectdump to mmfphonondebug in order to avoid conflicts.Frans Englich2009-09-141-1/+1
|
* Refactored object tree dumping framework into a separate DLLGareth Stockwell2009-09-071-1/+1
|
* Added visitor-based object tree dumping framework, which dumps details of ↵Gareth Stockwell2009-09-071-53/+20
| | | | Symbian control / window associated with each widget
* Merge branch 'mmfphonon' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into ↵Gareth Stockwell2009-09-011-12/+8
|\ | | | | | | mmfphonon
| * Reformatted code to comply with Qt styleGareth Stockwell2009-08-271-66/+60
| |
| * Wrapped code using QT_BEGIN/END_NAMESPACE macrosGareth Stockwell2009-08-271-6/+12
| |
* | Video playback now visible; flickering problems now observedGareth Stockwell2009-08-281-20/+10
| |
* | Added code to VideoOutput for painting the video region (currently commented ↵Gareth Stockwell2009-08-281-4/+5
| | | | | | | | out)
* | Experimenting to try and get video to be visibleGareth Stockwell2009-08-281-4/+13
| |
* | Reformatted code to comply with Qt styleGareth Stockwell2009-08-281-66/+60
| |
* | Wrapped code using QT_BEGIN/END_NAMESPACE macrosGareth Stockwell2009-08-281-6/+12
|/
* Wrapped VideoOuput::dump() in a macro for easier removal later onGareth Stockwell2009-08-261-1/+4
|
* Added VideoOutputObserver, to propagate screen region updates back to ↵Gareth Stockwell2009-08-261-1/+21
| | | | VideoPlayer
* Added a bit more tracing for debugging video visibilityGareth Stockwell2009-08-261-1/+2
|
* Made video playback visible using a couple of hacksGareth Stockwell2009-08-251-2/+67
| | | | | | | | | | | | These hacks, which are enabled using macros in defs.h, are: PHONON_MMF_HARD_CODE_VIDEO_RECT VideoPlayer should obtain the screen rectangle into which video rendering will occur, using the CoeControl associated with the video widget (i.e. the VideoOutput object). However, this control always has co-ordinates (relative to its parent) of (0,0)-(100,30), regardless of whether updateGeometry() and show() are called on the widget. So, this macro just hard-codes the screen rectangle to a value which works when the breakfast.mp4 clip is used for testing. PHONON_MMF_EXPLICITLY_SHOW_VIDEO_WIDGET In order that the video region does not overwrite the slider and buttons below it, the parent widget of the VideoObject instance must be appropriately re-sized. Debugging showed that both the parent and grandparent of VideoObject are in fact invisible at the time playback begins, so for now we just manually call show() on the grandparent. Clearly both of these are only temporary measures, for use until the underlying cause of the problem has been determined.
* Added some missing signals in MediaObject; fixed seek slider in musicplayer.exeGareth Stockwell2009-08-251-8/+12
|
* Modified video player to call updateGeometry on video display widget; having ↵Gareth Stockwell2009-08-251-2/+75
| | | | no effect at present
* Implemented connection between MediaOutput and VideoWidgetGareth Stockwell2009-08-211-2/+8
| | | | | 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-0/+45