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 "base/process/process.h" | 8 #include "base/process/process.h" |
9 #include "base/sync_socket.h" | 9 #include "base/sync_socket.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // transmitting audio packets between the browser process and the renderer | 27 // transmitting audio packets between the browser process and the renderer |
28 // process. | 28 // process. |
29 class AudioSyncReader : public media::AudioOutputController::SyncReader { | 29 class AudioSyncReader : public media::AudioOutputController::SyncReader { |
30 public: | 30 public: |
31 AudioSyncReader(base::SharedMemory* shared_memory, | 31 AudioSyncReader(base::SharedMemory* shared_memory, |
32 const media::AudioParameters& params); | 32 const media::AudioParameters& params); |
33 | 33 |
34 virtual ~AudioSyncReader(); | 34 virtual ~AudioSyncReader(); |
35 | 35 |
36 // media::AudioOutputController::SyncReader implementations. | 36 // media::AudioOutputController::SyncReader implementations. |
37 virtual void UpdatePendingBytes(uint32 bytes) OVERRIDE; | 37 virtual void UpdatePendingBytes(uint32 bytes) override; |
38 virtual void Read(media::AudioBus* dest) OVERRIDE; | 38 virtual void Read(media::AudioBus* dest) override; |
39 virtual void Close() OVERRIDE; | 39 virtual void Close() override; |
40 | 40 |
41 bool Init(); | 41 bool Init(); |
42 bool PrepareForeignSocket(base::ProcessHandle process_handle, | 42 bool PrepareForeignSocket(base::ProcessHandle process_handle, |
43 base::SyncSocket::TransitDescriptor* descriptor); | 43 base::SyncSocket::TransitDescriptor* descriptor); |
44 | 44 |
45 private: | 45 private: |
46 // Blocks until data is ready for reading or a timeout expires. Returns false | 46 // Blocks until data is ready for reading or a timeout expires. Returns false |
47 // if an error or timeout occurs. | 47 // if an error or timeout occurs. |
48 bool WaitUntilDataIsReady(); | 48 bool WaitUntilDataIsReady(); |
49 | 49 |
(...skipping 28 matching lines...) Expand all Loading... |
78 // The index of the audio buffer we're expecting to be sent from the renderer; | 78 // The index of the audio buffer we're expecting to be sent from the renderer; |
79 // used to block with timeout for audio data. | 79 // used to block with timeout for audio data. |
80 uint32 buffer_index_; | 80 uint32 buffer_index_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 82 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace content | 85 } // namespace content |
86 | 86 |
87 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 87 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
OLD | NEW |