| 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 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // transmitting audio packets between the browser process and the renderer | 32 // transmitting audio packets between the browser process and the renderer |
| 33 // process. | 33 // process. |
| 34 class AudioSyncReader : public media::AudioOutputController::SyncReader { | 34 class AudioSyncReader : public media::AudioOutputController::SyncReader { |
| 35 public: | 35 public: |
| 36 AudioSyncReader(base::SharedMemory* shared_memory, | 36 AudioSyncReader(base::SharedMemory* shared_memory, |
| 37 const media::AudioParameters& params); | 37 const media::AudioParameters& params); |
| 38 | 38 |
| 39 ~AudioSyncReader() override; | 39 ~AudioSyncReader() override; |
| 40 | 40 |
| 41 // media::AudioOutputController::SyncReader implementations. | 41 // media::AudioOutputController::SyncReader implementations. |
| 42 void UpdatePendingBytes(uint32_t bytes, uint32_t frames_skipped) override; | 42 void UpdatePendingBytes( |
| 43 uint32_t bytes, |
| 44 uint32_t frames_skipped, |
| 45 const media::AudioTimestamp& timestamp) override; |
| 43 void Read(media::AudioBus* dest) override; | 46 void Read(media::AudioBus* dest) override; |
| 44 void Close() override; | 47 void Close() override; |
| 45 | 48 |
| 46 bool Init(); | 49 bool Init(); |
| 47 bool PrepareForeignSocket(base::ProcessHandle process_handle, | 50 bool PrepareForeignSocket(base::ProcessHandle process_handle, |
| 48 base::SyncSocket::TransitDescriptor* descriptor); | 51 base::SyncSocket::TransitDescriptor* descriptor); |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 // Blocks until data is ready for reading or a timeout expires. Returns false | 54 // Blocks until data is ready for reading or a timeout expires. Returns false |
| 52 // if an error or timeout occurs. | 55 // if an error or timeout occurs. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // The index of the audio buffer we're expecting to be sent from the renderer; | 87 // The index of the audio buffer we're expecting to be sent from the renderer; |
| 85 // used to block with timeout for audio data. | 88 // used to block with timeout for audio data. |
| 86 uint32_t buffer_index_; | 89 uint32_t buffer_index_; |
| 87 | 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 91 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace content | 94 } // namespace content |
| 92 | 95 |
| 93 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 96 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
| OLD | NEW |