Lines Matching refs:MediaSync

38  * MediaSync class can be used to synchronously play audio and video streams.
41 * <p>MediaSync is generally used like this:
43 * MediaSync sync = new MediaSync();
51 * sync.setCallback(new MediaSync.Callback() {
53 * public void onAudioBufferConsumed(MediaSync sync, ByteBuffer audioBuffer, int bufferId) {
77 * // MediaCodec's, how they are fed to MediaSync and how they are returned by MediaSync.
91 * // This is the callback from MediaSync.
92 * onAudioBufferConsumed(MediaSync sync, ByteBuffer buffer, int bufferId) {
107 * AudioTrack#MODE_STREAM}. The audio buffers are sent to MediaSync directly via {@link
116 public final class MediaSync {
118 * MediaSync callback interface. Used to notify the user asynchronously
119 * of various MediaSync events.
125 * @param sync The MediaSync object.
128 * {@link MediaSync#queueAudio}.
131 @NonNull MediaSync sync, @NonNull ByteBuffer audioBuffer, int bufferId);
135 * @see android.media.MediaSync.OnErrorListener
140 * @see android.media.MediaSync.OnErrorListener
153 * @param sync The MediaSync the error pertains to
162 void onError(@NonNull MediaSync sync, int what, int extra);
165 private static final String TAG = "MediaSync";
187 private MediaSync.Callback mCallback = null;
191 private MediaSync.OnErrorListener mOnErrorListener = null;
208 * Class constructor. On creation, MediaSync is paused, i.e., playback rate is 0.0f.
210 public MediaSync() {
242 * Sets an asynchronous callback for actionable MediaSync events.
250 * @param handler The Handler that will run the callback. Use {@code null} to use MediaSync's
253 public void setCallback(@Nullable /* MediaSync. */ Callback cb, @Nullable Handler handler) {
282 * @param handler The Handler that will run the callback. Use {@code null} to use MediaSync's
285 public void setOnErrorListener(@Nullable /* MediaSync. */ OnErrorListener listener,
307 * Sets the output surface for MediaSync.
324 * Sets the audio track for MediaSync.
358 * When using MediaSync with {@link AudioTrack}, set playback params using this
582 final MediaSync sync = this;