Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Unified Diff: webrtc/media/base/videoadapter.h

Issue 1982983003: VideoAdapter: Drop frames based on actual fps instead of expected fps (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add jitter test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/media/base/videoadapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videoadapter.h
diff --git a/webrtc/media/base/videoadapter.h b/webrtc/media/base/videoadapter.h
index 2db0ada271324f5b61350ef0ca508d4d8856fdbe..45fd1fa8274ef3b85adfbb98cd3c8c598cfdf7d5 100644
--- a/webrtc/media/base/videoadapter.h
+++ b/webrtc/media/base/videoadapter.h
@@ -27,17 +27,13 @@ class VideoAdapter {
VideoAdapter();
virtual ~VideoAdapter();
- // Sets the expected frame interval. This controls how often frames should
- // be dropped if |OnOutputFormatRequest| is called with a lower frame
- // interval.
- void SetExpectedInputFrameInterval(int64_t interval);
-
// Return the adapted resolution given the input resolution. The input
// resolution should first be cropped to the specified resolution, and then
// scaled to the final output resolution. The output resolution will be 0x0 if
// the frame should be dropped.
void AdaptFrameResolution(int in_width,
int in_height,
+ int64_t in_timestamp_ns,
int* cropped_width,
int* cropped_height,
int* out_width,
@@ -58,14 +54,17 @@ class VideoAdapter {
rtc::Optional<int> max_pixel_count_step_up);
private:
+ // Determine if frame should be dropped based on input fps and requested fps.
+ bool KeepFrame(int64_t in_timestamp_ns);
+
int frames_in_; // Number of input frames.
int frames_out_; // Number of output frames.
int frames_scaled_; // Number of frames scaled.
int adaption_changes_; // Number of changes in scale factor.
int previous_width_; // Previous adapter output width.
int previous_height_; // Previous adapter output height.
- int input_interval_ GUARDED_BY(critical_section_);
- int64_t interval_next_frame_ GUARDED_BY(critical_section_);
+ // The target timestamp for the next frame based on requested format.
+ rtc::Optional<int64_t> next_frame_timestamp_ns_ GUARDED_BY(critical_section_);
// Max number of pixels requested via calls to OnOutputFormatRequest,
// OnResolutionRequest respectively.
« no previous file with comments | « no previous file | webrtc/media/base/videoadapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698