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

Functions

u8gf_isom_sample_get_subsamples_buffer (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, u32 *osize)
 
u32 gf_isom_sample_has_subsamples (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, u32 flags)
 
GF_Err gf_isom_sample_get_subsample (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, u32 flags, u32 subSampleNumber, u32 *size, u8 *priority, u32 *reserved, Bool *discardable)
 
GF_Err gf_isom_add_subsample (GF_ISOFile *isom_file, u32 trackNumber, u32 sampleNumber, u32 flags, u32 subSampleSize, u8 priority, u32 reserved, Bool discardable)
 
GF_Err gf_isom_fragment_add_subsample (GF_ISOFile *isom_file, GF_ISOTrackID TrackID, u32 flags, u32 subSampleSize, u8 priority, u32 reserved, Bool discardable)
 

Detailed Description

Function Documentation

◆ gf_isom_sample_get_subsamples_buffer()

u8* gf_isom_sample_get_subsamples_buffer ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleNumber,
u32 osize 
)

gets serialized subsample info for the sample The buffer is formatted as N times [(u32)flags(u32)sub_size(u32)codec_param(u8)priority(u8) discardable] If several subsample info are present, they are gathered by flags

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleNumberthe target sample number
osizeset to output buffer size
Returns
the serialized buffer, or NULL oif no associated subsample

◆ gf_isom_sample_has_subsamples()

u32 gf_isom_sample_has_subsamples ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleNumber,
u32  flags 
)

checks if a sample has subsample information

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleNumberthe target sample number. Set to 0 to check for presence of subsample info (will return 1 or 0 in this case)
flagsthe subsample flags to query (may be 0)
Returns
the number of subsamples in the given sample for the given flags

◆ gf_isom_sample_get_subsample()

GF_Err gf_isom_sample_get_subsample ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleNumber,
u32  flags,
u32  subSampleNumber,
u32 size,
u8 priority,
u32 reserved,
Bool discardable 
)

gets subsample information on a sample

Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleNumberthe target sample number
flagsthe subsample flags to query (may be 0)
subSampleNumberthe 1-based index of the subsample (see gf_isom_sample_has_subsamples)
sizeset to the subsample size
priorityset to the subsample priority
reservedset to the subsample reserved value (may be used by derived specifications)
discardableset to GF_TRUE if subsample is discardable
Returns
error if any

◆ gf_isom_add_subsample()

GF_Err gf_isom_add_subsample ( GF_ISOFile isom_file,
u32  trackNumber,
u32  sampleNumber,
u32  flags,
u32  subSampleSize,
u8  priority,
u32  reserved,
Bool  discardable 
)

adds subsample information to a given sample. Subsample information shall be added in increasing order of sampleNumbers, insertion of information is not supported

Note
it is possible to add subsample information for samples not yet added to the file
specifying 0 as subSampleSize will remove the last subsample information if any
Parameters
isom_filethe target ISO file
trackNumberthe target track
sampleNumberthe target sample number
flagsthe subsample flags to query (may be 0)
subSampleSizesize of the subsample. If 0, this will remove the last subsample information if any
prioritythe subsample priority
reservedthe subsample reserved value (may be used by derived specifications)
discardableindicates if the subsample is discardable
Returns
error if any

◆ gf_isom_fragment_add_subsample()

GF_Err gf_isom_fragment_add_subsample ( GF_ISOFile isom_file,
GF_ISOTrackID  TrackID,
u32  flags,
u32  subSampleSize,
u8  priority,
u32  reserved,
Bool  discardable 
)

adds subsample information for the latest sample added to the current track fragment

Parameters
isom_filethe target ISO file
TrackIDthe ID of the target track
flagsthe subsample flags to query (may be 0)
subSampleSizesize of the subsample. If 0, this will remove the last subsample information if any
prioritythe subsample priority
reservedthe subsample reserved value (may be used by derived specifications)
discardableindicates if the subsample is discardable
Returns
error if any