public MediaInfo() { try { handle = MediaInfoLibrary.INSTANCE.New(); } catch (LinkageError e) { throw new MediaInfoException(e); } }
public synchronized void dispose() { if (handle == null) { return; } // delete handle MediaInfoLibrary.INSTANCE.Delete(handle); handle = null; }
public static String staticOption(String option, String value) { try { return MediaInfoLibrary.INSTANCE .Option(null, new WString(option), new WString(value)) .toString(); } catch (LinkageError e) { throw new MediaInfoException(e); } }
public synchronized boolean open(File file) { if (file == null || !file.isFile()) { return false; } // MacOS filesystem may require NFD unicode decomposition (forcing NFD seems to work for // System.out() but passing to libmediainfo is still not working) String path = file.getAbsolutePath(); if (Platform.isMac()) { path = Normalizer.normalize(path, Form.NFD); } return MediaInfoLibrary.INSTANCE.Open(handle, new WString(path)) > 0; }
public synchronized String get( StreamKind streamKind, int streamNumber, String parameter, InfoKind infoKind, InfoKind searchKind) { return MediaInfoLibrary.INSTANCE .Get( handle, streamKind.ordinal(), streamNumber, new WString(parameter), infoKind.ordinal(), searchKind.ordinal()) .toString(); }
public synchronized String option(String option, String value) { return MediaInfoLibrary.INSTANCE .Option(handle, new WString(option), new WString(value)) .toString(); }
public synchronized String inform() { return MediaInfoLibrary.INSTANCE.Inform(handle).toString(); }
@Override public synchronized void close() { MediaInfoLibrary.INSTANCE.Close(handle); }
public synchronized int parameterCount(StreamKind streamKind, int streamNumber) { return MediaInfoLibrary.INSTANCE.Count_Get(handle, streamKind.ordinal(), streamNumber); }
public synchronized int streamCount(StreamKind streamKind) { return MediaInfoLibrary.INSTANCE.Count_Get(handle, streamKind.ordinal(), -1); }
public synchronized String get( StreamKind streamKind, int streamNumber, int parameterIndex, InfoKind infoKind) { return MediaInfoLibrary.INSTANCE .GetI(handle, streamKind.ordinal(), streamNumber, parameterIndex, infoKind.ordinal()) .toString(); }