|
1 /* |
|
2 * Copyright (c) 2010 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: This Custom API provides use case hints to camera. |
|
15 * Application can use this custom interface to notify camera |
|
16 * which use case it's going to use before reserving camera. |
|
17 * Based on this information camera adaptation can optimize |
|
18 * resource allocation so that camera is able to start up faster |
|
19 * for the particular use case. |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef ECAMUSECASEHINTCUSTOMAPI_H |
|
25 #define ECAMUSECASEHINTCUSTOMAPI_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <ecam.h> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 const TUid KCameraUseCaseHintUid = { 0x2002EA1A }; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Custom interface for providing use case hints to camera. |
|
38 */ |
|
39 class MCameraUseCaseHint |
|
40 { |
|
41 public: // Enumerations |
|
42 |
|
43 /** |
|
44 * List of codecs for encoded video |
|
45 * @see HintDirectVideoCaptureL() |
|
46 */ |
|
47 enum TVideoCodec |
|
48 { |
|
49 ECodecUnknown = 0, |
|
50 ECodecMpeg4, |
|
51 ECodecH263, |
|
52 ECodecH264, |
|
53 ECodecVC1, |
|
54 ECodecSorenson, |
|
55 ECodecOn2Vp6, |
|
56 ECodecOn2Vp7, |
|
57 }; |
|
58 |
|
59 /** |
|
60 * List of profiles for encoded video |
|
61 * @see HintDirectVideoCaptureL() |
|
62 */ |
|
63 enum TVideoProfile |
|
64 { |
|
65 EProfileUnknown = 0, |
|
66 |
|
67 EProfileMPEG4SpL0 = 0x1000, |
|
68 EProfileMPEG4SpL0b, |
|
69 EProfileMPEG4SpL1, |
|
70 EProfileMPEG4SpL2, |
|
71 EProfileMPEG4SpL3, |
|
72 EProfileMPEG4SpL4a, |
|
73 EProfileMPEG4SpL5, |
|
74 EProfileMPEG4SpL6, |
|
75 |
|
76 EProfileMPEG4AspL0, |
|
77 EProfileMPEG4AspL0b, |
|
78 EProfileMPEG4AspL1, |
|
79 EProfileMPEG4AspL2, |
|
80 EProfileMPEG4AspL3, |
|
81 EProfileMPEG4AspL3b, |
|
82 EProfileMPEG4AspL4, |
|
83 EProfileMPEG4AspL4a, |
|
84 EProfileMPEG4AspL5, |
|
85 EProfileMPEG4AspL6, |
|
86 |
|
87 EProfileH263P0L10 = 0x2000, |
|
88 EProfileH263P0L20, |
|
89 EProfileH263P0L30, |
|
90 EProfileH263P0L40, |
|
91 EProfileH263P0L45, |
|
92 |
|
93 EProfileH264BpL1 = 0x3000, |
|
94 EProfileH264BpL1b, |
|
95 EProfileH264BpL1_1, |
|
96 EProfileH264BpL1_2, |
|
97 EProfileH264BpL1_3, |
|
98 EProfileH264BpL2, |
|
99 EProfileH264BpL2_1, |
|
100 EProfileH264BpL2_2, |
|
101 EProfileH264BpL3, |
|
102 EProfileH264BpL3_1, |
|
103 EProfileH264BpL3_2, |
|
104 EProfileH264BpL4, |
|
105 |
|
106 EProfileH264MpL1, |
|
107 EProfileH264MpL1b, |
|
108 EProfileH264MpL1_1, |
|
109 EProfileH264MpL1_2, |
|
110 EProfileH264MpL1_3, |
|
111 EProfileH264MpL2, |
|
112 EProfileH264MpL2_1, |
|
113 EProfileH264MpL2_2, |
|
114 EProfileH264MpL3, |
|
115 EProfileH264MpL3_1, |
|
116 EProfileH264MpL3_2, |
|
117 EProfileH264MpL4, |
|
118 |
|
119 EProfileH264HpL1, |
|
120 EProfileH264HpL1b, |
|
121 EProfileH264HpL1_1, |
|
122 EProfileH264HpL1_2, |
|
123 EProfileH264HpL1_3, |
|
124 EProfileH264HpL2, |
|
125 EProfileH264HpL2_1, |
|
126 EProfileH264HpL2_2, |
|
127 EProfileH264HpL3, |
|
128 EProfileH264HpL3_1, |
|
129 EProfileH264HpL3_2, |
|
130 EProfileH264HpL4, |
|
131 |
|
132 EProfileVC1SpLL = 0x4000, |
|
133 EProfileVC1SpLM, |
|
134 EProfileVC1MpLL, |
|
135 EProfileVC1MpLM, |
|
136 EProfileVC1MpLH, |
|
137 EProfileVC1ApL0, |
|
138 EProfileVC1ApL1, |
|
139 EProfileVC1ApL2, |
|
140 |
|
141 EProfileSSGeneric = 0x5000, |
|
142 |
|
143 EProfileVP6Generic = 0x6000, |
|
144 }; |
|
145 |
|
146 public: // Methods |
|
147 |
|
148 /** |
|
149 * Gives a hint to camera that client wants to capture encoded video. |
|
150 * |
|
151 * This method should be called after calling CCamera::New2L() and |
|
152 * before CCamera::Reserve(). |
|
153 * |
|
154 * @param aCodec Codec of the encoded video. |
|
155 * @param aProfile Profile of the encoded video. |
|
156 * @param aResolution Resolution of the encoded video. |
|
157 * @leave KErrInUse if this method is not called at the right time. |
|
158 * @leave KErrNotSupported if given codec/profile/resolution is not |
|
159 * supported. |
|
160 */ |
|
161 virtual void HintDirectVideoCaptureL( |
|
162 TVideoCodec aCodec, |
|
163 TVideoProfile aProfile, |
|
164 const TSize& aResolution ) = 0; |
|
165 |
|
166 /** |
|
167 * Gives a hint to camera that client wants to capture non-encoded video. |
|
168 * |
|
169 * This method should be called after calling CCamera::New2L() and |
|
170 * before CCamera::Reserve(). |
|
171 * |
|
172 * @param aFormat Format. Must be one of the supported video frame formats |
|
173 (see TCameraInfo::iVideoFrameFormatsSupported). |
|
174 * @param aSizeIndex Size index. Must be in the range 0 to |
|
175 TCameraInfo::iNumVideoFrameSizesSupported-1 inclusive. |
|
176 * @param aRateIndex Rate index. Must be in the range 0 to |
|
177 TCameraInfo::iNumVideoFrameRatesSupported-1 inclusive. |
|
178 * @leave KErrInUse if this method is not called at the right time. |
|
179 * @leave KErrNotSupported if given format/size/rate is not supported. |
|
180 */ |
|
181 virtual void HintVideoCaptureL( |
|
182 CCamera::TFormat aFormat, |
|
183 TInt aSizeIndex, |
|
184 TInt aRateIndex ) = 0; |
|
185 |
|
186 /** |
|
187 * Gives a hint to camera that client wants to capture still images. |
|
188 * |
|
189 * This method should be called after calling CCamera::New2L() and |
|
190 * before CCamera::Reserve(). |
|
191 * |
|
192 * @param aFormat Format. Must be one of the supported still formats |
|
193 * (see TCameraInfo::iImageFormatsSupported). |
|
194 * @param aSizeIndex Size index. Must be in the range of 0 to |
|
195 * TCameraInfo::iNumImageSizesSupported-1 inclusive. |
|
196 * @leave KErrInUse if this method is not called at the right time. |
|
197 * @leave KErrNotSupported if given format/size/rate is not supported. |
|
198 */ |
|
199 virtual void HintStillCaptureL( |
|
200 CCamera::TFormat aFormat, |
|
201 TInt aSizeIndex ) = 0; |
|
202 }; |
|
203 |
|
204 #endif //ECAMUSECASEHINTCUSTOMAPI_H |