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}
This commit is contained in:
Markus Handell 2024-04-23 15:14:36 +02:00 committed by WebRTC LUCI CQ
parent 00a8839d47
commit fffd489d2e
3 changed files with 15 additions and 3 deletions

View file

@ -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 @@ rtc::scoped_refptr<VideoFrameBuffer> VideoFrameBuffer::GetMappedFrameBuffer(
return nullptr;
}
std::string VideoFrameBuffer::storage_representation() const {
return "?";
}
VideoFrameBuffer::Type I420BufferInterface::type() const {
return Type::kI420;
}

View file

@ -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 @@ class RTC_EXPORT VideoFrameBuffer : public webrtc::RefCountInterface {
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 {}
};

View file

@ -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);