lavf: Constify the probe function argument.

Reviewed-by: Lauri Kasanen
Reviewed-by: Tomas Härdin
pull/310/head
Carl Eugen Hoyos 6 years ago
parent 6dc1da416e
commit 4d8875ec23
  1. 2
      libavformat/3dostr.c
  2. 2
      libavformat/4xm.c
  3. 2
      libavformat/aacdec.c
  4. 2
      libavformat/aadec.c
  5. 6
      libavformat/ac3dec.c
  6. 2
      libavformat/acm.c
  7. 2
      libavformat/act.c
  8. 2
      libavformat/adp.c
  9. 2
      libavformat/ads.c
  10. 2
      libavformat/adxdec.c
  11. 2
      libavformat/aea.c
  12. 2
      libavformat/aiffdec.c
  13. 2
      libavformat/aixdec.c
  14. 6
      libavformat/amr.c
  15. 2
      libavformat/anm.c
  16. 2
      libavformat/apc.c
  17. 2
      libavformat/ape.c
  18. 2
      libavformat/apngdec.c
  19. 2
      libavformat/aqtitledec.c
  20. 2
      libavformat/asfdec_f.c
  21. 2
      libavformat/asfdec_o.c
  22. 2
      libavformat/assdec.c
  23. 2
      libavformat/astdec.c
  24. 2
      libavformat/au.c
  25. 2
      libavformat/avformat.h
  26. 2
      libavformat/avidec.c
  27. 2
      libavformat/avr.c
  28. 2
      libavformat/avs.c
  29. 2
      libavformat/bethsoftvid.c
  30. 2
      libavformat/bfi.c
  31. 2
      libavformat/bink.c
  32. 6
      libavformat/bintext.c
  33. 2
      libavformat/bit.c
  34. 2
      libavformat/boadec.c
  35. 4
      libavformat/brstm.c
  36. 2
      libavformat/c93.c
  37. 2
      libavformat/cafdec.c
  38. 2
      libavformat/cavsvideodec.c
  39. 2
      libavformat/cdxl.c
  40. 2
      libavformat/cinedec.c
  41. 2
      libavformat/codec2.c
  42. 2
      libavformat/concatdec.c
  43. 2
      libavformat/dashdec.c
  44. 2
      libavformat/davs2.c
  45. 2
      libavformat/dcstr.c
  46. 2
      libavformat/dfa.c
  47. 2
      libavformat/dhav.c
  48. 2
      libavformat/diracdec.c
  49. 2
      libavformat/dnxhddec.c
  50. 2
      libavformat/dsfdec.c
  51. 2
      libavformat/dsicin.c
  52. 2
      libavformat/dss.c
  53. 2
      libavformat/dtsdec.c
  54. 2
      libavformat/dtshddec.c
  55. 2
      libavformat/dv.c
  56. 2
      libavformat/dvbsub.c
  57. 2
      libavformat/dvbtxt.c
  58. 2
      libavformat/dxa.c
  59. 2
      libavformat/eacdata.c
  60. 2
      libavformat/electronicarts.c
  61. 2
      libavformat/epafdec.c
  62. 2
      libavformat/ffmetadec.c
  63. 2
      libavformat/fitsdec.c
  64. 4
      libavformat/flacdec.c
  65. 2
      libavformat/flic.c
  66. 6
      libavformat/flvdec.c
  67. 2
      libavformat/frmdec.c
  68. 2
      libavformat/fsb.c
  69. 2
      libavformat/gdv.c
  70. 2
      libavformat/genh.c
  71. 2
      libavformat/gifdec.c
  72. 2
      libavformat/gsmdec.c
  73. 2
      libavformat/gxf.c
  74. 2
      libavformat/h261dec.c
  75. 2
      libavformat/h263dec.c
  76. 2
      libavformat/h264dec.c
  77. 2
      libavformat/hcom.c
  78. 2
      libavformat/hevcdec.c
  79. 2
      libavformat/hls.c
  80. 2
      libavformat/hnm.c
  81. 2
      libavformat/icodec.c
  82. 2
      libavformat/idcin.c
  83. 2
      libavformat/idroqdec.c
  84. 2
      libavformat/iff.c
  85. 2
      libavformat/ilbc.c
  86. 2
      libavformat/img2_alias_pix.c
  87. 2
      libavformat/img2_brender_pix.c
  88. 54
      libavformat/img2dec.c
  89. 2
      libavformat/ingenientdec.c
  90. 2
      libavformat/ipmovie.c
  91. 2
      libavformat/ircamdec.c
  92. 2
      libavformat/iss.c
  93. 2
      libavformat/iv8.c
  94. 2
      libavformat/ivfdec.c
  95. 2
      libavformat/jacosubdec.c
  96. 2
      libavformat/jvdec.c
  97. 2
      libavformat/libgme.c
  98. 2
      libavformat/libmodplug.c
  99. 2
      libavformat/libopenmpt.c
  100. 2
      libavformat/lmlm4.c
  101. Some files were not shown because too many files have changed in this diff Show More

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

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

