Class MediaInfoAccessor
java.lang.Object
com.amilesend.mediainfo.lib.MediaInfoAccessor
- All Implemented Interfaces:
- AutoCloseable
The object used by java applications to interact with the libMediaInfo library.
- 
Constructor SummaryConstructorsConstructorDescriptionMediaInfoAccessor(@NonNull MediaInfoLibrary mediaInfoLibrary) Creates a newMediaInfoobject.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes the library instance.voidCloses a file handle that was previously opened.voiddispose()Disposes of the library instance reference.get(@NonNull StreamType streamType, int streamNumber, int parameterIndex, @NonNull InfoType infoType) Get a piece of information about a file (parameter is an integer that represents the parameter index).get(@NonNull StreamType streamType, int streamNumber, String parameter, @NonNull InfoType infoType, @NonNull InfoType searchType) Get a piece of information about a file (parameter is a string).get(StreamType streamType, int streamNumber, int parameterIndex) Get a piece of information about a file (parameter is an integer that represents the parameter index).get(StreamType streamType, int streamNumber, String parameter) Get a piece of information about a file (parameter is a string).get(StreamType streamType, int streamNumber, String parameter, InfoType infoType) Get a piece of information about a file (parameter is a string).Gets information about MediaInfo.intgetStreamCount(@NonNull StreamType streamType) Gets the number of streams for the given stream type.intgetStreamOrParameterCount(@NonNull StreamType streamType, int streamNumber) Gets the number of streams for the given stream type or the total count of information parameters for a stream.inform()Get all details about a file.booleanOpens a file to parse.intopenBufferContinue(@NonNull byte[] buffer, int size) Reads from a memory buffer to parse media information and tags.longTests if there is request to seek to another position in the stream.intCloses the buffer upon read completion.booleanopenBufferInit(long length, long offset) Prepares a memory buffer for reading and parsing media information from a stream.Configures information about MediaInfo.
- 
Constructor Details- 
MediaInfoAccessorCreates a newMediaInfoobject.- Parameters:
- mediaInfoLibrary- the library instance
- See Also:
 
 
- 
- 
Method Details- 
close
- 
disposepublic void dispose()Disposes of the library instance reference.
- 
openOpens a file to parse.- Parameters:
- fileName- the full path and filename to open
- Returns:
- trueif file was opened; else,- false
 
- 
openBufferInitpublic boolean openBufferInit(long length, long offset) Prepares a memory buffer for reading and parsing media information from a stream.- Parameters:
- length- the length of the buffer
- offset- the byte offset to start reading from
- Returns:
- trueif the buffer was successfully initialized; else,- false
 
- 
openBufferContinuepublic int openBufferContinue(@NonNull byte[] buffer, int size) Reads from a memory buffer to parse media information and tags.- Parameters:
- buffer- the buffer reference
- size- the amount of data to read
- Returns:
- a bitfield with the following bits:
        - 0- Accepted (format is known)
- 1- Filled (data collected)
- 2- Buffer updated (further data required)
- 3- Buffer finalized (no further data required)
- 4-15- Reserved
- 16-31- User defined
 
 
- 
openBufferContinueGotoGetpublic long openBufferContinueGotoGet()Tests if there is request to seek to another position in the stream.- Returns:
- -1if there is no more data to seek to; else, the seek position
 
- 
openBufferFinalizepublic int openBufferFinalize()Closes the buffer upon read completion.- Returns:
- 0if the buffer has been read or null; else non-0 value if an error occurred.
 
- 
closeHandlepublic void closeHandle()Closes a file handle that was previously opened.
- 
informGet all details about a file.- Returns:
- All details about a file in one string
 
- 
getGet a piece of information about a file (parameter is a string).- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- parameter- the parameter you are looking for in the stream (e.g., resolution, codec, bitrate, etc.)
- Returns:
- the query result, or empty if there is a problem or not found
- See Also:
 
- 
getGet a piece of information about a file (parameter is a string).- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- parameter- the parameter you are looking for in the stream (e.g., resolution, codec, bitrate, etc.)
- infoType- the type of information about the parameter
- See Also:
 
- 
getpublic String get(@NonNull StreamType streamType, int streamNumber, String parameter, @NonNull InfoType infoType, @NonNull InfoType searchType) Get a piece of information about a file (parameter is a string). For a list of available parameters, please refer to General.csv.- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- parameter- the parameter you are looking for in the stream (e.g., resolution, codec, bitrate, etc.)
- infoType- the type of information about the parameter
- searchType- describes where to look for the parameter
- Returns:
- the queries information; or an empty string if there was a problem
 
- 
getGet a piece of information about a file (parameter is an integer that represents the parameter index).- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- parameterIndex- the parameter index that you are looking for in the stream
- Returns:
- a string about information you search, an empty string if there is a problem
 
- 
getpublic String get(@NonNull StreamType streamType, int streamNumber, int parameterIndex, @NonNull InfoType infoType) Get a piece of information about a file (parameter is an integer that represents the parameter index).- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- parameterIndex- the parameter index that you are looking for in the stream
- infoType- the type of information you want about the parameter (the text, the measure, the help...)
- Returns:
- the information or an empty string if there is a problem
 
- 
getStreamCountGets the number of streams for the given stream type.- Parameters:
- streamType- the stream type
- Returns:
- number of streams of the given stream type
 
- 
getStreamOrParameterCountGets the number of streams for the given stream type or the total count of information parameters for a stream.- Parameters:
- streamType- the stream type
- streamNumber- the stream number
- Returns:
- number of streams of the given stream type
 
- 
getOption
- 
setOption
 
-