Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "remoting/host/audio_capturer_win.h" | 5 #include "remoting/host/audio_capturer_win.h" |
| 6 | 6 |
| 7 #include <avrt.h> | 7 #include <avrt.h> |
| 8 #include <mmreg.h> | 8 #include <mmreg.h> |
| 9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
| 10 #include <objbase.h> | 10 #include <objbase.h> |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 267 break; | 267 break; |
| 268 | 268 |
| 269 if (volume_filter_.Apply(reinterpret_cast<int16_t*>(data), frames)) { | 269 if (volume_filter_.Apply(reinterpret_cast<int16_t*>(data), frames)) { |
| 270 std::unique_ptr<AudioPacket> packet(new AudioPacket()); | 270 std::unique_ptr<AudioPacket> packet(new AudioPacket()); |
| 271 packet->add_data(data, frames * wave_format_ex_->nBlockAlign); | 271 packet->add_data(data, frames * wave_format_ex_->nBlockAlign); |
| 272 packet->set_encoding(AudioPacket::ENCODING_RAW); | 272 packet->set_encoding(AudioPacket::ENCODING_RAW); |
| 273 packet->set_sampling_rate(sampling_rate_); | 273 packet->set_sampling_rate(sampling_rate_); |
| 274 packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2); | 274 packet->set_bytes_per_sample(AudioPacket::BYTES_PER_SAMPLE_2); |
| 275 // Only the count of channels is taken into account now, we should also | 275 // Only the count of channels is taken into account now, we should also |
| 276 // consider dwChannelMask. | 276 // consider dwChannelMask. |
| 277 // TODO(zijiehe): Support also layouts. | 277 // TODO(zijiehe): Support various layouts of speakers. |
|
Sergey Ulanov
2017/06/12 23:59:18
This TODO is confusing since technically the curre
Hzj_jie
2017/06/13 01:45:46
Done.
| |
| 278 packet->set_channels(static_cast<AudioPacket::Channels>( | 278 packet->set_channels(static_cast<AudioPacket::Channels>( |
| 279 wave_format_ex_->nChannels)); | 279 wave_format_ex_->nChannels)); |
| 280 | 280 |
| 281 callback_.Run(std::move(packet)); | 281 callback_.Run(std::move(packet)); |
| 282 } | 282 } |
| 283 | 283 |
| 284 hr = audio_capture_client_->ReleaseBuffer(frames); | 284 hr = audio_capture_client_->ReleaseBuffer(frames); |
| 285 if (FAILED(hr)) | 285 if (FAILED(hr)) |
| 286 break; | 286 break; |
| 287 } | 287 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 301 | 301 |
| 302 bool AudioCapturer::IsSupported() { | 302 bool AudioCapturer::IsSupported() { |
| 303 return true; | 303 return true; |
| 304 } | 304 } |
| 305 | 305 |
| 306 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { | 306 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { |
| 307 return base::WrapUnique(new AudioCapturerWin()); | 307 return base::WrapUnique(new AudioCapturerWin()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace remoting | 310 } // namespace remoting |
| OLD | NEW |