7 #include "packager/media/base/media_sample.h"
11 #include "packager/base/logging.h"
12 #include "packager/base/strings/stringprintf.h"
14 namespace edash_packager {
17 MediaSample::MediaSample(
const uint8_t* data,
19 const uint8_t* side_data,
20 size_t side_data_size,
25 is_key_frame_(is_key_frame),
26 is_encrypted_(false) {
33 data_.assign(data, data + size);
35 side_data_.assign(side_data, side_data + side_data_size);
38 MediaSample::MediaSample() : dts_(0),
42 is_encrypted_(false) {}
44 MediaSample::~MediaSample() {}
52 return make_scoped_refptr(
53 new MediaSample(data, data_size, NULL, 0u, is_key_frame));
59 const uint8_t* side_data,
60 size_t side_data_size,
65 data, data_size, side_data, side_data_size, is_key_frame));
71 return make_scoped_refptr(media_sample);
76 return make_scoped_refptr(
new MediaSample(NULL, 0, NULL, 0,
false));
81 return "End of stream sample\n";
82 return base::StringPrintf(
83 "dts: %" PRId64
"\n pts: %" PRId64
"\n duration: %" PRId64
"\n "
84 "is_key_frame: %s\n size: %zu\n side_data_size: %zu\n",
88 is_key_frame_ ?
"true" :
"false",