Coverage Report

Created: 2024-09-06 07:53

/src/ffmpeg/libavformat/demux.h
Line
Count
Source
1
/*
2
 * copyright (c) 2001 Fabrice Bellard
3
 *
4
 * This file is part of FFmpeg.
5
 *
6
 * FFmpeg is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Lesser General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2.1 of the License, or (at your option) any later version.
10
 *
11
 * FFmpeg is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with FFmpeg; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
 */
20
21
#ifndef AVFORMAT_DEMUX_H
22
#define AVFORMAT_DEMUX_H
23
24
#include <stdint.h>
25
#include "libavutil/rational.h"
26
#include "libavcodec/packet.h"
27
#include "avformat.h"
28
29
struct AVDeviceInfoList;
30
31
/**
32
 * For an FFInputFormat with this flag set read_close() needs to be called
33
 * by the caller upon read_header() failure.
34
 */
35
870k
#define FF_INFMT_FLAG_INIT_CLEANUP                             (1 << 0)
36
37
typedef struct FFInputFormat {
38
    /**
39
     * The public AVInputFormat. See avformat.h for it.
40
     */
41
    AVInputFormat p;
42
43
    /**
44
     * Raw demuxers store their codec ID here.
45
     */
46
    enum AVCodecID raw_codec_id;
47
48
    /**
49
     * Size of private data so that it can be allocated in the wrapper.
50
     */
51
    int priv_data_size;
52
53
    /**
54
     * Internal flags. See FF_INFMT_FLAG_* above and FF_FMT_FLAG_* in internal.h.
55
     */
56
    int flags_internal;
57
58
    /**
59
     * Tell if a given file has a chance of being parsed as this format.
60
     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
61
     * big so you do not have to check for that unless you need more.
62
     */
63
    int (*read_probe)(const AVProbeData *);
64
65
    /**
66
     * Read the format header and initialize the AVFormatContext
67
     * structure. Return 0 if OK. 'avformat_new_stream' should be
68
     * called to create new streams.
69
     */
70
    int (*read_header)(struct AVFormatContext *);
71
72
    /**
73
     * Read one packet and put it in 'pkt'. pts and flags are also
74
     * set. 'avformat_new_stream' can be called only if the flag
75
     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
76
     * background thread).
77
     * @return 0 on success, < 0 on error.
78
     *         Upon returning an error, pkt must be unreferenced by the caller.
79
     */
80
    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
81
82
    /**
83
     * Close the stream. The AVFormatContext and AVStreams are not
84
     * freed by this function
85
     */
86
    int (*read_close)(struct AVFormatContext *);
87
88
    /**
89
     * Seek to a given timestamp relative to the frames in
90
     * stream component stream_index.
91
     * @param stream_index Must not be -1.
92
     * @param flags Selects which direction should be preferred if no exact
93
     *              match is available.
94
     * @return >= 0 on success (but not necessarily the new offset)
95
     */
96
    int (*read_seek)(struct AVFormatContext *,
97
                     int stream_index, int64_t timestamp, int flags);
98
99
    /**
100
     * Get the next timestamp in stream[stream_index].time_base units.
101
     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
102
     */
103
    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
104
                              int64_t *pos, int64_t pos_limit);
105
106
    /**
107
     * Start/resume playing - only meaningful if using a network-based format
108
     * (RTSP).
109
     */
110
    int (*read_play)(struct AVFormatContext *);
111
112
    /**
113
     * Pause playing - only meaningful if using a network-based format
114
     * (RTSP).
115
     */
116
    int (*read_pause)(struct AVFormatContext *);
117
118
    /**
119
     * Seek to timestamp ts.
120
     * Seeking will be done so that the point from which all active streams
121
     * can be presented successfully will be closest to ts and within min/max_ts.
122
     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
123
     */
124
    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
125
126
    /**
127
     * Returns device list with it properties.
128
     * @see avdevice_list_devices() for more details.
129
     */
130
    int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
