Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] Refine dropped frames reporting #2006

Closed

Conversation

jasonzhangxx
Copy link
Contributor

OnFrameRenderedListener can be significantly delayed and some frames may have been rendered even if there was no callback generated, so we can't rely on the callback to get dropped frames. We now predict if a frame would be dropped on the time when it's enqueued.

b/302198176

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c5a4b3c) 57.68% compared to head (8f15667) 57.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2006      +/-   ##
==========================================
+ Coverage   57.68%   57.69%   +0.01%     
==========================================
  Files        1907     1907              
  Lines       95181    95181              
==========================================
+ Hits        54905    54917      +12     
+ Misses      40276    40264      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

OnFrameRenderedListener can be significantly delayed and some frames may
have been rendered even if there was no callback generated, so we can't
rely on the callback to get dropped frames. We now predict if a frame
would be dropped on the time when it's enqueued.

b/302198176
@@ -485,6 +485,7 @@ bool MediaDecoder::ProcessOneInputBuffer(
status = media_codec_bridge_->QueueInputBuffer(
dequeue_input_result.index, kNoOffset, size, pts_us, kNoBufferFlags);
}
host_->OnInputBufferEnqueued(media_codec_bridge_.get(), input_buffer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: OnInputBufferQueued(), as the platform function is called Queue*().

SB_LOG(WARNING) << "feed video AU with same time stamp " << timestamp;
return;
}
if (input_buffer->timestamp() < media_time) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a frame is queued right before the current media time, we treat it as not dropped. This is a quite strong assumption and may lead to under report of dropped frames. Have we tried on some devices to see whether this reflects the actual frame drops?

frames_to_be_rendered_.emplace_front(timestamp);
}

void VideoFrameTracker::OnFrameRendered(int64_t frame_timestamp) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking with the partners on whether the behavior of the callback are reliable on certain platforms.

@jasonzhangxx jasonzhangxx deleted the dropped-frames-tunnel-mode branch February 1, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants