diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2020-08-06 16:56:12 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2020-08-06 16:57:48 +0900 |
commit | 672ccddce9fba7226aedb5220a16005d53ac5016 (patch) | |
tree | e72de68316f8a4e18f3089e00a85584a2695ee15 /include | |
parent | 0104feb03bd551cfee7208b4a490954dd4a4defe (diff) | |
download | camera-672ccddce9fba7226aedb5220a16005d53ac5016.tar.gz camera-672ccddce9fba7226aedb5220a16005d53ac5016.tar.bz2 camera-672ccddce9fba7226aedb5220a16005d53ac5016.zip |
Add new internal APIs for camera framesubmit/tizen/20200819.022508submit/tizen/20200818.102105
- In fact, they are exported for new recorder API.
[Version] 0.4.37
[Issue Type] New feature
Change-Id: Ia32edf33fd5cf95a3d011781609d6d4e000e3920
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/camera_internal.h | 59 | ||||
-rw-r--r-- | include/camera_private.h | 46 |
2 files changed, 60 insertions, 45 deletions
diff --git a/include/camera_internal.h b/include/camera_internal.h index 18740ef..a9ac503 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -18,6 +18,8 @@ #define __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__ #include <camera.h> +#include <mm_types.h> +#include <tbm_surface_internal.h> #ifdef __cplusplus extern "C" { @@ -34,6 +36,51 @@ extern "C" { * @{ */ +#ifdef BUFFER_MAX_PLANE_NUM +#undef BUFFER_MAX_PLANE_NUM +#endif /* BUFFER_MAX_PLANE_NUM */ + +#define BUFFER_MAX_PLANE_NUM 4 + +typedef struct _camera_stream_data_s { + union { + struct { + unsigned char *yuv; + unsigned int length_yuv; + } yuv420, yuv422; + struct { + unsigned char *y; + unsigned int length_y; + unsigned char *uv; + unsigned int length_uv; + } yuv420sp; + struct { + unsigned char *y; + unsigned int length_y; + unsigned char *u; + unsigned int length_u; + unsigned char *v; + unsigned int length_v; + } yuv420p, yuv422p; + struct { + unsigned char *data; + unsigned int length_data; + int is_delta_frame; + } encoded, depth, rgb; + } data; /**< pointer of captured stream */ + int data_type; /**< data type */ + unsigned int length_total; /**< total length of stream buffer (in byte)*/ + unsigned int num_planes; /**< number of planes */ + MMPixelFormatType format; /**< image format */ + int width; /**< width of video buffer */ + int height; /**< height of video buffer */ + unsigned int timestamp; /**< timestamp of stream buffer (msec)*/ + void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */ + void *internal_buffer; /**< Internal buffer pointer */ + int stride[BUFFER_MAX_PLANE_NUM]; /**< Stride of each plane */ + int elevation[BUFFER_MAX_PLANE_NUM]; /**< Elevation of each plane */ +} camera_stream_data_s; + /** * @brief Start the evas rendering. * @@ -88,6 +135,18 @@ int camera_stop_evas_rendering(camera_h camera, bool keep_screen); int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window); /** + * @brief Creates preview frame from stream data. + * @since_tizen 6.0 + * @param[in] stream The stream from internal pipeline + * @param[in] num_buffer_fd The number of buffer fd + * @param[in] buffer_bo_handle The bo handle of buffer + * @param[in] data_bo_handle The bo handle of data + * @param[out] frame The frame which will be filled + */ +void camera_create_preview_frame(camera_stream_data_s *stream, int num_buffer_fd, + tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame); + +/** * @} */ #ifdef __cplusplus diff --git a/include/camera_private.h b/include/camera_private.h index b863bbc..3dfa516 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -21,7 +21,7 @@ #ifndef __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__ #define __TIZEN_MULTIMEDIA_CAMERA_PRIVATE_H__ #include <glib.h> -#include <camera.h> +#include <camera_internal.h> #include <muse_core.h> #include <muse_camera.h> #include <mm_display_interface.h> @@ -30,11 +30,6 @@ extern "C" { #endif -#ifdef BUFFER_MAX_PLANE_NUM -#undef BUFFER_MAX_PLANE_NUM -#endif /* BUFFER_MAX_PLANE_NUM */ - -#define BUFFER_MAX_PLANE_NUM 4 #define CAMERA_CB_TIMEOUT 4 #define CAMERA_CB_NO_TIMEOUT 0 @@ -64,45 +59,6 @@ enum { CAMERA_MESSAGE_HANDLER_TYPE_CAPTURE_CB }; -typedef struct _camera_stream_data_s { - union { - struct { - unsigned char *yuv; - unsigned int length_yuv; - } yuv420, yuv422; - struct { - unsigned char *y; - unsigned int length_y; - unsigned char *uv; - unsigned int length_uv; - } yuv420sp; - struct { - unsigned char *y; - unsigned int length_y; - unsigned char *u; - unsigned int length_u; - unsigned char *v; - unsigned int length_v; - } yuv420p, yuv422p; - struct { - unsigned char *data; - unsigned int length_data; - int is_delta_frame; - } encoded, depth, rgb; - } data; /**< pointer of captured stream */ - int data_type; /**< data type */ - unsigned int length_total; /**< total length of stream buffer (in byte)*/ - unsigned int num_planes; /**< number of planes */ - MMPixelFormatType format; /**< image format */ - int width; /**< width of video buffer */ - int height; /**< height of video buffer */ - unsigned int timestamp; /**< timestamp of stream buffer (msec)*/ - void *bo[BUFFER_MAX_PLANE_NUM]; /**< TBM buffer object */ - void *internal_buffer; /**< Internal buffer pointer */ - int stride[BUFFER_MAX_PLANE_NUM]; /**< Stride of each plane */ - int elevation[BUFFER_MAX_PLANE_NUM]; /**< Elevation of each plane */ -} camera_stream_data_s; - typedef struct _camera_msg_handler_info_s { int type; void *cb_info; |