VideoFrameProcessorTestRunner


@UnstableApi
public final class VideoFrameProcessorTestRunner


A test runner for VideoFrameProcessor tests.

Summary

Constants

static final int

Time to wait for the decoded frame to populate the VideoFrameProcessor instance's input surface and the VideoFrameProcessor to finish processing the frame, in milliseconds.

Public methods

void
awaitFrameProcessingEnd(long videoFrameProcessingWaitMs)

After signalEndOfInput, is called, wait for this instance to end.

static TimestampIterator
void

endFrameProcessing with VIDEO_FRAME_PROCESSING_WAIT_MS applied.

void
endFrameProcessing(long videoFrameProcessingWaitMs)

Ends VideoFrameProcessor frame processing.

void

Calls flush.

Bitmap

Returns the Bitmap from the provided BitmapReader.

void
void
queueInputBitmap(
    Bitmap inputBitmap,
    long durationUs,
    long offsetToAddUs,
    float frameRate
)
void
queueInputBitmap(
    Bitmap inputBitmap,
    long durationUs,
    long offsetToAddUs,
    float frameRate,
    ColorInfo colorInfo
)
void
queueInputBitmaps(int width, int height, Pair[] frames)
void
queueInputBitmaps(
    int width,
    int height,
    ColorInfo colorInfo,
    Pair[] frames
)
void
queueInputTexture(
    GlTextureInfo inputTexture,
    long pts,
    ColorInfo colorInfo
)
void
void

Calls signalEndOfInput.

Constants

VIDEO_FRAME_PROCESSING_WAIT_MS

public static final int VIDEO_FRAME_PROCESSING_WAIT_MS = 5000

Time to wait for the decoded frame to populate the VideoFrameProcessor instance's input surface and the VideoFrameProcessor to finish processing the frame, in milliseconds.

Public methods

awaitFrameProcessingEnd

public void awaitFrameProcessingEnd(long videoFrameProcessingWaitMs)

After signalEndOfInput, is called, wait for this instance to end.

createTimestampIterator

public static TimestampIterator createTimestampIterator(List<Long> elements)

endFrameProcessing

public void endFrameProcessing()

endFrameProcessing with VIDEO_FRAME_PROCESSING_WAIT_MS applied.

endFrameProcessing

public void endFrameProcessing(long videoFrameProcessingWaitMs)

Ends VideoFrameProcessor frame processing.

Waits for frame processing to end, for videoFrameProcessingWaitMs.

flush

public void flush()

Calls flush.

getOutputBitmap

public Bitmap getOutputBitmap()

Returns the Bitmap from the provided BitmapReader.

Also saves the bitmap to the cache directory.

processFirstFrameAndEnd

public void processFirstFrameAndEnd()

queueInputBitmap

public void queueInputBitmap(
    Bitmap inputBitmap,
    long durationUs,
    long offsetToAddUs,
    float frameRate
)

queueInputBitmap

public void queueInputBitmap(
    Bitmap inputBitmap,
    long durationUs,
    long offsetToAddUs,
    float frameRate,
    ColorInfo colorInfo
)

queueInputBitmaps

public void queueInputBitmaps(int width, int height, Pair[] frames)

queueInputBitmaps

public void queueInputBitmaps(
    int width,
    int height,
    ColorInfo colorInfo,
    Pair[] frames
)

queueInputTexture

public void queueInputTexture(
    GlTextureInfo inputTexture,
    long pts,
    ColorInfo colorInfo
)

release

public void release()

signalEndOfInput

public void signalEndOfInput()

Calls signalEndOfInput.

Calling this and awaitFrameProcessingEnd is an alternative to endFrameProcessing.