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[] = {
|
const ColorSpace_Format_Convertion colorspace_format_convertion[] = {
|
||||||
{ "I420", GST_VIDEO_FORMAT_I420, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, EINA_TRUE },
|
{ "I420-709", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT709,
|
||||||
{ "YV12", GST_VIDEO_FORMAT_YV12, EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_yv12, EINA_TRUE },
|
EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_i420, EINA_TRUE },
|
||||||
{ "YUY2", GST_VIDEO_FORMAT_YUY2, EVAS_COLORSPACE_YCBCR422601_PL, _evas_video_yuy2, EINA_FALSE },
|
{ "I420", GST_VIDEO_FORMAT_I420, GST_VIDEO_COLOR_MATRIX_BT601,
|
||||||
{ "NV12", GST_VIDEO_FORMAT_NV12, EVAS_COLORSPACE_YCBCR420NV12601_PL, _evas_video_nv12, EINA_TRUE },
|
EVAS_COLORSPACE_YCBCR422P601_PL, _evas_video_i420, 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 },
|
{ "YV12-709", GST_VIDEO_FORMAT_YV12, GST_VIDEO_COLOR_MATRIX_BT709,
|
||||||
{ "BGRA", GST_VIDEO_FORMAT_BGRA, EVAS_COLORSPACE_ARGB8888, _evas_video_bgra, EINA_FALSE },
|
EVAS_COLORSPACE_YCBCR422P709_PL, _evas_video_yv12, EINA_TRUE },
|
||||||
{ NULL, 0, 0, NULL, 0 }
|
{ "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;
|
const char *name;
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
|
GstVideoColorMatrix colormatrix;
|
||||||
Evas_Colorspace eformat;
|
Evas_Colorspace eformat;
|
||||||
Evas_Video_Convert_Cb func;
|
Evas_Video_Convert_Cb func;
|
||||||
Eina_Bool force_height;
|
Eina_Bool force_height;
|
||||||
|
|
|
@ -181,17 +181,21 @@ gboolean emotion_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
|
||||||
priv->info = info;
|
priv->info = info;
|
||||||
priv->eheight = info.height;
|
priv->eheight = info.height;
|
||||||
|
|
||||||
for (i = 0; colorspace_format_convertion[i].name != NULL; ++i)
|
for (i = 0; colorspace_format_convertion[i].name; i++)
|
||||||
if (info.finfo->format == colorspace_format_convertion[i].format)
|
{
|
||||||
{
|
if ((info.finfo->format == colorspace_format_convertion[i].format) &&
|
||||||
DBG("Found '%s'", colorspace_format_convertion[i].name);
|
((colorspace_format_convertion[i].colormatrix == GST_VIDEO_COLOR_MATRIX_UNKNOWN) ||
|
||||||
priv->eformat = colorspace_format_convertion[i].eformat;
|
(colorspace_format_convertion[i].colormatrix == info.colorimetry.matrix)))
|
||||||
priv->func = colorspace_format_convertion[i].func;
|
{
|
||||||
if (colorspace_format_convertion[i].force_height)
|
DBG("Found '%s'", colorspace_format_convertion[i].name);
|
||||||
{
|
priv->eformat = colorspace_format_convertion[i].eformat;
|
||||||
priv->eheight = (priv->eheight >> 1) << 1;
|
priv->func = colorspace_format_convertion[i].func;
|
||||||
}
|
if (colorspace_format_convertion[i].force_height)
|
||||||
return TRUE;
|
{
|
||||||
|
priv->eheight = (priv->eheight >> 1) << 1;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format));
|
ERR("unsupported : %s\n", gst_video_format_to_string(info.finfo->format));
|
||||||
|
|
Loading…
Reference in New Issue