vrawdepay: fix UYVP format

This commit is contained in:
Wim Taymans 2013-07-24 12:42:31 +02:00
parent 8191b6fcd2
commit cc92ef1db2

View File

@ -171,7 +171,7 @@ gst_rtp_vraw_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
GstRtpVRawDepay *rtpvrawdepay; GstRtpVRawDepay *rtpvrawdepay;
gint clock_rate; gint clock_rate;
const gchar *str; const gchar *str;
gint format, width, height, pgroup, xinc, yinc; gint format, width, height, depth, pgroup, xinc, yinc;
GstCaps *srccaps; GstCaps *srccaps;
gboolean res; gboolean res;
GstFlowReturn ret; GstFlowReturn ret;
@ -194,6 +194,10 @@ gst_rtp_vraw_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
goto no_height; goto no_height;
height = atoi (str); 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 /* optional interlace value but we don't handle interlaced
* formats yet */ * formats yet */
if (gst_structure_get_string (structure, "interlace")) 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; format = GST_VIDEO_FORMAT_AYUV;
pgroup = 3; pgroup = 3;
} else if (!strcmp (str, "YCbCr-4:2:2")) { } else if (!strcmp (str, "YCbCr-4:2:2")) {
if (depth == 8) {
format = GST_VIDEO_FORMAT_UYVY; format = GST_VIDEO_FORMAT_UYVY;
pgroup = 4; pgroup = 4;
} else if (depth == 10) {
format = GST_VIDEO_FORMAT_UYVP;
pgroup = 5;
} else
goto unknown_format;
xinc = 2; xinc = 2;
} else if (!strcmp (str, "YCbCr-4:2:0")) { } else if (!strcmp (str, "YCbCr-4:2:0")) {
format = GST_VIDEO_FORMAT_I420; format = GST_VIDEO_FORMAT_I420;
@ -268,6 +278,11 @@ no_height:
GST_ERROR_OBJECT (depayload, "no height specified"); GST_ERROR_OBJECT (depayload, "no height specified");
return FALSE; return FALSE;
} }
no_depth:
{
GST_ERROR_OBJECT (depayload, "no depth specified");
return FALSE;
}
interlaced: interlaced:
{ {
GST_ERROR_OBJECT (depayload, "interlaced formats not supported yet"); 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_BGR:
case GST_VIDEO_FORMAT_BGRA: case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_UYVY: case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_UYVP:
/* samples are packed just like gstreamer packs them */ /* samples are packed just like gstreamer packs them */
offs /= xinc; offs /= xinc;
datap = yp + (line * ystride) + (offs * pgroup); datap = yp + (line * ystride) + (offs * pgroup);