Shaka Packager SDK
multi_segment_segmenter.h
1 // Copyright 2014 Google LLC. 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_MEDIA_FORMATS_MP4_MULTI_SEGMENT_SEGMENTER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP4_MULTI_SEGMENT_SEGMENTER_H_
9 
10 #include <packager/macros/classes.h>
11 #include <packager/media/formats/mp4/segmenter.h>
12 
13 namespace shaka {
14 namespace media {
15 namespace mp4 {
16 
17 struct SegmentType;
18 
25  public:
26  MultiSegmentSegmenter(const MuxerOptions& options,
27  std::unique_ptr<FileType> ftyp,
28  std::unique_ptr<Movie> moov);
29  ~MultiSegmentSegmenter() override;
30 
33  bool GetInitRange(size_t* offset, size_t* size) override;
34  bool GetIndexRange(size_t* offset, size_t* size) override;
35  std::vector<Range> GetSegmentRanges() override;
37 
38  private:
39  // Segmenter implementation overrides.
40  Status DoInitialize() override;
41  Status DoFinalize() override;
42  Status DoFinalizeSegment(int64_t segment_number) override;
43 
44  // Write segment to file.
45  Status WriteInitSegment();
46  Status WriteSegment(int64_t segment_number);
47 
48  std::unique_ptr<SegmentType> styp_;
49 
50  DISALLOW_COPY_AND_ASSIGN(MultiSegmentSegmenter);
51 };
52 
53 } // namespace mp4
54 } // namespace media
55 } // namespace shaka
56 
57 #endif // PACKAGER_MEDIA_FORMATS_MP4_MULTI_SEGMENT_SEGMENTER_H_
bool GetInitRange(size_t *offset, size_t *size) override
bool GetIndexRange(size_t *offset, size_t *size) override
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66
This structure contains the list of configuration options for Muxer.
Definition: muxer_options.h:19