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 23 matching lines...) Expand all Loading... |
34 // process. | 34 // process. |
35 class AudioSyncReader : public media::AudioOutputController::SyncReader { | 35 class AudioSyncReader : public media::AudioOutputController::SyncReader { |
36 public: | 36 public: |
37 ~AudioSyncReader() override; | 37 ~AudioSyncReader() override; |
38 | 38 |
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 |
45 return foreign_socket_.get(); | 45 std::unique_ptr<base::CancelableSyncSocket> TakeForeignSocket(); |
46 } | |
47 | 46 |
48 // media::AudioOutputController::SyncReader implementations. | 47 // media::AudioOutputController::SyncReader implementations. |
49 void RequestMoreData(base::TimeDelta delay, | 48 void RequestMoreData(base::TimeDelta delay, |
50 base::TimeTicks delay_timestamp, | 49 base::TimeTicks delay_timestamp, |
51 int prior_frames_skipped) override; | 50 int prior_frames_skipped) override; |
52 void Read(media::AudioBus* dest) override; | 51 void Read(media::AudioBus* dest) override; |
53 void Close() override; | 52 void Close() override; |
54 | 53 |
55 private: | 54 private: |
56 AudioSyncReader(const media::AudioParameters& params, | 55 AudioSyncReader(const media::AudioParameters& params, |
(...skipping 36 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; | 92 // The index of the audio buffer we're expecting to be sent from the renderer; |
94 // used to block with timeout for audio data. | 93 // used to block with timeout for audio data. |
95 uint32_t buffer_index_; | 94 uint32_t buffer_index_; |
96 | 95 |
97 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); | 96 DISALLOW_COPY_AND_ASSIGN(AudioSyncReader); |
98 }; | 97 }; |
99 | 98 |
100 } // namespace content | 99 } // namespace content |
101 | 100 |
102 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ | 101 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_SYNC_READER_H_ |
OLD | NEW |