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 17 package 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 */ 30 public final class AudioTimestamp 31 { 32 /** 33 * Position in frames relative to start of an assumed audio stream. 34 * The low-order 32 bits of position is in wrapping frame units similar to 35 * {@link AudioTrack#getPlaybackHeadPosition}. 36 */ 37 public long framePosition; 38 39 /** 40 * The estimated time when frame was presented or is committed to be presented, 41 * in the same units and timebase as {@link java.lang.System#nanoTime}. 42 */ 43 public long nanoTime; 44 } 45