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: sl@0: #ifndef DEVVIDEOCLIENTBUFFERSUPPORT_H sl@0: #define DEVVIDEOCLIENTBUFFERSUPPORT_H sl@0: sl@0: #include sl@0: sl@0: class TVideoFrameBuffer; sl@0: sl@0: /** sl@0: DevVideo Client Buffer Support Custom Interface UID. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: const TUid KUidMMFVideoClientBufferSupport = { 0x10283417 }; sl@0: sl@0: /** sl@0: In implementations where the controller creates and manages surfaces, this sl@0: DevVideo custom interface lets the decoder decode into those client-supplied sl@0: surface buffers. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class MMMFVideoClientBufferSupport sl@0: { sl@0: public: sl@0: /** sl@0: Enables client buffer mode. This method must be called before Initialize() with sl@0: aClientBuffers=ETrue to use client-supplied buffers. When client-supplied buffers sl@0: are used the decoder will not allocate output buffers, but will instead expect to sl@0: receive them from the client using MvcbsSupplyBuffer(). sl@0: sl@0: @param aClientBuffers ETrue to enable using client-supplied buffers, EFalse to sl@0: disable this. sl@0: */ sl@0: virtual void MvcbsUseClientBuffers(TBool aClientBuffers) = 0; sl@0: sl@0: /** sl@0: Supplies a buffer to be used for decoder output. The decoder will decode a sl@0: picture into the buffer and return it to the client through the standard sl@0: DevVideoPlay data flow (MdvppNewPicture() and NextPictureL()). The client can sl@0: identify the buffer by comparing TVideoPicture.iData.iRawData in the output sl@0: picture to TVideoFrameBuffer.Buffer() in the supplied buffer. sl@0: sl@0: Clients can queue multiple buffers in a decoder by calling this method several sl@0: times before receiving output pictures. sl@0: sl@0: The client must call ReturnPicture() for each decoder output picture even when sl@0: using client-supplied buffers, since the decoder must still be able to free other sl@0: DevVideo-related data structures such as the TVideoPicture object itself. sl@0: sl@0: @param aBuffer A TVideoFrameBuffer structure describing the buffer. The buffer sl@0: must remain accessible and the reference valid until the client receives the sl@0: buffer through NextPictureL() or calls MvcbsReleaseBuffers(). sl@0: */ sl@0: virtual void MvcbsSupplyBuffer(TVideoFrameBuffer& aBuffer) = 0; sl@0: sl@0: /** sl@0: Requests the decoder to release all buffers previously supplied with sl@0: MvcbsSupplyBuffer() but not yet used. The decoder must synchronously stop using sl@0: any such buffers before returning from this method. sl@0: sl@0: This method is typically used when the client must delete a surface unexpectedly. sl@0: sl@0: Note that decoded buffers may also be buffered in DevVideoPlay. Therefore, in sl@0: addition to calling this method the client must also receive all decoded pictures sl@0: from DevVideoPlay by calling NextPictureL() repeatedly until no more pictures are sl@0: available. sl@0: */ sl@0: virtual void MvcbsReleaseBuffers() = 0; sl@0: }; sl@0: sl@0: #endif // DEVVIDEOCLIENTBUFFERSUPPORT_H