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

Issue 2672793002: Change rtc::VideoSinkWants to have target and a max pixel count (Closed)

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, kthelgason
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

Change rtc::VideoSinkWants to have target and a max pixel count The current method with max_pixel_count and max_pixel_count_step_up, where only one should be used at a time and this first signaling an inclusive upper bound and other other an exclusive lower bound, makes for a lot of confusion. I've updated this to have a desired target and a maximum instead. The source should select a resolution as close to the target as possible, but no higher than the maximum. I intend to also add similar frame rate settings in an upcoming cl. BUG=webrtc:4172, webrtc:6850 Review-Url: https://codereview.webrtc.org/2672793002 Cr-Commit-Position: refs/heads/master@{#16533} Committed: https://chromium.googlesource.com/external/webrtc/+/84a3759825ec3bcba104196148be15aabc258a08

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed comment #

Total comments: 14

Patch Set 3 : Address comments #

Total comments: 6

Patch Set 4 : Minor tweaks #

Total comments: 5

Patch Set 5 : Clarified test #

Total comments: 2

Patch Set 6 : nit #

Patch Set 7 : Fixed incorrect behavior in VideoAdapter, updated test #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -177 lines) Patch
M webrtc/call/call_perf_tests.cc View 1 2 3 4 1 chunk +11 lines, -4 lines 0 comments Download
M webrtc/media/base/adaptedvideotracksource.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/media/base/videoadapter.h View 1 2 3 2 chunks +8 lines, -6 lines 0 comments Download
M webrtc/media/base/videoadapter.cc View 1 2 3 4 5 6 6 chunks +62 lines, -33 lines 0 comments Download
M webrtc/media/base/videoadapter_unittest.cc View 1 2 3 4 5 6 21 chunks +48 lines, -43 lines 0 comments Download
M webrtc/media/base/videobroadcaster.cc View 1 2 1 chunk +11 lines, -9 lines 0 comments Download
M webrtc/media/base/videobroadcaster_unittest.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M webrtc/media/base/videocapturer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M webrtc/media/base/videocapturer_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M webrtc/media/base/videosourceinterface.h View 1 chunk +6 lines, -6 lines 0 comments Download
M webrtc/media/engine/webrtcvideoengine2_unittest.cc View 2 chunks +16 lines, -10 lines 0 comments Download
M webrtc/video/vie_encoder.h View 1 2 3 1 chunk +10 lines, -4 lines 0 comments Download
M webrtc/video/vie_encoder.cc View 1 2 3 7 chunks +33 lines, -21 lines 8 comments Download
M webrtc/video/vie_encoder_unittest.cc View 14 chunks +39 lines, -27 lines 0 comments Download

Messages

