sl@0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// source\mmf\server\baseclasses\mmfvideoframebuffer.cpp
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "mmfvideoframebuffer.h"
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
/**
|
sl@0
|
22 |
Factory function to create objects of type CMMFYUVBuffer used
|
sl@0
|
23 |
to store a frame using YUV data. Allocates and constructs a YUV frame buffer.
|
sl@0
|
24 |
|
sl@0
|
25 |
@return A pointer to a fully constructed CMMFYUVBuffer.
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
EXPORT_C CMMFYUVBuffer* CMMFYUVBuffer::NewL()
|
sl@0
|
28 |
{
|
sl@0
|
29 |
CMMFYUVBuffer* self = new(ELeave) CMMFYUVBuffer;
|
sl@0
|
30 |
CleanupStack::PushL(self);
|
sl@0
|
31 |
self->ConstructL();
|
sl@0
|
32 |
CleanupStack::Pop(); // self
|
sl@0
|
33 |
return self;
|
sl@0
|
34 |
}
|
sl@0
|
35 |
|
sl@0
|
36 |
|
sl@0
|
37 |
void CMMFYUVBuffer::ConstructL()
|
sl@0
|
38 |
{
|
sl@0
|
39 |
}
|
sl@0
|
40 |
|
sl@0
|
41 |
/**
|
sl@0
|
42 |
Destructor.
|
sl@0
|
43 |
*/
|
sl@0
|
44 |
EXPORT_C CMMFYUVBuffer::~CMMFYUVBuffer()
|
sl@0
|
45 |
{
|
sl@0
|
46 |
delete iYUVBuffer;
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
/**
|
sl@0
|
50 |
Destructor.
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
EXPORT_C CMMFBitmapFrameBuffer::~CMMFBitmapFrameBuffer()
|
sl@0
|
53 |
{
|
sl@0
|
54 |
if (iFrame) iFrame->Reset(); //release bitmap handle
|
sl@0
|
55 |
delete iFrame;
|
sl@0
|
56 |
}
|
sl@0
|
57 |
|
sl@0
|
58 |
/**
|
sl@0
|
59 |
Factory function to create objects of type CMMFBitmapFrameBuffer used
|
sl@0
|
60 |
to store a frame an EPOC bitmap.
|
sl@0
|
61 |
Allocates and constructs a bitmap frame buffer with the specified size
|
sl@0
|
62 |
and display mode.
|
sl@0
|
63 |
|
sl@0
|
64 |
@param aSize
|
sl@0
|
65 |
The bitmap frame buffer size.
|
sl@0
|
66 |
@param aDisplayMode
|
sl@0
|
67 |
The display mode.
|
sl@0
|
68 |
|
sl@0
|
69 |
@return A pointer to a fully constructed CMMFBitmapFrameBuffer.
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(const TSize& aSize,TDisplayMode aDisplayMode)
|
sl@0
|
72 |
{
|
sl@0
|
73 |
CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer;
|
sl@0
|
74 |
CleanupStack::PushL(self);
|
sl@0
|
75 |
self->ConstructL();
|
sl@0
|
76 |
User::LeaveIfError(self->iFrame->Create(aSize,aDisplayMode));
|
sl@0
|
77 |
CleanupStack::Pop(); // self
|
sl@0
|
78 |
return self;
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
/**
|
sl@0
|
82 |
Factory function to create objects of type CMMFBitmapFrameBuffer used
|
sl@0
|
83 |
to store a frame using an EPOC bitmap.
|
sl@0
|
84 |
|
sl@0
|
85 |
@param aBitmapHandle
|
sl@0
|
86 |
The handle to the bitmap from which to make a copy.
|
sl@0
|
87 |
|
sl@0
|
88 |
@return A pointer to a fully constructed CMMFBitmapFrameBuffer.
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
EXPORT_C CMMFBitmapFrameBuffer* CMMFBitmapFrameBuffer::NewL(TInt aBitmapHandle)
|
sl@0
|
91 |
{
|
sl@0
|
92 |
CMMFBitmapFrameBuffer* self = new(ELeave) CMMFBitmapFrameBuffer;
|
sl@0
|
93 |
CleanupStack::PushL(self);
|
sl@0
|
94 |
self->ConstructL();
|
sl@0
|
95 |
User::LeaveIfError(self->iFrame->Duplicate(aBitmapHandle));
|
sl@0
|
96 |
CleanupStack::Pop(); // self
|
sl@0
|
97 |
return self;
|
sl@0
|
98 |
}
|
sl@0
|
99 |
|
sl@0
|
100 |
void CMMFBitmapFrameBuffer::ConstructL()
|
sl@0
|
101 |
{
|
sl@0
|
102 |
iFrame = new(ELeave)CFbsBitmap;
|
sl@0
|
103 |
}
|