Add VideoFrameBuffer::storage_presentation.
This CL adds tracing support for input video frame representation
which was useful in debugging the linked bug.
Bug: b/328533258
Change-Id: I8a9e533b11d99688a71a24138bf8058b841e55d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348841
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Stefan Holmer <holmer@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42155}
diff --git a/api/video/video_frame_buffer.cc b/api/video/video_frame_buffer.cc
index 374b438..7297ee6 100644
--- a/api/video/video_frame_buffer.cc
+++ b/api/video/video_frame_buffer.cc
@@ -10,6 +10,8 @@
#include "api/video/video_frame_buffer.h"
+#include <string>
+
#include "api/video/i420_buffer.h"
#include "api/video/i422_buffer.h"
#include "api/video/i444_buffer.h"
@@ -79,6 +81,10 @@
return nullptr;
}
+std::string VideoFrameBuffer::storage_representation() const {
+ return "?";
+}
+
VideoFrameBuffer::Type I420BufferInterface::type() const {
return Type::kI420;
}
diff --git a/api/video/video_frame_buffer.h b/api/video/video_frame_buffer.h
index 4e5d40c..ebea7d9 100644
--- a/api/video/video_frame_buffer.h
+++ b/api/video/video_frame_buffer.h
@@ -11,7 +11,8 @@
#ifndef API_VIDEO_VIDEO_FRAME_BUFFER_H_
#define API_VIDEO_VIDEO_FRAME_BUFFER_H_
-#include <stdint.h>
+#include <cstdint>
+#include <string>
#include "api/array_view.h"
#include "api/ref_count.h"
@@ -125,6 +126,10 @@
virtual rtc::scoped_refptr<VideoFrameBuffer> GetMappedFrameBuffer(
rtc::ArrayView<Type> types);
+ // For logging: returns a textual representation of the storage.
+ // TODO(b/328533258): Make pure virtual once downstream adapts.
+ virtual std::string storage_representation() const;
+
protected:
~VideoFrameBuffer() override {}
};
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 7f42f73..706b4ce 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -2021,8 +2021,9 @@
<< send_codec_.height << " received a too small frame "
<< out_frame.width() << "x" << out_frame.height();
- TRACE_EVENT1("webrtc", "VCMGenericEncoder::Encode", "timestamp",
- out_frame.rtp_timestamp());
+ TRACE_EVENT2("webrtc", "webrtc::VideoEncoder::Encode", "rtp_timestamp",
+ out_frame.rtp_timestamp(), "storage_representation",
+ out_frame.video_frame_buffer()->storage_representation());
frame_encode_metadata_writer_.OnEncodeStarted(out_frame);