Example usage for Java android.media MediaCodec fields, constructors, methods, implement or subclass
The text is from its open source code.
int | BUFFER_FLAG_CODEC_CONFIG This indicated that the buffer marked as such contains codec initialization / codec specific data instead of media data. |
int | BUFFER_FLAG_END_OF_STREAM This signals the end of stream, i.e. |
int | CRYPTO_MODE_AES_CTR |
int | INFO_TRY_AGAIN_LATER If a non-negative timeout had been specified in the call to #dequeueOutputBuffer , indicates that the call timed out. |
int | INFO_OUTPUT_FORMAT_CHANGED The output format has changed, subsequent data will follow the new format. |
int | INFO_OUTPUT_BUFFERS_CHANGED The output buffers have changed, the client must refer to the new set of output buffers returned by #getOutputBuffers from this point on. |
void | configure(@Nullable MediaFormat format, @Nullable Surface surface, @Nullable MediaCrypto crypto, @ConfigureFlag int flags) Configures a component. |
void | configure(@Nullable MediaFormat format, @Nullable Surface surface, @ConfigureFlag int flags, @Nullable MediaDescrambler descrambler) Configure a component to be used with a descrambler. |
MediaCodec | createDecoderByType(@NonNull String type) Instantiate the preferred decoder supporting input data of the given mime type. |
int | dequeueInputBuffer(long timeoutUs) Returns the index of an input buffer to be filled with valid data or -1 if no such buffer is currently available. |
int | dequeueOutputBuffer(@NonNull BufferInfo info, long timeoutUs) Dequeue an output buffer, block at most "timeoutUs" microseconds. |
ByteBuffer | getInputBuffer(int index) Returns a java.nio.Buffer#clear cleared , writable ByteBuffer object for a dequeued input buffer index to contain the input data. |
ByteBuffer[] | getInputBuffers() Retrieve the set of input buffers. |
ByteBuffer | getOutputBuffer(int index) Returns a read-only ByteBuffer for a dequeued output buffer index. |
ByteBuffer[] | getOutputBuffers() Retrieve the set of output buffers. |
MediaFormat | getOutputFormat() Call this after dequeueOutputBuffer signals a format change by returning #INFO_OUTPUT_FORMAT_CHANGED . |
void | queueInputBuffer(int index, int offset, int size, long presentationTimeUs, int flags) After filling a range of the input buffer at the specified index submit it to the component. |
void | release() Free up resources used by the codec instance. |
void | releaseOutputBuffer(int index, boolean render) If you are done with a buffer, use this call to return the buffer to the codec or to render it on the output surface. |
void | releaseOutputBuffer(int index, long renderTimestampNs) 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. |
void | start() After successfully configuring the component, call start . |
void | stop() Finish the decode/encode session, note that the codec instance remains active and ready to be #start ed again. |