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 <memory>
11
12#include <packager/macros/classes.h>
13#include <packager/media/formats/webm/mkv_writer.h>
14#include <packager/media/formats/webm/segmenter.h>
15#include <packager/status.h>
16
17namespace shaka {
18namespace media {
19
20struct MuxerOptions;
21
22namespace webm {
23
27 public:
28 explicit MultiSegmentSegmenter(const MuxerOptions& options);
29 ~MultiSegmentSegmenter() override;
30
33 Status FinalizeSegment(int64_t start_timestamp,
34 int64_t duration_timestamp,
35 bool is_subsegment,
36 int64_t segment_number) override;
37 bool GetInitRangeStartAndEnd(uint64_t* start, uint64_t* end) override;
38 bool GetIndexRangeStartAndEnd(uint64_t* start, uint64_t* end) override;
39 std::vector<Range> GetSegmentRanges() override;
41
42 protected:
43 // Segmenter implementation overrides.
44 Status DoInitialize() override;
45 Status DoFinalize() override;
46
47 private:
48 // Segmenter implementation overrides.
49 Status NewSegment(int64_t start_timestamp, bool is_subsegment) override;
50
51 std::unique_ptr<MkvWriter> writer_;
52 uint32_t num_segment_;
53 std::string temp_file_name_;
54
55 DISALLOW_COPY_AND_ASSIGN(MultiSegmentSegmenter);
56};
57
58} // namespace webm
59} // namespace media
60} // namespace shaka
61
62#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.