| 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Returns null on failure. | 39 // Returns null on failure. |
| 40 static std::unique_ptr<AudioSyncReader> Create( | 40 static std::unique_ptr<AudioSyncReader> Create( |
| 41 const media::AudioParameters& params); | 41 const media::AudioParameters& params); |
| 42 | 42 |
| 43 base::SharedMemory* shared_memory() const { return shared_memory_.get(); } | 43 base::SharedMemory* shared_memory() const { return shared_memory_.get(); } |
| 44 base::CancelableSyncSocket* foreign_socket() const { | 44 base::CancelableSyncSocket* foreign_socket() const { |
| 45 return foreign_socket_.get(); | 45 return foreign_socket_.get(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // media::AudioOutputController::SyncReader implementations. | 48 // media::AudioOutputController::SyncReader implementations. |
| 49 void RequestMoreData(base::TimeDelta delay, | 49 void UpdatePendingBytes(uint32_t bytes, uint32_t frames_skipped) override; |
| 50 base::TimeTicks delay_timestamp, | |
| 51 int prior_frames_skipped) override; | |
| 52 void Read(media::AudioBus* dest) override; | 50 void Read(media::AudioBus* dest) override; |
| 53 void Close() override; | 51 void Close() override; |
| 54 | 52 |
| 55 private: | 53 private: |
| 56 AudioSyncReader(const media::AudioParameters& params, | 54 AudioSyncReader(const media::AudioParameters& params, |
| 57 std::unique_ptr<base::SharedMemory> shared_memory, | 55 std::unique_ptr<base::SharedMemory> shared_memory, |
| 58 std::unique_ptr<base::CancelableSyncSocket> socket, | 56 std::unique_ptr<base::CancelableSyncSocket> socket, |
| 59 std::unique_ptr<base::CancelableSyncSocket> foreign_socket); | 57 std::unique_ptr<base::CancelableSyncSocket> foreign_socket); |
| 60 | 58 |
| 61 // Blocks until data is ready for reading or a timeout expires. Returns false | 59 // Blocks until data is ready for reading or a timeout expires. Returns false |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // The index of the audio buffer we're expecting to be sent from the renderer; | 91 // The index of the audio buffer we're expecting to be sent from the renderer; |
| 94 // used to block with timeout for audio data. | 92 // used to block with timeout for audio data. |
| 95 uint32_t buffer_index_; | 93 uint32_t buffer_index_; |
| 96 | 94 |
| 97 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 95 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
| 98 }; | 96 }; |
| 99 | 97 |
| 100 } // namespace content | 98 } // namespace content |
| 101 | 99 |
| 102 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 100 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
| OLD | NEW |