Example usage for Java android.media MediaExtractor fields, constructors, methods, implement or subclass
The text is from its open source code.
int | SEEK_TO_CLOSEST_SYNC If possible, seek to the sync sample closest to the specified time |
boolean | advance() Advance to the next sample. |
Map | getPsshInfo() Get the PSSH info if present. |
long | getSampleTime() Returns the current sample's presentation time in microseconds. |
int | getTrackCount() Count the number of tracks found in the data source. |
MediaFormat | getTrackFormat(int index) Get the track format at the specified index. |
int | readSampleData(@NonNull ByteBuffer byteBuf, int offset) Retrieve the current encoded sample and store it in the byte buffer starting at the given offset. |
void | release() Make sure you call this when you're done to free up any resources instead of relying on the garbage collector to do this for you at some point in the future. |
void | seekTo(long timeUs, @SeekMode int mode) All selected tracks seek near the requested time according to the specified mode. |
void | selectTrack(int index) Subsequent calls to #readSampleData , #getSampleTrackIndex and #getSampleTime only retrieve information for the subset of tracks selected. |
void | setDataSource(@NonNull MediaDataSource dataSource) Sets the data source (MediaDataSource) to use. |
void | setDataSource(@NonNull String path) Sets the data source (file-path or http URL) to use. |
void | setDataSource(@NonNull AssetFileDescriptor afd) Sets the data source (AssetFileDescriptor) to use. |
void | setDataSource(@NonNull FileDescriptor fd) Sets the data source (FileDescriptor) to use. |
void | setDataSource(@NonNull Context context, @NonNull Uri uri, @Nullable Map Sets the data source as a content Uri. |
void | setDataSource(@NonNull FileDescriptor fd, long offset, long length) Sets the data source (FileDescriptor) to use. |