Total messages: 53 (25 generated)
sprang_webrtc
Nisse, you were involved in the initial sink wants discussion. Do you wanna have a ...
3 years, 10 months ago (2017-02-02 15:09:01 UTC) #4
nisse-webrtc
Comments on the semantics and merging of wants. Haven't yet looked at the details where ...
3 years, 10 months ago (2017-02-02 15:34:02 UTC) #5
sprang_webrtc
https://codereview.webrtc.org/2672793002/diff/1/webrtc/media/base/videobroadcaster.cc File webrtc/media/base/videobroadcaster.cc (right): https://codereview.webrtc.org/2672793002/diff/1/webrtc/media/base/videobroadcaster.cc#newcode103 webrtc/media/base/videobroadcaster.cc:103: wants.target_pixel_count = Optional<int>(); On 2017/02/02 15:34:02, nisse-webrtc wrote: > ...
3 years, 10 months ago (2017-02-03 13:51:46 UTC) #8
nisse-webrtc
lgtm https://codereview.webrtc.org/2672793002/diff/20001/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (right): https://codereview.webrtc.org/2672793002/diff/20001/webrtc/media/base/videoadapter.cc#newcode70 webrtc/media/base/videoadapter.cc:70: // Multiply by 2/3. I think this logic ...
3 years, 10 months ago (2017-02-06 08:43:19 UTC) #9
stefan-webrtc
cc kthelgasson since he has done a lot of work here and may have comments.
3 years, 10 months ago (2017-02-06 08:55:59 UTC) #11
sprang_webrtc
+magjed for webrtc/media +stefan for webrtc/call/call_perf_tests.cc https://codereview.webrtc.org/2672793002/diff/20001/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (right): https://codereview.webrtc.org/2672793002/diff/20001/webrtc/media/base/videoadapter.cc#newcode70 webrtc/media/base/videoadapter.cc:70: // Multiply by ...
3 years, 10 months ago (2017-02-06 10:34:02 UTC) #14
kthelgason
https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (left): https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.cc#oldcode133 webrtc/media/base/videoadapter.cc:133: static_cast<int>(step_up_)); good riddance! https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.h File webrtc/media/base/videoadapter.h (right): https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.h#newcode57 webrtc/media/base/videoadapter.h:57: ...
3 years, 10 months ago (2017-02-06 12:13:21 UTC) #16
sprang_webrtc
Addressed comments. kthelgason, any comment on this? https://codereview.webrtc.org/2672793002/diff/20001/webrtc/video/vie_encoder.cc#newcode620 https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (left): https://codereview.webrtc.org/2672793002/diff/40001/webrtc/media/base/videoadapter.cc#oldcode133 webrtc/media/base/videoadapter.cc:133: static_cast<int>(step_up_)); ...
3 years, 10 months ago (2017-02-06 13:18:07 UTC) #17
kthelgason
lgtm https://codereview.webrtc.org/2672793002/diff/20001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2672793002/diff/20001/webrtc/video/vie_encoder.cc#newcode620 webrtc/video/vie_encoder.cc:620: if (quality_scaler_ && qp >= 0) On 2017/02/06 ...
3 years, 10 months ago (2017-02-06 13:31:05 UTC) #18
stefan-webrtc
https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc File webrtc/call/call_perf_tests.cc (right): https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc#newcode495 webrtc/call/call_perf_tests.cc:495: // to a higher. It's hard to understand why ...
3 years, 10 months ago (2017-02-06 13:39:49 UTC) #20
nisse-webrtc
https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc File webrtc/call/call_perf_tests.cc (right): https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc#newcode495 webrtc/call/call_perf_tests.cc:495: // to a higher. On 2017/02/06 13:39:49, stefan-webrtc wrote: ...
3 years, 10 months ago (2017-02-06 13:42:40 UTC) #21
sprang_webrtc
https://codereview.webrtc.org/2672793002/diff/20001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2672793002/diff/20001/webrtc/video/vie_encoder.cc#newcode620 webrtc/video/vie_encoder.cc:620: if (quality_scaler_ && qp >= 0) On 2017/02/06 13:31:05, ...
3 years, 10 months ago (2017-02-06 13:49:53 UTC) #22
stefan-webrtc
https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc File webrtc/call/call_perf_tests.cc (right): https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc#newcode495 webrtc/call/call_perf_tests.cc:495: // to a higher. On 2017/02/06 13:49:53, språng wrote: ...
3 years, 10 months ago (2017-02-06 14:01:28 UTC) #23
stefan-webrtc
lgtm with comments updated.
3 years, 10 months ago (2017-02-06 14:01:56 UTC) #24
stefan-webrtc
Also fix spelling error in description.
3 years, 10 months ago (2017-02-06 14:02:17 UTC) #25
sprang_webrtc
https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc File webrtc/call/call_perf_tests.cc (right): https://codereview.webrtc.org/2672793002/diff/60001/webrtc/call/call_perf_tests.cc#newcode495 webrtc/call/call_perf_tests.cc:495: // to a higher. On 2017/02/06 14:01:28, stefan-webrtc wrote: ...
3 years, 10 months ago (2017-02-06 14:44:08 UTC) #27
sprang_webrtc
actually +magjed for webrtc/media
3 years, 10 months ago (2017-02-07 09:53:10 UTC) #29
magjed_webrtc
webrtc/media looks good to me. I also think the current rtc::VideoSinkWants interface is confusing and ...
3 years, 10 months ago (2017-02-07 15:02:40 UTC) #31
sprang_webrtc
Thanks, I'll comment in the bug you linked. https://codereview.webrtc.org/2672793002/diff/80001/webrtc/media/base/videoadapter.cc File webrtc/media/base/videoadapter.cc (right): https://codereview.webrtc.org/2672793002/diff/80001/webrtc/media/base/videoadapter.cc#newcode62 webrtc/media/base/videoadapter.cc:62: int ...
3 years, 10 months ago (2017-02-09 13:00:45 UTC) #32
magjed_webrtc
lgtm
3 years, 10 months ago (2017-02-10 12:02:25 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2672793002/100001
3 years, 10 months ago (2017-02-10 12:07:44 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: mac_rel on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/mac_rel/builds/22610)
3 years, 10 months ago (2017-02-10 12:19:17 UTC) #38
sprang_webrtc
There was a miss in VideoAdapter::OnResolutionRequest(). It doesn't make sense to keep the old value ...
3 years, 10 months ago (2017-02-10 13:01:54 UTC) #39
nisse-webrtc
On 2017/02/10 13:01:54, språng wrote: > There was a miss in VideoAdapter::OnResolutionRequest(). It doesn't make ...
3 years, 10 months ago (2017-02-10 13:22:31 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2672793002/120001
3 years, 10 months ago (2017-02-10 15:01:02 UTC) #47
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/external/webrtc/+/84a3759825ec3bcba104196148be15aabc258a08
3 years, 10 months ago (2017-02-10 15:04:35 UTC) #50
perkj_webrtc
https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder.cc File webrtc/video/vie_encoder.cc (right): https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder.cc#newcode192 webrtc/video/vie_encoder.cc:192: sink_wants_.target_pixel_count = rtc::Optional<int>(); nit: isn the word target_pixel_count here ...
3 years, 10 months ago (2017-02-13 08:48:03 UTC) #52
sprang_webrtc
3 years, 10 months ago (2017-02-13 09:29:20 UTC) #53
Message was sent while issue was closed.
Thanks for you comments perkj@, uploaded
https://codereview.webrtc.org/2690023002 to address them.

https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder.cc
File webrtc/video/vie_encoder.cc (right):

https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder...
webrtc/video/vie_encoder.cc:192: sink_wants_.target_pixel_count =
rtc::Optional<int>();
On 2017/02/13 08:48:03, perkj_webrtc wrote:
> nit: isn the word target_pixel_count  here equally confusing?  Naming is hard
> and I dont have a strong prefens either or. 

I think it makes sense, since we want the source to return frames at a
resolution as close as possible to target_pixel_count, rather than "a step up
from X, regardless of the step size". Since we control the step size down, it
makes sense to also try to control the step size up, imo.

https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder...
webrtc/video/vie_encoder.cc:208: // to be at most twice the number of pixels.
On 2017/02/13 08:48:03, perkj_webrtc wrote:
> nope, you have limited to be 4* times the number  of pixels.

This whole comment is misleading. I'll put up CL to clarify it.

https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder...
webrtc/video/vie_encoder.cc:620: if (quality_scaler_ && qp >= 0)
On 2017/02/13 08:48:03, perkj_webrtc wrote:
> correct cl? Does this fix a bug?

Yes, if fixes a bug but it only seems to be triggered by FakeEncoder, which
emits frames with qp = -1. It caused the test I added to fail because of
incorrect qp scaling. See earlier comment.

https://codereview.webrtc.org/2672793002/diff/120001/webrtc/video/vie_encoder...
webrtc/video/vie_encoder.cc:710: !last_frame_info_) {
On 2017/02/13 08:48:03, perkj_webrtc wrote:
> Looks like a bug if last_frame_info_ = nullptr. How can we adapt unless a
frame
> have been received. 

I think some test triggered that. I may want to figure out why and fix the test
+ DCHECK here instead.

Powered by Google App Engine
This is Rietveld 408576698