Shaka Packager SDK
text_padder.h
1 // Copyright 2018 Google Inc. 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_TEXT_PADDER_H_
8 #define PACKAGER_MEDIA_FORMATS_WEBVTT_TEXT_PADDER_H_
9 
10 #include "packager/media/base/media_handler.h"
11 
12 namespace shaka {
13 namespace media {
14 
17 class TextPadder : public MediaHandler {
18  public:
27  explicit TextPadder(int64_t zero_start_bias_ms);
28  ~TextPadder() override = default;
29 
30  private:
31  TextPadder(const TextPadder&) = delete;
32  TextPadder& operator=(const TextPadder&) = delete;
33 
34  Status InitializeInternal() override;
35 
36  Status Process(std::unique_ptr<StreamData> data) override;
37  Status OnTextSample(std::unique_ptr<StreamData> data);
38 
39  const int64_t zero_start_bias_ms_;
40  // Will be set once we see our first sample. Using -1 to signal that we have
41  // not seen the first sample yet.
42  int64_t max_end_time_ms_ = -1;
43 };
44 
45 } // namespace media
46 } // namespace shaka
47 
48 #endif // MEDIA_FORMATS_WEBVTT_TEXT_PADDER_H_
shaka::media::TextPadder
Definition: text_padder.h:17
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::Status
Definition: status.h:110
shaka::media::MediaHandler
Definition: media_handler.h:154
shaka::media::TextPadder::TextPadder
TextPadder(int64_t zero_start_bias_ms)
Definition: text_padder.cc:19