| 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 11 matching lines...) Expand all Loading... |
| 22 #include "base/compiler_specific.h" | 22 #include "base/compiler_specific.h" |
| 23 #include "base/memory/ref_counted.h" | 23 #include "base/memory/ref_counted.h" |
| 24 #include "base/process.h" | 24 #include "base/process.h" |
| 25 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
| 26 #include "content/browser/renderer_host/media/video_capture_controller_event_han
dler.h" | 26 #include "content/browser/renderer_host/media/video_capture_controller_event_han
dler.h" |
| 27 #include "content/common/media/video_capture.h" | 27 #include "content/common/media/video_capture.h" |
| 28 #include "media/video/capture/video_capture.h" | 28 #include "media/video/capture/video_capture.h" |
| 29 #include "media/video/capture/video_capture_device.h" | 29 #include "media/video/capture/video_capture_device.h" |
| 30 #include "media/video/capture/video_capture_types.h" | 30 #include "media/video/capture/video_capture_types.h" |
| 31 | 31 |
| 32 namespace media_stream { | 32 namespace content { |
| 33 class VideoCaptureManager; | 33 class VideoCaptureManager; |
| 34 } // namespace media_stream | |
| 35 | 34 |
| 36 class CONTENT_EXPORT VideoCaptureController | 35 class CONTENT_EXPORT VideoCaptureController |
| 37 : public base::RefCountedThreadSafe<VideoCaptureController>, | 36 : public base::RefCountedThreadSafe<VideoCaptureController>, |
| 38 public media::VideoCaptureDevice::EventHandler { | 37 public media::VideoCaptureDevice::EventHandler { |
| 39 public: | 38 public: |
| 40 VideoCaptureController( | 39 VideoCaptureController(VideoCaptureManager* video_capture_manager); |
| 41 media_stream::VideoCaptureManager* video_capture_manager); | |
| 42 | 40 |
| 43 // Start video capturing and try to use the resolution specified in | 41 // Start video capturing and try to use the resolution specified in |
| 44 // |params|. | 42 // |params|. |
| 45 // When capturing has started, the |event_handler| receives a call OnFrameInfo | 43 // When capturing has started, the |event_handler| receives a call OnFrameInfo |
| 46 // with resolution that best matches the requested that the video | 44 // with resolution that best matches the requested that the video |
| 47 // capture device support. | 45 // capture device support. |
| 48 void StartCapture(const VideoCaptureControllerID& id, | 46 void StartCapture(const VideoCaptureControllerID& id, |
| 49 VideoCaptureControllerEventHandler* event_handler, | 47 VideoCaptureControllerEventHandler* event_handler, |
| 50 base::ProcessHandle render_process, | 48 base::ProcessHandle render_process, |
| 51 const media::VideoCaptureParams& params); | 49 const media::VideoCaptureParams& params); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // call per StartCapture(). | 131 // call per StartCapture(). |
| 134 media::VideoCaptureCapability frame_info_; | 132 media::VideoCaptureCapability frame_info_; |
| 135 // Chopped pixels in width/height in case video capture device has odd numbers | 133 // Chopped pixels in width/height in case video capture device has odd numbers |
| 136 // for width/height. | 134 // for width/height. |
| 137 int chopped_width_; | 135 int chopped_width_; |
| 138 int chopped_height_; | 136 int chopped_height_; |
| 139 | 137 |
| 140 // It's accessed only on IO thread. | 138 // It's accessed only on IO thread. |
| 141 bool frame_info_available_; | 139 bool frame_info_available_; |
| 142 | 140 |
| 143 media_stream::VideoCaptureManager* video_capture_manager_; | 141 VideoCaptureManager* video_capture_manager_; |
| 144 | 142 |
| 145 bool device_in_use_; | 143 bool device_in_use_; |
| 146 video_capture::State state_; | 144 VideoCaptureState state_; |
| 147 | 145 |
| 148 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController); | 146 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController); |
| 149 }; | 147 }; |
| 150 | 148 |
| 149 } // namespace content |
| 150 |
| 151 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 151 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
| OLD | NEW |