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

Issue 8304017: enable video capture to support sharing across multiple renderer processes (Closed)

Created:
9 years, 2 months ago by wjia(left Chromium)
Modified:
9 years, 1 month ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, jam, acolwell+watch_chromium.org, annacc+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, ajwong+watch_chromium.org, vrk (LEFT CHROMIUM), ihf+watch_chromium.org
Visibility:
Public.

Description

enable video capture to support sharing across multiple renderer processes To facilitate code review, this patch has been split into http://codereview.chromium.org/8400084/ for renderer process part, and http://codereview.chromium.org/8417046/ for browser process part. 1. VideoCaptureController is owned by VideoCaptureManager. 2. VideoCaptureHost obtains an instance of controller from manager. 3. Each renderer process has only one VC to serve multiple clients, while it is a client of browser process VC. 4. The largest resolution is used for the device capturing. Clients should expect frame buffers with larger resolution that they requsted. All cropping/resampling is done by clients. 5. Frame buffers are shared between renderer processes and browser process. The buffer received by clients are shared buffers. Clients are recommended to copy pixel data into their local storage. A client can slow down capture frame rate if it returns buffers slowly. 6. This patch only supported default device. More change in media stream is needed to support user selected device. That will be a different patch.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 38

Patch Set 4 : '' #

Patch Set 5 : add missing file #

Patch Set 6 : '' #

Total comments: 30

Patch Set 7 : code review #

Total comments: 19

Patch Set 8 : '' #

Total comments: 10

Patch Set 9 : remove state function from device; use currect requested params instead of frame_info #

Patch Set 10 : rebase #

Total comments: 20

Patch Set 11 : code review; VCImpl uses largest request, instead of device_info #

Patch Set 12 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+878 lines, -375 lines) Patch
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 3 4 5 6 7 8 9 3 chunks +78 lines, -34 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +369 lines, -52 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.h View 1 2 3 4 5 6 7 8 9 2 chunks +15 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 1 2 3 4 5 6 7 8 9 6 chunks +62 lines, -18 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -7 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.h View 1 2 3 4 5 6 7 8 9 6 chunks +38 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 3 4 5 6 7 8 9 6 chunks +136 lines, -23 lines 0 comments Download
M content/renderer/media/capture_video_decoder_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/media_stream_impl.cc View 1 2 3 4 5 6 7 8 9 11 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/video_capture_impl.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +4 lines, -19 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 3 4 5 6 7 8 9 10 14 chunks +94 lines, -133 lines 0 comments Download
M content/renderer/media/video_capture_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +66 lines, -69 lines 0 comments Download
M content/renderer/media/video_capture_module_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/video_capture_module_impl.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +2 lines, -8 lines 0 comments Download
M media/video/capture/video_capture.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
wjia(left Chromium)
9 years, 2 months ago (2011-10-15 01:25:18 UTC) #1
perkj_chrome
Looks very good. But I think you must make sure that the first client is ...
9 years, 2 months ago (2011-10-17 08:39:43 UTC) #2
scherkus (not reviewing)
few drive by nits http://codereview.chromium.org/8304017/diff/8001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/8001/content/browser/renderer_host/media/video_capture_controller.cc#newcode364 content/browser/renderer_host/media/video_capture_controller.cc:364: : controller_id(id), indent by 2 ...
9 years, 2 months ago (2011-10-19 18:02:21 UTC) #3
mflodman_chromium_OOO
http://codereview.chromium.org/8304017/diff/8001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/8001/content/browser/renderer_host/media/video_capture_controller.cc#newcode89 content/browser/renderer_host/media/video_capture_controller.cc:89: video_capture_manager_->Stop(params_.session_id, base::Closure()); On 2011/10/17 08:39:43, perkj wrote: > I ...
9 years, 2 months ago (2011-10-19 18:18:23 UTC) #4
wjia(left Chromium)
Thanks for the review! The new patch has resolution handling changed to take max of ...
9 years, 2 months ago (2011-10-21 00:56:13 UTC) #5
wjia(left Chromium)
+ vtl@
9 years, 2 months ago (2011-10-21 00:57:49 UTC) #6
perkj_chrome
Here are a some comments. Great with the support of many hosts to one controller. ...
9 years, 2 months ago (2011-10-21 14:54:00 UTC) #7
wjia(left Chromium)
http://codereview.chromium.org/8304017/diff/8001/media/video/capture/linux/video_capture_device_linux.cc File media/video/capture/linux/video_capture_device_linux.cc (right): http://codereview.chromium.org/8304017/diff/8001/media/video/capture/linux/video_capture_device_linux.cc#newcode195 media/video/capture/linux/video_capture_device_linux.cc:195: observer_->OnDeviceState(true); Could you clarify it's VideoCapture::StopCapture or VideoCaptureDevice::Stop, since ...
9 years, 2 months ago (2011-10-21 23:54:16 UTC) #8
wjia(left Chromium)
ping.
9 years, 2 months ago (2011-10-25 17:07:55 UTC) #9
mflodman_chromium_OOO
http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc#newcode61 content/browser/renderer_host/media/video_capture_controller.cc:61: const VideoCaptureControllerID& id, Q: What do you think about ...
9 years, 1 month ago (2011-10-26 12:34:44 UTC) #10
wjia(left Chromium)
Thanks, Magnus! http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc#newcode61 content/browser/renderer_host/media/video_capture_controller.cc:61: const VideoCaptureControllerID& id, On 2011/10/26 12:34:45, mflodman ...
9 years, 1 month ago (2011-10-26 21:17:33 UTC) #11
perkj_chrome
Added comments on why manager->start and manager->stop is asyncronouse. http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/24001/content/browser/renderer_host/media/video_capture_controller.cc#newcode183 content/browser/renderer_host/media/video_capture_controller.cc:183: ...
9 years, 1 month ago (2011-10-27 07:27:32 UTC) #12
perkj_chrome
more comments http://codereview.chromium.org/8304017/diff/32001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): http://codereview.chromium.org/8304017/diff/32001/content/browser/renderer_host/media/video_capture_controller.cc#newcode91 content/browser/renderer_host/media/video_capture_controller.cc:91: // Need restart catpuring. nit: catpuring- capturing. ...
9 years, 1 month ago (2011-10-27 14:30:30 UTC) #13
wjia(left Chromium)
Thanks, Per! The patch set 9 removed the state report function in video_capture_device. Controller now ...
9 years, 1 month ago (2011-10-28 01:27:39 UTC) #14
perkj_chrome
Looks good. It would be great if you can make sure VideoCaptureManager always post events ...
9 years, 1 month ago (2011-10-28 08:37:19 UTC) #15
wjia(left Chromium)
9 years, 1 month ago (2011-10-29 02:34:39 UTC) #16
http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
File content/browser/renderer_host/media/video_capture_controller.cc (right):

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_controller.cc:200: // after
this return, ready to delet this client.
On 2011/10/28 08:37:19, perkj wrote:
> nit delet -delete

