vrawdepay: fix UYVP format
This commit is contained in:
parent
8191b6fcd2
commit
cc92ef1db2
@ -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")) {
|
||||||
format = GST_VIDEO_FORMAT_UYVY;
|
if (depth == 8) {
|
||||||
pgroup = 4;
|
format = GST_VIDEO_FORMAT_UYVY;
|
||||||
|
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user