131
} FFInputFormat;
132
133
static inline const FFInputFormat *ffifmt(const AVInputFormat *fmt)
134
405M
{
135
405M
    return (const FFInputFormat*)fmt;
136
405M
}
Unexecuted instantiation: target_dem_fuzzer.c:ffifmt
Unexecuted instantiation: allformats.c:ffifmt
Unexecuted instantiation: alp.c:ffifmt
Unexecuted instantiation: amr.c:ffifmt
Unexecuted instantiation: anm.c:ffifmt
Unexecuted instantiation: apac.c:ffifmt
Unexecuted instantiation: apc.c:ffifmt
Unexecuted instantiation: ape.c:ffifmt
Unexecuted instantiation: apetag.c:ffifmt
Unexecuted instantiation: apm.c:ffifmt
Unexecuted instantiation: apngdec.c:ffifmt
Unexecuted instantiation: aptxdec.c:ffifmt
Unexecuted instantiation: aqtitledec.c:ffifmt
Unexecuted instantiation: argo_asf.c:ffifmt
Unexecuted instantiation: argo_brp.c:ffifmt
Unexecuted instantiation: argo_cvg.c:ffifmt
Unexecuted instantiation: asfdec_f.c:ffifmt
Unexecuted instantiation: asfdec_o.c:ffifmt
Unexecuted instantiation: assdec.c:ffifmt
Unexecuted instantiation: astdec.c:ffifmt
Unexecuted instantiation: au.c:ffifmt
Unexecuted instantiation: av1dec.c:ffifmt
Unexecuted instantiation: avformat.c:ffifmt
Unexecuted instantiation: avidec.c:ffifmt
Unexecuted instantiation: avr.c:ffifmt
Unexecuted instantiation: avs.c:ffifmt
Unexecuted instantiation: avs2dec.c:ffifmt
Unexecuted instantiation: avs3dec.c:ffifmt
Unexecuted instantiation: bethsoftvid.c:ffifmt
Unexecuted instantiation: bfi.c:ffifmt
Unexecuted instantiation: bink.c:ffifmt
Unexecuted instantiation: binka.c:ffifmt
Unexecuted instantiation: bintext.c:ffifmt
Unexecuted instantiation: bit.c:ffifmt
Unexecuted instantiation: bmv.c:ffifmt
Unexecuted instantiation: boadec.c:ffifmt
Unexecuted instantiation: bonk.c:ffifmt
Unexecuted instantiation: brstm.c:ffifmt
Unexecuted instantiation: c93.c:ffifmt
Unexecuted instantiation: cafdec.c:ffifmt
Unexecuted instantiation: cavsvideodec.c:ffifmt
Unexecuted instantiation: cdg.c:ffifmt
Unexecuted instantiation: cdxl.c:ffifmt
Unexecuted instantiation: cinedec.c:ffifmt
Unexecuted instantiation: codec2.c:ffifmt
Unexecuted instantiation: concatdec.c:ffifmt
Unexecuted instantiation: dashdec.c:ffifmt
Unexecuted instantiation: dauddec.c:ffifmt
Unexecuted instantiation: dcstr.c:ffifmt
demux.c:ffifmt
Line
Count
Source
134
165M
{
135
165M
    return (const FFInputFormat*)fmt;
136
165M
}
Unexecuted instantiation: demux_utils.c:ffifmt
Unexecuted instantiation: derf.c:ffifmt
Unexecuted instantiation: dfa.c:ffifmt
Unexecuted instantiation: dfpwmdec.c:ffifmt
Unexecuted instantiation: dhav.c:ffifmt
Unexecuted instantiation: diracdec.c:ffifmt
Unexecuted instantiation: dnxhddec.c:ffifmt
Unexecuted instantiation: dsfdec.c:ffifmt
Unexecuted instantiation: dsicin.c:ffifmt
Unexecuted instantiation: dss.c:ffifmt
Unexecuted instantiation: dtsdec.c:ffifmt
Unexecuted instantiation: dtshddec.c:ffifmt
Unexecuted instantiation: dv.c:ffifmt
Unexecuted instantiation: dvbsub.c:ffifmt
Unexecuted instantiation: dvbtxt.c:ffifmt
Unexecuted instantiation: dxa.c:ffifmt
Unexecuted instantiation: eacdata.c:ffifmt
Unexecuted instantiation: electronicarts.c:ffifmt
Unexecuted instantiation: epafdec.c:ffifmt
Unexecuted instantiation: evcdec.c:ffifmt
Unexecuted instantiation: ffmetadec.c:ffifmt
Unexecuted instantiation: filmstripdec.c:ffifmt
Unexecuted instantiation: fitsdec.c:ffifmt
Unexecuted instantiation: flacdec.c:ffifmt
Unexecuted instantiation: flic.c:ffifmt
Unexecuted instantiation: flvdec.c:ffifmt
format.c:ffifmt
Line
Count
Source
134
235M
{
135
235M
    return (const FFInputFormat*)fmt;
136
235M
}
Unexecuted instantiation: frmdec.c:ffifmt
Unexecuted instantiation: fsb.c:ffifmt
Unexecuted instantiation: fwse.c:ffifmt
Unexecuted instantiation: g722.c:ffifmt
Unexecuted instantiation: g723_1.c:ffifmt
g726.c:ffifmt
Line
Count
Source
134
10.2k
{
135
10.2k
    return (const FFInputFormat*)fmt;
136
10.2k
}
Unexecuted instantiation: g729dec.c:ffifmt
Unexecuted instantiation: gdv.c:ffifmt
Unexecuted instantiation: genh.c:ffifmt
Unexecuted instantiation: gifdec.c:ffifmt
Unexecuted instantiation: gsmdec.c:ffifmt
Unexecuted instantiation: gxf.c:ffifmt
Unexecuted instantiation: h261dec.c:ffifmt
Unexecuted instantiation: h263dec.c:ffifmt
Unexecuted instantiation: h264dec.c:ffifmt
Unexecuted instantiation: hca.c:ffifmt
Unexecuted instantiation: hcom.c:ffifmt
Unexecuted instantiation: hevcdec.c:ffifmt
Unexecuted instantiation: hls.c:ffifmt
Unexecuted instantiation: hnm.c:ffifmt
Unexecuted instantiation: iamfdec.c:ffifmt
Unexecuted instantiation: icodec.c:ffifmt
Unexecuted instantiation: id3v2.c:ffifmt
Unexecuted instantiation: idcin.c:ffifmt
Unexecuted instantiation: idroqdec.c:ffifmt
Unexecuted instantiation: iff.c:ffifmt
Unexecuted instantiation: ifv.c:ffifmt
Unexecuted instantiation: ilbc.c:ffifmt
Unexecuted instantiation: imfdec.c:ffifmt
Unexecuted instantiation: img2_alias_pix.c:ffifmt
Unexecuted instantiation: img2_brender_pix.c:ffifmt
img2dec.c:ffifmt
Line
Count
Source
134
4.75M
{
135
4.75M
    return (const FFInputFormat*)fmt;
136
4.75M
}
Unexecuted instantiation: imx.c:ffifmt
Unexecuted instantiation: ingenientdec.c:ffifmt
Unexecuted instantiation: ipmovie.c:ffifmt
Unexecuted instantiation: ipudec.c:ffifmt
Unexecuted instantiation: ircamdec.c:ffifmt
Unexecuted instantiation: isom.c:ffifmt
Unexecuted instantiation: iss.c:ffifmt
Unexecuted instantiation: iv8.c:ffifmt
Unexecuted instantiation: ivfdec.c:ffifmt
Unexecuted instantiation: jacosubdec.c:ffifmt
Unexecuted instantiation: jpegxl_anim_dec.c:ffifmt
Unexecuted instantiation: jvdec.c:ffifmt
Unexecuted instantiation: kvag.c:ffifmt
Unexecuted instantiation: lafdec.c:ffifmt
Unexecuted instantiation: lc3.c:ffifmt
Unexecuted instantiation: lmlm4.c:ffifmt
Unexecuted instantiation: loasdec.c:ffifmt
Unexecuted instantiation: lrcdec.c:ffifmt
Unexecuted instantiation: luodatdec.c:ffifmt
Unexecuted instantiation: lvfdec.c:ffifmt
Unexecuted instantiation: lxfdec.c:ffifmt
Unexecuted instantiation: m4vdec.c:ffifmt
Unexecuted instantiation: matroskadec.c:ffifmt
Unexecuted instantiation: mca.c:ffifmt
Unexecuted instantiation: mccdec.c:ffifmt
Unexecuted instantiation: mgsts.c:ffifmt
Unexecuted instantiation: microdvddec.c:ffifmt
Unexecuted instantiation: mj2kdec.c:ffifmt
Unexecuted instantiation: mlpdec.c:ffifmt
Unexecuted instantiation: mlvdec.c:ffifmt
Unexecuted instantiation: mm.c:ffifmt
Unexecuted instantiation: mmf.c:ffifmt
Unexecuted instantiation: mods.c:ffifmt
Unexecuted instantiation: moflex.c:ffifmt
Unexecuted instantiation: mov.c:ffifmt
Unexecuted instantiation: mp3dec.c:ffifmt
Unexecuted instantiation: mpc.c:ffifmt
Unexecuted instantiation: mpc8.c:ffifmt
Unexecuted instantiation: mpeg.c:ffifmt
Unexecuted instantiation: mpegts.c:ffifmt
Unexecuted instantiation: mpegvideodec.c:ffifmt
Unexecuted instantiation: mpjpegdec.c:ffifmt
Unexecuted instantiation: mpl2dec.c:ffifmt
Unexecuted instantiation: mpsubdec.c:ffifmt
Unexecuted instantiation: msf.c:ffifmt
Unexecuted instantiation: msnwc_tcp.c:ffifmt
Unexecuted instantiation: mspdec.c:ffifmt
Unexecuted instantiation: mtaf.c:ffifmt
Unexecuted instantiation: mtv.c:ffifmt
Unexecuted instantiation: musx.c:ffifmt
Unexecuted instantiation: mvdec.c:ffifmt
Unexecuted instantiation: mvi.c:ffifmt
Unexecuted instantiation: mxfdec.c:ffifmt
Unexecuted instantiation: mxg.c:ffifmt
Unexecuted instantiation: ncdec.c:ffifmt
Unexecuted instantiation: nistspheredec.c:ffifmt
Unexecuted instantiation: nspdec.c:ffifmt
Unexecuted instantiation: nsvdec.c:ffifmt
Unexecuted instantiation: nutdec.c:ffifmt
Unexecuted instantiation: nuv.c:ffifmt
Unexecuted instantiation: oggdec.c:ffifmt
Unexecuted instantiation: oggparsevorbis.c:ffifmt
Unexecuted instantiation: omadec.c:ffifmt
Unexecuted instantiation: options.c:ffifmt
Unexecuted instantiation: osq.c:ffifmt
Unexecuted instantiation: paf.c:ffifmt
pcmdec.c:ffifmt
Line
Count
Source
134
110k
{
135
110k
    return (const FFInputFormat*)fmt;
136
110k
}
Unexecuted instantiation: pdvdec.c:ffifmt
Unexecuted instantiation: pjsdec.c:ffifmt
Unexecuted instantiation: pmpdec.c:ffifmt
Unexecuted instantiation: pp_bnk.c:ffifmt
Unexecuted instantiation: psxstr.c:ffifmt
Unexecuted instantiation: pva.c:ffifmt
Unexecuted instantiation: pvfdec.c:ffifmt
Unexecuted instantiation: qcp.c:ffifmt
Unexecuted instantiation: qoadec.c:ffifmt
Unexecuted instantiation: r3d.c:ffifmt
rawdec.c:ffifmt
Line
Count
Source
134
140k
{
135
140k
    return (const FFInputFormat*)fmt;
136
140k
}
rawvideodec.c:ffifmt
Line
Count
Source
134
54.7k
{
135
54.7k
    return (const FFInputFormat*)fmt;
136
54.7k
}
Unexecuted instantiation: rcwtdec.c:ffifmt
Unexecuted instantiation: realtextdec.c:ffifmt
Unexecuted instantiation: redspark.c:ffifmt
Unexecuted instantiation: riffdec.c:ffifmt
Unexecuted instantiation: rka.c:ffifmt
Unexecuted instantiation: rl2.c:ffifmt
Unexecuted instantiation: rmdec.c:ffifmt
Unexecuted instantiation: rpl.c:ffifmt
Unexecuted instantiation: rsd.c:ffifmt
Unexecuted instantiation: rsodec.c:ffifmt
Unexecuted instantiation: s337m.c:ffifmt
Unexecuted instantiation: samidec.c:ffifmt
Unexecuted instantiation: sbcdec.c:ffifmt
Unexecuted instantiation: sbgdec.c:ffifmt
Unexecuted instantiation: sccdec.c:ffifmt
Unexecuted instantiation: scd.c:ffifmt
Unexecuted instantiation: sdns.c:ffifmt
Unexecuted instantiation: sdr2.c:ffifmt
Unexecuted instantiation: sdsdec.c:ffifmt
Unexecuted instantiation: sdxdec.c:ffifmt
seek.c:ffifmt
Line
Count
Source
134
1.50k
{
135
1.50k
    return (const FFInputFormat*)fmt;
136
1.50k
}
Unexecuted instantiation: segafilm.c:ffifmt
Unexecuted instantiation: serdec.c:ffifmt
Unexecuted instantiation: sga.c:ffifmt
Unexecuted instantiation: shortendec.c:ffifmt
Unexecuted instantiation: sierravmd.c:ffifmt
Unexecuted instantiation: siff.c:ffifmt
Unexecuted instantiation: smacker.c:ffifmt
Unexecuted instantiation: smjpegdec.c:ffifmt
Unexecuted instantiation: smush.c:ffifmt
Unexecuted instantiation: sol.c:ffifmt
Unexecuted instantiation: soxdec.c:ffifmt
Unexecuted instantiation: spdifdec.c:ffifmt
Unexecuted instantiation: srtdec.c:ffifmt
Unexecuted instantiation: stldec.c:ffifmt
Unexecuted instantiation: subviewer1dec.c:ffifmt
Unexecuted instantiation: subviewerdec.c:ffifmt
Unexecuted instantiation: supdec.c:ffifmt
Unexecuted instantiation: svag.c:ffifmt
Unexecuted instantiation: svs.c:ffifmt
Unexecuted instantiation: swfdec.c:ffifmt
Unexecuted instantiation: takdec.c:ffifmt
Unexecuted instantiation: tedcaptionsdec.c:ffifmt
Unexecuted instantiation: thp.c:ffifmt
Unexecuted instantiation: tiertexseq.c:ffifmt
Unexecuted instantiation: tmv.c:ffifmt
Unexecuted instantiation: tta.c:ffifmt
Unexecuted instantiation: tty.c:ffifmt
Unexecuted instantiation: txd.c:ffifmt
Unexecuted instantiation: ty.c:ffifmt
Unexecuted instantiation: usmdec.c:ffifmt
Unexecuted instantiation: vag.c:ffifmt
Unexecuted instantiation: vc1dec.c:ffifmt
Unexecuted instantiation: vc1test.c:ffifmt
Unexecuted instantiation: vividas.c:ffifmt
Unexecuted instantiation: vivo.c:ffifmt
Unexecuted instantiation: vocdec.c:ffifmt
Unexecuted instantiation: vpk.c:ffifmt
Unexecuted instantiation: vplayerdec.c:ffifmt
Unexecuted instantiation: vqf.c:ffifmt
Unexecuted instantiation: vvcdec.c:ffifmt
Unexecuted instantiation: wady.c:ffifmt
Unexecuted instantiation: wavarc.c:ffifmt
Unexecuted instantiation: wavdec.c:ffifmt
Unexecuted instantiation: wc3movie.c:ffifmt
Unexecuted instantiation: webvttdec.c:ffifmt
Unexecuted instantiation: westwood_aud.c:ffifmt
Unexecuted instantiation: westwood_vqa.c:ffifmt
Unexecuted instantiation: wsddec.c:ffifmt
Unexecuted instantiation: wtvdec.c:ffifmt
Unexecuted instantiation: wvdec.c:ffifmt
Unexecuted instantiation: wvedec.c:ffifmt
Unexecuted instantiation: xa.c:ffifmt
Unexecuted instantiation: xmd.c:ffifmt
Unexecuted instantiation: xmv.c:ffifmt
Unexecuted instantiation: xvag.c:ffifmt
Unexecuted instantiation: xwma.c:ffifmt
Unexecuted instantiation: yop.c:ffifmt
Unexecuted instantiation: yuv4mpegdec.c:ffifmt
Unexecuted instantiation: 3dostr.c:ffifmt
Unexecuted instantiation: 4xm.c:ffifmt
Unexecuted instantiation: aacdec.c:ffifmt
Unexecuted instantiation: aadec.c:ffifmt
Unexecuted instantiation: aaxdec.c:ffifmt
Unexecuted instantiation: ac3dec.c:ffifmt
Unexecuted instantiation: ac4dec.c:ffifmt
Unexecuted instantiation: acedec.c:ffifmt
Unexecuted instantiation: acm.c:ffifmt
Unexecuted instantiation: act.c:ffifmt
Unexecuted instantiation: adp.c:ffifmt
Unexecuted instantiation: ads.c:ffifmt
Unexecuted instantiation: adxdec.c:ffifmt
Unexecuted instantiation: aeadec.c:ffifmt
Unexecuted instantiation: afc.c:ffifmt
Unexecuted instantiation: aiffdec.c:ffifmt
Unexecuted instantiation: aixdec.c:ffifmt
Unexecuted instantiation: asf.c:ffifmt
Unexecuted instantiation: flac_picture.c:ffifmt
137
138
14.0G
#define MAX_STD_TIMEBASES (30*12+30+3+6)
139
typedef struct FFStreamInfo {
140
    int64_t last_dts;
141
    int64_t duration_gcd;
142
    int duration_count;
143
    int64_t rfps_duration_sum;
144
    double (*duration_error)[2][MAX_STD_TIMEBASES];
145
    int64_t codec_info_duration;
146
    int64_t codec_info_duration_fields;
147
    int frame_delay_evidence;
148
149
    /**
150
     * 0  -> decoder has not been searched for yet.
151
     * >0 -> decoder found
152
     * <0 -> decoder with codec_id == -found_decoder has not been found
153
     */
154
    int found_decoder;
155
156
    int64_t last_duration;
157
158
    /**
159
     * Those are used for average framerate estimation.
160
     */
161
    int64_t fps_first_dts;
162
    int     fps_first_dts_idx;
163
    int64_t fps_last_dts;
164
    int     fps_last_dts_idx;
165
} FFStreamInfo;
166
167
/**
168
 * Returned by demuxers to indicate that data was consumed but discarded
169
 * (ignored streams or junk data). The framework will re-call the demuxer.
170
 */
