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_
std::shared_ptr< Muxer > CreateMuxer(MediaContainerName output_format, const StreamDescriptor &stream)
void OverrideClock(base::Clock *clock)
All the methods that are virtual are virtual for mocking.
MP4 (ISO-BMFF) output related parameters.
Packaging parameters.
Definition: packager.h:38
Defines a single input/output stream.
Definition: packager.h:76