| 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 26 matching lines...) Expand all Loading... |
| 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(uint32_t bytes, uint32_t frames_skipped) override; |
| 43 void Read(media::AudioBus* dest) override; | 43 void Read(media::AudioBus* dest) override; |
| 44 void Close() override; | 44 void Close() override; |
| 45 | 45 |
| 46 bool Init(); | 46 bool Init(); |
| 47 bool PrepareForeignSocket(base::ProcessHandle process_handle, | 47 base::SyncSocket::Handle GetSyncSocket(); |
| 48 base::SyncSocket::TransitDescriptor* descriptor); | |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 // Blocks until data is ready for reading or a timeout expires. Returns false | 50 // Blocks until data is ready for reading or a timeout expires. Returns false |
| 52 // if an error or timeout occurs. | 51 // if an error or timeout occurs. |
| 53 bool WaitUntilDataIsReady(); | 52 bool WaitUntilDataIsReady(); |
| 54 | 53 |
| 55 const base::SharedMemory* const shared_memory_; | 54 const base::SharedMemory* const shared_memory_; |
| 56 | 55 |
| 57 // Mutes all incoming samples. This is used to prevent audible sound | 56 // Mutes all incoming samples. This is used to prevent audible sound |
| 58 // during automated testing. | 57 // during automated testing. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 84 // The index of the audio buffer we're expecting to be sent from the renderer; | 83 // The index of the audio buffer we're expecting to be sent from the renderer; |
| 85 // used to block with timeout for audio data. | 84 // used to block with timeout for audio data. |
| 86 uint32_t buffer_index_; | 85 uint32_t buffer_index_; |
| 87 | 86 |
| 88 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 87 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 } // namespace content | 90 } // namespace content |
| 92 | 91 |
| 93 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 92 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
| OLD | NEW |