Class DecodeOneFrameUtil
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.DecodeOneFrameUtil
-
public final class DecodeOneFrameUtil extends Object
Utilities for decoding a video frame for tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DecodeOneFrameUtil.Listener
Listener for decoding events.
-
Field Summary
Fields Modifier and Type Field Description static String
NO_DECODER_SUPPORT_ERROR_STRING
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
decodeOneAssetFileFrame(String assetFilePath, DecodeOneFrameUtil.Listener listener, Surface surface)
Reads and decodes one frame from theassetFilePath
and renders it to thesurface
.static void
decodeOneCacheFileFrame(String cacheFilePath, DecodeOneFrameUtil.Listener listener, Surface surface)
Reads and decodes one frame from thecacheFilePath
and renders it to thesurface
.
-
-
-
Field Detail
-
NO_DECODER_SUPPORT_ERROR_STRING
public static final String NO_DECODER_SUPPORT_ERROR_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
decodeOneCacheFileFrame
public static void decodeOneCacheFileFrame(String cacheFilePath, DecodeOneFrameUtil.Listener listener, @Nullable Surface surface) throws IOException
Reads and decodes one frame from thecacheFilePath
and renders it to thesurface
.- Parameters:
cacheFilePath
- The path to the file in the cache directory.listener
- ADecodeOneFrameUtil.Listener
implementation.surface
- TheSurface
to render the decoded frame to,null
if the decoded frame is not needed.- Throws:
IOException
- If theMediaExtractor
orMediaCodec
cannot be created.
-
decodeOneAssetFileFrame
public static void decodeOneAssetFileFrame(String assetFilePath, DecodeOneFrameUtil.Listener listener, @Nullable Surface surface) throws IOException
Reads and decodes one frame from theassetFilePath
and renders it to thesurface
.- Parameters:
assetFilePath
- The path to the file in the asset directory.listener
- ADecodeOneFrameUtil.Listener
implementation.surface
- TheSurface
to render the decoded frame to,null
if the decoded frame is not needed.- Throws:
IOException
- If theMediaExtractor
orMediaCodec
cannot be created.
-
-