From cc92ef1db20e6bb6a5305e9f15b20bcab8e83fa5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 24 Jul 2013 12:42:31 +0200 Subject: [PATCH] vrawdepay: fix UYVP format --- gst/rtp/gstrtpvrawdepay.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gst/rtp/gstrtpvrawdepay.c b/gst/rtp/gstrtpvrawdepay.c index c2fca1b069..7674122ee9 100644 --- a/gst/rtp/gstrtpvrawdepay.c +++ b/gst/rtp/gstrtpvrawdepay.c @@ -171,7 +171,7 @@ gst_rtp_vraw_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) GstRtpVRawDepay *rtpvrawdepay; gint clock_rate; const gchar *str; - gint format, width, height, pgroup, xinc, yinc; + gint format, width, height, depth, pgroup, xinc, yinc; GstCaps *srccaps; gboolean res; GstFlowReturn ret; @@ -194,6 +194,10 @@ gst_rtp_vraw_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) goto no_height; height = atoi (str); + if (!(str = gst_structure_get_string (structure, "depth"))) + goto no_depth; + depth = atoi (str); + /* optional interlace value but we don't handle interlaced * formats yet */ if (gst_structure_get_string (structure, "interlace")) @@ -218,8 +222,14 @@ gst_rtp_vraw_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) format = GST_VIDEO_FORMAT_AYUV; pgroup = 3; } else if (!strcmp (str, "YCbCr-4:2:2")) { - format = GST_VIDEO_FORMAT_UYVY; - pgroup = 4; + if (depth == 8) { + format = GST_VIDEO_FORMAT_UYVY; + pgroup = 4; + } else if (depth == 10) { + format = GST_VIDEO_FORMAT_UYVP; + pgroup = 5; + } else + goto unknown_format; xinc = 2; } else if (!strcmp (str, "YCbCr-4:2:0")) { format = GST_VIDEO_FORMAT_I420; @@ -268,6 +278,11 @@ no_height: GST_ERROR_OBJECT (depayload, "no height specified"); return FALSE; } +no_depth: + { + GST_ERROR_OBJECT (depayload, "no depth specified"); + return FALSE; + } interlaced: { GST_ERROR_OBJECT (depayload, "interlaced formats not supported yet"); @@ -434,6 +449,7 @@ gst_rtp_vraw_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) case GST_VIDEO_FORMAT_BGR: case GST_VIDEO_FORMAT_BGRA: case GST_VIDEO_FORMAT_UYVY: + case GST_VIDEO_FORMAT_UYVP: /* samples are packed just like gstreamer packs them */ offs /= xinc; datap = yp + (line * ystride) + (offs * pgroup);