Shaka Packager SDK
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 
15 namespace shaka {
16 namespace media {
17 namespace ttml {
18 
19 // A media handler that should come after the cue aligner and segmenter and
20 // should come before the muxer. This handler is to convert text samples
21 // to media samples so that they can be sent to a mp4 muxer.
23  public:
24  TtmlToMp4Handler() = default;
25  ~TtmlToMp4Handler() override = default;
26 
27  private:
28  Status InitializeInternal() override;
29  Status Process(std::unique_ptr<StreamData> stream_data) override;
30 
31  Status OnStreamInfo(std::unique_ptr<StreamData> stream_data);
32  Status OnCueEvent(std::unique_ptr<StreamData> stream_data);
33  Status OnSegmentInfo(std::unique_ptr<StreamData> stream_data);
34  Status OnTextSample(std::unique_ptr<StreamData> stream_data);
35 
36  TtmlGenerator generator_;
37 };
38 
39 } // namespace ttml
40 } // namespace media
41 } // namespace shaka
42 
43 #endif // PACKAGER_MEDIA_FORMATS_TTML_TTML_TO_MP4_HANDLER_H_
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66