1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavf: Constify the probe function argument.

Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
This commit is contained in:
Carl Eugen Hoyos 2019-03-21 01:18:37 +01:00
parent 6dc1da416e
commit 4d8875ec23
214 changed files with 256 additions and 256 deletions

View File

@ -22,7 +22,7 @@
#include "avformat.h"
#include "internal.h"
static int threedostr_probe(AVProbeData *p)
static int threedostr_probe(const AVProbeData *p)
{
if (memcmp(p->buf, "CTRL", 4) &&
memcmp(p->buf, "SHDR", 4) &&

View File

@ -81,7 +81,7 @@ typedef struct FourxmDemuxContext {
AVRational fps;
} FourxmDemuxContext;
static int fourxm_probe(AVProbeData *p)
static int fourxm_probe(const AVProbeData *p)
{
if ((AV_RL32(&p->buf[0]) != RIFF_TAG) ||
(AV_RL32(&p->buf[8]) != FOURXMV_TAG))

View File

@ -30,7 +30,7 @@
#define ADTS_HEADER_SIZE 7
static int adts_aac_probe(AVProbeData *p)
static int adts_aac_probe(const AVProbeData *p)
{
int max_frames = 0, first_frames = 0;
int fsize, frames;

View File

@ -360,7 +360,7 @@ static int aa_read_seek(AVFormatContext *s,
return 1;
}
static int aa_probe(AVProbeData *p)
static int aa_probe(const AVProbeData *p)
{
uint8_t *buf = p->buf;

View File

@ -25,7 +25,7 @@
#include "avformat.h"
#include "rawdec.h"
static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
static int ac3_eac3_probe(const AVProbeData *p, enum AVCodecID expected_codec_id)
{
int max_frames, first_frames = 0, frames;
const uint8_t *buf, *buf2, *end;
@ -97,7 +97,7 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
}
#if CONFIG_AC3_DEMUXER
static int ac3_probe(AVProbeData *p)
static int ac3_probe(const AVProbeData *p)
{
return ac3_eac3_probe(p, AV_CODEC_ID_AC3);
}
@ -115,7 +115,7 @@ AVInputFormat ff_ac3_demuxer = {
#endif
#if CONFIG_EAC3_DEMUXER
static int eac3_probe(AVProbeData *p)
static int eac3_probe(const AVProbeData *p)
{
return ac3_eac3_probe(p, AV_CODEC_ID_EAC3);
}

View File

@ -24,7 +24,7 @@
#include "rawdec.h"
#include "internal.h"
static int acm_probe(AVProbeData *p)
static int acm_probe(const AVProbeData *p)
{
if (AV_RB32(p->buf) != 0x97280301)
return 0;

View File

@ -33,7 +33,7 @@ typedef struct{
char second_packet; ///< 1 - if temporary buffer contains valid (second) G.729 packet
} ACTContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
int i;

View File

@ -24,7 +24,7 @@
#include "avformat.h"
#include "internal.h"
static int adp_probe(AVProbeData *p)
static int adp_probe(const AVProbeData *p)
{
int i, changes = 0;
uint8_t last = 0;

View File

@ -23,7 +23,7 @@
#include "avformat.h"
#include "internal.h"
static int ads_probe(AVProbeData *p)
static int ads_probe(const AVProbeData *p)
{
if (memcmp(p->buf, "SShd", 4) ||
memcmp(p->buf+32, "SSbd", 4))

View File

@ -34,7 +34,7 @@ typedef struct ADXDemuxerContext {
int header_size;
} ADXDemuxerContext;
static int adx_probe(AVProbeData *p)
static int adx_probe(const AVProbeData *p)
{
int offset;
if (AV_RB16(p->buf) != 0x8000)

View File

@ -27,7 +27,7 @@
#define AT1_SU_SIZE 212
static int aea_read_probe(AVProbeData *p)
static int aea_read_probe(const AVProbeData *p)
{
if (p->buf_size <= 2048+212)
return 0;

View File

@ -189,7 +189,7 @@ static int get_aiff_header(AVFormatContext *s, int size,
return num_frames;
}
static int aiff_probe(AVProbeData *p)
static int aiff_probe(const AVProbeData *p)
{
/* check file header */
if (p->buf[0] == 'F' && p->buf[1] == 'O' &&

View File

@ -23,7 +23,7 @@
#include "avformat.h"
#include "internal.h"
static int aix_probe(AVProbeData *p)
static int aix_probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) != MKTAG('A','I','X','F') ||
AV_RB32(p->buf + 8) != 0x01000014 ||

View File

@ -71,7 +71,7 @@ static int amr_write_packet(AVFormatContext *s, AVPacket *pkt)
}
#endif /* CONFIG_AMR_MUXER */
static int amr_probe(AVProbeData *p)
static int amr_probe(const AVProbeData *p)
{
// Only check for "#!AMR" which could be amr-wb, amr-nb.
// This will also trigger multichannel files: "#!AMR_MC1.0\n" and
@ -176,7 +176,7 @@ AVInputFormat ff_amr_demuxer = {
#endif
#if CONFIG_AMRNB_DEMUXER
static int amrnb_probe(AVProbeData *p)
static int amrnb_probe(const AVProbeData *p)
{
int mode, i = 0, valid = 0, invalid = 0;
const uint8_t *b = p->buf;
@ -232,7 +232,7 @@ AVInputFormat ff_amrnb_demuxer = {
#endif
#if CONFIG_AMRWB_DEMUXER
static int amrwb_probe(AVProbeData *p)
static int amrwb_probe(const AVProbeData *p)
{
int mode, i = 0, valid = 0, invalid = 0;
const uint8_t *b = p->buf;

View File

@ -47,7 +47,7 @@ typedef struct AnmDemuxContext {
#define LPF_TAG MKTAG('L','P','F',' ')
#define ANIM_TAG MKTAG('A','N','I','M')
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
/* verify tags and video dimensions */
if (AV_RL32(&p->buf[0]) == LPF_TAG &&

View File

@ -25,7 +25,7 @@
#include "avformat.h"
#include "internal.h"
static int apc_probe(AVProbeData *p)
static int apc_probe(const AVProbeData *p)
{
if (!strncmp(p->buf, "CRYO_APC", 8))
return AVPROBE_SCORE_MAX;

View File

@ -83,7 +83,7 @@ typedef struct APEContext {
uint8_t *bittable;
} APEContext;
static int ape_probe(AVProbeData * p)
static int ape_probe(const AVProbeData * p)
{
int version = AV_RL16(p->buf+4);
if (AV_RL32(p->buf) != MKTAG('M', 'A', 'C', ' '))

View File

@ -66,7 +66,7 @@ typedef struct APNGDemuxContext {
* ...
* IDAT
*/
static int apng_probe(AVProbeData *p)
static int apng_probe(const AVProbeData *p)
{
GetByteContext gb;
int state = 0;

View File

@ -37,7 +37,7 @@ typedef struct {
AVRational frame_rate;
} AQTitleContext;
static int aqt_probe(AVProbeData *p)
static int aqt_probe(const AVProbeData *p)
{
int frame;
const char *ptr = p->buf;

View File

@ -186,7 +186,7 @@ static void print_guid(ff_asf_guid *g)
#define print_guid(g) while(0)
#endif
static int asf_probe(AVProbeData *pd)
static int asf_probe(const AVProbeData *pd)
{
/* check file header */
if (!ff_guidcmp(pd->buf, &ff_asf_header))

View File

@ -147,7 +147,7 @@ typedef struct ASFContext {
static int detect_unknown_subobject(AVFormatContext *s, int64_t offset, int64_t size);
static const GUIDParseTable *find_guid(ff_asf_guid guid);
static int asf_probe(AVProbeData *pd)
static int asf_probe(const AVProbeData *pd)
{
/* check file header */
if (!ff_guidcmp(pd->buf, &ff_asf_header))

View File

@ -33,7 +33,7 @@ typedef struct ASSContext {
unsigned readorder;
} ASSContext;
static int ass_probe(AVProbeData *p)
static int ass_probe(const AVProbeData *p)
{
char buf[13];
FFTextReader tr;

View File

@ -25,7 +25,7 @@
#include "internal.h"
#include "ast.h"
static int ast_probe(AVProbeData *p)
static int ast_probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) != MKTAG('S','T','R','M'))
return 0;

View File

@ -57,7 +57,7 @@ static const AVCodecTag codec_au_tags[] = {
#if CONFIG_AU_DEMUXER
static int au_probe(AVProbeData *p)
static int au_probe(const AVProbeData *p)
{
if (p->buf[0] == '.' && p->buf[1] == 's' &&
p->buf[2] == 'n' && p->buf[3] == 'd')

View File

@ -702,7 +702,7 @@ typedef struct AVInputFormat {
* The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
* big so you do not have to check for that unless you need more.
*/
int (*read_probe)(AVProbeData *);
int (*read_probe)(const AVProbeData *);
/**
* Read the format header and initialize the AVFormatContext

View File

@ -1920,7 +1920,7 @@ static int avi_read_close(AVFormatContext *s)
return 0;
}
static int avi_probe(AVProbeData *p)
static int avi_probe(const AVProbeData *p)
{
int i;

View File

@ -24,7 +24,7 @@
#include "internal.h"
#include "pcm.h"
static int avr_probe(AVProbeData *p)
static int avr_probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) != MKTAG('2', 'B', 'I', 'T'))
return 0;

View File

@ -50,7 +50,7 @@ typedef enum avs_block_type {
AVS_GAME_DATA = 0x04,
} AvsBlockType;
static int avs_probe(AVProbeData * p)
static int avs_probe(const AVProbeData * p)
{
const uint8_t *d;

View File

@ -55,7 +55,7 @@ typedef struct BVID_DemuxContext
} BVID_DemuxContext;
static int vid_probe(AVProbeData *p)
static int vid_probe(const AVProbeData *p)
{
// little-endian VID tag, file starts with "VID\0"
if (AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))

View File

@ -39,7 +39,7 @@ typedef struct BFIContext {
int avflag;
} BFIContext;
static int bfi_probe(AVProbeData * p)
static int bfi_probe(const AVProbeData * p)
{
/* Check file header */
if (AV_RL32(p->buf) == MKTAG('B', 'F', '&', 'I'))

View File

@ -59,7 +59,7 @@ typedef struct BinkDemuxContext {
int smush_size;
} BinkDemuxContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
int smush = AV_RN32(p->buf) == AV_RN32("SMUS");

View File

@ -126,7 +126,7 @@ static void predict_width(AVCodecParameters *par, uint64_t fsize, int got_width)
par->width = fsize > 4000 ? (160<<3) : (80<<3);
}
static int bin_probe(AVProbeData *p)
static int bin_probe(const AVProbeData *p)
{
const uint8_t *d = p->buf;
int magic = 0, sauce = 0;
@ -204,7 +204,7 @@ static int bintext_read_header(AVFormatContext *s)
#endif /* CONFIG_BINTEXT_DEMUXER */
#if CONFIG_XBIN_DEMUXER
static int xbin_probe(AVProbeData *p)
static int xbin_probe(const AVProbeData *p)
{
const uint8_t *d = p->buf;
@ -302,7 +302,7 @@ static const uint8_t idf_magic[] = {
0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
};
static int idf_probe(AVProbeData *p)
static int idf_probe(const AVProbeData *p)
{
if (p->buf_size < sizeof(idf_magic))
return 0;

View File

@ -30,7 +30,7 @@
#define BIT_1 0x81
#if CONFIG_BIT_DEMUXER
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
int i = 0, j, valid = 0;

View File

@ -24,7 +24,7 @@
#include "avformat.h"
#include "internal.h"
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
if (p->buf_size < 2096)
return 0;

View File

@ -38,7 +38,7 @@ typedef struct BRSTMDemuxContext {
int little_endian;
} BRSTMDemuxContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('R','S','T','M') &&
(AV_RL16(p->buf + 4) == 0xFFFE ||
@ -47,7 +47,7 @@ static int probe(AVProbeData *p)
return 0;
}
static int probe_bfstm(AVProbeData *p)
static int probe_bfstm(const AVProbeData *p)
{
if ((AV_RL32(p->buf) == MKTAG('F','S','T','M') ||
AV_RL32(p->buf) == MKTAG('C','S','T','M')) &&

View File

@ -43,7 +43,7 @@ typedef struct C93DemuxContext {
AVStream *audio;
} C93DemuxContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
int i;
int index = 1;

View File

@ -48,7 +48,7 @@ typedef struct CafContext {
int64_t data_size; ///< raw data size, in bytes
} CafContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
if (AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1)
return AVPROBE_SCORE_MAX;

View File

@ -30,7 +30,7 @@
#define CAVS_VIDEO_EDIT_CODE 0x000001b7
#define CAVS_PROFILE_JIZHUN 0x20
static int cavsvideo_probe(AVProbeData *p)
static int cavsvideo_probe(const AVProbeData *p)
{
uint32_t code= -1;
int pic=0, seq=0, slice_pos = 0;

View File

@ -40,7 +40,7 @@ typedef struct CDXLDemuxContext {
int64_t filesize;
} CDXLDemuxContext;
static int cdxl_read_probe(AVProbeData *p)
static int cdxl_read_probe(const AVProbeData *p)
{
int score = AVPROBE_SCORE_EXTENSION + 10;

View File

@ -56,7 +56,7 @@ enum {
#define CFA_BLGRAY 0x20000000U
#define CFA_BRGRAY 0x10000000U
static int cine_read_probe(AVProbeData *p)
static int cine_read_probe(const AVProbeData *p)
{
int HeaderSize;
if (p->buf[0] == 'C' && p->buf[1] == 'I' && // Type

View File

@ -43,7 +43,7 @@ typedef struct {
int frames_per_packet;
} Codec2Context;
static int codec2_probe(AVProbeData *p)
static int codec2_probe(const AVProbeData *p)
{
//must start wih C0 DE C2
if (AV_RB24(p->buf) != AVPRIV_CODEC2_MAGIC) {

View File

@ -68,7 +68,7 @@ typedef struct {
int segment_time_metadata;
} ConcatContext;
static int concat_probe(AVProbeData *probe)
static int concat_probe(const AVProbeData *probe)
{
return memcmp(probe->buf, "ffconcat version 1.0", 20) ?
0 : AVPROBE_SCORE_MAX;

View File

@ -2302,7 +2302,7 @@ static int dash_read_seek(AVFormatContext *s, int stream_index, int64_t timestam
return ret;
}
static int dash_probe(AVProbeData *p)
static int dash_probe(const AVProbeData *p)
{
if (!av_stristr(p->buf, "<MPD"))
return 0;

View File

@ -31,7 +31,7 @@
#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 0xB5 || (x) == 0xB7 )
#define ISAVS2(x) ((x) == 0x20 || (x) == 0x22 || (x) == 0x30 || (x) == 0x32 )
static int avs2_probe(AVProbeData *p)
static int avs2_probe(const AVProbeData *p)
{
uint32_t code= -1, hds=0, pic=0, seq=0;
uint8_t state=0;

View File

@ -22,7 +22,7 @@
#include "avformat.h"
#include "internal.h"
static int dcstr_probe(AVProbeData *p)
static int dcstr_probe(const AVProbeData *p)
{
if (p->buf_size < 224 || memcmp(p->buf + 213, "Sega Stream", 11))
return 0;

View File

@ -25,7 +25,7 @@
#include "avformat.h"
#include "internal.h"
static int dfa_probe(AVProbeData *p)
static int dfa_probe(const AVProbeData *p)
{
if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('D', 'F', 'I', 'A'))
return 0;

View File

@ -49,7 +49,7 @@ typedef struct DHAVStream {
int64_t pts;
} DHAVStream;
static int dhav_probe(AVProbeData *p)
static int dhav_probe(const AVProbeData *p)
{
if (!memcmp(p->buf, "DAHUA", 5))
return AVPROBE_SCORE_MAX;

View File

@ -23,7 +23,7 @@
#include "avformat.h"
#include "rawdec.h"
static int dirac_probe(AVProbeData *p)
static int dirac_probe(const AVProbeData *p)
{
unsigned size;
if (AV_RL32(p->buf) != MKTAG('B', 'B', 'C', 'D'))

View File

@ -25,7 +25,7 @@
#include "rawdec.h"
#include "libavcodec/dnxhddata.h"
static int dnxhd_probe(AVProbeData *p)
static int dnxhd_probe(const AVProbeData *p)
{
int w, h, compression_id;
if (p->buf_size < 0x2c)

View File

@ -30,7 +30,7 @@ typedef struct {
uint64_t data_size;
} DSFContext;
static int dsf_probe(AVProbeData *p)
static int dsf_probe(const AVProbeData *p)
{
if (p->buf_size < 12 || memcmp(p->buf, "DSD ", 4) || AV_RL64(p->buf + 4) != 28)
return 0;

View File

@ -60,7 +60,7 @@ typedef struct CinDemuxContext {
} CinDemuxContext;
static int cin_probe(AVProbeData *p)
static int cin_probe(const AVProbeData *p)
{
/* header starts with this special marker */
if (AV_RL32(&p->buf[0]) != 0x55AA0000)

View File

@ -58,7 +58,7 @@ typedef struct DSSDemuxContext {
int dss_header_size;
} DSSDemuxContext;
static int dss_probe(AVProbeData *p)
static int dss_probe(const AVProbeData *p)
{
if ( AV_RL32(p->buf) != MKTAG(0x2, 'd', 's', 's')
&& AV_RL32(p->buf) != MKTAG(0x3, 'd', 's', 's'))

View File

@ -29,7 +29,7 @@
#include "avformat.h"
#include "rawdec.h"
static int dts_probe(AVProbeData *p)
static int dts_probe(const AVProbeData *p)
{
const uint8_t *buf, *bufp;
uint32_t state = -1;

View File

@ -43,7 +43,7 @@ typedef struct DTSHDDemuxContext {
uint64_t data_end;
} DTSHDDemuxContext;
static int dtshd_probe(AVProbeData *p)
static int dtshd_probe(const AVProbeData *p)
{
if (AV_RB64(p->buf) == DTSHDHDR)
return AVPROBE_SCORE_MAX;

View File

@ -587,7 +587,7 @@ static int dv_read_close(AVFormatContext *s)
return 0;
}
static int dv_probe(AVProbeData *p)
static int dv_probe(const AVProbeData *p)
{
unsigned marker_pos = 0;
int i;

View File

@ -25,7 +25,7 @@
#include "rawdec.h"
static int dvbsub_probe(AVProbeData *p)
static int dvbsub_probe(const AVProbeData *p)
{
int i, j, k;
const uint8_t *end = p->buf + p->buf_size;

View File

@ -24,7 +24,7 @@
#include "avformat.h"
#include "rawdec.h"
static int dvbtxt_probe(AVProbeData *p)
static int dvbtxt_probe(const AVProbeData *p)
{
const uint8_t *end = p->buf + p->buf_size;
const uint8_t *buf;

View File

@ -37,7 +37,7 @@ typedef struct DXAContext {
int readvid;
}DXAContext;
static int dxa_probe(AVProbeData *p)
static int dxa_probe(const AVProbeData *p)
{
int w, h;
if (p->buf_size < 15)

View File

@ -36,7 +36,7 @@ typedef struct CdataDemuxContext {
unsigned int audio_pts;
} CdataDemuxContext;
static int cdata_probe(AVProbeData *p)
static int cdata_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;

View File

@ -458,7 +458,7 @@ static int process_ea_header(AVFormatContext *s)
return 1;
}
static int ea_probe(AVProbeData *p)
static int ea_probe(const AVProbeData *p)
{
unsigned big_endian, size;

View File

@ -25,7 +25,7 @@
#include "internal.h"
#include "pcm.h"
static int epaf_probe(AVProbeData *p)
static int epaf_probe(const AVProbeData *p)
{
if (((AV_RL32(p->buf) == MKTAG('f','a','p',' ') &&
AV_RL32(p->buf + 8) == 1) ||

View File

@ -26,7 +26,7 @@
#include "internal.h"
#include "libavutil/dict.h"
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
if(!memcmp(p->buf, ID_STRING, strlen(ID_STRING)))
return AVPROBE_SCORE_MAX;

View File

@ -39,7 +39,7 @@ typedef struct FITSContext {
int64_t pts;
} FITSContext;
static int fits_probe(AVProbeData *p)
static int fits_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
if (!memcmp(b, "SIMPLE = T", 30))

View File

@ -211,7 +211,7 @@ fail:
return ret;
}
static int raw_flac_probe(AVProbeData *p)
static int raw_flac_probe(const AVProbeData *p)
{
if ((p->buf[2] & 0xF0) == 0) // blocksize code invalid
return 0;
@ -227,7 +227,7 @@ static int raw_flac_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION / 4 + 1;
}
static int flac_probe(AVProbeData *p)
static int flac_probe(const AVProbeData *p)
{
if ((AV_RB16(p->buf) & 0xFFFE) == 0xFFF8)
return raw_flac_probe(p);

View File

@ -57,7 +57,7 @@ typedef struct FlicDemuxContext {
int frame_number;
} FlicDemuxContext;
static int flic_probe(AVProbeData *p)
static int flic_probe(const AVProbeData *p)
{
int magic_number;

View File

@ -77,7 +77,7 @@ typedef struct FLVContext {
int64_t time_pos;
} FLVContext;
static int probe(AVProbeData *p, int live)
static int probe(const AVProbeData *p, int live)
{
const uint8_t *d = p->buf;
unsigned offset = AV_RB32(d + 5);
@ -96,12 +96,12 @@ static int probe(AVProbeData *p, int live)
return 0;
}
static int flv_probe(AVProbeData *p)
static int flv_probe(const AVProbeData *p)
{
return probe(p, 0);
}
static int live_flv_probe(AVProbeData *p)
static int live_flv_probe(const AVProbeData *p)
{
return probe(p, 1);
}

View File

@ -42,7 +42,7 @@ typedef struct {
int count;
} FrmContext;
static int frm_read_probe(AVProbeData *p)
static int frm_read_probe(const AVProbeData *p)
{
if (p->buf_size > 8 &&
p->buf[0] == 'F' && p->buf[1] == 'R' && p->buf[2] == 'M' &&

View File

@ -25,7 +25,7 @@
#include "avio.h"
#include "internal.h"
static int fsb_probe(AVProbeData *p)
static int fsb_probe(const AVProbeData *p)
{
if (memcmp(p->buf, "FSB", 3) || p->buf[3] - '0' < 1 || p->buf[3] - '0' > 5)
return 0;

View File

@ -34,7 +34,7 @@ typedef struct GDVContext {
unsigned pal[256];
} GDVContext;
static int gdv_read_probe(AVProbeData *p)
static int gdv_read_probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) == 0x29111994)
return AVPROBE_SCORE_MAX;

View File

@ -29,7 +29,7 @@ typedef struct GENHDemuxContext {
unsigned interleave_size;
} GENHDemuxContext;
static int genh_probe(AVProbeData *p)
static int genh_probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) != MKTAG('G','E','N','H'))
return 0;

View File

@ -69,7 +69,7 @@ typedef struct GIFDemuxContext {
*/
#define GIF_MIN_DELAY 2
static int gif_probe(AVProbeData *p)
static int gif_probe(const AVProbeData *p)
{
/* check magick */
if (memcmp(p->buf, gif87a_sig, 6) && memcmp(p->buf, gif89a_sig, 6))

View File

@ -34,7 +34,7 @@ typedef struct GSMDemuxerContext {
int sample_rate;
} GSMDemuxerContext;
static int gsm_probe(AVProbeData *p)
static int gsm_probe(const AVProbeData *p)
{
int valid = 0, invalid = 0;
uint8_t *b = p->buf;

View File

@ -86,7 +86,7 @@ static int parse_packet_header(AVIOContext *pb, GXFPktType *type, int *length) {
/**
* @brief check if file starts with a PKT_MAP header
*/
static int gxf_probe(AVProbeData *p) {
static int gxf_probe(const AVProbeData *p) {
static const uint8_t startcode[] = {0, 0, 0, 0, 1, 0xbc}; // start with map packet
static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2};
if (!memcmp(p->buf, startcode, sizeof(startcode)) &&

View File

@ -23,7 +23,7 @@
#include "avformat.h"
#include "rawdec.h"
static int h261_probe(AVProbeData *p)
static int h261_probe(const AVProbeData *p)
{
int i;
int valid_psc=0;

View File

@ -22,7 +22,7 @@
#include "avformat.h"
#include "rawdec.h"
static int h263_probe(AVProbeData *p)
static int h263_probe(const AVProbeData *p)
{
uint64_t code= -1;
int i;

View File

@ -28,7 +28,7 @@
#define MAX_SPS_COUNT 32
#define MAX_PPS_COUNT 256
static int h264_probe(AVProbeData *p)
static int h264_probe(const AVProbeData *p)
{
uint32_t code = -1;
int sps = 0, pps = 0, idr = 0, res = 0, sli = 0;

View File

@ -25,7 +25,7 @@
#include "internal.h"
#include "pcm.h"
static int hcom_probe(AVProbeData *p)
static int hcom_probe(const AVProbeData *p)
{
if (p->buf_size < 132)
return 0;

View File

@ -24,7 +24,7 @@
#include "avformat.h"
#include "rawdec.h"
static int hevc_probe(AVProbeData *p)
static int hevc_probe(const AVProbeData *p)
{
uint32_t code = -1;
int vps = 0, sps = 0, pps = 0, irap = 0;

View File

@ -2285,7 +2285,7 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
return 0;
}
static int hls_probe(AVProbeData *p)
static int hls_probe(const AVProbeData *p)
{
/* Require #EXTM3U at the start, and either one of the ones below
* somewhere for a proper match. */

View File

@ -52,7 +52,7 @@ typedef struct Hnm4DemuxContext {
AVPacket vpkt;
} Hnm4DemuxContext;
static int hnm_probe(AVProbeData *p)
static int hnm_probe(const AVProbeData *p)
{
if (p->buf_size < 4)
return 0;

View File

@ -43,7 +43,7 @@ typedef struct {
IcoImage * images;
} IcoDemuxContext;
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
unsigned i, frames, checked = 0;

View File

@ -91,7 +91,7 @@ typedef struct IdcinDemuxContext {
int64_t first_pkt_pos;
} IdcinDemuxContext;
static int idcin_probe(AVProbeData *p)
static int idcin_probe(const AVProbeData *p)
{
unsigned int number, sample_rate;
unsigned int w, h;

View File

@ -59,7 +59,7 @@ typedef struct RoqDemuxContext {
} RoqDemuxContext;
static int roq_probe(AVProbeData *p)
static int roq_probe(const AVProbeData *p)
{
if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
(AV_RL32(&p->buf[2]) != 0xFFFFFFFF))

View File

@ -142,7 +142,7 @@ static int get_metadata(AVFormatContext *s,
return 0;
}
static int iff_probe(AVProbeData *p)
static int iff_probe(const AVProbeData *p)
{
const uint8_t *d = p->buf;

View File

@ -59,7 +59,7 @@ static int ilbc_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
static int ilbc_probe(AVProbeData *p)
static int ilbc_probe(const AVProbeData *p)
{
// Only check for "#!iLBC" which matches both formats
if (!memcmp(p->buf, mode20_header, 6))

View File

@ -22,7 +22,7 @@
#include "img2.h"
#include "libavcodec/bytestream.h"
static int alias_pix_read_probe(AVProbeData *p)
static int alias_pix_read_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
const uint8_t *end = b + p->buf_size;

View File

@ -22,7 +22,7 @@
#include "img2.h"
#include "libavutil/intreadwrite.h"
static int brender_read_probe(AVProbeData *p)
static int brender_read_probe(const AVProbeData *p)
{
static const uint8_t brender_magic[16] = {
0,0,0,0x12,0,0,0,8,0,0,0,2,0,0,0,2

View File

@ -160,7 +160,7 @@ fail:
return -1;
}
static int img_read_probe(AVProbeData *p)
static int img_read_probe(const AVProbeData *p)
{
if (p->filename && ff_guess_image2_codec(p->filename)) {
if (av_filename_number_test(p->filename))
@ -629,7 +629,7 @@ AVInputFormat ff_image2pipe_demuxer = {
};
#endif
static int bmp_probe(AVProbeData *p)
static int bmp_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
int ihsize;
@ -647,7 +647,7 @@ static int bmp_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION / 4;
}
static int dds_probe(AVProbeData *p)
static int dds_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -658,7 +658,7 @@ static int dds_probe(AVProbeData *p)
return 0;
}
static int dpx_probe(AVProbeData *p)
static int dpx_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
int w, h;
@ -676,7 +676,7 @@ static int dpx_probe(AVProbeData *p)
return 0;
}
static int exr_probe(AVProbeData *p)
static int exr_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -685,7 +685,7 @@ static int exr_probe(AVProbeData *p)
return 0;
}
static int j2k_probe(AVProbeData *p)
static int j2k_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -695,7 +695,7 @@ static int j2k_probe(AVProbeData *p)
return 0;
}
static int jpeg_probe(AVProbeData *p)
static int jpeg_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
int i, state = SOI;
@ -770,7 +770,7 @@ static int jpeg_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION / 8;
}
static int jpegls_probe(AVProbeData *p)
static int jpegls_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -779,7 +779,7 @@ static int jpegls_probe(AVProbeData *p)
return 0;
}
static int pcx_probe(AVProbeData *p)
static int pcx_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -800,7 +800,7 @@ static int pcx_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION + 1;
}
static int qdraw_probe(AVProbeData *p)
static int qdraw_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -816,7 +816,7 @@ static int qdraw_probe(AVProbeData *p)
return 0;
}
static int pictor_probe(AVProbeData *p)
static int pictor_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -825,7 +825,7 @@ static int pictor_probe(AVProbeData *p)
return 0;
}
static int png_probe(AVProbeData *p)
static int png_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -834,7 +834,7 @@ static int png_probe(AVProbeData *p)
return 0;
}
static int psd_probe(AVProbeData *p)
static int psd_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
int ret = 0;
@ -862,7 +862,7 @@ static int psd_probe(AVProbeData *p)
return AVPROBE_SCORE_EXTENSION + ret;
}
static int sgi_probe(AVProbeData *p)
static int sgi_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -874,7 +874,7 @@ static int sgi_probe(AVProbeData *p)
return 0;
}
static int sunrast_probe(AVProbeData *p)
static int sunrast_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -883,7 +883,7 @@ static int sunrast_probe(AVProbeData *p)
return 0;
}
static int svg_probe(AVProbeData *p)
static int svg_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
const uint8_t *end = p->buf + p->buf_size;
@ -903,7 +903,7 @@ static int svg_probe(AVProbeData *p)
return 0;
}
static int tiff_probe(AVProbeData *p)
static int tiff_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -913,7 +913,7 @@ static int tiff_probe(AVProbeData *p)
return 0;
}
static int webp_probe(AVProbeData *p)
static int webp_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -941,39 +941,39 @@ static inline int pnm_probe(const AVProbeData *p)
return 0;
}
static int pbm_probe(AVProbeData *p)
static int pbm_probe(const AVProbeData *p)
{
return pnm_magic_check(p, 1) || pnm_magic_check(p, 4) ? pnm_probe(p) : 0;
}
static inline int pgmx_probe(AVProbeData *p)
static inline int pgmx_probe(const AVProbeData *p)
{
return pnm_magic_check(p, 2) || pnm_magic_check(p, 5) ? pnm_probe(p) : 0;
}
static int pgm_probe(AVProbeData *p)
static int pgm_probe(const AVProbeData *p)
{
int ret = pgmx_probe(p);
return ret && !av_match_ext(p->filename, "pgmyuv") ? ret : 0;
}
static int pgmyuv_probe(AVProbeData *p) // custom FFmpeg format recognized by file extension
static int pgmyuv_probe(const AVProbeData *p) // custom FFmpeg format recognized by file extension
{
int ret = pgmx_probe(p);
return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
}
static int ppm_probe(AVProbeData *p)
static int ppm_probe(const AVProbeData *p)
{
return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
}
static int pam_probe(AVProbeData *p)
static int pam_probe(const AVProbeData *p)
{
return pnm_magic_check(p, 7) ? pnm_probe(p) : 0;
}
static int xpm_probe(AVProbeData *p)
static int xpm_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
@ -982,7 +982,7 @@ static int xpm_probe(AVProbeData *p)
return 0;
}
static int xwd_probe(AVProbeData *p)
static int xwd_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
unsigned width, bpp, bpad, lsize;
@ -1012,7 +1012,7 @@ static int xwd_probe(AVProbeData *p)
return AVPROBE_SCORE_MAX / 2 + 1;
}
static int gif_probe(AVProbeData *p)
static int gif_probe(const AVProbeData *p)
{
/* check magick */
if (memcmp(p->buf, gif87a_sig, 6) && memcmp(p->buf, gif89a_sig, 6))

View File

@ -24,7 +24,7 @@
#include "libavutil/intreadwrite.h"
// http://multimedia.cx/ingenient.txt
static int ingenient_probe(AVProbeData *p)
static int ingenient_probe(const AVProbeData *p)
{
if ( AV_RN32(p->buf) != AV_RN32("MJPG")
|| p->buf_size < 50

View File

@ -614,7 +614,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb,
static const char signature[] = "Interplay MVE File\x1A\0\x1A";
static int ipmovie_probe(AVProbeData *p)
static int ipmovie_probe(const AVProbeData *p)
{
const uint8_t *b = p->buf;
const uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);

View File

@ -26,7 +26,7 @@
#include "pcm.h"
#include "ircam.h"
static int ircam_probe(AVProbeData *p)
static int ircam_probe(const AVProbeData *p)
{
if ((p->buf[0] == 0x64 && p->buf[1] == 0xA3 && p->buf[3] == 0x00 &&
p->buf[2] >= 1 && p->buf[2] <= 4) ||

View File

@ -58,7 +58,7 @@ static void get_token(AVIOContext *s, char *buf, int maxlen)
buf[i] = 0; /* Ensure null terminated, but may be truncated */
}
static int iss_probe(AVProbeData *p)
static int iss_probe(const AVProbeData *p)
{
if (strncmp(p->buf, ISS_SIG, ISS_SIG_LEN))
return 0;

View File

@ -22,7 +22,7 @@
#include "internal.h"
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
// the single file I have starts with that, I do not know if others do, too
if( p->buf[0] == 1

View File

@ -23,7 +23,7 @@
#include "riff.h"
#include "libavutil/intreadwrite.h"
static int probe(AVProbeData *p)
static int probe(const AVProbeData *p)
{
if (AV_RL32(p->buf) == MKTAG('D','K','I','F')
&& !AV_RL16(p->buf+4) && AV_RL16(p->buf+6) == 32)

View File

@ -48,7 +48,7 @@ static int timed_line(const char *ptr)
(sscanf(ptr, "@%u @%u %c", &fs, &fe, &c) == 3 && fs < fe));
}
static int jacosub_probe(AVProbeData *p)
static int jacosub_probe(const AVProbeData *p)
{
const char *ptr = p->buf;
const char *ptr_end = p->buf + p->buf_size;

View File

@ -52,7 +52,7 @@ typedef struct JVDemuxContext {
#define MAGIC " Compression by John M Phillips Copyright (C) 1995 The Bitmap Brothers Ltd."
static int read_probe(AVProbeData *pd)
static int read_probe(const AVProbeData *pd)
{
if (pd->buf[0] == 'J' && pd->buf[1] == 'V' && strlen(MAGIC) + 4 <= pd->buf_size &&
!memcmp(pd->buf + 4, MAGIC, strlen(MAGIC)))

View File

@ -169,7 +169,7 @@ static int read_seek_gme(AVFormatContext *s, int stream_idx, int64_t ts, int fla
return 0;
}
static int probe_gme(AVProbeData *p)
static int probe_gme(const AVProbeData *p)
{
// Reads 4 bytes - returns "" if unknown format.
if (gme_identify_header(p->buf)[0]) {

View File

@ -350,7 +350,7 @@ static int modplug_read_seek(AVFormatContext *s, int stream_idx, int64_t ts, int
static const char modplug_extensions[] = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm,itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz";
static int modplug_probe(AVProbeData *p)
static int modplug_probe(const AVProbeData *p)
{
if (av_match_ext(p->filename, modplug_extensions)) {
if (p->buf_size < 16384)

View File

@ -232,7 +232,7 @@ static int probe_openmpt_extension(AVProbeData *p)
return 0;
}
static int read_probe_openmpt(AVProbeData *p)
static int read_probe_openmpt(const AVProbeData *p)
{
#if OPENMPT_API_VERSION_AT_LEAST(0,3,0)
int probe_result;

View File

@ -35,7 +35,7 @@
#define LMLM4_MAX_PACKET_SIZE 1024 * 1024
static int lmlm4_probe(AVProbeData *pd)
static int lmlm4_probe(const AVProbeData *pd)
{
const unsigned char *buf = pd->buf;
unsigned int frame_type, packet_size;

Some files were not shown because too many files have changed in this diff Show More