libgpac
Documentation of the core library of GPAC
iTunes tagging
+ Collaboration diagram for iTunes tagging:

Data Structures

struct  GF_QT_UDTAKey
 
union  GF_QT_UDTAKey.value
 
struct  _tag_data.value.data
 
struct  _tag_vec2.value.pos_size
 
struct  _tag_rec.value.rect
 

Enumerations

enum  GF_ISOiTunesTag {
  GF_ISOM_ITUNE_PROBE = 0 , GF_ISOM_ITUNE_RESET = 1 , GF_ISOM_ITUNE_NAME = GF_4CC( 0xA9, 'n', 'a', 'm' ) , GF_ISOM_ITUNE_ARTIST = GF_4CC( 0xA9, 'A', 'R', 'T' ) ,
  GF_ISOM_ITUNE_ALBUM_ARTIST = GF_4CC( 'a', 'A', 'R', 'T' ) , GF_ISOM_ITUNE_ALBUM = GF_4CC( 0xA9, 'a', 'l', 'b' ) , GF_ISOM_ITUNE_GROUP = GF_4CC( 0xA9, 'g', 'r', 'p' ) , GF_ISOM_ITUNE_WRITER = GF_4CC( 0xA9, 'w', 'r', 't' ) ,
  GF_ISOM_ITUNE_COMMENT = GF_4CC( 0xA9, 'c', 'm', 't' ) , GF_ISOM_ITUNE_GENRE_USER = GF_4CC( 0xA9, 'g', 'e', 'n') , GF_ISOM_ITUNE_GENRE = GF_4CC( 'g', 'n', 'r', 'e' ) , GF_ISOM_ITUNE_CREATED = GF_4CC( 0xA9, 'd', 'a', 'y' ) ,
  GF_ISOM_ITUNE_TRACKNUMBER = GF_4CC( 't', 'r', 'k', 'n' ) , GF_ISOM_ITUNE_DISK = GF_4CC( 'd', 'i', 's', 'k' ) , GF_ISOM_ITUNE_TEMPO = GF_4CC( 't', 'm', 'p', 'o' ) , GF_ISOM_ITUNE_COMPILATION = GF_4CC( 'c', 'p', 'i', 'l' ) ,
  GF_ISOM_ITUNE_TV_SHOW = GF_4CC( 't', 'v', 's', 'h') , GF_ISOM_ITUNE_TV_EPISODE = GF_4CC( 't', 'v', 'e', 'n') , GF_ISOM_ITUNE_TV_SEASON = GF_4CC( 't', 'v', 's', 'n') , GF_ISOM_ITUNE_TV_EPISODE_NUM = GF_4CC( 't', 'v', 'e', 's') ,
  GF_ISOM_ITUNE_TV_NETWORK = GF_4CC( 't', 'v', 'n', 'n') , GF_ISOM_ITUNE_DESCRIPTION = GF_4CC( 'd', 'e', 's', 'c' ) , GF_ISOM_ITUNE_LONG_DESCRIPTION = GF_4CC( 'l', 'd', 'e', 's') , GF_ISOM_ITUNE_LYRICS = GF_4CC( 0xA9, 'l', 'y', 'r' ) ,
  GF_ISOM_ITUNE_SORT_NAME = GF_4CC( 's', 'o', 'n', 'm' ) , GF_ISOM_ITUNE_SORT_ARTIST = GF_4CC( 's', 'o', 'a', 'r' ) , GF_ISOM_ITUNE_SORT_ALB_ARTIST = GF_4CC( 's', 'o', 'a', 'a' ) , GF_ISOM_ITUNE_SORT_ALBUM = GF_4CC( 's', 'o', 'a', 'l' ) ,
  GF_ISOM_ITUNE_SORT_COMPOSER = GF_4CC( 's', 'o', 'c', 'o' ) , GF_ISOM_ITUNE_SORT_SHOW = GF_4CC( 's', 'o', 's', 'n' ) , GF_ISOM_ITUNE_COVER_ART = GF_4CC( 'c', 'o', 'v', 'r' ) , GF_ISOM_ITUNE_COPYRIGHT = GF_4CC( 'c', 'p', 'r', 't' ) ,
  GF_ISOM_ITUNE_TOOL = GF_4CC( 0xA9, 't', 'o', 'o' ) , GF_ISOM_ITUNE_ENCODER = GF_4CC( 0xA9, 'e', 'n', 'c' ) , GF_ISOM_ITUNE_PURCHASE_DATE = GF_4CC( 'p', 'u', 'r', 'd' ) , GF_ISOM_ITUNE_PODCAST = GF_4CC( 'p', 'c', 's', 't' ) ,
  GF_ISOM_ITUNE_PODCAST_URL = GF_4CC( 'p', 'u', 'r', 'l' ) , GF_ISOM_ITUNE_KEYWORDS = GF_4CC( 'k', 'y', 'y', 'w') , GF_ISOM_ITUNE_CATEGORY = GF_4CC( 'c', 'a', 't', 'g') , GF_ISOM_ITUNE_HD_VIDEO = GF_4CC( 'h', 'd', 'v', 'd') ,
  GF_ISOM_ITUNE_MEDIA_TYPE = GF_4CC( 's', 't', 'i', 'k') , GF_ISOM_ITUNE_RATING = GF_4CC( 'r', 't', 'n', 'g') , GF_ISOM_ITUNE_GAPLESS = GF_4CC( 'p', 'g', 'a', 'p' ) , GF_ISOM_ITUNE_COMPOSER = GF_4CC( 0xA9, 'c', 'o', 'm' ) ,
  GF_ISOM_ITUNE_TRACK = GF_4CC( 0xA9, 't', 'r', 'k' ) , GF_ISOM_ITUNE_CONDUCTOR = GF_4CC( 0xA9, 'c', 'o', 'n' ) , GF_ISOM_ITUNE_ART_DIRECTOR = GF_4CC( 0xA9, 'a', 'r', 'd' ) , GF_ISOM_ITUNE_ARRANGER = GF_4CC( 0xA9, 'a', 'r', 'g' ) ,
  GF_ISOM_ITUNE_LYRICIST = GF_4CC( 0xA9, 'a', 'u', 't' ) , GF_ISOM_ITUNE_COPY_ACK = GF_4CC( 0xA9, 'c', 'a', 'k' ) , GF_ISOM_ITUNE_SONG_DESC = GF_4CC( 0xA9, 'd', 'e', 's' ) , GF_ISOM_ITUNE_DIRECTOR = GF_4CC( 0xA9, 'd', 'i', 'r' ) ,
  GF_ISOM_ITUNE_EQ_PRESET = GF_4CC( 0xA9, 'e', 'q', 'u' ) , GF_ISOM_ITUNE_LINER_NOTES = GF_4CC( 0xA9, 'l', 'n', 't' ) , GF_ISOM_ITUNE_REC_COMPANY = GF_4CC( 0xA9, 'm', 'a', 'k' ) , GF_ISOM_ITUNE_ORIG_ARTIST = GF_4CC( 0xA9, 'o', 'p', 'e' ) ,
  GF_ISOM_ITUNE_PHONO_RIGHTS = GF_4CC( 0xA9, 'p', 'h', 'g' ) , GF_ISOM_ITUNE_PRODUCER = GF_4CC( 0xA9, 'p', 'r', 'd' ) , GF_ISOM_ITUNE_PERFORMER = GF_4CC( 0xA9, 'p', 'r', 'f' ) , GF_ISOM_ITUNE_PUBLISHER = GF_4CC( 0xA9, 'p', 'u', 'b' ) ,
  GF_ISOM_ITUNE_SOUND_ENG = GF_4CC( 0xA9, 's', 'n', 'e' ) , GF_ISOM_ITUNE_SOLOIST = GF_4CC( 0xA9, 's', 'o', 'l' ) , GF_ISOM_ITUNE_CREDITS = GF_4CC( 0xA9, 's', 'r', 'c' ) , GF_ISOM_ITUNE_THANKS = GF_4CC( 0xA9, 't', 'h', 'x' ) ,
  GF_ISOM_ITUNE_ONLINE = GF_4CC( 0xA9, 'u', 'r', 'l' ) , GF_ISOM_ITUNE_EXEC_PRODUCER = GF_4CC( 0xA9, 'x', 'p', 'd' ) , GF_ISOM_ITUNE_LOCATION = GF_4CC( 0xA9, 'x', 'y', 'z' ) , GF_ISOM_ITUNE_ITUNES_DATA = GF_4CC( '-', '-', '-', '-' )
}
 
