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: // source\mmf\server\baseclasses\mmfvideoframebuffer.cpp sl@0: // sl@0: // sl@0: sl@0: #include "mmfvideoframebuffer.h" sl@0: sl@0: sl@0: /** sl@0: Factory function to create objects of type CMMFYUVBuffer used sl@0: to store a frame using YUV data. Allocates and constructs a YUV frame buffer. sl@0: sl@0: @return A pointer to a fully constructed CMMFYUVBuffer. sl@0: */ sl@0: EXPORT_C CMMFYUVBuffer* CMMFYUVBuffer::NewL() sl@0: { sl@0: CMMFYUVBuffer* self = new(ELeave) CMMFYUVBuffer; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); // self sl@0: return self; sl@0: } sl@0: sl@0: sl@0: void CMMFYUVBuffer::ConstructL() sl@0: { sl@0: } sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: EXPORT_C CMMFYUVBuffer::~CMMFYUVBuffer() sl@0: { sl@0: delete iYUVBuffer; sl@0: } sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: EXPORT_C CMMFBitmapFrameBuffer::~CMMFBitmapFrameBuffer() sl@0: { sl@0: if (iFrame) iFrame->Reset(); //release bitmap handle sl@0: delete iFrame; sl@0: } sl@0: sl@0: /** sl@0: Factory function to create objects of type CMMFBitmapFrameBuffer used sl@0: to store a frame an EPOC bitmap. sl@0: Allocates and constructs a bitmap frame buffer with the specified size sl@0: and display mode. sl@0: sl@0: @param aSize sl@0: The bitmap frame buffer size. sl@0: @param aDisplayMode sl@0: The display mode. sl@0: sl@0: @return A pointer to a fully constructed CMMFBitmapFrameBuffer. sl@0: */ sl@0: EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(const TSize& aSize,TDisplayMode aDisplayMode) sl@0: { sl@0: CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: User::LeaveIfError(self->iFrame->Create(aSize,aDisplayMode)); sl@0: CleanupStack::Pop(); // self sl@0: return self; sl@0: } sl@0: sl@0: /** sl@0: Factory function to create objects of type CMMFBitmapFrameBuffer used sl@0: to store a frame using an EPOC bitmap. sl@0: sl@0: @param aBitmapHandle sl@0: The handle to the bitmap from which to make a copy. sl@0: sl@0: @return A pointer to a fully constructed CMMFBitmapFrameBuffer. sl@0: */ sl@0: EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(TInt aBitmapHandle) sl@0: { sl@0: CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer; sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(); sl@0: User::LeaveIfError(self->iFrame->Duplicate(aBitmapHandle)); sl@0: CleanupStack::Pop(); // self sl@0: return self; sl@0: } sl@0: sl@0: void CMMFBitmapFrameBuffer::ConstructL() sl@0: { sl@0: iFrame = new(ELeave)CFbsBitmap; sl@0: }