AudioTimestamp.java revision 948c2e6ff46d65942277f2e0e9ce0c038972b9d8
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.media;
18
19/**
20 * Structure that groups a position in frame units relative to an assumed audio stream,
21 * together with the estimated time when that frame was presented or is committed to be
22 * presented.
23 * In the case of audio output, "present" means that audio produced on device
24 * is detectable by an external observer off device.
25 * The time is based on the implementation's best effort, using whatever knowledge
26 * is available to the system, but cannot account for any delay unknown to the implementation.
27 *
28 * @see AudioTrack#getTimestamp
29 * @see AudioTrack.TimestampListener
30 *
31 * @hide
32 */
33public final class AudioTimestamp
34{
35    /**
36     * Position in frames relative to start of an assumed audio stream.
37     * The low-order 32 bits of position is in wrapping frame units similar to
38     * {@link AudioTrack#getPlaybackHeadPosition}.
39     */
40    public long framePosition;
41
42    /**
43     * The estimated time when frame was presented or is committed to be presented,
44     * in the same units and timebase as {@link java.lang.System#nanoTime}.
45     */
46    public long nanoTime;
47}
48