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 <cstdint>
11#include <memory>
12
13#include <packager/media/base/media_handler.h>
14#include <packager/status.h>
15
16namespace shaka {
17namespace media {
18
21class TextPadder : public MediaHandler {
22 public:
31 explicit TextPadder(int64_t zero_start_bias_ms);
32 ~TextPadder() override = default;
33
34 private:
35 TextPadder(const TextPadder&) = delete;
36 TextPadder& operator=(const TextPadder&) = delete;
37
38 Status InitializeInternal() override;
39
40 Status Process(std::unique_ptr<StreamData> data) override;
41 Status OnTextSample(std::unique_ptr<StreamData> data);
42
43 const int64_t zero_start_bias_ms_;
44 // Will be set once we see our first sample. Using -1 to signal that we have
45 // not seen the first sample yet.
46 int64_t max_end_time_ms_ = -1;
47};
48
49} // namespace media
50} // namespace shaka
51
52#endif // MEDIA_FORMATS_WEBVTT_TEXT_PADDER_H_
All the methods that are virtual are virtual for mocking.