FFmpeg  4.0
Data Structures | Macros | Enumerations | Functions | Variables
concatdec.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/timestamp.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  ConcatStream
 
struct  ConcatFile
 
struct  ConcatContext
 

Macros

#define FAIL(retcode)   do { ret = (retcode); goto fail; } while(0)
 
#define OFFSET(x)   offsetof(ConcatContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Enumerations

enum  ConcatMatchMode { MATCH_ONE_TO_ONE, MATCH_EXACT_ID }
 

Functions

static int concat_probe (AVProbeData *probe)
 
static char * get_keyword (uint8_t **cursor)
 
static int safe_filename (const char *f)
 
static int add_file (AVFormatContext *avf, char *filename, ConcatFile **rfile, unsigned *nb_files_alloc)
 
static int copy_stream_props (AVStream *st, AVStream *source_st)
 
static int detect_stream_specific (AVFormatContext *avf, int idx)
 
static int match_streams_one_to_one (AVFormatContext *avf)
 
static int match_streams_exact_id (AVFormatContext *avf)
 
static int match_streams (AVFormatContext *avf)
 
static int open_file (AVFormatContext *avf, unsigned fileno)
 
static int concat_read_close (AVFormatContext *avf)
 
static int concat_read_header (AVFormatContext *avf)
 
static int open_next_file (AVFormatContext *avf)
 
static int filter_packet (AVFormatContext *avf, ConcatStream *cs, AVPacket *pkt)
 
static int packet_after_outpoint (ConcatContext *cat, AVPacket *pkt)
 
static int concat_read_packet (AVFormatContext *avf, AVPacket *pkt)
 
static void rescale_interval (AVRational tb_in, AVRational tb_out, int64_t *min_ts, int64_t *ts, int64_t *max_ts)
 
