Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: content/browser/renderer_host/media/video_capture_manager.h

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: add //media/base:video_facing dependency to //content/browser Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..90a054ecd7fb53db1a92603a17b80e995fa5979f 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.
jennyz 2017/02/09 19:42:55 before any devices are opened or what?
shenghao 2017/02/09 22:32:51 Done.
+ // 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_;
+
// 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

Powered by Google App Engine
This is Rietveld 408576698