Interface SampleConsumer


  • @Deprecated
    public interface SampleConsumer
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Consumer of encoded media samples, raw audio or raw video frames.
    • Method Detail

      • getInputBuffer

        @Nullable
        default DecoderInputBuffer getInputBuffer()
        Deprecated.
        Returns a DecoderInputBuffer, if available.

        This buffer should be filled with new input data and queued to the consumer.

        If this method returns a non-null buffer:

        • The buffer's data is non-null.
        • The same buffer instance is returned if this method is called multiple times before queuing input.

        Should only be used for compressed data and raw audio data.

      • queueInputBuffer

        default boolean queueInputBuffer()
        Deprecated.
        Attempts to queue new input to the consumer.

        The input buffer from getInputBuffer() should be filled with the new input before calling this method.

        An input buffer should not be used anymore after it has been successfully queued.

        Should only be used for compressed data and raw audio data.

        Returns:
        Whether the input was successfully queued. If false, the caller should try again later.
      • queueInputBitmap

        default boolean queueInputBitmap​(Bitmap inputBitmap,
                                         long durationUs,
                                         int frameRate)
        Deprecated.
        Attempts to provide an input Bitmap to the consumer.

        Should only be used for image data.

        Parameters:
        inputBitmap - The Bitmap to queue to the consumer.
        durationUs - The duration for which to display the inputBitmap, in microseconds.
        frameRate - The frame rate at which to display the inputBitmap, in frames per second.
        Returns:
        Whether the Bitmap was successfully queued. If false, the caller should try again later.
      • queueInputTexture

        default boolean queueInputTexture​(int texId,
                                          long presentationTimeUs)
        Deprecated.
        Attempts to provide an input texture to the consumer.

        Should only be used for raw video data.

        Parameters:
        texId - The ID of the texture to queue to the consumer.
        presentationTimeUs - The presentation time for the texture, in microseconds.
        Returns:
        Whether the texture was successfully queued. If false, the caller should try again later.
      • getInputSurface

        default Surface getInputSurface()
        Deprecated.
        Returns the input Surface, where the consumer reads input frames from.

        Should only be used for raw video data.

      • getExpectedInputColorInfo

        default ColorInfo getExpectedInputColorInfo()
        Deprecated.
        Returns the expected input ColorInfo.

        Should only be used for raw video data.

      • getPendingVideoFrameCount

        default int getPendingVideoFrameCount()
        Deprecated.
        Returns the number of input video frames pending in the consumer. Pending input frames are frames that have been registered but not processed off the input surface yet.

        Should only be used for raw video data.

      • registerVideoFrame

        default boolean registerVideoFrame​(long presentationTimeUs)
        Deprecated.
        Attempts to register a video frame to the consumer.

        Each frame to consume should be registered using this method. After a frame is successfully registered, it should be rendered to the input surface.

        Should only be used for raw video data.

        Parameters:
        presentationTimeUs - The presentation time of the frame to register, in microseconds.
        Returns:
        Whether the frame was successfully registered. If false, the caller should try again later.
      • signalEndOfVideoInput

        default void signalEndOfVideoInput()
        Deprecated.
        Informs the consumer that no further input frames will be rendered.

        Should only be used for raw video data.