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

Issue 246433006: Change MediaStreamVideoSource to output different resolutions to different tracks depending on the … (Closed)

Created:
6 years, 8 months ago by perkj_chrome
Modified:
6 years, 7 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Visibility:
Public.

Description

Change MediaStreamVideoSource to output different resolutions do different tracks depending on the track constraints. This cl introduce a new class VideoTrackAdapter. The adapter is responsible for forwarding frames on the IO-thread from a MediaStreamVideoSource to a the tracks connected to the source. It has the ability to wrap media::VideoFrames with new visible_rect and natural_size to match max width and height resolutions as well as min and max aspect ratio per track. Note that this does not yet work for textures. It also changes the WebrtcVideoCaptureAdapter to use libyuv::Scale instead of libyuv::I420Copy. This is needed to allow the video frames sent on a PC to be both cropped and scaled. BUG=346616 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272214

Patch Set 1 #

Patch Set 2 : Rebased on work for delivering on IO-thread. #

Patch Set 3 : More cleaning. #

Patch Set 4 : #

Total comments: 44

Patch Set 5 : Rebased #

Patch Set 6 : Addressed code review comments. #

Patch Set 7 : Rebased #

Total comments: 38

Patch Set 8 : Addressed review comments. #

Total comments: 35

Patch Set 9 : Rebased and fixed comments. Also makes sure VideoSinkDeliverFrameCB is released on the main ui thre… #

Patch Set 10 : Fixed missed comments. #

Total comments: 8

Patch Set 11 : Addressed comments and fixed flaky tests. #

Patch Set 12 : Fix compile #

Patch Set 13 : Rebased #

Patch Set 14 : Rebased #

Patch Set 15 : Rebased #

Patch Set 16 : Fix race in ctor of VideoTrackAdapter. #

Total comments: 4

Patch Set 17 : Addressed nits. #

Patch Set 18 : Fix U & V offset before sending frame to libjingle. #

Patch Set 19 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1004 lines, -276 lines) Patch
M content/browser/media/webrtc_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +16 lines, -0 lines 0 comments Download
M content/browser/media/webrtc_getusermedia_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +45 lines, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/media/media_stream_constraints_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +24 lines, -10 lines 0 comments Download
M content/renderer/media/media_stream_constraints_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +43 lines, -18 lines 0 comments Download
M content/renderer/media/media_stream_video_capture_source_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/media_stream_video_source.h View 1 2 3 4 5 6 7 8 6 chunks +8 lines, -18 lines 0 comments Download
M content/renderer/media/media_stream_video_source.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 14 chunks +139 lines, -160 lines 0 comments Download
M content/renderer/media/media_stream_video_source_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +191 lines, -7 lines 0 comments Download
M content/renderer/media/media_stream_video_track.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/mock_media_stream_video_source.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/video_frame_deliverer.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A content/renderer/media/video_track_adapter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +88 lines, -0 lines 0 comments Download
A content/renderer/media/video_track_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +335 lines, -0 lines 0 comments Download
M content/renderer/media/webrtc/media_stream_remote_video_source.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/webrtc/media_stream_remote_video_source_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +45 lines, -35 lines 0 comments Download
M content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc View 1 2 3 4 5 2 chunks +18 lines, -13 lines 0 comments Download
M content/test/data/media/getusermedia.html View 1 2 3 4 chunks +45 lines, -11 lines 0 comments Download

Messages

