Back to Exoplayer

DecodeOneFrameUtil (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/DecodeOneFrameUtil.html

latest5.2 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class DecodeOneFrameUtil


public final classDecodeOneFrameUtilextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

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 the assetFilePath and renders it to the surface. | | static void | decodeOneCacheFileFrame​(String cacheFilePath, DecodeOneFrameUtil.Listener listener, Surface surface) | Reads and decodes one frame from the cacheFilePath and renders it to the surface. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

NO_DECODER_SUPPORT_ERROR_STRING

public static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")NO_DECODER_SUPPORT_ERROR_STRING

See Also:Constant Field Values

Method Detail

- 

decodeOneCacheFileFrame

public static void decodeOneCacheFileFrame​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")cacheFilePath,[DecodeOneFrameUtil.Listener](DecodeOneFrameUtil.Listener.html "interface in com.google.android.exoplayer2.testutil")listener,
                                           @Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
                                    throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Reads and decodes one frame from the cacheFilePath and renders it to the surface. Parameters:cacheFilePath - The path to the file in the cache directory.listener - A DecodeOneFrameUtil.Listener implementation.surface - The Surface to render the decoded frame to, null if the decoded frame is not needed.Throws:IOException - If the MediaExtractor or MediaCodec cannot be created.

- 

decodeOneAssetFileFrame

public static void decodeOneAssetFileFrame​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")assetFilePath,[DecodeOneFrameUtil.Listener](DecodeOneFrameUtil.Listener.html "interface in com.google.android.exoplayer2.testutil")listener,
                                           @Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
                                    throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Reads and decodes one frame from the assetFilePath and renders it to the surface. Parameters:assetFilePath - The path to the file in the asset directory.listener - A DecodeOneFrameUtil.Listener implementation.surface - The Surface to render the decoded frame to, null if the decoded frame is not needed.Throws:IOException - If the MediaExtractor or MediaCodec cannot be created.