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 <packager/media/base/muxer.h>
11#include <packager/media/base/text_sample.h>
12#include <packager/media/base/text_stream_info.h>
13
14namespace shaka {
15namespace media {
16
20class TextMuxer : public Muxer {
21 public:
22 explicit TextMuxer(const MuxerOptions& options);
23 ~TextMuxer() override;
24
25 private:
26 // Muxer implementation overrides.
27 Status InitializeMuxer() override;
28 Status Finalize() override;
29 Status AddTextSample(size_t stream_id, const TextSample& sample) override;
30 Status FinalizeSegment(size_t stream_id,
31 const SegmentInfo& segment_info) override;
32
33 virtual Status InitializeStream(TextStreamInfo* stream) = 0;
34 virtual Status AddTextSampleInternal(const TextSample& sample) = 0;
37 virtual Status WriteToFile(const std::string& filename, uint64_t* size) = 0;
38
39 int64_t total_duration_ms_ = 0;
40 int64_t last_cue_ms_ = 0;
41};
42
43} // namespace media
44} // namespace shaka
45
46#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.