AVPKit
com::avpkit::core::IMetaData Class Referenceabstract

Get MetaData about a IContainer or IStream. More...

#include <IMetaData.h>

Inheritance diagram for com::avpkit::core::IMetaData:
Collaboration diagram for com::avpkit::core::IMetaData:

Public Types

enum  Flags { METADATA_NONE =0 , METADATA_MATCH_CASE =1 , METADATA_DONT_OVERWRITE =16 , META_DATA_APPEND =32 }
 Different types of flags that can be passed to IMetaData#getValue. More...
 

Public Member Functions

virtual int32_t getNumKeys ()=0
 Get the total number of keys currently in this IMetaData object. More...
 
virtual const char * getKey (int32_t position)=0
 Get the key at the given position, or null if no such key at that position. More...
 
virtual const char * getValue (const char *key, Flags flag)=0
 Get the value for the given key. More...
 
virtual int32_t setValue (const char *key, const char *value)=0
 Sets the value for the given key to value. More...
 
virtual int32_t setValue (const char *key, const char *value, Flags flag)=0
 Sets the value for the given key to value. More...
 
- Public Member Functions inherited from com::avpkit::ferry::RefCounted
virtual int32_t acquire ()
 Internal Only. More...
 
virtual int32_t release ()
 Internal Only. More...
 
virtual RefCountedcopyReference ()
 Create a new Java object that refers to the same native object. More...
 
virtual int32_t getCurrentRefCount ()
 Return the current reference count on this object. More...
 
void setJavaAllocator (void *allocator)
 This method is public but not part of the standard API. More...
 
void * getJavaAllocator ()
 This method is public but not part of the standard API. More...
 

Static Public Member Functions

static IMetaDatamake ()
 Create a new IMetaData bag of properties with no values set.
 

Additional Inherited Members

- Protected Member Functions inherited from com::avpkit::ferry::RefCounted
virtual void destroy ()
 This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed.
 
- Protected Attributes inherited from com::avpkit::ferry::RefCounted
AtomicIntegermRefCount
 This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
 
void * mAllocator
 Not part of public API.
 

Detailed Description

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 {} 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.

Definition at line 50 of file IMetaData.h.

Member Enumeration Documentation

◆ Flags

Different types of flags that can be passed to IMetaData#getValue.

Enumerator
METADATA_NONE 

For getValue(String) case-insensitive match of key.

METADATA_MATCH_CASE 

For getValue(String) case-sensitive match of key.

METADATA_DONT_OVERWRITE 

For setValue(String,String,Flags) do not overwrite existing value – append another key/value pair.

META_DATA_APPEND 

For setValue(String,String,Flags) append to the existing value in a key (string append).

Definition at line 56 of file IMetaData.h.

56  {
60  METADATA_NONE=0,
73  } Flags;
Flags
Different types of flags that can be passed to IMetaData#getValue.
Definition: IMetaData.h:56
@ METADATA_DONT_OVERWRITE
For setValue(String,String,Flags) do not overwrite existing value – append another key/value pair.
Definition: IMetaData.h:68
@ METADATA_MATCH_CASE
For getValue(String) case-sensitive match of key.
Definition: IMetaData.h:64
@ METADATA_NONE
For getValue(String) case-insensitive match of key.
Definition: IMetaData.h:60
@ META_DATA_APPEND
For setValue(String,String,Flags) append to the existing value in a key (string append).
Definition: IMetaData.h:72

Member Function Documentation

◆ getKey()

virtual const char* com::avpkit::core::IMetaData::getKey ( int32_t  position)
pure virtual

Get the key at the given position, or null if no such key at that position.

Note: positions of keys may change between calls to setValue(String, String) and should be requiried.

Parameters
positionThe position. Must be >=0 and < getNumKeys().
Returns
the key, or null if not found.

Implemented in com::avpkit::core::MetaData.

◆ getNumKeys()

virtual int32_t com::avpkit::core::IMetaData::getNumKeys ( )
pure virtual

Get the total number of keys currently in this IMetaData object.

Returns
the number of keys.

Implemented in com::avpkit::core::MetaData.

◆ getValue()

virtual const char* com::avpkit::core::IMetaData::getValue ( const char *  key,
Flags  flag 
)
pure virtual

Get the value for the given key.

Parameters
keyThe key
flagA flag for how to search
Returns
The value, or null if none.

Implemented in com::avpkit::core::MetaData.

◆ setValue() [1/2]

virtual int32_t com::avpkit::core::IMetaData::setValue ( const char *  key,
const char *  value 
)
pure virtual

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
keyThe key to set.
valueThe value to set.

Implemented in com::avpkit::core::MetaData.

◆ setValue() [2/2]

virtual int32_t com::avpkit::core::IMetaData::setValue ( const char *  key,
const char *  value,
Flags  flag 
)
pure virtual

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
keyThe key to set.
valueThe value to set.
flagA flag on how this should be set.
Since
5.0

Implemented in com::avpkit::core::MetaData.


The documentation for this class was generated from the following files: