diff options
Diffstat (limited to 'toxav/video.c')
-rw-r--r-- | toxav/video.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/toxav/video.c b/toxav/video.c index f5f9f513..389d2e1c 100644 --- a/toxav/video.c +++ b/toxav/video.c | |||
@@ -324,17 +324,9 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate) | |||
324 | return false; | 324 | return false; |
325 | } | 325 | } |
326 | 326 | ||
327 | rc = vpx_codec_enc_init_ver(dest, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0, | ||
328 | VPX_ENCODER_ABI_VERSION); | ||
329 | |||
330 | if ( rc != VPX_CODEC_OK) { | ||
331 | LOGGER_ERROR("Failed to initialize encoder: %s", vpx_codec_err_to_string(rc)); | ||
332 | return false; | ||
333 | } | ||
334 | |||
335 | cfg.rc_target_bitrate = bit_rate; | 327 | cfg.rc_target_bitrate = bit_rate; |
336 | cfg.g_w = 800; | 328 | cfg.g_w = 4000; |
337 | cfg.g_h = 600; | 329 | cfg.g_h = 4000; |
338 | cfg.g_pass = VPX_RC_ONE_PASS; | 330 | cfg.g_pass = VPX_RC_ONE_PASS; |
339 | cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS; | 331 | cfg.g_error_resilient = VPX_ERROR_RESILIENT_DEFAULT | VPX_ERROR_RESILIENT_PARTITIONS; |
340 | cfg.g_lag_in_frames = 0; | 332 | cfg.g_lag_in_frames = 0; |
@@ -342,6 +334,14 @@ bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate) | |||
342 | cfg.kf_max_dist = 48; | 334 | cfg.kf_max_dist = 48; |
343 | cfg.kf_mode = VPX_KF_AUTO; | 335 | cfg.kf_mode = VPX_KF_AUTO; |
344 | 336 | ||
337 | rc = vpx_codec_enc_init_ver(dest, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0, | ||
338 | VPX_ENCODER_ABI_VERSION); | ||
339 | |||
340 | if ( rc != VPX_CODEC_OK) { | ||
341 | LOGGER_ERROR("Failed to initialize encoder: %s", vpx_codec_err_to_string(rc)); | ||
342 | return false; | ||
343 | } | ||
344 | |||
345 | rc = vpx_codec_control(dest, VP8E_SET_CPUUSED, 8); | 345 | rc = vpx_codec_control(dest, VP8E_SET_CPUUSED, 8); |
346 | 346 | ||
347 | if ( rc != VPX_CODEC_OK) { | 347 | if ( rc != VPX_CODEC_OK) { |