Interface MediaInfoLibrary
- All Superinterfaces:
- com.sun.jna.Library
public interface MediaInfoLibrary
extends com.sun.jna.Library
Defines the JNA interface to access the native libmediainfo library.
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.sun.jna.Librarycom.sun.jna.Library.Handler
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringDefines the java methods to library method mapping.Fields inherited from interface com.sun.jna.LibraryOPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose(com.sun.jna.Pointer handle) Closes the file that was opened withopen(Pointer, WString).intcountGet(com.sun.jna.Pointer handle, int streamType, int streamNumber) The count of streams for the given stream type, or count of information parameters for a stream.voiddeleteHandle(com.sun.jna.Pointer handle) Deallocates a pointer reference to the libMediaInfo library.com.sun.jna.WStringget(com.sun.jna.Pointer handle, int streamType, int streamNumber, com.sun.jna.WString parameter, int infoType, int searchType) Gets information about a media file where the parameter is a string.com.sun.jna.WStringgetI(com.sun.jna.Pointer handle, int streamType, int streamNumber, int parameterIndex, int infoType) Gets information about a media file where the parameter is an integer that represents the parameter index.com.sun.jna.WStringinform(com.sun.jna.Pointer handle, int reserved) Gets all media details about a file.com.sun.jna.PointerCreates a new pointer reference to the libMediaInfo library.static MediaInfoLibraryCreates a newMediaInfoLibraryinstance.intopen(com.sun.jna.Pointer handle, com.sun.jna.WString file) Opens a file for parsing media information and tags.intopenBufferContinue(com.sun.jna.Pointer handle, byte[] buffer, int size) Reads from a memory buffer to parse media information and tags.longopenBufferContinueGotoGet(com.sun.jna.Pointer handle) Tests if there is request to seek to another position in the stream.intopenBufferFinalize(com.sun.jna.Pointer handle) Closes the buffer upon read completion.intopenBufferInit(com.sun.jna.Pointer handle, long length, long offset) Prepares a memory buffer for reading and parsing media information from a stream.com.sun.jna.WStringoption(com.sun.jna.Pointer handle, com.sun.jna.WString option, com.sun.jna.WString value) Configure or gets information about MediaInfo
- 
Field Details- 
MEDIA_INFO_LIB_PATH- See Also:
 
- 
METHOD_TO_FUNCTION_NAME_MAP
 
- 
- 
Method Details- 
newInstanceCreates a newMediaInfoLibraryinstance.- Returns:
- the media info library instance
 
- 
newHandlecom.sun.jna.Pointer newHandle()Creates a new pointer reference to the libMediaInfo library.- Returns:
- the pointer reference
 
- 
deleteHandlevoid deleteHandle(com.sun.jna.Pointer handle) Deallocates a pointer reference to the libMediaInfo library.- Parameters:
- handle- the pointer reference
 
- 
openint open(com.sun.jna.Pointer handle, com.sun.jna.WString file) Opens a file for parsing media information and tags.- Parameters:
- handle- the library pointer
- file- the full path to the file to open
- Returns:
- 1if the file was successfully opened; else,- 0
 
- 
openBufferInitint openBufferInit(com.sun.jna.Pointer handle, 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:
- 1if the buffer was successfully allocated; else,- 0
 
- 
openBufferContinueint openBufferContinue(com.sun.jna.Pointer handle, byte[] buffer, int size) Reads from a memory buffer to parse media information and tags.- Parameters:
- handle- the library pointer
- 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
 
 
- 
openBufferContinueGotoGetlong openBufferContinueGotoGet(com.sun.jna.Pointer handle) Tests if there is request to seek to another position in the stream.- Parameters:
- handle- the library pointer
- Returns:
- -1if there is no more data to seek to; else, the seek position
 
- 
openBufferFinalizeint openBufferFinalize(com.sun.jna.Pointer handle) Closes the buffer upon read completion.- Parameters:
- handle- the library pointer.
- Returns:
- 0if the buffer has been read or null; else non-0 value if an error occurred.
 
- 
closevoid close(com.sun.jna.Pointer handle) Closes the file that was opened withopen(Pointer, WString).- Parameters:
- handle- the library pointer
 
- 
informcom.sun.jna.WString inform(com.sun.jna.Pointer handle, int reserved) Gets all media details about a file.- Parameters:
- handle- the library pointer
- reserved- reserved value. Should be defined as- 0
- Returns:
- the media information
 
- 
getcom.sun.jna.WString get(com.sun.jna.Pointer handle, int streamType, int streamNumber, com.sun.jna.WString parameter, int infoType, int searchType) Gets information about a media file where the parameter is a string. For a list of available parameters, please refer to General.csv.- Parameters:
- handle- the library pointer
- streamType- the stream type
- streamNumber- the stream number
- parameter- the parameter
- infoType- the information type
- searchType- the search type
- Returns:
- the media parameter information
 
- 
getIcom.sun.jna.WString getI(com.sun.jna.Pointer handle, int streamType, int streamNumber, int parameterIndex, int infoType) Gets information about a media file where the parameter is an integer that represents the parameter index.- Parameters:
- handle- the library pointer
- streamType- the stream type
- streamNumber- the stream number
- parameterIndex- the index position for the parameter
- infoType- the information type
- Returns:
- the media parameter information
 
- 
countGetint countGet(com.sun.jna.Pointer handle, int streamType, int streamNumber) The count of streams for the given stream type, or count of information parameters for a stream.- Parameters:
- handle- the library pointer
- streamType- the stream type
- streamNumber- the stream number
- Returns:
- the count of streams or parameters
 
- 
optioncom.sun.jna.WString option(com.sun.jna.Pointer handle, com.sun.jna.WString option, com.sun.jna.WString value) Configure or gets information about MediaInfo- Parameters:
- handle- the library pointer
- option- the option
- value- the value
- Returns:
- ""means no; else, any other value means yes
 
 
-