mmlibs/mmfw/src/server/BaseClasses/mmfvideoframebuffer.cpp
changeset 0 b8ed18f6c07b
equal deleted inserted replaced
-1:000000000000 0:b8ed18f6c07b
       
     1 // Copyright (c) 2002-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 // source\mmf\server\baseclasses\mmfvideoframebuffer.cpp
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "mmfvideoframebuffer.h"
       
    19 
       
    20 
       
    21 /**
       
    22 Factory function to create objects of type CMMFYUVBuffer used
       
    23 to store a frame using YUV data. Allocates and constructs a YUV frame buffer.
       
    24 
       
    25 @return	A pointer to a fully constructed CMMFYUVBuffer.
       
    26 */
       
    27 EXPORT_C CMMFYUVBuffer* CMMFYUVBuffer::NewL()
       
    28 	{
       
    29 	CMMFYUVBuffer* self = new(ELeave) CMMFYUVBuffer;
       
    30 	CleanupStack::PushL(self);
       
    31 	self->ConstructL();
       
    32 	CleanupStack::Pop(); // self
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 
       
    37 void CMMFYUVBuffer::ConstructL()
       
    38 	{
       
    39 	}
       
    40 
       
    41 /**
       
    42 Destructor.
       
    43 */
       
    44 EXPORT_C CMMFYUVBuffer::~CMMFYUVBuffer()
       
    45 	{
       
    46 	delete iYUVBuffer;
       
    47 	}
       
    48 
       
    49 /**
       
    50 Destructor.
       
    51 */
       
    52 EXPORT_C CMMFBitmapFrameBuffer::~CMMFBitmapFrameBuffer()
       
    53 	{
       
    54 	if (iFrame) iFrame->Reset(); //release bitmap handle
       
    55 	delete iFrame;
       
    56 	}
       
    57 
       
    58 /**
       
    59 Factory function to create objects of type CMMFBitmapFrameBuffer used
       
    60 to store a frame an EPOC bitmap.
       
    61 Allocates and constructs a bitmap frame buffer with the specified size
       
    62 and display mode.
       
    63 
       
    64 @param  aSize
       
    65         The bitmap frame buffer size.
       
    66 @param  aDisplayMode
       
    67         The display mode.
       
    68 
       
    69 @return A pointer to a fully constructed CMMFBitmapFrameBuffer.
       
    70 */
       
    71 EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(const TSize& aSize,TDisplayMode aDisplayMode)
       
    72 	{
       
    73 	CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer;
       
    74 	CleanupStack::PushL(self);
       
    75 	self->ConstructL();
       
    76 	User::LeaveIfError(self->iFrame->Create(aSize,aDisplayMode));
       
    77 	CleanupStack::Pop(); // self
       
    78 	return self;
       
    79 	}
       
    80 
       
    81 /**
       
    82 Factory function to create objects of type CMMFBitmapFrameBuffer used
       
    83 to store a frame using an EPOC bitmap.
       
    84 
       
    85 @param  aBitmapHandle
       
    86         The handle to the bitmap from which to make a copy.
       
    87 
       
    88 @return A pointer to a fully constructed CMMFBitmapFrameBuffer.
       
    89 */
       
    90 EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(TInt aBitmapHandle)
       
    91 	{
       
    92 	CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer;
       
    93 	CleanupStack::PushL(self);
       
    94 	self->ConstructL();
       
    95 	User::LeaveIfError(self->iFrame->Duplicate(aBitmapHandle));
       
    96 	CleanupStack::Pop(); // self
       
    97 	return self;
       
    98 	}
       
    99 
       
   100 void CMMFBitmapFrameBuffer::ConstructL()
       
   101 	{
       
   102 	iFrame = new(ELeave)CFbsBitmap;
       
   103 	}