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

Issue 8037055: Add OnRemoved() in VideoCapture::EventHandler API (Closed)

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

Description

Add OnRemoved() in VideoCapture::EventHandler API This is to allow client to know when the event handler can be deleted. BUG=none TEST=trybots Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=103016

Patch Set 1 #

Total comments: 4

Patch Set 2 : code review #

Patch Set 3 : change needed for unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -1 line) Patch
M content/renderer/media/capture_video_decoder.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/capture_video_decoder.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/media/video_capture_impl.cc View 1 2 5 chunks +9 lines, -0 lines 0 comments Download
M content/renderer/media/video_capture_impl_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/media/video_capture_module_impl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/media/video_capture_module_impl.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M media/video/capture/video_capture.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M media/video/capture/video_capture_proxy.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M media/video/capture/video_capture_proxy.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M webkit/plugins/ppapi/ppb_video_capture_impl.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
viettrungluu
LGTM, though maybe expand some comments as indicated. http://codereview.chromium.org/8037055/diff/1/media/video/capture/video_capture.h File media/video/capture/video_capture.h (right): http://codereview.chromium.org/8037055/diff/1/media/video/capture/video_capture.h#newcode69 media/video/capture/video_capture.h:69: // ...
9 years, 2 months ago (2011-09-27 00:04:57 UTC) #1
wjia(left Chromium)
Need stamp from media/ owner. http://codereview.chromium.org/8037055/diff/1/media/video/capture/video_capture.h File media/video/capture/video_capture.h (right): http://codereview.chromium.org/8037055/diff/1/media/video/capture/video_capture.h#newcode69 media/video/capture/video_capture.h:69: // Notify client that ...
9 years, 2 months ago (2011-09-27 00:26:17 UTC) #2
Ami GONE FROM CHROMIUM
I see no problems with the code that's here, but I'm confused. Is the expectation ...
9 years, 2 months ago (2011-09-27 03:21:47 UTC) #3
Ami GONE FROM CHROMIUM
BTW CL description needs BUG/TEST lines. Maybe there's a bug that explains the answers to ...
9 years, 2 months ago (2011-09-27 03:22:44 UTC) #4
wjia(left Chromium)
Thanks, Ami! Reply is inline. On Mon, Sep 26, 2011 at 8:21 PM, <fischman@chromium.org> wrote: ...
9 years, 2 months ago (2011-09-27 17:12:54 UTC) #5
wjia(left Chromium)
On Mon, Sep 26, 2011 at 8:22 PM, <fischman@chromium.org> wrote: > BTW CL description needs ...
9 years, 2 months ago (2011-09-27 17:15:53 UTC) #6
Ami GONE FROM CHROMIUM
IIUC I had to deal with a similar set of constraints in OmxVideoDecodeAccelerator, where the ...
9 years, 2 months ago (2011-09-27 17:44:04 UTC) #7
wjia(left Chromium)
On Tue, Sep 27, 2011 at 10:44 AM, <fischman@chromium.org> wrote: > IIUC I had to ...
9 years, 2 months ago (2011-09-27 18:02:58 UTC) #8
Ami GONE FROM CHROMIUM
> Indeed, I had another patch to make StopCapture() as synchronous shutdown ( > http://codereview.chromium.org/8036005/). ...
9 years, 2 months ago (2011-09-27 18:16:16 UTC) #9
viettrungluu
On 2011/09/27 18:16:16, Ami Fischman wrote: > > Indeed, I had another patch to make ...
9 years, 2 months ago (2011-09-27 20:18:30 UTC) #10
Ami GONE FROM CHROMIUM
LGTM On 2011/09/27 20:18:30, viettrungluu wrote: > This is essentially equivalent to refcounting the EventHandler ...
9 years, 2 months ago (2011-09-27 21:05:35 UTC) #11
viettrungluu
9 years, 2 months ago (2011-09-27 21:10:02 UTC) #12
On 2011/09/27 21:05:35, Ami Fischman wrote:
> LGTM
> 
> On 2011/09/27 20:18:30, viettrungluu wrote:
> > This is essentially equivalent to refcounting the EventHandler (and having
the
> > video capture thread take a reference to the EventHandler), without making
it
> > refcounted (which poses other problems).
> 
> I remain confused as to why this smells-like-a-refcounting scheme results in
an
> API method named "OnRemove" but Wei tells me you (or someone else from
> pepper-team?) think this is an appropriate name, which makes me think I still
> don't really grok the point of this API.  Since you're the consumer here I'll
> let this go and look forward to understanding the point of this when the
> interface is filled in in the various clients.

I'm not attached to "OnRemoved()". I'd be okay with "EventHandlerReleased()" or
whatever.

(Note that "EventHandlerAttached()"/"...Added()"/whatever would be useless,
since it'd be racy. If *I* were to design this API, I'd have an explicit
|AddEventHandler()| call, which would be required before passing the handler to
anything else.[*])

[*] I'd also probably have it return an opaque handle, which may or may not be a
pointer to the EventHandler, to be used for all the other calls.

Powered by Google App Engine
This is Rietveld 408576698