Log SSRC for video decode errors

which makes it possible to grep the logs for all decode errors
on a particular SSRC.

BUG=None

Change-Id: I4aa54434f0b85932313adaf39e099729991a4700
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308823
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40404}
This commit is contained in:
Philipp Hancke 2023-07-04 13:31:28 +02:00 committed by WebRTC LUCI CQ
parent 26f72901c6
commit 3f10b4917e
2 changed files with 9 additions and 1 deletions

View File

@ -245,6 +245,7 @@ rtc_library("video_coding") {
"../../rtc_base:rtc_event",
"../../rtc_base:rtc_numerics",
"../../rtc_base:safe_conversions",
"../../rtc_base:stringutils",
"../../rtc_base:threading",
"../../rtc_base:timeutils",
"../../rtc_base/experiments:alr_experiment",

View File

@ -25,6 +25,7 @@
#include "modules/video_coding/include/video_error_codes.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#include "rtc_base/string_encode.h"
#include "rtc_base/trace_event.h"
#include "system_wrappers/include/clock.h"
@ -299,8 +300,14 @@ int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, Timestamp now) {
_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.Timestamp() << ", error code: " << ret;
<< frame.Timestamp() << ", ssrc "
<< (ssrc ? rtc::ToString(*ssrc) : "<not set>")
<< ", error code: " << ret;
_callback->ClearTimestampMap();
} else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT) {
// No output.