Change mediapacket usage 08/227608/5 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.114501 accepted/tizen/6.0/unified/hotfix/20201103.003106 accepted/tizen/unified/20200326.215045 submit/tizen/20200325.100145 submit/tizen/20200326.024055 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
authorHyunsoo Park <hance.park@samsung.com>
Fri, 13 Mar 2020 05:57:16 +0000 (14:57 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Fri, 20 Mar 2020 07:03:12 +0000 (16:03 +0900)
Change-Id: I226b832ed7cd9fd08a52d8a1c6eef6ad6ca3ff89
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
packaging/libmm-streamrecorder.spec
src/mm_streamrecorder_gstcommon.c
src/mm_streamrecorder_internal.c
src/mm_streamrecorder_recorder.c

index 33d1200..3c6bfc5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-streamrecorder
 Summary:    Media Stream Recorder library
-Version:    0.0.30
+Version:    0.0.31
 Release:    0
 Group:      Multimedia/Other
 License:    Apache-2.0
index 2543298..548d844 100644 (file)
@@ -328,7 +328,7 @@ GstCaps *gst_set_videosrcpad_caps_sw(gint srcfmt, gint width, gint height, gint
 {
 
        GstCaps *caps = NULL;
-
+       gchar *type  = NULL;
        switch (srcfmt) {
        case MM_STREAMRECORDER_INPUT_FORMAT_NV12 :
                caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "NV12", "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, rate, scale, NULL);
@@ -350,11 +350,11 @@ GstCaps *gst_set_videosrcpad_caps_sw(gint srcfmt, gint width, gint height, gint
        if (!caps)
                _mmstreamrec_dbg_err("failed to alloc caps");
 
-       /* gchar *type = gst_caps_to_string(caps); */
+       type = gst_caps_to_string(caps);
 
-       /* _mmstreamrec_dbg_warn("Set srcpad caps: %s",type); */
+       _mmstreamrec_dbg_warn("Set srcfmt %d caps: %s",srcfmt, type);
 
-       /* g_free(type); */
+       g_free(type);
 
        return caps;
 }
index b446eed..863755a 100644 (file)
@@ -496,15 +496,17 @@ int _mmstreamrecorder_push_stream_buffer(MMHandleType handle, MMStreamRecorderSt
        GST_BUFFER_DURATION(stream_buffer->buffer) = GST_CLOCK_TIME_NONE;
 
        if (streamtype == MM_STREAM_TYPE_VIDEO) {
-               if (format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 || format == MM_STREAMRECORDER_INPUT_FORMAT_NV21) {
+               if (format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+                       format == MM_STREAMRECORDER_INPUT_FORMAT_NV21) {
 
                        MMVideoBuffer *video_buf = (MMVideoBuffer *)buffer;
+
                        /* Buffer at 0th position */
                        gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
                                                                video_buf->data[0], size, 0, size, video_buf->data[0], NULL));
                        /* Buffer at 1st position */
                        gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
-                                                               video_buf, sizeof(MMVideoBuffer), 0, sizeof(MMVideoBuffer), stream_buffer, _mmstreamrecorder_buffer_destroy));
+                                                               video_buf->data[1], size / 2, 0, size / 2, stream_buffer, _mmstreamrecorder_buffer_destroy));
                } else {
                        gst_buffer_append_memory(stream_buffer->buffer, gst_memory_new_wrapped(GST_MEMORY_FLAG_READONLY,
                                                                buffer, size, 0, size, stream_buffer, _mmstreamrecorder_buffer_destroy));
index efa126c..9f8b35c 100644 (file)
@@ -700,13 +700,15 @@ int _mmstreamrecorder_create_encodesink_bin(MMHandleType handle, MMStreamRecorde
 
                MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_ENCBIN].gst, "auto-colorspace", hstreamrecorder->ini.encsink_bin_auto_colorspace);
 
-               if (video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 || video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV21 )
+               if (video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+                       video_src_format == MM_STREAMRECORDER_INPUT_FORMAT_NV21)
                        video_src_format = MM_STREAMRECORDER_INPUT_FORMAT_I420;
 
                caps = gst_set_videosrcpad_caps_sw(video_src_format, video_width, video_height, video_fps, 1);
                MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_ENCBIN].gst, "vcaps", caps);
 
-               if (video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV12)
+               if (video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV12 ||
+                       video_src_format != MM_STREAMRECORDER_INPUT_FORMAT_NV21)
                        MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_VCONV].gst, "dst-buffer-num", hstreamrecorder->ini.convert_output_buffer_num);
 
                /* state tuning */
@@ -1570,9 +1572,6 @@ int _mmstreamrecorder_push_videostream_buffer(MMHandleType handle, unsigned long
 
        if (sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst) {
 
-               /*_mmstreamrec_dbg_log("Buffer Push start , time stamp %ld",timestamp);*/
-               /* srcpad = gst_element_get_static_pad(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst, "src"); */
-               /* srccaps = gst_pad_get_current_caps(srcpad); */
                srccaps = gst_set_videosrcpad_caps_sw(video_src, video_width, video_height, video_fps, 1);
                if (srccaps) {
                        gst_app_src_set_caps((GstAppSrc *) sc->encode_element[_MMSTREAMRECORDER_ENCSINK_SRC].gst, srccaps);