Shaka Packager SDK
Loading...
Searching...
No Matches
low_latency_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_LOW_LATENCY_SEGMENT_SEGMENTER_H_
8#define PACKAGER_MEDIA_FORMATS_MP4_LOW_LATENCY_SEGMENT_SEGMENTER_H_
9
10#include <cstdint>
11
12#include <packager/file.h>
13#include <packager/file/file_closer.h>
14#include <packager/macros/classes.h>
15#include <packager/media/formats/mp4/segmenter.h>
16
17namespace shaka {
18namespace media {
19namespace mp4 {
20
21struct SegmentType;
22
32 public:
34 std::unique_ptr<FileType> ftyp,
35 std::unique_ptr<Movie> moov);
37
40 bool GetInitRange(size_t* offset, size_t* size) override;
41 bool GetIndexRange(size_t* offset, size_t* size) override;
42 std::vector<Range> GetSegmentRanges() override;
44
45 private:
46 // Segmenter implementation overrides.
47 Status DoInitialize() override;
48 Status DoFinalize() override;
49 Status DoFinalizeSegment(int64_t segment_number) override;
50 Status DoFinalizeChunk(int64_t segment_number) override;
51
52 // Write segment to file.
53 Status WriteInitSegment();
54 Status WriteChunk();
55 Status WriteInitialChunk(int64_t segment_number);
56 Status FinalizeSegment();
57
58 uint64_t GetSegmentDuration();
59
60 std::unique_ptr<SegmentType> styp_;
61 uint32_t num_segments_;
62 bool is_initial_chunk_in_seg_ = true;
63 bool ll_dash_mpd_values_initialized_ = false;
64 std::unique_ptr<File, FileCloser> segment_file_;
65 std::string file_name_;
66 size_t segment_size_ = 0u;
67
68 DISALLOW_COPY_AND_ASSIGN(LowLatencySegmentSegmenter);
69};
70
71} // namespace mp4
72} // namespace media
73} // namespace shaka
74
75#endif // PACKAGER_MEDIA_FORMATS_MP4_LOW_LATENCY_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.
This structure contains the list of configuration options for Muxer.