@ -30,7 +30,7 @@
#define ADTS_HEADER_SIZE 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 max_frames = 0, first_frames = 0;
int fsize, frames; int fsize, frames;

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

@ -25,7 +25,7 @@
#include "avformat.h" #include "avformat.h"
#include "rawdec.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; int max_frames, first_frames = 0, frames;
const uint8_t *buf, *buf2, *end; 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 #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); return ac3_eac3_probe(p, AV_CODEC_ID_AC3);
} }
@ -115,7 +115,7 @@ AVInputFormat ff_ac3_demuxer = {
#endif #endif
#if CONFIG_EAC3_DEMUXER #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); return ac3_eac3_probe(p, AV_CODEC_ID_EAC3);
} }

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

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

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

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

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

@ -27,7 +27,7 @@
#define AT1_SU_SIZE 212 #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) if (p->buf_size <= 2048+212)
return 0; return 0;

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

@ -23,7 +23,7 @@
#include "avformat.h" #include "avformat.h"
#include "internal.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') || if (AV_RL32(p->buf) != MKTAG('A','I','X','F') ||
AV_RB32(p->buf + 8) != 0x01000014 || AV_RB32(p->buf + 8) != 0x01000014 ||

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

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

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

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

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

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

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

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

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

@ -25,7 +25,7 @@
#include "internal.h" #include "internal.h"
#include "ast.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')) if (AV_RL32(p->buf) != MKTAG('S','T','R','M'))
return 0; return 0;

@ -57,7 +57,7 @@ static const AVCodecTag codec_au_tags[] = {
#if CONFIG_AU_DEMUXER #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' && if (p->buf[0] == '.' && p->buf[1] == 's' &&
p->buf[2] == 'n' && p->buf[3] == 'd') p->buf[2] == 'n' && p->buf[3] == 'd')

@ -702,7 +702,7 @@ typedef struct AVInputFormat {
* The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes * 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. * 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 * Read the format header and initialize the AVFormatContext

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

@ -24,7 +24,7 @@
#include "internal.h" #include "internal.h"
#include "pcm.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')) if (AV_RL32(p->buf) != MKTAG('2', 'B', 'I', 'T'))
return 0; return 0;

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

@ -55,7 +55,7 @@ typedef struct BVID_DemuxContext
} 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" // little-endian VID tag, file starts with "VID\0"
if (AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0)) if (AV_RL32(p->buf) != MKTAG('V', 'I', 'D', 0))

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

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

@ -126,7 +126,7 @@ static void predict_width(AVCodecParameters *par, uint64_t fsize, int got_width)
par->width = fsize > 4000 ? (160<<3) : (80<<3); 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; const uint8_t *d = p->buf;
int magic = 0, sauce = 0; int magic = 0, sauce = 0;
@ -204,7 +204,7 @@ static int bintext_read_header(AVFormatContext *s)
#endif /* CONFIG_BINTEXT_DEMUXER */ #endif /* CONFIG_BINTEXT_DEMUXER */
#if CONFIG_XBIN_DEMUXER #if CONFIG_XBIN_DEMUXER
static int xbin_probe(AVProbeData *p) static int xbin_probe(const AVProbeData *p)
{ {
const uint8_t *d = p->buf; 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 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)) if (p->buf_size < sizeof(idf_magic))
return 0; return 0;

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

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

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

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

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

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

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

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

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

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

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

@ -31,7 +31,7 @@
#define ISUNIT(x) ( ISSQH(x) || ISEND(x) || (x) == 0xB2 || ISPIC(x) || (x) == 0xB5 || (x) == 0xB7 ) #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 ) #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; uint32_t code= -1, hds=0, pic=0, seq=0;
uint8_t state=0; uint8_t state=0;

@ -22,7 +22,7 @@
#include "avformat.h" #include "avformat.h"
#include "internal.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)) if (p->buf_size < 224 || memcmp(p->buf + 213, "Sega Stream", 11))
return 0; return 0;

@ -25,7 +25,7 @@
#include "avformat.h" #include "avformat.h"
#include "internal.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')) if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('D', 'F', 'I', 'A'))
return 0; return 0;

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

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

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

