2020-07-30 21:26:45 +00:00
|
|
|
// Copyright 2020 Google LLC. All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
|
|
|
|
#define PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
|
|
|
|
|
2020-10-08 21:46:37 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
#include <packager/media/base/text_muxer.h>
|
|
|
|
#include <packager/media/formats/webvtt/webvtt_file_buffer.h>
|
2020-07-30 21:26:45 +00:00
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
|
|
|
namespace webvtt {
|
|
|
|
|
|
|
|
/// Implements WebVtt Muxer.
|
2020-10-08 21:46:37 +00:00
|
|
|
class WebVttMuxer : public TextMuxer {
|
2020-07-30 21:26:45 +00:00
|
|
|
public:
|
|
|
|
/// Create a WebMMuxer object from MuxerOptions.
|
|
|
|
explicit WebVttMuxer(const MuxerOptions& options);
|
|
|
|
~WebVttMuxer() override;
|
|
|
|
|
|
|
|
private:
|
2020-10-08 21:46:37 +00:00
|
|
|
// TextMuxer implementation overrides.
|
|
|
|
Status InitializeStream(TextStreamInfo* stream) override;
|
|
|
|
Status AddTextSampleInternal(const TextSample& sample) override;
|
|
|
|
Status WriteToFile(const std::string& filename, uint64_t* size) override;
|
2020-07-30 21:26:45 +00:00
|
|
|
|
|
|
|
std::unique_ptr<WebVttFileBuffer> buffer_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace webvtt
|
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|
|
|
|
|
|
|
|
#endif // PACKAGER_MEDIA_FORMATS_WEBVTT_WEBVTT_MUXER_H_
|