enum  GF_QTKeyType {
  GF_QT_KEY_OPAQUE =0 , GF_QT_KEY_UTF8 =1 , GF_QT_KEY_UTF16_BE =2 , GF_QT_KEY_JIS =3 ,
  GF_QT_KEY_UTF8_SORT =4 , GF_QT_KEY_UTF16_SORT =5 , GF_QT_KEY_JPEG =13 , GF_QT_KEY_PNG =14 ,
  GF_QT_KEY_SIGNED_VSIZE =21 , GF_QT_KEY_UNSIGNED_VSIZE =22 , GF_QT_KEY_FLOAT =23 , GF_QT_KEY_DOUBLE =24 ,
  GF_QT_KEY_BMP =27 , GF_QT_KEY_METABOX =28 , GF_QT_KEY_SIGNED_8 =65 , GF_QT_KEY_SIGNED_16 =66 ,
  GF_QT_KEY_SIGNED_32 =67 , GF_QT_KEY_POINTF =70 , GF_QT_KEY_SIZEF =71 , GF_QT_KEY_RECTF =72 ,
  GF_QT_KEY_SIGNED_64 =74 , GF_QT_KEY_UNSIGNED_8 =75 , GF_QT_KEY_UNSIGNED_16 =76 , GF_QT_KEY_UNSIGNED_32 =77 ,
  GF_QT_KEY_UNSIGNED_64 =78 , GF_QT_KEY_MATRIXF =79 , GF_QT_KEY_REMOVE =0xFFFFFFFF
}
 

