2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FMedia_CameraImpl.h
20 * @brief This header file contains the declarations of the %_CameraImpl class.
24 #ifndef _FMEDIA_INTERNAL_CAMERA_IMPL_H_
25 #define _FMEDIA_INTERNAL_CAMERA_IMPL_H_
27 #include <unique_ptr.h>
29 #include <FBaseColIList.h>
30 #include <FBaseColIListT.h>
31 #include <FBaseObject.h>
32 #include <FBaseColQueue.h>
33 #include <FGrpBufferInfo.h>
34 #include <FGrpDimension.h>
35 #include <FGrpPixelFormat.h>
36 #include <FGrpRectangle.h>
37 #include <FMediaCameraTypes.h>
38 #include <FMediaTypes.h>
39 #include <FMediaIVideoStreamFilter.h>
40 #include "FMedia_CameraTypes.h"
41 #include "FMedia_CapabilityTypes.h"
42 #include "FMedia_ICameraCoordinatorListener.h"
43 #include "FMedia_CameraBuffer.h"
44 #include "FMedia_CamPtrUtil.h"
46 namespace Tizen { namespace Media
49 class ICameraEventListener;
51 class _CameraCoordinator;
52 class _CameraCapability;
54 class _VideoStreamCoordinator;
58 * @brief This class implements the APIs of %Camera class.
62 : public Tizen::Base::Object
63 , public _ICameraCoordinatorListener
67 * This is the default constructor for this class.
69 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to
70 * initialize this instance.
75 * This is the destructor for this class. @n
76 * All allocated resources are deallocated by this method. This method should be called in the same thread
77 * where the Construct() method is called.
81 virtual ~_CameraImpl(void);
85 * Initializes this instance of Camera with the specified parameters. @n
86 * This method creates an instance of Camera in the subsystem. Only one instance is created at a given time.
88 * @return An error code
89 * @param[in] listener An event listener instance
90 * @param[in] camSel The Camera to be used
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_SYSTEM A system error has occurred.
93 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
94 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
96 result Construct(ICameraEventListener& listener, CameraSelection camSel);
99 * Powers the camera on.
101 * @return An error code
102 * @exception E_SUCCESS The method is successful.
103 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
104 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
105 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
106 * @exception E_DEVICE_FAILED The device operation has failed.
107 * @exception E_OUT_OF_MEMORY The memory is insufficient.
108 * @remarks The reserved configurations are set in this method.
111 result PowerOn(void);
114 * Powers the camera off.
116 * @return An error code
117 * @exception E_SUCCESS The method is successful.
118 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
119 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
120 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
121 * @exception E_DEVICE_FAILED The device operation has failed.
122 * @exception E_OUT_OF_MEMORY The memory is insufficient.
125 result PowerOff(void);
128 * Checks whether the camera is powered on.
130 * @return @c true if the camera is powered on, @n
132 * @exception E_SUCCESS The method is successful.
133 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
134 * @exception E_OUT_OF_MEMORY The memory is insufficient.
135 * @remarks The specific error code can be accessed using the GetLastResult() method.
136 * @see PowerOn(), PowerOff()
138 bool IsPoweredOn(void) const;
141 * Starts displaying the preview image on the camera device. @n
142 * If the value of @c pBufferInfo is @c null, no preview image is displayed. In this case, the application can
143 * draw the preview image with the data passed on by the ICameraEventListener::OnCameraPreviewed() method.
145 * If the value of @c previewedData is @c true, the previewed image data is passed to the
146 * ICameraEventListener::OnCameraPreviewed() method periodically based on the frame-rate, otherwise the
147 * callback is not invoked. The default value of @c previewedData is @c false.
149 * @return An error code
150 * @param[in] pBufferInfo The buffer information for the camera preview display
151 * @param[in] previewedData Set to @c true if the previewed data is delivered to the callback method, @n
153 * @exception E_SUCCESS The method is successful.
154 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
155 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
156 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
157 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
158 * @exception E_DEVICE_FAILED The device operation has failed.
159 * @exception E_OUT_OF_MEMORY The memory is insufficient.
160 * @remarks The overlay region retrieved by the buffer information should be the topmost window when this method is
162 * @remarks The ICameraEventListener::OnCameraPreviewed() method can be delayed or dropped depending on
163 * the system's performance. @n@n
164 * For more information on the relationship between this method and the PowerOn() method, and the
165 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
166 ">Launching the Camera</a>.
168 * @see StopPreview(), ICameraEventListener::OnCameraPreviewed()
170 result StartPreview(const Tizen::Graphics::BufferInfo* pBufferInfo, bool previewedData = false);
173 * Stops displaying the preview image on the camera device.
175 * @return An error code
176 * @exception E_SUCCESS The method is successful.
177 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
178 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
179 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
180 * @exception E_DEVICE_FAILED The device operation has failed.
181 * @exception E_OUT_OF_MEMORY The memory is insufficient.
182 * @remarks For more information on the relationship between this method and the PowerOn() method, and the
183 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
184 ">Launching the Camera</a>.
185 * @see StartPreview()
187 result StopPreview(void);
190 * Captures the current image data from the camera sensor. @n
191 * After capturing the image, the camera's state changes to ::CAMERA_STATE_CAPTURED. @n
192 * The camera's preview should be restarted by calling the StartPreview() method. @n
193 * The captured image is passed through ICameraEventListener::OnCameraCaptured().
195 * @return An error code
196 * @exception E_SUCCESS The method is successful.
197 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
198 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
199 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
200 * @exception E_DEVICE_FAILED The device operation has failed.
201 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
202 * @exception E_OUT_OF_MEMORY The memory is insufficient.
203 * @remarks For more information on the relationship between this method and the PowerOn() method, and the
204 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
205 ">Launching the Camera</a>.
206 * @see ICameraEventListener::OnCameraCaptured()
208 result Capture(void);
211 * Gets the state of the camera in CameraState.
213 * @return The current state of the camera
214 * @exception E_SUCCESS The method is successful.
215 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
216 * @exception E_OUT_OF_MEMORY The memory is insufficient.
217 * @remarks The specific error code can be accessed using the GetLastResult() method.
218 * @see StartPreview(), StopPreview(), SetAutoFocus(), Capture()
220 CameraState GetState(void) const;
223 * Sets the brightness level of the camera input data.
225 * @return An error code
226 * @param[in] brightness The brightness level to set @n
227 * The range of this parameter is from @c 0 to @c 9.
228 * @exception E_SUCCESS The method is successful.
229 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
230 * @exception E_OUT_OF_RANGE The specified @c brightness is out of range.
231 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
232 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
233 * @exception E_DEVICE_FAILED The device operation has failed.
234 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
235 * @exception E_OUT_OF_MEMORY The memory is insufficient.
236 * @remarks The default brightness level is @c 5. @n
237 * The device's supported range for the brightness level is from @c 0 to @c 9. @n
238 * This method works correctly when PowerOn() is executed. @n@n
239 * For more information on the relationship between this method and the PowerOn() method, and the
240 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
241 ">Launching the Camera</a>.
242 * @see GetBrightness()
244 result SetBrightness(int brightness);
247 * Gets the brightness level of the camera input data.
249 * @return The current brightness level @n
250 * The returned value ranges from @c 0 to @c 9.
251 * @exception E_SUCCESS The method is successful.
252 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
253 * @exception E_OUT_OF_MEMORY The memory is insufficient.
254 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
255 * The device's supported range for the brightness level is from @c 0 to @c 9. @n
256 * @see SetBrightness()
258 int GetBrightness(void) const;
261 * Sets the contrast level of the Camera input data.
263 * @return An error code
264 * @param[in] contrast The contrast level to set @n
265 * The range of this parameter is from @c 0 to @c 9.
266 * @exception E_SUCCESS The method is successful.
267 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
268 * @exception E_OUT_OF_RANGE The specified contrast is out of range.
269 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
270 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
271 * @exception E_DEVICE_FAILED The device operation has failed.
272 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
273 * @exception E_OUT_OF_MEMORY The memory is insufficient.
274 * @remarks The default contrast level is @c 5. @n
275 * The device's supported range for the contrast level is from @c 0 to @c 9. @n
276 * This method works correctly when PowerOn() is executed. @n@n
277 * For more information on the relationship between this method and the PowerOn() method, and the
278 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
279 ">Launching the Camera</a>.
282 result SetContrast(int contrast);
285 * Gets the contrast level of the camera input data.
287 * @return The current contrast level @n
288 * The returned value ranges from @c 0 to @c 9.
289 * @exception E_SUCCESS The method is successful.
290 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
291 * @exception E_OUT_OF_MEMORY The memory is insufficient.
292 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
293 * The device's supported range for the contrast level is from @c 0 to @c 9.
296 int GetContrast(void) const;
299 * Increases the zoom level of the camera.
301 * @return An error code
302 * @exception E_SUCCESS The method is successful.
303 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
304 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
305 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
306 * @exception E_DEVICE_FAILED The device operation has failed.
307 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
308 * @exception E_OUT_OF_MEMORY The memory is insufficient.
309 * @remarks This method returns E_UNSUPPORTED_OPERATION in the emulator.
310 * If CameraZoomType supports only ::CAMERA_ZOOM_TYPE_SMART, the zoom ratio can differ according
311 * to the preview, capture, and recording resolutions.
312 * The supported zoom types can be obtained by using the
313 * MediaCapability::GetValueN(CAMERA_PRIMARY_ZOOM_TYPE) method. @n@n
314 * For more information on the relationship between this method and the PowerOn() method, and the
315 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
316 ">Launching the Camera</a>.
317 * @see ZoomOut(),GetZoomLevel(),GetMaxZoomLevel()
322 * Decreases the zoom level of the camera.
324 * @return An error code
325 * @exception E_SUCCESS The method is successful.
326 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
327 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
328 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
329 * @exception E_DEVICE_FAILED The device operation has failed.
330 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
331 * @exception E_OUT_OF_MEMORY The memory is insufficient.
332 * @remarks This method returns E_UNSUPPORTED_OPERATION in the emulator.
333 * If CameraZoomType supports only ::CAMERA_ZOOM_TYPE_SMART, zoom ratio can differ according to
334 * the preview, capture, and recording resolutions.
335 * The supported zoom types can be obtained by using the
336 * MediaCapability::GetValueN(CAMERA_PRIMARY_ZOOM_TYPE) method. @n@n
337 * For more information on the relationship between this method and the PowerOn() method, and the
338 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
339 ">Launching the Camera</a>.
340 * @see ZoomIn(),GetZoomLevel(),GetMaxZoomLevel()
342 result ZoomOut(void);
345 * Gets the zoom level of the camera.
347 * @return The current zoom level
348 * @exception E_SUCCESS The method is successful.
349 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
350 * @exception E_OUT_OF_MEMORY The memory is insufficient.
351 * @remarks The specific error code can be accessed using the GetLastResult() method.
352 * @remarks The zoom level is different for each camera device.
353 * @remarks This method throws E_UNSUPPORTED_OPERATION in the emulator.
354 * @see ZoomIn(), ZoomOut(),GetMaxZoomLevel()
356 int GetZoomLevel(void) const;
359 * Gets the maximum zoom level supported by this Camera.
361 * @return The maximum zoom level
362 * @exception E_SUCCESS The method is successful.
363 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
364 * @exception E_OUT_OF_MEMORY The memory is insufficient.
365 * @remarks The specific error code can be accessed using the GetLastResult() method.
366 * @remarks The zoom level is different for each camera device.
367 * @remarks This method returns E_UNSUPPORTED_OPERATION in the emulator. @n
368 * This method works correctly when PowerOn() is executed.
369 * @see ZoomIn(), ZoomOut(), GetZoomLevel()
371 int GetMaxZoomLevel(void) const;
374 * Changes the current resolution of the preview.
376 * @return An error code
377 * @param[in] resolution The preview resolution @n
378 * It should be one of the listed dimensions that are extracted using GetSupportedPreviewResolutionListN().
379 * @exception E_SUCCESS The method is successful.
380 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
381 * @exception E_OUT_OF_RANGE The position or size is out of range.
382 * @exception E_OUT_OF_MEMORY The memory is insufficient.
383 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
384 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
385 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
386 * @exception E_DEVICE_FAILED The device operation has failed.
387 * @remarks This method works in the ::CAMERA_STATE_INITIALIZED state. @n@n
388 * For more information on the relationship between this method and the PowerOn() method, and the
389 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
390 ">Launching the Camera</a>.
391 * @see GetPreviewResolution()
393 result SetPreviewResolution(const Tizen::Graphics::Dimension& resolution);
396 * Retrieves the current resolution of the preview.
398 * @return The current preview resolution
399 * @exception E_SUCCESS The method is successful.
400 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
401 * @exception E_OUT_OF_MEMORY The memory is insufficient.
402 * @remarks The specific error code can be accessed using the GetLastResult() method.
403 * @see SetPreviewResolution()
405 Tizen::Graphics::Dimension GetPreviewResolution(void) const;
408 * Retrieves the supported preview resolution list of the Camera class. @n
409 * Each item in the returned list contains a pointer of Tizen::Graphics::Dimension value.
411 * @return A list of dimensions that represent the preview resolutions supported by the Camera class, @n
412 * else @c null if no preview resolution is supported or an exception occurs
413 * @exception E_SUCCESS The method is successful.
414 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
415 * @exception E_SYSTEM A system error has occurred.
416 * @exception E_OUT_OF_MEMORY The memory is insufficient.
417 * @remark The specific error code can be accessed using the GetLastResult() method. @n
418 * The return value and each item in the list must be deleted by the caller. @n
419 * This method works correctly when Camera::PowerOn() is executed.
420 * @see SetPreviewResolution(), GetPreviewResolution()
422 Tizen::Base::Collection::IList* GetSupportedPreviewResolutionListN(void) const;
426 * Sets the capturing resolution of the camera. @n
427 * Initially, the default resolution is set using the internal configuration.
429 * @return An error code
430 * @param[in] resolution The display resolution @n
431 * The display resolution should be one of the values extracted using GetSupportedCaptureResolutionListN().
432 * @exception E_SUCCESS The method is successful.
433 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
434 * @exception E_SYSTEM A system error has occurred.
435 * @exception E_OUT_OF_RANGE The specified resolution is out of range.
436 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
437 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
438 * @exception E_DEVICE_FAILED The device operation has failed.
439 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
440 * @exception E_OUT_OF_MEMORY The memory is insufficient.
441 * @remarks For more information on the relationship between this method and the PowerOn() method, and the
442 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
443 ">Launching the Camera</a>.
444 * @see GetCaptureResolution(), GetSupportedCaptureResolutionListN()
446 result SetCaptureResolution(const Tizen::Graphics::Dimension& resolution);
449 * Gets the resolution for capturing the data of the camera.
451 * @return The current resolution for capturing the data of the camera
452 * @exception E_SUCCESS The method is successful.
453 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
454 * @exception E_OUT_OF_MEMORY The memory is insufficient.
455 * @remarks The specific error code can be accessed using the GetLastResult() method.
456 * @see SetCaptureResolution(),GetSupportedCaptureResolutionListN()
458 Tizen::Graphics::Dimension GetCaptureResolution(void) const;
461 * Gets a list of the capturing resolutions supported by the Camera class. @n
462 * Each item of the list has a pointer of the Tizen::Graphics::Dimension value.
464 * @return A list of the capture resolutions supported by the Camera class @n
465 * else @c null if no capture resolution is supported or an exception occurs
466 * @exception E_SUCCESS The method is successful.
467 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
468 * @exception E_SYSTEM A system error has occurred.
469 * @exception E_OUT_OF_MEMORY The memory is insufficient.
470 * @remark The specific error code can be accessed using the GetLastResult() method. @n
471 * The return value and each item in the list must be deleted by the caller. @n
472 * This method works correctly when PowerOn() is executed.
473 * @see SetCaptureResolution(), GetCaptureResolution()
475 Tizen::Base::Collection::IList* GetSupportedCaptureResolutionListN(void) const;
478 * Sets the effect for the input data of the camera.
480 * @return An error code
481 * @param[in] effect The effect for the input data of the camera
482 * @exception E_SUCCESS The method is successful.
483 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
484 * @exception E_INVALID_ARG The specified input parameter is invalid.
485 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
486 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
487 * @exception E_DEVICE_FAILED The device operation has failed.
488 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
489 * @exception E_UNSUPPORTED_TYPE The effect type is not supported.
490 * @exception E_OUT_OF_MEMORY The memory is insufficient.
491 * @remarks The default effect is ::CAMERA_EFFECT_NONE.
492 * This method works correctly when PowerOn() is executed. @n@n
493 * For more information on the relationship between this method and the PowerOn() method, and the
494 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
495 ">Launching the Camera</a>.
498 result SetEffect(CameraEffect effect);
501 * Gets the effect for the input data of the camera.
503 * @return The effect for the input data of the camera
504 * @exception E_SUCCESS The method is successful.
505 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
506 * @exception E_OUT_OF_MEMORY The memory is insufficient.
507 * @remarks The specific error code can be accessed using the GetLastResult() method.
510 CameraEffect GetEffect(void) const;
513 * Sets the camera's flash mode.
515 * @return An error code
516 * @param[in] flashMode flash mode to switch on the flash light.
517 * @exception E_SUCCESS The method is successful.
518 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
519 * @exception E_INVALID_ARG The specified flash mode is invalid.
520 * @exception E_DEVICE_BUSY The camera is under use by other application.
521 * @exception E_DEVICE_UNAVAILABLE The camera becomes unavailable.
522 * @exception E_DEVICE_FAILED The device operation has failed.
523 * @exception E_OUT_OF_MEMORY The memory is insufficient.
524 * @exception E_UNSUPPORTED_OPERATION The target device does not support flash configuration feature.
525 * @exception E_UNSUPPORTED_TYPE The specified @c flashMode is not supported.
526 * @remarks Normally the flash splashes before the camera captures a picture. @n
527 * ::CAMERA_FLASH_MODE_CONTINUOUS keeps the flash turned on after the method is called until ::CAMERA_FLASH_MODE_OFF is set. @n
528 * This method returns E_UNSUPPORTED_OPERATION in the Emulator.
529 * @see GetFlashMode()
531 result SetFlashMode(CameraFlashMode flashMode);
534 * Gets the flash mode of the camera.
536 * @return The flash mode of the camera
537 * @exception E_SUCCESS The method is successful.
538 * @remarks The specific error code can be accessed using the GetLastResult() method.
539 * If the %Camera doesn't support the flash mode, this method always returns ::CAMERA_FLASH_MODE_OFF.
540 * @see SetFlashMode()
542 CameraFlashMode GetFlashMode(void) const;
545 * Sets the exposure level of the camera.
547 * @return An error code
548 * @param[in] exposure The camera exposure level @n
549 * The range of this parameter is from @c 0 to @c 9.
550 * @exception E_SUCCESS The method is successful.
551 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
552 * @exception E_OUT_OF_RANGE The specified exposure level is out of range.
553 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
554 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
555 * @exception E_DEVICE_FAILED The device operation has failed.
556 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
557 * @exception E_OUT_OF_MEMORY The memory is insufficient.
558 * @remarks The default exposure level is @c 5.
559 * The supported range for exposure level is from @c 0 to @c 9.
560 * This method works correctly when PowerOn() is executed. @n@n
561 * For more information on the relationship between this method and the PowerOn() method, and the
562 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
563 ">Launching the Camera</a>.
566 result SetExposure(int exposure);
569 * Gets the exposure level of the camera.
571 * @return An integer value representing the exposure level of the camera @n
572 * The returned value ranges from @c 0 to @c 9.
573 * @exception E_SUCCESS The method is successful.
574 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
575 * @exception E_OUT_OF_MEMORY The memory is insufficient.
576 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
577 * The supported range for exposure level is from @c 0 to @c 9.
580 int GetExposure(void) const;
583 * Sets the white balance level of the camera.
585 * @return An error code
586 * @param[in] whiteBalance The camera white balance level
587 * @exception E_SUCCESS The method is successful.
588 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
589 * @exception E_INVALID_ARG The specified input parameter is invalid.
590 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
591 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
592 * @exception E_DEVICE_FAILED The device operation has failed.
593 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
594 * @exception E_UNSUPPORTED_TYPE The @c whiteBalance type is not supported.
595 * @exception E_OUT_OF_MEMORY The memory is insufficient.
596 * @remarks The default white balance is ::CAMERA_WHITE_BALANCE_AUTO.
597 * This method works correctly when PowerOn() is executed. @n@n
598 * For more information on the relationship between this method and the PowerOn() method, and the
599 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
600 ">Launching the Camera</a>.
601 * @see GetWhiteBalance()
604 result SetWhiteBalance(CameraWhiteBalance whiteBalance);
607 * Gets the white balance level of the camera.
609 * @return The white balance level of the camera
610 * @exception E_SUCCESS The method is successful.
611 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
612 * @exception E_OUT_OF_MEMORY The memory is insufficient.
613 * @remarks The specific error code can be accessed using the GetLastResult() method.
614 * @see SetWhiteBalance()
616 CameraWhiteBalance GetWhiteBalance(void) const;
619 * Sets the capturing quality of the camera.
621 * @return An error code
622 * @param[in] quality The camera's quality level
623 * @exception E_SUCCESS The method is successful.
624 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
625 * @exception E_INVALID_ARG The specified @c quality is not supported.
626 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
627 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
628 * @exception E_DEVICE_FAILED The device operation has failed.
629 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
630 * @exception E_OUT_OF_MEMORY The memory is insufficient.
631 * @remarks The default quality is ::CAMERA_QUALITY_NORMAL.
632 * This method works correctly when PowerOn() is executed. @n@n
633 * For more information on the relationship between this method and the PowerOn() method, and the
634 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
635 ">Launching the Camera</a>.
638 result SetQuality(CameraQuality quality);
641 * Gets the capturing quality of the camera.
643 * @return The Camera quality level
644 * @exception E_SUCCESS The method is successful.
645 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
646 * @exception E_OUT_OF_MEMORY The memory is insufficient.
647 * @remarks The specific error code can be accessed using the GetLastResult() method.
650 CameraQuality GetQuality(void) const;
653 * Sets the focus mode of the camera.
655 * @return An error code
656 * @param[in] focusMode focus mode
657 * @exception E_SUCCESS The method is successful.
658 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
659 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
660 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
661 * @exception E_DEVICE_FAILED The device operation has failed.
662 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
663 * @exception E_UNSUPPORTED_TYPE The @c focusMode type is not supported.
664 * @exception E_OUT_OF_MEMORY The memory is insufficient.
665 * @remarks ::CAMERA_FOCUS_MODE_NONE always throws E_INVALID_ARG.
666 * @see GetFocusMode()
668 result SetFocusMode(CameraFocusMode focusMode);
671 * Gets the focus mode of the camera.
673 * @return The %Camera focus mode
674 * @see SetFocusMode()
676 CameraFocusMode GetFocusMode(void) const;
679 * Enables or disables the auto focus mode of the camera.
681 * @return An error code
682 * @param[in] callback Set to @c true to enable auto focus callback, @n
684 * @exception E_SUCCESS The method is successful.
685 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
686 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
687 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
688 * @exception E_DEVICE_FAILED The device operation has failed.
689 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
690 * @exception E_OUT_OF_MEMORY The memory is insufficient.
691 * @remarks If @c callback is set to @c false, the ICameraEventListener::OnCameraAutoFocused() method is not called.
692 * This method throws E_UNSUPPORTED_OPERATION in the emulator. @n@n
693 * For more information on the relationship between this method and the PowerOn() method, and the
694 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
695 ">Launching the Camera</a>.
696 * @see ICameraEventListener::OnCameraAutoFocused()
698 result SetAutoFocus(bool callback);
701 * Check the object is ready to call the auto focus callback or not.
703 * @return true if it calls the callback, otherwise false.
705 bool ReadyToAutoFocusCallback(void) const;
708 * Sets the auto focus point list.
710 * @return An error code
711 * @param[in] pointList auto focus point list which consists of Tizen::Graphics::Point pointers
712 * @exception E_SUCCESS The method is successful.
713 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
714 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
715 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
716 * @exception E_DEVICE_FAILED The device operation has failed.
717 * @exception E_INVALID_ARG The specified input parameter is invalid.
718 * @exception E_UNSUPPORTED_OPERATION The device does not support the focus point.
719 * @exception E_UNSUPPORTED_TYPE This method is not supported for the current focus mode.
720 * @exception E_OUT_OF_MEMORY The memory is insufficient.
721 * @remarks This method works fine when the current focus mode is CAMERA_FOCUS_MODE_NORMAL or CAMRA_FOCUS_MODE_MACRO.
722 * @see GetAutoFocusPointN()
724 result SetAutoFocusPoint(const Tizen::Base::Collection::IList& pointList);
727 * Gets the auto focus point list. @n
728 * Each item of the list has a pointer of the Tizen::Graphics::Point value.
730 * @return A list of dimensions that represent the auto focus point, @n
731 * else @c null if no auto focus point is set or an exception occurs
732 * @exception E_SUCCESS The method is successful.
733 * @exception E_OUT_OF_MEMORY The memory is insufficient.
734 * @remarks The specific error code can be accessed using the GetLastResult() method. @n
735 * The return value and each item in the list must be deleted by the caller.
736 * @see SetAutoFocusPoint()
738 Tizen::Base::Collection::IList* GetAutoFocusPointN(void) const;
741 * Sets the capturing format of the camera. @n
742 * Initially, the default format is set using the internal configuration.
744 * @return An error code
745 * @param[in] format The camera's capture format @n
746 * It should be one of the pixel formats extracted using GetSupportedCaptureFormatListN().
747 * @exception E_SUCCESS The method is successful.
748 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
749 * @exception E_SYSTEM A system error has occurred.
750 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
751 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
752 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
753 * @exception E_DEVICE_FAILED The device operation has failed.
754 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
755 * @exception E_OUT_OF_MEMORY The memory is insufficient.
756 * @remarks This method works correctly when PowerOn() is executed.
757 * @see GetCaptureFormat(), GetSupportedCaptureFormatListN()
759 result SetCaptureFormat(const Tizen::Graphics::PixelFormat format);
762 * Gets the capturing format of the camera.
764 * @return The capturing format of the camera
765 * @exception E_SUCCESS The method is successful.
766 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
767 * @exception E_OUT_OF_MEMORY The memory is insufficient.
768 * @remarks The specific error code can be accessed using the GetLastResult() method.
769 * @see SetCaptureFormat(), GetSupportedCaptureFormatListN()
771 Tizen::Graphics::PixelFormat GetCaptureFormat(void) const;
774 * Gets the supported capturing format list for the Camera class. @n
775 * Each list item has a Tizen::Graphics::PixelFormat value.
777 * @return A list of the formats supported by the Camera class, @n
778 * else @c null if no capture format is supported or an exception occurs
779 * @exception E_SUCCESS The method is successful.
780 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
781 * @exception E_SYSTEM A system error has occurred.
782 * @exception E_OUT_OF_MEMORY The memory is insufficient.
783 * @remark The specific error code can be accessed using the GetLastResult() method. @n
784 * The return value must be deleted. @n
785 * This method works correctly when PowerOn() is executed.
786 * @see SetCaptureFormat(), GetCaptureFormat()
788 Tizen::Base::Collection::IListT<Tizen::Graphics::PixelFormat>* GetSupportedCaptureFormatListN(void) const;
791 * Sets the preview format of the camera. @n
792 * Initially, the default format is set using the internal configuration.
794 * @return An error code
795 * @param[in] format The camera's preview format @n
796 * It should be one of the pixel formats extracted using GetSupportedPreviewFormatListN().
797 * @exception E_SUCCESS The method is successful.
798 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
799 * @exception E_SYSTEM A system error has occurred.
800 * @exception E_UNSUPPORTED_FORMAT The specified format is not supported.
801 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
802 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
803 * @exception E_DEVICE_FAILED The device operation has failed.
804 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
805 * @exception E_OUT_OF_MEMORY The memory is insufficient.
806 * @remarks This method works in ::CAMERA_STATE_INITIALIZED state. @n@n
807 * For more information on the relationship between this method and the PowerOn() method, and the
808 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
809 ">Launching the Camera</a>.
810 * @see GetPreviewFormat(), GetSupportedPreviewFormatListN()
812 result SetPreviewFormat(const Tizen::Graphics::PixelFormat format);
815 * Gets the preview format of the camera.
817 * @return The preview format of the camera
818 * @exception E_SUCCESS The method is successful.
819 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
820 * @exception E_OUT_OF_MEMORY The memory is insufficient.
821 * @remarks The specific error code can be accessed using the GetLastResult() method.
822 * @see SetPreviewFormat(), GetSupportedPreviewFormatListN()
824 Tizen::Graphics::PixelFormat GetPreviewFormat(void) const;
827 * Gets the supported preview format list for the Camera class. @n
828 * Each list item has a Tizen::Graphics::PixelFormat value.
830 * @return A list of the preview format supported by the Camera class, @n
831 * else @c null if no preview format is supported or an exception occurs
832 * @exception E_SUCCESS The method is successful.
833 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
834 * @exception E_SYSTEM A system error has occurred.
835 * @exception E_OUT_OF_MEMORY The memory is insufficient.
836 * @remark The specific error code can be accessed using the GetLastResult() method. @n
837 * The return value must be deleted. @n
838 * This method works correctly when PowerOn() is executed.
839 * @see SetPreviewFormat(), GetPreviewFormat()
841 Tizen::Base::Collection::IListT<Tizen::Graphics::PixelFormat>* GetSupportedPreviewFormatListN(void) const;
845 * Sets the ISO level of the camera.
847 * @return An error code
848 * @param[in] isoLevel The camera's ISO level @n
849 * The default ISO level is set from the internal configuration.
850 * @exception E_SUCCESS The method is successful.
851 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
852 * @exception E_OUT_OF_RANGE The specified ISO level is out of range.
853 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
854 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
855 * @exception E_DEVICE_FAILED The device operation has failed.
856 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
857 * @exception E_UNSUPPORTED_TYPE The specified @c isoLevel is not supported.
858 * @exception E_OUT_OF_MEMORY The memory is insufficient.
859 * @remarks In some devices this method works in the ::CAMERA_STATE_PREVIEW state.
860 * This method throws E_UNSUPPORTED_OPERATION in the emulator. @n@n
861 * For more information on the relationship between this method and the PowerOn() method, and the
862 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
863 ">Launching the Camera</a>.
866 result SetIsoLevel(CameraIsoLevel isoLevel);
869 * Gets the ISO level of the camera.
871 * @return The ISO level of the camera
872 * @exception E_SUCCESS The method is successful.
873 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
874 * @exception E_OUT_OF_MEMORY The memory is insufficient.
875 * @remarks The specific error code can be accessed using the GetLastResult() method.
878 CameraIsoLevel GetIsoLevel(void) const;
881 * Sets the preview frame rate of the camera. @n
882 * Initially, the default frame rate is set using the internal configuration.
884 * @return An error code
885 * @param[in] fps The frame rate per second
886 * @exception E_SUCCESS The method is successful.
887 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
888 * @exception E_OUT_OF_RANGE The specified @c fps is out of range on this device.
889 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
890 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
891 * @exception E_DEVICE_FAILED The device operation has failed.
892 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
893 * @exception E_OUT_OF_MEMORY The memory is insufficient.
894 * @remarks This method works in ::CAMERA_STATE_INITIALIZED state. @n@n
895 * For more information on the relationship between this method and the PowerOn() method, and the
896 * state transition caused by this method, see <a href="../com.osp.cppprogramming.help/html/dev_guide/media/launching_camera.htm
897 ">Launching the Camera</a>.
898 * @see GetPreviewFrameRate(), GetSupportedPreviewFrameRateListN(), FRAME_RATE_AUTO
900 result SetPreviewFrameRate(int fps);
903 * Retrieves the frame rate of the camera.
905 * @return The frame rate of the camera @n
906 * If the frame rate is not set using SetPreviewFrameRate(), the system-dependent default frame rate is returned.
907 * @exception E_SUCCESS The method is successful.
908 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
909 * @exception E_OUT_OF_MEMORY The memory is insufficient.
910 * @remarks The specific error code can be accessed using the GetLastResult() method.
911 * @see SetPreviewFrameRate(), GetSupportedPreviewFrameRateListN()
913 int GetPreviewFrameRate(void) const;
916 * Gets the supported preview frame rate list for the Camera class. @n
917 * Each list item has an integer value.
919 * @return A list of the preview frame rate supported by the Camera class, @n
920 * else @c null if no frame rate is supported or an exception occurs
921 * @exception E_SUCCESS The method is successful.
922 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
923 * @exception E_SYSTEM A system error has occurred.
924 * @exception E_OUT_OF_MEMORY The memory is insufficient.
925 * @remark The specific error code can be accessed using the GetLastResult() method. @n
926 * The return value must be deleted by the caller. @n
927 * This method works correctly when PowerOn() is executed. @n
928 * This method returns fps list that can be supported by all resolutions.
929 * @see SetPreviewFrameRate(), GetPreviewFrameRate(), FRAME_RATE_AUTO
930 * @see GetSupportedPreviewFrameRateListN(const Tizen::Graphics::Dimension& dim) const
932 Tizen::Base::Collection::IListT<int>* GetSupportedPreviewFrameRateListN(void) const;
935 * Gets the supported preview frame rate list of the input resolution of the Camera class. @n
936 * Each item of the list has an integer value.
938 * @return A list of the preview frame rate of the input preview resolution, @n
939 * else @c null if no frame rate is supported or an exception occurs
940 * @param[in] dim The preview resolution of the camera
941 * @exception E_SUCCESS The method is successful.
942 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
943 * @exception E_INVALID_ARG The specified input resolution is invalid.
944 * @exception E_SYSTEM A system error has occurred.
945 * @exception E_OUT_OF_MEMORY The memory is insufficient.
946 * @remark The specific error code can be accessed using the GetLastResult() method. @n
947 * The return value must be deleted by the caller. @n
948 * This method works correctly when PowerOn() is executed.
949 * @see SetPreviewFrameRate(), GetPreviewFrameRate()
950 * @see GetSupportedPreviewFrameRateListN(void) const
952 Tizen::Base::Collection::IListT<int>* GetSupportedPreviewFrameRateListN(const Tizen::Graphics::Dimension& dim) const;
955 * Sets the orientation value in the Exchangeable Image File Format (EXIF) field of the captured data.
957 * @return An error code
958 * @param[in] orientation The orientation value to set in EXIF
959 * @exception E_SUCCESS The method is successful.
960 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
961 * @exception E_OUT_OF_RANGE The input value is out of range.
962 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
963 * @exception E_SYSTEM A system error has occurred.
964 * @remarks The default value of orientation is CAMERA_EXIF_ORIENTATION_TOP_LEFT. @n
965 * This method works correctly when PowerOn() is executed. The orientation value set by this method can be obtained using the
966 * Tizen::Content::ImageData::GetOrientation() method after writing the captured data to a file.
968 result SetExifOrientation(CameraExifOrientation orientation);
971 * Sets the GPS coordinates in the Exchangeable Image File Format (EXIF) field for the captured data.
973 * @return An error code
974 * @param[in] latitude The latitude value to be set in EXIF @n
975 * The valid range is [-90.0, 90.0].
976 * @param[in] longitude The longitude value to be set in EXIF @n
977 * The valid range is [-180.0, 180.0]
978 * @param[in] altitude The altitude value to be set in EXIF
979 * @exception E_SUCCESS The method is successful.
980 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
981 * @exception E_OUT_OF_RANGE The input value is out of range.
982 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
983 * @exception E_SYSTEM A system error has occurred.
984 * @remarks This method sets the GPS coordinates and enables entering the coordinates into the Exchangeable Image File Format (EXIF).
985 * @remarks By default, the GPS coordinates are not entered in JPEG's EXIF.
986 * @remarks The GPS coordinates that are set using this method are entered in every call to the
987 * Capture() method, until DisableExifGpsCoordinates() is called or this instance is destroyed. @n
988 * This method works correctly when PowerOn() is executed. @n
989 * The values set by this method can result in an error as compared to the values stored in the Exchangeable Image File Format (EXIF) field.
990 * @see DisableExifGpsCoordinates()
992 result SetExifGpsCoordinates(double latitude, double longitude, float altitude);
995 * Disables the insertion of the GPS coordinates in the Exchangeable Image File Format (EXIF) field for the captured data.
997 * @return An error code
998 * @exception E_SUCCESS The method is successful.
999 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1000 * @exception E_OUT_OF_RANGE The input value is out of range.
1001 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1002 * @exception E_SYSTEM A system error has occurred.
1003 * @see SetExifGpsCoordinates()
1005 result DisableExifGpsCoordinates(void);
1008 * Sets the flip type for the previewed and captured data.
1010 * @return An error code
1011 * @param[in] flip The camera flip type
1012 * @exception E_SUCCESS The method is successful.
1013 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1014 * @exception E_INVALID_ARG The input value is out of range.
1015 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1016 * @exception E_UNSUPPORTED_TYPE The specified flip type is not supported.
1017 * @exception E_SYSTEM A system error has occurred.
1018 * @remarks This method works in the ::CAMERA_STATE_INITIALIZED state.
1019 * @remarks Finally the last specified type is applied even with the several types applicable.
1022 result SetFlip(CameraFlipType flip);
1025 * Gets the flip type for the previewed and captured data.
1027 * @return The Camera flip type
1028 * @exception E_SUCCESS The method is successful.
1029 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1032 CameraFlipType GetFlip(void) const;
1035 * Sets the rotation for the previewed data.
1037 * @return An error code
1038 * @param[in] rotation The camera rotation
1039 * @exception E_SUCCESS The method is successful.
1040 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1041 * @exception E_INVALID_ARG The input value is out of range.
1042 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1043 * @exception E_UNSUPPORTED_TYPE The specified rotation type is not supported.
1044 * @exception E_SYSTEM A system error has occurred.
1045 * @remarks This method works in the ::CAMERA_STATE_INITIALIZED state.
1046 * @remarks The last specified type is applied even with the several types applicable.
1047 * @remarks This method rotates the preview and recording data but not the captured image. @n
1048 * The captured image's orientation is always following the physical rotation.
1049 * @remarks When the preview is rotated, the preview callback data's width and height can be changed. @n
1050 * Thus the application should recognize these changes when it uses the preview data in ICameraEventListener::OnCameraPreviewed() callback.
1051 * @remarks For the intended view of preview, Tizen::Ui::Controls::OverlayRegion::OVERLAY_REGION_TYPE_NORMAL should be selected when Tizen::Ui::Controls::OverlayRegion is created.
1052 * @see GetPreviewRotation()
1055 result SetPreviewRotation(CameraRotation rotation);
1059 * Gets the rotation for the previewed data.
1061 * @return The camera rotation
1062 * @exception E_SUCCESS The method is successful.
1063 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1064 * @see SetPreviewRotation()
1067 CameraRotation GetPreviewRotation(void) const;
1070 * Sets the metering mode of the camera.
1072 * @return An error code
1073 * @param[in] meteringMode metering mode
1074 * @exception E_SUCCESS The method is successful.
1075 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1076 * @exception E_DEVICE_BUSY The device cannot be approached because of other operations.
1077 * @exception E_DEVICE_UNAVAILABLE The device is unavailable.
1078 * @exception E_DEVICE_FAILED The device operation has failed.
1079 * @exception E_UNSUPPORTED_OPERATION This operation is not supported.
1080 * @exception E_UNSUPPORTED_TYPE The @c meteringMode type is not supported.
1081 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1082 * @remarks ::CAMERA_METERING_MODE_NONE always throws E_INVALID_ARG.
1083 * @see GetMeteringMode()
1085 result SetMeteringMode(CameraMeteringMode meteringMode);
1088 * Gets the metering mode of the camera.
1090 * @return The %Camera metering mode
1091 * @see SetMeteringMode()
1093 CameraMeteringMode GetMeteringMode(void) const;
1096 * Sets the scene mode of the camera.
1098 * @return An error code
1099 * @param[in] sceneMode The scene mode
1100 * @exception E_SUCCESS The method is successful.
1101 * @exception E_INVALID_STATE This instance is in an invalid state for this method.
1102 * @exception E_DEVICE_BUSY The camera is under use by other application.
1103 * @exception E_DEVICE_UNAVAILABLE The camera becomes unavailable.
1104 * @exception E_DEVICE_FAILED The device operation has failed.
1105 * @exception E_INVALID_ARG The specified scene mode is invalid.
1106 * @exception E_UNSUPPORTED_OPERATION The target device does not support scene mode configuration feature.
1107 * @exception E_UNSUPPORTED_TYPE The specified @c sceneMode is not supported.
1108 * @remarks In a specific scene mode, camera's attributes such as brightness, metering mode, iso level, white balance, flash and focus are changed to the ones which are pre-defined by each scene mode.@n
1109 * In a specific scene mode, if an application sets any attribute which is related to the scene, the mode can be changed to ::CAMERA_SCENE_OFF.@n
1110 * Thus it is recommended that the application checks the current scene mode after setting the attributes.@n
1111 * In case that the scene mode is changed to ::CAMERA_SCENE_OFF, all the attributes set by the application are re-loaded.@n
1113 result SetSceneMode(CameraSceneMode sceneMode);
1116 * Adds the stream filter to process the video stream data while previewing or recording.
1118 * @return An error code
1119 * @param[in] filter An instance of IVideoStreamFilter
1120 * @exception E_SUCCESS The method is successful.
1121 * @exception E_OBJ_ALREADY_EXIST The filter already exists.
1122 * @exception E_OUT_OF_MEMORY The memory is insufficient.
1123 * @remarks IVideoStreamFilter::ProcessVideoStream() will be called when the video frame is ready.
1125 result AddVideoStreamFilter(IVideoStreamFilter& filter);
1128 * Removes the stream filter to stop receiving the video stream data.
1130 * @return An error code
1131 * @param[in] filter An instance of IVideoStreamFilter
1132 * @exception E_SUCCESS The method is successful.
1133 * @exception E_OBJ_NOT_FOUND The filter is not found.
1135 result RemoveVideoStreamFilter(IVideoStreamFilter& filter);
1138 * Gets the scene mode of the camera.
1140 * @return The %Camera scene mode
1142 CameraSceneMode GetSceneMode(void) const;
1145 * Gets the camera's state.
1149 camera_state_e GetMmState(void) const;
1154 * @param[in] state _AudioRecorderImpl's state
1156 void SetState(CameraState state);
1159 * Get the camera selection.
1161 * @return The camera selection.
1163 CameraSelection GetSelection(void) const;
1166 * Enqueues the preview or captured data.
1168 * @return An error code
1169 * @exception E_SUCCESS The method is successful.
1170 * @exception E_INVALID_ARG A specified input parameter is invalid.
1171 * @param[in] cameraBuffer The data prepared for enqueing.
1172 * @remarks The preview and capture data is delivered by callback. _CameraImpl class should keep the data using Queue and consume the data in the event listener. @n
1173 * Preview frame skip is controled in this method.
1175 result EnqueueData(_CameraBuffer& cameraBuffer);
1178 * Dequeues the preview or captured data.
1180 * @return A buffer data
1181 * @param[in] bufferType The buffer type
1182 * @remarks The preview and capture data is delivered by callback. _CameraImpl class should keep the data using Queue and consume the data in the event listener. @n
1183 * Preview frame skip is controled in this method. @n
1184 * The return value must be deleted. @n
1185 * The return value cannot be null.
1187 _CameraBuffer* DequeueDataN(_CameraBufferType bufferType);
1190 * Gets the camera coordinator.
1192 * @return camera coordinator
1194 _CameraCoordinator* GetCoordinator(void);
1197 * Gets the camera's zero shutter lag capability
1199 * @return Zero shutter lag capability
1201 bool IsZeroShutterLag(void) const;
1205 * Gets the camera's recommened preview format
1207 * @return recommened preview format
1209 Tizen::Graphics::PixelFormat GetDeviceRecommendPreviewFormat(void) const;
1212 * Called when the event is received from the %_ICameraCoordinatorListener object.
1214 * @return An error code
1215 * @param[in] message message id
1216 * @param[in] state camera state
1217 * @param[in] pParam0 Extra data0
1219 result OnCamcorderCoordinatorEventReceived(camera_state_e previous, camera_state_e current, bool byPolicy);
1222 * Called when the mode is prepared to change.
1224 * @return An error code
1225 * @param[in] mode camcorder mode
1227 result OnCameraCoordinatorModeChangePrepared(_CameraMode mode);
1230 * Called when the mode is changed.
1232 * @return An error code
1233 * @param[in] mode camcorder mode
1235 result OnCameraCoordinatorModeChanged(_CameraMode mode);
1238 * Called when the other module is removed
1240 * @return An error code
1242 result OnCameraCoordinatorOtherRemoved(void);
1245 * Function definition for start capture.
1247 * @return This function returns 0 on success, else on failure.
1248 * @param[in] mmHandle The camcorder handle
1250 static int StartMmCapture(_CameraHandle mmHandle);
1253 * Function definition for state chnaged callback.
1255 * @param[in] previous Previous state
1256 * @param[in] current Current state
1257 * @param[in] byPolicy The flag which says the state was chnaged from the policy.
1258 * @param[in] pUserData User parameter which is received from user when callback function was set
1259 * @remarks This function is called in the camera created thread.
1261 static void StateChangedCb(camera_state_e previous, camera_state_e current, bool byPolicy, void *pUserData);
1264 * Function definition for image capture callback.
1266 * @param[in] pImage Reference pointer to captured image data
1267 * @param[in] pPostview Reference pointer to post view image data
1268 * @param[in] pThumbnail Reference pointer to thumbnail data
1269 * @param[in] pUserData User parameter which is received from user when callback function was set
1270 * @remarks This function is issued in the context of gstreamer (video src thread).
1272 static void CaptureCb(camera_image_data_s* pImage, camera_image_data_s *pPostview, camera_image_data_s* pThumbnail, void* pUserData);
1275 * Function definition for capture completion callback.
1277 * @param[in] pUserData User parameter which is received from user when callback function was set
1278 * @remarks This function is issued in the context of gstreamer (video src thread).
1280 static void CaptureCompletedCb(void *pUserData);
1283 * Function definition for preview stream callback.
1285 * @param[in] pFrame frame data structure for stream
1286 * @param[in] pUserData User parameter which is received from user when callback function was set
1287 * @remarks This function is issued in the context of gstreamer (video src thread).
1289 static void PreviewCb(camera_preview_data_s *pFrame, void *pUSerData);
1292 * Function definition for interrupted callback.
1294 * @param[in] policy The policy which made the interruption
1295 * @param[in] previous Previous state
1296 * @param[in] current Current state
1297 * @param[in] pUserData User parameter which is received from user when callback function was set
1298 * @remarks This function is called in the camera created thread.
1300 static void InterruptedCb(camera_policy_e policy, camera_state_e previous, camera_state_e current, void *pUserData);
1304 * Function definition for error callback.
1306 * @param[in] error The cause which made the error
1307 * @param[in] current Current state
1308 * @param[in] pUserData User parameter which is received from user when callback function was set
1309 * @remarks This function is called in the camera created thread.
1311 static void ErrorCb(camera_error_e error, camera_state_e current, void *pUserData);
1314 * Function definition for focus changed callback.
1316 * @param[in] state focus state
1317 * @param[in] pUserData User parameter which is received from user when callback function was set
1318 * @remarks This function is called in the camera created thread.
1320 static void FocusStateChangedCb(camera_focus_state_e state, void *pUserData);
1323 * Function check fo this object is alive.
1325 * @return true if the object is alive, otherwise false.
1327 static bool IsAlive(void);
1330 * Gets the Impl instance.
1332 * @return The pointer to %_CameraImpl
1333 * @param[in] pCamera The %Camera pointer
1335 static _CameraImpl* GetInstance(Camera *pCamera);
1338 * Gets the Impl instance.
1340 * @return The pointer to %_CameraImpl
1341 * @param[in] pCamera The %Camera pointer
1343 static const _CameraImpl* GetInstance(const Camera *pCamera);
1347 * Converts the error from camera.
1349 * @return An error code
1350 * @param[in] err camera error
1352 result ConvertResult(int err) const;
1357 * @return An error code
1358 * @param[in] operation camcorder's operation type
1359 * @param[in] min min value
1360 * @param[in] max max value
1361 * @param[in] value value to be set
1363 result SetProperty(_CameraOperationType operation, int min, int max, int value);
1368 * @return An error code
1369 * @param[in] operation camcorder's operation type
1370 * @param[out] mmMin min value
1371 * @param[out] mmMax max value
1373 result GetProperty(_CameraOperationType operation, int& mmMin, int& mmMax) const;
1376 * Get the property list.
1378 * @return The property list
1379 * @param[in] operation camcorder's operation type
1380 * @param[in] itemQueryType item type for verifying the list
1381 * @remarks If the list's item type and itemQueryType parameter are not same, it returns null.
1383 Tizen::Base::Collection::IList* GetPropertyListN(_CameraOperationType operation, _ResultType itemQueryType) const;
1386 * Get the property list.
1388 * @return The property list
1389 * @param[in] key key name
1391 Tizen::Base::Collection::IList* GetPropertyListN(const Tizen::Base::String& key) const;
1394 * Re-load configuration.
1396 * @return An error code
1397 * @param[in] reload reload configuration field
1398 * @exception E_SUCCESS The method is successful.
1399 * @exception E_SYSTEM A system error has occurred.
1400 * @remarks Multiple configuration field can be set using reloadConf parameter appending.
1402 result ReloadConfiguration(int reload);
1405 * Load default configuration.
1407 * @return An error code
1408 * @param[in] reload reload configuration field
1409 * @exception E_SUCCESS The method is successful.
1410 * @exception E_SYSTEM A system error has occurred.
1412 result LoadDefaultConfiguration(int reload);
1415 * Change the focus state.
1417 * @return An error code
1418 * @param[in] currentMode focus' current mode
1419 * @param[in] destMode focus' destinationed mode
1420 * @exception E_SUCCESS The method is successful.
1421 * @exception E_SYSTEM A system error has occurred.
1423 result ChangeFocusModeTo(CameraFocusMode currentMode, CameraFocusMode destMode);
1426 * Handle the auto focus operations.
1428 * @return An error code
1429 * @param[in] currentMode focus' current mode
1430 * @exception E_SUCCESS The method is successful.
1431 * @exception E_SYSTEM A system error has occurred.
1433 result HandleAutoFocus(CameraFocusMode currentMode);
1436 * Sets the scene mode off.
1438 * @return An error code
1439 * @param[in] reload The reload flag
1440 * @exception E_SUCCESS The method is successful.
1441 * @exception E_DEVICE_FAILED The device operation has failed.
1442 * @exception E_SYSTEM A system error has occurred.
1444 result SetSceneModeOff(int reload);
1446 _CameraImpl(const _CameraImpl& camera);
1447 _CameraImpl& operator =(const _CameraImpl& camera);
1449 _CameraDeviceType __deviceType;
1450 _CameraCoordinator* __pCoordinator;
1451 _CameraCapability* __pCameraCapability;
1453 CameraState __state;
1454 _CameraHandle __handle;
1456 std::unique_ptr <_CameraEvent> __pCameraEvent;
1457 std::unique_ptr <_VideoStreamCoordinator> __pVideoStreamCoordinator;
1458 ICameraEventListener* __pCameraEventListener;
1459 std::unique_ptr <Tizen::Base::Collection::Queue, _ListPtrUtil::Remover> __pCaptureBufferQueue;
1460 std::unique_ptr <Tizen::Base::Collection::Queue, _ListPtrUtil::Remover> __pPreviewBufferQueue;
1462 bool __isConstructed;
1464 CameraSelection __selection;
1471 CameraEffect __effect;
1472 CameraWhiteBalance __wb;
1473 CameraQuality __quality;
1474 CameraIsoLevel __isoLevel;
1475 CameraFlashMode __flashMode;
1476 bool __zeroShutterLag;
1477 CameraMeteringMode __meteringMode;
1478 CameraSceneMode __sceneMode;
1479 bool __focusCallback;
1480 bool __isFocusAreaSet;
1482 Tizen::Graphics::Dimension __previewResolution;
1483 Tizen::Graphics::Dimension __deviceDefaultPreviewResolution; // device default
1484 Tizen::Graphics::Dimension __captureResolution;
1485 Tizen::Graphics::Dimension __deviceDefaultCaptureResolution; // device default
1487 Tizen::Graphics::PixelFormat __previewFormat;
1488 Tizen::Graphics::PixelFormat __deviceDefaultPreviewFormat; // device default
1489 Tizen::Graphics::PixelFormat __captureFormat;
1490 Tizen::Graphics::PixelFormat __deviceDefaultCaptureFormat; // device default
1492 CameraExifOrientation __exifOrientation;
1493 static const CameraExifOrientation CAMERA_EXIF_ORIENTATION_NONE = (CameraExifOrientation)-1;
1494 double __exifLatitude;
1495 double __exifLongitude;
1496 float __exifAltitude;
1498 CameraFlipType __flip;
1499 CameraRotation __previewRotation;
1501 CameraFocusMode __focusMode;
1503 int __previewProcessing;
1504 Tizen::Graphics::Rectangle __previewRegionRect;
1505 int __previewRegionHandle;
1506 camera_display_type_e __previewDisplayType;
1507 CameraRotation __displayRotationType;
1508 CameraDirection __physicalDirection;
1509 CameraRotation __physicalRotation;
1510 static const int MAX_FOCUS_POINT = 10;
1511 int __focusPoints[2][MAX_FOCUS_POINT];
1512 int __supportedFocusPointCount;
1514 static bool __isUsed;
1515 static const int MAX_CAMERA_PLANE_COUNT = 4;