sl@0: // Copyright (c) 2002-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: // include\mmf\server\mmfvideoframebuffer.h
sl@0: // 
sl@0: //
sl@0: 
sl@0: 
sl@0: #ifndef __MMF_SERVER_VIDEOFRAMEBUFFER_H__
sl@0: #define __MMF_SERVER_VIDEOFRAMEBUFFER_H__
sl@0: 
sl@0: #include <e32base.h>
sl@0: #include <fbs.h>
sl@0: #include <mmf/server/mmfbuffer.h>
sl@0: 
sl@0: 
sl@0: /**
sl@0: @publishedAll
sl@0: @deprecated
sl@0: 
sl@0: Class to store a frame of video data using an EPOC bitmap (RGB data).
sl@0: */
sl@0: class CMMFBitmapFrameBuffer : public CMMFBuffer
sl@0: 	{
sl@0: public:
sl@0: 	IMPORT_C ~CMMFBitmapFrameBuffer();
sl@0: 	IMPORT_C static CMMFBitmapFrameBuffer* NewL(const TSize& aSize,TDisplayMode aDisplayMode);
sl@0: 	IMPORT_C static CMMFBitmapFrameBuffer* NewL(TInt aBitmapHandle);
sl@0: 	inline TUint BufferSize() const;
sl@0: 	inline CFbsBitmap* Data();
sl@0: private:
sl@0: 	CMMFBitmapFrameBuffer() : CMMFBuffer(KUidMmfBitmapFrameBuffer) {};
sl@0: 	void ConstructL();
sl@0: private:
sl@0: 	CFbsBitmap* iFrame;
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: Dummy implementation. Not applicable to bitmap frame data.
sl@0: 
sl@0: @return Always zero for bitmap frames
sl@0: */
sl@0: inline TUint CMMFBitmapFrameBuffer::BufferSize() const
sl@0: 	{
sl@0: 	return 0; //Not applicable to bitmap
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: Retrieves the frame data.
sl@0: 
sl@0: @return A pointer to a bitmap containing the frame data.
sl@0: */
sl@0: inline CFbsBitmap* CMMFBitmapFrameBuffer::Data()
sl@0: 	{
sl@0: 	if (iFrame) return iFrame;
sl@0: 	else return NULL;
sl@0: 	}
sl@0: 
sl@0: 
sl@0: /**
sl@0: @publishedAll
sl@0: @deprecated
sl@0: 
sl@0: Class to store a frame of video data using YUV data instead of an EPOC bitmap.
sl@0: */
sl@0: class CMMFYUVBuffer : public CMMFBuffer
sl@0: 	{
sl@0: public:
sl@0: 	IMPORT_C static CMMFYUVBuffer* NewL();
sl@0: 	IMPORT_C ~CMMFYUVBuffer();
sl@0: 	inline TUint BufferSize() const;
sl@0: private:
sl@0: 	CMMFYUVBuffer() : CMMFBuffer(KUidMmfYUVBuffer) {};
sl@0: 	void ConstructL();
sl@0: public:
sl@0: 	/** The buffer to hold the YUV data */
sl@0: 	HBufC8* iYUVBuffer;
sl@0: 	/** The size of a pixel */
sl@0: 	TSize iPixelSize;
sl@0: private:
sl@0: 	};
sl@0: 
sl@0: /**
sl@0: Returns the buffer size.
sl@0: 
sl@0: @return The buffer size.
sl@0: */
sl@0: inline TUint CMMFYUVBuffer::BufferSize() const
sl@0: 	{
sl@0: 	return iYUVBuffer->Size();
sl@0: 	}
sl@0: 
sl@0: #endif