7 #ifndef PACKAGER_MEDIA_BASE_TEXT_STREAM_INFO_H_
8 #define PACKAGER_MEDIA_BASE_TEXT_STREAM_INFO_H_
13 #include <packager/media/base/stream_info.h>
14 #include <packager/media/base/text_sample.h>
29 TextNumber window_anchor_y{0, TextUnitType::kPercent};
36 TextNumber region_anchor_y{0, TextUnitType::kPercent};
67 const std::string& codec_string,
68 const std::string& codec_config,
71 const std::string& language);
77 std::string
ToString()
const override;
78 std::unique_ptr<StreamInfo>
Clone()
const override;
80 uint16_t width()
const {
return width_; }
81 uint16_t height()
const {
return height_; }
82 const std::map<std::string, TextRegion>& regions()
const {
return regions_; }
83 void AddRegion(
const std::string&
id,
const TextRegion& region) {
84 regions_[id] = region;
86 const std::string& css_styles()
const {
return css_styles_; }
87 void set_css_styles(
const std::string& styles) { css_styles_ = styles; }
90 sub_streams_.emplace(index, std::move(info));
92 const std::map<uint16_t, TextSubStreamInfo>& sub_streams()
const {
97 std::map<std::string, TextRegion> regions_;
98 std::map<uint16_t, TextSubStreamInfo> sub_streams_;
99 std::string css_styles_;
TextStreamInfo(int track_id, int32_t time_scale, int64_t duration, Codec codec, const std::string &codec_string, const std::string &codec_config, uint16_t width, uint16_t height, const std::string &language)
std::string ToString() const override
std::unique_ptr< StreamInfo > Clone() const override
bool IsValidConfig() const override
All the methods that are virtual are virtual for mocking.
TextNumber region_anchor_x
TextNumber window_anchor_x
TextNumber width
The width of the region; percent units are relative to the window.
TextNumber height
The height of the region; percent units are relative to the window.