Done.

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_controller.cc:399:
frame_info_= info;
On 2011/10/28 08:37:19, perkj wrote:
> nit: do you really need both frame_info and frame_info available? 
Using frame_info_available is easy to read. Another way is to tap into
frame_info and use its members as indicator of availability.

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_controller.cc:437: void
VideoCaptureController::PostStopping() {
On 2011/10/28 08:37:19, perkj wrote:
> Add a comment about what this function do. And maybe rename since it does not
> stop but rather restart the camera?
Comments added. This function indeed also puts controller in kStopped state when
there is no more client. So it is some post processing after kStopping state.

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_controller.cc:506:
BrowserThread::PostTask(BrowserThread::IO,
On 2011/10/28 08:37:19, perkj wrote:
> Make sure that this post in this class is moved to the capturemanager.
> Ie,make sure that the capturemanager post this event on the io thread. Ie -
all
> input and output from the manager should be done on the io thread since that
is
> the only thread that it's clients know of.
Controller doesn't need to know what threads VCManager is operating on. It just
posts a task to IO thread whenever this function is called. This is more
flexible than requiring VCManager to call outgoing function on IO thread. The
callee decides which thread to run the function, instead of caller.

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
File content/browser/renderer_host/media/video_capture_host.cc (right):

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_host.cc:164:
BrowserThread::PostTask(
On 2011/10/28 08:37:19, perkj wrote:
> Make sure that this post in this class is moved to the capturemanager.
> Ie,make sure that the capturemanager post this event on the io thread. Ie -
all
> input and output from the manager should be done on the io thread since that
is
> the only thread that it's clients now of.

Same explanation as in video_capture_controller.cc

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
File content/browser/renderer_host/media/video_capture_manager.cc (right):

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_manager.cc:11: #include
"content/browser/renderer_host/media/video_capture_controller_event_handler.h"
On 2011/10/28 08:37:19, perkj wrote:
> can and should this be made 80 by breaking the line?
Header files should be always on one line. This line breaking comes from
display.

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
File content/browser/renderer_host/media/video_capture_manager_unittest.cc
(right):

http://codereview.chromium.org/8304017/diff/43002/content/browser/renderer_ho...
content/browser/renderer_host/media/video_capture_manager_unittest.cc:67:
virtual void OnDeviceState(bool in_use) {}
On 2011/10/28 08:37:19, perkj wrote:
> remove

Done.

http://codereview.chromium.org/8304017/diff/43002/content/renderer/media/vide...
File content/renderer/media/video_capture_module_impl.cc (right):

http://codereview.chromium.org/8304017/diff/43002/content/renderer/media/vide...
content/renderer/media/video_capture_module_impl.cc:251: if (!got_first_frame_)
{
On 2011/10/28 08:37:19, perkj wrote:
> Why is this necessary? Why compensate the time? ViE don't care about the
> timestamp of the first frame.
removed.

http://codereview.chromium.org/8304017/diff/43002/content/renderer/media/vide...
content/renderer/media/video_capture_module_impl.cc:260: if (buf->width ==
static_cast<int>(width_) &&
On 2011/10/28 08:37:19, perkj wrote:
> You should never have to care about the frame size. ViE will have to scale
> before doing encoding. Just make sure the frameInfo is correct in each frame.
reverted the change.

Powered by Google App Engine
This is Rietveld 408576698