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

Side by Side Diff: chromeos/dbus/cras_audio_client.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/cras_audio_client.h" 5 #include "chromeos/dbus/cras_audio_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
11 #include "base/logging.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
13 #include "dbus/bus.h" 14 #include "dbus/bus.h"
14 #include "dbus/message.h" 15 #include "dbus/message.h"
15 #include "dbus/object_path.h" 16 #include "dbus/object_path.h"
16 #include "dbus/object_proxy.h" 17 #include "dbus/object_proxy.h"
17 #include "third_party/cros_system_api/dbus/service_constants.h" 18 #include "third_party/cros_system_api/dbus/service_constants.h"
18 19
19 namespace chromeos { 20 namespace chromeos {
20 21
(...skipping 14 matching lines...) Expand all
35 } 36 }
36 37
37 void RemoveObserver(Observer* observer) override { 38 void RemoveObserver(Observer* observer) override {
38 observers_.RemoveObserver(observer); 39 observers_.RemoveObserver(observer);
39 } 40 }
40 41
41 bool HasObserver(const Observer* observer) const override { 42 bool HasObserver(const Observer* observer) const override {
42 return observers_.HasObserver(observer); 43 return observers_.HasObserver(observer);
43 } 44 }
44 45
46 void OnVideoCaptureStarted(VideoFacingMode facing) override {
47 // TODO(jennyz): Switch active audio device according to video facing.
48 }
49
45 void GetVolumeState(const GetVolumeStateCallback& callback) override { 50 void GetVolumeState(const GetVolumeStateCallback& callback) override {
46 dbus::MethodCall method_call(cras::kCrasControlInterface, 51 dbus::MethodCall method_call(cras::kCrasControlInterface,
47 cras::kGetVolumeState); 52 cras::kGetVolumeState);
48 cras_proxy_->CallMethod( 53 cras_proxy_->CallMethod(
49 &method_call, 54 &method_call,
50 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 55 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
51 base::Bind(&CrasAudioClientImpl::OnGetVolumeState, 56 base::Bind(&CrasAudioClientImpl::OnGetVolumeState,
52 weak_ptr_factory_.GetWeakPtr(), callback)); 57 weak_ptr_factory_.GetWeakPtr(), callback));
53 } 58 }
54 59
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 517
513 CrasAudioClient::~CrasAudioClient() { 518 CrasAudioClient::~CrasAudioClient() {
514 } 519 }
515 520
516 // static 521 // static
517 CrasAudioClient* CrasAudioClient::Create() { 522 CrasAudioClient* CrasAudioClient::Create() {
518 return new CrasAudioClientImpl(); 523 return new CrasAudioClientImpl();
519 } 524 }
520 525
521 } // namespace chromeos 526 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698