aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPooja Prajod2016-06-03 06:58:27 -0500
committerPooja Prajod2016-07-05 09:35:25 -0500
commit4304ca58b7fece8005b532f40a2723dc18db8256 (patch)
tree600f304b2376a29d1dbb8812467e9deb1ed99d66
parenta29898328c8e4f59e31b1e00dc82740f42571f42 (diff)
downloadgstreamer1-0-plugins-bad-4304ca58b7fece8005b532f40a2723dc18db8256.tar.gz
gstreamer1-0-plugins-bad-4304ca58b7fece8005b532f40a2723dc18db8256.tar.xz
gstreamer1-0-plugins-bad-4304ca58b7fece8005b532f40a2723dc18db8256.zip
gsth264parse: Fix create() width and height calculation
Ignore the frame_cropping flag set in the SPS and instead assign the maximum width and height. Also, always set SPS width and height instead of override by upstream components Signed-off-by: Ramprasad <x0038811@ti.com> Signed-off-by: Karthik Ramanan <a0393906@ti.com> Signed-off-by: Pooja Prajod <a0132412@ti.com>
-rw-r--r--gst/videoparsers/gsth264parse.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 1aeecf1..3d49f4a 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -1712,13 +1712,8 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
1712 gint fps_num, fps_den; 1712 gint fps_num, fps_den;
1713 gint par_n, par_d; 1713 gint par_n, par_d;
1714 1714
1715 if (sps->frame_cropping_flag) { 1715 crop_width = (sps->crop_rect_width > sps->width)? sps->crop_rect_width: sps->width;
1716 crop_width = sps->crop_rect_width; 1716 crop_height = (sps->crop_rect_height > sps->height)? sps->crop_rect_height: sps->height;
1717 crop_height = sps->crop_rect_height;
1718 } else {
1719 crop_width = sps->width;
1720 crop_height = sps->height;
1721 }
1722 1717
1723 if (G_UNLIKELY (h264parse->width != crop_width || 1718 if (G_UNLIKELY (h264parse->width != crop_width ||
1724 h264parse->height != crop_height)) { 1719 h264parse->height != crop_height)) {
@@ -1752,7 +1747,7 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
1752 } 1747 }
1753 1748
1754 if (G_UNLIKELY (modified || h264parse->update_caps)) { 1749 if (G_UNLIKELY (modified || h264parse->update_caps)) {
1755 gint width, height; 1750 gint width=0, height=0;
1756 GstClockTime latency; 1751 GstClockTime latency;
1757 1752
1758 const gchar *caps_mview_mode = NULL; 1753 const gchar *caps_mview_mode = NULL;
@@ -1764,16 +1759,13 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
1764 1759
1765 caps = gst_caps_copy (sink_caps); 1760 caps = gst_caps_copy (sink_caps);
1766 1761
1767 /* sps should give this but upstream overrides */
1768 if (s && gst_structure_has_field (s, "width")) 1762 if (s && gst_structure_has_field (s, "width"))
1769 gst_structure_get_int (s, "width", &width); 1763 gst_structure_get_int (s, "width", &width);
1770 else 1764 width = (width > h264parse->width)? width: h264parse->width;
1771 width = h264parse->width; 1765
1772
1773 if (s && gst_structure_has_field (s, "height")) 1766 if (s && gst_structure_has_field (s, "height"))
1774 gst_structure_get_int (s, "height", &height); 1767 gst_structure_get_int (s, "height", &height);
1775 else 1768 height = (height > h264parse->height)? height: h264parse->height;
1776 height = h264parse->height;
1777 1769
1778 if (s == NULL || 1770 if (s == NULL ||
1779 !gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n, 1771 !gst_structure_get_fraction (s, "pixel-aspect-ratio", &par_n,