Functions

GF_Err gf_isom_apple_get_tag (GF_ISOFile *isom_file, GF_ISOiTunesTag tag, const u8 **data, u32 *data_len)
 
GF_Err gf_isom_apple_enum_tag (GF_ISOFile *isom_file, u32 idx, GF_ISOiTunesTag *out_tag, const u8 **data, u32 *data_len, u64 *out_int_val, u32 *out_int_val2, u32 *out_flags)
 
GF_Err gf_isom_wma_enum_tag (GF_ISOFile *isom_file, u32 idx, char **out_tag, const u8 **data, u32 *data_len, u32 *version, u32 *data_type)
 
GF_Err gf_isom_enum_udta_keys (GF_ISOFile *isom_file, u32 idx, GF_QT_UDTAKey *out_key)
 
GF_Err gf_isom_apple_set_tag (GF_ISOFile *isom_file, GF_ISOiTunesTag tag, const u8 *data, u32 data_len, u64 int_val, u32 int_val2)
 
GF_Err gf_isom_wma_set_tag (GF_ISOFile *isom_file, char *name, char *value)
 
GF_Err gf_isom_set_qt_key (GF_ISOFile *isom_file, GF_QT_UDTAKey *key)
 
GF_Err gf_isom_set_ipod_compatible (GF_ISOFile *isom_file, u32 trackNumber)
 

Detailed Description


Data Structure Documentation

◆ GF_QT_UDTAKey

struct GF_QT_UDTAKey

QT userdata key

Data Fields
const char * name

key name

u32 ns

key namespace 4CC

GF_QTKeyType type

key type

union GF_QT_UDTAKey value

◆ GF_QT_UDTAKey.value

union GF_QT_UDTAKey.value
Data Fields
const char * string

UTF-8 string, for GF_QT_KEY_UTF8 and GF_QT_KEY_UTF8_SORT

value data
u64 uint

unsigned integer value

s64 sint

signed integer value

Double number

number value for GF_QT_KEY_FLOAT and GF_QT_KEY_DOUBLE

value pos_size
value rect
Double matrix[9]

2x3 matrix

◆ GF_QT_UDTAKey::_tag_data.value.data

struct GF_QT_UDTAKey::_tag_data.value.data

data, for unsupported types, image types, UTF16 types and metabox

Data Fields
const u8 * data

data

u32 data_len

size

◆ GF_QT_UDTAKey::_tag_vec2.value.pos_size

struct GF_QT_UDTAKey::_tag_vec2.value.pos_size

2D float value, for GF_QT_KEY_POINTF and GF_QT_KEY_SIZEFF

Data Fields
Float x

x-coord

Float y

y-coord

◆ GF_QT_UDTAKey::_tag_rec.value.rect

struct GF_QT_UDTAKey::_tag_rec.value.rect

4D value, for GF_QT_KEY_RECTF

Data Fields
Float x

