Shaka Packager SDK
Loading...
Searching...
No Matches
text_padder.h
1// Copyright 2018 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_TEXT_PADDER_H_
8#define PACKAGER_MEDIA_FORMATS_WEBVTT_TEXT_PADDER_H_
9
10#include <packager/media/base/media_handler.h>
11
12namespace shaka {
13namespace media {
14
17class 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_
All the methods that are virtual are virtual for mocking.