libgpac
Documentation of the core library of GPAC
ISOBMFF MPEG-4 Systems
+ Collaboration diagram for ISOBMFF MPEG-4 Systems:

Enumerations

enum  GF_ISOProfileLevelType {
  GF_ISOM_PL_AUDIO , GF_ISOM_PL_VISUAL , GF_ISOM_PL_GRAPHICS , GF_ISOM_PL_SCENE ,
  GF_ISOM_PL_OD , GF_ISOM_PL_MPEGJ , GF_ISOM_PL_INLINE
}
 

Functions

u32 gf_isom_get_mpeg4_subtype (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex)
 
GF_Descriptorgf_isom_get_root_od (GF_ISOFile *isom_file)
 
void gf_isom_disable_odf_conversion (GF_ISOFile *isom_file, Bool disable)
 
u8 gf_isom_is_track_in_root_od (GF_ISOFile *isom_file, u32 trackNumber)
 
GF_ESDgf_isom_get_esd (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex)
 
GF_DecoderConfiggf_isom_get_decoder_config (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex)
 
void gf_isom_set_default_sync_track (GF_ISOFile *isom_file, u32 trackNumber)
 
u8 gf_isom_get_pl_indication (GF_ISOFile *isom_file, GF_ISOProfileLevelType PL_Code)
 
u32 gf_isom_find_od_id_for_track (GF_ISOFile *isom_file, u32 trackNumber)
 
GF_Err gf_isom_set_pl_indication (GF_ISOFile *isom_file, GF_ISOProfileLevelType PL_Code, u8 ProfileLevel)
 
GF_Err gf_isom_set_root_od_id (GF_ISOFile *isom_file, u32 OD_ID)
 
GF_Err gf_isom_set_root_od_url (GF_ISOFile *isom_file, const char *url_string)
 
GF_Err gf_isom_remove_root_od (GF_ISOFile *isom_file)
 
GF_Err gf_isom_add_desc_to_root_od (GF_ISOFile *isom_file, const GF_Descriptor *theDesc)
 
GF_Err gf_isom_add_track_to_root_od (GF_ISOFile *isom_file, u32 trackNumber)
 
GF_Err gf_isom_remove_track_from_root_od (GF_ISOFile *isom_file, u32 trackNumber)
 
GF_Err gf_isom_new_mpeg4_description (GF_ISOFile *isom_file, u32 trackNumber, const GF_ESD *esd, const char *URLname, const char *URNname, u32 *outDescriptionIndex)
 
GF_Err gf_isom_change_mpeg4_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const GF_ESD *newESD)
 
GF_Err gf_isom_add_desc_to_description (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const GF_Descriptor *theDesc)
 
GF_Err gf_isom_clone_pl_indications (GF_ISOFile *orig_file, GF_ISOFile *dest_file)
 
GF_Err gf_isom_set_extraction_slc (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleDescriptionIndex, const GF_SLConfig *slConfig)
 

Detailed Description

MPEG-4 Systems extensions

Enumeration Type Documentation

◆ GF_ISOProfileLevelType

MPEG-4 ProfileAndLevel codes

Enumerator
GF_ISOM_PL_AUDIO 

Audio PL

GF_ISOM_PL_VISUAL 

Visual PL

GF_ISOM_PL_GRAPHICS 

Graphics PL

GF_ISOM_PL_SCENE 

Scene PL

GF_ISOM_PL_OD 

OD PL

GF_ISOM_PL_MPEGJ 

MPEG-J PL

GF_ISOM_PL_INLINE 

not a profile, just set/unset inlineFlag

Function Documentation

◆ gf_isom_get_mpeg4_subtype()

u32 gf_isom_get_mpeg4_subtype ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex 
)

gets MPEG-4 subtype of a sample description entry (eg, mp4a, mp4v, enca, encv, resv, etc...)

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleDescriptionIndexthe target sample description index (1-based)
Returns
the media type FOUR CHAR code type of an MPEG4 media, or 0 if not MPEG-4 subtype

