31 #include "libavutil/avstring.h"
32 #include "libavutil/bprint.h"
33 #include "libavutil/intreadwrite.h"
41 const unsigned char *ptr = p->
buf;
54 int res = 0, got_first_sync_point = 0;
75 got_first_sync_point = 1;
77 if (!got_first_sync_point) {
88 sub->
pts = p ? strtol(p, NULL, 10) : 0;
113 int64_t min_ts, int64_t ts, int64_t max_ts,
int flags)
117 min_ts, ts, max_ts, flags);
136 .extensions =
"smi,sami",
int64_t pos
byte position in stream, -1 if unknown
AVCodecContext * codec
Codec context associated with this stream.
void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q)
Remove and destroy all the subtitles packets.
int av_strncasecmp(const char *a, const char *b, size_t n)
Locale-independent case-insensitive compare.
AVPacket * ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, const uint8_t *event, int len, int merge)
Insert a new subtitle event.
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.
int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt)
Generic read_packet() callback for subtitles demuxers using this queue system.
static av_cold int end(AVCodecContext *avctx)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static av_cold int read_close(AVFormatContext *ctx)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
Finalize buf into extradata and set its size appropriately.
void * priv_data
Format private data.
#define AV_BPRINT_SIZE_UNLIMITED
Convenience macros for special values for av_bprint_init() size_max parameter.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Init a print buffer.
Buffer to print data progressively.
int ff_smil_extract_next_chunk(AVIOContext *pb, AVBPrint *buf, char *c)
SMIL helper to load next chunk ("<...>" or untagged content) in buf.
void ff_subtitles_queue_finalize(FFDemuxSubtitlesQueue *q)
Set missing durations and sort subtitles by PTS, and then byte position.
static int read_header(FFV1Context *f)
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.
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
This structure contains the data a format has to probe a file.
common internal api header.
void av_bprintf(AVBPrint *buf, const char *fmt,...) av_printf_format(2
Append a formatted string to a print buffer.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...