mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
vp8: probe for the new tuning API to keep building with older libvpx
https://bugzilla.gnome.org/show_bug.cgi?id=656928
This commit is contained in:
parent
e323efc353
commit
c24d052bb7
3 changed files with 35 additions and 0 deletions
11
configure.ac
11
configure.ac
|
@ -1692,6 +1692,17 @@ AG_GST_CHECK_FEATURE(VP8, [VP8 decoder], vp8, [
|
||||||
HAVE_VP8=yes
|
HAVE_VP8=yes
|
||||||
AC_DEFINE(HAVE_VP8_ENCODER, 1, [Defined if the VP8 encoder is available])
|
AC_DEFINE(HAVE_VP8_ENCODER, 1, [Defined if the VP8 encoder is available])
|
||||||
VPX_LIBS="-lvpx"
|
VPX_LIBS="-lvpx"
|
||||||
|
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <vpx/vpx_encoder.h>
|
||||||
|
#include <vpx/vp8cx.h>
|
||||||
|
int foo=VP8E_SET_TUNING;
|
||||||
|
], [
|
||||||
|
return 0;
|
||||||
|
], [
|
||||||
|
AC_DEFINE(HAVE_VP8ENC_TUNING, 1, [Defined if the VP8 encoder has tuning API])
|
||||||
|
], [
|
||||||
|
])
|
||||||
])
|
])
|
||||||
AC_CHECK_LIB(vpx, vpx_codec_vp8_dx_algo, [
|
AC_CHECK_LIB(vpx, vpx_codec_vp8_dx_algo, [
|
||||||
HAVE_VP8=yes
|
HAVE_VP8=yes
|
||||||
|
|
|
@ -101,7 +101,13 @@ gst_vp8_enc_coder_hook_free (GstVP8EncCoderHook * hook)
|
||||||
#define DEFAULT_LAG_IN_FRAMES 0
|
#define DEFAULT_LAG_IN_FRAMES 0
|
||||||
#define DEFAULT_SHARPNESS 0
|
#define DEFAULT_SHARPNESS 0
|
||||||
#define DEFAULT_NOISE_SENSITIVITY 0
|
#define DEFAULT_NOISE_SENSITIVITY 0
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
#define DEFAULT_TUNE VP8_TUNE_PSNR
|
#define DEFAULT_TUNE VP8_TUNE_PSNR
|
||||||
|
#else
|
||||||
|
typedef enum
|
||||||
|
{ VP8_TUNE_NONE } vp8e_tuning;
|
||||||
|
#define DEFAULT_TUNE VP8_TUNE_NONE
|
||||||
|
#endif
|
||||||
#define DEFAULT_STATIC_THRESHOLD 0
|
#define DEFAULT_STATIC_THRESHOLD 0
|
||||||
#define DEFAULT_DROP_FRAME 0
|
#define DEFAULT_DROP_FRAME 0
|
||||||
#define DEFAULT_RESIZE_ALLOWED TRUE
|
#define DEFAULT_RESIZE_ALLOWED TRUE
|
||||||
|
@ -186,8 +192,12 @@ static GType
|
||||||
gst_vp8_enc_tune_get_type (void)
|
gst_vp8_enc_tune_get_type (void)
|
||||||
{
|
{
|
||||||
static const GEnumValue values[] = {
|
static const GEnumValue values[] = {
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
{VP8_TUNE_PSNR, "Tune for PSNR", "psnr"},
|
{VP8_TUNE_PSNR, "Tune for PSNR", "psnr"},
|
||||||
{VP8_TUNE_SSIM, "Tune for SSIM", "ssim"},
|
{VP8_TUNE_SSIM, "Tune for SSIM", "ssim"},
|
||||||
|
#else
|
||||||
|
{VP8_TUNE_NONE, "none", "none"},
|
||||||
|
#endif
|
||||||
{0, NULL, NULL}
|
{0, NULL, NULL}
|
||||||
};
|
};
|
||||||
static volatile GType id = 0;
|
static volatile GType id = 0;
|
||||||
|
@ -542,7 +552,12 @@ gst_vp8_enc_set_property (GObject * object, guint prop_id,
|
||||||
gst_vp8_enc->noise_sensitivity = g_value_get_int (value);
|
gst_vp8_enc->noise_sensitivity = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case PROP_TUNE:
|
case PROP_TUNE:
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
gst_vp8_enc->tuning = g_value_get_enum (value);
|
gst_vp8_enc->tuning = g_value_get_enum (value);
|
||||||
|
#else
|
||||||
|
GST_WARNING_OBJECT (gst_vp8_enc,
|
||||||
|
"The tuning property is unsupported by this libvpx");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case PROP_STATIC_THRESHOLD:
|
case PROP_STATIC_THRESHOLD:
|
||||||
gst_vp8_enc->static_threshold = g_value_get_int (value);
|
gst_vp8_enc->static_threshold = g_value_get_int (value);
|
||||||
|
@ -626,7 +641,12 @@ gst_vp8_enc_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
g_value_set_int (value, gst_vp8_enc->noise_sensitivity);
|
g_value_set_int (value, gst_vp8_enc->noise_sensitivity);
|
||||||
break;
|
break;
|
||||||
case PROP_TUNE:
|
case PROP_TUNE:
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
g_value_set_enum (value, gst_vp8_enc->tuning);
|
g_value_set_enum (value, gst_vp8_enc->tuning);
|
||||||
|
#else
|
||||||
|
GST_WARNING_OBJECT (gst_vp8_enc,
|
||||||
|
"The tuning property is unsupported by this libvpx");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case PROP_STATIC_THRESHOLD:
|
case PROP_STATIC_THRESHOLD:
|
||||||
g_value_set_int (value, gst_vp8_enc->static_threshold);
|
g_value_set_int (value, gst_vp8_enc->static_threshold);
|
||||||
|
@ -800,8 +820,10 @@ gst_vp8_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
|
||||||
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_TYPE,
|
status = vpx_codec_control (&encoder->encoder, VP8E_SET_ARNR_TYPE,
|
||||||
encoder->arnr_type);
|
encoder->arnr_type);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
|
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
|
||||||
encoder->tuning);
|
encoder->tuning);
|
||||||
|
#endif
|
||||||
|
|
||||||
status =
|
status =
|
||||||
vpx_codec_control (&encoder->encoder, VP8E_SET_ENABLEAUTOALTREF,
|
vpx_codec_control (&encoder->encoder, VP8E_SET_ENABLEAUTOALTREF,
|
||||||
|
|
|
@ -78,7 +78,9 @@ struct _GstVP8Enc
|
||||||
unsigned int lag_in_frames;
|
unsigned int lag_in_frames;
|
||||||
int sharpness;
|
int sharpness;
|
||||||
int noise_sensitivity;
|
int noise_sensitivity;
|
||||||
|
#ifdef HAVE_VP8ENC_TUNING
|
||||||
vp8e_tuning tuning;
|
vp8e_tuning tuning;
|
||||||
|
#endif
|
||||||
int static_threshold;
|
int static_threshold;
|
||||||
gboolean drop_frame;
|
gboolean drop_frame;
|
||||||
gboolean resize_allowed;
|
gboolean resize_allowed;
|
||||||
|
|
Loading…
Reference in a new issue