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 569910d09d1f9dc23b58ef29c11c1f3b9b559652..a1d96a1da53326dc08fd1d1ed0fa369987c6987c 100644 |
--- a/content/browser/renderer_host/media/video_capture_manager.h |
+++ b/content/browser/renderer_host/media/video_capture_manager.h |
@@ -21,6 +21,7 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
#include "base/message_loop/message_loop.h" |
+#include "base/observer_list.h" |
#include "base/process/process_handle.h" |
#include "base/threading/thread_checker.h" |
#include "base/timer/elapsed_timer.h" |
@@ -29,6 +30,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" |
@@ -54,6 +56,16 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { |
std::unique_ptr<media::VideoCaptureDeviceFactory> factory, |
scoped_refptr<base::SingleThreadTaskRunner> device_task_runner); |
+ // 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(); |
+ |
// Implements MediaStreamProvider. |
void RegisterListener(MediaStreamProviderListener* listener) override; |
void UnregisterListener() override; |
@@ -341,6 +353,8 @@ class CONTENT_EXPORT VideoCaptureManager : public MediaStreamProvider { |
std::unique_ptr<media::VideoCaptureDeviceFactory> |
video_capture_device_factory_; |
+ base::ObserverList<media::VideoCaptureObserver> capture_observers_; |
+ |
// 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 |