Chromium Code Reviews| Index: content/browser/renderer_host/media/video_capture_host.h |
| diff --git a/content/browser/renderer_host/media/video_capture_host.h b/content/browser/renderer_host/media/video_capture_host.h |
| index 00a5f090d58dd9824c208fc64f8bd39fadfc7e1f..d7c58bbff3d95e5f24c89088cd3f9cb0d78654d6 100644 |
| --- a/content/browser/renderer_host/media/video_capture_host.h |
| +++ b/content/browser/renderer_host/media/video_capture_host.h |
| @@ -13,21 +13,21 @@ |
| // Renderer VideoCaptureHost |
| // | | |
| // | --------- StartCapture --------> | |
| -// | < VideoCaptureMsg_StateChanged | |
| -// | (VIDEO_CAPTURE_STATE_STARTED) | |
| +// | <------ VideoCaptureObserver ------ | |
| +// | ::StateChanged(STARTED) | |
| // | < VideoCaptureMsg_NewBuffer(1) | |
| // | < VideoCaptureMsg_NewBuffer(2) | |
| // | < VideoCaptureMsg_NewBuffer(3) | |
| // | | |
| // | < VideoCaptureMsg_BufferReady(1) | |
| // | < VideoCaptureMsg_BufferReady(2) | |
| -// | VideoCaptureHostMsg_BufferReady(1) > | |
| +// | -------- ReleaseBuffer(1) ---------> | |
| // | < VideoCaptureMsg_BufferReady(3) | |
| -// | VideoCaptureHostMsg_BufferReady(2) > | |
| +// | -------- ReleaseBuffer(2) ---------> | |
| // | < VideoCaptureMsg_BufferReady(1) | |
| -// | VideoCaptureHostMsg_BufferReady(3) > | |
| +// | -------- ReleaseBuffer(3) ---------> | |
| // | < VideoCaptureMsg_BufferReady(2) | |
| -// | VideoCaptureHostMsg_BufferReady(1) > | |
| +// | -------- ReleaseBuffer(1) ---------> | |
| // | ... | |
| // | < VideoCaptureMsg_BufferReady(3) | |
| // | | |
| @@ -35,7 +35,7 @@ |
| // | < VideoCaptureMsg_FreeBuffer(1) | Buffers are re-allocated |
| // | < VideoCaptureMsg_NewBuffer(4) | with a larger size, as |
| // | < VideoCaptureMsg_BufferReady(4) | needed. |
| -// | VideoCaptureHostMsg_BufferReady(2) > | |
| +// | -------- ReleaseBuffer(2) ---------> | |
| // | < VideoCaptureMsg_FreeBuffer(2) | |
| // | < VideoCaptureMsg_NewBuffer(5) | |
| // | < VideoCaptureMsg_BufferReady(5) | |
| @@ -43,9 +43,9 @@ |
| // | | |
| // | < VideoCaptureMsg_BufferReady | |
| // | --------- StopCapture ---------> | |
| -// | VideoCaptureHostMsg_BufferReady > | |
| -// | < VideoCaptureMsg_StateChanged | |
| -// | (VIDEO_CAPTURE_STATE_STOPPED) | |
| +// | -------- ReleaseBuffer(n) ---------> | |
| +// | <------ VideoCaptureObserver ------ | |
| +// | ::StateChanged(STOPPED) | |
| // v v |
| #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| @@ -105,22 +105,21 @@ class CONTENT_EXPORT VideoCaptureHost |
| ~VideoCaptureHost() override; |
| - // IPC message handlers. |
| - void OnRendererFinishedWithBuffer(int device_id, |
| - int buffer_id, |
| - const gpu::SyncToken& sync_token, |
| - double consumer_resource_utilization); |
| - |
| // mojom::VideoCaptureHost implementation |
| void Start(int32_t device_id, |
| int32_t session_id, |
| - const media::VideoCaptureParams& params) override; |
| + const media::VideoCaptureParams& params, |
| + mojom::VideoCaptureObserverPtr observer) override; |
| void Stop(int32_t device_id) override; |
| void Pause(int32_t device_id) override; |
| void Resume(int32_t device_id, |
| int32_t session_id, |
| const media::VideoCaptureParams& params) override; |
| void RequestRefreshFrame(int32_t device_id) override; |
| + void ReleaseBuffer(int32_t device_id, |
| + int32_t buffer_id, |
| + const gpu::SyncToken& sync_token, |
| + double consumer_resource_utilization) override; |
| void GetDeviceSupportedFormats( |
| int32_t device_id, |
| int32_t session_id, |
| @@ -147,6 +146,10 @@ class CONTENT_EXPORT VideoCaptureHost |
| std::map<VideoCaptureControllerID, base::WeakPtr<VideoCaptureController>> |
| controllers_; |
| + // VideoCaptureObservers map, each one is used and should be valid between |
| + // Start() and the corresponding Stop(). |
| + std::map<int32_t, mojom::VideoCaptureObserverPtr> observers_; |
|
chfremer
2016/10/10 18:57:19
Unclear what the int32_t parameter is.
device_id?
mcasas
2016/10/10 19:39:44
The first or the last one :)
device_id == control
|
| + |
| DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| }; |