11 #include "SubtitlesStyle.h" 12 #include "threads/CriticalSection.h" 13 #include "utils/ColorUtils.h" 18 #include <ass/ass_types.h> 22 static constexpr
int ASS_NO_ID = -1;
42 ASS_Image* RenderImage(
double pts,
45 const std::shared_ptr<struct KODI::SUBTITLES::STYLE::style>& subStyle,
48 ASS_Event* GetEvents();
67 bool DecodeDemuxPkt(
const char* data,
int size,
double start,
double duration);
113 int AddEvent(
const char* text,
double startTime,
double stopTime);
152 void ConfigureAssOverride(
const std::shared_ptr<struct KODI::SUBTITLES::STYLE::style>& subStyle,
154 void ApplyStyle(
const std::shared_ptr<struct KODI::SUBTITLES::STYLE::style>& subStyle,
157 ASS_Library* m_library =
nullptr;
158 ASS_Track* m_track =
nullptr;
159 ASS_Renderer* m_renderer =
nullptr;
160 mutable CCriticalSection m_section;
161 ASSSubType m_subtitleType{NATIVE};
164 int m_currentDefaultStyleId{ASS_NO_ID};
167 int m_defaultKodiStyleId{ASS_NO_ID};
168 std::string m_defaultFontFamilyName;
void AppendTextToEvent(int eventId, const char *text)
Append text to the specified event.
Definition: DVDSubtitlesLibass.cpp:653
bool CreateTrack()
Create a new empty ASS track.
Definition: DVDSubtitlesLibass.cpp:189
bool DecodeDemuxPkt(const char *data, int size, double start, double duration)
Decode ASS/SSA demux packet (depends from DecodeHeader)
Definition: DVDSubtitlesLibass.cpp:174
void SetSubtitleType(ASSSubType type)
Specify whether the subtitles are native (loaded from ASS/SSA file or stream) or adapted (converted f...
Definition: DVDSubtitlesLibass.h:104
int DeleteEvents(int nEvents, int threshold)
Delete old events only if the total number of events reaches the threshold.
Definition: DVDSubtitlesLibass.cpp:721
Definition: SubtitlesStyle.h:114
int GetNrOfEvents() const
Get the number of events (subtitle entries) in the ASS track.
Definition: DVDSubtitlesLibass.cpp:598
int AddEvent(const char *text, double startTime, double stopTime)
Add an ASS event to show a subtitle on a specified time.
Definition: DVDSubtitlesLibass.cpp:606
Definition: SubtitlesAdapter.h:22
void ChangeEventStopTime(int eventId, double stopTime)
Change the stop time of an Event with the specified time.
Definition: DVDSubtitlesLibass.cpp:685
void Configure()
Configure libass. This method groups any configurations that might change throughout the lifecycle of...
Definition: DVDSubtitlesLibass.cpp:82
void FlushEvents()
Flush buffered events.
Definition: DVDSubtitlesLibass.cpp:709
int GetPlayResY()
Get PlayResY value.
Definition: DVDSubtitlesLibass.cpp:539
bool CreateStyle()
Create a new empty ASS style.
Definition: DVDSubtitlesLibass.cpp:217
Definition: SubtitlesStyle.h:106
Definition: DVDSubtitlesLibass.h:30
bool DecodeHeader(char *data, int size)
Decode Header of ASS/SSA, needed to properly decode demux packets with DecodeDemuxPkt.
Definition: DVDSubtitlesLibass.cpp:161