171
6.49M
#define FFERROR_REDO FFERRTAG('R','E','D','O')
172
173
1.00G
#define RELATIVE_TS_BASE (INT64_MAX - (1LL << 48))
174
175
static av_always_inline int is_relative(int64_t ts)
176
714M
{
177
714M
    return ts > (RELATIVE_TS_BASE - (1LL << 48));
178
714M
}
Unexecuted instantiation: target_dem_fuzzer.c:is_relative
Unexecuted instantiation: allformats.c:is_relative
Unexecuted instantiation: alp.c:is_relative
Unexecuted instantiation: amr.c:is_relative
Unexecuted instantiation: anm.c:is_relative
Unexecuted instantiation: apac.c:is_relative
Unexecuted instantiation: apc.c:is_relative
Unexecuted instantiation: ape.c:is_relative
Unexecuted instantiation: apetag.c:is_relative
Unexecuted instantiation: apm.c:is_relative
Unexecuted instantiation: apngdec.c:is_relative
Unexecuted instantiation: aptxdec.c:is_relative
Unexecuted instantiation: aqtitledec.c:is_relative
Unexecuted instantiation: argo_asf.c:is_relative
Unexecuted instantiation: argo_brp.c:is_relative
Unexecuted instantiation: argo_cvg.c:is_relative
Unexecuted instantiation: asfdec_f.c:is_relative
Unexecuted instantiation: asfdec_o.c:is_relative
Unexecuted instantiation: assdec.c:is_relative
Unexecuted instantiation: astdec.c:is_relative
Unexecuted instantiation: au.c:is_relative
Unexecuted instantiation: av1dec.c:is_relative
Unexecuted instantiation: avformat.c:is_relative
Unexecuted instantiation: avidec.c:is_relative
Unexecuted instantiation: avr.c:is_relative
Unexecuted instantiation: avs.c:is_relative
Unexecuted instantiation: avs2dec.c:is_relative
Unexecuted instantiation: avs3dec.c:is_relative
Unexecuted instantiation: bethsoftvid.c:is_relative
Unexecuted instantiation: bfi.c:is_relative
Unexecuted instantiation: bink.c:is_relative
Unexecuted instantiation: binka.c:is_relative
Unexecuted instantiation: bintext.c:is_relative
Unexecuted instantiation: bit.c:is_relative
Unexecuted instantiation: bmv.c:is_relative
Unexecuted instantiation: boadec.c:is_relative
Unexecuted instantiation: bonk.c:is_relative
Unexecuted instantiation: brstm.c:is_relative
Unexecuted instantiation: c93.c:is_relative
Unexecuted instantiation: cafdec.c:is_relative
Unexecuted instantiation: cavsvideodec.c:is_relative
Unexecuted instantiation: cdg.c:is_relative
Unexecuted instantiation: cdxl.c:is_relative
Unexecuted instantiation: cinedec.c:is_relative
Unexecuted instantiation: codec2.c:is_relative
Unexecuted instantiation: concatdec.c:is_relative
Unexecuted instantiation: dashdec.c:is_relative
Unexecuted instantiation: dauddec.c:is_relative
Unexecuted instantiation: dcstr.c:is_relative
demux.c:is_relative
Line
Count
Source
176
237M
{
177
237M
    return ts > (RELATIVE_TS_BASE - (1LL << 48));
178
237M
}
Unexecuted instantiation: demux_utils.c:is_relative
Unexecuted instantiation: derf.c:is_relative
Unexecuted instantiation: dfa.c:is_relative
Unexecuted instantiation: dfpwmdec.c:is_relative
Unexecuted instantiation: dhav.c:is_relative
Unexecuted instantiation: diracdec.c:is_relative
Unexecuted instantiation: dnxhddec.c:is_relative
Unexecuted instantiation: dsfdec.c:is_relative
Unexecuted instantiation: dsicin.c:is_relative
Unexecuted instantiation: dss.c:is_relative
Unexecuted instantiation: dtsdec.c:is_relative
Unexecuted instantiation: dtshddec.c:is_relative
Unexecuted instantiation: dv.c:is_relative
Unexecuted instantiation: dvbsub.c:is_relative
Unexecuted instantiation: dvbtxt.c:is_relative
Unexecuted instantiation: dxa.c:is_relative
Unexecuted instantiation: eacdata.c:is_relative
Unexecuted instantiation: electronicarts.c:is_relative
Unexecuted instantiation: epafdec.c:is_relative
Unexecuted instantiation: evcdec.c:is_relative
Unexecuted instantiation: ffmetadec.c:is_relative
Unexecuted instantiation: filmstripdec.c:is_relative
Unexecuted instantiation: fitsdec.c:is_relative
Unexecuted instantiation: flacdec.c:is_relative
Unexecuted instantiation: flic.c:is_relative
Unexecuted instantiation: flvdec.c:is_relative
Unexecuted instantiation: format.c:is_relative
Unexecuted instantiation: frmdec.c:is_relative
Unexecuted instantiation: fsb.c:is_relative
Unexecuted instantiation: fwse.c:is_relative
Unexecuted instantiation: g722.c:is_relative
Unexecuted instantiation: g723_1.c:is_relative
Unexecuted instantiation: g726.c:is_relative
Unexecuted instantiation: g729dec.c:is_relative
Unexecuted instantiation: gdv.c:is_relative
Unexecuted instantiation: genh.c:is_relative
Unexecuted instantiation: gifdec.c:is_relative
Unexecuted instantiation: gsmdec.c:is_relative
Unexecuted instantiation: gxf.c:is_relative
Unexecuted instantiation: h261dec.c:is_relative
Unexecuted instantiation: h263dec.c:is_relative
Unexecuted instantiation: h264dec.c:is_relative
Unexecuted instantiation: hca.c:is_relative
Unexecuted instantiation: hcom.c:is_relative
Unexecuted instantiation: hevcdec.c:is_relative
Unexecuted instantiation: hls.c:is_relative
Unexecuted instantiation: hnm.c:is_relative
Unexecuted instantiation: iamfdec.c:is_relative
Unexecuted instantiation: icodec.c:is_relative
Unexecuted instantiation: id3v2.c:is_relative
Unexecuted instantiation: idcin.c:is_relative
Unexecuted instantiation: idroqdec.c:is_relative
Unexecuted instantiation: iff.c:is_relative
Unexecuted instantiation: ifv.c:is_relative
Unexecuted instantiation: ilbc.c:is_relative
Unexecuted instantiation: imfdec.c:is_relative
Unexecuted instantiation: img2_alias_pix.c:is_relative
Unexecuted instantiation: img2_brender_pix.c:is_relative
Unexecuted instantiation: img2dec.c:is_relative
Unexecuted instantiation: imx.c:is_relative
Unexecuted instantiation: ingenientdec.c:is_relative
Unexecuted instantiation: ipmovie.c:is_relative
Unexecuted instantiation: ipudec.c:is_relative
Unexecuted instantiation: ircamdec.c:is_relative
Unexecuted instantiation: isom.c:is_relative
Unexecuted instantiation: iss.c:is_relative
Unexecuted instantiation: iv8.c:is_relative
Unexecuted instantiation: ivfdec.c:is_relative
Unexecuted instantiation: jacosubdec.c:is_relative
Unexecuted instantiation: jpegxl_anim_dec.c:is_relative
Unexecuted instantiation: jvdec.c:is_relative
Unexecuted instantiation: kvag.c:is_relative
Unexecuted instantiation: lafdec.c:is_relative
Unexecuted instantiation: lc3.c:is_relative
Unexecuted instantiation: lmlm4.c:is_relative
Unexecuted instantiation: loasdec.c:is_relative
Unexecuted instantiation: lrcdec.c:is_relative
Unexecuted instantiation: luodatdec.c:is_relative
Unexecuted instantiation: lvfdec.c:is_relative
Unexecuted instantiation: lxfdec.c:is_relative
Unexecuted instantiation: m4vdec.c:is_relative
Unexecuted instantiation: matroskadec.c:is_relative
Unexecuted instantiation: mca.c:is_relative
Unexecuted instantiation: mccdec.c:is_relative
Unexecuted instantiation: mgsts.c:is_relative
Unexecuted instantiation: microdvddec.c:is_relative
Unexecuted instantiation: mj2kdec.c:is_relative
Unexecuted instantiation: mlpdec.c:is_relative
Unexecuted instantiation: mlvdec.c:is_relative
Unexecuted instantiation: mm.c:is_relative
Unexecuted instantiation: mmf.c:is_relative
Unexecuted instantiation: mods.c:is_relative
Unexecuted instantiation: moflex.c:is_relative
Unexecuted instantiation: mov.c:is_relative
Unexecuted instantiation: mp3dec.c:is_relative
Unexecuted instantiation: mpc.c:is_relative
Unexecuted instantiation: mpc8.c:is_relative
Unexecuted instantiation: mpeg.c:is_relative
Unexecuted instantiation: mpegts.c:is_relative
Unexecuted instantiation: mpegvideodec.c:is_relative
Unexecuted instantiation: mpjpegdec.c:is_relative
Unexecuted instantiation: mpl2dec.c:is_relative
Unexecuted instantiation: mpsubdec.c:is_relative
Unexecuted instantiation: msf.c:is_relative
Unexecuted instantiation: msnwc_tcp.c:is_relative
Unexecuted instantiation: mspdec.c:is_relative
Unexecuted instantiation: mtaf.c:is_relative
Unexecuted instantiation: mtv.c:is_relative
Unexecuted instantiation: musx.c:is_relative
Unexecuted instantiation: mvdec.c:is_relative
Unexecuted instantiation: mvi.c:is_relative
Unexecuted instantiation: mxfdec.c:is_relative
Unexecuted instantiation: mxg.c:is_relative
Unexecuted instantiation: ncdec.c:is_relative
Unexecuted instantiation: nistspheredec.c:is_relative
Unexecuted instantiation: nspdec.c:is_relative
Unexecuted instantiation: nsvdec.c:is_relative
Unexecuted instantiation: nutdec.c:is_relative
Unexecuted instantiation: nuv.c:is_relative
Unexecuted instantiation: oggdec.c:is_relative
Unexecuted instantiation: oggparsevorbis.c:is_relative
Unexecuted instantiation: omadec.c:is_relative
Unexecuted instantiation: options.c:is_relative
Unexecuted instantiation: osq.c:is_relative
Unexecuted instantiation: paf.c:is_relative
Unexecuted instantiation: pcmdec.c:is_relative
Unexecuted instantiation: pdvdec.c:is_relative
Unexecuted instantiation: pjsdec.c:is_relative
Unexecuted instantiation: pmpdec.c:is_relative
Unexecuted instantiation: pp_bnk.c:is_relative
Unexecuted instantiation: psxstr.c:is_relative
Unexecuted instantiation: pva.c:is_relative
Unexecuted instantiation: pvfdec.c:is_relative
Unexecuted instantiation: qcp.c:is_relative
Unexecuted instantiation: qoadec.c:is_relative
Unexecuted instantiation: r3d.c:is_relative
Unexecuted instantiation: rawdec.c:is_relative
Unexecuted instantiation: rawvideodec.c:is_relative
Unexecuted instantiation: rcwtdec.c:is_relative
Unexecuted instantiation: realtextdec.c:is_relative
Unexecuted instantiation: redspark.c:is_relative
Unexecuted instantiation: riffdec.c:is_relative
Unexecuted instantiation: rka.c:is_relative
Unexecuted instantiation: rl2.c:is_relative
Unexecuted instantiation: rmdec.c:is_relative
Unexecuted instantiation: rpl.c:is_relative
Unexecuted instantiation: rsd.c:is_relative
Unexecuted instantiation: rsodec.c:is_relative
Unexecuted instantiation: s337m.c:is_relative
Unexecuted instantiation: samidec.c:is_relative
Unexecuted instantiation: sbcdec.c:is_relative
Unexecuted instantiation: sbgdec.c:is_relative
Unexecuted instantiation: sccdec.c:is_relative
Unexecuted instantiation: scd.c:is_relative
Unexecuted instantiation: sdns.c:is_relative
Unexecuted instantiation: sdr2.c:is_relative
Unexecuted instantiation: sdsdec.c:is_relative
Unexecuted instantiation: sdxdec.c:is_relative
seek.c:is_relative
Line
Count
Source
176
477M
{
177
477M
    return ts > (RELATIVE_TS_BASE - (1LL << 48));
178
477M
}
Unexecuted instantiation: segafilm.c:is_relative
Unexecuted instantiation: serdec.c:is_relative
Unexecuted instantiation: sga.c:is_relative
Unexecuted instantiation: shortendec.c:is_relative
Unexecuted instantiation: sierravmd.c:is_relative
Unexecuted instantiation: siff.c:is_relative
Unexecuted instantiation: smacker.c:is_relative
Unexecuted instantiation: smjpegdec.c:is_relative
Unexecuted instantiation: smush.c:is_relative
Unexecuted instantiation: sol.c:is_relative
Unexecuted instantiation: soxdec.c:is_relative
Unexecuted instantiation: spdifdec.c:is_relative
Unexecuted instantiation: srtdec.c:is_relative
Unexecuted instantiation: stldec.c:is_relative
Unexecuted instantiation: subviewer1dec.c:is_relative
Unexecuted instantiation: subviewerdec.c:is_relative
Unexecuted instantiation: supdec.c:is_relative
Unexecuted instantiation: svag.c:is_relative
Unexecuted instantiation: svs.c:is_relative
Unexecuted instantiation: swfdec.c:is_relative
Unexecuted instantiation: takdec.c:is_relative
Unexecuted instantiation: tedcaptionsdec.c:is_relative
Unexecuted instantiation: thp.c:is_relative
Unexecuted instantiation: tiertexseq.c:is_relative
Unexecuted instantiation: tmv.c:is_relative
Unexecuted instantiation: tta.c:is_relative
Unexecuted instantiation: tty.c:is_relative
Unexecuted instantiation: txd.c:is_relative
Unexecuted instantiation: ty.c:is_relative
Unexecuted instantiation: usmdec.c:is_relative
Unexecuted instantiation: vag.c:is_relative
Unexecuted instantiation: vc1dec.c:is_relative
Unexecuted instantiation: vc1test.c:is_relative
Unexecuted instantiation: vividas.c:is_relative
Unexecuted instantiation: vivo.c:is_relative
Unexecuted instantiation: vocdec.c:is_relative
Unexecuted instantiation: vpk.c:is_relative
Unexecuted instantiation: vplayerdec.c:is_relative
Unexecuted instantiation: vqf.c:is_relative
Unexecuted instantiation: vvcdec.c:is_relative
Unexecuted instantiation: wady.c:is_relative
Unexecuted instantiation: wavarc.c:is_relative
Unexecuted instantiation: wavdec.c:is_relative
Unexecuted instantiation: wc3movie.c:is_relative
Unexecuted instantiation: webvttdec.c:is_relative
Unexecuted instantiation: westwood_aud.c:is_relative
Unexecuted instantiation: westwood_vqa.c:is_relative
Unexecuted instantiation: wsddec.c:is_relative
Unexecuted instantiation: wtvdec.c:is_relative
Unexecuted instantiation: wvdec.c:is_relative
Unexecuted instantiation: wvedec.c:is_relative
Unexecuted instantiation: xa.c:is_relative
Unexecuted instantiation: xmd.c:is_relative
Unexecuted instantiation: xmv.c:is_relative
Unexecuted instantiation: xvag.c:is_relative
Unexecuted instantiation: xwma.c:is_relative
Unexecuted instantiation: yop.c:is_relative
Unexecuted instantiation: yuv4mpegdec.c:is_relative
Unexecuted instantiation: 3dostr.c:is_relative
Unexecuted instantiation: 4xm.c:is_relative
Unexecuted instantiation: aacdec.c:is_relative
Unexecuted instantiation: aadec.c:is_relative
Unexecuted instantiation: aaxdec.c:is_relative
Unexecuted instantiation: ac3dec.c:is_relative
Unexecuted instantiation: ac4dec.c:is_relative
Unexecuted instantiation: acedec.c:is_relative
Unexecuted instantiation: acm.c:is_relative
Unexecuted instantiation: act.c:is_relative
Unexecuted instantiation: adp.c:is_relative
Unexecuted instantiation: ads.c:is_relative
Unexecuted instantiation: adxdec.c:is_relative
Unexecuted instantiation: aeadec.c:is_relative
Unexecuted instantiation: afc.c:is_relative
Unexecuted instantiation: aiffdec.c:is_relative
Unexecuted instantiation: aixdec.c:is_relative
Unexecuted instantiation: asf.c:is_relative
Unexecuted instantiation: flac_picture.c:is_relative
179
180
/**
181
 * Wrap a given time stamp, if there is an indication for an overflow
182
 *
183
 * @param st stream
184
 * @param timestamp the time stamp to wrap
185
 * @return resulting time stamp
186
 */
