Shaka Packager SDK
Loading...
Searching...
No Matches
segment_coordinator.h
1// Copyright 2025 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_CHUNKING_SEGMENT_COORDINATOR_H_
8#define PACKAGER_MEDIA_CHUNKING_SEGMENT_COORDINATOR_H_
9
10#include <cstddef>
11#include <cstdint>
12#include <memory>
13#include <optional>
14#include <set>
15
16#include <packager/media/base/media_handler.h>
17#include <packager/status.h>
18
19namespace shaka {
20namespace media {
21
51 public:
53 ~SegmentCoordinator() override = default;
54
58 void MarkAsTeletextStream(size_t input_stream_index);
59
60 protected:
63 Status InitializeInternal() override;
64 Status Process(std::unique_ptr<StreamData> stream_data) override;
66
67 private:
69 SegmentCoordinator& operator=(const SegmentCoordinator&) = delete;
70
77 Status OnSegmentInfo(size_t input_stream_index,
78 std::shared_ptr<const SegmentInfo> info);
79
83 bool IsTeletextStream(size_t input_stream_index) const;
84
87 int64_t latest_segment_boundary_ = 0;
88
91 std::set<size_t> teletext_stream_indices_;
92
98 std::optional<size_t> sync_source_stream_index_;
99};
100
101} // namespace media
102} // namespace shaka
103
104#endif // PACKAGER_MEDIA_CHUNKING_SEGMENT_COORDINATOR_H_
Status Process(std::unique_ptr< StreamData > stream_data) override
void MarkAsTeletextStream(size_t input_stream_index)
All the methods that are virtual are virtual for mocking.