Class to hold a media sample.
More...
#include <media_sample.h>
|
| | MediaSample (const uint8_t *data, size_t data_size, const uint8_t *side_data, size_t side_data_size, bool is_key_frame) |
| |
Class to hold a media sample.
Definition at line 25 of file media_sample.h.
◆ ~MediaSample()
| shaka::media::MediaSample::~MediaSample |
( |
| ) |
|
|
virtual |
◆ MediaSample() [1/2]
| shaka::media::MediaSample::MediaSample |
( |
const uint8_t * |
data, |
|
|
size_t |
data_size, |
|
|
const uint8_t * |
side_data, |
|
|
size_t |
side_data_size, |
|
|
bool |
is_key_frame |
|
) |
| |
|
protected |
◆ MediaSample() [2/2]
| shaka::media::MediaSample::MediaSample |
( |
| ) |
|
|
protected |
◆ Clone()
| std::shared_ptr< MediaSample > shaka::media::MediaSample::Clone |
( |
| ) |
const |
◆ config_id()
| const std::string & shaka::media::MediaSample::config_id |
( |
| ) |
const |
|
inline |
◆ CopyFrom() [1/2]
| std::shared_ptr< MediaSample > shaka::media::MediaSample::CopyFrom |
( |
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
bool |
is_key_frame |
|
) |
| |
|
static |
Create a MediaSample object from input.
- Parameters
-
| 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 43 of file media_sample.cc.
◆ CopyFrom() [2/2]
| std::shared_ptr< MediaSample > shaka::media::MediaSample::CopyFrom |
( |
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
const uint8_t * |
side_data, |
|
|
size_t |
side_data_size, |
|
|
bool |
is_key_frame |
|
) |
| |
|
static |
Create a MediaSample object from input.
- Parameters
-
| 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 53 of file media_sample.cc.
◆ CreateEmptyMediaSample()
| std::shared_ptr< MediaSample > shaka::media::MediaSample::CreateEmptyMediaSample |
( |
| ) |
|
|
static |
◆ CreateEOSBuffer()
| std::shared_ptr< MediaSample > shaka::media::MediaSample::CreateEOSBuffer |
( |
| ) |
|
|
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 77 of file media_sample.cc.
◆ data()
| const uint8_t * shaka::media::MediaSample::data |
( |
| ) |
const |
|
inline |
◆ data_size()
| size_t shaka::media::MediaSample::data_size |
( |
| ) |
const |
|
inline |
◆ decrypt_config()
| const DecryptConfig * shaka::media::MediaSample::decrypt_config |
( |
| ) |
const |
|
inline |
◆ dts()
| int64_t shaka::media::MediaSample::dts |
( |
| ) |
const |
|
inline |
◆ duration()
| int64_t shaka::media::MediaSample::duration |
( |
| ) |
const |
|
inline |
◆ end_of_stream()
| bool shaka::media::MediaSample::end_of_stream |
( |
| ) |
const |
|
inline |
◆ FromMetadata()
| std::shared_ptr< MediaSample > shaka::media::MediaSample::FromMetadata |
( |
const uint8_t * |
metadata, |
|
|
size_t |
metadata_size |
|
) |
| |
|
static |
Create a MediaSample object from metadata. Unlike other factory methods, this cannot be a key frame. It must be only for metadata.
- Parameters
-
| metadata | points to the buffer containing metadata. Must not be NULL. |
| metadata_size | is the size of metadata in bytes. |
Definition at line 65 of file media_sample.cc.
◆ is_encrypted()
| bool shaka::media::MediaSample::is_encrypted |
( |
| ) |
const |
|
inline |
◆ is_key_frame()
| bool shaka::media::MediaSample::is_key_frame |
( |
| ) |
const |
|
inline |
◆ pts()
| int64_t shaka::media::MediaSample::pts |
( |
| ) |
const |
|
inline |
◆ set_config_id()
| void shaka::media::MediaSample::set_config_id |
( |
const std::string & |
config_id | ) |
|
|
inline |
◆ set_decrypt_config()
| void shaka::media::MediaSample::set_decrypt_config |
( |
std::unique_ptr< DecryptConfig > |
decrypt_config | ) |
|
|
inline |
◆ set_dts()
| void shaka::media::MediaSample::set_dts |
( |
int64_t |
dts | ) |
|
|
inline |
◆ set_duration()
| void shaka::media::MediaSample::set_duration |
( |
int64_t |
duration | ) |
|
|
inline |
◆ set_is_encrypted()
| void shaka::media::MediaSample::set_is_encrypted |
( |
bool |
value | ) |
|
|
inline |
◆ set_is_key_frame()
| void shaka::media::MediaSample::set_is_key_frame |
( |
bool |
value | ) |
|
|
inline |
◆ set_pts()
| void shaka::media::MediaSample::set_pts |
( |
int64_t |
pts | ) |
|
|
inline |
◆ SetData()
| void shaka::media::MediaSample::SetData |
( |
const uint8_t * |
data, |
|
|
size_t |
data_size |
|
) |
| |
Set the data in this media sample. Note that this method involves data copying.
- Parameters
-
| data | points to the data to be copied. |
| data_size | is the size of the data to be copied. |
Definition at line 110 of file media_sample.cc.
◆ side_data()
| const uint8_t * shaka::media::MediaSample::side_data |
( |
| ) |
const |
|
inline |
◆ side_data_size()
| size_t shaka::media::MediaSample::side_data_size |
( |
| ) |
const |
|
inline |
◆ ToString()
| std::string shaka::media::MediaSample::ToString |
( |
| ) |
const |
- Returns
- a human-readable string describing |*this|.
Definition at line 117 of file media_sample.cc.
◆ TransferData()
| void shaka::media::MediaSample::TransferData |
( |
std::shared_ptr< uint8_t > |
data, |
|
|
size_t |
data_size |
|
) |
| |
Transfer data to this media sample. No data copying is involved.
- Parameters
-
| data | points to the data to be transferred. |
| data_size | is the size of the data to be transferred. |
Definition at line 104 of file media_sample.cc.
The documentation for this class was generated from the following files: