Interface FrameProcessor

    • Method Detail

      • setInputFrameInfo

        void setInputFrameInfo​(FrameInfo inputFrameInfo)
        Sets information about the input frames.

        The new input information is applied from the next frame registered onwards.

        Pixels are expanded using the FrameInfo.pixelWidthHeightRatio so that the output frames' pixels have a ratio of 1.

        The caller should update FrameInfo.streamOffsetUs when switching input streams to ensure that frame timestamps are always monotonically increasing.

      • getPendingInputFrameCount

        int getPendingInputFrameCount()
        Returns the number of input frames that have been registered but not processed off the input surface yet.
      • setOutputSurfaceInfo

        void setOutputSurfaceInfo​(@Nullable
                                  SurfaceInfo outputSurfaceInfo)
        Sets the output surface and supporting information. When output frames are released and not dropped, they will be rendered to this output SurfaceInfo.

        The new output SurfaceInfo is applied from the next output frame rendered onwards. If the output SurfaceInfo is null, the FrameProcessor will stop rendering pending frames and resume rendering once a non-null SurfaceInfo is set.

        If the dimensions given in SurfaceInfo do not match the output size after applying the final effect the frames are resized before rendering to the surface and letter/pillar-boxing is applied.

        The caller is responsible for tracking the lifecycle of the SurfaceInfo.surface including calling this method with a new surface if it is destroyed. When this method returns, the previous output surface is no longer being used and can safely be released by the caller.

      • signalEndOfInput

        void signalEndOfInput()
        Informs the FrameProcessor that no further input frames should be accepted.
        Throws:
        IllegalStateException - If called more than once.
      • release

        void release()
        Releases all resources.

        If the frame processor is released before it has ended, it will attempt to cancel processing any input frames that have already become available. Input frames that become available after release are ignored.

        This method blocks until all resources are released or releasing times out.