h264parse: fix and optimize NAL collection function.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 26 Jun 2014 12:37:58 +0000 (14:37 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 26 Jun 2014 12:38:32 +0000 (14:38 +0200)
Use gst_h264_parser_identify_nalu_unchecked() to identify the next
NAL unit. We don't want to parse the full NAL unit, but only the
header bytes and possibly the first RBSP byte for identifying the
first_mb_in_slice syntax element.

Also fix check for failure when returning from that function. The
only success condition for that is GST_H264_PARSER_OK, so use it.

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

patches/videoparsers/0003-h264parse-fix-and-optimize-NAL-collection-function.patch [new file with mode: 0644]
patches/videoparsers/series.frag

diff --git a/patches/videoparsers/0003-h264parse-fix-and-optimize-NAL-collection-function.patch b/patches/videoparsers/0003-h264parse-fix-and-optimize-NAL-collection-function.patch
new file mode 100644 (file)
index 0000000..014a2f7
--- /dev/null
@@ -0,0 +1,41 @@
+From cf890efdb44feb4cfc728756bcf0ce1df17b8e9d Mon Sep 17 00:00:00 2001
+From: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
+Date: Tue, 24 Jun 2014 13:55:13 +0200
+Subject: [PATCH 3/8] h264parse: fix and optimize NAL collection function.
+
+Use gst_h264_parser_identify_nalu_unchecked() to identify the next
+NAL unit. We don't want to parse the full NAL unit, but only the
+header bytes and possibly the first RBSP byte for identifying the
+first_mb_in_slice syntax element.
+
+Also fix check for failure when returning from that function. The
+only success condition for that is GST_H264_PARSER_OK, so use it.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=732154
+
+Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
+---
+ gst/vaapi/gsth264parse.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gst/vaapi/gsth264parse.c b/gst/vaapi/gsth264parse.c
+index fff1d48..7a88a07 100644
+--- a/gst/vaapi/gsth264parse.c
++++ b/gst/vaapi/gsth264parse.c
+@@ -668,10 +668,10 @@ gst_h264_parse_collect_nal (GstH264Parse * h264parse, const guint8 * data,
+   GstH264NalUnit nnalu;
+   GST_DEBUG_OBJECT (h264parse, "parsing collected nal");
+-  parse_res = gst_h264_parser_identify_nalu (h264parse->nalparser, data,
+-      nalu->offset + nalu->size, size, &nnalu);
++  parse_res = gst_h264_parser_identify_nalu_unchecked (h264parse->nalparser,
++      data, nalu->offset + nalu->size, size, &nnalu);
+-  if (parse_res == GST_H264_PARSER_ERROR)
++  if (parse_res != GST_H264_PARSER_OK)
+     return FALSE;
+   /* determine if AU complete */
+-- 
+1.7.9.5
+
index 13612c5..14864ac 100644 (file)
@@ -3,5 +3,6 @@
 videoparsers_patches_base = \
        0001-plugins-compile-the-built-in-video-parsers-as-vaapip.patch \
        0002-h264parse-fix-build-with-GStreamer-1.2.patch               \
+       0003-h264parse-fix-and-optimize-NAL-collection-function.patch   \
        0003-h264parse-add-initial-support-for-MVC-NAL-units.patch      \
        $(NULL)