Total messages: 45 (0 generated)
perkj_chrome
Hej I think this is ready for a first pass. Can you please review?
6 years, 7 months ago (2014-05-06 13:11:00 UTC) #1
perkj_chrome
Miguel, can you please take a look?
6 years, 7 months ago (2014-05-07 12:32:15 UTC) #2
perkj_chrome
And Patrik for the tests and as much code as you want.
6 years, 7 months ago (2014-05-07 13:00:32 UTC) #3
mcasas
Looking fine, just minor comments and suggestions. https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc File content/renderer/media/media_stream_video_source.cc (right): https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc#newcode273 content/renderer/media/media_stream_video_source.cc:273: if (*min_aspect_ratio ...
6 years, 7 months ago (2014-05-07 14:10:43 UTC) #4
phoglund_chromium
lgtm for content_browsertests
6 years, 7 months ago (2014-05-07 14:14:25 UTC) #5
perkj_chrome
PTAL https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc File content/renderer/media/media_stream_video_source.cc (right): https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc#newcode273 content/renderer/media/media_stream_video_source.cc:273: if (*min_aspect_ratio != 0) On 2014/05/07 14:10:43, mcasas ...
6 years, 7 months ago (2014-05-08 11:29:46 UTC) #6
tommi (sloooow) - chröme
first pass - need to go to a meeting will take another look after https://codereview.chromium.org/246433006/diff/120001/content/renderer/media/media_stream_video_source.cc ...
6 years, 7 months ago (2014-05-08 11:57:57 UTC) #7
perkj_chrome
self review https://codereview.chromium.org/246433006/diff/120001/content/browser/media/webrtc_getusermedia_browsertest.cc File content/browser/media/webrtc_getusermedia_browsertest.cc (right): https://codereview.chromium.org/246433006/diff/120001/content/browser/media/webrtc_getusermedia_browsertest.cc#newcode482 content/browser/media/webrtc_getusermedia_browsertest.cc:482: one to many lines https://codereview.chromium.org/246433006/diff/120001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc ...
6 years, 7 months ago (2014-05-08 11:59:02 UTC) #8
perkj_chrome
PTAL https://codereview.chromium.org/246433006/diff/120001/content/browser/media/webrtc_getusermedia_browsertest.cc File content/browser/media/webrtc_getusermedia_browsertest.cc (right): https://codereview.chromium.org/246433006/diff/120001/content/browser/media/webrtc_getusermedia_browsertest.cc#newcode482 content/browser/media/webrtc_getusermedia_browsertest.cc:482: On 2014/05/08 11:59:02, perkj wrote: > one to ...
6 years, 7 months ago (2014-05-08 13:36:24 UTC) #9
mcasas
Couple of smaller things. Possible bug in webrtc_video_capturer_adapter.cc:144? https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc File content/renderer/media/media_stream_video_source.cc (right): https://codereview.chromium.org/246433006/diff/60001/content/renderer/media/media_stream_video_source.cc#newcode273 content/renderer/media/media_stream_video_source.cc:273: if ...
6 years, 7 months ago (2014-05-09 07:46:24 UTC) #10
tommi (sloooow) - chröme
due to having limited time today I defer to Miguel for the rest of the ...
6 years, 7 months ago (2014-05-09 11:16:13 UTC) #11
mcasas
LGTM with: * refactor common code in webrtc_getusermedia_browsertest.cc * nit: some minor documentation cleanup in ...
6 years, 7 months ago (2014-05-09 13:11:34 UTC) #12
perkj_chrome
PTAL https://codereview.chromium.org/246433006/diff/140001/content/browser/media/webrtc_browsertest.cc File content/browser/media/webrtc_browsertest.cc (right): https://codereview.chromium.org/246433006/diff/140001/content/browser/media/webrtc_browsertest.cc#newcode57 content/browser/media/webrtc_browsertest.cc:57: base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(5)); On 2014/05/09 07:46:24, mcasas wrote: > nit: ...
6 years, 7 months ago (2014-05-13 11:05:55 UTC) #13
tommi (sloooow) - chröme
lgtm w/ a few minor suggestions/questions https://codereview.chromium.org/246433006/diff/180001/content/browser/media/webrtc_getusermedia_browsertest.cc File content/browser/media/webrtc_getusermedia_browsertest.cc (right): https://codereview.chromium.org/246433006/diff/180001/content/browser/media/webrtc_getusermedia_browsertest.cc#newcode448 content/browser/media/webrtc_getusermedia_browsertest.cc:448: std::string constraints2 = ...
6 years, 7 months ago (2014-05-14 09:43:37 UTC) #14
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-14 12:37:35 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/200001
6 years, 7 months ago (2014-05-14 12:37:41 UTC) #16
perkj_chrome
The CQ bit was unchecked by perkj@chromium.org
6 years, 7 months ago (2014-05-14 13:17:56 UTC) #17
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-14 13:29:33 UTC) #18
perkj_chrome
https://codereview.chromium.org/246433006/diff/180001/content/browser/media/webrtc_getusermedia_browsertest.cc File content/browser/media/webrtc_getusermedia_browsertest.cc (right): https://codereview.chromium.org/246433006/diff/180001/content/browser/media/webrtc_getusermedia_browsertest.cc#newcode448 content/browser/media/webrtc_getusermedia_browsertest.cc:448: std::string constraints2 = "{video: true, audio: true}"; On 2014/05/14 ...
6 years, 7 months ago (2014-05-14 13:29:43 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/220001
6 years, 7 months ago (2014-05-14 13:29:49 UTC) #20
perkj_chrome
The CQ bit was unchecked by perkj@chromium.org
6 years, 7 months ago (2014-05-14 15:17:07 UTC) #21
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-15 06:58:25 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/240001
6 years, 7 months ago (2014-05-15 06:59:48 UTC) #23
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-15 08:58:43 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-15 09:01:32 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: ios_rel_device on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_rel_device/builds/141919)
6 years, 7 months ago (2014-05-15 09:01:33 UTC) #26
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-15 13:31:23 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/260001
6 years, 7 months ago (2014-05-15 13:32:00 UTC) #28
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-15 17:27:39 UTC) #29
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-15 17:30:48 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_dbg_simulator/builds/152385)
6 years, 7 months ago (2014-05-15 17:30:48 UTC) #31
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-19 18:54:56 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/360001
6 years, 7 months ago (2014-05-19 18:56:25 UTC) #33
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-19 19:29:59 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-19 19:33:57 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_chromium_gn_compile_rel/builds/5499) linux_chromium_gn_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_gn_rel/builds/8339) linux_chromium_rel ...
6 years, 7 months ago (2014-05-19 19:33:58 UTC) #36
mcasas
LGTM with a nit. https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc (right): https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc#newcode49 content/renderer/media/video_track_adapter.cc:49: // |callback| will however be ...
6 years, 7 months ago (2014-05-20 07:19:52 UTC) #37
tommi (sloooow) - chröme
Hej Per - I see you've been trying to land this for almost a week. ...
6 years, 7 months ago (2014-05-20 07:30:57 UTC) #38
mcasas
https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc (right): https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc#newcode227 content/renderer/media/video_track_adapter.cc:227: base::Passed(&callback))); PS-nit: consider "RelaseSoon()" https://code.google.com/p/chromium/codesearch#chromium/src/base/message_loop/message_loop.h&sq=package:chromium&type=cs&q=deletesoon&l=205
6 years, 7 months ago (2014-05-20 07:36:08 UTC) #39
perkj_chrome
On 2014/05/20 07:36:08, mcasas wrote: > https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc > File content/renderer/media/video_track_adapter.cc (right): > > https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc#newcode227 > ...
6 years, 7 months ago (2014-05-20 07:38:11 UTC) #40
phoglund_chromium
On 2014/05/20 07:38:11, perkj wrote: > On 2014/05/20 07:36:08, mcasas wrote: > > > https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc ...
6 years, 7 months ago (2014-05-20 08:03:42 UTC) #41
perkj_chrome
https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc File content/renderer/media/video_track_adapter.cc (right): https://codereview.chromium.org/246433006/diff/360001/content/renderer/media/video_track_adapter.cc#newcode49 content/renderer/media/video_track_adapter.cc:49: // |callback| will however be released on thee main ...
6 years, 7 months ago (2014-05-22 07:06:04 UTC) #42
perkj_chrome
The CQ bit was checked by perkj@chromium.org
6 years, 7 months ago (2014-05-22 07:06:19 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/perkj@chromium.org/246433006/420001
6 years, 7 months ago (2014-05-22 07:09:12 UTC) #44
commit-bot: I haz the power
6 years, 7 months ago (2014-05-22 17:24:03 UTC) #45
Message was sent while issue was closed.
Change committed as 272214

Powered by Google App Engine
This is Rietveld 408576698