Shaka Packager SDK
Loading...
Searching...
No Matches
webvtt_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_FORMATS_WEBVTT_WEBVTT_MUXER_H_
8#define PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
9
10#include <cstdint>
11#include <memory>
12#include <string>
13
14#include <packager/media/base/muxer_options.h>
15#include <packager/media/base/text_muxer.h>
16#include <packager/media/base/text_stream_info.h>
17#include <packager/media/formats/webvtt/webvtt_file_buffer.h>
18#include <packager/status.h>
19
20namespace shaka {
21namespace media {
22namespace webvtt {
23
25class WebVttMuxer : public TextMuxer {
26 public:
28 explicit WebVttMuxer(const MuxerOptions& options);
29 ~WebVttMuxer() override;
30
31 private:
32 // TextMuxer implementation overrides.
33 Status InitializeStream(TextStreamInfo* stream) override;
34 Status AddTextSampleInternal(const TextSample& sample) override;
35 Status WriteToFile(const std::string& filename, uint64_t* size) override;
36
37 std::unique_ptr<WebVttFileBuffer> buffer_;
38};
39
40} // namespace webvtt
41} // namespace media
42} // namespace shaka
43
44#endif // PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
Implements WebVtt Muxer.
All the methods that are virtual are virtual for mocking.
This structure contains the list of configuration options for Muxer.