dshowvideosrc: Add support for YUY2 input format

Fix bug #613708
This commit is contained in:
Andoni Morales 2010-03-24 17:05:14 +01:00 committed by julien
parent 53db4a1884
commit b65da8ea96
2 changed files with 8 additions and 0 deletions

View file

@ -405,6 +405,9 @@ gst_dshow_guid_to_gst_video_format (AM_MEDIA_TYPE *mediatype)
if (gst_dshow_check_mediatype (mediatype, MEDIASUBTYPE_RGB24, FORMAT_VideoInfo))
return GST_VIDEO_FORMAT_BGR;
if (gst_dshow_check_mediatype (mediatype, MEDIASUBTYPE_YUY2, FORMAT_VideoInfo))
return GST_VIDEO_FORMAT_YUY2;
return GST_VIDEO_FORMAT_UNKNOWN;
}
@ -422,6 +425,10 @@ gst_dshow_new_video_caps (GstVideoFormat video_format, const gchar * name,
break;
case GST_VIDEO_FORMAT_I420:
video_caps = gst_caps_from_string (GST_VIDEO_CAPS_YUV ("I420"));
break;
case GST_VIDEO_FORMAT_YUY2:
video_caps = gst_caps_from_string (GST_VIDEO_CAPS_YUV ("YUY2"));
break;
default:
break;
}

View file

@ -36,6 +36,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_BGR ";"
GST_VIDEO_CAPS_YUV ("{ I420 }") ";"
GST_VIDEO_CAPS_YUV ("{ YUY2 }") ";"
"video/x-dv,"
"systemstream = (boolean) FALSE,"
"width = (int) [ 1, MAX ],"