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