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 // VideoCaptureController is the glue between VideoCaptureHost, | 5 // VideoCaptureController is the glue between VideoCaptureHost, |
6 // VideoCaptureManager and VideoCaptureDevice. | 6 // VideoCaptureManager and VideoCaptureDevice. |
7 // It provides functions for VideoCaptureHost to start a VideoCaptureDevice and | 7 // It provides functions for VideoCaptureHost to start a VideoCaptureDevice and |
8 // is responsible for keeping track of shared DIBs and filling them with I420 | 8 // is responsible for keeping track of shared DIBs and filling them with I420 |
9 // video frames for IPC communication between VideoCaptureHost and | 9 // video frames for IPC communication between VideoCaptureHost and |
10 // VideoCaptureMessageFilter. | 10 // VideoCaptureMessageFilter. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // |params|. | 44 // |params|. |
45 // When capturing has started, the |event_handler| receives a call OnFrameInfo | 45 // When capturing has started, the |event_handler| receives a call OnFrameInfo |
46 // with resolution that best matches the requested that the video | 46 // with resolution that best matches the requested that the video |
47 // capture device support. | 47 // capture device support. |
48 void StartCapture(const VideoCaptureControllerID& id, | 48 void StartCapture(const VideoCaptureControllerID& id, |
49 VideoCaptureControllerEventHandler* event_handler, | 49 VideoCaptureControllerEventHandler* event_handler, |
50 base::ProcessHandle render_process, | 50 base::ProcessHandle render_process, |
51 const media::VideoCaptureParams& params); | 51 const media::VideoCaptureParams& params); |
52 | 52 |
53 // Stop video capture. | 53 // Stop video capture. |
54 // When the capture is stopped and all DIBs have been returned, | 54 // This will take back all buffers held by by |event_handler|, and |
55 // VideoCaptureControllerEventHandler::OnReadyToDelete will be called. | 55 // |event_handler| shouldn't use those buffers any more. |
56 // |force_buffer_return| allows controller to take back all buffers used | |
57 // by |event_handler|. | |
58 void StopCapture(const VideoCaptureControllerID& id, | 56 void StopCapture(const VideoCaptureControllerID& id, |
59 VideoCaptureControllerEventHandler* event_handler, | 57 VideoCaptureControllerEventHandler* event_handler); |
60 bool force_buffer_return); | |
61 | 58 |
62 // API called directly by VideoCaptureManager in case the device is | 59 // API called directly by VideoCaptureManager in case the device is |
63 // prematurely closed. | 60 // prematurely closed. |
64 void StopSession(int session_id); | 61 void StopSession(int session_id); |
65 | 62 |
66 // Return a buffer previously given in | 63 // Return a buffer previously given in |
67 // VideoCaptureControllerEventHandler::OnBufferReady. | 64 // VideoCaptureControllerEventHandler::OnBufferReady. |
68 void ReturnBuffer(const VideoCaptureControllerID& id, | 65 void ReturnBuffer(const VideoCaptureControllerID& id, |
69 VideoCaptureControllerEventHandler* event_handler, | 66 VideoCaptureControllerEventHandler* event_handler, |
70 int buffer_id); | 67 int buffer_id); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 138 |
142 media_stream::VideoCaptureManager* video_capture_manager_; | 139 media_stream::VideoCaptureManager* video_capture_manager_; |
143 | 140 |
144 bool device_in_use_; | 141 bool device_in_use_; |
145 video_capture::State state_; | 142 video_capture::State state_; |
146 | 143 |
147 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController); | 144 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController); |
148 }; | 145 }; |
149 | 146 |
150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 147 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |