summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2015-12-28 19:36:25 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2015-12-28 19:36:25 +0900
commit9fdbde95cd87fda1738867a86a390baca64eead8 (patch)
treed3be9ebdbc2bf173044231b67d2248d55984f184
parentf55256d0a2f330f5d93fdba4f3e420f351868743 (diff)
downloadcamera-9fdbde95cd87fda1738867a86a390baca64eead8.tar.gz
camera-9fdbde95cd87fda1738867a86a390baca64eead8.tar.bz2
camera-9fdbde95cd87fda1738867a86a390baca64eead8.zip
1. Support encoded data preview callback Change-Id: I42810dadcfbf37f3358060b619115d8b7a011202 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--include/camera.h5
-rw-r--r--packaging/capi-media-camera.spec4
-rw-r--r--src/camera.c67
3 files changed, 44 insertions, 32 deletions
diff --git a/include/camera.h b/include/camera.h
index 4440998..0fe79de 100644
--- a/include/camera.h
+++ b/include/camera.h
@@ -227,6 +227,11 @@ typedef struct {
unsigned int u_size; /**< The size of u data */
unsigned int v_size; /**< The size of v data */
} triple_plane; /**< triple plane frame data */
+
+ struct {
+ unsigned char *data; /**< The encoded data pointer */
+ unsigned int size; /**< The size of encoded data */
+ } encoded_plane;
} data;
} camera_preview_data_s;
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index 06c6d8b..51102ba 100644
--- a/packaging/capi-media-camera.spec
+++ b/packaging/capi-media-camera.spec
@@ -3,8 +3,8 @@
Name: capi-media-camera
Summary: A Camera API
-Version: 0.2.30
-Release: 2
+Version: 0.2.31
+Release: 0
Group: Multimedia/API
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
diff --git a/src/camera.c b/src/camera.c
index 2c46bbd..05378f2 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -561,36 +561,43 @@ static void _client_user_callback(camera_cb_info_s *cb_info, char *recv_msg, mus
if (num_buffer_key == 0) {
/* non-zero copy */
buf_pos += sizeof(MMCamcorderVideoStreamDataType);
- 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;
- 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.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;
- 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.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.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;
- break;
- default:
- break;
+
+ if (stream->format == MM_PIXEL_FORMAT_ENCODED_H264) {
+ frame.data.encoded_plane.data = buf_pos;
+ frame.data.encoded_plane.size = stream->data.encoded.length_data;
+ total_size = stream->data.encoded.length_data;
+ } else {
+ 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;
+ 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.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;
+ 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.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.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;
+ break;
+ default:
+ break;
+ }
}
} else {
/* zero copy */