| 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 "media/audio/win/audio_low_latency_output_win.h" | 5 #include "media/audio/win/audio_low_latency_output_win.h" |
| 6 | 6 |
| 7 #include <Functiondiscoverykeys_devpkey.h> | 7 #include <Functiondiscoverykeys_devpkey.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 pos_sample_playing_frames) * frame_size_; | 433 pos_sample_playing_frames) * frame_size_; |
| 434 } | 434 } |
| 435 | 435 |
| 436 // Read a data packet from the registered client source and | 436 // Read a data packet from the registered client source and |
| 437 // deliver a delay estimate in the same callback to the client. | 437 // deliver a delay estimate in the same callback to the client. |
| 438 // A time stamp is also stored in the AudioBuffersState. This | 438 // A time stamp is also stored in the AudioBuffersState. This |
| 439 // time stamp can be used at the client side to compensate for | 439 // time stamp can be used at the client side to compensate for |
| 440 // the delay between the usage of the delay value and the time | 440 // the delay between the usage of the delay value and the time |
| 441 // of generation. | 441 // of generation. |
| 442 uint32 num_filled_bytes = source_->OnMoreData( | 442 uint32 num_filled_bytes = source_->OnMoreData( |
| 443 this, audio_data, packet_size_bytes_, | 443 audio_data, packet_size_bytes_, |
| 444 AudioBuffersState(0, audio_delay_bytes)); | 444 AudioBuffersState(0, audio_delay_bytes)); |
| 445 | 445 |
| 446 // Perform in-place, software-volume adjustments. | 446 // Perform in-place, software-volume adjustments. |
| 447 media::AdjustVolume(audio_data, | 447 media::AdjustVolume(audio_data, |
| 448 num_filled_bytes, | 448 num_filled_bytes, |
| 449 format_.nChannels, | 449 format_.nChannels, |
| 450 format_.wBitsPerSample >> 3, | 450 format_.wBitsPerSample >> 3, |
| 451 volume_); | 451 volume_); |
| 452 | 452 |
| 453 // Zero out the part of the packet which has not been filled by | 453 // Zero out the part of the packet which has not been filled by |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 // are now re-initiated and it is now possible to re-start audio rendering. | 805 // are now re-initiated and it is now possible to re-start audio rendering. |
| 806 | 806 |
| 807 // Start rendering again using the new default audio endpoint. | 807 // Start rendering again using the new default audio endpoint. |
| 808 hr = audio_client_->Start(); | 808 hr = audio_client_->Start(); |
| 809 | 809 |
| 810 restart_rendering_mode_ = false; | 810 restart_rendering_mode_ = false; |
| 811 return SUCCEEDED(hr); | 811 return SUCCEEDED(hr); |
| 812 } | 812 } |
| 813 | 813 |
| 814 } // namespace media | 814 } // namespace media |
| OLD | NEW |