| 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 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ | 5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ | 6 #define REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void FillWithSamples(void* samples, uint32_t buffer_size); | 41 void FillWithSamples(void* samples, uint32_t buffer_size); |
| 42 | 42 |
| 43 pp::Instance* instance_; | 43 pp::Instance* instance_; |
| 44 pp::Audio audio_; | 44 pp::Audio audio_; |
| 45 | 45 |
| 46 AudioPacket::SamplingRate sampling_rate_; | 46 AudioPacket::SamplingRate sampling_rate_; |
| 47 | 47 |
| 48 // The count of sample frames per channel in an audio buffer. | 48 // The count of sample frames per channel in an audio buffer. |
| 49 uint32_t samples_per_frame_; | 49 uint32_t samples_per_frame_; |
| 50 | 50 |
| 51 // Protects |queued_packets_| and |bytes_consumed_|. | 51 bool start_failed_; |
| 52 // This is necessary to prevent races, | 52 |
| 53 // because Pepper will callback on a separate thread. | 53 // Protects |queued_packets_|, |queued_samples_ and |bytes_consumed_|. This is |
| 54 // necessary to prevent races, because Pepper will call the callback on a |
| 55 // separate thread. |
| 54 base::Lock lock_; | 56 base::Lock lock_; |
| 55 | 57 |
| 56 AudioPacketQueue queued_packets_; | 58 AudioPacketQueue queued_packets_; |
| 59 int queued_samples_; |
| 57 | 60 |
| 58 // The number of bytes from |queued_packets_| that have been consumed. | 61 // The number of bytes from |queued_packets_| that have been consumed. |
| 59 size_t bytes_consumed_; | 62 size_t bytes_consumed_; |
| 60 | 63 |
| 61 bool start_failed_; | |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(PepperAudioPlayer); | 64 DISALLOW_COPY_AND_ASSIGN(PepperAudioPlayer); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace remoting | 67 } // namespace remoting |
| 67 | 68 |
| 68 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ | 69 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_AUDIO_PLAYER_H_ |
| OLD | NEW |