187
int64_t ff_wrap_timestamp(const AVStream *st, int64_t timestamp);
188
189
/**
190
 * Read a transport packet from a media file.
191
 *
192
 * @param s media file handle
193
 * @param pkt is filled
194
 * @return 0 if OK, AVERROR_xxx on error
195
 */
196
int ff_read_packet(AVFormatContext *s, AVPacket *pkt);
197
198
void ff_read_frame_flush(AVFormatContext *s);
199
200
/**
201
 * Perform a binary search using av_index_search_timestamp() and
202
 * FFInputFormat.read_timestamp().
203
 *
204
 * @param target_ts target timestamp in the time base of the given stream
205
 * @param stream_index stream number
206
 */
207
int ff_seek_frame_binary(AVFormatContext *s, int stream_index,
208
                         int64_t target_ts, int flags);
209
210
/**
211
 * Update cur_dts of all streams based on the given timestamp and AVStream.
212
 *
213
 * Stream ref_st unchanged, others set cur_dts in their native time base.
214
 * Only needed for timestamp wrapping or if (dts not set and pts!=dts).
215
 * @param timestamp new dts expressed in time_base of param ref_st
216
 * @param ref_st reference stream giving time_base of param timestamp
217
 */
218
void avpriv_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
219
220
int ff_find_last_ts(AVFormatContext *s, int stream_index, int64_t *ts, int64_t *pos,
221
                    int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
222
223
/**
224
 * Perform a binary search using read_timestamp().
225
 *
226
 * @param target_ts target timestamp in the time base of the given stream
227
 * @param stream_index stream number
228
 */
229
int64_t ff_gen_search(AVFormatContext *s, int stream_index,
230
                      int64_t target_ts, int64_t pos_min,
231
                      int64_t pos_max, int64_t pos_limit,
232
                      int64_t ts_min, int64_t ts_max,
233
                      int flags, int64_t *ts_ret,
234
                      int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
235
236
/**
237
 * Internal version of av_index_search_timestamp
238
 */
239
int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries,
240
                              int64_t wanted_timestamp, int flags);
241
242
/**
243
 * Internal version of av_add_index_entry
244
 */
245
int ff_add_index_entry(AVIndexEntry **index_entries,
246
                       int *nb_index_entries,
247
                       unsigned int *index_entries_allocated_size,
248
                       int64_t pos, int64_t timestamp, int size, int distance, int flags);
249
250
void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance);
251
252
/**
253
 * Ensure the index uses less memory than the maximum specified in
254
 * AVFormatContext.max_index_size by discarding entries if it grows
255
 * too large.
256
 */
