Shaka Packager SDK
muxer_factory.h
1 // Copyright 2017 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 #ifndef PACKAGER_APP_MUXER_FACTORY_H_
8 #define PACKAGER_APP_MUXER_FACTORY_H_
9 
10 #include <memory>
11 #include <string>
12 
13 #include "packager/media/base/container_names.h"
14 #include "packager/media/public/mp4_output_params.h"
15 
16 namespace base {
17 class Clock;
18 } // namespace base
19 
20 namespace shaka {
21 struct PackagingParams;
22 struct StreamDescriptor;
23 
24 namespace media {
25 
26 class Muxer;
27 class MuxerListener;
28 
32 class MuxerFactory {
33  public:
34  MuxerFactory(const PackagingParams& packaging_params);
35 
38  std::shared_ptr<Muxer> CreateMuxer(MediaContainerName output_format,
39  const StreamDescriptor& stream);
40 
43  void OverrideClock(base::Clock* clock);
44 
45  void SetTsStreamOffset(uint32_t offset_ms) {
46  transport_stream_timestamp_offset_ms_ = offset_ms;
47  }
48 
49  private:
50  MuxerFactory(const MuxerFactory&) = delete;
51  MuxerFactory& operator=(const MuxerFactory&) = delete;
52 
53  const Mp4OutputParams mp4_params_;
54  const std::string temp_dir_;
55  uint32_t transport_stream_timestamp_offset_ms_ = 0;
56  base::Clock* clock_ = nullptr;
57 };
58 
59 } // namespace media
60 } // namespace shaka
61 
62 #endif // PACKAGER_APP_MUXER_FACTORY_H_
shaka::Mp4OutputParams
MP4 (ISO-BMFF) output related parameters.
Definition: mp4_output_params.h:13
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::StreamDescriptor
Defines a single input/output stream.
Definition: packager.h:76
shaka::media::MuxerFactory
Definition: muxer_factory.h:32
shaka::PackagingParams
Packaging parameters.
Definition: packager.h:38
shaka::media::MuxerFactory::CreateMuxer
std::shared_ptr< Muxer > CreateMuxer(MediaContainerName output_format, const StreamDescriptor &stream)
Definition: muxer_factory.cc:29
shaka::media::MuxerFactory::OverrideClock
void OverrideClock(base::Clock *clock)
Definition: muxer_factory.cc:83