Class 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 class  IMetaData.Flags
      Different types of flags that can be passed to {IMetaData#getValue}
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected IMetaData​(long cPtr, boolean cMemoryOwn)
      Internal Only.
      protected IMetaData​(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)
      Internal Only.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IMetaData copyReference()
      Create a new IMetaData object that is actually referring to the exact same underlying native object.
      boolean equals​(java.lang.Object obj)
      Compares two values, returning true if the underlying objects in native code are the same object.
      static long getCPtr​(IMetaData obj)
      Internal Only.
      java.util.Collection<java.lang.String> getKeys()
      Get the set of keys currently in this IMediaData object as an unordered collection.
      long getMyCPtr()
      Internal Only.
      int getNumKeys()
      Get the total number of keys currently in this
      {IMetaData} object.

      java.lang.String getValue​(java.lang.String key)
      Return the value for this key, comparing case insensitively.
      java.lang.String getValue​(java.lang.String key, IMetaData.Flags flag)
      Get the value for the given key.

      int hashCode()
      Get a hashable value for this object.
      static IMetaData make()
      Create a new {IMetaData} bag of properties with
      no values set.
      int setValue​(java.lang.String key, java.lang.String value)
      Sets the value for the given key to value.
      int setValue​(java.lang.String key, java.lang.String value, IMetaData.Flags flag)
      Sets the value for the given key to value.
      java.lang.String toString()
      Return the meta-data, with all values expanded.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IMetaData

        protected IMetaData​(long cPtr,
                            boolean cMemoryOwn)
        Internal Only.
      • IMetaData

        protected IMetaData​(long cPtr,
                            boolean cMemoryOwn,
                            java.util.concurrent.atomic.AtomicLong ref)
        Internal Only.
    • 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:
        getMyCPtr in class RefCounted
        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:
        copyReference in class RefCounted
        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:
        equals in class java.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:
        hashCode in class java.lang.Object
        Returns:
        the hashable value.
      • toString

        public java.lang.String toString()
        Return the meta-data, with all values expanded.
        Overrides:
        toString in class java.lang.Object
      • getKeys

        public java.util.Collection<java.lang.String> getKeys()
        Get the set of keys currently in this IMediaData object 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 key
        flag - 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.
      • make

        public static IMetaData make()
        Create a new {IMetaData} bag of properties with
        no values 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