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

Issue 9234064: Implement device enumeration for PPB_VideoCapture_Dev. (Closed)

Created:
8 years, 11 months ago by yzshen1
Modified:
8 years, 10 months 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, joi+watch-content_chromium.org, darin-cc_chromium.org, vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org
Visibility:
Public.

Description

Implement device enumeration for PPB_VideoCapture_Dev. - Implement PPB_VideoCapture_Dev v0.2. - Use a ref-counted PlatformVideoCapture to manage lifespan of media::VideoCapture::EventHandler, instead of manipulating the ref count of PPB_VideoCapture_Impl. - Extend examples/video_capture. BUG=None TEST=examples/video_capture Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=122176

Patch Set 1 #

Patch Set 2 : Real change. The first patch set is actually 8480028 patch set 10. #

Total comments: 8

Patch Set 3 : . #

Total comments: 4

Patch Set 4 : Changes in response to Antoine's comments. #

Total comments: 13

Patch Set 5 : Change interface and move shared code into shared_impl. #

Total comments: 4

Patch Set 6 : sync & changes in response to Brett's suggestions #

Total comments: 12

Patch Set 7 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1869 lines, -419 lines) Patch
M content/content_renderer.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
A content/renderer/pepper_platform_video_capture_impl.h View 1 2 3 4 5 1 chunk +83 lines, -0 lines 0 comments Download
A content/renderer/pepper_platform_video_capture_impl.cc View 1 2 3 4 5 1 chunk +175 lines, -0 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.h View 1 2 3 4 5 6 5 chunks +26 lines, -1 line 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 4 5 6 9 chunks +198 lines, -59 lines 0 comments Download
M ppapi/api/dev/ppb_video_capture_dev.idl View 1 2 3 4 5 6 5 chunks +73 lines, -7 lines 0 comments Download
M ppapi/c/dev/ppb_video_capture_dev.h View 1 2 3 4 5 6 5 chunks +69 lines, -21 lines 0 comments Download
M ppapi/cpp/dev/video_capture_dev.h View 1 2 3 4 5 2 chunks +31 lines, -3 lines 0 comments Download
M ppapi/cpp/dev/video_capture_dev.cc View 1 2 3 4 4 chunks +120 lines, -12 lines 0 comments Download
M ppapi/examples/video_capture/video_capture.cc View 1 2 3 4 5 6 9 chunks +75 lines, -9 lines 0 comments Download
M ppapi/examples/video_capture/video_capture.html View 1 2 3 4 1 chunk +82 lines, -5 lines 0 comments Download
M ppapi/ppapi_shared.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 2 3 4 5 2 chunks +21 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_video_capture_proxy.h View 1 2 3 4 2 chunks +30 lines, -5 lines 0 comments Download
M ppapi/proxy/ppb_video_capture_proxy.cc View 1 2 3 4 5 6 7 chunks +205 lines, -99 lines 0 comments Download
M ppapi/shared_impl/ppb_device_ref_shared.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M ppapi/shared_impl/ppb_device_ref_shared.cc View 1 2 3 4 5 6 2 chunks +28 lines, -0 lines 0 comments Download
A ppapi/shared_impl/ppb_video_capture_shared.h View 1 2 3 4 5 6 1 chunk +98 lines, -0 lines 0 comments Download
A ppapi/shared_impl/ppb_video_capture_shared.cc View 1 2 3 4 5 6 1 chunk +189 lines, -0 lines 0 comments Download
M ppapi/thunk/interfaces_ppb_public_dev.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M ppapi/thunk/ppb_video_capture_api.h View 1 2 3 4 1 chunk +24 lines, -4 lines 0 comments Download
M ppapi/thunk/ppb_video_capture_thunk.cc View 1 2 3 4 5 3 chunks +72 lines, -8 lines 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/mock_plugin_delegate.cc View 1 2 3 4 5 2 chunks +8 lines, -1 line 0 comments Download
M webkit/plugins/ppapi/plugin_delegate.h View 1 2 3 4 5 6 chunks +35 lines, -3 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.h View 1 2 3 4 5 6 5 chunks +43 lines, -25 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.cc View 1 2 3 4 5 6 7 chunks +168 lines, -155 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
yzshen1
Hi, Antoine, Trung and Wei. Would you please review this change? Antoine, Trung: everything. Wei: ...
8 years, 11 months ago (2012-01-27 00:49:46 UTC) #1
wjia(left Chromium)
The interface with MediaStreamDispatcher looks fine. The main question is whether a plugin client would ...
8 years, 11 months ago (2012-01-27 06:13:09 UTC) #2
yzshen1
Thanks for your comments, Wei! http://codereview.chromium.org/9234064/diff/2001/webkit/plugins/ppapi/ppb_video_capture_impl.cc File webkit/plugins/ppapi/ppb_video_capture_impl.cc (right): http://codereview.chromium.org/9234064/diff/2001/webkit/plugins/ppapi/ppb_video_capture_impl.cc#newcode131 webkit/plugins/ppapi/ppb_video_capture_impl.cc:131: capability_.interlaced = false; // ...
8 years, 11 months ago (2012-01-27 18:00:24 UTC) #3
viettrungluu
some quick initial comments http://codereview.chromium.org/9234064/diff/2001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/9234064/diff/2001/content/renderer/pepper_plugin_delegate_impl.cc#newcode1151 content/renderer/pepper_plugin_delegate_impl.cc:1151: static int next_id_; Why does ...
8 years, 11 months ago (2012-01-27 18:54:34 UTC) #4
yzshen1
http://codereview.chromium.org/9234064/diff/2001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/9234064/diff/2001/content/renderer/pepper_plugin_delegate_impl.cc#newcode1151 content/renderer/pepper_plugin_delegate_impl.cc:1151: static int next_id_; You are right. It doesn't need ...
8 years, 11 months ago (2012-01-27 19:20:40 UTC) #5
piman
http://codereview.chromium.org/9234064/diff/8001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): http://codereview.chromium.org/9234064/diff/8001/content/renderer/pepper_plugin_delegate_impl.cc#newcode647 content/renderer/pepper_plugin_delegate_impl.cc:647: base::WeakPtrFactory<PlatformVideoCaptureImpl> weak_ptr_factory_; Do we actually need this? This class ...
8 years, 11 months ago (2012-01-28 08:26:54 UTC) #6
yzshen1
Thanks, Antoine! I also sent you a mail about more changes to the interface. You ...
8 years, 10 months ago (2012-01-29 21:58:31 UTC) #7
wjia(left Chromium)
lgtm for MediaStreamDispatcher related stuff.
8 years, 10 months ago (2012-01-30 23:54:07 UTC) #8
brettw
http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl File ppapi/api/dev/ppb_video_capture_dev.idl (right): http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl#newcode76 ppapi/api/dev/ppb_video_capture_dev.idl:76: int32_t EnumerateDevices( Thinking about this, I think it would ...
8 years, 10 months ago (2012-02-06 21:51:51 UTC) #9
yzshen1
Thanks Brett! I will update the CL soon. But I would like to understand your ...
8 years, 10 months ago (2012-02-06 22:42:56 UTC) #10
brettw
http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl File ppapi/api/dev/ppb_video_capture_dev.idl (right): http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl#newcode76 ppapi/api/dev/ppb_video_capture_dev.idl:76: int32_t EnumerateDevices( Yeah, I agree. The other way to ...
8 years, 10 months ago (2012-02-06 23:01:41 UTC) #11
yzshen1
http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl File ppapi/api/dev/ppb_video_capture_dev.idl (right): http://codereview.chromium.org/9234064/diff/11002/ppapi/api/dev/ppb_video_capture_dev.idl#newcode76 ppapi/api/dev/ppb_video_capture_dev.idl:76: int32_t EnumerateDevices( On 2012/02/06 23:01:42, brettw wrote: > Yeah, ...
8 years, 10 months ago (2012-02-07 00:15:00 UTC) #12
yzshen1
Hi, Brett, Trung and Antoine. Thanks for your suggestions! I have: - changed the interface ...
8 years, 10 months ago (2012-02-10 07:10:43 UTC) #13
brettw
lgtm https://chromiumcodereview.appspot.com/9234064/diff/20001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc (right): https://chromiumcodereview.appspot.com/9234064/diff/20001/content/renderer/pepper_plugin_delegate_impl.cc#newcode591 content/renderer/pepper_plugin_delegate_impl.cc:591: class PlatformVideoCaptureImpl Do you think you can move ...
8 years, 10 months ago (2012-02-10 23:46:22 UTC) #14
yzshen1
Thanks, Brett! Trung and Aotoine: Would you please take another look? Thanks! https://chromiumcodereview.appspot.com/9234064/diff/20001/content/renderer/pepper_plugin_delegate_impl.cc File content/renderer/pepper_plugin_delegate_impl.cc ...
8 years, 10 months ago (2012-02-13 20:55:40 UTC) #15
piman
LGTM+nits https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/examples/video_capture/video_capture.cc File ppapi/examples/video_capture/video_capture.cc (right): https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/examples/video_capture/video_capture.cc#newcode141 ppapi/examples/video_capture/video_capture.cc:141: bool page_initialized_; nit: I don't think this is ...
8 years, 10 months ago (2012-02-14 07:21:16 UTC) #16
viettrungluu
lgtm w/a few nits http://codereview.chromium.org/9234064/diff/32001/ppapi/api/dev/ppb_video_capture_dev.idl File ppapi/api/dev/ppb_video_capture_dev.idl (right): http://codereview.chromium.org/9234064/diff/32001/ppapi/api/dev/ppb_video_capture_dev.idl#newcode19 ppapi/api/dev/ppb_video_capture_dev.idl:19: * 2- Find out available ...
8 years, 10 months ago (2012-02-15 18:40:28 UTC) #17
yzshen1
8 years, 10 months ago (2012-02-15 21:17:53 UTC) #18
Thanks!

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/api/dev/ppb_v...
File ppapi/api/dev/ppb_video_capture_dev.idl (right):

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/api/dev/ppb_v...
ppapi/api/dev/ppb_video_capture_dev.idl:19: * 2- Find out available video
capture devices using EnumerateDevices.
On 2012/02/15 18:40:28, viettrungluu wrote:
> English nit: s/out //

