From 9355c5aac5f5917588bed69676113326e8df3e08 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Thu, 31 Aug 2023 11:06:16 +0900 Subject: [PATCH] Clean up dependency - Remove dependency(libtbm, mm-common, mm-camcorder) from pkgconfig file. - Remove headers from external packages in camera_internal.h file. - The direct dependencies with libtbm, mm-common and mm-camcorder will be removed from the pakcage using capi-media-camera. [Version] 0.4.114 [Issue Type] Clean up Change-Id: Ie6190f1fc436d9fdda8845c795727c6ca9d3cf8f Signed-off-by: Jeongmo Yang --- CMakeLists.txt | 2 +- include/camera_internal.h | 8 +-- include/camera_private.h | 1 + packaging/capi-media-camera.spec | 2 +- src/camera.c | 2 +- src/camera_internal.c | 135 ++++++++++++++++++++------------------- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca27ab3..8dc2cc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ SET(submodule "camera") # for package file SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common mm-camcorder capi-base-common capi-media-tool mmsvc-camera muse-client mm-display-interface") -SET(pc_dependents "capi-base-common capi-media-tool libtbm mm-common mm-camcorder") +SET(pc_dependents "capi-base-common capi-media-tool") SET(fw_name "${project_prefix}-${service}-${submodule}") PROJECT(${fw_name}) diff --git a/include/camera_internal.h b/include/camera_internal.h index b003d3a..c8b4367 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -18,9 +18,7 @@ #define __TIZEN_MULTIMEDIA_CAMERA_INTERNAL_H__ #include -#include -#include -#include + #ifdef __cplusplus extern "C" { @@ -145,8 +143,8 @@ int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window); * @param[in] data_bo_handle The bo handle of data * @param[out] frame The frame which will be filled */ -void camera_create_preview_frame(MMCamcorderVideoStreamDataType *stream, int num_buffer_fd, - tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame); +void camera_create_preview_frame(void *stream, int num_buffer_fd, + void *buffer_bo_handle, void *data_bo_handle, camera_preview_data_s *frame); /** * @internal diff --git a/include/camera_private.h b/include/camera_private.h index 9e5a180..ae540d0 100644 --- a/include/camera_private.h +++ b/include/camera_private.h @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 4d68fad..f19e85f 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.113 +Version: 0.4.114 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index c5b61c2..9c44551 100644 --- a/src/camera.c +++ b/src/camera.c @@ -21,12 +21,12 @@ #include #include #include -#include #include #include #include #include #include +#include #ifdef LOG_TAG #undef LOG_TAG diff --git a/src/camera_internal.c b/src/camera_internal.c index 6c42e74..06c117b 100644 --- a/src/camera_internal.c +++ b/src/camera_internal.c @@ -18,8 +18,6 @@ #include #include #include -#include -#include #include #include @@ -72,39 +70,42 @@ int camera_set_ecore_wl_display(camera_h camera, void *ecore_wl_window) //LCOV_EXCL_STOP -void camera_create_preview_frame(MMCamcorderVideoStreamDataType *stream, int num_buffer_fd, - tbm_bo_handle *buffer_bo_handle, tbm_bo_handle *data_bo_handle, camera_preview_data_s *frame) +void camera_create_preview_frame(void *stream, int num_buffer_fd, + void *buffer_bo_handle, void *data_bo_handle, camera_preview_data_s *frame) { int total_size = 0; unsigned char *buf_pos = NULL; + MMCamcorderVideoStreamDataType *_stream = (MMCamcorderVideoStreamDataType *)stream; + tbm_bo_handle *_buffer_bo_handle = (tbm_bo_handle *)buffer_bo_handle; + tbm_bo_handle *_data_bo_handle = (tbm_bo_handle *)data_bo_handle; - if (!stream || !buffer_bo_handle || !frame) { - CAM_LOG_ERROR("invalid param %p,%p,%p", stream, buffer_bo_handle, frame); + if (!_stream || !_buffer_bo_handle || !frame) { + CAM_LOG_ERROR("invalid param %p,%p,%p", _stream, _buffer_bo_handle, frame); return; } /* set frame info */ - if (stream->format == MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) + if (_stream->format == MM_PIXEL_FORMAT_ITLV_JPEG_UYVY) frame->format = MM_PIXEL_FORMAT_UYVY; else - frame->format = stream->format; + frame->format = _stream->format; - frame->width = stream->width; - frame->height = stream->height; - frame->timestamp = stream->timestamp; - frame->num_of_planes = stream->num_planes; + frame->width = _stream->width; + frame->height = _stream->height; + frame->timestamp = _stream->timestamp; + frame->num_of_planes = _stream->num_planes; if (num_buffer_fd == 0) { //LCOV_EXCL_START /* non-zero copy */ - if (!data_bo_handle || !data_bo_handle->ptr) { + if (!_data_bo_handle || !_data_bo_handle->ptr) { CAM_LOG_ERROR("NULL pointer"); return; } - buf_pos = data_bo_handle->ptr; + buf_pos = _data_bo_handle->ptr; - switch (stream->format) { + switch (_stream->format) { case MM_PIXEL_FORMAT_ENCODED_H264: /* fall through */ case MM_PIXEL_FORMAT_ENCODED_MJPEG: @@ -113,53 +114,53 @@ void camera_create_preview_frame(MMCamcorderVideoStreamDataType *stream, int num /* fall through */ case MM_PIXEL_FORMAT_ENCODED_VP9: frame->data.encoded_plane.data = buf_pos; - frame->data.encoded_plane.size = stream->data.encoded.length_data; - frame->data.encoded_plane.is_delta_frame = (bool)stream->data.encoded.is_delta_frame; - total_size = stream->data.encoded.length_data; + frame->data.encoded_plane.size = _stream->data.encoded.length_data; + frame->data.encoded_plane.is_delta_frame = (bool)_stream->data.encoded.is_delta_frame; + total_size = _stream->data.encoded.length_data; break; case MM_PIXEL_FORMAT_INVZ: frame->data.depth_plane.data = buf_pos; - frame->data.depth_plane.size = stream->data.depth.length_data; - total_size = stream->data.depth.length_data; + frame->data.depth_plane.size = _stream->data.depth.length_data; + total_size = _stream->data.depth.length_data; break; case MM_PIXEL_FORMAT_RGBA: /* fall through */ case MM_PIXEL_FORMAT_ARGB: frame->data.rgb_plane.data = buf_pos; - frame->data.rgb_plane.size = stream->data.rgb.length_data; - total_size = stream->data.rgb.length_data; + frame->data.rgb_plane.size = _stream->data.rgb.length_data; + total_size = _stream->data.rgb.length_data; break; default: - switch (stream->num_planes) { + switch (_stream->num_planes) { case 1: frame->data.single_plane.yuv = buf_pos; - frame->data.single_plane.size = stream->data.yuv420.length_yuv; - total_size = stream->data.yuv420.length_yuv; + frame->data.single_plane.size = _stream->data.yuv420.length_yuv; + total_size = _stream->data.yuv420.length_yuv; break; case 2: frame->data.double_plane.y = buf_pos; - frame->data.double_plane.y_size = stream->data.yuv420sp.length_y; - buf_pos += stream->data.yuv420sp.length_y; + frame->data.double_plane.y_size = _stream->data.yuv420sp.length_y; + buf_pos += _stream->data.yuv420sp.length_y; frame->data.double_plane.uv = buf_pos; - frame->data.double_plane.uv_size = stream->data.yuv420sp.length_uv; - total_size = stream->data.yuv420sp.length_y + \ - stream->data.yuv420sp.length_uv; + frame->data.double_plane.uv_size = _stream->data.yuv420sp.length_uv; + total_size = _stream->data.yuv420sp.length_y + \ + _stream->data.yuv420sp.length_uv; break; case 3: frame->data.triple_plane.y = buf_pos; - frame->data.triple_plane.y_size = stream->data.yuv420p.length_y; - buf_pos += stream->data.yuv420p.length_y; + frame->data.triple_plane.y_size = _stream->data.yuv420p.length_y; + buf_pos += _stream->data.yuv420p.length_y; frame->data.triple_plane.u = buf_pos; - frame->data.triple_plane.u_size = stream->data.yuv420p.length_u; - buf_pos += stream->data.yuv420p.length_u; + frame->data.triple_plane.u_size = _stream->data.yuv420p.length_u; + buf_pos += _stream->data.yuv420p.length_u; frame->data.triple_plane.v = buf_pos; - frame->data.triple_plane.v_size = stream->data.yuv420p.length_v; - total_size = stream->data.yuv420p.length_y + \ - stream->data.yuv420p.length_u + \ - stream->data.yuv420p.length_v; + frame->data.triple_plane.v_size = _stream->data.yuv420p.length_v; + total_size = _stream->data.yuv420p.length_y + \ + _stream->data.yuv420p.length_u + \ + _stream->data.yuv420p.length_v; break; default: break; @@ -169,48 +170,48 @@ void camera_create_preview_frame(MMCamcorderVideoStreamDataType *stream, int num //LCOV_EXCL_STOP } else { /* zero copy */ - switch (stream->num_planes) { + switch (_stream->num_planes) { //LCOV_EXCL_START case 1: - if (stream->data_type == MM_CAM_STREAM_DATA_ENCODED) { - frame->data.encoded_plane.data = buffer_bo_handle[0].ptr; - frame->data.encoded_plane.size = stream->data.encoded.length_data; - frame->data.encoded_plane.is_delta_frame = (bool)stream->data.encoded.is_delta_frame; - total_size = stream->data.encoded.length_data; + if (_stream->data_type == MM_CAM_STREAM_DATA_ENCODED) { + frame->data.encoded_plane.data = _buffer_bo_handle[0].ptr; + frame->data.encoded_plane.size = _stream->data.encoded.length_data; + frame->data.encoded_plane.is_delta_frame = (bool)_stream->data.encoded.is_delta_frame; + total_size = _stream->data.encoded.length_data; } else { - frame->data.single_plane.yuv = buffer_bo_handle[0].ptr; - frame->data.single_plane.size = stream->data.yuv420.length_yuv; - total_size = stream->data.yuv420.length_yuv; + frame->data.single_plane.yuv = _buffer_bo_handle[0].ptr; + frame->data.single_plane.size = _stream->data.yuv420.length_yuv; + total_size = _stream->data.yuv420.length_yuv; } break; //LCOV_EXCL_STOP case 2: - frame->data.double_plane.y = buffer_bo_handle[0].ptr; - if (stream->num_planes == (unsigned int)num_buffer_fd) - frame->data.double_plane.uv = buffer_bo_handle[1].ptr; + frame->data.double_plane.y = _buffer_bo_handle[0].ptr; + if (_stream->num_planes == (unsigned int)num_buffer_fd) + frame->data.double_plane.uv = _buffer_bo_handle[1].ptr; else - frame->data.double_plane.uv = buffer_bo_handle[0].ptr + stream->data.yuv420sp.length_y; - frame->data.double_plane.y_size = stream->data.yuv420sp.length_y; - frame->data.double_plane.uv_size = stream->data.yuv420sp.length_uv; - total_size = stream->data.yuv420sp.length_y + \ - stream->data.yuv420sp.length_uv; + frame->data.double_plane.uv = _buffer_bo_handle[0].ptr + _stream->data.yuv420sp.length_y; + frame->data.double_plane.y_size = _stream->data.yuv420sp.length_y; + frame->data.double_plane.uv_size = _stream->data.yuv420sp.length_uv; + total_size = _stream->data.yuv420sp.length_y + \ + _stream->data.yuv420sp.length_uv; break; case 3: //LCOV_EXCL_START - frame->data.triple_plane.y = buffer_bo_handle[0].ptr; - if (stream->num_planes == (unsigned int)num_buffer_fd) { - frame->data.triple_plane.u = buffer_bo_handle[1].ptr; - frame->data.triple_plane.v = buffer_bo_handle[2].ptr; + frame->data.triple_plane.y = _buffer_bo_handle[0].ptr; + if (_stream->num_planes == (unsigned int)num_buffer_fd) { + frame->data.triple_plane.u = _buffer_bo_handle[1].ptr; + frame->data.triple_plane.v = _buffer_bo_handle[2].ptr; } else { - frame->data.triple_plane.u = buffer_bo_handle[0].ptr + stream->data.yuv420p.length_y; - frame->data.triple_plane.v = frame->data.triple_plane.u + stream->data.yuv420p.length_u; + frame->data.triple_plane.u = _buffer_bo_handle[0].ptr + _stream->data.yuv420p.length_y; + frame->data.triple_plane.v = frame->data.triple_plane.u + _stream->data.yuv420p.length_u; } - frame->data.triple_plane.y_size = stream->data.yuv420p.length_y; - frame->data.triple_plane.u_size = stream->data.yuv420p.length_u; - frame->data.triple_plane.v_size = stream->data.yuv420p.length_v; - total_size = stream->data.yuv420p.length_y + \ - stream->data.yuv420p.length_u + \ - stream->data.yuv420p.length_v; + frame->data.triple_plane.y_size = _stream->data.yuv420p.length_y; + frame->data.triple_plane.u_size = _stream->data.yuv420p.length_u; + frame->data.triple_plane.v_size = _stream->data.yuv420p.length_v; + total_size = _stream->data.yuv420p.length_y + \ + _stream->data.yuv420p.length_u + \ + _stream->data.yuv420p.length_v; break; //LCOV_EXCL_STOP default: -- 2.7.4