h264parse: parse SPS subset
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 19 Jan 2015 16:31:26 +0000 (17:31 +0100)
committerJan Schmidt <jan@centricular.com>
Tue, 20 Jan 2015 14:03:36 +0000 (01:03 +1100)
This patch calls gst_h264_parser_parse_subset_sps() when a
SPS subset NAL type is found.

All the bits required for parsing the SPS subset in NALs were
already there, just we need to call them when the this NAL type
is found.

With this parsing, the number of views (minus 1) attribute is
filled, which was a requirement for negotiating the stereo-high
profile.

https://bugzilla.gnome.org/show_bug.cgi?id=743174

gst/videoparsers/gsth264parse.c

index d14a1f1..fa72a94 100644 (file)
@@ -472,13 +472,16 @@ static const gchar *nal_names[] = {
   "AU delimiter",
   "Sequence End",
   "Stream End",
-  "Filler Data"
+  "Filler Data",
+  "SPS extension",
+  "Prefix",
+  "SPS Subset"
 };
 
 static const gchar *
 _nal_name (GstH264NalUnitType nal_type)
 {
-  if (nal_type <= GST_H264_NAL_FILLER_DATA)
+  if (nal_type <= GST_H264_NAL_SUBSET_SPS)
     return nal_names[nal_type];
   return "Invalid";
 }
@@ -574,14 +577,15 @@ gst_h264_parse_process_nal (GstH264Parse * h264parse, GstH264NalUnit * nalu)
     case GST_H264_NAL_SUBSET_SPS:
       if (!GST_H264_PARSE_STATE_VALID (h264parse, GST_H264_PARSE_STATE_GOT_SPS))
         return FALSE;
+      pres = gst_h264_parser_parse_subset_sps (nalparser, nalu, &sps, TRUE);
       goto process_sps;
 
     case GST_H264_NAL_SPS:
       /* reset state, everything else is obsolete */
       h264parse->state = 0;
+      pres = gst_h264_parser_parse_sps (nalparser, nalu, &sps, TRUE);
 
     process_sps:
-      pres = gst_h264_parser_parse_sps (nalparser, nalu, &sps, TRUE);
       /* arranged for a fallback sps.id, so use that one and only warn */
       if (pres != GST_H264_PARSER_OK) {
         GST_WARNING_OBJECT (h264parse, "failed to parse SPS:");