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

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

Issue 730083002: [media/audio] Convert VLOGs to DVLOGs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « media/audio/win/audio_manager_win.cc ('k') | 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/core_audio_util_win.h" 5 #include "media/audio/win/core_audio_util_win.h"
6 6
7 #include <audioclient.h> 7 #include <audioclient.h>
8 #include <devicetopology.h> 8 #include <devicetopology.h>
9 #include <functiondiscoverykeys_devpkey.h> 9 #include <functiondiscoverykeys_devpkey.h>
10 10
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 // See http://msdn.microsoft.com/en-us/library/windows/hardware/ff537083.aspx 638 // See http://msdn.microsoft.com/en-us/library/windows/hardware/ff537083.aspx
639 // for more details. 639 // for more details.
640 ChannelConfig channel_config = mix_format.dwChannelMask; 640 ChannelConfig channel_config = mix_format.dwChannelMask;
641 641
642 // Convert Microsoft's channel configuration to genric ChannelLayout. 642 // Convert Microsoft's channel configuration to genric ChannelLayout.
643 ChannelLayout channel_layout = ChannelConfigToChannelLayout(channel_config); 643 ChannelLayout channel_layout = ChannelConfigToChannelLayout(channel_config);
644 644
645 // Some devices don't appear to set a valid channel layout, so guess based on 645 // Some devices don't appear to set a valid channel layout, so guess based on
646 // the number of channels. See http://crbug.com/311906. 646 // the number of channels. See http://crbug.com/311906.
647 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { 647 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
648 VLOG(1) << "Unsupported channel config: " 648 DVLOG(1) << "Unsupported channel config: "
649 << std::hex << channel_config 649 << std::hex << channel_config
650 << ". Guessing layout by channel count: " 650 << ". Guessing layout by channel count: "
651 << std::dec << mix_format.Format.nChannels; 651 << std::dec << mix_format.Format.nChannels;
652 channel_layout = GuessChannelLayout(mix_format.Format.nChannels); 652 channel_layout = GuessChannelLayout(mix_format.Format.nChannels);
653 } 653 }
654 654
655 // Preferred sample rate. 655 // Preferred sample rate.
656 int sample_rate = mix_format.Format.nSamplesPerSec; 656 int sample_rate = mix_format.Format.nSamplesPerSec;
657 657
658 // TODO(henrika): possibly use format.Format.wBitsPerSample here instead. 658 // TODO(henrika): possibly use format.Format.wBitsPerSample here instead.
659 // We use a hard-coded value of 16 bits per sample today even if most audio 659 // We use a hard-coded value of 16 bits per sample today even if most audio
660 // engines does the actual mixing in 32 bits per sample. 660 // engines does the actual mixing in 32 bits per sample.
661 int bits_per_sample = 16; 661 int bits_per_sample = 16;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 return false; 848 return false;
849 849
850 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to 850 // Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to
851 // explicitly write silence data to the rendering buffer. 851 // explicitly write silence data to the rendering buffer.
852 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence"; 852 DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence";
853 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill, 853 return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill,
854 AUDCLNT_BUFFERFLAGS_SILENT)); 854 AUDCLNT_BUFFERFLAGS_SILENT));
855 } 855 }
856 856
857 } // namespace media 857 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698