summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-08-16 15:41:48 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2013-08-16 15:46:18 -0400
commit27bceba4adf6eaf3f0643958b4da4f8df791a0da (patch)
treeee053e0633662771ddf55f5e9cd2810616178845
parentb8f9d674bef05a4020cef6ab2a53b0f346232444 (diff)
downloadgstreamer-plugins-bad-27bceba4adf6eaf3f0643958b4da4f8df791a0da.tar.gz
mpeg4videoparse: Reparse the config if the size changed
Also only re-issue the caps update if the part of the config that changed is one we care about.
-rw-r--r--gst/videoparsers/gstmpeg4videoparse.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c
index 19ae48c7e..b5c128839 100644
--- a/gst/videoparsers/gstmpeg4videoparse.c
+++ b/gst/videoparsers/gstmpeg4videoparse.c
@@ -246,9 +246,11 @@ gst_mpeg4vparse_process_config (GstMpeg4VParse * mp4vparse,
const guint8 * data, guint offset, gsize size)
{
GstMpeg4VisualObject *vo;
+ GstMpeg4VideoObjectLayer vol = { 0 };
/* only do stuff if something new */
if (mp4vparse->config
+ && gst_buffer_get_size (mp4vparse->config) == size
&& !gst_buffer_memcmp (mp4vparse->config, offset, data, size))
return TRUE;
@@ -262,12 +264,27 @@ gst_mpeg4vparse_process_config (GstMpeg4VParse * mp4vparse,
/* If the parsing fail, we accept the config only if we don't have
* any config yet. */
- if (gst_mpeg4_parse_video_object_layer (&mp4vparse->vol,
+ if (gst_mpeg4_parse_video_object_layer (&vol,
vo, data + mp4vparse->vol_offset,
size - mp4vparse->vol_offset) != GST_MPEG4_PARSER_OK &&
mp4vparse->config)
return FALSE;
+ /* ignore update if nothing meaningful changed */
+ if (vol.height == mp4vparse->vol.height &&
+ vol.width == mp4vparse->vol.width &&
+ vol.vop_time_increment_resolution ==
+ mp4vparse->vol.vop_time_increment_resolution &&
+ vol.fixed_vop_time_increment == mp4vparse->vol.fixed_vop_time_increment &&
+ vol.par_width == mp4vparse->vol.par_width &&
+ vol.par_height == mp4vparse->vol.par_height &&
+ vol.sprite_enable == mp4vparse->vol.sprite_enable &&
+ vol.no_of_sprite_warping_points ==
+ mp4vparse->vol.no_of_sprite_warping_points)
+ return TRUE;
+
+ mp4vparse->vol = vol;
+
GST_LOG_OBJECT (mp4vparse, "Width/Height: %u/%u, "
"time increment resolution: %u fixed time increment: %u",
mp4vparse->vol.width, mp4vparse->vol.height,
@@ -514,13 +531,13 @@ gst_mpeg4vparse_update_src_caps (GstMpeg4VParse * mp4vparse)
GstCaps *caps = NULL;
GstStructure *s = NULL;
- GST_LOG_OBJECT (mp4vparse, "Updating caps");
-
/* only update if no src caps yet or explicitly triggered */
if (G_LIKELY (gst_pad_has_current_caps (GST_BASE_PARSE_SRC_PAD (mp4vparse)) &&
!mp4vparse->update_caps))
return;
+ GST_LOG_OBJECT (mp4vparse, "Updating caps");
+
/* carry over input caps as much as possible; override with our own stuff */
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SINK_PAD (mp4vparse));
if (caps) {