diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2013-07-11 17:46:37 +0300 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-07-12 10:06:05 +0200 |
commit | 654744a03c807b6c1f7ece6d8316a899237fda11 (patch) | |
tree | ab81b68b00b2268ca4885315e1e566f5c2841441 /gst/videoparsers/gstmpegvideoparse.c | |
parent | 1e7b3a8c9e0783acd34304f41dc35f277d9f64f2 (diff) | |
download | gstreamer-plugins-bad-654744a03c807b6c1f7ece6d8316a899237fda11.tar.gz |
mpegvideoparse: Use sequence_display_extension values to update the src caps
The caps should always represent what the user is supposed to see.
So if there is a sequence_display_extension associated with the
stream then use the display_horizontal_size/display_vertical_size
to update the src caps (if they are less than the values provided
by sequence header).
https://bugzilla.gnome.org/show_bug.cgi?id=704009
Diffstat (limited to 'gst/videoparsers/gstmpegvideoparse.c')
-rw-r--r-- | gst/videoparsers/gstmpegvideoparse.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c index 78dc85eb3..c0a2ffd04 100644 --- a/gst/videoparsers/gstmpegvideoparse.c +++ b/gst/videoparsers/gstmpegvideoparse.c @@ -737,8 +737,26 @@ gst_mpegv_parse_update_src_caps (GstMpegvParse * mpvparse) "parsed", G_TYPE_BOOLEAN, TRUE, NULL); if (mpvparse->sequencehdr.width > 0 && mpvparse->sequencehdr.height > 0) { - gst_caps_set_simple (caps, "width", G_TYPE_INT, mpvparse->sequencehdr.width, - "height", G_TYPE_INT, mpvparse->sequencehdr.height, NULL); + GstMpegVideoSequenceDisplayExt *seqdispext; + gint width, height; + + width = mpvparse->sequencehdr.width; + height = mpvparse->sequencehdr.height; + + if (mpvparse->config_flags & FLAG_SEQUENCE_DISPLAY_EXT) { + seqdispext = &mpvparse->sequencedispext; + + if (seqdispext->display_horizontal_size <= width + && seqdispext->display_vertical_size <= height) { + width = seqdispext->display_horizontal_size; + height = seqdispext->display_vertical_size; + GST_INFO_OBJECT (mpvparse, + "stream has display extension: display_width=%d display_height=%d", + width, height); + } + } + gst_caps_set_simple (caps, "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, NULL); } /* perhaps we have a framerate */ |