7 #ifndef PACKAGER_MEDIA_BASE_TEXT_STREAM_INFO_H_
8 #define PACKAGER_MEDIA_BASE_TEXT_STREAM_INFO_H_
10 #include "packager/media/base/stream_info.h"
11 #include "packager/media/base/text_sample.h"
29 TextNumber window_anchor_y{0, TextUnitType::kPercent};
36 TextNumber region_anchor_y{0, TextUnitType::kPercent};
63 TextStreamInfo(
int track_id, uint32_t time_scale, uint64_t duration,
65 const std::string& codec_string,
66 const std::string& codec_config, uint16_t width,
67 uint16_t height,
const std::string& language);
73 std::string
ToString()
const override;
74 std::unique_ptr<StreamInfo>
Clone()
const override;
76 uint16_t width()
const {
return width_; }
77 uint16_t height()
const {
return height_; }
78 const std::map<std::string, TextRegion>& regions()
const {
return regions_; }
79 void AddRegion(
const std::string&
id,
const TextRegion& region) {
80 regions_[id] = region;
82 const std::string& css_styles()
const {
return css_styles_; }
83 void set_css_styles(
const std::string& styles) { css_styles_ = styles; }
86 sub_streams_.emplace(index, std::move(info));
88 const std::map<uint16_t, TextSubStreamInfo>& sub_streams()
const {
93 std::map<std::string, TextRegion> regions_;
94 std::map<uint16_t, TextSubStreamInfo> sub_streams_;
95 std::string css_styles_;
105 #endif // PACKAGER_MEDIA_BASE_TEXT_STREAM_INFO_H_