| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // VideoCaptureHost serves video capture related messages from | 5 // VideoCaptureHost serves video capture related messages from |
| 6 // VideoCaptureMessageFilter which lives inside the render process. | 6 // VideoCaptureMessageFilter which lives inside the render process. |
| 7 // | 7 // |
| 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI | 8 // This class is owned by RenderProcessHostImpl, and instantiated on UI |
| 9 // thread, but all other operations and method calls happen on IO thread. | 9 // thread, but all other operations and method calls happen on IO thread. |
| 10 // | 10 // |
| 11 // Here's an example of a typical IPC dialog for video capture: | 11 // Here's an example of a typical IPC dialog for video capture: |
| 12 // | 12 // |
| 13 // Renderer VideoCaptureHost | 13 // Renderer VideoCaptureHost |
| 14 // | | | 14 // | | |
| 15 // | --------- StartCapture --------> | | 15 // | --------- StartCapture --------> | |
| 16 // | <------ VideoCaptureObserver ------ | | 16 // | <------ VideoCaptureObserver ------ | |
| 17 // | ::StateChanged(STARTED) | | 17 // | ::StateChanged(STARTED) | |
| 18 // | < VideoCaptureMsg_NewBuffer(1) | | 18 // | < VideoCaptureMsg_NewBuffer(1) | |
| 19 // | < VideoCaptureMsg_NewBuffer(2) | | 19 // | < VideoCaptureMsg_NewBuffer(2) | |
| 20 // | < VideoCaptureMsg_NewBuffer(3) | | 20 // | < VideoCaptureMsg_NewBuffer(3) | |
| 21 // | | | 21 // | | |
| 22 // | < VideoCaptureMsg_BufferReady(1) | | 22 // | <-------- OnBufferReady(1) --------- | |
| 23 // | < VideoCaptureMsg_BufferReady(2) | | 23 // | <-------- OnBufferReady(2) --------- | |
| 24 // | -------- ReleaseBuffer(1) ---------> | | 24 // | -------- ReleaseBuffer(1) ---------> | |
| 25 // | < VideoCaptureMsg_BufferReady(3) | | 25 // | <-------- OnBufferReady(3) --------- | |
| 26 // | -------- ReleaseBuffer(2) ---------> | | 26 // | -------- ReleaseBuffer(2) ---------> | |
| 27 // | < VideoCaptureMsg_BufferReady(1) | | 27 // | <-------- OnBufferReady(1) --------- | |
| 28 // | -------- ReleaseBuffer(3) ---------> | | 28 // | -------- ReleaseBuffer(3) ---------> | |
| 29 // | < VideoCaptureMsg_BufferReady(2) | | 29 // | <-------- OnBufferReady(2) --------- | |
| 30 // | -------- ReleaseBuffer(1) ---------> | | 30 // | -------- ReleaseBuffer(1) ---------> | |
| 31 // | ... | | 31 // | ... | |
| 32 // | < VideoCaptureMsg_BufferReady(3) | | 32 // | <-------- OnBufferReady(3) --------- | |
| 33 // | | | 33 // = = |
| 34 // | ... (resolution change) | | 34 // | ... (resolution change) | |
| 35 // | < VideoCaptureMsg_FreeBuffer(1) | Buffers are re-allocated | 35 // | <------ OnBufferDestroyed(3) ------- | Buffers are re-allocated |
| 36 // | < VideoCaptureMsg_NewBuffer(4) | with a larger size, as | 36 // | < VideoCaptureMsg_NewBuffer(4) | with a larger size, as |
| 37 // | < VideoCaptureMsg_BufferReady(4) | needed. | 37 // | <-------- OnBufferReady(4) --------- | needed. |
| 38 // | -------- ReleaseBuffer(2) ---------> | | 38 // | -------- ReleaseBuffer(2) ---------> | |
| 39 // | < VideoCaptureMsg_FreeBuffer(2) | | 39 // | <------ OnBufferDestroyed(2) ------- | |
| 40 // | < VideoCaptureMsg_NewBuffer(5) | | 40 // | < VideoCaptureMsg_NewBuffer(5) | |
| 41 // | < VideoCaptureMsg_BufferReady(5) | | 41 // | <-------- OnBufferReady(5) --------- | |
| 42 // | ... | | 42 // = ... = |
| 43 // | | | 43 // | | |
| 44 // | < VideoCaptureMsg_BufferReady | | 44 // | < VideoCaptureMsg_BufferReady | |
| 45 // | --------- StopCapture ---------> | | 45 // | --------- StopCapture ---------> | |
| 46 // | -------- ReleaseBuffer(n) ---------> | | 46 // | -------- ReleaseBuffer(n) ---------> | |
| 47 // | <------ VideoCaptureObserver ------ | | 47 // | <------ VideoCaptureObserver ------ | |
| 48 // | ::StateChanged(STOPPED) | | 48 // | ::StateChanged(STOPPED) | |
| 49 // v v | 49 // v v |
| 50 | 50 |
| 51 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 51 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| 52 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 52 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // VideoCaptureObservers map, each one is used and should be valid between | 149 // VideoCaptureObservers map, each one is used and should be valid between |
| 150 // Start() and the corresponding Stop(). | 150 // Start() and the corresponding Stop(). |
| 151 std::map<int32_t, mojom::VideoCaptureObserverPtr> device_id_to_observer_map_; | 151 std::map<int32_t, mojom::VideoCaptureObserverPtr> device_id_to_observer_map_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 153 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace content | 156 } // namespace content |
| 157 | 157 |
| 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |