Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -23989,6 +23989,7 @@ package android.media { method public void releaseOutputBuffer(int, boolean); method public void releaseOutputBuffer(int, long); method public void reset(); method public void setAudioPresentation(android.media.AudioPresentation); method public void setCallback(android.media.MediaCodec.Callback, android.os.Handler); method public void setCallback(android.media.MediaCodec.Callback); method public void setInputSurface(android.view.Surface); media/java/android/media/MediaCodec.java +31 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1426,6 +1425,24 @@ import java.util.concurrent.locks.ReentrantLock; <td>⎆</td> <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> Loading Loading @@ -3259,6 +3276,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. Loading media/jni/android_media_MediaCodec.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,13 @@ void JMediaCodec::setVideoScalingMode(int mode) { } } void JMediaCodec::selectAudioPresentation(const int32_t presentationId, const int32_t programId) { sp<AMessage> msg = new AMessage; msg->setInt32("audio-presentation-presentation-id", presentationId); msg->setInt32("audio-presentation-program-id", programId); (void)mCodec->setParameters(msg); } static jthrowable createCodecException( JNIEnv *env, status_t err, int32_t actionCode, const char *msg = NULL) { ScopedLocalRef<jclass> clazz( Loading Loading @@ -1874,6 +1881,18 @@ static void android_media_MediaCodec_setVideoScalingMode( codec->setVideoScalingMode(mode); } static void android_media_MediaCodec_setAudioPresentation( JNIEnv *env, jobject thiz, jint presentationId, jint programId) { sp<JMediaCodec> codec = getMediaCodec(env, thiz); if (codec == NULL) { throwExceptionAsNecessary(env, INVALID_OPERATION); return; } codec->selectAudioPresentation((int32_t)presentationId, (int32_t)programId); } static void android_media_MediaCodec_native_init(JNIEnv *env) { ScopedLocalRef<jclass> clazz( env, env->FindClass("android/media/MediaCodec")); Loading Loading @@ -2183,6 +2202,9 @@ static const JNINativeMethod gMethods[] = { { "setVideoScalingMode", "(I)V", (void *)android_media_MediaCodec_setVideoScalingMode }, { "native_setAudioPresentation", "(II)V", (void *)android_media_MediaCodec_setAudioPresentation }, { "native_init", "()V", (void *)android_media_MediaCodec_native_init }, { "native_setup", "(Ljava/lang/String;ZZ)V", Loading media/jni/android_media_MediaCodec.h +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ struct JMediaCodec : public AHandler { void setVideoScalingMode(int mode); void selectAudioPresentation(const int32_t presentationId, const int32_t programId); protected: virtual ~JMediaCodec(); Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -23989,6 +23989,7 @@ package android.media { method public void releaseOutputBuffer(int, boolean); method public void releaseOutputBuffer(int, long); method public void reset(); method public void setAudioPresentation(android.media.AudioPresentation); method public void setCallback(android.media.MediaCodec.Callback, android.os.Handler); method public void setCallback(android.media.MediaCodec.Callback); method public void setInputSurface(android.view.Surface);
media/java/android/media/MediaCodec.java +31 −1 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -1426,6 +1425,24 @@ import java.util.concurrent.locks.ReentrantLock; <td>⎆</td> <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> Loading Loading @@ -3259,6 +3276,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. Loading
media/jni/android_media_MediaCodec.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -752,6 +752,13 @@ void JMediaCodec::setVideoScalingMode(int mode) { } } void JMediaCodec::selectAudioPresentation(const int32_t presentationId, const int32_t programId) { sp<AMessage> msg = new AMessage; msg->setInt32("audio-presentation-presentation-id", presentationId); msg->setInt32("audio-presentation-program-id", programId); (void)mCodec->setParameters(msg); } static jthrowable createCodecException( JNIEnv *env, status_t err, int32_t actionCode, const char *msg = NULL) { ScopedLocalRef<jclass> clazz( Loading Loading @@ -1874,6 +1881,18 @@ static void android_media_MediaCodec_setVideoScalingMode( codec->setVideoScalingMode(mode); } static void android_media_MediaCodec_setAudioPresentation( JNIEnv *env, jobject thiz, jint presentationId, jint programId) { sp<JMediaCodec> codec = getMediaCodec(env, thiz); if (codec == NULL) { throwExceptionAsNecessary(env, INVALID_OPERATION); return; } codec->selectAudioPresentation((int32_t)presentationId, (int32_t)programId); } static void android_media_MediaCodec_native_init(JNIEnv *env) { ScopedLocalRef<jclass> clazz( env, env->FindClass("android/media/MediaCodec")); Loading Loading @@ -2183,6 +2202,9 @@ static const JNINativeMethod gMethods[] = { { "setVideoScalingMode", "(I)V", (void *)android_media_MediaCodec_setVideoScalingMode }, { "native_setAudioPresentation", "(II)V", (void *)android_media_MediaCodec_setAudioPresentation }, { "native_init", "()V", (void *)android_media_MediaCodec_native_init }, { "native_setup", "(Ljava/lang/String;ZZ)V", Loading
media/jni/android_media_MediaCodec.h +2 −0 Original line number Diff line number Diff line Loading @@ -128,6 +128,8 @@ struct JMediaCodec : public AHandler { void setVideoScalingMode(int mode); void selectAudioPresentation(const int32_t presentationId, const int32_t programId); protected: virtual ~JMediaCodec(); Loading