7 #include "packager/media/base/muxer.h"
11 #include "packager/media/base/fourccs.h"
12 #include "packager/media/base/media_sample.h"
17 Muxer::Muxer(
const MuxerOptions& options)
19 encryption_key_source_(NULL),
23 clear_lead_in_seconds_(0),
24 crypto_period_duration_in_seconds_(0),
25 protection_scheme_(FOURCC_NULL),
32 uint32_t max_sd_pixels,
33 uint32_t max_hd_pixels,
34 uint32_t max_uhd1_pixels,
35 double clear_lead_in_seconds,
36 double crypto_period_duration_in_seconds,
37 FourCC protection_scheme) {
38 DCHECK(encryption_key_source);
39 encryption_key_source_ = encryption_key_source;
40 max_sd_pixels_ = max_sd_pixels;
41 max_hd_pixels_ = max_hd_pixels;
42 max_uhd1_pixels_ = max_uhd1_pixels;
43 clear_lead_in_seconds_ = clear_lead_in_seconds;
44 crypto_period_duration_in_seconds_ = crypto_period_duration_in_seconds;
45 protection_scheme_ = protection_scheme;
53 muxer_listener_ = std::move(muxer_listener);
57 std::unique_ptr<ProgressListener> progress_listener) {
58 progress_listener_ = std::move(progress_listener);
63 switch (stream_data->stream_data_type) {
64 case StreamDataType::kStreamInfo:
65 streams_.push_back(std::move(stream_data->stream_info));
66 return InitializeMuxer();
67 case StreamDataType::kSegmentInfo:
68 return FinalizeSegment(stream_data->stream_index,
69 std::move(stream_data->segment_info));
70 case StreamDataType::kMediaSample:
71 return AddSample(stream_data->stream_index,
72 std::move(stream_data->media_sample));
74 VLOG(3) <<
"Stream data type "
75 <<
static_cast<int>(stream_data->stream_data_type) <<
" ignored.";