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

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

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: Created 3 years, 11 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
« chromeos/dbus/cras_audio_client.h ('K') | « chromeos/dbus/cras_audio_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24880a5759a4fb77c265057242bd5fb93c51fed1..904d0c1d2ca4c1b5ce97d193106f0c78e9793937 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -56,6 +56,11 @@
#endif // defined(ENABLE_SCREEN_CAPTURE)
+#if defined(OS_CHROMEOS)
+#include "chromeos/dbus/cras_audio_client.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#endif
+
namespace {
class VideoFrameConsumerFeedbackObserverOnTaskRunner
@@ -653,6 +658,31 @@ VideoCaptureManager::DoStartDeviceCaptureOnDeviceThread(
return nullptr;
}
+#if defined(OS_CHROMEOS)
+ chromeos::DBusThreadManager* thread_manager =
+ chromeos::DBusThreadManager::Get();
chfremer 2017/01/17 18:05:55 Independent of the question whether or not this is
shenghao 2017/01/18 10:41:12 Yeah. I totally agree with you on the idea to elim
chfremer 2017/01/18 18:36:10 The observer interface does not need to live in //
+ if (thread_manager != NULL) {
+ chromeos::CrasAudioClient* client = thread_manager->GetCrasAudioClient();
+ if (client != NULL) {
+ chromeos::CrasAudioClient::VideoFacingMode facing =
+ chromeos::CrasAudioClient::VideoFacingMode::NONE;
+ switch (descriptor.facing) {
chfremer 2017/01/17 18:05:55 In the current version of the code indexed in code
shenghao 2017/01/18 10:41:12 Yes, this CL depends on https://codereview.chromiu
+ case MEDIA_VIDEO_FACING_NONE:
+ case NUM_MEDIA_VIDEO_FACING_MODE:
+ facing = chromeos::CrasAudioClient::VideoFacingMode::NONE;
+ break;
+ case MEDIA_VIDEO_FACING_USER:
+ facing = chromeos::CrasAudioClient::VideoFacingMode::USER;
+ break;
+ case MEDIA_VIDEO_FACING_ENVIRONMENT:
+ facing = chromeos::CrasAudioClient::VideoFacingMode::ENVIRONMENT;
+ break;
+ }
+ client->OnVideoCaptureStarted(facing);
+ }
+ }
+#endif
+
video_capture_device->AllocateAndStart(params, std::move(device_client));
return video_capture_device;
}
« chromeos/dbus/cras_audio_client.h ('K') | « chromeos/dbus/cras_audio_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698