video: port to new colorimetry info

This commit is contained in:
Wim Taymans 2011-08-23 19:09:31 +02:00
parent d6908f1a2d
commit 60f0e44bf6
3 changed files with 17 additions and 20 deletions

View file

@ -377,7 +377,7 @@ gst_alpha_set_property (GObject * object, guint prop_id,
case PROP_PREFER_PASSTHROUGH:{
gboolean prefer_passthrough = g_value_get_boolean (value);
reconfigure = ((!!prefer_passthrough) != (!!alpha->prefer_passthrough))
reconfigure = ((! !prefer_passthrough) != (! !alpha->prefer_passthrough))
&& (alpha->method == ALPHA_METHOD_SET) && (alpha->alpha == 1.0);
alpha->prefer_passthrough = prefer_passthrough;
break;
@ -532,11 +532,8 @@ gst_alpha_set_caps (GstBaseTransform * btrans,
GST_ALPHA_LOCK (alpha);
alpha->in_sdtv =
in_info.color_matrix ? g_str_equal (in_info.color_matrix, "sdtv") : TRUE;
alpha->out_sdtv =
out_info.color_matrix ? g_str_equal (out_info.color_matrix,
"sdtv") : TRUE;
alpha->in_sdtv = in_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601;
alpha->out_sdtv = out_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601;
passthrough = alpha->prefer_passthrough &&
GST_VIDEO_INFO_FORMAT (&in_info) == GST_VIDEO_INFO_FORMAT (&out_info)

View file

@ -491,11 +491,8 @@ gst_alpha_color_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
GST_VIDEO_INFO_HEIGHT (&in_info) != GST_VIDEO_INFO_HEIGHT (&out_info))
goto invalid_caps;
in_sdtv =
in_info.color_matrix ? g_str_equal (in_info.color_matrix, "sdtv") : TRUE;
out_sdtv =
out_info.color_matrix ? g_str_equal (out_info.color_matrix,
"sdtv") : TRUE;
in_sdtv = in_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601;
out_sdtv = out_info.colorimetry.matrix = GST_VIDEO_COLOR_MATRIX_BT601;
switch (GST_VIDEO_INFO_FORMAT (&in_info)) {
case GST_VIDEO_FORMAT_ARGB:

View file

@ -121,14 +121,17 @@ gst_rtp_vraw_pay_setcaps (GstBaseRTPPayload * payload, GstCaps * caps)
rtpvrawpay->vinfo = info;
colorimetrystr = "SMPTE240M";
if (info.color_matrix) {
if (g_str_equal (info.color_matrix, "sdtv")) {
/* BT.601 implies a bit more than just color-matrix */
if (gst_video_colorimetry_matches (&info.colorimetry,
GST_VIDEO_COLORIMETRY_BT601)) {
colorimetrystr = "BT601-5";
} else if (g_str_equal (info.color_matrix, "hdtv")) {
} else if (gst_video_colorimetry_matches (&info.colorimetry,
GST_VIDEO_COLORIMETRY_BT709)) {
colorimetrystr = "BT709-2";
}
} else if (gst_video_colorimetry_matches (&info.colorimetry,
GST_VIDEO_COLORIMETRY_SMPTE240M)) {
colorimetrystr = "SMPTE240M";
} else {
colorimetrystr = "SMPTE240M";
}
xinc = yinc = 1;
@ -268,7 +271,7 @@ gst_rtp_vraw_pay_handle_buffer (GstBaseRTPPayload * payload, GstBuffer * buffer)
width = GST_VIDEO_INFO_WIDTH (&rtpvrawpay->vinfo);
height = GST_VIDEO_INFO_HEIGHT (&rtpvrawpay->vinfo);
interlaced = !!(rtpvrawpay->vinfo.flags & GST_VIDEO_FLAG_INTERLACED);
interlaced = ! !(rtpvrawpay->vinfo.flags & GST_VIDEO_FLAG_INTERLACED);
/* start with line 0, offset 0 */
for (field = 0; field < 1 + interlaced; field++) {