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

Issue 2698203003: Update sink wants with ranges for both pixel count and frame rate.

Created:
3 years, 10 months ago by sprang_webrtc
Modified:
3 years, 10 months ago
CC:
webrtc-reviews_webrtc.org, video-team_agora.io, yujie_mao (webrtc), zhengzhonghou_agora.io, stefan-webrtc, tterriberry_mozilla.com, the sun, mflodman
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Update sink wants with ranges for both pixel count and frame rate. This cl has a few features: * Update SinkWants with a range struct (min, target, max) instead of having each component be optional. * Both pixel count and framerate is now present as an optional range. * Wire framerate restriction up in VideoAdapter * Support both maintain-resolution and balanced in vie_encoder, but don't actually request lower framerate yet. The new range makes the requests more explicit, as we can set max or min as cap when adapting down or up respectievely, while having a target that matches our desired step size and the possibility of not taking a too large step up or down. BUG=webrtc:4172

Patch Set 1 #

Total comments: 7

Patch Set 2 : Renamed range, refactored merging, updated tests #

Patch Set 3 : Slightly updated sink wants merging in videobroadcaster #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+528 lines, -263 lines) Patch
M webrtc/call/call_perf_tests.cc View 3 chunks +30 lines, -13 lines 0 comments Download
M webrtc/media/base/adaptedvideotracksource.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/media/base/fakevideorenderer.h View 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/media/base/videoadapter.h View 1 4 chunks +11 lines, -10 lines 0 comments Download
M webrtc/media/base/videoadapter.cc View 1 10 chunks +58 lines, -29 lines 0 comments Download
M webrtc/media/base/videoadapter_unittest.cc View 1 26 chunks +38 lines, -46 lines 0 comments Download
M webrtc/media/base/videobroadcaster.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/media/base/videobroadcaster.cc View 1 2 2 chunks +34 lines, -21 lines 2 comments Download
M webrtc/media/base/videobroadcaster_unittest.cc View 1 3 chunks +113 lines, -16 lines 0 comments Download
M webrtc/media/base/videocapturer.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/media/base/videocapturer_unittest.cc View 1 3 chunks +8 lines, -5 lines 0 comments Download
M webrtc/media/base/videosourceinterface.h View 1 1 chunk +36 lines, -7 lines 0 comments Download
M webrtc/media/engine/webrtcvideoengine2_unittest.cc View 1 9 chunks +19 lines, -15 lines 0 comments Download
M webrtc/video/vie_encoder.h View 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/video/vie_encoder.cc View 1 9 chunks +115 lines, -44 lines 0 comments Download
M webrtc/video/vie_encoder_unittest.cc View 1 14 chunks +57 lines, -53 lines 0 comments Download

Messages

