summaryrefslogtreecommitdiff
path: root/toxav/toxav.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-01-24 23:29:54 +0100
committermannol <eniz_vukovic@hotmail.com>2015-01-24 23:29:54 +0100
commit1450c22d01cbb5185ee8eac14657ddf3301d7e48 (patch)
tree366f795f56689b0fb53dfe52941fb9c813429e8b /toxav/toxav.c
parente57fb8c12ea7de1a5070ea0fc6f14c8e242c409f (diff)
Current progress
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r--toxav/toxav.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index b0534ec5..68402020 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -460,7 +460,7 @@ int toxav_prepare_video_frame ( ToxAv *av, int32_t call_index, uint8_t *dest, in
460 return av_ErrorInvalidState; 460 return av_ErrorInvalidState;
461 } 461 }
462 462
463 if (cs_set_video_encoder_resolution(call->cs, input->d_w, input->d_h) < 0) { 463 if (cs_set_sending_video_resolution(call->cs, input->d_w, input->d_h) < 0) {
464 pthread_mutex_unlock(call->mutex_control); 464 pthread_mutex_unlock(call->mutex_control);
465 return av_ErrorSettingVideoResolution; 465 return av_ErrorSettingVideoResolution;
466 } 466 }
@@ -468,7 +468,7 @@ int toxav_prepare_video_frame ( ToxAv *av, int32_t call_index, uint8_t *dest, in
468 pthread_mutex_lock(call->mutex_encoding_video); 468 pthread_mutex_lock(call->mutex_encoding_video);
469 pthread_mutex_unlock(call->mutex_control); 469 pthread_mutex_unlock(call->mutex_control);
470 470
471 int rc = vpx_codec_encode(&call->cs->v_encoder, input, call->cs->frame_counter, 1, 0, MAX_ENCODE_TIME_US); 471 int rc = vpx_codec_encode(call->cs->v_encoder, input, call->cs->frame_counter, 1, 0, MAX_ENCODE_TIME_US);
472 472
473 if ( rc != VPX_CODEC_OK) { 473 if ( rc != VPX_CODEC_OK) {
474 LOGGER_ERROR("Could not encode video frame: %s\n", vpx_codec_err_to_string(rc)); 474 LOGGER_ERROR("Could not encode video frame: %s\n", vpx_codec_err_to_string(rc));
@@ -482,7 +482,7 @@ int toxav_prepare_video_frame ( ToxAv *av, int32_t call_index, uint8_t *dest, in
482 const vpx_codec_cx_pkt_t *pkt; 482 const vpx_codec_cx_pkt_t *pkt;
483 int copied = 0; 483 int copied = 0;
484 484
485 while ( (pkt = vpx_codec_get_cx_data(&call->cs->v_encoder, &iter)) ) { 485 while ( (pkt = vpx_codec_get_cx_data(call->cs->v_encoder, &iter)) ) {
486 if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) { 486 if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
487 if ( copied + pkt->data.frame.sz > dest_max ) { 487 if ( copied + pkt->data.frame.sz > dest_max ) {
488 pthread_mutex_unlock(call->mutex_encoding_video); 488 pthread_mutex_unlock(call->mutex_encoding_video);
@@ -608,8 +608,6 @@ ToxAvCallState toxav_get_call_state(ToxAv *av, int32_t call_index)
608 608
609int toxav_capability_supported ( ToxAv *av, int32_t call_index, ToxAvCapabilities capability ) 609int toxav_capability_supported ( ToxAv *av, int32_t call_index, ToxAvCapabilities capability )
610{ 610{
611 return av->calls[call_index].cs ? av->calls[call_index].cs->capabilities & (CSCapabilities) capability : 0;
612 /* 0 is error here */
613} 611}
614 612
615Tox *toxav_get_tox(ToxAv *av) 613Tox *toxav_get_tox(ToxAv *av)