FFmpeg
|
#include "avformat.h"
#include "subtitles.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
Go to the source code of this file.
Functions | |
AVPacket * | ff_subtitles_queue_insert (FFDemuxSubtitlesQueue *q, const uint8_t *event, int len, int merge) |
Insert a new subtitle event. | |
static int | cmp_pkt_sub_ts_pos (const void *a, const void *b) |
static int | cmp_pkt_sub_pos_ts (const void *a, const void *b) |
void | ff_subtitles_queue_finalize (FFDemuxSubtitlesQueue *q) |
Set missing durations and sort subtitles by PTS, and then byte position. | |
int | ff_subtitles_queue_read_packet (FFDemuxSubtitlesQueue *q, AVPacket *pkt) |
Generic read_packet() callback for subtitles demuxers using this queue system. | |
static int | search_sub_ts (const FFDemuxSubtitlesQueue *q, int64_t ts) |
int | ff_subtitles_queue_seek (FFDemuxSubtitlesQueue *q, AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) |
Update current_sub_idx to emulate a seek. | |
void | ff_subtitles_queue_clean (FFDemuxSubtitlesQueue *q) |
Remove and destroy all the subtitles packets. | |
int | ff_smil_extract_next_chunk (AVIOContext *pb, AVBPrint *buf, char *c) |
SMIL helper to load next chunk ("<...>" or untagged content) in buf. | |
const char * | ff_smil_get_attr_ptr (const char *s, const char *attr) |
SMIL helper to point on the value of an attribute in the given tag. | |
static int | is_eol (char c) |
void | ff_subtitles_read_chunk (AVIOContext *pb, AVBPrint *buf) |
Read a subtitles chunk. | |
AVPacket* ff_subtitles_queue_insert | ( | FFDemuxSubtitlesQueue * | q, |
const uint8_t * | event, | ||
int | len, | ||
int | merge | ||
) |
Insert a new subtitle event.
event | the subtitle line, may not be zero terminated |
len | the length of the event (in strlen() sense, so without '\0') |
merge | set to 1 if the current event should be concatenated with the previous one instead of adding a new entry, 0 otherwise |
Definition at line 26 of file subtitles.c.
Referenced by aqt_read_header(), ass_read_header(), jacosub_read_header(), microdvd_read_header(), mpl2_read_header(), mpsub_read_header(), parse_file(), pjs_read_header(), realtext_read_header(), sami_read_header(), srt_read_header(), subviewer1_read_header(), subviewer_read_header(), vplayer_read_header(), and webvtt_read_header().
Definition at line 60 of file subtitles.c.
Referenced by ff_subtitles_queue_finalize().
Definition at line 72 of file subtitles.c.
Referenced by ff_subtitles_queue_finalize().
void ff_subtitles_queue_finalize | ( | FFDemuxSubtitlesQueue * | q | ) |
Set missing durations and sort subtitles by PTS, and then byte position.
Definition at line 84 of file subtitles.c.
Referenced by aqt_read_header(), ass_read_header(), jacosub_read_header(), microdvd_read_header(), mpl2_read_header(), mpsub_read_header(), pjs_read_header(), realtext_read_header(), sami_read_header(), srt_read_header(), subviewer1_read_header(), subviewer_read_header(), tedcaptions_read_header(), vplayer_read_header(), and webvtt_read_header().
int ff_subtitles_queue_read_packet | ( | FFDemuxSubtitlesQueue * | q, |
AVPacket * | pkt | ||
) |
Generic read_packet() callback for subtitles demuxers using this queue system.
Definition at line 96 of file subtitles.c.
Referenced by aqt_read_packet(), ass_read_packet(), jacosub_read_packet(), microdvd_read_packet(), mpl2_read_packet(), mpsub_read_packet(), pjs_read_packet(), realtext_read_packet(), sami_read_packet(), srt_read_packet(), subviewer1_read_packet(), subviewer_read_packet(), tedcaptions_read_packet(), vplayer_read_packet(), and webvtt_read_packet().
|
static |
Definition at line 111 of file subtitles.c.
Referenced by ff_subtitles_queue_seek().
int ff_subtitles_queue_seek | ( | FFDemuxSubtitlesQueue * | q, |
AVFormatContext * | s, | ||
int | stream_index, | ||
int64_t | min_ts, | ||
int64_t | ts, | ||
int64_t | max_ts, | ||
int | flags | ||
) |
Update current_sub_idx to emulate a seek.
Except the first parameter, it matches AVInputFormat->read_seek2 prototypes.
Definition at line 133 of file subtitles.c.
Referenced by aqt_read_seek(), ass_read_seek(), jacosub_read_seek(), microdvd_read_seek(), mpl2_read_seek(), mpsub_read_seek(), pjs_read_seek(), realtext_read_seek(), sami_read_seek(), srt_read_seek(), subviewer1_read_seek(), subviewer_read_seek(), tedcaptions_read_seek(), vplayer_read_seek(), and webvtt_read_seek().
void ff_subtitles_queue_clean | ( | FFDemuxSubtitlesQueue * | q | ) |
Remove and destroy all the subtitles packets.
Definition at line 185 of file subtitles.c.
Referenced by aqt_read_close(), ass_read_close(), jacosub_read_close(), microdvd_read_close(), mpl2_read_close(), mpsub_read_close(), pjs_read_close(), realtext_read_close(), sami_read_close(), srt_read_close(), subviewer1_read_close(), subviewer_read_close(), tedcaptions_read_close(), tedcaptions_read_header(), vplayer_read_close(), and webvtt_read_close().
int ff_smil_extract_next_chunk | ( | AVIOContext * | pb, |
AVBPrint * | buf, | ||
char * | c | ||
) |
SMIL helper to load next chunk ("<...>" or untagged content) in buf.
c | cached character, to avoid a backward seek |
Definition at line 195 of file subtitles.c.
Referenced by realtext_read_header(), and sami_read_header().
const char* ff_smil_get_attr_ptr | ( | const char * | s, |
const char * | attr | ||
) |
SMIL helper to point on the value of an attribute in the given tag.
s | SMIL tag ("<...>") |
attr | the attribute to look for |
Definition at line 218 of file subtitles.c.
Referenced by realtext_read_header(), and sami_read_header().
|
inlinestatic |
Definition at line 238 of file subtitles.c.
Referenced by ff_subtitles_read_chunk().
void ff_subtitles_read_chunk | ( | AVIOContext * | pb, |
AVBPrint * | buf | ||
) |
Read a subtitles chunk.
A chunk is defined by a multiline "event", ending with a second line break. The trailing line breaks are trimmed. CRLF are supported. Example: "foo\r\nbar\r\n\r\nnext" will print "foo\r\nbar" into buf, and pb will focus on the 'n' of the "next" string.
pb | I/O context |
buf | an initialized buf where the chunk is written |
Definition at line 243 of file subtitles.c.
Referenced by mpsub_read_header(), srt_read_header(), and webvtt_read_header().