22 #include "SubtecPacket.hpp"
23 #include "SubtecChannel.hpp"
42 appendType(Packet::PacketType::TTML_SELECTION);
44 append32(TTML_SELECTION_PACKET_SIZE);
51 static constexpr std::uint8_t TTML_SELECTION_PACKET_SIZE = 12;
71 std::uint32_t counter,
72 std::int64_t dataOffset,
73 std::vector<std::uint8_t> &&dataBuffer) :
Packet(counter)
75 auto& buffer = getBuffer();
76 uint32_t size = 8 + 4 + dataBuffer.size();
78 appendType(PacketType::TTML_DATA);
84 buffer.insert(buffer.end(), dataBuffer.begin(), dataBuffer.end());
100 std::uint32_t counter,
101 std::uint64_t timestamp) :
Packet(counter)
103 appendType(PacketType::TTML_TIMESTAMP);
105 append32(TTML_TIMESTAMP_PACKET_SIZE);
112 static constexpr std::uint8_t TTML_TIMESTAMP_PACKET_SIZE = 12;
121 virtual void SendSelectionPacket(uint32_t width, uint32_t height)
override {
122 sendPacket<TtmlSelectionPacket>(width, height);
124 virtual void SendDataPacket(std::vector<uint8_t> &&data, std::int64_t time_offset_ms = 0)
override {
125 sendPacket<TtmlDataPacket>(time_offset_ms, std::move(data));
127 virtual void SendTimestampPacket(uint64_t timestampMs)
override {
128 sendPacket<TtmlTimestampPacket>(timestampMs);