]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugin-ducati.git/blobdiff - src/gstducatih264dec.c
ducatih264dec: assume no B frames for baseline profile
[glsdk/gst-plugin-ducati.git] / src / gstducatih264dec.c
index 561b2f07be47871e57cfb8e22c6c5a6edec036ea..e5eeba07a49321db6115cf3afd0cfa3bf9634c4e 100644 (file)
@@ -306,6 +306,19 @@ gst_ducati_h264dec_set_sink_caps (GstDucatiVidDec * self, GstCaps * caps)
   structure = gst_caps_get_structure (caps, 0);
   if (structure) {
     gint num_ref_frames = -1, num_reorder_frames = -1;
+    const char *profile;
+
+    /* baseline profile does not use B frames (and I'll say constrained-baseline
+       is unlikely either from the name, it's not present in my H264 spec... */
+    profile = gst_structure_get_string (structure, "profile");
+    if (profile && (!strcmp (profile, "baseline")
+            || !strcmp (profile, "constrained-baseline"))) {
+      GST_DEBUG_OBJECT (self, "No need for reordering for %s profile", profile);
+      self->backlog_maxframes = 0;
+      goto no_b_frames;
+    }
+
+
     if (gst_structure_get_int (structure, "num-ref-frames", &num_ref_frames)
         && num_ref_frames >= 0) {
       ((IH264VDEC_Params *) self->params)->maxNumRefFrames = num_ref_frames;
@@ -334,6 +347,8 @@ gst_ducati_h264dec_set_sink_caps (GstDucatiVidDec * self, GstCaps * caps)
         self->backlog_maxframes);
   }
 
+no_b_frames:
+
   return TRUE;
 }