From 3b9e2410ee49f0b452c463e9baf096f293ec670b Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Sun, 23 Oct 2022 17:41:17 +0900 Subject: [PATCH] Add new field "timestamp_nsec" in MMCamcorderVideoStreamDataType [Version] 0.10.278 [Issue Type] New feature Change-Id: I8b5548ded608f2ec26944359bb58a6105b328657 Signed-off-by: Jeongmo Yang --- packaging/libmm-camcorder.spec | 2 +- src/include/mm_camcorder.h | 35 ++++++++++++++++++----------------- src/mm_camcorder_gstcommon.c | 1 + 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index fb19bef..793d31d 100755 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.10.277 +Version: 0.10.278 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/include/mm_camcorder.h b/src/include/mm_camcorder.h index a171817..31d2127 100644 --- a/src/include/mm_camcorder.h +++ b/src/include/mm_camcorder.h @@ -1871,23 +1871,24 @@ typedef struct { int is_delta_frame; int is_header_included; } encoded, depth, rgb; - } data; /**< pointer of captured stream */ - MMCamStreamData 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 */ - int extra_stream_id; /**< ID of extra preview stream */ - int focus_state; /**< Focus state */ - int facing_direction; /**< Facing direction */ - int flip; /**< Flip */ - int rotation; /**< Rotation */ + } data; /**< pointer of captured stream */ + MMCamStreamData data_type; /**< data type */ + unsigned int length_total; /**< total length of stream buffer(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 */ + int extra_stream_id; /**< ID of extra preview stream */ + int focus_state; /**< Focus state */ + int facing_direction; /**< Facing direction */ + int flip; /**< Flip */ + int rotation; /**< Rotation */ + unsigned long long timestamp_nsec; /**< timestamp of stream buffer(nsec) */ } MMCamcorderVideoStreamDataType; diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c index e91f548..4b434d9 100644 --- a/src/mm_camcorder_gstcommon.c +++ b/src/mm_camcorder_gstcommon.c @@ -486,6 +486,7 @@ gboolean _mmcamcorder_invoke_video_stream_cb(MMHandleType handle, GstSample *sam MMCAM_LOG_DEBUG("VideoStreamData : format[%d], resolution[%dx%d], stream_id[%d]", stream.format, stream.width, stream.height, stream_id); + stream.timestamp_nsec = GST_BUFFER_PTS(buffer); stream.timestamp = (unsigned int)(GST_BUFFER_PTS(buffer) / 1000000); /* nano sec -> milli sec */ stream.extra_stream_id = stream_id; stream.internal_buffer = buffer; -- 2.7.4