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 MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 }; | 81 }; |
82 | 82 |
83 // A synchronous reader interface used by AudioOutputController for | 83 // A synchronous reader interface used by AudioOutputController for |
84 // synchronous reading. | 84 // synchronous reading. |
85 // TODO(crogers): find a better name for this class and the Read() method | 85 // TODO(crogers): find a better name for this class and the Read() method |
86 // now that it can handle synchronized I/O. | 86 // now that it can handle synchronized I/O. |
87 class SyncReader { | 87 class SyncReader { |
88 public: | 88 public: |
89 virtual ~SyncReader() {} | 89 virtual ~SyncReader() {} |
90 | 90 |
91 // Notify the synchronous reader the number of bytes in the | 91 // Notify the synchronous reader the number of bytes in the |
chcunningham
2016/10/21 18:19:47
Replace mentions of bytes with time delayed.
Mikhail
2016/10/24 19:50:24
Done.
| |
92 // AudioOutputController not yet played. This is used by SyncReader to | 92 // AudioOutputController not yet played. This is used by SyncReader to |
93 // prepare more data and perform synchronization. Also inform about if any | 93 // prepare more data and perform synchronization. Also inform about if any |
94 // frames has been skipped by the renderer (typically the OS). The renderer | 94 // frames has been skipped by the renderer (typically the OS). The renderer |
95 // source can handle this appropriately depending on the type of source. An | 95 // source can handle this appropriately depending on the type of source. An |
96 // ordinary file playout would ignore this. | 96 // ordinary file playout would ignore this. |
97 virtual void UpdatePendingBytes(uint32_t bytes, | 97 virtual void PrepareNextData(base::TimeDelta delay, |
98 uint32_t frames_skipped) = 0; | 98 base::TimeTicks delay_timestamp, |
99 uint32_t frames_skipped) = 0; | |
James West
2016/10/21 19:40:17
Change "uint32_t frames_skipped" to "int prior_fra
Mikhail
2016/10/24 19:50:24
Done.
| |
99 | 100 |
100 // Attempts to completely fill |dest|, zeroing |dest| if the request can not | 101 // Attempts to completely fill |dest|, zeroing |dest| if the request can not |
101 // be fulfilled (due to timeout). | 102 // be fulfilled (due to timeout). |
102 virtual void Read(AudioBus* dest) = 0; | 103 virtual void Read(AudioBus* dest) = 0; |
103 | 104 |
104 // Close this synchronous reader. | 105 // Close this synchronous reader. |
105 virtual void Close() = 0; | 106 virtual void Close() = 0; |
106 }; | 107 }; |
107 | 108 |
108 // Factory method for creating an AudioOutputController. | 109 // Factory method for creating an AudioOutputController. |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 // be accessed while |error_lock_| is held. | 285 // be accessed while |error_lock_| is held. |
285 bool ignore_errors_during_stop_close_; | 286 bool ignore_errors_during_stop_close_; |
286 base::Lock error_lock_; | 287 base::Lock error_lock_; |
287 | 288 |
288 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 289 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
289 }; | 290 }; |
290 | 291 |
291 } // namespace media | 292 } // namespace media |
292 | 293 |
293 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 294 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |