FS-7500: improvement for conf vid

This commit is contained in:
Anthony Minessale
2014-12-02 11:51:21 -05:00
committed by Michael Jerris
parent 8b9d23fad0
commit 2ea12656ea
4 changed files with 80 additions and 15 deletions

View File

@@ -74,6 +74,7 @@ struct vpx_context {
uint8_t decoder_init;
switch_buffer_t *vpx_packet_buffer;
int got_key_frame;
int key_count;
switch_size_t last_received_timestamp;
switch_bool_t last_received_complete_picture;
int need_key_frame;
@@ -479,6 +480,7 @@ static switch_status_t buffer_vpx_packets(vpx_context_t *context, switch_frame_t
if (is_keyframe && !context->got_key_frame) {
context->got_key_frame = 1;
context->key_count = 0;
}
}
@@ -529,9 +531,9 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
len = switch_buffer_inuse(context->vpx_packet_buffer);
if (frame->m && (status != SWITCH_STATUS_SUCCESS || !len)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WTF????? %d %ld\n", status, len);
}
//if (frame->m && (status != SWITCH_STATUS_SUCCESS || !len)) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WTF????? %d %ld\n", status, len);
//}
if (status == SWITCH_STATUS_SUCCESS && frame->m && len) {
@@ -572,11 +574,6 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
end:
if (status == SWITCH_STATUS_NOTFOUND) {
switch_buffer_zero(context->vpx_packet_buffer);
switch_set_flag(frame, SFF_WAIT_KEY_FRAME);
}
if (status == SWITCH_STATUS_RESTART) {
context->got_key_frame = 0;
switch_buffer_zero(context->vpx_packet_buffer);
@@ -589,9 +586,12 @@ end:
}
if (!context->got_key_frame) {
switch_set_flag(frame, SFF_WAIT_KEY_FRAME);
if (!(context->key_count++ % 20)) {
switch_set_flag(frame, SFF_WAIT_KEY_FRAME);
}
}
return status;
}