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_BUFFERS_STATE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ |
6 #define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ | 6 #define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ |
7 | 7 |
8 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
9 | 9 |
| 10 namespace media { |
| 11 |
10 // AudioBuffersState struct stores current state of audio buffers. | 12 // AudioBuffersState struct stores current state of audio buffers. |
11 // It is used for audio synchronization. | 13 // It is used for audio synchronization. |
12 struct MEDIA_EXPORT AudioBuffersState { | 14 struct MEDIA_EXPORT AudioBuffersState { |
13 AudioBuffersState(); | 15 AudioBuffersState(); |
14 AudioBuffersState(int pending_bytes, int hardware_delay_bytes); | 16 AudioBuffersState(int pending_bytes, int hardware_delay_bytes); |
15 | 17 |
16 int total_bytes() { | 18 int total_bytes() { |
17 return pending_bytes + hardware_delay_bytes; | 19 return pending_bytes + hardware_delay_bytes; |
18 } | 20 } |
19 | 21 |
20 // Number of bytes we currently have in our software buffer. | 22 // Number of bytes we currently have in our software buffer. |
21 int pending_bytes; | 23 int pending_bytes; |
22 | 24 |
23 // Number of bytes that have been written to the device, but haven't | 25 // Number of bytes that have been written to the device, but haven't |
24 // been played yet. | 26 // been played yet. |
25 int hardware_delay_bytes; | 27 int hardware_delay_bytes; |
26 }; | 28 }; |
27 | 29 |
| 30 } // namespace media |
| 31 |
28 #endif // MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ | 32 #endif // MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_ |
OLD | NEW |