|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CCMRFrameBuffer.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCMRFRAMEBUFFER_H |
|
21 #define CCMRFRAMEBUFFER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ecam.h> |
|
25 #include <e32std.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 class MCameraBuffer; |
|
32 |
|
33 // CLASS DECLARATIONS |
|
34 |
|
35 /** |
|
36 * Wrapper class from MCameraBuffer to MFrameBuffer |
|
37 */ |
|
38 |
|
39 class CCMRFrameBuffer: public CBase, public MFrameBuffer |
|
40 { |
|
41 |
|
42 |
|
43 public: // Construction and destruction |
|
44 |
|
45 static CCMRFrameBuffer* NewL( MCameraBuffer* aCameraBuffer ); |
|
46 |
|
47 virtual ~CCMRFrameBuffer(); |
|
48 |
|
49 |
|
50 public: // General methods / From MFrameBuffer |
|
51 |
|
52 /** |
|
53 Gets a non-bitmap frame in the buffer. |
|
54 |
|
55 @param aIndex |
|
56 The index of the required, non-bitmap, frame. |
|
57 |
|
58 @leave KErrArgument if aIndex is out of range |
|
59 @leave KErrNotSupported if the frame format is bitmap. |
|
60 @return A pointer to the specified non-bitmap format frame of video data. |
|
61 */ |
|
62 TDesC8* DataL(TInt aIndex); |
|
63 |
|
64 /** |
|
65 Gets a bitmap frame in the buffer. |
|
66 |
|
67 @param aIndex |
|
68 The index of the required, bitmap format, frame. |
|
69 |
|
70 @leave KErrArgument if aIndex is out of range and |
|
71 @leave KErrNotSupported if |
|
72 the frame format is not a bitmap. |
|
73 @return A pointer to the specified bitmap format frame of video data. |
|
74 */ |
|
75 CFbsBitmap* FrameL(TInt aIndex); |
|
76 |
|
77 /** |
|
78 Releases the buffer for re-use by the camera once the client has processed |
|
79 the frame data. |
|
80 |
|
81 Signals to CCamera that the buffer data has been used and that the buffer |
|
82 is free for re-use. |
|
83 */ |
|
84 void Release(); |
|
85 |
|
86 |
|
87 private: // Private member methods |
|
88 |
|
89 /** |
|
90 * C++ constructor. |
|
91 */ |
|
92 CCMRFrameBuffer(); |
|
93 |
|
94 /** |
|
95 * Symbian OS 2nd phase constructor that can leave. |
|
96 * @param aCameraBuffer New MCameraBuffer object |
|
97 * @return void |
|
98 */ |
|
99 void ConstructL( MCameraBuffer* aCameraBuffer ); |
|
100 |
|
101 |
|
102 private: // Data |
|
103 |
|
104 // Stored MCameraBuffer that is owned by Camera-API. |
|
105 MCameraBuffer* iCameraBuffer; |
|
106 |
|
107 }; |
|
108 |
|
109 |
|
110 #endif // CCMRFRAMEBUFFER_H |