RDK Documentation (Open Sourced RDK Components)
WebVttSubtecParser.hpp
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2020 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #pragma once
21 
22 #include "subtitleParser.h"
23 #include "SubtecChannel.hpp"
24 
26 {
27 public:
29 
30  WebVTTSubtecParser(const WebVTTSubtecParser&) = delete;
31  WebVTTSubtecParser& operator=(const WebVTTSubtecParser&) = delete;
32 
33 
34  bool init(double startPosSeconds, unsigned long long basePTS);
35  bool processData(char* buffer, size_t bufferLen, double position, double duration);
36  bool close() { return true; }
37  void reset();
38  void setProgressEventOffset(double offset) {}
39  void updateTimestamp(unsigned long long positionMs);
40  void pause(bool pause) override;
41  void mute(bool mute) override;
42  void setTextStyle(const std::string &options) override;
43 protected:
44  std::unique_ptr<SubtecChannel> m_channel;
45 private:
46  std::uint64_t time_offset_ms_ = 0;
47  std::uint64_t start_ms_ = 0;
48 };
subtitleParser.h
This file provides interfaces for a subtitle parser in AAMP.
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
SubtitleMimeType
SubtitleMimeType
Subtitle data types.
Definition: subtitleParser.h:37
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
WebVTTSubtecParser
Definition: WebVttSubtecParser.hpp:25
SubtitleParser
Subtitle parser class.
Definition: subtitleParser.h:52