| 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_AUDIO_PLAYER_H_ | 5 #ifndef REMOTING_CLIENT_AUDIO_PLAYER_H_ |
| 6 #define REMOTING_CLIENT_AUDIO_PLAYER_H_ | 6 #define REMOTING_CLIENT_AUDIO_PLAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <memory> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "remoting/proto/audio.pb.h" | 16 #include "remoting/proto/audio.pb.h" |
| 17 | 17 |
| 18 namespace remoting { | 18 namespace remoting { |
| 19 | 19 |
| 20 class AudioPlayer { | 20 class AudioPlayer { |
| 21 public: | 21 public: |
| 22 virtual ~AudioPlayer(); | 22 virtual ~AudioPlayer(); |
| 23 | 23 |
| 24 void ProcessAudioPacket(scoped_ptr<AudioPacket> packet); | 24 void ProcessAudioPacket(std::unique_ptr<AudioPacket> packet); |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 AudioPlayer(); | 27 AudioPlayer(); |
| 28 | 28 |
| 29 // Return the recommended number of samples to include in a frame. | 29 // Return the recommended number of samples to include in a frame. |
| 30 virtual uint32_t GetSamplesPerFrame() = 0; | 30 virtual uint32_t GetSamplesPerFrame() = 0; |
| 31 | 31 |
| 32 // Resets the audio player and starts playback. | 32 // Resets the audio player and starts playback. |
| 33 // Returns true on success. | 33 // Returns true on success. |
| 34 virtual bool ResetAudioPlayer(AudioPacket::SamplingRate sampling_rate) = 0; | 34 virtual bool ResetAudioPlayer(AudioPacket::SamplingRate sampling_rate) = 0; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 60 | 60 |
| 61 // The number of bytes from |queued_packets_| that have been consumed. | 61 // The number of bytes from |queued_packets_| that have been consumed. |
| 62 size_t bytes_consumed_; | 62 size_t bytes_consumed_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(AudioPlayer); | 64 DISALLOW_COPY_AND_ASSIGN(AudioPlayer); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace remoting | 67 } // namespace remoting |
| 68 | 68 |
| 69 #endif // REMOTING_CLIENT_AUDIO_PLAYER_H_ | 69 #endif // REMOTING_CLIENT_AUDIO_PLAYER_H_ |
| OLD | NEW |