Total messages: 21 (10 generated)
sprang_webrtc
nisse@, would you like to have a first shot at this since you've been involved ...
3 years, 10 months ago (2017-02-16 16:09:35 UTC) #4
nisse-webrtc
First round of comments, without looking carefully at the implementation. https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (right): https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videoadapter.cc#newcode279 ...
3 years, 10 months ago (2017-02-17 08:55:21 UTC) #7
sprang_webrtc
https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (right): https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videoadapter.cc#newcode279 webrtc/media/base/videoadapter.cc:279: void VideoAdapter::OnSinkWantsUpdated(const rtc::VideoSinkWants& sink_wants) { On 2017/02/17 08:55:21, nisse-webrtc ...
3 years, 10 months ago (2017-02-20 15:48:35 UTC) #10
nisse-webrtc
https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h File webrtc/media/base/videosourceinterface.h (right): https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h#newcode41 webrtc/media/base/videosourceinterface.h:41: uint32_t target; On 2017/02/20 15:48:35, språng wrote: > I ...
3 years, 10 months ago (2017-02-20 16:03:47 UTC) #11
sprang_webrtc
https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h File webrtc/media/base/videosourceinterface.h (right): https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h#newcode41 webrtc/media/base/videosourceinterface.h:41: uint32_t target; On 2017/02/20 16:03:47, nisse-webrtc wrote: > On ...
3 years, 10 months ago (2017-02-21 09:11:03 UTC) #14
nisse-webrtc
https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h File webrtc/media/base/videosourceinterface.h (right): https://codereview.webrtc.org/2698203003/diff/1/webrtc/media/base/videosourceinterface.h#newcode41 webrtc/media/base/videosourceinterface.h:41: uint32_t target; On 2017/02/21 09:11:03, språng wrote: > Any ...
3 years, 10 months ago (2017-02-21 09:33:59 UTC) #16
sprang_webrtc
https://codereview.webrtc.org/2698203003/diff/40001/webrtc/media/base/videobroadcaster.cc File webrtc/media/base/videobroadcaster.cc (right): https://codereview.webrtc.org/2698203003/diff/40001/webrtc/media/base/videobroadcaster.cc#newcode82 webrtc/media/base/videobroadcaster.cc:82: } On 2017/02/21 09:33:59, nisse-webrtc wrote: > I think ...
3 years, 10 months ago (2017-02-21 09:42:38 UTC) #17
kthelgason
This seems over-engineered to me, however I've followed the discussion and realise that this problem ...
3 years, 10 months ago (2017-02-22 12:30:09 UTC) #18
sprang_webrtc
On 2017/02/22 12:30:09, kthelgason wrote: > This seems over-engineered to me, however I've followed the ...
3 years, 10 months ago (2017-02-22 13:23:02 UTC) #19
nisse-webrtc
On 2017/02/22 13:23:02, språng wrote: > I'm not sure where OnOutputFormatRequest() comes into this, it ...
3 years, 10 months ago (2017-02-22 13:27:08 UTC) #20
kthelgason
3 years, 10 months ago (2017-02-22 13:27:11 UTC) #21
On 2017/02/22 13:23:02, språng wrote:
> On 2017/02/22 12:30:09, kthelgason wrote:
> > This seems over-engineered to me, however I've followed the discussion and
> > realise that this problem has more nuances than immediately apparent. Here
are
> > some thoughts in no particular order:
> > 
> > 1) I don't really understand what the point of |target| is when we have min
> and
> > max, i.e. what is the difference between selecting the next resolution
greater
> > than |min|?
> 
> The point of target was to have a more direct control of what resolution to,
> without a priori knowledge about available step sizes. We can just say "give
me
> a resolution close to X", rather than "give me a resolution lower than Y" over
> and over again until we're reasonably close to X.
> Right now, all scaling is done by VideoAdapter, but hopefully we will be able
to
> propagate these wants all the way to the capturer soon(ish), and then all bets
> are off as to step size.
> 
> > 2) When no resolution >= |min| is available, we return the greatest
available
> > resolution, even if it's less than |min| right? That makes it very easy to
> > misunderstand what these terms mean.
> 
> All of this is on a best effort basis, so yeah. When we enable the capturer to
> handles this, we may need to add extra protection just in case it misbehaves.
> 
> > 3) We already have onOutputFormatRequest to cap the maximum resolution, why
is
> > |max| also necessary?
> 
> I'm not sure where OnOutputFormatRequest() comes into this, it seems to a
> request for cropping that comes from elsewhere? I'm in favor of removing that
> if it's duplicate (both max pixel count and output format request was there
> before I started mucking around, so unsure of the context).
> 
> > I haven't taken a good look at the code, I just wanted to have a discussion
> > about the high-level design first.
> 
> Thanks.
> I really want to get the fps constraints in asap. Should we have a face to
face
> meeting so we can reach consensus faster?

That sounds really good, I'm sure you've thought about this much more thoroughly
than I have, and it would be good to have a meatspace discussion about this. If
you schedule a meeting magjed may also be interested.

Powered by Google App Engine
This is Rietveld 408576698