257
void ff_reduce_index(AVFormatContext *s, int stream_index);
258
259
/**
260
 * add frame for rfps calculation.
261
 *
262
 * @param dts timestamp of the i-th frame
263
 * @return 0 if OK, AVERROR_xxx on error
264
 */
265
int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t dts);
266
267
void ff_rfps_calculate(AVFormatContext *ic);
268
269
/**
270
 * Rescales a timestamp and the endpoints of an interval to which the temstamp
271
 * belongs, from a timebase `tb_in` to a timebase `tb_out`.
272
 *
273
 * The upper (lower) bound of the output interval is rounded up (down) such that
274
 * the output interval always falls within the intput interval. The timestamp is
275
 * rounded to the nearest integer and halfway cases away from zero, and can
276
 * therefore fall outside of the output interval.
277
 *
278
 * Useful to simplify the rescaling of the arguments of FFInputFormat::read_seek2()
279
 *
280
 * @param[in] tb_in      Timebase of the input `min_ts`, `ts` and `max_ts`
281
 * @param[in] tb_out     Timebase of the output `min_ts`, `ts` and `max_ts`
282
 * @param[in,out] min_ts Lower bound of the interval
283
 * @param[in,out] ts     Timestamp
284
 * @param[in,out] max_ts Upper bound of the interval
285
 */
