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

Side by Side Diff: media/audio/win/audio_manager_win.cc

Issue 2667843007: Revert a behavioral change in AudioManagerWin::GetInputStreamParameters. (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/audio/win/audio_manager_win.h" 5 #include "media/audio/win/audio_manager_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <objbase.h> // This has to be before initguid.h 8 #include <objbase.h> // This has to be before initguid.h
9 #include <initguid.h> 9 #include <initguid.h>
10 #include <mmsystem.h> 10 #include <mmsystem.h>
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 AudioParameters AudioManagerWin::GetInputStreamParameters( 279 AudioParameters AudioManagerWin::GetInputStreamParameters(
280 const std::string& device_id) { 280 const std::string& device_id) {
281 AudioParameters parameters; 281 AudioParameters parameters;
282 HRESULT hr = 282 HRESULT hr =
283 CoreAudioUtil::GetPreferredAudioParameters(device_id, false, &parameters); 283 CoreAudioUtil::GetPreferredAudioParameters(device_id, false, &parameters);
284 284
285 if (FAILED(hr) || !parameters.IsValid()) { 285 if (FAILED(hr) || !parameters.IsValid()) {
286 LOG(WARNING) << "Unable to get preferred audio params for " << device_id 286 LOG(WARNING) << "Unable to get preferred audio params for " << device_id
287 << " 0x" << std::hex << hr; 287 << " 0x" << std::hex << hr;
288 return parameters; 288 // TODO(tommi): We appear to have callers to GetInputStreamParameters that
289 // rely on getting valid audio parameters returned for an invalid or
290 // unavailable device. We should track down those code paths (it is likely
291 // that they actually don't need a real device but depend on the audio
292 // code path somehow for a configuration - e.g. tab capture).
293 parameters =
294 AudioParameters(AudioParameters::AUDIO_PCM_LINEAR,
295 CHANNEL_LAYOUT_STEREO, 48000, 16, kFallbackBufferSize);
289 } 296 }
290 297
291 int user_buffer_size = GetUserBufferSize(); 298 int user_buffer_size = GetUserBufferSize();
292 if (user_buffer_size) 299 if (user_buffer_size)
293 parameters.set_frames_per_buffer(user_buffer_size); 300 parameters.set_frames_per_buffer(user_buffer_size);
294 301
295 return parameters; 302 return parameters;
296 } 303 }
297 304
298 std::string AudioManagerWin::GetAssociatedOutputDeviceID( 305 std::string AudioManagerWin::GetAssociatedOutputDeviceID(
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 ScopedAudioManagerPtr CreateAudioManager( 467 ScopedAudioManagerPtr CreateAudioManager(
461 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 468 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
462 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 469 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
463 AudioLogFactory* audio_log_factory) { 470 AudioLogFactory* audio_log_factory) {
464 return ScopedAudioManagerPtr( 471 return ScopedAudioManagerPtr(
465 new AudioManagerWin(std::move(task_runner), std::move(worker_task_runner), 472 new AudioManagerWin(std::move(task_runner), std::move(worker_task_runner),
466 audio_log_factory)); 473 audio_log_factory));
467 } 474 }
468 475
469 } // namespace media 476 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698