Skip to content

Commit

Permalink
lavf: Constify the probe function argument.
Browse files Browse the repository at this point in the history
Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
  • Loading branch information
cehoyos committed Mar 21, 2019
1 parent 6dc1da4 commit 4d8875e
Show file tree
Hide file tree
Showing 214 changed files with 256 additions and 256 deletions.
2 changes: 1 addition & 1 deletion libavformat/3dostr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down
2 changes: 1 addition & 1 deletion libavformat/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions libavformat/ac3dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion libavformat/acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/act.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/adp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/adxdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aea.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aiffdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aixdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down
6 changes: 3 additions & 3 deletions libavformat/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/anm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion libavformat/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/ape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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', ' '))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/apngdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/aqtitledec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/asfdec_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/asfdec_o.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/assdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/astdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/au.c
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion libavformat/avformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libavformat/avidec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/avr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/avs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/bethsoftvid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/bfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion libavformat/bink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions libavformat/bintext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/boadec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/brstm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -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')) &&
Expand Down
2 changes: 1 addition & 1 deletion libavformat/c93.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/cafdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 4d8875e

Please sign in to comment.