Add new internal APIs for extra preview GOP interval
[platform/core/api/camera.git] / include / camera_internal.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
18 #define __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__
19
20 #include <camera.h>
21 #include <mm_types.h>
22 #include <tbm_surface_internal.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @file camera_internal.h
30  * @brief This file contains the internal Camera API, related structures and enumerations.
31  * @since_tizen 3.0
32  */
33
34 /**
35  * @addtogroup CAPI_MEDIA_CAMERA_INTERNAL_MODULE
36  * @{
37  */
38
39 #ifdef BUFFER_MAX_PLANE_NUM
40 #undef BUFFER_MAX_PLANE_NUM
41 #endif /* BUFFER_MAX_PLANE_NUM */
42
43 #define BUFFER_MAX_PLANE_NUM     4
44 #define CAMERA_DEVICE_MAX        ((CAMERA_DEVICE_CAMERA9 + 1) * 2)
45 #define DEVICE_NAME_MAX_LENGTH   64
46 #define DEVICE_ID_MAX_LENGTH     64
47
48 typedef struct _camera_stream_data_s {
49         union {
50                 struct {
51                         unsigned char *yuv;
52                         unsigned int length_yuv;
53                 } yuv420, yuv422;
54                 struct {
55                         unsigned char *y;
56                         unsigned int length_y;
57                         unsigned char *uv;
58                         unsigned int length_uv;
59                 } yuv420sp;
60                 struct {
61                         unsigned char *y;
62                         unsigned int length_y;
63                         unsigned char *u;
64                         unsigned int length_u;
65                         unsigned char *v;
66                         unsigned int length_v;
67                 } yuv420p, yuv422p;
68                 struct {
69                         unsigned char *data;
70                         unsigned int length_data;
71                         int is_delta_frame;
72                 } encoded, depth, rgb;
73         } data;                         /**< pointer of captured stream */
74         int data_type;                  /**< data type */
75         unsigned int length_total;      /**< total length of stream buffer (in byte)*/
76         unsigned int num_planes;        /**< number of planes */
77         MMPixelFormatType format;       /**< image format */
78         int width;                      /**< width of video buffer */
79         int height;                     /**< height of video buffer */
80         unsigned int timestamp;         /**< timestamp of stream buffer (msec)*/
81         void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */
82         void *internal_buffer;          /**< Internal buffer pointer */
83         int stride[BUFFER_MAX_PLANE_NUM];    /**< Stride of each plane */
84         int elevation[BUFFER_MAX_PLANE_NUM]; /**< Elevation of each plane */
85         int extra_stream_id;            /**< ID of extra preview stream */
86 } camera_stream_data_s;
87
88
89 typedef enum {
90         CAMERA_DEVICE_TYPE_BUILTIN = 0, /**< Built-in camera */
91         CAMERA_DEVICE_TYPE_USB,         /**< USB connected camera */
92         CAMERA_DEVICE_TYPE_NETWORK      /**< Network camera */
93 } camera_device_type_e;
94
95 typedef struct _camera_device_s {
96         camera_device_type_e type;
97         camera_device_e index;
98         char name[DEVICE_NAME_MAX_LENGTH];
99         char id[DEVICE_ID_MAX_LENGTH];
100         int extra_stream_num;
101 } camera_device_s;
102
103 typedef struct _camera_device_list_s {
104         unsigned int count;
105         camera_device_s device[CAMERA_DEVICE_MAX];
106 } camera_device_list_s;
107
108 typedef struct camera_device_manager *camera_device_manager_h;
109
110 /**
111  * @internal
112  * @brief Called when the connection state of a camera device was changed.
113  * @since_tizen 6.5
114  * @param[in] device        The camera device
115  * @param[in] is_connected  The state of device connection: (@c true = connected, @c false = disconnected)
116  * @param[in] user_data     The user data passed from the callback registration function
117  * @see camera_device_manager_add_device_connection_changed_cb()
118  * @see camera_device_manager_remove_device_connection_changed_cb()
119  */
120 typedef void (*camera_device_connection_changed_cb)(camera_device_s *device, bool is_connected, void *user_data);
121
122 /**
123  * @internal
124  * @brief Called to register for notifications about delivering a copy of the new extra preview frames.
125  * @since_tizen 6.5
126  * @param[in] frame     The reference pointer to extra preview stream data
127  * @param[in] stream_id The id of stream
128  * @param[in] user_data The user data passed from the callback registration function
129  * @pre camera_start_preview() will invoke this callback function if you register this callback using camera_set_extra_preview_cb().
130  * @see camera_start_preview()
131  * @see camera_set_extra_preview_cb()
132  * @see camera_unset_extra_preview_cb()
133  */
134 typedef void (*camera_extra_preview_cb)(camera_preview_data_s *frame, int stream_id, void *user_data);
135
136 /**
137  * @internal
138  * @brief Start the evas rendering.
139  * @since_tizen 3.0
140  * @param[in] camera The handle to the camera
141  * @return @c 0 on success, otherwise a negative error value
142  * @retval #CAMERA_ERROR_NONE Successful
143  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
144  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
145  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
146  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
147  */
148 int camera_start_evas_rendering(camera_h camera);
149
150 /**
151  * @internal
152  * @brief Stop the evas rendering.
153  * @since_tizen 3.0
154  * @param[in] camera The handle to the camera
155  * @param[in] keep_screen If @c true keep last frame on display, otherwise @c false
156  * @return @c 0 on success, otherwise a negative error value
157  * @retval #CAMERA_ERROR_NONE Successful
158  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
159  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
160  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
161  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
162  */
163 int camera_stop_evas_rendering(camera_h camera, bool keep_screen);
164
165 /**
166  * @internal
167  * @brief Sets the ecore wayland video display.
168  * @since_tizen 6.0
169  * @remarks This function must be called in main thread of the application.
170  *          Otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION by internal restriction.
171  *          To avoid #CAMERA_ERROR_INVALID_OPERATION in sub thread, ecore_thread_main_loop_begin() and
172  *          ecore_thread_main_loop_end() can be used, but deadlock can occur if the main thread is busy.
173  *          So, it's not recommended to use them.
174  * @param[in] camera The handle to the camera
175  * @param[in] ecore_wl_window The ecore wayland window handle
176  * @return @c 0 on success,
177  *         otherwise a negative error value
178  * @retval #CAMERA_ERROR_NONE Successful
179  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
180  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
181  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
182  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
183  * @pre The camera state must be set to #CAMERA_STATE_CREATED.
184  * @see camera_start_preview()
185  * @see ecore_thread_main_loop_begin()
186  * @see ecore_thread_main_loop_end()
187  */
188 int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window);
189
190 /**
191  * @internal
192  * @brief Creates preview frame from stream data.
193  * @since_tizen 6.0
194  * @param[in] stream The stream from internal pipeline
195  * @param[in] num_buffer_fd The number of buffer fd
196  * @param[in] buffer_bo_handle The bo handle of buffer
197  * @param[in] data_bo_handle The bo handle of data
198  * @param[out] frame The frame which will be filled
199  */
200 void camera_create_preview_frame(camera_stream_data_s *stream, int num_buffer_fd,
201         tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame);
202
203 /**
204  * @internal
205  * @brief Creates a new camera handle for controlling a network camera.
206  * @since_tizen 6.0
207  * @remarks A @a camera must be released using camera_destroy().
208  * @param[in]  device The network camera to access
209  * @param[out] camera A newly returned handle to the camera
210  * @return @c 0 on success, otherwise a negative error value
211  * @retval #CAMERA_ERROR_NONE Successful
212  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
213  * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
214  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
215  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
216  * @post If it succeeds, the camera state will be #CAMERA_STATE_CREATED.
217  *
218  * @see camera_destroy()
219  */
220 int camera_create_network(camera_device_e device, camera_h *camera);
221
222 /**
223  * @internal
224  * @brief Initialize a camera device manager.
225  * @since_tizen 6.0
226  * @param[out] manager A newly returned handle to the camera device manager
227  * @return @c 0 on success, otherwise a negative error value
228  * @retval #CAMERA_ERROR_NONE Successful
229  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
230  * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
231  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
232  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
233  * @see camera_device_manager_deinitialize()
234  */
235 int camera_device_manager_initialize(camera_device_manager_h *manager);
236
237 /**
238  * @internal
239  * @brief Deinitialize the camera device manager handle.
240  * @since_tizen 6.0
241  * @param[in] manager The handle to the camera device manager
242  * @return @c 0 on success, otherwise a negative error value
243  * @retval #CAMERA_ERROR_NONE Successful
244  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
245  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
246  * @see camera_device_manager_initialize()
247  */
248 int camera_device_manager_deinitialize(camera_device_manager_h manager);
249
250 /**
251  * @internal
252  * @brief Gets a list of available camera devices.
253  * @since_tizen 6.0
254  * @param[in]  manager The handle to the camera device manager
255  * @param[out] list    A list of available camera devices
256  * @return @c 0 on success, otherwise a negative error value
257  * @retval #CAMERA_ERROR_NONE Successful
258  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
259  * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
260  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
261  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
262  */
263 int camera_device_manager_get_device_list(camera_device_manager_h manager, camera_device_list_s *list);
264
265 /**
266  * @internal
267  * @brief Registers a callback function to be called when the connection state of camera device is changed.
268  * @since_tizen 6.5
269  * @param[in]  manager   The handle to the camera device manager
270  * @param[in]  callback  The callback function to register
271  * @param[in]  user_data The user data to be passed to the callback function
272  * @param[out] cb_id     The id of registered callback
273  * @return @c 0 on success, otherwise a negative error value
274  * @retval #CAMERA_ERROR_NONE Successful
275  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
276  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
277  * @retval #CAMERA_ERROR_OUT_OF_MEMORY Out of memory
278  * @post camera_device_connection_changed_cb() will be invoked when the connection state of camera device is changed.
279  * @see camera_device_manager_remove_device_connection_changed_cb()
280  * @see camera_device_connection_changed_cb()
281  */
282 int camera_device_manager_add_device_connection_changed_cb(camera_device_manager_h manager, camera_device_connection_changed_cb callback, void *user_data, int *cb_id);
283
284 /**
285  * @internal
286  * @brief Unregisters the callback function.
287  * @since_tizen 6.5
288  * @param[in] manager The handle to the camera device manager
289  * @param[in] cb_id   The id of registered callback
290  * @return @c 0 on success, otherwise a negative error value
291  * @retval #CAMERA_ERROR_NONE Successful
292  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
293  * @retval #CAMERA_ERROR_INVALID_OPERATION Invalid operation
294  * @see camera_device_manager_add_device_changed_cb()
295  */
296 int camera_device_manager_remove_device_connection_changed_cb(camera_device_manager_h manager, int cb_id);
297
298 /**
299  * @internal
300  * @brief Sets the brightness level of flash.
301  * @since_tizen 6.5
302  * @remarks If the min value is greater than the max value from camera_attr_get_flash_brightness_range(), \n
303  *          it means that this feature is not supported.
304  * @param[in] camera The handle to the camera
305  * @param[in] level The brightness level of flash
306  * @return @c 0 on success, otherwise a negative error value
307  * @retval #CAMERA_ERROR_NONE Successful
308  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
309  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
310  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
311  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
312  * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
313  * @see camera_attr_get_flash_brightness()
314  * @see camera_attr_get_flash_brightness_range()
315  */
316 int camera_attr_set_flash_brightness(camera_h camera, int level);
317
318 /**
319  * @internal
320  * @brief Gets the brightness level of flash.
321  * @since_tizen 6.5
322  * @param[in]  camera The handle to the camera
323  * @param[out] level  The brightness level of flash
324  * @return @c 0 on success, otherwise a negative error value
325  * @retval #CAMERA_ERROR_NONE Successful
326  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
327  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
328  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
329  * @see camera_attr_set_flash_brightness()
330  * @see camera_attr_get_flash_brightness_range()
331  */
332 int camera_attr_get_flash_brightness(camera_h camera, int *level);
333
334 /**
335  * @internal
336  * @brief Gets the available brightness level of flash.
337  * @since_tizen 6.5
338  * @remarks If the min value is greater than the max value, it means that this feature is not supported.
339  * @param[in]  camera The handle to the camera
340  * @param[out] min    The minimum brightness level of flash
341  * @param[out] max    The maximum brightness level of flash
342  * @return @c 0 on success, otherwise a negative error value
343  * @retval #CAMERA_ERROR_NONE Successful
344  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
345  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
346  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
347  * @see camera_attr_set_flash_brightness()
348  * @see camera_attr_get_flash_brightness()
349  */
350 int camera_attr_get_flash_brightness_range(camera_h camera, int *min, int *max);
351
352 /**
353  * @internal
354  * @brief Registers a callback function to be called for extra preview frames.
355  * @since_tizen 6.5
356  * @param[in] camera    The handle to the camera
357  * @param[in] callback  The callback function to be registered
358  * @param[in] user_data The user data to be passed to the callback function
359  * @return @c 0 on success, otherwise a negative error value
360  * @retval #CAMERA_ERROR_NONE Successful
361  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
362  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
363  * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
364  * @see camera_start_preview()
365  * @see camera_unset_extra_preview_cb()
366  * @see camera_extra_preview_cb()
367  */
368 int camera_set_extra_preview_cb(camera_h camera, camera_extra_preview_cb callback, void *user_data);
369
370 /**
371  * @internal
372  * @brief Unregisters the callback function.
373  * @since_tizen 6.5
374  * @param[in] camera The handle to the camera
375  * @return @c 0 on success, otherwise a negative error value
376  * @retval #CAMERA_ERROR_NONE Successful
377  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
378  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
379  * @see camera_set_extra_preview_cb()
380  */
381 int camera_unset_extra_preview_cb(camera_h camera);
382
383 /**
384  * @internal
385  * @brief Sets the extra preview stream format.
386  * @since_tizen 6.5
387  * @param[in] camera       The handle to the camera
388  * @param[in] stream_id    The id of extra preview stream
389  * @param[in] pixel_format The pixel format of extra preview stream
390  * @param[in] width        The width of extra preview stream
391  * @param[in] height       The height of extra preview stream
392  * @param[in] fps          The fps of extra preview stream
393  * @return @c 0 on success, otherwise a negative error value
394  * @retval #CAMERA_ERROR_NONE Successful
395  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
396  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
397  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
398  * @pre The camera state must be set to #CAMERA_STATE_CREATED or #CAMERA_STATE_PREVIEW.
399  * @see camera_start_preview()
400  * @see camera_set_extra_preview_cb()
401  * @see camera_unset_extra_preview_cb()
402  * @see camera_get_extra_preview_stream_format()
403  */
404 int camera_set_extra_preview_stream_format(camera_h camera, int stream_id, camera_pixel_format_e pixel_format, int width, int height, int fps);
405
406 /**
407  * @internal
408  * @brief Gets the extra preview stream format.
409  * @since_tizen 6.5
410  * @param[in] camera        The handle to the camera
411  * @param[in] stream_id     The id of extra preview stream
412  * @param[out] pixel_format The pixel format of extra preview stream
413  * @param[out] width        The width of extra preview stream
414  * @param[out] height       The height of extra preview stream
415  * @param[out] fps          The fps of extra preview stream
416  * @return @c 0 on success, otherwise a negative error value
417  * @retval #CAMERA_ERROR_NONE Successful
418  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
419  * @retval #CAMERA_ERROR_INVALID_STATE Invalid state
420  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
421  * @pre The camera state must be set to #CAMERA_STATE_PREVIEW.
422  * @see camera_start_preview()
423  * @see camera_set_extra_preview_cb()
424  * @see camera_unset_extra_preview_cb()
425  * @see camera_set_extra_preview_stream_format()
426  */
427 int camera_get_extra_preview_stream_format(camera_h camera, int stream_id, camera_pixel_format_e *pixel_format, int *width, int *height, int *fps);
428
429 /**
430  * @internal
431  * @brief Sets the manual focus level.
432  * @since_tizen 6.5
433  * @remarks The auto focusing will be stopped when camera_attr_set_focus_level() is called.
434  * @param[in] camera The handle to the camera
435  * @param[in] level The manual focus level
436  * @return @c 0 on success, otherwise a negative error value
437  * @retval #CAMERA_ERROR_NONE Successful
438  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
439  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
440  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
441  * @see camera_attr_get_focus_level()
442  * @see camera_attr_get_focus_level_range()
443  */
444 int camera_attr_set_focus_level(camera_h camera, int level);
445
446 /**
447  * @internal
448  * @brief Gets the manual focus level.
449  * @since_tizen 6.5
450  * @param[in] camera The handle to the camera
451  * @param[out] level The manual focus level
452  * @return @c 0 on success, otherwise a negative error value
453  * @retval #CAMERA_ERROR_NONE Successful
454  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
455  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
456  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
457  * @see camera_attr_set_focus_level()
458  * @see camera_attr_get_focus_level_range()
459  */
460 int camera_attr_get_focus_level(camera_h camera, int *level);
461
462 /**
463  * @internal
464  * @brief Gets lower limit and upper limit for manual focus level.
465  * @since_tizen 6.5
466  * @remarks If the min value is greater than the max value, it means that this feature is not supported.
467  * @param[in] camera The handle to the camera
468  * @param[out] min The lower limit for manual focus level
469  * @param[out] max The upper limit for manual focus level
470  * @return @c 0 on success, otherwise a negative error value
471  * @retval #CAMERA_ERROR_NONE Successful
472  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
473  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
474  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
475  * @see camera_attr_set_focus_level()
476  * @see camera_attr_get_focus_level()
477  */
478 int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max);
479
480 /**
481  * @internal
482  * @brief Sets the bitrate of extra preview.
483  * @since_tizen 6.5
484  * @param[in] camera    The handle to the camera
485  * @param[in] stream_id The id of extra preview stream
486  * @param[in] bitrate   The bitrate(bps) of extra preview
487  * @return @c 0 on success, otherwise a negative error value
488  * @retval #CAMERA_ERROR_NONE Successful
489  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
490  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
491  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
492  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
493  * @see camera_attr_get_extra_preview_bitrate()
494  */
495 int camera_attr_set_extra_preview_bitrate(camera_h camera, int stream_id, int bitrate);
496
497 /**
498  * @internal
499  * @brief Gets the bitrate of extra preview.
500  * @since_tizen 6.5
501  * @param[in] camera    The handle to the camera
502  * @param[in] stream_id The id of extra preview stream
503  * @param[out] bitrate  The bitrate(bps) of extra preview stream
504  * @return @c 0 on success, otherwise a negative error value
505  * @retval #CAMERA_ERROR_NONE Successful
506  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
507  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
508  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
509  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
510  * @see camera_attr_set_extra_preview_bitrate()
511  */
512 int camera_attr_get_extra_preview_bitrate(camera_h camera, int stream_id, int *bitrate);
513
514 /**
515  * @internal
516  * @brief Sets the GOP (Group Of Pictures) interval of extra preview.
517  * @since_tizen 6.5
518  * @remarks The recommended range is from 1,000 (1 second) to 600,000 (10 minutes). \n
519  *          But, due to codec limitations, it may not apply.
520  * @param[in] camera    The handle to the camera
521  * @param[in] stream_id The id of extra preview stream
522  * @param[in] interval  The GOP interval of extra preview (millisecond)
523  * @return @c 0 on success, otherwise a negative error value
524  * @retval #CAMERA_ERROR_NONE Successful
525  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
526  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
527  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
528  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
529  * @see camera_attr_get_extra_preview_gop_interval()
530  */
531 int camera_attr_set_extra_preview_gop_interval(camera_h camera, int stream_id, int interval);
532
533 /**
534  * @internal
535  * @brief Gets the GOP (Group Of Pictures) interval of extra preview.
536  * @since_tizen 6.5
537  * @param[in] camera    The handle to the camera
538  * @param[in] stream_id The id of extra preview stream
539  * @param[out] interval The GOP interval of extra preview (millisecond)
540  * @return @c 0 on success, otherwise a negative error value
541  * @retval #CAMERA_ERROR_NONE Successful
542  * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error
543  * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter
544  * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported
545  * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected
546  * @see camera_attr_set_extra_preview_gop_interval()
547  */
548 int camera_attr_get_extra_preview_gop_interval(camera_h camera, int stream_id, int *interval);
549
550 /**
551  * @}
552  */
553 #ifdef __cplusplus
554 }
555 #endif
556
557 #endif /* __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__ */