openh264: Conditionally support the main and high profiles
authorJan Schmidt <jan@centricular.com>
Mon, 27 Feb 2017 11:41:47 +0000 (22:41 +1100)
committerJan Schmidt <jan@centricular.com>
Wed, 30 Jan 2019 03:53:02 +0000 (14:53 +1100)
openh264 added main/high profile support upstream after the 1.8.0
release, so detect a version higher than that and support main/high
stream input

ext/openh264/gstopenh264dec.cpp

index aafccf0e43033fe71d25234e49a1a873887ff993..a8a3f90b3e7a6c64b581640184d07cff1dd582dc 100644 (file)
 #include <gst/video/gstvideodecoder.h>
 #include <string.h>             /* for memcpy */
 
+#if OPENH264_VERSION_CHECK (1,9)
+#define HAVE_OPENH264_MAIN_PROFILE 1
+#else
+#define HAVE_OPENH264_MAIN_PROFILE 0
+#endif
+
 GST_DEBUG_CATEGORY_STATIC (gst_openh264dec_debug_category);
 #define GST_CAT_DEFAULT gst_openh264dec_debug_category
 
@@ -62,7 +68,12 @@ GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS
     ("video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, "
-        "profile=(string){ constrained-baseline, baseline}"));
+#if HAVE_OPENH264_MAIN_PROFILE
+        "profile=(string){ constrained-baseline, baseline, main, high }"
+#else
+        "profile=(string){ constrained-baseline, baseline }"
+#endif
+    ));
 
 static GstStaticPadTemplate gst_openh264dec_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",