Commit d6eedc20 authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

VideoFrameSubmitter: Add PresentationFeedback TRACE_EVENT_ASYNC

This CL adds a TRACE_EVENT_ASYNC_... for VideoFrameSubmitter's
frame round trip (e.g. from the CompositorFrame delivery to the
swap buffers event deep in the DRM Thread if on ChromeOS).

E.g. for a webm playback from file on my gLinux box it looks
like [1]. On a real time loopback webrtc conversation on
my nocturne chromebook it looks much more jittery.

[1] https://i.imgur.com/uyJk7cz.png (https://imgur.com/a/nbaBc7U)

Bug: 950183
Change-Id: Ia95fb0e9b60128343eecf699ba0551b920a497ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554952Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649135}
parent 3c8481d0
......@@ -172,10 +172,18 @@ void VideoFrameSubmitter::DidReceiveCompositorFrameAck(
void VideoFrameSubmitter::OnBeginFrame(
const viz::BeginFrameArgs& args,
WTF::HashMap<uint32_t, ::gfx::mojom::blink::PresentationFeedbackPtr>) {
WTF::HashMap<uint32_t, ::gfx::mojom::blink::PresentationFeedbackPtr>
feedbacks) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
TRACE_EVENT0("media", "VideoFrameSubmitter::OnBeginFrame");
for (const auto& pair : feedbacks) {
if (viz::FrameTokenGT(pair.key, *next_frame_token_))
continue;
TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0("media", "VideoFrameSubmitter",
pair.key, pair.value->timestamp);
}
// Don't call UpdateCurrentFrame() for MISSED BeginFrames. Also don't call it
// after StopRendering() has been called (forbidden by API contract).
viz::BeginFrameAck current_begin_frame_ack(args, false);
......@@ -483,6 +491,10 @@ viz::CompositorFrame VideoFrameSubmitter::CreateCompositorFrame(
compositor_frame.metadata.begin_frame_ack = begin_frame_ack;
compositor_frame.metadata.frame_token = ++next_frame_token_;
TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0("media", "VideoFrameSubmitter",
*next_frame_token_,
base::TimeTicks::Now());
// We don't assume that the ack is marked as having damage. However, we're
// definitely emitting a CompositorFrame that damages the entire surface.
compositor_frame.metadata.begin_frame_ack.has_damage = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment