os/mm/mmhais/videohai/devvideo/inc/devvideoclientbuffersupport.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 #ifndef DEVVIDEOCLIENTBUFFERSUPPORT_H
    18 #define DEVVIDEOCLIENTBUFFERSUPPORT_H
    19 
    20 #include <e32def.h>
    21 
    22 class TVideoFrameBuffer;
    23 
    24 /** 
    25 DevVideo Client Buffer Support Custom Interface UID.
    26 
    27 @publishedPartner
    28 @released
    29 */
    30 const TUid KUidMMFVideoClientBufferSupport = { 0x10283417 };
    31 
    32 /**
    33 In implementations where the controller creates and manages surfaces, this
    34 DevVideo custom interface lets the decoder decode into those client-supplied
    35 surface buffers.
    36 
    37 @publishedPartner
    38 @released
    39 */
    40 class MMMFVideoClientBufferSupport
    41 	{
    42 public:
    43 	/**
    44 	Enables client buffer mode. This method must be called before Initialize() with
    45 	aClientBuffers=ETrue to use client-supplied buffers. When client-supplied buffers
    46 	are used the decoder will not allocate output buffers, but will instead expect to
    47 	receive them from the client using MvcbsSupplyBuffer().
    48 	
    49 	@param aClientBuffers ETrue to enable using client-supplied buffers, EFalse to
    50 	disable this.
    51 	*/
    52 	virtual void MvcbsUseClientBuffers(TBool aClientBuffers) = 0;
    53 	
    54 	/**
    55 	Supplies a buffer to be used for decoder output. The decoder will decode a
    56 	picture into the buffer and return it to the client through the standard
    57 	DevVideoPlay data flow (MdvppNewPicture() and NextPictureL()). The client can
    58 	identify the buffer by comparing TVideoPicture.iData.iRawData in the output
    59 	picture to TVideoFrameBuffer.Buffer() in the supplied buffer.
    60 	
    61 	Clients can queue multiple buffers in a decoder by calling this method several
    62 	times before receiving output pictures.
    63 	
    64 	The client must call ReturnPicture() for each decoder output picture even when
    65 	using client-supplied buffers, since the decoder must still be able to free other
    66 	DevVideo-related data structures such as the TVideoPicture object itself.
    67 	
    68 	@param aBuffer A TVideoFrameBuffer structure describing the buffer. The buffer
    69 	must remain accessible and the reference valid until the client receives the
    70 	buffer through NextPictureL() or calls MvcbsReleaseBuffers().
    71 	*/
    72 	virtual void MvcbsSupplyBuffer(TVideoFrameBuffer& aBuffer) = 0;
    73 	
    74 	/**
    75 	Requests the decoder to release all buffers previously supplied with 
    76 	MvcbsSupplyBuffer() but not yet used. The decoder must synchronously stop using
    77 	any such buffers before returning from this method.
    78 	
    79 	This method is typically used when the client must delete a surface unexpectedly.
    80 
    81 	Note that decoded buffers may also be buffered in DevVideoPlay. Therefore, in
    82 	addition to calling this method the client must also receive all decoded pictures
    83 	from DevVideoPlay by calling NextPictureL() repeatedly until no more pictures are
    84 	available.
    85 	*/
    86 	virtual void MvcbsReleaseBuffers() = 0;
    87 	};
    88 
    89 #endif // DEVVIDEOCLIENTBUFFERSUPPORT_H