Package com.avpkit.core
Class IMetaData
- java.lang.Object
-
- com.avpkit.ferry.RefCounted
-
- com.avpkit.core.IMetaData
-
public class IMetaData extends RefCounted
Get MetaData about a {IContainer} or {IStream}.
MetaData is a bag of key/value pairs that can be embedded
in some {IContainer} or some {IStream}
in an {IContainer}, and are then written to
or read from a media file. Keys must be unique, and
any attempt to set a key value replaces any previous values.
An example is the "title" meta-data item in an MP3 file.
Support for IMetaData differs depending upon the {
IContainer} format you're using and the implementation
in FFmpeg. For example,
MP3 meta-data reading and writing is supported, but
(as of the writing of this comment) FLV meta-data writing
is not supported.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIMetaData.FlagsDifferent types of flags that can be passed to {IMetaData#getValue}
-
Field Summary
-
Fields inherited from class com.avpkit.ferry.RefCounted
swigCMemOwn
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IMetaDatacopyReference()Create a new IMetaData object that is actually referring to the exact same underlying native object.booleanequals(java.lang.Object obj)Compares two values, returning true if the underlying objects in native code are the same object.static longgetCPtr(IMetaData obj)Internal Only.java.util.Collection<java.lang.String>getKeys()Get the set of keys currently in thisIMediaDataobject as an unordered collection.longgetMyCPtr()Internal Only.intgetNumKeys()Get the total number of keys currently in this
{IMetaData} object.
java.lang.StringgetValue(java.lang.String key)Return the value for this key, comparing case insensitively.java.lang.StringgetValue(java.lang.String key, IMetaData.Flags flag)Get the value for the given key.
inthashCode()Get a hashable value for this object.static IMetaDatamake()Create a new {IMetaData} bag of properties with
no values set.intsetValue(java.lang.String key, java.lang.String value)Sets the value for the given key to value.intsetValue(java.lang.String key, java.lang.String value, IMetaData.Flags flag)Sets the value for the given key to value.java.lang.StringtoString()Return the meta-data, with all values expanded.-
Methods inherited from class com.avpkit.ferry.RefCounted
acquire, delete, getCPtr, getCurrentRefCount, getJavaRefCount, release
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(IMetaData obj)
Internal Only. Not part of public API. Get the raw value of the native object that obj is proxying for.- Parameters:
obj- The java proxy object for a native object.- Returns:
- The raw pointer obj is proxying for.
-
getMyCPtr
public long getMyCPtr()
Internal Only. Not part of public API. Get the raw value of the native object that we're proxying for.- Overrides:
getMyCPtrin classRefCounted- Returns:
- The raw pointer we're proxying for.
-
copyReference
public IMetaData copyReference()
Create a new IMetaData object that is actually referring to the exact same underlying native object.- Overrides:
copyReferencein classRefCounted- Returns:
- the new Java object.
-
equals
public boolean equals(java.lang.Object obj)
Compares two values, returning true if the underlying objects in native code are the same object. That means you can have two different Java objects, but when you do a comparison, you'll find out they are the EXACT same object.- Overrides:
equalsin classjava.lang.Object- Returns:
- True if the underlying native object is the same. False otherwise.
-
hashCode
public int hashCode()
Get a hashable value for this object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashable value.
-
toString
public java.lang.String toString()
Return the meta-data, with all values expanded.- Overrides:
toStringin classjava.lang.Object
-
getKeys
public java.util.Collection<java.lang.String> getKeys()
Get the set of keys currently in thisIMediaDataobject as an unordered collection.- Returns:
- the keys.
-
getValue
public java.lang.String getValue(java.lang.String key)
Return the value for this key, comparing case insensitively.- Parameters:
key- the key- Returns:
- the value.
-
getNumKeys
public int getNumKeys()
Get the total number of keys currently in this
{IMetaData} object.
- Returns:
- the number of keys.
-
getValue
public java.lang.String getValue(java.lang.String key, IMetaData.Flags flag)
Get the value for the given key.
- Parameters:
key- The keyflag- A flag for how to search
- Returns:
- The value, or null if none.
-
setValue
public int setValue(java.lang.String key, java.lang.String value)
Sets the value for the given key to value. This overrides
any prior setting for key, or adds key to the meta-data
if appropriate.
- Parameters:
key- The key to set.value- The value to set.
-
setValue
public int setValue(java.lang.String key, java.lang.String value, IMetaData.Flags flag)
Sets the value for the given key to value. This overrides
any prior setting for key, or adds key to the meta-data
if appropriate.
- Parameters:
key- The key to set.value- The value to set.flag- A flag on how this should be set.
- Since:
- 5.0
-
-