Adds NV21 format support 18/225918/1 submit/tizen/20200225.105031 submit/tizen/20200302.004345 submit/tizen/20200304.030752 submit/tizen/20200304.104357
authorHyunsoo Park <hance.park@samsung.com>
Tue, 25 Feb 2020 09:21:32 +0000 (18:21 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Tue, 25 Feb 2020 09:21:32 +0000 (18:21 +0900)
Change-Id: Icc1bebcd58f873c276a28d5da62187d3c14bd5f1
Signed-off-by: Hyunsoo Park <hance.park@samsung.com>
packaging/libmm-streamrecorder.spec
src/mm_streamrecorder_gstcommon.c
src/mm_streamrecorder_recorder.c

index 187f587..33d1200 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-streamrecorder
 Summary:    Media Stream Recorder library
-Version:    0.0.29
+Version:    0.0.30
 Release:    0
 Group:      Multimedia/Other
 License:    Apache-2.0
index 2ab6911..2543298 100644 (file)
@@ -333,6 +333,9 @@ GstCaps *gst_set_videosrcpad_caps_sw(gint srcfmt, gint width, gint height, gint
        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);
                break;
+       case MM_STREAMRECORDER_INPUT_FORMAT_NV21 :
+               caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "NV21", "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, rate, scale, NULL);
+               break;
        case MM_STREAMRECORDER_INPUT_FORMAT_I420 :
                caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "I420", "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", GST_TYPE_FRACTION, rate, scale, NULL);
                break;
index eb72cdb..efa126c 100644 (file)
@@ -700,11 +700,12 @@ 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)
+               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)
                        MMSTREAMRECORDER_G_OBJECT_SET(sc->encode_element[_MMSTREAMRECORDER_ENCSINK_VCONV].gst, "dst-buffer-num", hstreamrecorder->ini.convert_output_buffer_num);