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