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

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

Issue 1809093003: Moving SwitchOutputDevice out of OutputDevice interface, eliminating OutputDevice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 | « no previous file | content/public/renderer/media_stream_audio_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index ca963294d840dc746e7cfc613f8f5e49c368de3d..eadd484b31116d0507282c74ef860ffbc59fad1a 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -49,13 +49,6 @@ namespace {
base::LazyInstance<media::AudioStreamsTracker> g_audio_streams_tracker =
LAZY_INSTANCE_INITIALIZER;
-media::AudioParameters DummyParams() {
- return media::AudioParameters(
- media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO,
- media::AudioParameters::kAudioCDSampleRate, 16,
- media::AudioParameters::kAudioCDSampleRate / 10);
-}
-
std::pair<int, std::pair<bool, std::string>> MakeAuthorizationData(
int stream_id,
bool authorized,
@@ -124,7 +117,7 @@ void MaybeFixAudioParameters(media::AudioParameters* params) {
// If hardware parameters are still invalid, use dummy parameters with
// fake audio path and let the client handle the error.
if (!params->IsValid())
- *params = DummyParams();
+ *params = media::AudioParameters::UnavailableDeviceParams();
}
} // namespace
@@ -427,7 +420,8 @@ void AudioRendererHost::OnRequestDeviceAuthorization(
if (!IsValidDeviceId(device_id)) {
Send(new AudioMsg_NotifyDeviceAuthorized(
- stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, DummyParams()));
+ stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND,
+ media::AudioParameters::UnavailableDeviceParams()));
return;
}
@@ -482,7 +476,7 @@ void AudioRendererHost::OnDeviceAuthorized(int stream_id,
authorizations_.erase(auth_data);
Send(new AudioMsg_NotifyDeviceAuthorized(
stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED,
- DummyParams()));
+ media::AudioParameters::UnavailableDeviceParams()));
return;
}
@@ -521,7 +515,8 @@ void AudioRendererHost::OnDeviceIDTranslated(
if (!device_found) {
authorizations_.erase(auth_data);
Send(new AudioMsg_NotifyDeviceAuthorized(
- stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND, DummyParams()));
+ stream_id, media::OUTPUT_DEVICE_STATUS_ERROR_NOT_FOUND,
+ media::AudioParameters::UnavailableDeviceParams()));
return;
}
@@ -817,8 +812,9 @@ void AudioRendererHost::TranslateDeviceID(
}
}
DCHECK(!device_id.empty()); // Default device must always be found
- AudioOutputDeviceInfo device_info = {std::string(), std::string(),
- DummyParams()};
+ AudioOutputDeviceInfo device_info = {
+ std::string(), std::string(),
+ media::AudioParameters::UnavailableDeviceParams()};
callback.Run(false, device_info);
}
« no previous file with comments | « no previous file | content/public/renderer/media_stream_audio_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698