[1.0.8] fix encoder caps error 60/284460/2 accepted/tizen/unified/20221121.163712
authorEunhye Choi <eunhae1.choi@samsung.com>
Thu, 17 Nov 2022 09:46:50 +0000 (18:46 +0900)
committerEunhye Choi <eunhae1.choi@samsung.com>
Thu, 17 Nov 2022 10:43:10 +0000 (19:43 +0900)
- pipeline state is not changed normally
  if the caps is invalid

Change-Id: I6efd9658373a301411adddf262f356b1937d621d

packaging/capi-media-transporter.spec
src/MediaSourceBinBaseVideo.cpp
src/MediaTransporterGst.cpp

index 29ce78f15c1ebb462aaed22b24c98e3f7f3ffa59..262d77aa83dd742ad0bb3109e34c7bb4cc8865d8 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-transporter
 Summary:    A Media Transporter library in Tizen Native API
-Version:    1.0.7
+Version:    1.0.8
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index eb0e7e6f0afb95c2ef30c7de4164e9483380c11d..a3a8f22fb179cdb8027f134de9a3160239e03aa8 100644 (file)
@@ -112,6 +112,10 @@ std::vector<GstElement*> MediaSourceBinBaseVideo::createVideoRestOfElements(cons
 
                sinkCaps = __makeVideoDefaultEncodedCaps(ini);
                if (sinkCaps) {
+                       std::string encoderName = GST_ELEMENT_NAME(encoder);
+                       if (encoderName.find("v4l2h264enc") != std::string::npos)
+                               gst_caps_set_simple(sinkCaps, "level", G_TYPE_STRING, "3", NULL);
+
                        gst::_printCaps(sinkCaps, ELEMENT_NAME_ENCODE_CAPSFILTER);
                        g_object_set(G_OBJECT(capsfilter2), "caps", sinkCaps, NULL);
                        gst_caps_unref(sinkCaps);
index b68b9d007396b9687e042803b29621666196aedf..0eed11e8c405e0abf9d1d7ed9ba963bc21eeab5a 100644 (file)
@@ -778,7 +778,7 @@ void gst::_updateCaps(GstElement* element, const param::videoInfo& vInfo)
                                vInfo.frameRate, 1, NULL);
 
        if (!gst_caps_is_equal(oldCaps, newCaps)) {
-         gst::_printCaps(newCaps, "newCaps");
+               gst::_printCaps(newCaps, "newCaps");
                g_object_set(G_OBJECT(element), "caps", newCaps, NULL);
        }
 
@@ -792,9 +792,6 @@ void gst::_updateEncCaps(GstElement* element, const param::videoInfo& vInfo)
        RET_IF(!oldCaps, "capsfilter has no caps");
 
        GstCaps* newCaps = gst_caps_copy(oldCaps);
-       std::string elementName = GST_ELEMENT_NAME(element);
-       if (elementName.find("v4l2h264enc"))
-               gst_caps_set_simple(newCaps, "level", G_TYPE_STRING, "3", NULL);
 
        if (vInfo.width > 0)
                gst_caps_set_simple(newCaps, "width", G_TYPE_INT, vInfo.width, NULL);
@@ -803,7 +800,7 @@ void gst::_updateEncCaps(GstElement* element, const param::videoInfo& vInfo)
                gst_caps_set_simple(newCaps, "height", G_TYPE_INT, vInfo.height, NULL);
 
        if (!gst_caps_is_equal(oldCaps, newCaps)) {
-         gst::_printCaps(newCaps, "Change newCaps");
+               gst::_printCaps(newCaps, "Change newCaps");
                g_object_set(G_OBJECT(element), "caps", newCaps, NULL);
        }