diff --git a/api/video/video_frame_buffer.cc b/api/video/video_frame_buffer.cc index 374b438adc..7297ee6051 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 + #include "api/video/i420_buffer.h" #include "api/video/i422_buffer.h" #include "api/video/i444_buffer.h" @@ -79,6 +81,10 @@ rtc::scoped_refptr VideoFrameBuffer::GetMappedFrameBuffer( 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 4e5d40c3f3..ebea7d9406 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 +#include +#include #include "api/array_view.h" #include "api/ref_count.h" @@ -125,6 +126,10 @@ class RTC_EXPORT VideoFrameBuffer : public webrtc::RefCountInterface { virtual rtc::scoped_refptr GetMappedFrameBuffer( rtc::ArrayView 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 7f42f73a61..706b4ce1c4 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -2021,8 +2021,9 @@ void VideoStreamEncoder::EncodeVideoFrame(const VideoFrame& video_frame, << 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);