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

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

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: move DEPS 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.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index 9f7b8f170846fb1e73c8fe7b462852f8e05a9ab5..a60330375d54faf42813f1f0c3c4ec16d0318333 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -34,6 +34,7 @@
#include "content/public/common/media_stream_request.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/media_switches.h"
+#include "media/base/video_facing.h"
#include "media/capture/video/video_capture_buffer_pool_impl.h"
#include "media/capture/video/video_capture_buffer_tracker_factory_impl.h"
#include "media/capture/video/video_capture_device.h"
@@ -337,6 +338,16 @@ VideoCaptureManager::~VideoCaptureManager() {
DCHECK(device_start_queue_.empty());
}
+void VideoCaptureManager::AddVideoCaptureObserver(
+ media::VideoCaptureObserver* observer) {
+ DCHECK(observer);
+ capture_observers_.AddObserver(observer);
+}
+
+void VideoCaptureManager::RemoveAllVideoCaptureObservers() {
+ capture_observers_.Clear();
+}
+
void VideoCaptureManager::Register(
MediaStreamProviderListener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) {
@@ -467,6 +478,12 @@ void VideoCaptureManager::DoStopDevice(DeviceEntry* entry) {
}
}
+ const DeviceInfo* device_info = GetDeviceInfoById(entry->id);
+ if (device_info != nullptr) {
+ for (auto& observer : capture_observers_)
+ observer.OnVideoCaptureStopped(device_info->descriptor.facing);
+ }
+
DVLOG(3) << "DoStopDevice. Send stop request for device = " << entry->id
<< " serial_id = " << entry->serial_id << ".";
entry->video_capture_controller.OnLog(
@@ -523,6 +540,9 @@ void VideoCaptureManager::HandleQueuedStartRequest() {
found->descriptor.GetNameAndModel().c_str(),
found->descriptor.GetCaptureApiTypeString()));
+ for (auto& observer : capture_observers_)
+ observer.OnVideoCaptureStarted(found->descriptor.facing);
+
start_capture_function =
base::Bind(&VideoCaptureManager::DoStartDeviceCaptureOnDeviceThread,
this, found->descriptor, request->params(),

Powered by Google App Engine
This is Rietveld 408576698