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

Issue 120893002: Eliminate video capture thread in renderer (Closed)

Created:
7 years ago by Alpha Left Google
Modified:
6 years, 11 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, perkj_chrome, Jói
Visibility:
Public.

Description

Eliminate video capture thread in renderer The main motivation of this change is to remove the video capture thread in the renderer. All users of a video capture device already handles the video frame on their thread. There is no need to call the clients with an additional thread. Summary of this change: * Video capture thread eliminated VideoCaptureImpl now runs on the IO thread. Clients are called on the IO thread. * Simplified VideoCaptureImplManager We still need to keep this object for the purpose of sharing a VideoCaptureImpl object with multiple clients. It should own these objects and maintain the usage count. A couple clean up items are done on this class: * It doesn't own the video capture thread now. * It is now a render thread only object. * It maintains refcount of a VideoCaptureImpl explicitly. * It is no longer refcounted. * Clients access it through RenderThreadImpl. Which ensures usage is on the render thread. * New VideoCaptureHandle class Object of this class is returned by VideoCaptureImplManager to give access to a media::VideoCapture object. It is purely a wrapper and helps to do refcounting on the render thread. Testing: Added unit tests for VideoCaptureImplManager to test refcounting. Also updated unit test for VideoCaptureImpl due to the threading changes. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244074 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244687

Patch Set 1 : mac compile #

Patch Set 2 : compile warning #

Total comments: 7

Patch Set 3 : missing file #

Patch Set 4 : fixed comments #

Patch Set 5 : comments #

Total comments: 51

Patch Set 6 : git cl upload #

Total comments: 25

Patch Set 7 : comments #

Total comments: 9

Patch Set 8 : comments #

Patch Set 9 : upload again because of stupid 500 error #

Patch Set 10 : merged #

Patch Set 11 : merged #

Patch Set 12 : revert #

Patch Set 13 : test-fix #

Total comments: 2

Patch Set 14 : fixed tsan #

Total comments: 2

Patch Set 15 : git cl upload #

