Support additional meta for preview frame 11/292911/1
authorJeongmo Yang <jm80.yang@samsung.com>
Mon, 24 Apr 2023 06:21:05 +0000 (15:21 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 17 May 2023 02:20:16 +0000 (11:20 +0900)
[Version] 0.10.291
[Issue Type] Update

Change-Id: I0e3eb384202e177970cf128295082b29ca8d6799
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/include/mm_camcorder.h
src/mm_camcorder_gstcommon.c

index deade19..2022afd 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    0.10.290
+Version:    0.10.291
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 9077402..8415b52 100644 (file)
@@ -1864,6 +1864,25 @@ typedef struct {
 
 
 /**
+ * Structure for metadata of stream buffer.
+ */
+typedef struct {
+       unsigned long long ts_soe;
+       unsigned long long ts_eoe;
+       unsigned long long ts_sof;
+       unsigned long long ts_eof;
+       unsigned long long ts_hal;
+       unsigned long long ts_qmf;
+       unsigned long long ts_gst;
+       unsigned long long td_exp;
+       unsigned long long ts_aux;
+       unsigned long long td_aux;
+       unsigned long long seqnum;
+       unsigned long long flags;
+} MMCamcorderFrameMeta;
+
+
+/**
  * Structure for video stream data.
  */
 #define BUFFER_MAX_PLANE_NUM 4
@@ -1912,16 +1931,7 @@ typedef struct {
        int flip;                           /**< Flip */
        int rotation;                       /**< Rotation */
        unsigned long long timestamp_nsec;  /**< timestamp of stream buffer(nsec) */
-       unsigned long long ts_soe;
-       unsigned long long ts_eoe;
-       unsigned long long ts_sof;
-       unsigned long long ts_eof;
-       unsigned long long ts_hal;
-       unsigned long long ts_qmf;
-       unsigned long long ts_gst;
-       unsigned long long td_exp;
-       unsigned long long ts_aux;
-       unsigned long long td_aux;
+       MMCamcorderFrameMeta frame_meta;   /**< Metadata of stream buffer */
 } MMCamcorderVideoStreamDataType;
 
 
index 4c0eeb4..cba91d2 100644 (file)
@@ -397,6 +397,7 @@ static const char *__mmcamcorder_get_parser_name(MMPixelFormatType format)
 static gboolean __mmcamcorder_frame_meta_foreach_func(GQuark field_id, const GValue *value, gpointer user_data)
 {
        MMCamcorderVideoStreamDataType *stream = (MMCamcorderVideoStreamDataType *)user_data;
+       MMCamcorderFrameMeta *frame_meta = NULL;
        const char *field_name = g_quark_to_string(field_id);
        guint64 field_value = g_value_get_uint64(value);
 
@@ -405,36 +406,44 @@ static gboolean __mmcamcorder_frame_meta_foreach_func(GQuark field_id, const GVa
                return TRUE;
        }
 
+       frame_meta = &stream->frame_meta;
+
        if (!strncmp("ts_soe", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_soe = field_value;
-               MMCAM_LOG_VERBOSE("[TS] SOE -> %llu", stream->ts_soe);
+               frame_meta->ts_soe = field_value;
+               MMCAM_LOG_VERBOSE("[TS] SOE -> %llu", frame_meta->ts_soe);
        } else if (!strncmp("ts_eoe", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_eoe = field_value;
-               MMCAM_LOG_VERBOSE("[TS] EOE -> %llu", stream->ts_eoe);
+               frame_meta->ts_eoe = field_value;
+               MMCAM_LOG_VERBOSE("[TS] EOE -> %llu", frame_meta->ts_eoe);
        } else if (!strncmp("ts_sof", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_sof = field_value;
-               MMCAM_LOG_VERBOSE("[TS] SOF -> %llu", stream->ts_sof);
+               frame_meta->ts_sof = field_value;
+               MMCAM_LOG_VERBOSE("[TS] SOF -> %llu", frame_meta->ts_sof);
        } else if (!strncmp("ts_eof", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_eof = field_value;
-               MMCAM_LOG_VERBOSE("[TS] EOF -> %llu", stream->ts_eof);
+               frame_meta->ts_eof = field_value;
+               MMCAM_LOG_VERBOSE("[TS] EOF -> %llu", frame_meta->ts_eof);
        } else if (!strncmp("ts_hal", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_hal = field_value;
-               MMCAM_LOG_VERBOSE("[TS] HAL -> %llu", stream->ts_hal);
+               frame_meta->ts_hal = field_value;
+               MMCAM_LOG_VERBOSE("[TS] HAL -> %llu", frame_meta->ts_hal);
        } else if (!strncmp("ts_qmf", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_qmf = field_value;
-               MMCAM_LOG_VERBOSE("[TS] QMF -> %llu", stream->ts_qmf);
+               frame_meta->ts_qmf = field_value;
+               MMCAM_LOG_VERBOSE("[TS] QMF -> %llu", frame_meta->ts_qmf);
        } else if (!strncmp("ts_gst", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_gst = field_value;
-               MMCAM_LOG_VERBOSE("[TS] GST -> %llu", stream->ts_gst);
+               frame_meta->ts_gst = field_value;
+               MMCAM_LOG_VERBOSE("[TS] GST -> %llu", frame_meta->ts_gst);
        } else if (!strncmp("td_exp", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->td_exp = field_value;
-               MMCAM_LOG_VERBOSE("[TD] EXP -> %llu", stream->td_exp);
+               frame_meta->td_exp = field_value;
+               MMCAM_LOG_VERBOSE("[TD] EXP -> %llu", frame_meta->td_exp);
        } else if (!strncmp("ts_aux", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->ts_aux = field_value;
-               MMCAM_LOG_VERBOSE("[TS] AUX -> %llu", stream->ts_aux);
+               frame_meta->ts_aux = field_value;
+               MMCAM_LOG_VERBOSE("[TS] AUX -> %llu", frame_meta->ts_aux);
        } else if (!strncmp("td_aux", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
-               stream->td_aux = field_value;
-               MMCAM_LOG_VERBOSE("[TD] AUX -> %llu", stream->td_aux);
+               frame_meta->td_aux = field_value;
+               MMCAM_LOG_VERBOSE("[TD] AUX -> %llu", frame_meta->td_aux);
+       } else if (!strncmp("seqnum", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
+               frame_meta->seqnum = field_value;
+               MMCAM_LOG_VERBOSE("SEQNUM -> %llu", frame_meta->seqnum);
+       } else if (!strncmp("flags", field_name, META_TIMESTAMP_FIELD_LENGTH)) {
+               frame_meta->flags = field_value;
+               MMCAM_LOG_VERBOSE("FLAGS -> %llu", frame_meta->flags);
        }
 
        return TRUE;