mmhais/videohai/devvideo/inc/devvideovideosurfacecustominterface.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H
       
    17 #define DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H
       
    18 
       
    19 #include <graphics/surface.h>
       
    20 #include <mmf/common/mmfvideo.h>
       
    21 
       
    22 /** 
       
    23 DevVideo Surface Support Custom Interface UID.
       
    24 
       
    25 @publishedPartner
       
    26 @prototype
       
    27 */
       
    28 const TUid KUidMMFVideoSurfaceSupport = { 0x1028340E };
       
    29 
       
    30 /**
       
    31 Video graphics surface change observer that is used with the MMMFVideoSurfaceSupport 
       
    32 custom interface. Controllers or other DevVideo clients using that custom interface 
       
    33 must implement this observer interface.
       
    34 
       
    35 @publishedPartner
       
    36 @prototype
       
    37 */
       
    38 class MMMFVideoSurfaceObserver
       
    39     {
       
    40 public:
       
    41     /** 
       
    42     Video surface created. The media device calls this method when a surface has been created 
       
    43     after (1) a surface has been created after a play command and the first frame for the stream
       
    44     has been passed to the surface, and (2) when an existing surface that has already been created
       
    45     by the media device is to be replaced with a new surface also created by the mdeai device. MMF
       
    46     controllers typically send a KMMFEventCategoryVideoSurfaceCreated event to the client utility
       
    47     when they receive this callback.
       
    48     */
       
    49     virtual void MmvsoSurfaceCreated() = 0;
       
    50     
       
    51     /** 
       
    52     Video surface parameters changed. The client must get the updated surface parameters with 
       
    53     MmvssGetSurfaceParametersL() and recalculate its display layout. MMF controllers typically 
       
    54     send a KMMFEventCategoryVideoSurfaceParametersChanged event to the client utility when 
       
    55     they receive this callback.
       
    56     */
       
    57     virtual void MmvsoSurfaceParametersChanged() = 0;
       
    58     
       
    59     /** 
       
    60     The client must remove the video surface. The media device calls this callback when the surface
       
    61     needs to be replaced. This typically happens if the video picture size changes too much to fit in 
       
    62     existing surface buffers.
       
    63     
       
    64 	The client must remove all surfaces from its current windows and when it has done so must call
       
    65 	MmvssSurfaceRemovedL().
       
    66 	
       
    67 	MMF controllers typically send a KMMFEventCategoryVideoRemoveSurface event to the client 
       
    68 	utility when they receive this callback and let the client utility remove the surface.
       
    69     */
       
    70     virtual void MmvsoRemoveSurface() = 0;
       
    71     };
       
    72 
       
    73 /**
       
    74 DevVideo custom interface. Video decoders and post-processor media devices 
       
    75 that support rendering to video surfaces implements this custom interface to 
       
    76 provide surface management support to the controller. Most of the methods in 
       
    77 this custom interface map directly to MMF custom commands, and controllers 
       
    78 typically implement the MMF custom commands using these methods.
       
    79 
       
    80 @publishedPartner
       
    81 @prototype
       
    82 */
       
    83 class MMMFVideoSurfaceSupport
       
    84     {
       
    85 public:
       
    86 	/** 
       
    87     Requests the media device to use graphics surfaces for video rendering. 
       
    88     The client must call this method before Initialize() to ensure the media 
       
    89     device allocates the right types of resources for rendering.
       
    90     */
       
    91     virtual void MmvssUseSurfaces() = 0;
       
    92     
       
    93     /** 
       
    94     Sets a new video surface support observer to receive surface management events 
       
    95     from the media device.
       
    96      
       
    97     @param aObserver New observer object to use.
       
    98     */
       
    99     virtual void MmvssSetObserver(MMMFVideoSurfaceObserver& aObserver) = 0;
       
   100   
       
   101     /** 
       
   102     Retrieves parameters for the current surface. The client typically calls this in response 
       
   103     to a MmvsoSurfaceCreated() or MmvsoSurfaceParametersChanged() observer callback.
       
   104 
       
   105 	@param  aSurfaceId
       
   106 	        Surface ID for the display.
       
   107 	@param  aCropRect
       
   108 	        Cropping rectangle within the surface. The crop rectangle identifies the area of 
       
   109 	        the surface that should be shown on the screen.
       
   110 	@param  aPixelAspectRatio
       
   111 	        Video picture pixel aspect ratio.
       
   112 
       
   113 	@leave KErrNotReady if no surface is available for the display.
       
   114     */
       
   115     
       
   116     virtual void MmvssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect, 
       
   117     					TVideoAspectRatio& aPixelAspectRatio) = 0;
       
   118 
       
   119     /** 
       
   120     Indicates that the surface is no longer in use and can be destroyed. The client typically calls
       
   121     this in response to MmvsoSurfaceCreated() (where the newly created surface is replacing an
       
   122     existing one) or MmvsoRemoveSurface() observer callback.  
       
   123          
       
   124     @param aSurfaceId Surface ID that is no longer in use
       
   125     
       
   126     @leave KErrNotFound if the surface does not exist
       
   127     */
       
   128     virtual void MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId) = 0;
       
   129     };	
       
   130 
       
   131 #endif // DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H