diff options
author | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 21:45:09 +0000 |
---|---|---|
committer | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 21:45:09 +0000 |
commit | 38ba7ae8f8aa0a2399e466c36d458a9e38e94297 (patch) | |
tree | adb07982f6cec3b218e638ffd7648942975a9435 /media/video | |
parent | 0881e190121c0a4ef24175df2f2307334d6a8d32 (diff) | |
download | chromium_src-38ba7ae8f8aa0a2399e466c36d458a9e38e94297.zip chromium_src-38ba7ae8f8aa0a2399e466c36d458a9e38e94297.tar.gz chromium_src-38ba7ae8f8aa0a2399e466c36d458a9e38e94297.tar.bz2 |
Add OnRemoved() in VideoCapture::EventHandler API
This is to allow client to know when the event handler can be deleted.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/8037055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r-- | media/video/capture/video_capture.h | 6 | ||||
-rw-r--r-- | media/video/capture/video_capture_proxy.cc | 4 | ||||
-rw-r--r-- | media/video/capture/video_capture_proxy.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/media/video/capture/video_capture.h b/media/video/capture/video_capture.h index 9a197e2..c4f6d70 100644 --- a/media/video/capture/video_capture.h +++ b/media/video/capture/video_capture.h @@ -66,6 +66,10 @@ class VideoCapture { // Notify client that video capture has hit some error |error_code|. virtual void OnError(VideoCapture* capture, int error_code) = 0; + // Notify client that the client has been removed and no more calls will be + // received. + virtual void OnRemoved(VideoCapture* capture) = 0; + // Notify client that a buffer is available. virtual void OnBufferReady(VideoCapture* capture, scoped_refptr<VideoFrameBuffer> buffer) = 0; @@ -93,10 +97,12 @@ class VideoCapture { // Request video capture to start capturing with |capability|. // Also register |handler| with video capture for event handling. + // |handler| must remain valid until it has received |OnRemoved()|. virtual void StartCapture(EventHandler* handler, const VideoCaptureCapability& capability) = 0; // Request video capture to stop capturing for client |handler|. + // |handler| must remain valid until it has received |OnRemoved()|. virtual void StopCapture(EventHandler* handler) = 0; // Feed buffer to video capture when done with it. diff --git a/media/video/capture/video_capture_proxy.cc b/media/video/capture/video_capture_proxy.cc index 0ee5393..a8d00cb 100644 --- a/media/video/capture/video_capture_proxy.cc +++ b/media/video/capture/video_capture_proxy.cc @@ -68,6 +68,10 @@ void VideoCaptureHandlerProxy::OnError(VideoCapture* capture, int error_code) { error_code)); } +void VideoCaptureHandlerProxy::OnRemoved(VideoCapture* capture) { + // TODO(vtl): add logic when this event handler is removed. +} + void VideoCaptureHandlerProxy::OnBufferReady( VideoCapture* capture, scoped_refptr<VideoCapture::VideoFrameBuffer> buffer) { diff --git a/media/video/capture/video_capture_proxy.h b/media/video/capture/video_capture_proxy.h index 8be8474..0594379 100644 --- a/media/video/capture/video_capture_proxy.h +++ b/media/video/capture/video_capture_proxy.h @@ -51,6 +51,7 @@ class MEDIA_EXPORT VideoCaptureHandlerProxy virtual void OnStopped(VideoCapture* capture) OVERRIDE; virtual void OnPaused(VideoCapture* capture) OVERRIDE; virtual void OnError(VideoCapture* capture, int error_code) OVERRIDE; + virtual void OnRemoved(VideoCapture* capture) OVERRIDE; virtual void OnBufferReady( VideoCapture* capture, scoped_refptr<VideoCapture::VideoFrameBuffer> buffer) OVERRIDE; |