@ -30,7 +30,7 @@ typedef struct {
uint64_t data_size; uint64_t data_size;
} DSFContext; } 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) if (p->buf_size < 12 || memcmp(p->buf, "DSD ", 4) || AV_RL64(p->buf + 4) != 28)
return 0; return 0;

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

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

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

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

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

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

@ -24,7 +24,7 @@
#include "avformat.h" #include "avformat.h"
#include "rawdec.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 *end = p->buf + p->buf_size;
const uint8_t *buf; const uint8_t *buf;

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

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

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

@ -25,7 +25,7 @@
#include "internal.h" #include "internal.h"
#include "pcm.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',' ') && if (((AV_RL32(p->buf) == MKTAG('f','a','p',' ') &&
AV_RL32(p->buf + 8) == 1) || AV_RL32(p->buf + 8) == 1) ||

@ -26,7 +26,7 @@
#include "internal.h" #include "internal.h"
#include "libavutil/dict.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))) if(!memcmp(p->buf, ID_STRING, strlen(ID_STRING)))
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;

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

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

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

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

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

@ -25,7 +25,7 @@
#include "avio.h" #include "avio.h"
#include "internal.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) if (memcmp(p->buf, "FSB", 3) || p->buf[3] - '0' < 1 || p->buf[3] - '0' > 5)
return 0; return 0;

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

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

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

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

@ -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 * @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 startcode[] = {0, 0, 0, 0, 1, 0xbc}; // start with map packet
static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2}; static const uint8_t endcode[] = {0, 0, 0, 0, 0xe1, 0xe2};
if (!memcmp(p->buf, startcode, sizeof(startcode)) && if (!memcmp(p->buf, startcode, sizeof(startcode)) &&

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

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

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

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

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

@ -2285,7 +2285,7 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
return 0; 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 /* Require #EXTM3U at the start, and either one of the ones below
* somewhere for a proper match. */ * somewhere for a proper match. */

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

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

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

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

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

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

@ -22,7 +22,7 @@
#include "img2.h" #include "img2.h"
#include "libavcodec/bytestream.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 *b = p->buf;
const uint8_t *end = b + p->buf_size; const uint8_t *end = b + p->buf_size;

@ -22,7 +22,7 @@
#include "img2.h" #include "img2.h"
#include "libavutil/intreadwrite.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] = { static const uint8_t brender_magic[16] = {
0,0,0,0x12,0,0,0,8,0,0,0,2,0,0,0,2 0,0,0,0x12,0,0,0,8,0,0,0,2,0,0,0,2

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

@ -24,7 +24,7 @@
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
// http://multimedia.cx/ingenient.txt // 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") if ( AV_RN32(p->buf) != AV_RN32("MJPG")
|| p->buf_size < 50 || p->buf_size < 50

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

@ -26,7 +26,7 @@
#include "pcm.h" #include "pcm.h"
#include "ircam.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 && if ((p->buf[0] == 0x64 && p->buf[1] == 0xA3 && p->buf[3] == 0x00 &&
p->buf[2] >= 1 && p->buf[2] <= 4) || p->buf[2] >= 1 && p->buf[2] <= 4) ||

@ -58,7 +58,7 @@ static void get_token(AVIOContext *s, char *buf, int maxlen)
buf[i] = 0; /* Ensure null terminated, but may be truncated */ 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)) if (strncmp(p->buf, ISS_SIG, ISS_SIG_LEN))
return 0; return 0;

@ -22,7 +22,7 @@
#include "internal.h" #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 // the single file I have starts with that, I do not know if others do, too
if( p->buf[0] == 1 if( p->buf[0] == 1

@ -23,7 +23,7 @@
#include "riff.h" #include "riff.h"
#include "libavutil/intreadwrite.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') if (AV_RL32(p->buf) == MKTAG('D','K','I','F')
&& !AV_RL16(p->buf+4) && AV_RL16(p->buf+6) == 32) && !AV_RL16(p->buf+4) && AV_RL16(p->buf+6) == 32)

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

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

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

@ -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 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 (av_match_ext(p->filename, modplug_extensions)) {
if (p->buf_size < 16384) if (p->buf_size < 16384)

@ -232,7 +232,7 @@ static int probe_openmpt_extension(AVProbeData *p)
return 0; 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) #if OPENMPT_API_VERSION_AT_LEAST(0,3,0)
int probe_result; int probe_result;

@ -35,7 +35,7 @@
#define LMLM4_MAX_PACKET_SIZE 1024 * 1024 #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; const unsigned char *buf = pd->buf;
unsigned int frame_type, packet_size; unsigned int frame_type, packet_size;

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

Loading…
Cancel
Save