static int try_seek (AVFormatContext *avf, int stream, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 
static int real_seek (AVFormatContext *avf, int stream, int64_t min_ts, int64_t ts, int64_t max_ts, int flags, AVFormatContext *cur_avf)
 
static int concat_seek (AVFormatContext *avf, int stream, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 

Variables

static const AVOption options []
 
static const AVClass concat_class
 
AVInputFormat ff_concat_demuxer
 

Macro Definition Documentation

◆ FAIL

#define FAIL (   retcode)    do { ret = (retcode); goto fail; } while(0)

Definition at line 106 of file concatdec.c.

Referenced by add_file(), and concat_read_header().

◆ OFFSET

#define OFFSET (   x)    offsetof(ConcatContext, x)

Definition at line 752 of file concatdec.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 753 of file concatdec.c.

Enumeration Type Documentation

◆ ConcatMatchMode

Enumerator
MATCH_ONE_TO_ONE 
MATCH_EXACT_ID 

Definition at line 32 of file concatdec.c.

Function Documentation

◆ concat_probe()

static int concat_probe ( AVProbeData probe)
static

Definition at line 70 of file concatdec.c.

◆ get_keyword()

static char* get_keyword ( uint8_t **  cursor)
static

Definition at line 76 of file concatdec.c.

Referenced by concat_read_header().

◆ safe_filename()

static int safe_filename ( const char *  f)
static

Definition at line 87 of file concatdec.c.

Referenced by add_file().

◆ add_file()

static int add_file ( AVFormatContext avf,
char *  filename,
ConcatFile **  rfile,
unsigned *  nb_files_alloc 
)
static

Definition at line 108 of file concatdec.c.

Referenced by concat_read_header().

◆ copy_stream_props()

static int copy_stream_props ( AVStream st,
AVStream source_st 
)
static

Definition at line 166 of file concatdec.c.

Referenced by match_streams_exact_id(), and match_streams_one_to_one().

◆ detect_stream_specific()

static int detect_stream_specific ( AVFormatContext avf,
int  idx 
)
static

Definition at line 196 of file concatdec.c.

Referenced by match_streams().

◆ match_streams_one_to_one()

static int match_streams_one_to_one ( AVFormatContext avf)
static

Definition at line 238 of file concatdec.c.

Referenced by match_streams().

◆ match_streams_exact_id()

static int match_streams_exact_id ( AVFormatContext avf)
static

Definition at line 258 of file concatdec.c.

Referenced by match_streams().

◆ match_streams()

static int match_streams ( AVFormatContext avf)
static

Definition at line 280 of file concatdec.c.

Referenced by concat_read_packet(), and open_file().

◆ open_file()

static int open_file ( AVFormatContext avf,
unsigned  fileno 
)
static

Definition at line 317 of file concatdec.c.

Referenced by concat_read_header(), open_files(), open_next_file(), and real_seek().

◆ concat_read_close()

static int concat_read_close ( AVFormatContext avf)
static

Definition at line 367 of file concatdec.c.

Referenced by concat_read_header().

◆ concat_read_header()

static int concat_read_header ( AVFormatContext avf)
static

Definition at line 387 of file concatdec.c.

◆ open_next_file()

static int open_next_file ( AVFormatContext avf)
static

Definition at line 512 of file concatdec.c.

Referenced by concat_read_packet().

◆ filter_packet()

static int filter_packet ( AVFormatContext avf,
ConcatStream cs,
AVPacket pkt 
)
static

Definition at line 533 of file concatdec.c.

Referenced by concat_read_packet(), and cuvid_decode_packet().

◆ packet_after_outpoint()

static int packet_after_outpoint ( ConcatContext cat,
AVPacket pkt 
)
static

Definition at line 559 of file concatdec.c.

Referenced by concat_read_packet().

◆ concat_read_packet()

static int concat_read_packet ( AVFormatContext avf,
AVPacket pkt 
)
static

Definition at line 568 of file concatdec.c.

◆ rescale_interval()

static void rescale_interval ( AVRational  tb_in,
AVRational  tb_out,
int64_t *  min_ts,
int64_t *  ts,
int64_t *  max_ts 
)
static

Definition at line 652 of file concatdec.c.

Referenced by real_seek(), and try_seek().

◆ try_seek()

static int try_seek ( AVFormatContext avf,
int  stream,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)
static

Definition at line 662 of file concatdec.c.

Referenced by real_seek().

◆ real_seek()

static int real_seek ( AVFormatContext avf,
int  stream,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags,
AVFormatContext cur_avf 
)
static

Definition at line 680 of file concatdec.c.

Referenced by concat_seek().

◆ concat_seek()

static int concat_seek ( AVFormatContext avf,
int  stream,
int64_t  min_ts,
int64_t  ts,
int64_t  max_ts,
int  flags 
)
static

Definition at line 723 of file concatdec.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "safe", "enable safe mode",
OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC },
{ "auto_convert", "automatically convert bitstream format",
OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
{ "segment_time_metadata", "output file segment start time and duration as packet metadata",
OFFSET(segment_time_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define DEC
Definition: concatdec.c:753
#define OFFSET(x)
Definition: concatdec.c:752

Definition at line 755 of file concatdec.c.

◆ concat_class

const AVClass concat_class
static
Initial value:
= {
.class_name = "concat demuxer",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption options[]
Definition: concatdec.c:755

Definition at line 765 of file concatdec.c.

◆ ff_concat_demuxer

AVInputFormat ff_concat_demuxer
Initial value:
= {
.name = "concat",
.long_name = NULL_IF_CONFIG_SMALL("Virtual concatenation script"),
.priv_data_size = sizeof(ConcatContext),
.read_seek2 = concat_seek,
.priv_class = &concat_class,
}
static int concat_read_close(AVFormatContext *avf)
Definition: concatdec.c:367
static int concat_seek(AVFormatContext *avf, int stream, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Definition: concatdec.c:723
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static int concat_read_header(AVFormatContext *avf)
Definition: concatdec.c:387
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int concat_probe(AVProbeData *probe)
Definition: concatdec.c:70
static int read_probe(AVProbeData *pd)
Definition: jvdec.c:55
static const AVClass concat_class
Definition: concatdec.c:765
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:530
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
Definition: concatdec.c:568

Definition at line 773 of file concatdec.c.