From 6fc55a997e57d8a4547b58680b390a8f1394a2b8 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Thu, 30 Apr 2015 19:08:25 +0300 Subject: [PATCH] h265parse: Fix source caps to report cropped dimensions https://bugzilla.gnome.org/show_bug.cgi?id=747613 --- gst/videoparsers/gsth265parse.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 01546d9b7e..86f4f7a9cd 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -1329,9 +1329,24 @@ gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps) if (G_UNLIKELY (!sps)) { caps = gst_caps_copy (sink_caps); } else { - h265parse->width = sps->width; - h265parse->height = sps->height; - modified = TRUE; + gint crop_width, crop_height; + + if (sps->conformance_window_flag) { + crop_width = sps->crop_rect_width; + crop_height = sps->crop_rect_height; + } else { + crop_width = sps->width; + crop_height = sps->height; + } + + if (G_UNLIKELY (h265parse->width != crop_width || + h265parse->height != crop_height)) { + GST_INFO_OBJECT (h265parse, "resolution changed %dx%d", + crop_width, crop_height); + h265parse->width = crop_width; + h265parse->height = crop_height; + modified = TRUE; + } /* 0/1 is set as the default in the codec parser */ if (sps->vui_params.timing_info_present_flag &&