Patch Set 16 : upload again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+421 lines, -445 lines) Patch
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/media_stream_dependency_factory.h View 3 chunks +0 lines, -3 lines 0 comments Download
M content/renderer/media/media_stream_dependency_factory.cc View 3 chunks +1 line, -4 lines 0 comments Download
M content/renderer/media/mock_media_stream_dependency_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/rtc_video_capture_delegate.h View 1 2 3 4 5 6 3 chunks +7 lines, -7 lines 0 comments Download
M content/renderer/media/rtc_video_capture_delegate.cc View 1 2 3 4 5 1 chunk +8 lines, -6 lines 0 comments Download
M content/renderer/media/rtc_video_capturer.h View 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/media/rtc_video_capturer.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/renderer/media/video_capture_impl.h View 1 2 3 4 5 6 7 8 9 6 chunks +50 lines, -57 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 13 chunks +60 lines, -107 lines 0 comments Download
M content/renderer/media/video_capture_impl_manager.h View 1 2 3 4 5 6 7 1 chunk +65 lines, -38 lines 0 comments Download
M content/renderer/media/video_capture_impl_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +74 lines, -55 lines 0 comments Download
M content/renderer/media/video_capture_impl_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +24 lines, -14 lines 0 comments Download
M content/renderer/media/video_capture_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +62 lines, -136 lines 0 comments Download
M content/renderer/pepper/pepper_platform_video_capture.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/pepper/pepper_platform_video_capture.cc View 1 2 3 4 5 3 chunks +2 lines, -8 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -2 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
A media/video/capture/mock_video_capture_event_handler.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +36 lines, -0 lines 0 comments Download
A media/video/capture/mock_video_capture_event_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (0 generated)
Alpha Left Google
7 years ago (2013-12-24 04:44:46 UTC) #1
Alpha Left Google
7 years ago (2013-12-24 04:44:57 UTC) #2
Alpha Left Google
7 years ago (2013-12-24 04:45:16 UTC) #3
Alpha Left Google
7 years ago (2013-12-24 04:45:33 UTC) #4
Jói
This change looks really good to me, it simplifies things quite a bit. However, I ...
6 years, 12 months ago (2013-12-27 13:34:34 UTC) #5
Alpha Left Google
https://codereview.chromium.org/120893002/diff/310004/content/renderer/media/video_capture_impl.cc File content/renderer/media/video_capture_impl.cc (right): https://codereview.chromium.org/120893002/diff/310004/content/renderer/media/video_capture_impl.cc#newcode191 content/renderer/media/video_capture_impl.cc:191: DLOG(ERROR) << "SharedMemory::Map() failed."; On 2013/12/27 13:34:35, Jói (AWAY ...
6 years, 12 months ago (2013-12-27 21:30:00 UTC) #6
wjia(left Chromium)
Overall looks good. One comment. https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc (right): https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc#newcode22 content/renderer/media/rtc_video_capture_delegate.cc:22: RenderThreadImpl::current()->video_capture_impl_manager() Using RenderThreadImpl::current() will ...
6 years, 12 months ago (2013-12-28 02:42:32 UTC) #7
Alpha Left Google
https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc (right): https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc#newcode22 content/renderer/media/rtc_video_capture_delegate.cc:22: RenderThreadImpl::current()->video_capture_impl_manager() On 2013/12/28 02:42:32, wjia wrote: > Using RenderThreadImpl::current() ...
6 years, 11 months ago (2014-01-02 23:35:15 UTC) #8
Alpha Left Google
Anyone can look at this again? I would like to land this soon.
6 years, 11 months ago (2014-01-06 19:01:26 UTC) #9
wjia(left Chromium)
+perkj@ since he created the first version of rtc_video_capture_delegate.cc. https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc (right): https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc#newcode22 content/renderer/media/rtc_video_capture_delegate.cc:22: ...
6 years, 11 months ago (2014-01-06 19:17:22 UTC) #10
Ami GONE FROM CHROMIUM
I think this CL is a huge improvement! Thanks for doing this. https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc ...
6 years, 11 months ago (2014-01-06 23:37:13 UTC) #11
perkj_chrome
https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc (right): https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc#newcode22 content/renderer/media/rtc_video_capture_delegate.cc:22: RenderThreadImpl::current()->video_capture_impl_manager() On 2014/01/06 23:37:14, Ami Fischman wrote: > On ...
6 years, 11 months ago (2014-01-07 06:21:43 UTC) #12
Alpha Left Google
https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc File content/renderer/media/rtc_video_capture_delegate.cc (right): https://codereview.chromium.org/120893002/diff/530001/content/renderer/media/rtc_video_capture_delegate.cc#newcode26 content/renderer/media/rtc_video_capture_delegate.cc:26: RtcVideoCaptureDelegate::~RtcVideoCaptureDelegate() { On 2014/01/06 23:37:14, Ami Fischman wrote: > ...
6 years, 11 months ago (2014-01-08 00:23:35 UTC) #13
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/120893002/diff/760001/content/renderer/media/rtc_video_capture_delegate.h File content/renderer/media/rtc_video_capture_delegate.h (right): https://codereview.chromium.org/120893002/diff/760001/content/renderer/media/rtc_video_capture_delegate.h#newcode46 content/renderer/media/rtc_video_capture_delegate.h:46: // These functions are called from IO thread that ...
6 years, 11 months ago (2014-01-08 01:43:58 UTC) #14
Alpha Left Google
https://codereview.chromium.org/120893002/diff/760001/content/renderer/media/rtc_video_capture_delegate.h File content/renderer/media/rtc_video_capture_delegate.h (right): https://codereview.chromium.org/120893002/diff/760001/content/renderer/media/rtc_video_capture_delegate.h#newcode46 content/renderer/media/rtc_video_capture_delegate.h:46: // These functions are called from IO thread that ...
6 years, 11 months ago (2014-01-08 22:30:49 UTC) #15
Ami GONE FROM CHROMIUM
LGTM % nits. https://codereview.chromium.org/120893002/diff/1080001/content/renderer/media/video_capture_impl.h File content/renderer/media/video_capture_impl.h (right): https://codereview.chromium.org/120893002/diff/1080001/content/renderer/media/video_capture_impl.h#newcode15 content/renderer/media/video_capture_impl.h:15: // be called on any thread. ...
6 years, 11 months ago (2014-01-08 22:41:09 UTC) #16
Alpha Left Google
https://codereview.chromium.org/120893002/diff/1080001/content/renderer/media/video_capture_impl.h File content/renderer/media/video_capture_impl.h (right): https://codereview.chromium.org/120893002/diff/1080001/content/renderer/media/video_capture_impl.h#newcode15 content/renderer/media/video_capture_impl.h:15: // be called on any thread. Internally it runs ...
6 years, 11 months ago (2014-01-08 22:57:04 UTC) #17
Alpha Left Google
+jamesr for changes in content/renderer/render_thread_impl.{cc,h}.
6 years, 11 months ago (2014-01-08 22:57:23 UTC) #18
Alpha Left Google
Actually +jamesr this time.
6 years, 11 months ago (2014-01-08 23:10:04 UTC) #19
jamesr
lgtm
6 years, 11 months ago (2014-01-08 23:11:45 UTC) #20
Alpha Left Google
+jam for content/content_tests.gypi
6 years, 11 months ago (2014-01-08 23:46:59 UTC) #21
jam
On 2014/01/08 23:46:59, Alpha wrote: > +jam for content/content_tests.gypi lgtm. please feel free to tbr ...
6 years, 11 months ago (2014-01-09 18:12:44 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/120893002/1340001
6 years, 11 months ago (2014-01-09 20:54:31 UTC) #23
commit-bot: I haz the power
Failed to apply patch for content/renderer/media/video_capture_impl.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2014-01-09 23:19:20 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/120893002/1660001
6 years, 11 months ago (2014-01-10 00:27:38 UTC) #25
commit-bot: I haz the power
Change committed as 244074
6 years, 11 months ago (2014-01-10 03:39:31 UTC) #26
Alpha Left Google
fischman: can you look at patchset 12. This patch was reverted because of a TSan ...
6 years, 11 months ago (2014-01-13 01:14:03 UTC) #27
Alpha Left Google
On 2014/01/13 01:14:03, Alpha wrote: > fischman: can you look at patchset 12. This patch ...
6 years, 11 months ago (2014-01-13 01:14:47 UTC) #28
mcasas
https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl.cc File content/renderer/media/video_capture_impl.cc (right): https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl.cc#newcode170 content/renderer/media/video_capture_impl.cc:170: client_buffers_.clear(); Alpha: I rebased my CL against this landed ...
6 years, 11 months ago (2014-01-13 13:46:41 UTC) #29
Alpha Left Google
On 2014/01/13 13:46:41, mcasas wrote: > https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl.cc > File content/renderer/media/video_capture_impl.cc (right): > > https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl.cc#newcode170 > ...
6 years, 11 months ago (2014-01-13 17:02:36 UTC) #30
Alpha Left Google
On 2014/01/13 17:02:36, Alpha wrote: > On 2014/01/13 13:46:41, mcasas wrote: > > > https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl.cc ...
6 years, 11 months ago (2014-01-13 17:26:38 UTC) #31
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl_manager_unittest.cc File content/renderer/media/video_capture_impl_manager_unittest.cc (right): https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl_manager_unittest.cc#newcode150 content/renderer/media/video_capture_impl_manager_unittest.cc:150: // destruction sequence of VideoCaptureImpl. If the thing you're ...
6 years, 11 months ago (2014-01-13 18:26:36 UTC) #32
Alpha Left Google
On 2014/01/13 18:26:36, Ami Fischman wrote: > https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl_manager_unittest.cc > File content/renderer/media/video_capture_impl_manager_unittest.cc (right): > > https://codereview.chromium.org/120893002/diff/1960001/content/renderer/media/video_capture_impl_manager_unittest.cc#newcode150 ...
6 years, 11 months ago (2014-01-13 21:50:03 UTC) #33
Ami GONE FROM CHROMIUM
PS#14 LGTM https://codereview.chromium.org/120893002/diff/2630001/content/renderer/media/video_capture_impl_manager_unittest.cc File content/renderer/media/video_capture_impl_manager_unittest.cc (right): https://codereview.chromium.org/120893002/diff/2630001/content/renderer/media/video_capture_impl_manager_unittest.cc#newcode53 content/renderer/media/video_capture_impl_manager_unittest.cc:53: : destruct_callback_(destruct_callback) {} explicit https://codereview.chromium.org/120893002/diff/2630001/content/renderer/media/video_capture_impl_manager_unittest.cc#newcode53 content/renderer/media/video_capture_impl_manager_unittest.cc:53: : ...
6 years, 11 months ago (2014-01-13 22:15:03 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hclam@chromium.org/120893002/2690001
6 years, 11 months ago (2014-01-14 07:32:15 UTC) #35
commit-bot: I haz the power
6 years, 11 months ago (2014-01-14 13:51:50 UTC) #36
Message was sent while issue was closed.
Change committed as 244687

Powered by Google App Engine
This is Rietveld 408576698