summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2013-02-02 18:44:11 +0100
committerJosep Torra <n770galaxy@gmail.com>2013-03-05 11:10:24 +0100
commit7726b12fe531d6ed713d156fa10631b727f2c456 (patch)
tree3a17f972d7c22aeb30f2d030fc90a4185c0cdfa9
parent14bea4ee6dd3422e4abd94ea6df7b230456f9ad7 (diff)
h264parse: separate fields for distinct functional uses of codec_data fieldvideoparsers
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692789 Conflicts: gst/videoparsers/gsth264parse.c
-rw-r--r--gst/videoparsers/gsth264parse.c8
-rw-r--r--gst/videoparsers/gsth264parse.h3
2 files changed, 8 insertions, 3 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 2ee6b7fda..2dcf2cfd7 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -201,6 +201,7 @@ gst_h264_parse_reset (GstH264Parse * h264parse)
h264parse->upstream_par_n = -1;
h264parse->upstream_par_d = -1;
gst_buffer_replace (&h264parse->codec_data, NULL);
+ gst_buffer_replace (&h264parse->codec_data_in, NULL);
h264parse->nal_length_size = 4;
h264parse->packetized = FALSE;
@@ -1051,8 +1052,8 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
GST_BUFFER_DATA (h264parse->codec_data), GST_BUFFER_SIZE (buf)))
modified = TRUE;
} else {
- if (h264parse->codec_data)
- buf = gst_buffer_ref (h264parse->codec_data);
+ if (!buf && h264parse->codec_data_in)
+ buf = gst_buffer_ref (h264parse->codec_data_in);
modified = TRUE;
}
}
@@ -1171,6 +1172,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
/* remove any left-over codec-data hanging around */
s = gst_caps_get_structure (caps, 0);
gst_structure_remove_field (s, "codec_data");
+ gst_buffer_replace (&h264parse->codec_data, NULL);
}
gst_pad_set_caps (GST_BASE_PARSE_SRC_PAD (h264parse), caps);
gst_caps_unref (caps);
@@ -1687,7 +1689,7 @@ gst_h264_parse_set_caps (GstBaseParse * parse, GstCaps * caps)
off = nalu.offset + nalu.size;
}
- h264parse->codec_data = gst_buffer_ref (codec_data);
+ gst_buffer_replace (&h264parse->codec_data_in, codec_data);
/* if upstream sets codec_data without setting stream-format and alignment, we
* assume stream-format=avc,alignment=au */
diff --git a/gst/videoparsers/gsth264parse.h b/gst/videoparsers/gsth264parse.h
index 61afe9387..9fa9d69b6 100644
--- a/gst/videoparsers/gsth264parse.h
+++ b/gst/videoparsers/gsth264parse.h
@@ -61,7 +61,10 @@ struct _GstH264Parse
gint aspect_ratio_idc;
gint sar_width, sar_height;
gint upstream_par_n, upstream_par_d;
+ /* current codec_data in output caps, if any */
GstBuffer *codec_data;
+ /* input codec_data, if any */
+ GstBuffer *codec_data_in;
guint nal_length_size;
gboolean packetized;