◆ gf_isom_get_root_od()

GF_Descriptor* gf_isom_get_root_od ( GF_ISOFile isom_file)

fetches the root OD of a file (can be NULL, OD or IOD, you have to check its tag)

Parameters
isom_filethe target ISO file
Returns
the OD/IOD if any. Caller must destroy the descriptor

◆ gf_isom_disable_odf_conversion()

void gf_isom_disable_odf_conversion ( GF_ISOFile isom_file,
Bool  disable 
)

disable OD conversion from ISOM internal to regular OD tags

Parameters
isom_filethe target ISO file
disableif TRUE, ODs and ESDs will not be converted

◆ gf_isom_is_track_in_root_od()

u8 gf_isom_is_track_in_root_od ( GF_ISOFile isom_file,
u32  trackNumber 
)

checks the presence of a track in rood OD/IOD

Parameters
isom_filethe target ISO file
trackNumberthe target track
Returns
0: NO, 1: YES, 2: ERROR

◆ gf_isom_get_esd()

GF_ESD* gf_isom_get_esd ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex 
)

gets the GF_ESD given the sampleDescriptionIndex

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleDescriptionIndexthe target sample description index (1-based)
Returns
the ESD associated to the sample description index, or NULL if error or not supported. Caller must destroy the ESD

◆ gf_isom_get_decoder_config()

GF_DecoderConfig* gf_isom_get_decoder_config ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex 
)

gets the decoderConfigDescriptor given the sampleDescriptionIndex

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleDescriptionIndexthe target sample description index (1-based)
Returns
the decoder configuration descriptor associated to the sample description index, or NULL if error or not supported. Caller must destroy the descriptor

◆ gf_isom_set_default_sync_track()

void gf_isom_set_default_sync_track ( GF_ISOFile isom_file,
u32  trackNumber 
)

sets default TrackID (or ES_ID) for clock references.

Parameters
isom_filethe target ISO file
trackNumberthe target track to set as a clock reference. If 0, default sync track ID is reseted and will be reassigned at next ESD fetch

◆ gf_isom_get_pl_indication()

u8 gf_isom_get_pl_indication ( GF_ISOFile isom_file,
GF_ISOProfileLevelType  PL_Code 
)

gets the profile and level value for MPEG-4 streams

Parameters
isom_filethe target ISO file
PL_Codethe target profile to query file
Returns
the profile and level value, 0xFF if not defined

◆ gf_isom_find_od_id_for_track()

u32 gf_isom_find_od_id_for_track ( GF_ISOFile isom_file,
u32  trackNumber 
)

finds the first ObjectDescriptor using the given track by inspecting all OD tracks

Parameters
isom_filethe target ISO file
trackNumberthe target track
Returns
the OD ID if dound, 0 otherwise

◆ gf_isom_set_pl_indication()

GF_Err gf_isom_set_pl_indication ( GF_ISOFile isom_file,
GF_ISOProfileLevelType  PL_Code,
u8  ProfileLevel 
)

sets a profile and level indication for the movie iod (created if needed)

Note
Use for MPEG-4 Systems only if the flag is ProfileLevel is 0 this means the movie doesn't require the specific codec (equivalent to 0xFF value in MPEG profiles)
Parameters
isom_filethe target ISO file
PL_Codethe profile and level code to set
ProfileLevelthe profile and level value to set
Returns
error if any

◆ gf_isom_set_root_od_id()

GF_Err gf_isom_set_root_od_id ( GF_ISOFile isom_file,
u32  OD_ID 
)

sets the rootOD ID of the movie if you need it. By default, movies are created without root ODs

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
OD_IDID to assign to the root OD/IOD
Returns
error if any

◆ gf_isom_set_root_od_url()

GF_Err gf_isom_set_root_od_url ( GF_ISOFile isom_file,
const char *  url_string 
)

