Shaka Packager SDK
single_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_SINGLE_SEGMENT_SEGMENTER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP4_SINGLE_SEGMENT_SEGMENTER_H_
9 
10 #include <packager/file/file_closer.h>
11 #include <packager/macros/classes.h>
12 #include <packager/media/event/muxer_listener.h>
13 #include <packager/media/formats/mp4/segmenter.h>
14 
15 namespace shaka {
16 namespace media {
17 namespace mp4 {
18 
30  public:
31  SingleSegmentSegmenter(const MuxerOptions& options,
32  std::unique_ptr<FileType> ftyp,
33  std::unique_ptr<Movie> moov);
34  ~SingleSegmentSegmenter() override;
35 
38  bool GetInitRange(size_t* offset, size_t* size) override;
39  bool GetIndexRange(size_t* offset, size_t* size) override;
40  std::vector<Range> GetSegmentRanges() override;
42 
43  private:
44  // Segmenter implementation overrides.
45  Status DoInitialize() override;
46  Status DoFinalize() override;
47  Status DoFinalizeSegment(int64_t segment_number) override;
48 
49  std::unique_ptr<SegmentIndex> vod_sidx_;
50  std::string temp_file_name_;
51  std::unique_ptr<File, FileCloser> temp_file_;
52 
53  DISALLOW_COPY_AND_ASSIGN(SingleSegmentSegmenter);
54 };
55 
56 } // namespace mp4
57 } // namespace media
58 } // namespace shaka
59 
60 #endif // PACKAGER_MEDIA_FORMATS_MP4_SINGLE_SEGMENT_SEGMENTER_H_
bool GetIndexRange(size_t *offset, size_t *size) override
bool GetInitRange(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