Chromium Code Reviews| 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 // TODO(hclam): This class should be renamed to VideoCaptureService. | 5 // TODO(hclam): This class should be renamed to VideoCaptureService. |
| 6 | 6 |
| 7 // This class provides access to a video capture device in the browser | 7 // This class provides access to a video capture device in the browser |
| 8 // process through IPC. The main function is to deliver video frames | 8 // process through IPC. The main function is to deliver video frames |
| 9 // to a client. | 9 // to a client. |
| 10 // | 10 // |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 #include "content/common/content_export.h" | 32 #include "content/common/content_export.h" |
| 33 #include "content/common/media/video_capture.h" | 33 #include "content/common/media/video_capture.h" |
| 34 #include "content/public/renderer/media_stream_video_sink.h" | 34 #include "content/public/renderer/media_stream_video_sink.h" |
| 35 #include "media/base/video_capture_types.h" | 35 #include "media/base/video_capture_types.h" |
| 36 | 36 |
| 37 namespace content { | 37 namespace content { |
| 38 | 38 |
| 39 class VideoCaptureImpl; | 39 class VideoCaptureImpl; |
| 40 class VideoCaptureMessageFilter; | 40 class VideoCaptureMessageFilter; |
| 41 | 41 |
| 42 // VideoCaptureImplManager provides access to the representations of capture | |
| 43 // device in renderer process. | |
| 44 // All methods must be called on the IO thread. | |
|
mcasas
2015/03/06 19:18:29
The docs for the class are, oddly enough, on the b
emircan
2015/03/10 23:38:36
Done.
| |
| 42 class CONTENT_EXPORT VideoCaptureImplManager { | 45 class CONTENT_EXPORT VideoCaptureImplManager { |
| 43 public: | 46 public: |
| 44 VideoCaptureImplManager(); | 47 VideoCaptureImplManager(); |
| 45 virtual ~VideoCaptureImplManager(); | 48 virtual ~VideoCaptureImplManager(); |
| 46 | 49 |
| 47 // Open a device associated with the session ID. | 50 // Open a device associated with the session ID. |
| 48 // This method must be called before any methods with the same ID | 51 // This method must be called before any methods with the same ID |
| 49 // is used. | 52 // is used. |
| 50 // Returns a callback that should be used to release the acquired | 53 // Returns a callback that should be used to release the acquired |
| 51 // resources. | 54 // resources. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 std::pair<int, VideoCaptureImpl*> > | 114 std::pair<int, VideoCaptureImpl*> > |
| 112 VideoCaptureDeviceMap; | 115 VideoCaptureDeviceMap; |
| 113 VideoCaptureDeviceMap devices_; | 116 VideoCaptureDeviceMap devices_; |
| 114 | 117 |
| 115 // This is an internal ID for identifying clients of VideoCaptureImpl. | 118 // This is an internal ID for identifying clients of VideoCaptureImpl. |
| 116 // The ID is global for the render process. | 119 // The ID is global for the render process. |
| 117 int next_client_id_; | 120 int next_client_id_; |
| 118 | 121 |
| 119 scoped_refptr<VideoCaptureMessageFilter> filter_; | 122 scoped_refptr<VideoCaptureMessageFilter> filter_; |
| 120 | 123 |
| 121 // Bound to the render thread. | 124 // Hold a pointer to the IO message loop to check we operate on the right |
| 122 base::ThreadChecker thread_checker_; | 125 // thread. |
| 126 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | |
|
mcasas
2015/03/06 19:18:29
Make const. That way, by reading the class declara
emircan
2015/03/10 23:38:36
Done.
| |
| 123 | 127 |
| 124 // Bound to the render thread. | 128 // Bound to the render thread. |
| 125 // NOTE: Weak pointers must be invalidated before all other member variables. | 129 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 126 base::WeakPtrFactory<VideoCaptureImplManager> weak_factory_; | 130 base::WeakPtrFactory<VideoCaptureImplManager> weak_factory_; |
| 127 | 131 |
| 128 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); | 132 DISALLOW_COPY_AND_ASSIGN(VideoCaptureImplManager); |
| 129 }; | 133 }; |
| 130 | 134 |
| 131 } // namespace content | 135 } // namespace content |
| 132 | 136 |
| 133 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ | 137 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_IMPL_MANAGER_H_ |
| OLD | NEW |