From 65b4c026f4a2aa965f89f28958fe75bceb16475c Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 5 Jul 2014 14:36:19 -0400 Subject: The width and height set during the video encoder initialization is now described as the maximum width and height of images. This is to work around what appears to be a bug in libvpx where the resolution of the stream can be decreased but increasing it above its originally set value introduces memory corruption. --- toxav/toxav.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'toxav/toxav.c') diff --git a/toxav/toxav.c b/toxav/toxav.c index 9a1c5e3e..606f1370 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -81,8 +81,8 @@ struct _ToxAv { const ToxAvCodecSettings av_DefaultSettings = { 500, - 800, - 600, + 1280, + 720, 64000, 20, @@ -350,8 +350,8 @@ int toxav_prepare_transmission ( ToxAv *av, int32_t call_index, ToxAvCodecSettin codec_settings->audio_sample_rate, codec_settings->audio_channels, codec_settings->audio_VAD_tolerance, - codec_settings->video_width, - codec_settings->video_height, + codec_settings->max_video_width, + codec_settings->max_video_height, codec_settings->video_bitrate) )) { if ( pthread_mutex_init(&call->mutex, NULL) != 0 ) goto error; @@ -642,7 +642,8 @@ inline__ int toxav_prepare_video_frame(ToxAv *av, int32_t call_index, uint8_t *d CallSpecific *call = &av->calls[call_index]; pthread_mutex_lock(&call->mutex); - reconfigure_video_encoder_resolution(call->cs, input->d_w, input->d_h); + if (reconfigure_video_encoder_resolution(call->cs, input->d_w, input->d_h) != 0) + return ErrorInternal; int rc = vpx_codec_encode(&call->cs->v_encoder, input, call->cs->frame_counter, 1, 0, MAX_ENCODE_TIME_US); -- cgit v1.2.3