Shaka Packager SDK
Loading...
Searching...
No Matches
text_muxer.h
1// Copyright 2020 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_BASE_TEXT_MUXER_H_
8#define PACKAGER_MEDIA_BASE_TEXT_MUXER_H_
9
10#include <cstdint>
11
12#include <packager/media/base/muxer.h>
13#include <packager/media/base/text_sample.h>
14#include <packager/media/base/text_stream_info.h>
15
16namespace shaka {
17namespace media {
18
22class TextMuxer : public Muxer {
23 public:
24 explicit TextMuxer(const MuxerOptions& options);
25 ~TextMuxer() override;
26
27 private:
28 // Muxer implementation overrides.
29 Status InitializeMuxer() override;
30 Status Finalize() override;
31 Status AddTextSample(size_t stream_id, const TextSample& sample) override;
32 Status FinalizeSegment(size_t stream_id,
33 const SegmentInfo& segment_info) override;
34
35 virtual Status InitializeStream(TextStreamInfo* stream) = 0;
36 virtual Status AddTextSampleInternal(const TextSample& sample) = 0;
39 virtual Status WriteToFile(const std::string& filename, uint64_t* size) = 0;
40
41 int64_t total_duration_ms_ = 0;
42 int64_t last_cue_ms_ = 0;
43};
44
45} // namespace media
46} // namespace shaka
47
48#endif // PACKAGER_MEDIA_BASE_TEXT_MUXER_H_
All the methods that are virtual are virtual for mocking.
This structure contains the list of configuration options for Muxer.