DASH Media Packaging SDK
|
Class to hold a media sample. More...
#include <media_sample.h>
Public Member Functions | |
MediaSample (const uint8_t *data, size_t size, const uint8_t *side_data, size_t side_data_size, bool is_key_frame) | |
int64_t | dts () const |
void | set_dts (int64_t dts) |
int64_t | pts () const |
void | set_pts (int64_t pts) |
int64_t | duration () const |
void | set_duration (int64_t duration) |
bool | is_key_frame () const |
bool | is_encrypted () const |
const uint8_t * | data () const |
uint8_t * | writable_data () |
size_t | data_size () const |
const uint8_t * | side_data () const |
size_t | side_data_size () const |
const DecryptConfig * | decrypt_config () const |
void | set_data (const uint8_t *data, const size_t data_size) |
void | resize_data (const size_t data_size) |
void | set_is_key_frame (bool value) |
void | set_is_encrypted (bool value) |
void | set_decrypt_config (std::unique_ptr< DecryptConfig > decrypt_config) |
bool | end_of_stream () const |
const std::string & | config_id () const |
void | set_config_id (const std::string &config_id) |
std::string | ToString () const |
Static Public Member Functions | |
static std::shared_ptr < MediaSample > | CopyFrom (const uint8_t *data, size_t size, bool is_key_frame) |
static std::shared_ptr < MediaSample > | CopyFrom (const uint8_t *data, size_t size, const uint8_t *side_data, size_t side_data_size, bool is_key_frame) |
static std::shared_ptr < MediaSample > | CopyFrom (const MediaSample &media_sample) |
static std::shared_ptr < MediaSample > | FromMetadata (const uint8_t *metadata, size_t metadata_size) |
static std::shared_ptr < MediaSample > | CreateEmptyMediaSample () |
Create a MediaSample object with default members. | |
static std::shared_ptr < MediaSample > | CreateEOSBuffer () |
Class to hold a media sample.
Definition at line 22 of file media_sample.h.
|
static |
Create a MediaSample object from input.
data | points to the buffer containing the sample data. Must not be NULL. |
size | indicates sample size in bytes. Must not be negative. |
is_key_frame | indicates whether the sample is a key frame. |
Definition at line 45 of file media_sample.cc.
|
static |
Create a MediaSample object from input.
data | points to the buffer containing the sample data. Must not be NULL. |
side_data | points to the buffer containing the additional data. Some containers allow additional data to be specified. Must not be NULL. |
size | indicates sample size in bytes. Must not be negative. |
side_data_size | indicates additional sample data size in bytes. |
is_key_frame | indicates whether the sample is a key frame. |
Definition at line 55 of file media_sample.cc.
|
static |
Make a copy of MediaSample.
media_sample | is the source MediaSample to copy from. |
Definition at line 67 of file media_sample.cc.
|
static |
Create a MediaSample indicating we've reached end of stream. Calling any method other than end_of_stream() on the resulting buffer is disallowed.
Definition at line 105 of file media_sample.cc.
|
static |
Create a MediaSample object from metadata. Unlike other factory methods, this cannot be a key frame. It must be only for metadata.
metadata | points to the buffer containing metadata. Must not be NULL. |
metadata_size | is the size of metadata in bytes. |
Definition at line 93 of file media_sample.cc.
std::string shaka::media::MediaSample::ToString | ( | ) | const |
Definition at line 109 of file media_sample.cc.