From 3f10b4917e813f73a9c49a72211bf71c8d812f11 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Tue, 4 Jul 2023 13:31:28 +0200 Subject: [PATCH] Log SSRC for video decode errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Henrik Boström Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/main@{#40404} --- modules/video_coding/BUILD.gn | 1 + modules/video_coding/generic_decoder.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index f875a1b20a..d8d20d6566 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -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", diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc index b660e02b72..46b8c95f61 100644 --- a/modules/video_coding/generic_decoder.cc +++ b/modules/video_coding/generic_decoder.cc @@ -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 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) : "") + << ", error code: " << ret; _callback->ClearTimestampMap(); } else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT) { // No output.