summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2011-08-19 19:17:15 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-08-23 10:23:21 +0200
commitc24d052bb7223efce1885e1577b0f9daeb3a3e7c (patch)
tree5034d54a83c1ca0dd87957966ef53e56f121b4f8 /ext
parente323efc35345f8cc4942fd2598a08d97aeb023f0 (diff)
vp8: probe for the new tuning API to keep building with older libvpx
https://bugzilla.gnome.org/show_bug.cgi?id=656928
Diffstat (limited to 'ext')
-rw-r--r--ext/vp8/gstvp8enc.c22
-rw-r--r--ext/vp8/gstvp8enc.h2
2 files changed, 24 insertions, 0 deletions
diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c
index 2e61fd339..f0d282f22 100644
--- a/ext/vp8/gstvp8enc.c
+++ b/ext/vp8/gstvp8enc.c
@@ -101,7 +101,13 @@ gst_vp8_enc_coder_hook_free (GstVP8EncCoderHook * hook)
#define DEFAULT_LAG_IN_FRAMES 0
#define DEFAULT_SHARPNESS 0
#define DEFAULT_NOISE_SENSITIVITY 0
+#ifdef HAVE_VP8ENC_TUNING
#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_DROP_FRAME 0
#define DEFAULT_RESIZE_ALLOWED TRUE
@@ -186,8 +192,12 @@ static GType
gst_vp8_enc_tune_get_type (void)
{
static const GEnumValue values[] = {
+#ifdef HAVE_VP8ENC_TUNING
{VP8_TUNE_PSNR, "Tune for PSNR", "psnr"},
{VP8_TUNE_SSIM, "Tune for SSIM", "ssim"},
+#else
+ {VP8_TUNE_NONE, "none", "none"},
+#endif
{0, NULL, NULL}
};
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);
break;
case PROP_TUNE:
+#ifdef HAVE_VP8ENC_TUNING
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;
case PROP_STATIC_THRESHOLD:
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);
break;
case PROP_TUNE:
+#ifdef HAVE_VP8ENC_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;
case PROP_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,
encoder->arnr_type);
#endif
+#ifdef HAVE_VP8ENC_TUNING
status = vpx_codec_control (&encoder->encoder, VP8E_SET_TUNING,
encoder->tuning);
+#endif
status =
vpx_codec_control (&encoder->encoder, VP8E_SET_ENABLEAUTOALTREF,
diff --git a/ext/vp8/gstvp8enc.h b/ext/vp8/gstvp8enc.h
index 420963529..3b0151297 100644
--- a/ext/vp8/gstvp8enc.h
+++ b/ext/vp8/gstvp8enc.h
@@ -78,7 +78,9 @@ struct _GstVP8Enc
unsigned int lag_in_frames;
int sharpness;
int noise_sensitivity;
+#ifdef HAVE_VP8ENC_TUNING
vp8e_tuning tuning;
+#endif
int static_threshold;
gboolean drop_frame;
gboolean resize_allowed;