DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
ts_muxer.cc
1 // Copyright 2016 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #include "packager/media/formats/mp2t/ts_muxer.h"
8 
9 namespace edash_packager {
10 namespace media {
11 namespace mp2t {
12 
13 TsMuxer::TsMuxer(const MuxerOptions& muxer_options)
14  : Muxer(muxer_options), segmenter_(options()) {}
15 TsMuxer::~TsMuxer() {}
16 
17 Status TsMuxer::Initialize() {
18  if (streams().size() > 1u)
19  return Status(error::MUXER_FAILURE, "Cannot handle more than one streams.");
20  return segmenter_.Initialize(*streams()[0]->info());
21 }
22 
23 Status TsMuxer::Finalize() {
24  return segmenter_.Finalize();
25 }
26 
27 Status TsMuxer::DoAddSample(const MediaStream* stream,
28  scoped_refptr<MediaSample> sample) {
29  return segmenter_.AddSample(sample);
30 }
31 
32 } // namespace mp2t
33 } // namespace media
34 } // namespace edash_packager
Status Initialize(const StreamInfo &stream_info)
Definition: ts_segmenter.cc:28
Status AddSample(scoped_refptr< MediaSample > sample)
Definition: ts_segmenter.cc:48