Loading include/ndk/NdkMediaCodec.h +12 −1 Original line number Diff line number Diff line Loading @@ -153,6 +153,18 @@ AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec*); */ media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool render); /** * Dynamically sets the output surface of a codec. * * This can only be used if the codec was configured with an output surface. The * new output surface should have a compatible usage type to the original output surface. * E.g. codecs may not support switching from a SurfaceTexture (GPU readable) output * to ImageReader (software readable) output. * * For more details, see the Java documentation for MediaCodec.setOutputSurface. */ media_status_t AMediaCodec_setOutputSurface(AMediaCodec*, ANativeWindow* surface); /** * If you are done with a buffer, use this call to update its surface timestamp * and return it to the codec to render it on the output surface. If you Loading @@ -164,7 +176,6 @@ media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool re media_status_t AMediaCodec_releaseOutputBufferAtTime( AMediaCodec *mData, size_t idx, int64_t timestampNs); typedef enum { AMEDIACODECRYPTOINFO_MODE_CLEAR = 0, AMEDIACODECRYPTOINFO_MODE_AES_CTR = 1 Loading media/ndk/NdkMediaCodec.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -359,6 +359,15 @@ media_status_t AMediaCodec_releaseOutputBufferAtTime( return translate_error(mData->mCodec->renderOutputBufferAndRelease(idx, timestampNs)); } EXPORT media_status_t AMediaCodec_setOutputSurface(AMediaCodec *mData, ANativeWindow* window) { sp<Surface> surface = NULL; if (window != NULL) { surface = (Surface*) window; } return translate_error(mData->mCodec->setSurface(surface)); } //EXPORT media_status_t AMediaCodec_setNotificationCallback(AMediaCodec *mData, OnCodecEvent callback, void *userdata) { Loading Loading
include/ndk/NdkMediaCodec.h +12 −1 Original line number Diff line number Diff line Loading @@ -153,6 +153,18 @@ AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec*); */ media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool render); /** * Dynamically sets the output surface of a codec. * * This can only be used if the codec was configured with an output surface. The * new output surface should have a compatible usage type to the original output surface. * E.g. codecs may not support switching from a SurfaceTexture (GPU readable) output * to ImageReader (software readable) output. * * For more details, see the Java documentation for MediaCodec.setOutputSurface. */ media_status_t AMediaCodec_setOutputSurface(AMediaCodec*, ANativeWindow* surface); /** * If you are done with a buffer, use this call to update its surface timestamp * and return it to the codec to render it on the output surface. If you Loading @@ -164,7 +176,6 @@ media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool re media_status_t AMediaCodec_releaseOutputBufferAtTime( AMediaCodec *mData, size_t idx, int64_t timestampNs); typedef enum { AMEDIACODECRYPTOINFO_MODE_CLEAR = 0, AMEDIACODECRYPTOINFO_MODE_AES_CTR = 1 Loading
media/ndk/NdkMediaCodec.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -359,6 +359,15 @@ media_status_t AMediaCodec_releaseOutputBufferAtTime( return translate_error(mData->mCodec->renderOutputBufferAndRelease(idx, timestampNs)); } EXPORT media_status_t AMediaCodec_setOutputSurface(AMediaCodec *mData, ANativeWindow* window) { sp<Surface> surface = NULL; if (window != NULL) { surface = (Surface*) window; } return translate_error(mData->mCodec->setSurface(surface)); } //EXPORT media_status_t AMediaCodec_setNotificationCallback(AMediaCodec *mData, OnCodecEvent callback, void *userdata) { Loading