Functions to operate with ISOMedia/MP4Media objects. More...
Functions | |
MP4Err | MP4AddMediaDataReference (MP4Media theMedia, u32 *outReferenceIndex, MP4Handle urlHandle, MP4Handle urnHandle) |
Use this to add a data reference to a media container. | |
MP4Err | MP4AddMediaSampleReference (MP4Media media, u64 dataOffset, u32 sampleCount, MP4Handle durationsH, MP4Handle sizesH, MP4Handle sampleEntryH, MP4Handle decodingOffsetsH, MP4Handle syncSamplesH) |
Use this function to add samples to a media by reference. | |
MP4Err | MP4AddMediaSamples (MP4Media media, MP4Handle sampleH, u32 sampleCount, MP4Handle durationsH, MP4Handle sizesH, MP4Handle sampleEntryH, MP4Handle decodingOffsetsH, MP4Handle syncSamplesH) |
Use this function to samples to the media. | |
MP4Err | MP4AddMediaSampleReferencePad (MP4Media media, u64 dataOffset, u32 sampleCount, MP4Handle durationsH, MP4Handle sizesH, MP4Handle sampleEntryH, MP4Handle decodingOffsetsH, MP4Handle syncSamplesH, MP4Handle padsH) |
Add media samples by reference with padding bits. | |
MP4Err | MP4AddMediaSamplesPad (MP4Media media, MP4Handle sampleH, u32 sampleCount, MP4Handle durationsH, MP4Handle sizesH, MP4Handle sampleEntryH, MP4Handle decodingOffsetsH, MP4Handle syncSamplesH, MP4Handle padsH) |
Add media samples with padding bits. | |
MP4Err | ISOAddGroupDescription (MP4Media media, u32 groupType, MP4Handle description, u32 *index) |
Adds a Sample Group Description to the indicated media. | |
MP4Err | ISOGetGroupDescription (MP4Media media, u32 groupType, u32 index, MP4Handle description) |
Returns in the handle ‘description’ the group description associated with the given group index of the given group type. | |
MP4Err | ISOGetGroupDescriptionEntryCount (MP4Media media, u32 groupType, u32 *outEntryCount) |
Returns the entry_count of the desired SampleGroupDescriptionBox of the given type. | |
MP4Err | ISOSetSamplestoGroupType (MP4Media media, sampleToGroupType_t sampleToGroupType) |
Set the SampleToGroup mapping type. | |
MP4Err | ISOMapSamplestoGroup (MP4Media media, u32 groupType, u32 group_index, s32 sample_index, u32 count) |
Maps a set of samples to a group of a given type. | |
MP4Err | ISOGetSampletoGroupMap (MP4Media media, u32 groupType, u32 sample_number, u32 *group_index) |
Returns in group_index the group index associated with the given sample number of the given group type. | |
MP4Err | ISOGetSampleGroupSampleNumbers (MP4Media media, u32 groupType, u32 group_index, u32 **outSampleNubers, u32 *outSampleCnt) |
Get all sample numbers associated with the given group type and index of the description. | |
MP4Err | ISOSetSampleDependency (MP4Media media, s32 sample_index, MP4Handle dependencies) |
Sets the sample dependency of a set of samples, after having added the samples. | |
MP4Err | ISOGetSampleDependency (MP4Media media, s32 sample_index, u8 *dependency) |
Returns in dependency the sample dependency associated with the given sample number. | |
MP4Err | MP4BeginMediaEdits (MP4Media theMedia) |
Use this function to prepare the media before adding samples. | |
MP4Err | MP4CheckMediaDataReferences (MP4Media theMedia) |
Tests all data references in the media to ensure that the references exist and are readable. | |
MP4Err | MP4EndMediaEdits (MP4Media theMedia) |
Call this function when you have finished adding samples to the media. | |
MP4Err | MP4GetIndMediaSampleWithPad (MP4Media theMedia, u32 sampleNumber, MP4Handle outSample, u32 *outSize, u64 *outDTS, s32 *outCTSOffset, u64 *outDuration, u32 *outSampleFlags, u32 *outSampleDescIndex, u8 *outPad) |
Returns a sample with padding bits from the media, given the sample's index. | |
MP4Err | MP4GetIndMediaSample (MP4Media theMedia, u32 sampleNumber, MP4Handle outSample, u32 *outSize, u64 *outDTS, s32 *outCTSOffset, u64 *outDuration, u32 *outSampleFlags, u32 *outSampleDescIndex) |
Returns a sample from the media, given the sample's index. | |
MP4Err | MP4GetIndMediaSampleReference (MP4Media theMedia, u32 sampleNumber, u32 *outOffset, u32 *outSize, u32 *outDuration, u32 *outSampleFlags, u32 *outSampleDescIndex, MP4Handle sampleDesc) |
Returns a reference (offset and size) for the sample from the media, given the sample's index. | |
MP4Err | MP4GetMediaDataRefCount (MP4Media theMedia, u32 *outCount) |
Returns the number of data references. | |
MP4Err | MP4UseSignedCompositionTimeOffsets (MP4Media media) |
Sets the version of the MP4CompositionOffsetAtom to 1. | |
MP4Err | MP4GetMediaDataReference (MP4Media theMedia, u32 index, MP4Handle referenceURL, MP4Handle referenceURN, u32 *outReferenceType, u32 *outReferenceAttributes) |
Use this to get information about a specific data reference to a media container. | |
MP4Err | MP4GetMediaDuration (MP4Media theMedia, u64 *outDuration) |
Get the total duration of the media, expressed in the media’s time scale. | |
MP4Err | MP4GetMediaHandlerDescription (MP4Media theMedia, u32 *outType, MP4Handle *outName) |
This function can be used to obtain the media type. | |
MP4Err | MP4GetMediaLanguage (MP4Media theMedia, char *outThreeCharCode) |
Returns the ISO 639-2/T three character language code associated with the media. | |
MP4Err | MP4GetMediaExtendedLanguageTag (MP4Media theMedia, char **extended_language) |
Returns the extended language, based on RFC 4646 (Best Common Practices – BCP – 47) industry standard. | |
MP4Err | MP4GetMediaNextInterestingTime (MP4Media theMedia, u32 interestingTimeFlags, u64 searchFromTime, u32 searchDirection, u64 *outInterestingTime, u64 *outInterestingDuration) |
Search for interesging time. | |
MP4Err | MP4GetMediaSample (MP4Media theMedia, MP4Handle outSample, u32 *outSize, u64 desiredDecodingTime, u64 *outDecodingTime, u64 *outCompositionTime, u64 *outDuration, MP4Handle outSampleDescription, u32 *outSampleDescriptionIndex, u32 *outSampleFlags) |
Returns a closest sample from the media, given the desired decoding time. | |
MP4Err | MP4GetMediaSampleWithPad (MP4Media theMedia, MP4Handle outSample, u32 *outSize, u64 desiredDecodingTime, u64 *outDecodingTime, u64 *outCompositionTime, u64 *outDuration, MP4Handle outSampleDescription, u32 *outSampleDescriptionIndex, u32 *outSampleFlags, u8 *outPad) |
Returns a closest sample with padding bits, given the desired decoding time. | |
MP4Err | MP4GetMediaSampleCount (MP4Media theMedia, u32 *outCount) |
Use this to determine the total number of samples contained in the media. | |
MP4Err | MP4GetMediaTimeScale (MP4Media theMedia, u32 *outTimeScale) |
Returns the time scale associated with the media. | |
MP4Err | MP4GetMediaTrack (MP4Media theMedia, MP4Track *outTrack) |
Returns the track that is associated with this media. | |
MP4Err | MP4MediaTimeToSampleNum (MP4Media theMedia, u64 mediaTime, u32 *outSampleNum, u64 *outSampleCTS, u64 *outSampleDTS, s32 *outSampleDuration) |
Use this to obtain the sample number for a sample with the given decoding time. | |
MP4Err | MP4SampleNumToMediaTime (MP4Media theMedia, u32 sampleNum, u64 *outSampleCTS, u64 *outSampleDTS, s32 *outSampleDuration) |
Use this to obtain the decoding and composition times for a particular media sample. | |
MP4Err | MP4SetMediaLanguage (MP4Media theMedia, char *threeCharCode) |
Use this to indicate the ISO 639-2/T three character language code that is to be associated with the media. | |
MP4Err | MP4SetMediaExtendedLanguageTag (MP4Media theMedia, char *extended_language) |
The extended language tag box represents media language information, based on RFC 4646 (Best Common Practices – BCP – 47) industry standard. | |
MP4Err | ISOSetSampleSizeField (MP4Media theMedia, u32 fieldsize) |
Use this to set the size of samplesize entries in the sample size table. | |
MP4Err | MP4GetElementaryStreamPacket (MP4Media theMedia, MP4Handle outSample, u32 *outSize, u32 sequenceNumber, u64 desiredTime, u64 *outActualTime, u64 *outDuration) |
MP4Err | MP4GetMediaDecoderConfig (MP4Media theMedia, u32 sampleDescIndex, MP4Handle decoderConfigH) |
Use this to obtain the decoder configuration descriptor for a given sample description. | |
MP4Err | MP4GetMediaDecoderInformation (MP4Media theMedia, u32 sampleDescIndex, u32 *outObjectType, u32 *outStreamType, u32 *outBufferSize, u32 *outUpstream, u32 *outMaxBitrate, u32 *outAvgBitrate, MP4Handle specificInfoH) |
Obtain the complete decoder configuration and specific info without having to parse the decoder config descriptor. | |
MP4Err | MP4GetMediaDecoderType (MP4Media theMedia, u32 sampleDescIndex, u32 *outObjectType, u32 *outStreamType, u32 *outBufferSize, MP4Handle specificInfoH) |
Use this to obtain the decoder configuration and specific info without having to parse the decoder config descriptor. | |
MP4Err | MP4CheckMediaDataRef (MP4Media theMedia, u32 dataEntryIndex) |
Tests a specific data reference in the media to ensure that the reference exists and is readable. | |
Functions to operate with ISOMedia/MP4Media objects.
Adds a Sample Group Description to the indicated media.
media | input media object |
groupType | grouping_type of the SampleGroupDescriptionBox |
description | SampleGroupDescriptionEntry pre-serialized (big-endian) group description |
index | output index of the added group |
Returns in the handle ‘description’ the group description associated with the given group index of the given group type.
media | media object where to look for the specific group description |
groupType | grouping_type |
index | index starting with 1 |
description | output handle holding the SampleGroupDescriptionEntry |
Returns the entry_count of the desired SampleGroupDescriptionBox of the given type.
media | media object where to look for the specific group description |
groupType | grouping_type of 'sgpd' |
outEntryCount | entry_count output |
Returns in dependency the sample dependency associated with the given sample number.
media | input media object |
sample_index | index of the sample |
dependency | output dependency byte as defined in SampleDependencyTypeBox |
MP4Err ISOGetSampleGroupSampleNumbers | ( | MP4Media | media, |
u32 | groupType, | ||
u32 | group_index, | ||
u32 ** | outSampleNubers, | ||
u32 * | outSampleCnt | ||
) |
Get all sample numbers associated with the given group type and index of the description.
media | input media object |
groupType | grouping_type of the sample group |
group_index | group description index |
outSampleNubers | output array containing all sample numbers |
outSampleCnt | output number of samples (size of outSampleNubers) |
MP4Err ISOGetSampletoGroupMap | ( | MP4Media | media, |
u32 | groupType, | ||
u32 | sample_number, | ||
u32 * | group_index | ||
) |
Returns in group_index the group index associated with the given sample number of the given group type.
media | input media object |
groupType | grouping_type of the sample group |
sample_number | input sample number |
group_index | output group description index |
MP4Err ISOMapSamplestoGroup | ( | MP4Media | media, |
u32 | groupType, | ||
u32 | group_index, | ||
s32 | sample_index, | ||
u32 | count | ||
) |
Maps a set of samples to a group of a given type.
sample_index can also be negative. For example, a sample_index of -2 and a count of 2 sets the mapping for the last two samples. If movie fragments are in use, the sample index is relative to the current fragment (and cannot be outside it), not the whole movie.
media | input media object |
groupType | grouping_type of the sample group |
group_index | either 0 (to map samples to no group of this type) or an index value obtained using ISOAddGroupDescription() |
sample_index | the first sample index to map. If it is zero or positive, it is the sample at that offset from the first sample in the media. If it is negative, it is at that offset from the last sample in the media. |
count | the number of samples for which to set the mapping |
Sets the sample dependency of a set of samples, after having added the samples.
media | input media object |
sample_index | the first same index as in ISOMapSamplestoGroup() |
dependencies | The handle contains a set of one-byte values each made from OR-ing together the at most one from each pair of the sample dependency constants (does_depend_on, does_not_depend_on, is_depended_on, is_not_depended_on, has_redundancy, etc.) |
Use this to set the size of samplesize entries in the sample size table.
The default value is 32, which gives the ‘old’ sample size table. Values of 4, 8, or 16 (the size in bits of the field) may be given, to request the ‘compact’ sample size table.
MP4Err ISOSetSamplestoGroupType | ( | MP4Media | media, |
sampleToGroupType_t | sampleToGroupType | ||
) |
Set the SampleToGroup mapping type.
media | media object |
sampleToGroupType | choose between SAMPLE_GROUP_NORMAL ('sbgp' default), SAMPLE_GROUP_COMPACT ('csgp') or SAMPLE_GROUP_AUTO (decide automatically, smaller size wins) |
MP4Err MP4AddMediaDataReference | ( | MP4Media | theMedia, |
u32 * | outReferenceIndex, | ||
MP4Handle | urlHandle, | ||
MP4Handle | urnHandle | ||
) |
Use this to add a data reference to a media container.
The data reference specifies a location for media samples. The outReferenceIndex parameter is updated to contain the index for the new reference. (You will need to use this index to create a sample description that will point to this new data reference.)
theMedia | input media object |
outReferenceIndex | output the index for the new reference |
urlHandle | UTF-8 encoded file:// URL that indicates the file containing the samples. Set this to NULL to indicate that the samples are in the movie’s file. |
urnHandle | UTF-8 encoded URN. This may be used in addition to urlHandle to indicate the uniform resource name associated with this media file. If no URN is used, set urnHandle to NULL |
MP4Err MP4AddMediaSampleReference | ( | MP4Media | media, |
u64 | dataOffset, | ||
u32 | sampleCount, | ||
MP4Handle | durationsH, | ||
MP4Handle | sizesH, | ||
MP4Handle | sampleEntryH, | ||
MP4Handle | decodingOffsetsH, | ||
MP4Handle | syncSamplesH | ||
) |
Use this function to add samples to a media by reference.
This is usually used when the samples are already present in some file, for example when you are making reference to samples contained in an external file.
media | input media object |
dataOffset | The byte offset into the file containing the samples. All samples added in this function are assumed to be contiguous in the file starting at this offset. |
sampleCount | The number of samples to be added in this call. |
durationsH | A handle containing u32[] durations for each sample to be added. If the durations differ you must supply a duration for each sample. If the durations are constant you should only place one entry in this handle. |
sizesH | A handle containing u32[] sizes (in bytes) for each sample to be added. If the sizes differ you must indicate a size for each sample. If the sizes are constant you should only place one entry in this handle. |
sampleEntryH | Contains a sample entry that describes the samples to be added. For MPEG-4, this entry can be created using MP4CreateSampleDescriptionAtom(), or for both MJ2 and MP4 you can supply your own as long as it is formatted according to the appropriate standard. If this handle is set to NULL the previous non-null sample entry will be used. |
decodingOffsetsH | If the media contains separate decoding and composition timestamps you must use this handle to indicate the offset between the composition time and the decoding time for each sample in a u32[]. Note that samples must be added in decoding order. |
syncSamplesH | If all the samples added are sync samples you can set this to NULL. Otherwise, place the one-based indexes of each sync sample into this handle as a u32[]. If none of the samples you are adding is a sync sample this handle will have a size of zero. |
MP4Err MP4AddMediaSampleReferencePad | ( | MP4Media | media, |
u64 | dataOffset, | ||
u32 | sampleCount, | ||
MP4Handle | durationsH, | ||
MP4Handle | sizesH, | ||
MP4Handle | sampleEntryH, | ||
MP4Handle | decodingOffsetsH, | ||
MP4Handle | syncSamplesH, | ||
MP4Handle | padsH | ||
) |
Add media samples by reference with padding bits.
padsH | padding bits. May be NULL, indicating no pad, or may be a handle to an array of padding values (which are 8 bits each). If the array has only one value, then it is used for all the samples. Otherwise, the array should be sampleCount long. |
MP4Err MP4AddMediaSamples | ( | MP4Media | media, |
MP4Handle | sampleH, | ||
u32 | sampleCount, | ||
MP4Handle | durationsH, | ||
MP4Handle | sizesH, | ||
MP4Handle | sampleEntryH, | ||
MP4Handle | decodingOffsetsH, | ||
MP4Handle | syncSamplesH | ||
) |
Use this function to samples to the media.
sampleH | contains the data for all the samples |
MP4Err MP4AddMediaSamplesPad | ( | MP4Media | media, |
MP4Handle | sampleH, | ||
u32 | sampleCount, | ||
MP4Handle | durationsH, | ||
MP4Handle | sizesH, | ||
MP4Handle | sampleEntryH, | ||
MP4Handle | decodingOffsetsH, | ||
MP4Handle | syncSamplesH, | ||
MP4Handle | padsH | ||
) |
Add media samples with padding bits.
padsH | padding bits as in MP4AddMediaSampleReferencePad() |
Use this function to prepare the media before adding samples.
Tests all data references in the media to ensure that the references exist and are readable.
theMedia | input media object |
MP4Err MP4GetIndMediaSample | ( | MP4Media | theMedia, |
u32 | sampleNumber, | ||
MP4Handle | outSample, | ||
u32 * | outSize, | ||
u64 * | outDTS, | ||
s32 * | outCTSOffset, | ||
u64 * | outDuration, | ||
u32 * | outSampleFlags, | ||
u32 * | outSampleDescIndex | ||
) |
Returns a sample from the media, given the sample's index.
Parameters are the same as in MP4GetIndMediaSampleWithPad()
MP4Err MP4GetIndMediaSampleReference | ( | MP4Media | theMedia, |
u32 | sampleNumber, | ||
u32 * | outOffset, | ||
u32 * | outSize, | ||
u32 * | outDuration, | ||
u32 * | outSampleFlags, | ||
u32 * | outSampleDescIndex, | ||
MP4Handle | sampleDesc | ||
) |
Returns a reference (offset and size) for the sample from the media, given the sample's index.
Other parameters are similar to MP4GetIndMediaSampleWithPad()
outOffset | The offset of the returned sample in bytes |
sampleDesc | The sample description that corresponds to this sample in the media. Set this to NULL if you do not want this information to be returned. |
MP4Err MP4GetIndMediaSampleWithPad | ( | MP4Media | theMedia, |
u32 | sampleNumber, | ||
MP4Handle | outSample, | ||
u32 * | outSize, | ||
u64 * | outDTS, | ||
s32 * | outCTSOffset, | ||
u64 * | outDuration, | ||
u32 * | outSampleFlags, | ||
u32 * | outSampleDescIndex, | ||
u8 * | outPad | ||
) |
Returns a sample with padding bits from the media, given the sample's index.
theMedia | input media object |
sampleNumber | The index of the desired sample within its Media. This index runs from one to the total number of samples in the Media. |
outSample | The data for the desired sample. This is the raw access unit without headers |
outSize | The size of the returned sample in bytes |
outDTS | The decoding time for the sample using the media time scale |
outCTSOffset | The composition time offset for the sample using the media time scale |
outDuration | The sample's duration in units of media time scale |
outSampleFlags | Flags that indicate the nature of this sample. Values are combinations of MP4MediaSampleNotSync if the sample is not a sync sample and MP4MediaSampleHasCompositionOffset if the sample's DTS differs from its CTS. |
outSampleDescIndex | The index of the sample description that corresponds to this sample |
outPad | output padding bits. Returns dummy 0xF8 value if no padding information is found |
Returns the number of data references.
theMedia | input media object |
outCount | output number of data references |
MP4Err MP4GetMediaDataReference | ( | MP4Media | theMedia, |
u32 | index, | ||
MP4Handle | referenceURL, | ||
MP4Handle | referenceURN, | ||
u32 * | outReferenceType, | ||
u32 * | outReferenceAttributes | ||
) |
Use this to get information about a specific data reference to a media container.
The data reference specifies a location for media samples. Note that data references to samples contained in the movie's file are treated as URL reference types with no name and a special attribute bit set.
theMedia | input media object |
index | The index of the desired data reference. This number ranges from one to the number of data references in the media. |
referenceURL | Will be set to a UTF-8 encoded file:// URL that indicates the file containing the samples. If the data reference doesn't contain a URL the handle size will be set to zero. Set referenceURL to NULL if you do not want this information. |
referenceURN | UTF-8 encoded URN. This may be used in addition to urlHandle to indicate the uniform resource name associated with this media file. If the data reference does not contain a URN the handle size will be set to zero. Set referenceURN to NULL if you do not want this information. |
outReferenceType | This will be set to MP4URLDataReferenceType or MP4URNDataReferenceType to indicate the type of data reference. |
outReferenceAttributes | Returns the attributes of the data reference as a bit set. The only bit currently defined is MP4DataRefSelfReferenceMask which will be set if the media's samples are contained in the same file as the movie. |
MP4Err MP4GetMediaDecoderConfig | ( | MP4Media | theMedia, |
u32 | sampleDescIndex, | ||
MP4Handle | decoderConfigH | ||
) |
Use this to obtain the decoder configuration descriptor for a given sample description.
sampleDescIndex | sample description index (starts with 1) |
decoderConfigH | output decoder confiburation handle |
MP4Err MP4GetMediaDecoderInformation | ( | MP4Media | theMedia, |
u32 | sampleDescIndex, | ||
u32 * | outObjectType, | ||
u32 * | outStreamType, | ||
u32 * | outBufferSize, | ||
u32 * | outUpstream, | ||
u32 * | outMaxBitrate, | ||
u32 * | outAvgBitrate, | ||
MP4Handle | specificInfoH | ||
) |
Obtain the complete decoder configuration and specific info without having to parse the decoder config descriptor.
sampleDescIndex | Index of the sample description you desire (>0) |
outObjectType | Will contain the object type for this decoder config. |
outStreamType | Will contain the stream type for this decoder config. |
outBufferSize | Will contain the decoder buffer size. |
outUpstream | Will contain the value of the upstream flag. |
outMaxBitrate | Will contain the maximum bitrate for this decoder config. |
outAvgBitrate | Will contain the average bitrate for this decoder config. |
specificInfoH | Handle that will contain the specific info for this decoder config The tag and length fields are stripped from the descriptor so only the configuration data remains. Set specificInfoH to NULL if you do not want this information. |
MP4Err MP4GetMediaDecoderType | ( | MP4Media | theMedia, |
u32 | sampleDescIndex, | ||
u32 * | outObjectType, | ||
u32 * | outStreamType, | ||
u32 * | outBufferSize, | ||
MP4Handle | specificInfoH | ||
) |
Use this to obtain the decoder configuration and specific info without having to parse the decoder config descriptor.
See MP4GetMediaDecoderConfig() if you need all the configuration information.
sampleDescIndex | Index of the sample description you desire (>0) |
outObjectType | Will contain the object type for this decoder config. |
outStreamType | Will contain the stream type for this decoder config. |
outBufferSize | Will contain the decoder buffer size. |
specificInfoH | Handle that will contain the specific info for this decoder config The tag and length fields are stripped from the descriptor so only the configuration data remains. Set specificInfoH to NULL if you do not want this information. |
Get the total duration of the media, expressed in the media’s time scale.
theMedia | input media object |
outDuration | output duration of the media in media's time scale |
Returns the extended language, based on RFC 4646 (Best Common Practices – BCP – 47) industry standard.
theMedia | input media object |
extended_language | Allocates memory for extended_language string. extended_language string will be set to NULL if there is no extended language tag. |
This function can be used to obtain the media type.
The handler type and the decoder config information, can be used to obtain enough information to instantiate a decoder.
theMedia | input media object |
outType | contains the media handler (ISOVisualHandlerType, ISOAudioHandlerType, etc.) |
outName | If you want to retrieve the name for the handler you must supply a handle for outName, otherwise set outName to NULL. |
Returns the ISO 639-2/T three character language code associated with the media.
theMedia | input media object |
outThreeCharCode | output ISO 639-2/T three character language code |
MP4Err MP4GetMediaNextInterestingTime | ( | MP4Media | theMedia, |
u32 | interestingTimeFlags, | ||
u64 | searchFromTime, | ||
u32 | searchDirection, | ||
u64 * | outInterestingTime, | ||
u64 * | outInterestingDuration | ||
) |
Search for interesging time.
theMedia | input media object |
interestingTimeFlags | eg: MP4NextTimeMediaSample |
searchFromTime | in Media time scale |
searchDirection | eg: MP4NextTimeSearchForward |
outInterestingTime | output interesting time in Media time scale |
outInterestingDuration | output interesting duration in Media's time coordinate system |
MP4Err MP4GetMediaSample | ( | MP4Media | theMedia, |
MP4Handle | outSample, | ||
u32 * | outSize, | ||
u64 | desiredDecodingTime, | ||
u64 * | outDecodingTime, | ||
u64 * | outCompositionTime, | ||
u64 * | outDuration, | ||
MP4Handle | outSampleDescription, | ||
u32 * | outSampleDescriptionIndex, | ||
u32 * | outSampleFlags | ||
) |
Returns a closest sample from the media, given the desired decoding time.
theMedia | input media object |
outSample | The data for the desired sample. This is the raw access unit without headers. |
outSize | The size of the returned sample in bytes. |
desiredDecodingTime | The decoding time of the sample to be retrieved. You must specify this value in the media’s time scale. |
outDecodingTime | The decoding time for the sample using the media time scale. This time may differ from the value specified in the desiredDecodingTime parameter if that parameter's value is not at a sample time boundary. |
outCompositionTime | The composition time for the sample expressed in the media time scale |
outDuration | The sample's duration in units of media time scale. |
outSampleDescription | The sample description that corresponds to this sample in the media. Set this to NULL if you do not want this information to be returned. |
outSampleDescriptionIndex | The index of the sample description that corresponds to this sample in the media. |
outSampleFlags | Flags that indicate the nature of this sample. Same as in MP4GetIndMediaSampleWithPad() |
Use this to determine the total number of samples contained in the media.
theMedia | input media object |
outCount | output number of samples in the media |
MP4Err MP4GetMediaSampleWithPad | ( | MP4Media | theMedia, |
MP4Handle | outSample, | ||
u32 * | outSize, | ||
u64 | desiredDecodingTime, | ||
u64 * | outDecodingTime, | ||
u64 * | outCompositionTime, | ||
u64 * | outDuration, | ||
MP4Handle | outSampleDescription, | ||
u32 * | outSampleDescriptionIndex, | ||
u32 * | outSampleFlags, | ||
u8 * | outPad | ||
) |
Returns a closest sample with padding bits, given the desired decoding time.
outPad | output padding bits of the sample. |
other parameters are the same as in MP4GetMediaSample()
Returns the time scale associated with the media.
theMedia | input media object |
outTimeScale | output time scale |
Returns the track that is associated with this media.
theMedia | input media object |
outTrack | output track object |
MP4Err MP4MediaTimeToSampleNum | ( | MP4Media | theMedia, |
u64 | mediaTime, | ||
u32 * | outSampleNum, | ||
u64 * | outSampleCTS, | ||
u64 * | outSampleDTS, | ||
s32 * | outSampleDuration | ||
) |
Use this to obtain the sample number for a sample with the given decoding time.
theMedia | input media object |
mediaTime | The decoding time of the desired sample. In the media's time scale. |
outSampleNum | The sample number index for the desired sample. |
outSampleCTS | The composition time for the desired sample. |
outSampleDTS | The decoding time for the desired sample. |
outSampleDuration | The duration of the sample, expressed in the media time scale. |
MP4Err MP4SampleNumToMediaTime | ( | MP4Media | theMedia, |
u32 | sampleNum, | ||
u64 * | outSampleCTS, | ||
u64 * | outSampleDTS, | ||
s32 * | outSampleDuration | ||
) |
Use this to obtain the decoding and composition times for a particular media sample.
theMedia | input media object |
sampleNum | The sample number index for the desired sample. |
outSampleCTS | The composition time for the desired sample. |
outSampleDTS | The decoding time for the desired sample. |
outSampleDuration | The duration of the sample, expressed in the media time scale. |
Sets the version of the MP4CompositionOffsetAtom to 1.
This means that negative offsets for the composition time are enabled. Call this function before adding samples to the media. This function also adds the composition to decode atom to the sample table.
media | input media object |