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

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

Issue 2698203003: Update sink wants with ranges for both pixel count and frame rate.
Patch Set: Slightly updated sink wants merging in videobroadcaster Created 3 years, 10 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
Index: webrtc/media/base/videoadapter.h
diff --git a/webrtc/media/base/videoadapter.h b/webrtc/media/base/videoadapter.h
index caaab3ce6c144f75737db3eea6471c22f0c4e5f3..57dd0dca20cbe66e78df89791fd32c50eb184905 100644
--- a/webrtc/media/base/videoadapter.h
+++ b/webrtc/media/base/videoadapter.h
@@ -15,6 +15,7 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/optional.h"
#include "webrtc/media/base/videocommon.h"
+#include "webrtc/media/base/videosourceinterface.h"
namespace cricket {
@@ -25,7 +26,7 @@ namespace cricket {
class VideoAdapter {
public:
VideoAdapter();
- VideoAdapter(int required_resolution_alignment);
+ explicit VideoAdapter(int required_resolution_alignment);
virtual ~VideoAdapter();
// Return the adapted resolution and cropping parameters given the
@@ -48,13 +49,11 @@ class VideoAdapter {
// 720x1280 is requested.
void OnOutputFormatRequest(const VideoFormat& format);
- // Requests the output frame size from |AdaptFrameResolution| to have as close
- // as possible to |target_pixel_count|, but no more than |max_pixel_count|
- // pixels. If |target_pixel_count| is not set, treat it as being equal to
- // |max_pixel_count|. If |max_pixel_count| is not set, treat is as being the
- // highest resolution available.
- void OnResolutionRequest(const rtc::Optional<int>& target_pixel_count,
- const rtc::Optional<int>& max_pixel_count);
+ // Requests resolution and/or framerate to be restricted according to the
+ // constraints specified.
+ void OnResolutionFramerateRequest(
+ const rtc::Optional<rtc::VideoSinkWants::Range>& pixel_count,
+ const rtc::Optional<rtc::VideoSinkWants::Range>& framerate_fps);
private:
// Determine if frame should be dropped based on input fps and requested fps.
@@ -75,8 +74,10 @@ class VideoAdapter {
// OnResolutionRequest respectively.
// The adapted output format is the minimum of these.
rtc::Optional<VideoFormat> requested_format_ GUARDED_BY(critical_section_);
- int resolution_request_target_pixel_count_ GUARDED_BY(critical_section_);
- int resolution_request_max_pixel_count_ GUARDED_BY(critical_section_);
+ rtc::Optional<rtc::VideoSinkWants::Range> requested_pixel_count_
+ GUARDED_BY(critical_section_);
+ rtc::Optional<rtc::VideoSinkWants::Range> requested_framerate_fps_
+ GUARDED_BY(critical_section_);
// The critical section to protect the above variables.
rtc::CriticalSection critical_section_;

Powered by Google App Engine
This is Rietveld 408576698