Interface IMediaSample
interface IMediaSample
Extends com.amazon.apmf.IStandard
MediaSample holds the audio/video encoded bitstream data
and all the related meta data.
MediaSample contains the following information:
- Presentation timestamp, the time at which the MediaSample needs to be displayed/rendered.
- Duration, the duration of the MediaSample
- Decoding timeStamp, the time at which the MediaSample needs to be decoded.
- Sync/Non-Sync frame, indicates if the MediaSample is key frame or not.
- Encryption info, contains the encryption related information for encrypted MediaSample.
Methods
setPresentationTimestamp()
Sets the presentation timestamp of the sample in millisecondvoidsetPresentationTimestamp(i64timestampMs)
Parameters
timestampMs
i64 — Required
The presentation timestamp in milliseconds.
setDecodingTimestamp()
Sets the sample duration in millisecond Setting duration to media sample is optional.voidsetDecodingTimestamp(i64timestampMs)
Parameters
timestampMs
i64 — Required
The decoding timestamp in milliseconds.
setDuration()
Decoding timestamp (DTS) represents the time at which the sample should be decoded or rendered. Sets the decoding timestamp of the sample in millisecond. Setting decoding timestamp to media sample is optional.voidsetDuration(i64durationMs)
Parameters
durationMs
i64 — Required
The duration in milliseconds.
setSyncFrame()
void setSyncFrame()
Marks the sample as Key/Sync frame.
isSyncFrame()
bool isSyncFrame()
Checks if the sample is a Key/Sync frame.
Returns
bool
true if the media sample is a key/sync frame,
false otherwise.
setEncryptionInfo()
Sets encryption information if the media sample is encrypted.voidsetEncryptionInfo(IEncryptionInfo*encryptionInfo)
Parameters
encryptionInfo
IEncryptionInfo* — Required
IEncryptionInfo for the Media Sample.

