forked from enlightenment/efl
emotion gstreamer1 module - support 709 color matrix properly now
now that 709 colorsp[ace works in evas, use it properly in gst1 module if possible
This commit is contained in:
parent
742d7c394c
commit
2b8d54c357
|
@ -148,13 +148,28 @@ _evas_video_nv12(unsigned char *evas_data, const unsigned char *gst_data, unsign
|
|||
}
|
||||
|
||||
const ColorSpace_Format_Convertion colorspace_format_convertion[] = {
|
||||
{ "I420", GST_VIDEO_FORMAT_I420, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
|
||||
{ "YV12", GST_VIDEO_FORMAT_YV12, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
|
||||
{ "YUY2", GST_VIDEO_FORMAT_YUY2, EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
|
||||
{ "NV12", GST_VIDEO_FORMAT_NV12, EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
|
||||
{ "BGR", GST_VIDEO_FORMAT_BGR, EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, EINA_FALSE },
|
||||
{ "BGRx", GST_VIDEO_FORMAT_BGRx, EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, EINA_FALSE },
|
||||
{ "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE },
|
||||
{ NULL, 0, 0, NULL, 0 }
|
||||
{ "I420-709", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT709,
|
||||
EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_i420, EINA_TRUE },
|
||||
{ "I420", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601,
|
||||
EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
|
||||
|
||||
{ "YV12-709", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT709,
|
||||
EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_yv12, EINA_TRUE },
|
||||
{ "YV12", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT601,
|
||||
EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
|
||||
|
||||
{ "YUY2", GST_VIDEO_FORMAT_YUY2, GST_VIDEO_COLOR_MATRIX_BT601,
|
||||
EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
|
||||
{ "NV12", GST_VIDEO_FORMAT_NV12, GST_VIDEO_COLOR_MATRIX_BT601,
|
||||
EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
|
||||
|
||||
{ "BGR", GST_VIDEO_FORMAT_BGR, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
|
||||
EVAS_COLORSPACE_ARGB8888, _evas_video_bgr, EINA_FALSE },
|
||||
{ "BGRx", GST_VIDEO_FORMAT_BGRx, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
|
||||
EVAS_COLORSPACE_ARGB8888, _evas_video_bgrx, EINA_FALSE },
|
||||
{ "BGRA", GST_VIDEO_FORMAT_BGRA, GST_VIDEO_COLOR_MATRIX_UNKNOWN,
|
||||
EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE },
|
||||
|
||||
{ NULL, 0, 0, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
|
|
|
@ -220,6 +220,7 @@ struct _ColorSpace_Format_Convertion
|
|||
{
|
||||
const char *name;
|
||||
GstVideoFormat format;
|
||||
GstVideoColorMatrix colormatrix;
|
||||
Evas_Colorspace eformat;
|
||||
Evas_Video_Convert_Cb func;
|
||||
Eina_Bool force_height;
|
||||
|
|
|
@ -181,8 +181,11 @@ gboolean emotion_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
|
|||
priv->info = info;
|
||||
priv->eheight = info.height;
|
||||
|
||||
for (i = 0; colorspace_format_convertion[i].name != NULL; ++i)
|
||||
if (info.finfo->format == colorspace_format_convertion[i].format)
|
||||
for (i = 0; colorspace_format_convertion[i].name; i++)
|
||||
{
|
||||
if ((info.finfo->format == colorspace_format_convertion[i].format) &&
|
||||
((colorspace_format_convertion[i].colormatrix == GST_VIDEO_COLOR_MATRIX_UNKNOWN) ||
|
||||
(colorspace_format_convertion[i].colormatrix == info.colorimetry.matrix)))
|
||||
{
|
||||
DBG("Found '%s'", colorspace_format_convertion[i].name);
|
||||
priv->eformat = colorspace_format_convertion[i].eformat;
|
||||
|
@ -193,6 +196,7 @@ gboolean emotion_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format));
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in New Issue