Loading media/java/android/media/MediaCodec.java +12 −12 Original line number Diff line number Diff line Loading @@ -60,10 +60,10 @@ import java.util.concurrent.locks.ReentrantLock; with {@link MediaExtractor}, {@link MediaSync}, {@link MediaMuxer}, {@link MediaCrypto}, {@link MediaDrm}, {@link Image}, {@link Surface}, and {@link AudioTrack}.) <p> <center><object style="width: 540px; height: 205px;" type="image/svg+xml" data="../../../images/media/mediacodec_buffers.svg"><img src="../../../images/media/mediacodec_buffers.png" style="width: 540px; height: 205px" alt="MediaCodec buffer flow diagram"></object></center> <center> <img src="../../../images/media/mediacodec_buffers.svg" style="width: 540px; height: 205px" alt="MediaCodec buffer flow diagram"> </center> <p> In broad terms, a codec processes input data to generate output data. It processes data asynchronously and uses a set of input and output buffers. At a simplistic level, you request Loading Loading @@ -268,10 +268,10 @@ import java.util.concurrent.locks.ReentrantLock; Uninitialized, Configured and Error, whereas the Executing state conceptually progresses through three sub-states: Flushed, Running and End-of-Stream. <p> <center><object style="width: 516px; height: 353px;" type="image/svg+xml" data="../../../images/media/mediacodec_states.svg"><img src="../../../images/media/mediacodec_states.png" style="width: 519px; height: 356px" alt="MediaCodec state diagram"></object></center> <center> <img src="../../../images/media/mediacodec_states.svg" style="width: 519px; height: 356px" alt="MediaCodec state diagram"> </center> <p> When you create a codec using one of the factory methods, the codec is in the Uninitialized state. First, you need to configure it via {@link #configure configure(…)}, which brings Loading Loading @@ -513,10 +513,10 @@ import java.util.concurrent.locks.ReentrantLock; Similarly, upon an initial call to {@code start} the codec will move directly to the Running sub-state and start passing available input buffers via the callback. <p> <center><object style="width: 516px; height: 353px;" type="image/svg+xml" data="../../../images/media/mediacodec_async_states.svg"><img src="../../../images/media/mediacodec_async_states.png" style="width: 516px; height: 353px" alt="MediaCodec state diagram for asynchronous operation"></object></center> <center> <img src="../../../images/media/mediacodec_async_states.svg" style="width: 516px; height: 353px" alt="MediaCodec state diagram for asynchronous operation"> </center> <p> MediaCodec is typically used like this in asynchronous mode: <pre class=prettyprint> Loading Loading
media/java/android/media/MediaCodec.java +12 −12 Original line number Diff line number Diff line Loading @@ -60,10 +60,10 @@ import java.util.concurrent.locks.ReentrantLock; with {@link MediaExtractor}, {@link MediaSync}, {@link MediaMuxer}, {@link MediaCrypto}, {@link MediaDrm}, {@link Image}, {@link Surface}, and {@link AudioTrack}.) <p> <center><object style="width: 540px; height: 205px;" type="image/svg+xml" data="../../../images/media/mediacodec_buffers.svg"><img src="../../../images/media/mediacodec_buffers.png" style="width: 540px; height: 205px" alt="MediaCodec buffer flow diagram"></object></center> <center> <img src="../../../images/media/mediacodec_buffers.svg" style="width: 540px; height: 205px" alt="MediaCodec buffer flow diagram"> </center> <p> In broad terms, a codec processes input data to generate output data. It processes data asynchronously and uses a set of input and output buffers. At a simplistic level, you request Loading Loading @@ -268,10 +268,10 @@ import java.util.concurrent.locks.ReentrantLock; Uninitialized, Configured and Error, whereas the Executing state conceptually progresses through three sub-states: Flushed, Running and End-of-Stream. <p> <center><object style="width: 516px; height: 353px;" type="image/svg+xml" data="../../../images/media/mediacodec_states.svg"><img src="../../../images/media/mediacodec_states.png" style="width: 519px; height: 356px" alt="MediaCodec state diagram"></object></center> <center> <img src="../../../images/media/mediacodec_states.svg" style="width: 519px; height: 356px" alt="MediaCodec state diagram"> </center> <p> When you create a codec using one of the factory methods, the codec is in the Uninitialized state. First, you need to configure it via {@link #configure configure(…)}, which brings Loading Loading @@ -513,10 +513,10 @@ import java.util.concurrent.locks.ReentrantLock; Similarly, upon an initial call to {@code start} the codec will move directly to the Running sub-state and start passing available input buffers via the callback. <p> <center><object style="width: 516px; height: 353px;" type="image/svg+xml" data="../../../images/media/mediacodec_async_states.svg"><img src="../../../images/media/mediacodec_async_states.png" style="width: 516px; height: 353px" alt="MediaCodec state diagram for asynchronous operation"></object></center> <center> <img src="../../../images/media/mediacodec_async_states.svg" style="width: 516px; height: 353px" alt="MediaCodec state diagram for asynchronous operation"> </center> <p> MediaCodec is typically used like this in asynchronous mode: <pre class=prettyprint> Loading