Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

void setPresentationTimestamp(i64 timestampMs)
Sets the presentation timestamp of the sample in millisecond

Parameters

timestampMs
i64 — Required The presentation timestamp in milliseconds.

setDecodingTimestamp()

void setDecodingTimestamp(i64 timestampMs)
Sets the sample duration in millisecond Setting duration to media sample is optional.

Parameters

timestampMs
i64 — Required The decoding timestamp in milliseconds.

setDuration()

void setDuration(i64 durationMs)
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.

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()

void setEncryptionInfo(IEncryptionInfo* encryptionInfo)
Sets encryption information if the media sample is encrypted.

Parameters

encryptionInfo
IEncryptionInfo* — Required IEncryptionInfo for the Media Sample.
Last modified on October 29, 2026