FFmpeg
Loading...
Searching...
No Matches
srtdec.c File Reference
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "subtitles.h"
#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"

Go to the source code of this file.

Data Structures

struct  SRTContext
 
struct  event_info
 

Functions

static int srt_probe (const AVProbeData *p)
 
static int get_event_info (const char *line, struct event_info *ei)
 
static int add_event (FFDemuxSubtitlesQueue *q, AVBPrint *buf, char *line_cache, const struct event_info *ei, int append_cache)
 
static int srt_read_header (AVFormatContext *s)
 

Variables

const FFInputFormat ff_srt_demuxer
 

Function Documentation

◆ srt_probe()

static int srt_probe ( const AVProbeData * p)
static

Definition at line 34 of file srtdec.c.

◆ get_event_info()

static int get_event_info ( const char * line,
struct event_info * ei )
static

Definition at line 73 of file srtdec.c.

Referenced by srt_read_header().

◆ add_event()

static int add_event ( FFDemuxSubtitlesQueue * q,
AVBPrint * buf,
char * line_cache,
const struct event_info * ei,
int append_cache )
static

Definition at line 95 of file srtdec.c.

Referenced by srt_read_header().

◆ srt_read_header()

static int srt_read_header ( AVFormatContext * s)
static

Definition at line 129 of file srtdec.c.

Variable Documentation

◆ ff_srt_demuxer

const FFInputFormat ff_srt_demuxer
Initial value:
= {
.p.name = "srt",
.p.long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
.priv_data_size = sizeof(SRTContext),
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP,
.read_seek2 = ff_subtitles_read_seek,
}
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition demux.h:35
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
static int srt_read_header(AVFormatContext *s)
Definition srtdec.c:129
static int srt_probe(const AVProbeData *p)
Definition srtdec.c:34
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
int ff_subtitles_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition subtitles.c:331
int ff_subtitles_read_seek(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Definition subtitles.c:337
int ff_subtitles_read_close(AVFormatContext *s)
Definition subtitles.c:345

Definition at line 217 of file srtdec.c.