Done.

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/api/dev/ppb_v...
ppapi/api/dev/ppb_video_capture_dev.idl:81: * - this method ignores the previous
value pointed to by |devices| (won't
We usually don't have restrictions about the previous value of out parameters,
so I think it makes sense to do the same here.

If you don't mind, I will leave it unchanged.

On 2012/02/15 18:40:28, viettrungluu wrote:
> This is a good warning, though I wonder if it'd be safer to insist that
*devices
> == 0 (though that would make devices an in-out parameters, technically).

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/examples/vide...
File ppapi/examples/video_capture/video_capture.cc (right):

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/examples/vide...
ppapi/examples/video_capture/video_capture.cc:141: bool page_initialized_;
On 2012/02/14 07:21:16, piman wrote:
> nit: I don't think this is used anywhere.

Done.

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/proxy/ppb_vid...
File ppapi/proxy/ppb_video_capture_proxy.cc (right):

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/proxy/ppb_vid...
ppapi/proxy/ppb_video_capture_proxy.cc:180: virtual const
std::vector<DeviceRefData>& InternalGetDeviceRefData(
On 2012/02/15 18:40:28, viettrungluu wrote:
> Nit: This is a very unusual way to break the line (probably you should just
move
> InternalGetDeviceRefData( to the next line?).

Done.

https://chromiumcodereview.appspot.com/9234064/diff/32001/ppapi/proxy/ppb_vid...
ppapi/proxy/ppb_video_capture_proxy.cc:208: default:
Thanks for pointing this out. Done.

On 2012/02/15 18:40:28, viettrungluu wrote:
> Nit: I have a preference for not having default cases (so that some compilers
> will warn you if other values of the enum are added). I'd put a |break;| after
> PP_..._{STARTING,STOPPING} and the NOTREACHED(); return false; outside the
> switch.

https://chromiumcodereview.appspot.com/9234064/diff/32001/webkit/plugins/ppap...
File webkit/plugins/ppapi/ppb_video_capture_impl.h (right):

https://chromiumcodereview.appspot.com/9234064/diff/32001/webkit/plugins/ppap...
webkit/plugins/ppapi/ppb_video_capture_impl.h:67: virtual const std::vector<
::ppapi::DeviceRefData>& InternalGetDeviceRefData(
Eye surgery done! :)
On 2012/02/14 07:21:16, piman wrote:
> nit: My eyes! It would be worth making a DeviceRefDataVector typedef.

Powered by Google App Engine
This is Rietveld 408576698