MythTV  master
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
TextSubtitleParser Class Reference

#include <textsubtitleparser.h>

Collaboration diagram for TextSubtitleParser:
Collaboration graph
[legend]

Public Member Functions

 TextSubtitleParser (SubtitleReader *parent, QString fileName, TextSubtitles *target)
 
 ~TextSubtitleParser ()
 
void LoadSubtitles (bool inBackground)
 
int decode (AVPacket *pkt)
 
QByteArray GetSubHeader ()
 
void SeekFrame (int64_t ts, int flags)
 
int ReadNextSubtitle (void)
 Read the next subtitle in the AV stream. More...
 

Static Private Member Functions

static int read_packet (void *opaque, uint8_t *buf, int buf_size)
 Read data from the file buffer into the avio context buffer. More...
 
static int64_t seek_packet (void *opaque, int64_t offset, int whence)
 Seek in the file buffer. More...
 

Private Attributes

SubtitleReaderm_parent {nullptr}
 
SubtitleLoadHelperm_loadHelper {nullptr}
 
TextSubtitlesm_target {nullptr}
 
QString m_fileName
 
AVFormatContext * m_fmtCtx {nullptr}
 
AVCodecContext * m_decCtx {nullptr}
 
AVStream * m_stream {nullptr}
 
AVPacket * m_pkt {nullptr}
 

Detailed Description

Definition at line 86 of file textsubtitleparser.h.

Constructor & Destructor Documentation

◆ TextSubtitleParser()

TextSubtitleParser::TextSubtitleParser ( SubtitleReader parent,
QString  fileName,
TextSubtitles target 
)

Definition at line 174 of file textsubtitleparser.cpp.

◆ ~TextSubtitleParser()

TextSubtitleParser::~TextSubtitleParser ( )

Definition at line 180 of file textsubtitleparser.cpp.

Member Function Documentation

◆ LoadSubtitles()

void TextSubtitleParser::LoadSubtitles ( bool  inBackground)

◆ decode()

int TextSubtitleParser::decode ( AVPacket *  pkt)

◆ GetSubHeader()

QByteArray TextSubtitleParser::GetSubHeader ( )

Definition at line 417 of file textsubtitleparser.cpp.

◆ SeekFrame()

void TextSubtitleParser::SeekFrame ( int64_t  ts,
int  flags 
)

Definition at line 425 of file textsubtitleparser.cpp.

Referenced by SubtitleReader::SeekFrame().

◆ ReadNextSubtitle()

int TextSubtitleParser::ReadNextSubtitle ( void  )

Read the next subtitle in the AV stream.

av_read_frame guarantees that pkt->pts, pkt->dts and pkt->duration are always set to correct values in AVStream.time_base units (and guessed if the format cannot provide them). pkt->pts can be AV_NOPTS_VALUE if the video format has B-frames, so it is better to rely on pkt->dts if you do not decompress the payload.

Definition at line 240 of file textsubtitleparser.cpp.

Referenced by SubtitleReader::ReadNextSubtitle().

◆ read_packet()

int TextSubtitleParser::read_packet ( void *  opaque,
uint8_t *  buf,
int  buf_size 
)
staticprivate

Read data from the file buffer into the avio context buffer.

Definition at line 190 of file textsubtitleparser.cpp.

Referenced by LoadSubtitles().

◆ seek_packet()

int64_t TextSubtitleParser::seek_packet ( void *  opaque,
int64_t  offset,
int  whence 
)
staticprivate

Seek in the file buffer.

Definition at line 206 of file textsubtitleparser.cpp.

Referenced by LoadSubtitles().

Member Data Documentation

◆ m_parent

SubtitleReader* TextSubtitleParser::m_parent {nullptr}
private

Definition at line 101 of file textsubtitleparser.h.

Referenced by LoadSubtitles(), and ReadNextSubtitle().

◆ m_loadHelper

SubtitleLoadHelper* TextSubtitleParser::m_loadHelper {nullptr}
private

Definition at line 102 of file textsubtitleparser.h.

Referenced by LoadSubtitles(), and ~TextSubtitleParser().

◆ m_target

TextSubtitles* TextSubtitleParser::m_target {nullptr}
private

Definition at line 103 of file textsubtitleparser.h.

Referenced by LoadSubtitles().

◆ m_fileName

QString TextSubtitleParser::m_fileName
private

Definition at line 104 of file textsubtitleparser.h.

Referenced by LoadSubtitles().

◆ m_fmtCtx

AVFormatContext* TextSubtitleParser::m_fmtCtx {nullptr}
private

◆ m_decCtx

AVCodecContext* TextSubtitleParser::m_decCtx {nullptr}
private

◆ m_stream

AVStream* TextSubtitleParser::m_stream {nullptr}
private

Definition at line 108 of file textsubtitleparser.h.

Referenced by LoadSubtitles(), ReadNextSubtitle(), and ~TextSubtitleParser().

◆ m_pkt

AVPacket* TextSubtitleParser::m_pkt {nullptr}
private

Definition at line 109 of file textsubtitleparser.h.

Referenced by ReadNextSubtitle(), TextSubtitleParser(), and ~TextSubtitleParser().


The documentation for this class was generated from the following files: