Shaka Packager SDK
Loading...
Searching...
No Matches
ttml_to_mp4_handler.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_TTML_TTML_TO_MP4_HANDLER_H_
8#define PACKAGER_MEDIA_FORMATS_TTML_TTML_TO_MP4_HANDLER_H_
9
10#include <memory>
11
12#include <packager/media/base/media_handler.h>
13#include <packager/media/formats/ttml/ttml_generator.h>
14#include <packager/status.h>
15
16namespace shaka {
17namespace media {
18namespace ttml {
19
20// A media handler that should come after the cue aligner and segmenter and
21// should come before the muxer. This handler is to convert text samples
22// to media samples so that they can be sent to a mp4 muxer.
24 public:
25 TtmlToMp4Handler() = default;
26 ~TtmlToMp4Handler() override = default;
27
28 private:
29 Status InitializeInternal() override;
30 Status Process(std::unique_ptr<StreamData> stream_data) override;
31
32 Status OnStreamInfo(std::unique_ptr<StreamData> stream_data);
33 Status OnCueEvent(std::unique_ptr<StreamData> stream_data);
34 Status OnSegmentInfo(std::unique_ptr<StreamData> stream_data);
35 Status OnTextSample(std::unique_ptr<StreamData> stream_data);
36
37 TtmlGenerator generator_;
38};
39
40} // namespace ttml
41} // namespace media
42} // namespace shaka
43
44#endif // PACKAGER_MEDIA_FORMATS_TTML_TTML_TO_MP4_HANDLER_H_
All the methods that are virtual are virtual for mocking.