Shaka Packager SDK
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 <memory>
11 
12 #include "packager/media/base/text_muxer.h"
13 #include "packager/media/formats/webvtt/webvtt_file_buffer.h"
14 
15 namespace shaka {
16 namespace media {
17 namespace webvtt {
18 
20 class WebVttMuxer : public TextMuxer {
21  public:
23  explicit WebVttMuxer(const MuxerOptions& options);
24  ~WebVttMuxer() override;
25 
26  private:
27  // TextMuxer implementation overrides.
28  Status InitializeStream(TextStreamInfo* stream) override;
29  Status AddTextSampleInternal(const TextSample& sample) override;
30  Status WriteToFile(const std::string& filename, uint64_t* size) override;
31 
32  std::unique_ptr<WebVttFileBuffer> buffer_;
33 };
34 
35 } // namespace webvtt
36 } // namespace media
37 } // namespace shaka
38 
39 #endif // PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
Implements WebVtt Muxer.
Definition: webvtt_muxer.h:20
WebVttMuxer(const MuxerOptions &options)
Create a WebMMuxer object from MuxerOptions.
Definition: webvtt_muxer.cc:18
All the methods that are virtual are virtual for mocking.
This structure contains the list of configuration options for Muxer.
Definition: muxer_options.h:20