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