sets the rootOD URL of the movie if you need it (only needed to create an empty file pointing to external resource)

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
url_stringthe URL to assign to the root OD/IOD
Returns
error if any

◆ gf_isom_remove_root_od()

GF_Err gf_isom_remove_root_od ( GF_ISOFile isom_file)

removes the root OD

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
Returns
error if any

◆ gf_isom_add_desc_to_root_od()

GF_Err gf_isom_add_desc_to_root_od ( GF_ISOFile isom_file,
const GF_Descriptor theDesc 
)

adds a system descriptor to the OD of the movie

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
theDescthe descriptor to add
Returns
error if any

◆ gf_isom_add_track_to_root_od()

GF_Err gf_isom_add_track_to_root_od ( GF_ISOFile isom_file,
u32  trackNumber 
)

adds a track to the root OD

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
trackNumberthe track to add to the root OD
Returns
error if any

◆ gf_isom_remove_track_from_root_od()

GF_Err gf_isom_remove_track_from_root_od ( GF_ISOFile isom_file,
u32  trackNumber 
)

removes a track to the root OD

Note
Use for MPEG-4 Systems only
Parameters
isom_filethe target ISO file
trackNumberthe track to remove from the root OD
Returns
error if any

◆ gf_isom_new_mpeg4_description()

GF_Err gf_isom_new_mpeg4_description ( GF_ISOFile isom_file,
u32  trackNumber,
const GF_ESD esd,
const char *  URLname,
const char *  URNname,
u32 outDescriptionIndex 
)

creates a new MPEG-4 sample description in a track

Note
Used for MPEG-4 Systems, AAC and MPEG-4 Visual (part 2)
Parameters
isom_filethe target ISO file
trackNumberthe target track number
esdthe ESD to use for that sample description
URLnameURL value of the data reference, NULL if no data reference (media in the file)
URNnameURN value of the data reference, NULL if no data reference (media in the file)
outDescriptionIndexset to index of the new sample description
Returns
error if any

◆ gf_isom_change_mpeg4_description()

GF_Err gf_isom_change_mpeg4_description ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex,
const GF_ESD newESD 
)

changes an MPEG-4 sample description

Note
Used for MPEG-4 Systems, AAC and MPEG-4 Visual (part 2)
Warning
This will replace the whole ESD
Parameters
isom_filethe target ISO file
trackNumberthe target track number
sampleDescriptionIndexthe target sample description
newESDthe new ESD to use for that sample description
Returns
error if any

◆ gf_isom_add_desc_to_description()

GF_Err gf_isom_add_desc_to_description ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex,
const GF_Descriptor theDesc 
)

adds an MPEG-4 systems descriptor to the ESD of a sample description

Note
Used for MPEG-4 Systems, AAC and MPEG-4 Visual (part 2)
Warning
This will replace the whole ESD
Parameters
isom_filethe target ISO file
trackNumberthe target track number
sampleDescriptionIndexthe target sample description
theDescthe descriptor to add to the ESD of the sample description
Returns
error if any

◆ gf_isom_clone_pl_indications()

GF_Err gf_isom_clone_pl_indications ( GF_ISOFile orig_file,
GF_ISOFile dest_file 
)

clones IOD PLs from orig to dest if any

Parameters
orig_filethe source ISO file
dest_filethe destination ISO file
Returns
error if any

◆ gf_isom_set_extraction_slc()

GF_Err gf_isom_set_extraction_slc ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleDescriptionIndex,
const GF_SLConfig slConfig 
)

associates a given SL config with a given ESD while extracting the OD information This is useful while reading the IOD / OD stream of an MP4 file. Note however that only full AUs are extracted, therefore the calling application must SL-packetize the streams

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleDescriptionIndexset to the sample description index corresponding to this sample (optional, can be NULL)
slConfigthe SL configuration descriptor to set. The descriptor is copied by the API for further use. A NULL pointer will result in using the default SLConfig (predefined = 2) remapped to predefined = 0
Returns
error if any