Shaka Packager SDK
Loading...
Searching...
No Matches
multi_segment_segmenter.h
1// Copyright 2015 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_WEBM_MULTI_SEGMENT_SEGMENTER_H_
8#define PACKAGER_MEDIA_FORMATS_WEBM_MULTI_SEGMENT_SEGMENTER_H_
9
10#include <cstdint>
11#include <memory>
12
13#include <packager/macros/classes.h>
14#include <packager/media/formats/webm/mkv_writer.h>
15#include <packager/media/formats/webm/segmenter.h>
16#include <packager/status.h>
17
18namespace shaka {
19namespace media {
20
21struct MuxerOptions;
22
23namespace webm {
24
28 public:
29 explicit MultiSegmentSegmenter(const MuxerOptions& options);
30 ~MultiSegmentSegmenter() override;
31
34 Status FinalizeSegment(int64_t start_timestamp,
35 int64_t duration_timestamp,
36 bool is_subsegment,
37 int64_t segment_number) override;
38 bool GetInitRangeStartAndEnd(uint64_t* start, uint64_t* end) override;
39 bool GetIndexRangeStartAndEnd(uint64_t* start, uint64_t* end) override;
40 std::vector<Range> GetSegmentRanges() override;
42
43 protected:
44 // Segmenter implementation overrides.
45 Status DoInitialize() override;
46 Status DoFinalize() override;
47
48 private:
49 // Segmenter implementation overrides.
50 Status NewSegment(int64_t start_timestamp, bool is_subsegment) override;
51
52 std::unique_ptr<MkvWriter> writer_;
53 uint32_t num_segment_;
54 std::string temp_file_name_;
55
56 DISALLOW_COPY_AND_ASSIGN(MultiSegmentSegmenter);
57};
58
59} // namespace webm
60} // namespace media
61} // namespace shaka
62
63#endif // PACKAGER_MEDIA_FORMATS_WEBM_MULTI_SEGMENT_SEGMENTER_H_
bool GetIndexRangeStartAndEnd(uint64_t *start, uint64_t *end) override
Status FinalizeSegment(int64_t start_timestamp, int64_t duration_timestamp, bool is_subsegment, int64_t segment_number) override
Finalize the (sub)segment.
bool GetInitRangeStartAndEnd(uint64_t *start, uint64_t *end) override
All the methods that are virtual are virtual for mocking.
This structure contains the list of configuration options for Muxer.