mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Check if call supports video encoding before encoding frame.
This commit is contained in:
parent
6a4c2e8fc6
commit
b2350f2e26
|
@ -460,6 +460,12 @@ int toxav_prepare_video_frame ( ToxAv *av, int32_t call_index, uint8_t *dest, in
|
|||
return av_ErrorInvalidState;
|
||||
}
|
||||
|
||||
if (!(call->cs->capabilities & cs_VideoEncoding)) {
|
||||
pthread_mutex_unlock(call->mutex);
|
||||
LOGGER_WARNING("Call doesn't support encoding video: %d", call_index);
|
||||
return av_ErrorInvalidState;
|
||||
}
|
||||
|
||||
if (cs_set_video_encoder_resolution(call->cs, input->w, input->h) < 0) {
|
||||
pthread_mutex_unlock(call->mutex);
|
||||
return av_ErrorSettingVideoResolution;
|
||||
|
|
Loading…
Reference in New Issue
Block a user