27#define NP AV_NOPTS_VALUE
30static const int64_t cfr[] = { 0, 10, 20, 30, 40, 50, 60, 70, 80 };
31static const int64_t vfr[] = { 0, 5, 25, 45, 65, 85, 105, 125, 145 };
50#define ARRAY(a) a, FF_ARRAY_ELEMS(a)
51#define SEQ(...) (const int64_t[]) { __VA_ARGS__ }, \
52 FF_ARRAY_ELEMS(((const int64_t[]) { __VA_ARGS__ }))
53#define DTS(...) (const int64_t[]) { __VA_ARGS__ }
57 ARRAY(
cfr),
ARRAY(
cfr),
DTS(0, 10, 20, 30, 40, 50, 60, 70, 80) },
59 ARRAY(
cfr),
ARRAY(
cfr_out),
DTS(-20, -10, 0, 10, 20, 30, 40, 50, 60) },
61 ARRAY(
vfr),
ARRAY(
vfr_out),
DTS(-10, -5, 0, 5, 25, 45, 65, 85, 105) },
63 ARRAY(
cfr),
ARRAY(
cfr_out),
DTS(-40, -30, -20, -10, 0, 10, 20, 30, 40) },
65 ARRAY(
cfr),
ARRAY(
cfr_out),
DTS(
NP,
NP,
NP,
NP,
NP,
NP,
NP,
NP,
NP) },
68 SEQ(0, 1, 1, 2),
SEQ(0, 1, 1, 2),
DTS(-1, 0, 1, 1), 1 },
73 ARRAY(
cfr),
ARRAY(
cfr_out),
DTS(-20, -10, 0, 10, 20, 30, 40, 50, 60) },
75 NULL, 0,
ARRAY(
cfr_out),
DTS(-40, -20, 0, 10, 20, 30, 40, 50, 60) },
77 NULL, 0,
ARRAY(
cfr_out),
DTS(-2, -1, 0, 10, 20, 30, 40, 50, 60) },
82 SEQ(0, 10, 20, 30, 40, 50),
SEQ(20, 0, 10, 50, 30, 40),
83 DTS(-20, -10, 0, 10, 20, 30) },
86 { 0, 0 },
ARRAY(
cfr),
ARRAY(
cfr),
DTS(0, 10, 20, 30, 40, 50, 60, 70, 80) },
113 for (
int i = 0;
i <
c->nb_input;
i++)
116 for (
int i = 0;
i <
c->nb;
i++) {
120 if (
pkt.dts !=
c->dts[
i]) {
121 fprintf(stderr,
"%s: packet %d: dts %"PRId64
", expected %"PRId64
"\n",
122 c->name,
i,
pkt.dts,
c->dts[
i]);
126 if (
g.warned !=
c->warned) {
127 fprintf(stderr,
"%s: warned %d, expected %d\n",
128 c->name,
g.warned,
c->warned);
157 fprintf(stderr,
"reset: dts %"PRId64
", expected 80\n",
pkt.dts);
179 fprintf(stderr,
"init accepted delay %d\n", delays[
i]);
Libavcodec external API header.
#define i(width, name, range_min, range_max)
void ff_dts_gen_fill_pkt(AVCodecContext *avctx, FFDTSGen *g, AVPacket *pkt)
av_cold void ff_dts_gen_reset(FFDTSGen *g)
void ff_dts_gen_record_pts(FFDTSGen *g, int64_t pts)
av_cold int ff_dts_gen_init(const AVCodecContext *avctx, FFDTSGen *g, int delay)
#define FF_DTS_GEN_DELAY_SKIP
#define FF_DTS_GEN_DELAY_MAX
#define FF_DTS_GEN_DELAY_AUTO
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
AVCodecID
Identify the syntax and semantics of the bitstream.
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
Utility Preprocessor macros.
#define FF_ARRAY_ELEMS(a)
main external API structure.
const struct AVCodecDescriptor * codec_descriptor
AVCodecDescriptor.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
static int run_invalid_delays(void)
static const int64_t cfr[]
static const int64_t vfr_out[]
static const int64_t vfr[]
static const int64_t cfr_out[]
static int run_reset(void)
static const Case cases[]
static AVCodecContext * alloc_context(enum AVCodecID id, AVRational framerate)
static int run_case(const Case *c)