Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef MMFVIDEOSURFACECUSTOMCOMMANDS_H
17 #define MMFVIDEOSURFACECUSTOMCOMMANDS_H
19 #include <mmf/common/mmfcontroller.h>
20 #include <mmf/common/mmfvideo.h>
21 #include <graphics/surface.h>
27 const TUid KUidInterfaceMMFVideoPlaySurfaceSupport = {0x1028340D};
33 The controller sends this event when (1) a surface has been created after a play command and
34 the first frame for the stream has been passed to the surface, and (2) when an existing surface
35 should be replaced with a newly created surface.
37 const TUid KMMFEventCategoryVideoSurfaceCreated = { 0x1028340F };
43 const TUid KMMFEventCategoryVideoSurfaceParametersChanged = { 0x10283410 };
49 The controller sends this event when a surface must be replaced with another surface
50 but there are not enough resources to have both created at the same time. The client
51 utility must respond with MvpssSurfaceRemovedL() command.
53 const TUid KMMFEventCategoryVideoRemoveSurface = { 0x10283411 };
59 Mixin class for the custom commands implemented by the controller. The custom command parser calls
60 methods in this class to deliver the requests to the controller.
62 class MMMFVideoPlaySurfaceSupportCustomCommandImplementor
67 Enables using graphics surfaces for video playback.
69 An interface implemented by either the decoder or the controller.
71 virtual void MvpssUseSurfacesL() = 0;
74 Gets surface parameters.
76 An interface implemented by either the decoder or the controller.
79 Surface id of the current surface.
81 Cropping rectangle within the surface. The crop rectangle identifies the area of
82 the surface that should be shown on the screen.
83 @param aPixelAspectRatio
84 Video picture pixel aspect ratio.
86 virtual void MvpssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect,
87 TVideoAspectRatio& aPixelAspectRatio) = 0;
90 Informs the controller that the surface is no longer in use and can
93 An interface implemented by either the decoder or the controller.
96 Surface that has been removed and can be destroyed.
98 virtual void MvpssSurfaceRemovedL(const TSurfaceId& aSurfaceId) = 0;
106 Custom command parser class to be used by controller plugins wishing to support video surface play
109 The controller plugin must be derived from MMMFVideoPlaySurfaceSupportCustomCommandImplementor to use
110 this class. The controller plugin should create an object of this type and add it to the list of
111 custom command parsers in the controller framework.
114 class CMMFVideoPlaySurfaceSupportCustomCommandParser : public CMMFCustomCommandParserBase
119 Creates a new custom command parser capable of handling video surface support commands.
122 A reference to the controller plugin that owns this new object.
124 @return A pointer to the object created.
127 IMPORT_C static CMMFVideoPlaySurfaceSupportCustomCommandParser* NewL(MMMFVideoPlaySurfaceSupportCustomCommandImplementor& aImplementor);
133 IMPORT_C ~CMMFVideoPlaySurfaceSupportCustomCommandParser();
136 Handles a request from the client. Called by the controller framework.
139 The message to be handled.
142 void HandleRequest(TMMFMessage& aMessage);
148 A reference to the controller plugin that owns this new object.
151 CMMFVideoPlaySurfaceSupportCustomCommandParser(MMMFVideoPlaySurfaceSupportCustomCommandImplementor& aImplementor);
152 // Internal request handling methods.
153 void DoHandleRequestL(TMMFMessage& aMessage);
154 TBool DoUseSurfacesL(TMMFMessage& aMessage);
155 TBool DoGetSurfaceParametersL(TMMFMessage& aMessage);
156 TBool DoSurfaceRemovedL(TMMFMessage& aMessage);
160 The object that implements the video surface support interface
162 MMMFVideoPlaySurfaceSupportCustomCommandImplementor& iImplementor;
169 Client class to access functionality specific to a video surface support playback controller.
171 The class uses the custom command function of the controller plugin, and removes the necessity
172 for the client to formulate the custom commands.
174 class RMMFVideoPlaySurfaceSupportCustomCommands : public RMMFCustomCommandsBase
182 The client side controller object to be used by this custom command interface.
184 IMPORT_C RMMFVideoPlaySurfaceSupportCustomCommands(RMMFController& aController);
187 Enables using graphics surfaces for video playback.
189 Instructs the controller to use graphics surfaces as destination. Note that direct screen
190 access and graphics surface use is mutually exclusive, enabling one will disable the other.
192 @return KErrNone if successful. KErrNotSupported if graphic surfaces are not supported by the
193 controller or otherwise one of the system wide error codes.
195 IMPORT_C TInt UseSurfaces() const;
198 Gets the surface parameters for a display.
200 The client utility typically calls this in response to KMMFEventCategoryVideoSurfaceCreated and
201 KMMFEventCategoryVideoSurfaceParametersChanged events to retrieve new or updated surface
202 information for a display.
205 Surface id of the current surface.
207 Cropping rectangle within the surface. The crop rectangle identifies the area of
208 the surface that should be shown on the screen.
209 @param aPixelAspectRatio
210 Video picture pixel aspect ratio.
212 @return KErrNone if successful. KErrNotSupported if graphic surfaces are not supported by the
213 controller or KErrNotReady if no surface is available for the display or otherwise one of the
214 system wide error codes.
216 IMPORT_C TInt GetSurfaceParameters(TSurfaceId& aSurfaceId, TRect& aCropRect, TVideoAspectRatio& aPixelAspectRatio) const;
219 Indicates that the surface is no longer in use and can be destroyed.
221 The client utility typically calls this in response to either:
223 KMMFEventCategoryVideoSurfaceCreated - when a surface is already registered with the utility. This
224 indicates that the client utility should stop using the current surface and use the one supplied
225 in the notification. When the client utility is no longer using the current surface it calls
228 KMMFEventCategoryVideoRemoveSurface - when the current surface should be removed. This indicates
229 that the client utility should stop using the current surface immediately. When the client utility
230 is no longer using the current surface it calls SurfaceRemoved()
233 Surface which is no longer being used by client utility.
235 @return KErrNone if successful. KErrNotSupported if graphic surfaces are not supported by the
236 controller or KErrNotReady if no surface is available for the display or otherwise one of the
237 system wide error codes.
239 IMPORT_C TInt SurfaceRemoved(TSurfaceId& aSurfaceId) const;
243 #endif // MMFVIDEOSURFACECUSTOMCOMMANDS_H