7 #ifndef PACKAGER_MEDIA_FORMATS_MP2T_TS_SEGMENTER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP2T_TS_SEGMENTER_H_
12 #include <packager/file.h>
13 #include <packager/macros/classes.h>
14 #include <packager/media/base/muxer_options.h>
15 #include <packager/media/formats/mp2t/pes_packet_generator.h>
16 #include <packager/media/formats/mp2t/ts_writer.h>
17 #include <packager/status.h>
68 std::unique_ptr<PesPacketGenerator> generator);
73 int64_t segment_start_timestamp()
const {
return segment_start_timestamp_; }
74 BufferWriter* segment_buffer() {
return &segment_buffer_; }
75 void set_segment_started(
bool value) { segment_started_ = value; }
76 bool segment_started()
const {
return segment_started_; }
78 double timescale()
const {
return timescale_scale_; }
79 uint32_t transport_stream_timestamp_offset()
const {
80 return transport_stream_timestamp_offset_;
84 Status StartSegmentIfNeeded(int64_t next_pts);
87 Status WritePesPackets();
92 Codec codec_ = kUnknownCodec;
93 std::vector<uint8_t> audio_codec_config_;
95 const int32_t transport_stream_timestamp_offset_ = 0;
99 double timescale_scale_ = 1.0;
101 std::unique_ptr<TsWriter> ts_writer_;
107 bool segment_started_ =
false;
108 std::unique_ptr<PesPacketGenerator> pes_packet_generator_;
110 int64_t segment_start_timestamp_ = -1;
All the methods that are virtual are virtual for mocking.