gint widthY, widthUV;
gint hY, hUV;
- dest_strideY =
- gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 0, dest_width);
- dest_strideUV =
- gst_video_format_get_row_stride (GST_VIDEO_FORMAT_I420, 1, dest_width);
+ dest_strideY = gst_video_format_get_row_stride (dest_format, 0, dest_width);
+ dest_strideUV = gst_video_format_get_row_stride (dest_format, 1, dest_width);
destY =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
+ dest + gst_video_format_get_component_offset (dest_format, 0,
dest_width, dest_height);
destU =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1,
+ dest + gst_video_format_get_component_offset (dest_format, 1,
dest_width, dest_height);
destV =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2,
+ dest + gst_video_format_get_component_offset (dest_format, 2,
dest_width, dest_height);
destY = destY + dest_y * dest_strideY + dest_x;
dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
width, height);
destU =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1,
- width, height);
+ dest + gst_video_format_get_component_offset (format, 1, width, height);
destV =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2,
- width, height);
+ dest + gst_video_format_get_component_offset (format, 2, width, height);
heightY =
gst_video_format_get_component_height (GST_VIDEO_FORMAT_I420, 0, height);
dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
dest_width, dest_height);
destU =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1,
+ dest + gst_video_format_get_component_offset (dest_format, 1,
dest_width, dest_height);
destV =
- dest + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2,
+ dest + gst_video_format_get_component_offset (dest_format, 2,
dest_width, dest_height);
srcY =
src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
src_width, src_height);
srcU =
- src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1,
+ src + gst_video_format_get_component_offset (src_format, 1,
src_width, src_height);
srcV =
- src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2,
+ src + gst_video_format_get_component_offset (src_format, 2,
src_width, src_height);
src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 0,
src_width, src_height);
srcU =
- src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 1,
+ src + gst_video_format_get_component_offset (src_format, 1,
src_width, src_height);
srcV =
- src + gst_video_format_get_component_offset (GST_VIDEO_FORMAT_I420, 2,
+ src + gst_video_format_get_component_offset (src_format, 2,
src_width, src_height);
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";"
GST_VIDEO_CAPS_YUV ("I420") ";"
+ GST_VIDEO_CAPS_YUV ("YV12") ";"
GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_BGRx ";"
GST_VIDEO_CAPS_xBGR ";" GST_VIDEO_CAPS_RGBx ";"
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_BGRA ";"
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("AYUV") ";"
GST_VIDEO_CAPS_YUV ("I420") ";"
+ GST_VIDEO_CAPS_YUV ("YV12") ";"
GST_VIDEO_CAPS_xRGB ";" GST_VIDEO_CAPS_BGRx ";"
GST_VIDEO_CAPS_xBGR ";" GST_VIDEO_CAPS_RGBx ";"
GST_VIDEO_CAPS_ARGB ";" GST_VIDEO_CAPS_BGRA ";"
/* Supported conversions:
* I420->AYUV
+ * I420->YV12
+ * YV12->AYUV
+ * YV12->I420
* AYUV->I420
+ * AYUV->YV12
* AYUV->xRGB (24bpp, 32bpp, incl. alpha)
* xRGB->xRGB (24bpp, 32bpp, from/to all variants, incl. alpha)
* xRGB->AYUV (24bpp, 32bpp, incl. alpha)
if (gst_structure_get_fourcc (structure, "format", &fourcc) &&
(fourcc == GST_STR_FOURCC ("AYUV") ||
- fourcc == GST_STR_FOURCC ("I420"))) {
+ fourcc == GST_STR_FOURCC ("I420") ||
+ fourcc == GST_STR_FOURCC ("YV12"))) {
GValue list = { 0, };
GValue val = { 0, };
GstStructure *s2;
g_value_reset (&val);
gst_value_set_fourcc (&val, GST_STR_FOURCC ("I420"));
gst_value_list_append_value (&list, &val);
+ g_value_reset (&val);
+ gst_value_set_fourcc (&val, GST_STR_FOURCC ("YV12"));
+ gst_value_list_append_value (&list, &val);
g_value_unset (&val);
gst_structure_set_value (structure, "format", &list);
g_value_unset (&list);
video_box->copy = copy_ayuv_ayuv;
break;
case GST_VIDEO_FORMAT_I420:
+ case GST_VIDEO_FORMAT_YV12:
video_box->copy = copy_i420_ayuv;
break;
case GST_VIDEO_FORMAT_ARGB:
}
break;
case GST_VIDEO_FORMAT_I420:
+ case GST_VIDEO_FORMAT_YV12:
video_box->fill = fill_i420;
switch (video_box->in_format) {
case GST_VIDEO_FORMAT_AYUV:
video_box->copy = copy_ayuv_i420;
break;
case GST_VIDEO_FORMAT_I420:
+ case GST_VIDEO_FORMAT_YV12:
video_box->copy = copy_i420_i420;
break;
default: