Move and extend frame decode failure logging

Move logging of decode failure from VCMGenericDecoder to VideoReceiveStream2 where remote SSRC is always known. Log frame details such as size and resolution which help to identify this frame in bitstream dump.

Bug: b/309132190
Change-Id: Ibe50799e448ffdc19f9857cc1625cfde0d7aa7a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328821
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41276}
This commit is contained in:
Sergey Silkin 2023-11-29 14:05:39 +01:00 committed by WebRTC LUCI CQ
parent 1a82d31cb5
commit ee46340054
2 changed files with 17 additions and 12 deletions

View File

@ -329,18 +329,7 @@ int32_t VCMGenericDecoder::Decode(const EncodedImage& frame,
}
_callback->OnDecoderInfoChanged(std::move(decoder_info));
}
if (ret < WEBRTC_VIDEO_CODEC_OK) {
const absl::optional<uint32_t> ssrc =
!frame_info.packet_infos.empty()
? absl::make_optional(frame_info.packet_infos[0].ssrc())
: absl::nullopt;
RTC_LOG(LS_WARNING) << "Failed to decode frame with timestamp "
<< frame.RtpTimestamp() << ", ssrc "
<< (ssrc ? rtc::ToString(*ssrc) : "<not set>")
<< ", error code: " << ret;
_callback->ClearTimestampMap();
} else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT) {
// No output.
if (ret < WEBRTC_VIDEO_CODEC_OK || ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT) {
_callback->ClearTimestampMap();
}
return ret;

View File

@ -904,6 +904,22 @@ int VideoReceiveStream2::DecodeAndMaybeDispatchEncodedFrame(
}
int decode_result = video_receiver_.Decode(frame_ptr);
if (decode_result < WEBRTC_VIDEO_CODEC_OK) {
// Asynchronous decoders may delay error reporting, potentially resulting in
// error reports reflecting issues that occurred several frames back.
RTC_LOG(LS_WARNING)
<< "Failed to decode frame. Return code: " << decode_result
<< ", SSRC: " << remote_ssrc()
<< ", frame RTP timestamp: " << frame_ptr->RtpTimestamp()
<< ", type: " << VideoFrameTypeToString(frame_ptr->FrameType())
<< ", size: " << frame_ptr->size()
<< ", width: " << frame_ptr->_encodedWidth
<< ", height: " << frame_ptr->_encodedHeight
<< ", spatial idx: " << frame_ptr->SpatialIndex().value_or(-1)
<< ", temporal idx: " << frame_ptr->TemporalIndex().value_or(-1)
<< ", id: " << frame_ptr->Id();
}
if (encoded_frame_output_enabled) {
absl::optional<RecordableEncodedFrame::EncodedResolution>
pending_resolution;