fix h264 encoder don't generate template_structure after first keyframe

Bug: webrtc:345993676
Change-Id: Ie71c08d9a29b33c5f5d74d3e0779084ead9b5505
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365962
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43265}
This commit is contained in:
林恩 2024-10-17 07:27:14 +00:00 committed by WebRTC LUCI CQ
parent 93e177862c
commit c382c84575
2 changed files with 3 additions and 1 deletions

View File

@ -151,6 +151,7 @@ Yuriy Pavlyshak <yuriy@appear.in>
Yusuke Suzuki <utatane.tea@gmail.com>
Pengfei Han <hanpfei@gmail.com>
Yingying Ma <yingying.ma@intel.com>
Hailin Zhao <lynnworld7@gmail.com>
# END individuals section.
# BEGIN organizations section.

View File

@ -590,7 +590,8 @@ int32_t H264EncoderImpl::Encode(
if (svc_controllers_[i]) {
codec_specific.generic_frame_info =
svc_controllers_[i]->OnEncodeDone(layer_frames[0]);
if (send_key_frame && codec_specific.generic_frame_info.has_value()) {
if (encoded_images_[i]._frameType == VideoFrameType::kVideoFrameKey &&
codec_specific.generic_frame_info.has_value()) {
codec_specific.template_structure =
svc_controllers_[i]->DependencyStructure();
}