summaryrefslogtreecommitdiff
path: root/ext/vp8
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-06-14 15:56:24 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-06-14 15:56:24 +0200
commit0679c76b64a0334afad2ad161daf6bf4a2f9234e (patch)
treef3fb60a646cd5d6c6e40ad09ed67be6f29fcfd5c /ext/vp8
parentc2809e68430d4b1037f053771d9dd7a83bfd0e0a (diff)
downloadgstreamer-plugins-bad-0679c76b64a0334afad2ad161daf6bf4a2f9234e.tar.gz
vp8enc: Set VP8E_SET_CPUUSED to 0
This setting controls how much CPU can be used by the encoder, specified in fractions of 16. Negative values mean strict enforcement of this while positive values are adaptive. The default value is -4, which means that we're not running as fast as possible and probably are wasting some quality. 0 is the recommended default by libvpx upstream.
Diffstat (limited to 'ext/vp8')
-rw-r--r--ext/vp8/gstvp8enc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/vp8/gstvp8enc.c b/ext/vp8/gstvp8enc.c
index efc0e510d..07318c482 100644
--- a/ext/vp8/gstvp8enc.c
+++ b/ext/vp8/gstvp8enc.c
@@ -701,13 +701,19 @@ gst_vp8_enc_handle_frame (GstBaseVideoEncoder * base_video_encoder,
status = vpx_codec_enc_init (&encoder->encoder, &vpx_codec_vp8_cx_algo,
&cfg, 0);
- if (status) {
+ if (status != VPX_CODEC_OK) {
GST_ELEMENT_ERROR (encoder, LIBRARY, INIT,
("Failed to initialize encoder"), ("%s",
gst_vpx_error_name (status)));
return GST_FLOW_ERROR;
}
+ status = vpx_codec_control (&encoder->encoder, VP8E_SET_CPUUSED, 0);
+ if (status != VPX_CODEC_OK) {
+ GST_WARNING_OBJECT (encoder, "Failed to set VP8E_SET_CPUUSED to 0: %s",
+ gst_vpx_error_name (status));
+ }
+
gst_base_video_encoder_set_latency (base_video_encoder, 0,
gst_util_uint64_scale (encoder->max_latency,
base_video_encoder->state.fps_d * GST_SECOND,