提交 3b7bdac4 authored 作者: Seven Du's avatar Seven Du 提交者: Michael Jerris

FS-7517: mod_openh264 follows up the new encoder flow

上级 e7d34f31
...@@ -274,7 +274,7 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t ...@@ -274,7 +274,7 @@ static switch_status_t nalu_slice(h264_codec_context_t *context, switch_frame_t
frame->m = SWITCH_TRUE; frame->m = SWITCH_TRUE;
context->nalu_eat = 0; context->nalu_eat = 0;
context->cur_nalu_index++; context->cur_nalu_index++;
status = SWITCH_STATUS_MORE_DATA; status = SWITCH_STATUS_SUCCESS;
goto end; goto end;
} }
} }
...@@ -381,6 +381,8 @@ static switch_status_t switch_h264_encode(switch_codec_t *codec, switch_frame_t ...@@ -381,6 +381,8 @@ static switch_status_t switch_h264_encode(switch_codec_t *codec, switch_frame_t
SSourcePicture* pic = NULL; SSourcePicture* pic = NULL;
long result; long result;
frame->m = SWITCH_FALSE;
if (context->need_key_frame) { if (context->need_key_frame) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "H264 KEYFRAME GENERATED\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "H264 KEYFRAME GENERATED\n");
context->encoder->ForceIntraFrame(1); context->encoder->ForceIntraFrame(1);
...@@ -452,7 +454,6 @@ error: ...@@ -452,7 +454,6 @@ error:
} }
frame->datalen = 0; frame->datalen = 0;
frame->m = SWITCH_TRUE;
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
...@@ -541,9 +542,9 @@ static switch_status_t switch_h264_decode(switch_codec_t *codec, switch_frame_t ...@@ -541,9 +542,9 @@ static switch_status_t switch_h264_decode(switch_codec_t *codec, switch_frame_t
end: end:
if (size == 0) { if (size == 0) {
status == SWITCH_STATUS_MORE_DATA; status = SWITCH_STATUS_MORE_DATA;
} }
if (status == SWITCH_STATUS_RESTART) { if (status == SWITCH_STATUS_RESTART) {
context->got_sps = 0; context->got_sps = 0;
switch_buffer_zero(context->nalu_buffer); switch_buffer_zero(context->nalu_buffer);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论