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

Unified Diff: media/audio/audio_system_impl.cc

Issue 2696253004: Revert of Switching AudioOutputAuthorizationHandler from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: 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
« no previous file with comments | « media/audio/audio_system_impl.h ('k') | media/audio/audio_system_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_system_impl.cc
diff --git a/media/audio/audio_system_impl.cc b/media/audio/audio_system_impl.cc
index a6c51a67d863a6086b33b9e470c97d1b8ebf4471..fdffa70fda0f70cbce1e60457eb2044e9287a254 100644
--- a/media/audio/audio_system_impl.cc
+++ b/media/audio/audio_system_impl.cc
@@ -7,7 +7,6 @@
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/task_runner_util.h"
-#include "media/audio/audio_device_description.h"
#include "media/audio/audio_manager.h"
// Using base::Unretained for |audio_manager_| is safe since it is deleted after
@@ -22,27 +21,11 @@
DCHECK(audio_manager->GetTaskRunner()->BelongsToCurrentThread());
// TODO(olka): remove this when AudioManager::GetInputStreamParameters()
- // returns invalid parameters if the device is not found.
+ // works this way on all the platforms.
if (!audio_manager->HasAudioInputDevices())
return AudioParameters();
return audio_manager->GetInputStreamParameters(device_id);
-}
-
-AudioParameters GetOutputParametersOnDeviceThread(
- AudioManager* audio_manager,
- const std::string& device_id) {
- DCHECK(audio_manager->GetTaskRunner()->BelongsToCurrentThread());
-
- // TODO(olka): remove this when
- // AudioManager::Get[Default]OutputStreamParameters() returns invalid
- // parameters if the device is not found.
- if (!audio_manager->HasAudioOutputDevices())
- return AudioParameters();
-
- return media::AudioDeviceDescription::IsDefaultDevice(device_id)
- ? audio_manager->GetDefaultOutputStreamParameters()
- : audio_manager->GetOutputStreamParameters(device_id);
}
} // namespace
@@ -79,22 +62,6 @@
std::move(on_params_cb));
}
-void AudioSystemImpl::GetOutputStreamParameters(
- const std::string& device_id,
- OnAudioParamsCallback on_params_cb) const {
- if (GetTaskRunner()->BelongsToCurrentThread()) {
- GetTaskRunner()->PostTask(
- FROM_HERE, base::Bind(on_params_cb, GetOutputParametersOnDeviceThread(
- audio_manager_, device_id)));
- return;
- }
- base::PostTaskAndReplyWithResult(
- GetTaskRunner(), FROM_HERE,
- base::Bind(&GetOutputParametersOnDeviceThread,
- base::Unretained(audio_manager_), device_id),
- std::move(on_params_cb));
-}
-
void AudioSystemImpl::HasInputDevices(OnBoolCallback on_has_devices_cb) const {
if (GetTaskRunner()->BelongsToCurrentThread()) {
GetTaskRunner()->PostTask(
« no previous file with comments | « media/audio/audio_system_impl.h ('k') | media/audio/audio_system_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698