diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-08-08 17:45:24 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-08-08 17:45:24 +0200 |
commit | 3c8cae72d08cabe870e2fd6b6ffdd78a32c2b410 (patch) | |
tree | 818fb6a8660d3607069f33833070f9536876f61c /toxav/video.c | |
parent | 657a57b406717a3ff08233eef14f20818c137f47 (diff) |
Removed redundant function from video.[h|c]
Diffstat (limited to 'toxav/video.c')
-rw-r--r-- | toxav/video.c | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/toxav/video.c b/toxav/video.c index ee49c0a1..f5f9f513 100644 --- a/toxav/video.c +++ b/toxav/video.c | |||
@@ -289,20 +289,20 @@ end: | |||
289 | rtp_free_msg(msg); | 289 | rtp_free_msg(msg); |
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | int vc_reconfigure_encoder(VCSession* vc, int32_t bit_rate, uint16_t width, uint16_t height) | 292 | int vc_reconfigure_encoder(vpx_codec_ctx_t* vccdc, uint32_t bit_rate, uint16_t width, uint16_t height) |
293 | { | 293 | { |
294 | if (!vc) | 294 | if (!vccdc) |
295 | return -1; | 295 | return -1; |
296 | 296 | ||
297 | vpx_codec_enc_cfg_t cfg = *vc->encoder->config.enc; | 297 | vpx_codec_enc_cfg_t cfg = *vccdc->config.enc; |
298 | if (cfg.rc_target_bitrate == (uint32_t) bit_rate && cfg.g_w == width && cfg.g_h == height) | 298 | if (cfg.rc_target_bitrate == bit_rate && cfg.g_w == width && cfg.g_h == height) |
299 | return 0; /* Nothing changed */ | 299 | return 0; /* Nothing changed */ |
300 | 300 | ||
301 | cfg.rc_target_bitrate = bit_rate; | 301 | cfg.rc_target_bitrate = bit_rate; |
302 | cfg.g_w = width; | 302 | cfg.g_w = width; |
303 | cfg.g_h = height; | 303 | cfg.g_h = height; |
304 | 304 | ||
305 | int rc = vpx_codec_enc_config_set(vc->encoder, &cfg); | 305 | int rc = vpx_codec_enc_config_set(vccdc, &cfg); |
306 | if ( rc != VPX_CODEC_OK) { | 306 | if ( rc != VPX_CODEC_OK) { |
307 | LOGGER_ERROR("Failed to set encoder control setting: %s", vpx_codec_err_to_string(rc)); | 307 | LOGGER_ERROR("Failed to set encoder control setting: %s", vpx_codec_err_to_string(rc)); |
308 | return -1; | 308 | return -1; |
@@ -310,28 +310,6 @@ int vc_reconfigure_encoder(VCSession* vc, int32_t bit_rate, uint16_t width, uint | |||
310 | 310 | ||
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
313 | int vc_reconfigure_test_encoder(VCSession* vc, int32_t bit_rate, uint16_t width, uint16_t height) | ||
314 | { | ||
315 | if (!vc) | ||
316 | return -1; | ||
317 | |||
318 | vpx_codec_enc_cfg_t cfg = *vc->test_encoder->config.enc; | ||
319 | if (cfg.rc_target_bitrate == (uint32_t) bit_rate && cfg.g_w == width && cfg.g_h == height) | ||
320 | return 0; /* Nothing changed */ | ||
321 | |||
322 | cfg.rc_target_bitrate = bit_rate; | ||
323 | cfg.g_w = width; | ||
324 | cfg.g_h = height; | ||
325 | |||
326 | int rc = vpx_codec_enc_config_set(vc->test_encoder, &cfg); | ||
327 | if ( rc != VPX_CODEC_OK) { | ||
328 | LOGGER_ERROR("Failed to set test encoder control setting: %s", vpx_codec_err_to_string(rc)); | ||
329 | return -1; | ||
330 | } | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | 313 | ||
336 | 314 | ||
337 | bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate) | 315 | bool create_video_encoder (vpx_codec_ctx_t* dest, int32_t bit_rate) |