Index: content/browser/renderer_host/media/video_capture_manager.h |
diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h |
index 2136b308d02a6ca0e060aea10b3a123f6d6af1c3..9304b71fff4c54f39ebc90a30d0ce90b618084f3 100644 |
--- a/content/browser/renderer_host/media/video_capture_manager.h |
+++ b/content/browser/renderer_host/media/video_capture_manager.h |
@@ -29,6 +29,7 @@ |
#include "content/browser/renderer_host/media/video_capture_controller_event_handler.h" |
#include "content/common/content_export.h" |
#include "content/common/media/media_stream_options.h" |
+#include "media/base/video_facing.h" |
#include "media/capture/video/video_capture_device.h" |
#include "media/capture/video/video_capture_device_factory.h" |
#include "media/capture/video_capture_types.h" |
@@ -53,6 +54,16 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { |
explicit VideoCaptureManager( |
std::unique_ptr<media::VideoCaptureDeviceFactory> factory); |
+ // AddVideoCaptureObserver() can be called only before any devices are opened. |
+ // RemoveAllVideoCaptureObservers() can be called only after all devices |
+ // are closed. |
+ // They can be called more than once and it's ok to not call at all if the |
+ // client is not interested in receiving media::VideoCaptureObserver callacks. |
+ // This methods can be called on whatever thread. The callbacks of |
+ // media::VideoCaptureObserver arrive on browser IO thread. |
+ void AddVideoCaptureObserver(media::VideoCaptureObserver* observer); |
+ void RemoveAllVideoCaptureObservers(); |
+ |
void Unregister(); |
// Implements MediaStreamProvider. |
@@ -336,6 +347,8 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { |
std::unique_ptr<media::VideoCaptureDeviceFactory> |
video_capture_device_factory_; |
+ std::vector<media::VideoCaptureObserver*> capture_observers_; |
jennyz
2017/02/10 18:28:28
Why don't use base::ObserverList<media::VideoCaptu
shenghao
2017/02/11 00:54:51
Done.
|
+ |
// Local cache of the enumerated video capture devices' names and capture |
// supported formats. A snapshot of the current devices and their capabilities |
// is composed in VideoCaptureDeviceFactory::EnumerateDeviceNames() and |