diff options
author | ybai <Yanning.Bai@dolby.com> | 2018-11-01 13:02:15 +0800 |
---|---|---|
committer | Mikhail Naganov <mnaganov@google.com> | 2018-12-11 12:46:21 -0800 |
commit | 5e05320c7239601327c4a1689d1b2fb6d30c493d (patch) | |
tree | cbce9efc681e204a4a4c0f120bb300123d660c99 /media/java/android/media/MediaCodec.java | |
parent | b5555f6929640e0c114b103feda72d170a0ad632 (diff) |
Add AudioPresentation selection support for MediaCodec
Bug: 119312182
Test: compile
Change-Id: I5cfc577b681ea6dcc1692abf71837fd5f41616ea
Diffstat (limited to 'media/java/android/media/MediaCodec.java')
-rw-r--r-- | media/java/android/media/MediaCodec.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 242ae46f4d33..0375de3cc496 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -27,7 +27,6 @@ import android.media.MediaCodecInfo.CodecCapabilities; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.os.IBinder; import android.os.IHwBinder; import android.os.Looper; import android.os.Message; @@ -1427,6 +1426,24 @@ import java.util.concurrent.locks.ReentrantLock; <td>⎆</td> </tr> <tr> + <td>(29+)</td> + <td>29+</td> + <td>29+</td> + <td>29+</td> + <td>(29+)</td> + <td>(29+)</td> + <td>-</td> + <td class=fn>{@link #setAudioPresentation setAudioPresentation}</td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> + <tr> <td>-</td> <td>-</td> <td>18+</td> @@ -3260,6 +3277,19 @@ final public class MediaCodec { public native final void setVideoScalingMode(@VideoScalingMode int mode); /** + * Sets the audio presentation. + * @param presentation see {@link AudioPresentation}. In particular, id should be set. + */ + public void setAudioPresentation(@NonNull AudioPresentation presentation) { + if (presentation == null) { + throw new IllegalArgumentException("audio presentation is null"); + } + native_setAudioPresentation(presentation.getPresentationId(), presentation.getProgramId()); + } + + private native void native_setAudioPresentation(int presentationId, int programId); + + /** * Get the component name. If the codec was created by createDecoderByType * or createEncoderByType, what component is chosen is not known beforehand. * @throws IllegalStateException if in the Released state. |