286
void ff_rescale_interval(AVRational tb_in, AVRational tb_out,
287
                         int64_t *min_ts, int64_t *ts, int64_t *max_ts);
288
289
void avpriv_stream_set_need_parsing(AVStream *st, enum AVStreamParseType type);
290
291
/**
292
 * Add a new chapter.
293
 *
294
 * @param s media file handle
295
 * @param id unique ID for this chapter
296
 * @param start chapter start time in time_base units
297
 * @param end chapter end time in time_base units
298
 * @param title chapter title
299
 *
300
 * @return AVChapter or NULL on error
301
 */
302
AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base,
303
                              int64_t start, int64_t end, const char *title);
304
305
/**
306
 * Add an attached pic to an AVStream.
307
 *
308
 * @param st   if set, the stream to add the attached pic to;
309
 *             if unset, a new stream will be added to s.
310
 * @param pb   AVIOContext to read data from if buf is unset.
311
 * @param buf  if set, it contains the data and size information to be used
312
 *             for the attached pic; if unset, data is read from pb.
313
 * @param size the size of the data to read if buf is unset.
314
 *
315
 * @return 0 on success, < 0 on error. On error, this function removes
316
 *         the stream it has added (if any).
317
 */
318
int ff_add_attached_pic(AVFormatContext *s, AVStream *st, AVIOContext *pb,
319
                        AVBufferRef **buf, int size);
320
321
/**
322
 * Add side data to a packet for changing parameters to the given values.
323
 * Parameters set to 0 aren't included in the change.
324
 */
325
int ff_add_param_change(AVPacket *pkt, int32_t channels,
326
                        uint64_t channel_layout, int32_t sample_rate,
327
                        int32_t width, int32_t height);
328
329
/**
330
 * Generate standard extradata for AVC-Intra based on width/height and field
331
 * order.
332
 */
333
int ff_generate_avci_extradata(AVStream *st);
334
335
/**
336
 * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end
337
 * which is always set to 0 and fill it from pb.
338
 *
339
 * @param size size of extradata
340
 * @return >= 0 if OK, AVERROR_xxx on error
341
 */
342
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size);
343
344
/**
345
 * Find stream index based on format-specific stream ID
346
 * @return stream index, or < 0 on error
347
 */
348
int ff_find_stream_index(const AVFormatContext *s, int id);
349
350
int ff_buffer_packet(AVFormatContext *s, AVPacket *pkt);
351
352
#endif /* AVFORMAT_DEMUX_H */