os/mm/mmhais/videohai/devvideo/inc/devvideovideosurfacecustominterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmhais/videohai/devvideo/inc/devvideovideosurfacecustominterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,131 @@
     1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H
    1.20 +#define DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H
    1.21 +
    1.22 +#include <graphics/surface.h>
    1.23 +#include <mmf/common/mmfvideo.h>
    1.24 +
    1.25 +/** 
    1.26 +DevVideo Surface Support Custom Interface UID.
    1.27 +
    1.28 +@publishedPartner
    1.29 +@prototype
    1.30 +*/
    1.31 +const TUid KUidMMFVideoSurfaceSupport = { 0x1028340E };
    1.32 +
    1.33 +/**
    1.34 +Video graphics surface change observer that is used with the MMMFVideoSurfaceSupport 
    1.35 +custom interface. Controllers or other DevVideo clients using that custom interface 
    1.36 +must implement this observer interface.
    1.37 +
    1.38 +@publishedPartner
    1.39 +@prototype
    1.40 +*/
    1.41 +class MMMFVideoSurfaceObserver
    1.42 +    {
    1.43 +public:
    1.44 +    /** 
    1.45 +    Video surface created. The media device calls this method when a surface has been created 
    1.46 +    after (1) a surface has been created after a play command and the first frame for the stream
    1.47 +    has been passed to the surface, and (2) when an existing surface that has already been created
    1.48 +    by the media device is to be replaced with a new surface also created by the mdeai device. MMF
    1.49 +    controllers typically send a KMMFEventCategoryVideoSurfaceCreated event to the client utility
    1.50 +    when they receive this callback.
    1.51 +    */
    1.52 +    virtual void MmvsoSurfaceCreated() = 0;
    1.53 +    
    1.54 +    /** 
    1.55 +    Video surface parameters changed. The client must get the updated surface parameters with 
    1.56 +    MmvssGetSurfaceParametersL() and recalculate its display layout. MMF controllers typically 
    1.57 +    send a KMMFEventCategoryVideoSurfaceParametersChanged event to the client utility when 
    1.58 +    they receive this callback.
    1.59 +    */
    1.60 +    virtual void MmvsoSurfaceParametersChanged() = 0;
    1.61 +    
    1.62 +    /** 
    1.63 +    The client must remove the video surface. The media device calls this callback when the surface
    1.64 +    needs to be replaced. This typically happens if the video picture size changes too much to fit in 
    1.65 +    existing surface buffers.
    1.66 +    
    1.67 +	The client must remove all surfaces from its current windows and when it has done so must call
    1.68 +	MmvssSurfaceRemovedL().
    1.69 +	
    1.70 +	MMF controllers typically send a KMMFEventCategoryVideoRemoveSurface event to the client 
    1.71 +	utility when they receive this callback and let the client utility remove the surface.
    1.72 +    */
    1.73 +    virtual void MmvsoRemoveSurface() = 0;
    1.74 +    };
    1.75 +
    1.76 +/**
    1.77 +DevVideo custom interface. Video decoders and post-processor media devices 
    1.78 +that support rendering to video surfaces implements this custom interface to 
    1.79 +provide surface management support to the controller. Most of the methods in 
    1.80 +this custom interface map directly to MMF custom commands, and controllers 
    1.81 +typically implement the MMF custom commands using these methods.
    1.82 +
    1.83 +@publishedPartner
    1.84 +@prototype
    1.85 +*/
    1.86 +class MMMFVideoSurfaceSupport
    1.87 +    {
    1.88 +public:
    1.89 +	/** 
    1.90 +    Requests the media device to use graphics surfaces for video rendering. 
    1.91 +    The client must call this method before Initialize() to ensure the media 
    1.92 +    device allocates the right types of resources for rendering.
    1.93 +    */
    1.94 +    virtual void MmvssUseSurfaces() = 0;
    1.95 +    
    1.96 +    /** 
    1.97 +    Sets a new video surface support observer to receive surface management events 
    1.98 +    from the media device.
    1.99 +     
   1.100 +    @param aObserver New observer object to use.
   1.101 +    */
   1.102 +    virtual void MmvssSetObserver(MMMFVideoSurfaceObserver& aObserver) = 0;
   1.103 +  
   1.104 +    /** 
   1.105 +    Retrieves parameters for the current surface. The client typically calls this in response 
   1.106 +    to a MmvsoSurfaceCreated() or MmvsoSurfaceParametersChanged() observer callback.
   1.107 +
   1.108 +	@param  aSurfaceId
   1.109 +	        Surface ID for the display.
   1.110 +	@param  aCropRect
   1.111 +	        Cropping rectangle within the surface. The crop rectangle identifies the area of 
   1.112 +	        the surface that should be shown on the screen.
   1.113 +	@param  aPixelAspectRatio
   1.114 +	        Video picture pixel aspect ratio.
   1.115 +
   1.116 +	@leave KErrNotReady if no surface is available for the display.
   1.117 +    */
   1.118 +    
   1.119 +    virtual void MmvssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect, 
   1.120 +    					TVideoAspectRatio& aPixelAspectRatio) = 0;
   1.121 +
   1.122 +    /** 
   1.123 +    Indicates that the surface is no longer in use and can be destroyed. The client typically calls
   1.124 +    this in response to MmvsoSurfaceCreated() (where the newly created surface is replacing an
   1.125 +    existing one) or MmvsoRemoveSurface() observer callback.  
   1.126 +         
   1.127 +    @param aSurfaceId Surface ID that is no longer in use
   1.128 +    
   1.129 +    @leave KErrNotFound if the surface does not exist
   1.130 +    */
   1.131 +    virtual void MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId) = 0;
   1.132 +    };	
   1.133 +
   1.134 +#endif // DEVVIDEOVIDEOSURFACECUSTOMINTERFACE_H