sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H sl@0: #define DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: DevVideo Surface Support Custom Interface UID. sl@0: sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: const TUid KUidMMFVideoSurfaceSupport = { 0x1028340E }; sl@0: sl@0: /** sl@0: Video graphics surface change observer that is used with the MMMFVideoSurfaceSupport sl@0: custom interface. Controllers or other DevVideo clients using that custom interface sl@0: must implement this observer interface. sl@0: sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: class MMMFVideoSurfaceObserver sl@0: { sl@0: public: sl@0: /** sl@0: Video surface created. The media device calls this method when a surface has been created sl@0: after (1) a surface has been created after a play command and the first frame for the stream sl@0: has been passed to the surface, and (2) when an existing surface that has already been created sl@0: by the media device is to be replaced with a new surface also created by the mdeai device. MMF sl@0: controllers typically send a KMMFEventCategoryVideoSurfaceCreated event to the client utility sl@0: when they receive this callback. sl@0: */ sl@0: virtual void MmvsoSurfaceCreated() = 0; sl@0: sl@0: /** sl@0: Video surface parameters changed. The client must get the updated surface parameters with sl@0: MmvssGetSurfaceParametersL() and recalculate its display layout. MMF controllers typically sl@0: send a KMMFEventCategoryVideoSurfaceParametersChanged event to the client utility when sl@0: they receive this callback. sl@0: */ sl@0: virtual void MmvsoSurfaceParametersChanged() = 0; sl@0: sl@0: /** sl@0: The client must remove the video surface. The media device calls this callback when the surface sl@0: needs to be replaced. This typically happens if the video picture size changes too much to fit in sl@0: existing surface buffers. sl@0: sl@0: The client must remove all surfaces from its current windows and when it has done so must call sl@0: MmvssSurfaceRemovedL(). sl@0: sl@0: MMF controllers typically send a KMMFEventCategoryVideoRemoveSurface event to the client sl@0: utility when they receive this callback and let the client utility remove the surface. sl@0: */ sl@0: virtual void MmvsoRemoveSurface() = 0; sl@0: }; sl@0: sl@0: /** sl@0: DevVideo custom interface. Video decoders and post-processor media devices sl@0: that support rendering to video surfaces implements this custom interface to sl@0: provide surface management support to the controller. Most of the methods in sl@0: this custom interface map directly to MMF custom commands, and controllers sl@0: typically implement the MMF custom commands using these methods. sl@0: sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: class MMMFVideoSurfaceSupport sl@0: { sl@0: public: sl@0: /** sl@0: Requests the media device to use graphics surfaces for video rendering. sl@0: The client must call this method before Initialize() to ensure the media sl@0: device allocates the right types of resources for rendering. sl@0: */ sl@0: virtual void MmvssUseSurfaces() = 0; sl@0: sl@0: /** sl@0: Sets a new video surface support observer to receive surface management events sl@0: from the media device. sl@0: sl@0: @param aObserver New observer object to use. sl@0: */ sl@0: virtual void MmvssSetObserver(MMMFVideoSurfaceObserver& aObserver) = 0; sl@0: sl@0: /** sl@0: Retrieves parameters for the current surface. The client typically calls this in response sl@0: to a MmvsoSurfaceCreated() or MmvsoSurfaceParametersChanged() observer callback. sl@0: sl@0: @param aSurfaceId sl@0: Surface ID for the display. sl@0: @param aCropRect sl@0: Cropping rectangle within the surface. The crop rectangle identifies the area of sl@0: the surface that should be shown on the screen. sl@0: @param aPixelAspectRatio sl@0: Video picture pixel aspect ratio. sl@0: sl@0: @leave KErrNotReady if no surface is available for the display. sl@0: */ sl@0: sl@0: virtual void MmvssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect, sl@0: TVideoAspectRatio& aPixelAspectRatio) = 0; sl@0: sl@0: /** sl@0: Indicates that the surface is no longer in use and can be destroyed. The client typically calls sl@0: this in response to MmvsoSurfaceCreated() (where the newly created surface is replacing an sl@0: existing one) or MmvsoRemoveSurface() observer callback. sl@0: sl@0: @param aSurfaceId Surface ID that is no longer in use sl@0: sl@0: @leave KErrNotFound if the surface does not exist sl@0: */ sl@0: virtual void MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId) = 0; sl@0: }; sl@0: sl@0: #endif // DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H