forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudio_buffers_state.h
32 lines (23 loc) · 907 Bytes
/
audio_buffers_state.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
#define MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_
#include "media/base/media_export.h"
namespace media {
// AudioBuffersState struct stores current state of audio buffers.
// It is used for audio synchronization.
struct MEDIA_EXPORT AudioBuffersState {
AudioBuffersState();
AudioBuffersState(int pending_bytes, int hardware_delay_bytes);
int total_bytes() {
return pending_bytes + hardware_delay_bytes;
}
// Number of bytes we currently have in our software buffer.
int pending_bytes;
// Number of bytes that have been written to the device, but haven't
// been played yet.
int hardware_delay_bytes;
};
} // namespace media
#endif // MEDIA_AUDIO_AUDIO_BUFFERS_STATE_H_