x-coord

Float y

y-coord

Float w

width

Float h

height

Enumeration Type Documentation

◆ GF_ISOiTunesTag

iTunes info tags

◆ GF_QTKeyType

QT key types

Function Documentation

◆ gf_isom_apple_get_tag()

GF_Err gf_isom_apple_get_tag ( GF_ISOFile isom_file,
GF_ISOiTunesTag  tag,
const u8 **  data,
u32 data_len 
)

gets the given itunes tag info.

Warning
'genre' may be coded by ID, the libisomedia doesn't translate the ID. In such a case, the result data is set to NULL and the data_len to the genre ID
Parameters
isom_filethe target ISO file
tagthe tag to query
dataset to the tag data pointer - do not modify
data_lenset to the size of the tag data
Returns
error if any (GF_URL_ERROR if no tag is present in the file)

◆ gf_isom_apple_enum_tag()

GF_Err gf_isom_apple_enum_tag ( GF_ISOFile isom_file,
u32  idx,
GF_ISOiTunesTag out_tag,
const u8 **  data,
u32 data_len,
u64 out_int_val,
u32 out_int_val2,
u32 out_flags 
)

enumerate itunes tags.

Parameters
isom_filethe target ISO file
idx0-based index of the tag to get
out_tagset to the tag code
dataset to the tag data pointer - do not modify
data_lenset to the size of the tag data. Data is set to NULL and data_size to 1 if the associated tag has no data
out_int_valset to the int/bool/frac numerator type for known tags, in which case data is set to NULL
out_int_val2set to the frac denominator for known tags, in which case data is set to NULL
out_flagsset to the flags value of the data container box
Returns
error if any (GF_URL_ERROR if no more tags)

◆ gf_isom_wma_enum_tag()

GF_Err gf_isom_wma_enum_tag ( GF_ISOFile isom_file,
u32  idx,
char **  out_tag,
const u8 **  data,
u32 data_len,
u32 version,
u32 data_type 
)

enumerate WMA tags.

Parameters
isom_filethe target ISO file
idx0-based index of the tag to get
out_tagset to the tag name
dataset to the tag data pointer - do not modify
data_lenset to the size of the tag data
versionset to the WMA tag version
data_typeset to the WMA data type
Returns
error if any (GF_URL_ERROR if no more tags)

◆ gf_isom_enum_udta_keys()

GF_Err gf_isom_enum_udta_keys ( GF_ISOFile isom_file,
u32  idx,
GF_QT_UDTAKey out_key 
)

enumerate QT keys tags.

Parameters
isom_filethe target ISO file
idx0-based index of the tag to get
out_keykey to be filled with key at given index
Returns
error if any (GF_URL_ERROR if no more tags)

◆ gf_isom_apple_set_tag()

GF_Err gf_isom_apple_set_tag ( GF_ISOFile isom_file,
GF_ISOiTunesTag  tag,
const u8 data,
u32  data_len,
u64  int_val,
u32  int_val2 
)

sets the given tag info.

Parameters
isom_filethe target ISO file
tagthe tag to set
datatag data buffer or string to parse
data_lensize of the tag data buffer. If data is NULL and and data_len not 0, removes the given tag
int_valvalue for integer/boolean tags. If data and data_len are set, parse data as string to get the value
int_val2value for fractional tags. If data and data_len are set, parse data as string to get the value
Returns
error if any

◆ gf_isom_wma_set_tag()

GF_Err gf_isom_wma_set_tag ( GF_ISOFile isom_file,
char *  name,
char *  value 
)

sets the given WMA tag info (only string tags are supported).

Parameters
isom_filethe target ISO file
namename of the tag to set
valuestring value to set
Returns
error if any

◆ gf_isom_set_qt_key()

GF_Err gf_isom_set_qt_key ( GF_ISOFile isom_file,
GF_QT_UDTAKey key 
)

sets key (QT style metadata)

Parameters
isom_filethe target ISO file
keythe key to use. if NULL, removes ALL keys
Returns
error if any

◆ gf_isom_set_ipod_compatible()

GF_Err gf_isom_set_ipod_compatible ( GF_ISOFile isom_file,
u32  trackNumber 
)

sets compatibility tag on AVC tracks (needed by iPod to play files... hurray for standards)

Parameters
isom_filethe target ISO file
trackNumberthe target track
Returns
error if any