vpx: mark arnr-type properties as deprecated and set them to no-op

ARNR type control in libvpx has been deprecated so this commit mark the
vp8enc and vp9enc associated properties as deprecated and change their
behavior to just display a warning message.

https://bugzilla.gnome.org/show_bug.cgi?id=739476
This commit is contained in:
Aurélien Zanelli 2014-11-01 22:39:41 +01:00 committed by Sebastian Dröge
parent 1c3b233fef
commit d0e8a385e0
2 changed files with 8 additions and 32 deletions

View file

@ -683,7 +683,8 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass)
g_param_spec_int ("arnr-type", "AltRef type",
"AltRef type",
1, 3, DEFAULT_ARNR_TYPE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_DEPRECATED)));
g_object_class_install_property (gobject_class, PROP_TUNING,
g_param_spec_enum ("tuning", "Tuning",
@ -1127,15 +1128,8 @@ gst_vp8_enc_set_property (GObject * object, guint prop_id,
break;
case PROP_ARNR_TYPE:
gst_vp8_enc->arnr_type = g_value_get_int (value);
if (gst_vp8_enc->inited) {
status = vpx_codec_control (&gst_vp8_enc->encoder, VP8E_SET_ARNR_TYPE,
gst_vp8_enc->arnr_type);
if (status != VPX_CODEC_OK) {
GST_WARNING_OBJECT (gst_vp8_enc,
"Failed to set VP8E_SET_ARNR_TYPE: %s",
gst_vpx_error_name (status));
}
}
g_warning ("arnr-type is a no-op since control has been deprecated "
"in libvpx");
break;
case PROP_TUNING:
gst_vp8_enc->tuning = g_value_get_enum (value);
@ -1666,12 +1660,6 @@ gst_vp8_enc_set_format (GstVideoEncoder * video_encoder,
"Failed to set VP8E_SET_ARNR_STRENGTH: %s",
gst_vpx_error_name (status));
}
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_TYPE,
encoder->arnr_type);
if (status != VPX_CODEC_OK) {
GST_WARNING_OBJECT (encoder,
"Failed to set VP8E_SET_ARNR_TYPE: %s", gst_vpx_error_name (status));
}
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
encoder->tuning);
if (status != VPX_CODEC_OK) {

View file

@ -658,7 +658,8 @@ gst_vp9_enc_class_init (GstVP9EncClass * klass)
g_param_spec_int ("arnr-type", "AltRef type",
"AltRef type",
1, 3, DEFAULT_ARNR_TYPE,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_DEPRECATED)));
g_object_class_install_property (gobject_class, PROP_TUNING,
g_param_spec_enum ("tuning", "Tuning",
@ -1104,15 +1105,8 @@ gst_vp9_enc_set_property (GObject * object, guint prop_id,
break;
case PROP_ARNR_TYPE:
gst_vp9_enc->arnr_type = g_value_get_int (value);
if (gst_vp9_enc->inited) {
status = vpx_codec_control (&gst_vp9_enc->encoder, VP8E_SET_ARNR_TYPE,
gst_vp9_enc->arnr_type);
if (status != VPX_CODEC_OK) {
GST_WARNING_OBJECT (gst_vp9_enc,
"Failed to set VP8E_SET_ARNR_TYPE: %s",
gst_vpx_error_name (status));
}
}
g_warning ("arnr-type is a no-op since control has been deprecated "
"in libvpx");
break;
case PROP_TUNING:
gst_vp9_enc->tuning = g_value_get_enum (value);
@ -1645,12 +1639,6 @@ gst_vp9_enc_set_format (GstVideoEncoder * video_encoder,
"Failed to set VP8E_SET_ARNR_STRENGTH: %s",
gst_vpx_error_name (status));
}
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_TYPE,
encoder->arnr_type);
if (status != VPX_CODEC_OK) {
GST_WARNING_OBJECT (encoder,
"Failed to set VP8E_SET_ARNR_TYPE: %s", gst_vpx_error_name (status));
}
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
encoder->tuning);
if (status != VPX_CODEC_OK) {