aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2003-02-11 16:35:48 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2003-02-11 16:35:48 +0000
commit0c1a9edad463bd6e22b30c19b700b099c7093fc1 (patch)
treed16ccbe29c8dbfc2cdc4e92cac31b22c181ed940 /libavformat
parent4596673c062e3834b6d31d1e8e210b64d74ce26b (diff)
downloadffmpeg-0c1a9edad463bd6e22b30c19b700b099c7093fc1.tar.gz
* UINTX -> uintx_t INTX -> intx_t
Originally committed as revision 1578 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/asf.c58
-rw-r--r--libavformat/au.c10
-rw-r--r--libavformat/audio.c4
-rw-r--r--libavformat/avformat.h30
-rw-r--r--libavformat/avidec.c6
-rw-r--r--libavformat/avienc.c8
-rw-r--r--libavformat/avio.h22
-rw-r--r--libavformat/aviobuf.c60
-rw-r--r--libavformat/crc.c4
-rw-r--r--libavformat/dv1394.c2
-rw-r--r--libavformat/ffm.c44
-rw-r--r--libavformat/framehook.c2
-rw-r--r--libavformat/framehook.h2
-rw-r--r--libavformat/gif.c14
-rw-r--r--libavformat/grab.c26
-rw-r--r--libavformat/http.c6
-rw-r--r--libavformat/img.c12
-rw-r--r--libavformat/jpeg.c4
-rw-r--r--libavformat/mov.c74
-rw-r--r--libavformat/mpeg.c42
-rw-r--r--libavformat/mpegts.c2
-rw-r--r--libavformat/mpjpeg.c8
-rw-r--r--libavformat/pnm.c2
-rw-r--r--libavformat/raw.c2
-rw-r--r--libavformat/rm.c14
-rw-r--r--libavformat/rtp.c46
-rw-r--r--libavformat/rtpproto.c4
-rw-r--r--libavformat/rtsp.h4
-rw-r--r--libavformat/swf.c14
-rw-r--r--libavformat/tcp.c4
-rw-r--r--libavformat/udp.c4
-rw-r--r--libavformat/utils.c44
-rw-r--r--libavformat/wav.c6
-rw-r--r--libavformat/yuv.c2
-rw-r--r--libavformat/yuv4mpeg.c4
35 files changed, 295 insertions, 295 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index 79d720819b..e3d5883ba6 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -31,7 +31,7 @@ typedef struct {
AVPacket pkt;
int frag_offset;
int timestamp;
- INT64 duration;
+ int64_t duration;
int ds_span; /* descrambling */
int ds_packet_size;
@@ -42,10 +42,10 @@ typedef struct {
} ASFStream;
typedef struct {
- UINT32 v1;
- UINT16 v2;
- UINT16 v3;
- UINT8 v4[8];
+ uint32_t v1;
+ uint16_t v2;
+ uint16_t v3;
+ uint8_t v4[8];
} GUID;
typedef struct __attribute__((packed)) {
@@ -83,14 +83,14 @@ typedef struct {
int asfid2avid[128]; /* conversion table from asf ID 2 AVStream ID */
ASFStream streams[128]; /* it's max number and it's not that big */
/* non streamed additonnal info */
- INT64 nb_packets;
- INT64 duration; /* in 100ns units */
+ int64_t nb_packets;
+ int64_t duration; /* in 100ns units */
/* packet filling */
int packet_size_left;
int packet_timestamp_start;
int packet_timestamp_end;
int packet_nb_frames;
- UINT8 packet_buf[PACKET_SIZE];
+ uint8_t packet_buf[PACKET_SIZE];
ByteIOContext pb;
/* only for reading */
uint64_t data_offset; /* begining of the first data packet */
@@ -199,7 +199,7 @@ static void put_str16(ByteIOContext *s, const char *tag)
put_le16(s,strlen(tag) + 1);
for(;;) {
- c = (UINT8)*tag++;
+ c = (uint8_t)*tag++;
put_le16(s, c);
if (c == '\0')
break;
@@ -211,16 +211,16 @@ static void put_str16_nolen(ByteIOContext *s, const char *tag)
int c;
for(;;) {
- c = (UINT8)*tag++;
+ c = (uint8_t)*tag++;
put_le16(s, c);
if (c == '\0')
break;
}
}
-static INT64 put_header(ByteIOContext *pb, const GUID *g)
+static int64_t put_header(ByteIOContext *pb, const GUID *g)
{
- INT64 pos;
+ int64_t pos;
pos = url_ftell(pb);
put_guid(pb, g);
@@ -229,9 +229,9 @@ static INT64 put_header(ByteIOContext *pb, const GUID *g)
}
/* update header size */
-static void end_header(ByteIOContext *pb, INT64 pos)
+static void end_header(ByteIOContext *pb, int64_t pos)
{
- INT64 pos1;
+ int64_t pos1;
pos1 = url_ftell(pb);
url_fseek(pb, pos + 16, SEEK_SET);
@@ -256,24 +256,24 @@ static void put_chunk(AVFormatContext *s, int type, int payload_length, int flag
}
/* convert from unix to windows time */
-static INT64 unix_to_file_time(int ti)
+static int64_t unix_to_file_time(int ti)
{
- INT64 t;
+ int64_t t;
- t = ti * INT64_C(10000000);
- t += INT64_C(116444736000000000);
+ t = ti * int64_t_C(10000000);
+ t += int64_t_C(116444736000000000);
return t;
}
/* write the header (used two times if non streamed) */
-static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chunk_size)
+static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size)
{
ASFContext *asf = s->priv_data;
ByteIOContext *pb = &s->pb;
int header_size, n, extra_size, extra_size2, wav_extra_size, file_time;
int has_title;
AVCodecContext *enc;
- INT64 header_offset, cur_pos, hpos;
+ int64_t header_offset, cur_pos, hpos;
int bit_rate;
has_title = (s->title[0] || s->author[0] || s->copyright[0] || s->comment[0]);
@@ -337,7 +337,7 @@ static int asf_write_header1(AVFormatContext *s, INT64 file_size, INT64 data_chu
/* stream headers */
for(n=0;n<s->nb_streams;n++) {
- INT64 es_pos;
+ int64_t es_pos;
// ASFStream *stream = &asf->streams[n];
enc = &s->streams[n]->codec;
@@ -574,7 +574,7 @@ static void put_frame_header(AVFormatContext *s, ASFStream *stream, int timestam
crap. They have misread the MPEG Systems spec !
*/
static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
- UINT8 *buf, int payload_size)
+ uint8_t *buf, int payload_size)
{
ASFContext *asf = s->priv_data;
int frag_pos, frag_len, frag_len1;
@@ -607,22 +607,22 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, int timestamp,
static int asf_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int timestamp)
+ uint8_t *buf, int size, int timestamp)
{
ASFContext *asf = s->priv_data;
ASFStream *stream;
- INT64 duration;
+ int64_t duration;
AVCodecContext *codec;
codec = &s->streams[stream_index]->codec;
stream = &asf->streams[stream_index];
if (codec->codec_type == CODEC_TYPE_AUDIO) {
- duration = (codec->frame_number * codec->frame_size * INT64_C(10000000)) /
+ duration = (codec->frame_number * codec->frame_size * int64_t_C(10000000)) /
codec->sample_rate;
} else {
duration = codec->frame_number *
- ((INT64_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
+ ((int64_t_C(10000000) * FRAME_RATE_BASE) / codec->frame_rate);
}
if (duration > asf->duration)
asf->duration = duration;
@@ -634,7 +634,7 @@ static int asf_write_packet(AVFormatContext *s, int stream_index,
static int asf_write_trailer(AVFormatContext *s)
{
ASFContext *asf = s->priv_data;
- INT64 file_size;
+ int64_t file_size;
/* flush the current packet */
if (asf->pb.buf_ptr > asf->pb.buffer)
@@ -746,7 +746,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
AVStream *st;
ASFStream *asf_st;
int size, i;
- INT64 gsize;
+ int64_t gsize;
av_set_pts_info(s, 32, 1, 1000); /* 32 bit pts in ms */
@@ -786,7 +786,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} else if (!memcmp(&g, &stream_header, sizeof(GUID))) {
int type, total_size;
unsigned int tag1;
- INT64 pos1, pos2;
+ int64_t pos1, pos2;
pos1 = url_ftell(pb);
diff --git a/libavformat/au.c b/libavformat/au.c
index b584d8d4f5..50f22a8c9a 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -29,7 +29,7 @@
#include "avi.h"
/* if we don't know the size in advance */
-#define AU_UNKOWN_SIZE ((UINT32)(~0))
+#define AU_UNKOWN_SIZE ((uint32_t)(~0))
/* The ffmpeg codecs we support, and the IDs they have in the file */
static const CodecTag codec_au_tags[] = {
@@ -50,9 +50,9 @@ static int put_au_header(ByteIOContext *pb, AVCodecContext *enc)
put_tag(pb, ".snd"); /* magic number */
put_be32(pb, 24); /* header size */
put_be32(pb, AU_UNKOWN_SIZE); /* data size */
- put_be32(pb, (UINT32)tag); /* codec ID */
+ put_be32(pb, (uint32_t)tag); /* codec ID */
put_be32(pb, enc->sample_rate);
- put_be32(pb, (UINT32)enc->channels);
+ put_be32(pb, (uint32_t)enc->channels);
return 0;
}
@@ -73,7 +73,7 @@ static int au_write_header(AVFormatContext *s)
}
static int au_write_packet(AVFormatContext *s, int stream_index_ptr,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
ByteIOContext *pb = &s->pb;
put_buffer(pb, buf, size);
@@ -90,7 +90,7 @@ static int au_write_trailer(AVFormatContext *s)
/* update file size */
file_size = url_ftell(pb);
url_fseek(pb, 8, SEEK_SET);
- put_be32(pb, (UINT32)(file_size - 24));
+ put_be32(pb, (uint32_t)(file_size - 24));
url_fseek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
diff --git a/libavformat/audio.c b/libavformat/audio.c
index 737b79cd15..aea0942661 100644
--- a/libavformat/audio.c
+++ b/libavformat/audio.c
@@ -37,7 +37,7 @@ typedef struct {
int frame_size; /* in bytes ! */
int codec_id;
int flip_left : 1;
- UINT8 buffer[AUDIO_BLOCK_SIZE];
+ uint8_t buffer[AUDIO_BLOCK_SIZE];
int buffer_ptr;
} AudioData;
@@ -165,7 +165,7 @@ static int audio_write_header(AVFormatContext *s1)
}
static int audio_write_packet(AVFormatContext *s1, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AudioData *s = s1->priv_data;
int len, ret;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b9589c8e1c..c78b98aa70 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -18,8 +18,8 @@ extern "C" {
#define AV_NOPTS_VALUE 0
typedef struct AVPacket {
- INT64 pts; /* presentation time stamp in stream units (set av_set_pts_info) */
- UINT8 *data;
+ int64_t pts; /* presentation time stamp in stream units (set av_set_pts_info) */
+ uint8_t *data;
int size;
int stream_index;
int flags;
@@ -54,12 +54,12 @@ static inline void av_free_packet(AVPacket *pkt)
/* the exact value of the fractional number is: 'val + num / den'. num
is assumed to be such as 0 <= num < den */
typedef struct AVFrac {
- INT64 val, num, den;
+ int64_t val, num, den;
} AVFrac;
-void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den);
-void av_frac_add(AVFrac *f, INT64 incr);
-void av_frac_set(AVFrac *f, INT64 val);
+void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den);
+void av_frac_add(AVFrac *f, int64_t incr);
+void av_frac_set(AVFrac *f, int64_t val);
/*************************************************/
/* input/output formats */
@@ -141,7 +141,7 @@ typedef struct AVInputFormat {
int (*read_close)(struct AVFormatContext *);
/* seek at or before a given pts (given in microsecond). The pts
origin is defined by the stream */
- int (*read_seek)(struct AVFormatContext *, INT64 pts);
+ int (*read_seek)(struct AVFormatContext *, int64_t pts);
/* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_NOHEADER */
int flags;
/* if extensions are defined, then no probe is done. You should
@@ -337,20 +337,20 @@ AVOutputFormat *guess_stream_format(const char *short_name,
AVOutputFormat *guess_format(const char *short_name,
const char *filename, const char *mime_type);
-void av_hex_dump(UINT8 *buf, int size);
+void av_hex_dump(uint8_t *buf, int size);
void av_register_all(void);
typedef struct FifoBuffer {
- UINT8 *buffer;
- UINT8 *rptr, *wptr, *end;
+ uint8_t *buffer;
+ uint8_t *rptr, *wptr, *end;
} FifoBuffer;
int fifo_init(FifoBuffer *f, int size);
void fifo_free(FifoBuffer *f);
-int fifo_size(FifoBuffer *f, UINT8 *rptr);
-int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr);
-void fifo_write(FifoBuffer *f, UINT8 *buf, int size, UINT8 **wptr_ptr);
+int fifo_size(FifoBuffer *f, uint8_t *rptr);
+int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr);
+void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr);
/* media file input */
AVInputFormat *av_find_input_format(const char *short_name);
@@ -386,9 +386,9 @@ void dump_format(AVFormatContext *ic,
const char *url,
int is_output);
int parse_image_size(int *width_ptr, int *height_ptr, const char *str);
-INT64 parse_date(const char *datestr, int duration);
+int64_t parse_date(const char *datestr, int duration);
-INT64 av_gettime(void);
+int64_t av_gettime(void);
/* ffm specific for ffserver */
#define FFM_PACKET_SIZE 4096
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 650b03fcb6..4cba26918c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -28,7 +28,7 @@ typedef struct AVIIndex {
} AVIIndex;
typedef struct {
- INT64 movi_end;
+ int64_t movi_end;
offset_t movi_list;
AVIIndex *first, *last;
} AVIContext;
@@ -49,7 +49,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = &s->pb;
- UINT32 tag, tag1;
+ uint32_t tag, tag1;
int codec_type, stream_index, frame_period, bit_rate;
unsigned int size;
int i;
@@ -144,7 +144,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec.width = get_le32(pb);
st->codec.height = get_le32(pb);
if (frame_period)
- st->codec.frame_rate = (INT64_C(1000000) * FRAME_RATE_BASE) / frame_period;
+ st->codec.frame_rate = (int64_t_C(1000000) * FRAME_RATE_BASE) / frame_period;
else
st->codec.frame_rate = 25 * FRAME_RATE_BASE;
get_le16(pb); /* panes */
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index b2face1d46..9b930f346a 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -49,7 +49,7 @@ void end_tag(ByteIOContext *pb, offset_t start)
pos = url_ftell(pb);
url_fseek(pb, start - 4, SEEK_SET);
- put_le32(pb, (UINT32)(pos - start));
+ put_le32(pb, (uint32_t)(pos - start));
url_fseek(pb, pos, SEEK_SET);
}
@@ -211,7 +211,7 @@ static int avi_write_header(AVFormatContext *s)
nb_frames = 0;
if(video_enc){
- put_le32(pb, (UINT32)(INT64_C(1000000) * FRAME_RATE_BASE / video_enc->frame_rate));
+ put_le32(pb, (uint32_t)(int64_t_C(1000000) * FRAME_RATE_BASE / video_enc->frame_rate));
} else {
put_le32(pb, 0);
}
@@ -320,7 +320,7 @@ static int avi_write_header(AVFormatContext *s)
}
static int avi_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AVIContext *avi = s->priv_data;
ByteIOContext *pb = &s->pb;
@@ -395,7 +395,7 @@ static int avi_write_trailer(AVFormatContext *s)
/* update file size */
file_size = url_ftell(pb);
url_fseek(pb, 4, SEEK_SET);
- put_le32(pb, (UINT32)(file_size - 8));
+ put_le32(pb, (uint32_t)(file_size - 8));
/* Fill in frame/sample counters */
nb_frames = 0;
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 4ed359c1db..29e9489d60 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -3,7 +3,7 @@
/* output byte stream handling */
-typedef INT64 offset_t;
+typedef int64_t offset_t;
/* unbuffered I/O */
@@ -60,8 +60,8 @@ typedef struct {
int buffer_size;
unsigned char *buf_ptr, *buf_end;
void *opaque;
- int (*read_packet)(void *opaque, UINT8 *buf, int buf_size);
- void (*write_packet)(void *opaque, UINT8 *buf, int buf_size);
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
+ void (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
int (*seek)(void *opaque, offset_t offset, int whence);
offset_t pos; /* position in the file of the current buffer */
int must_flush; /* true if the next seek should flush */
@@ -76,14 +76,14 @@ int init_put_byte(ByteIOContext *s,
int buffer_size,
int write_flag,
void *opaque,
- int (*read_packet)(void *opaque, UINT8 *buf, int buf_size),
- void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ void (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*seek)(void *opaque, offset_t offset, int whence));
void put_byte(ByteIOContext *s, int b);
void put_buffer(ByteIOContext *s, const unsigned char *buf, int size);
-void put_le64(ByteIOContext *s, UINT64 val);
-void put_be64(ByteIOContext *s, UINT64 val);
+void put_le64(ByteIOContext *s, uint64_t val);
+void put_be64(ByteIOContext *s, uint64_t val);
void put_le32(ByteIOContext *s, unsigned int val);
void put_be32(ByteIOContext *s, unsigned int val);
void put_le16(ByteIOContext *s, unsigned int val);
@@ -108,14 +108,14 @@ void put_flush_packet(ByteIOContext *s);
int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
int get_byte(ByteIOContext *s);
unsigned int get_le32(ByteIOContext *s);
-UINT64 get_le64(ByteIOContext *s);
+uint64_t get_le64(ByteIOContext *s);
unsigned int get_le16(ByteIOContext *s);
double get_be64_double(ByteIOContext *s);
char *get_strz(ByteIOContext *s, char *buf, int maxlen);
unsigned int get_be16(ByteIOContext *s);
unsigned int get_be32(ByteIOContext *s);
-UINT64 get_be64(ByteIOContext *s);
+uint64_t get_be64(ByteIOContext *s);
static inline int url_is_streamed(ByteIOContext *s)
{
@@ -129,12 +129,12 @@ int url_fclose(ByteIOContext *s);
URLContext *url_fileno(ByteIOContext *s);
int url_fget_max_packet_size(ByteIOContext *s);
-int url_open_buf(ByteIOContext *s, UINT8 *buf, int buf_size, int flags);
+int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags);
int url_close_buf(ByteIOContext *s);
int url_open_dyn_buf(ByteIOContext *s);
int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size);
-int url_close_dyn_buf(ByteIOContext *s, UINT8 **pbuffer);
+int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer);
/* file.c */
extern URLProtocol file_protocol;
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 2a62286865..fc1ae2c64f 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -27,8 +27,8 @@ int init_put_byte(ByteIOContext *s,
int buffer_size,
int write_flag,
void *opaque,
- int (*read_packet)(void *opaque, UINT8 *buf, int buf_size),
- void (*write_packet)(void *opaque, UINT8 *buf, int buf_size),
+ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+ void (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*seek)(void *opaque, offset_t offset, int whence))
{
s->buffer = buffer;
@@ -182,7 +182,7 @@ void put_be64_double(ByteIOContext *s, double val)
{
union {
double d;
- UINT64 ull;
+ uint64_t ull;
} u;
u.d = val;
put_be64(s, u.ull);
@@ -196,16 +196,16 @@ void put_strz(ByteIOContext *s, const char *str)
put_byte(s, 0);
}
-void put_le64(ByteIOContext *s, UINT64 val)
+void put_le64(ByteIOContext *s, uint64_t val)
{
- put_le32(s, (UINT32)(val & 0xffffffff));
- put_le32(s, (UINT32)(val >> 32));
+ put_le32(s, (uint32_t)(val & 0xffffffff));
+ put_le32(s, (uint32_t)(val >> 32));
}
-void put_be64(ByteIOContext *s, UINT64 val)
+void put_be64(ByteIOContext *s, uint64_t val)
{
- put_be32(s, (UINT32)(val >> 32));
- put_be32(s, (UINT32)(val & 0xffffffff));
+ put_be32(s, (uint32_t)(val >> 32));
+ put_be32(s, (uint32_t)(val & 0xffffffff));
}
void put_le16(ByteIOContext *s, unsigned int val)
@@ -320,11 +320,11 @@ unsigned int get_le32(ByteIOContext *s)
return val;
}
-UINT64 get_le64(ByteIOContext *s)
+uint64_t get_le64(ByteIOContext *s)
{
- UINT64 val;
- val = (UINT64)get_le32(s);
- val |= (UINT64)get_le32(s) << 32;
+ uint64_t val;
+ val = (uint64_t)get_le32(s);
+ val |= (uint64_t)get_le32(s) << 32;
return val;
}
@@ -350,7 +350,7 @@ double get_be64_double(ByteIOContext *s)
{
union {
double d;
- UINT64 ull;
+ uint64_t ull;
} u;
u.ull = get_be64(s);
@@ -372,29 +372,29 @@ char *get_strz(ByteIOContext *s, char *buf, int maxlen)
return buf;
}
-UINT64 get_be64(ByteIOContext *s)
+uint64_t get_be64(ByteIOContext *s)
{
- UINT64 val;
- val = (UINT64)get_be32(s) << 32;
- val |= (UINT64)get_be32(s);
+ uint64_t val;
+ val = (uint64_t)get_be32(s) << 32;
+ val |= (uint64_t)get_be32(s);
return val;
}
/* link with avio functions */
-static void url_write_packet(void *opaque, UINT8 *buf, int buf_size)
+static void url_write_packet(void *opaque, uint8_t *buf, int buf_size)
{
URLContext *h = opaque;
url_write(h, buf, buf_size);
}
-static int url_read_packet(void *opaque, UINT8 *buf, int buf_size)
+static int url_read_packet(void *opaque, uint8_t *buf, int buf_size)
{
URLContext *h = opaque;
return url_read(h, buf, buf_size);
}
-static int url_seek_packet(void *opaque, INT64 offset, int whence)
+static int url_seek_packet(void *opaque, int64_t offset, int whence)
{
URLContext *h = opaque;
url_seek(h, offset, whence);
@@ -403,7 +403,7 @@ static int url_seek_packet(void *opaque, INT64 offset, int whence)
int url_fdopen(ByteIOContext *s, URLContext *h)
{
- UINT8 *buffer;
+ uint8_t *buffer;
int buffer_size, max_packet_size;
@@ -431,7 +431,7 @@ int url_fdopen(ByteIOContext *s, URLContext *h)
/* XXX: must be called before any I/O */
int url_setbufsize(ByteIOContext *s, int buf_size)
{
- UINT8 *buffer;
+ uint8_t *buffer;
buffer = av_malloc(buf_size);
if (!buffer)
return -ENOMEM;
@@ -530,7 +530,7 @@ int url_fget_max_packet_size(ByteIOContext *s)
}
/* buffer handling */
-int url_open_buf(ByteIOContext *s, UINT8 *buf, int buf_size, int flags)
+int url_open_buf(ByteIOContext *s, uint8_t *buf, int buf_size, int flags)
{
return init_put_byte(s, buf, buf_size,
(flags & URL_WRONLY) != 0, NULL, NULL, NULL, NULL);
@@ -547,16 +547,16 @@ int url_close_buf(ByteIOContext *s)
typedef struct DynBuffer {
int pos, size, allocated_size;
- UINT8 *buffer;
+ uint8_t *buffer;
int io_buffer_size;
- UINT8 io_buffer[1];
+ uint8_t io_buffer[1];
} DynBuffer;
-static void dyn_buf_write(void *opaque, UINT8 *buf, int buf_size)
+static void dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
{
DynBuffer *d = opaque;
int new_size, new_allocated_size;
- UINT8 *new_buffer;
+ uint8_t *new_buffer;
/* reallocate buffer if needed */
new_size = d->pos + buf_size;
@@ -583,7 +583,7 @@ static void dyn_buf_write(void *opaque, UINT8 *buf, int buf_size)
d->size = d->pos;
}
-static void dyn_packet_buf_write(void *opaque, UINT8 *buf, int buf_size)
+static void dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
{
unsigned char buf1[4];
@@ -674,7 +674,7 @@ int url_open_dyn_packet_buf(ByteIOContext *s, int max_packet_size)
* @param pointer to a byte buffer
* @return the length of the byte buffer
*/
-int url_close_dyn_buf(ByteIOContext *s, UINT8 **pbuffer)
+int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer)
{
DynBuffer *d = s->opaque;
int size;
diff --git a/libavformat/crc.c b/libavformat/crc.c
index 553ab537cb..d130917d70 100644
--- a/libavformat/crc.c
+++ b/libavformat/crc.c
@@ -33,7 +33,7 @@
#define DO8(buf) DO4(buf); DO4(buf);
#define DO16(buf) DO8(buf); DO8(buf);
-static UINT32 adler32(UINT32 adler, UINT8 *buf, unsigned int len)
+static uint32_t adler32(uint32_t adler, uint8_t *buf, unsigned int len)
{
unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff;
@@ -58,7 +58,7 @@ static UINT32 adler32(UINT32 adler, UINT8 *buf, unsigned int len)
}
typedef struct CRCState {
- UINT32 crcval;
+ uint32_t crcval;
} CRCState;
static int crc_write_header(struct AVFormatContext *s)
diff --git a/libavformat/dv1394.c b/libavformat/dv1394.c
index 41c936393a..7048c342c8 100644
--- a/libavformat/dv1394.c
+++ b/libavformat/dv1394.c
@@ -46,7 +46,7 @@ struct dv1394_data {
int done; /* Number of completed frames */
int stream; /* Current stream. 0 - video, 1 - audio */
- INT64 pts; /* Current timestamp */
+ int64_t pts; /* Current timestamp */
};
static int dv1394_reset(struct dv1394_data *dv)
diff --git a/libavformat/ffm.c b/libavformat/ffm.c
index da761cbed8..425155d15b 100644
--- a/libavformat/ffm.c
+++ b/libavformat/ffm.c
@@ -28,7 +28,7 @@
#define FLAG_KEY_FRAME 0x01
typedef struct FFMStream {
- INT64 pts;
+ int64_t pts;
} FFMStream;
enum {
@@ -40,15 +40,15 @@ typedef struct FFMContext {
/* only reading mode */
offset_t write_index, file_size;
int read_state;
- UINT8 header[FRAME_HEADER_SIZE];
+ uint8_t header[FRAME_HEADER_SIZE];
/* read and write */
int first_packet; /* true if first packet, needed to set the discontinuity tag */
int packet_size;
int frame_offset;
- INT64 pts;
- UINT8 *packet_ptr, *packet_end;
- UINT8 packet[FFM_PACKET_SIZE];
+ int64_t pts;
+ uint8_t *packet_ptr, *packet_end;
+ uint8_t packet[FFM_PACKET_SIZE];
} FFMContext;
/* disable pts hack for testing */
@@ -82,8 +82,8 @@ static void flush_packet(AVFormatContext *s)
/* 'first' is true if first data of a frame */
static void ffm_write_data(AVFormatContext *s,
- UINT8 *buf, int size,
- INT64 pts, int first)
+ uint8_t *buf, int size,
+ int64_t pts, int first)
{
FFMContext *ffm = s->priv_data;
int len;
@@ -214,12 +214,12 @@ static int ffm_write_header(AVFormatContext *s)
}
static int ffm_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AVStream *st = s->streams[stream_index];
FFMStream *fst = st->priv_data;
- INT64 pts;
- UINT8 header[FRAME_HEADER_SIZE];
+ int64_t pts;
+ uint8_t header[FRAME_HEADER_SIZE];
int duration;
if (st->codec.codec_type == CODEC_TYPE_AUDIO) {
@@ -260,7 +260,7 @@ static int ffm_write_trailer(AVFormatContext *s)
put_flush_packet(pb);
if (!url_is_streamed(pb)) {
- INT64 size;
+ int64_t size;
/* update the write offset */
size = url_ftell(pb);
url_fseek(pb, 8, SEEK_SET);
@@ -305,7 +305,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
/* first is true if we read the frame header */
static int ffm_read_data(AVFormatContext *s,
- UINT8 *buf, int size, int first)
+ uint8_t *buf, int size, int first)
{
FFMContext *ffm = s->priv_data;
ByteIOContext *pb = &s->pb;
@@ -368,7 +368,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
ByteIOContext *pb = &s->pb;
AVCodecContext *codec;
int i;
- UINT32 tag;
+ uint32_t tag;
/* header */
tag = get_le32(pb);
@@ -382,7 +382,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!url_is_streamed(pb)) {
ffm->file_size = url_filesize(url_fileno(pb));
} else {
- ffm->file_size = (UINT64_C(1) << 63) - 1;
+ ffm->file_size = (uint64_t_C(1) << 63) - 1;
}
s->nb_streams = get_be32(pb);
@@ -411,7 +411,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
/* specific info */
switch(codec->codec_type) {
case CODEC_TYPE_VIDEO:
- codec->frame_rate = ((INT64)get_be32(pb) * FRAME_RATE_BASE) / 1000;
+ codec->frame_rate = ((int64_t)get_be32(pb) * FRAME_RATE_BASE) / 1000;
codec->width = get_be16(pb);
codec->height = get_be16(pb);
codec->gop_size = get_be16(pb);
@@ -539,10 +539,10 @@ static void ffm_seek1(AVFormatContext *s, offset_t pos1)
url_fseek(pb, pos, SEEK_SET);
}
-static INT64 get_pts(AVFormatContext *s, offset_t pos)
+static int64_t get_pts(AVFormatContext *s, offset_t pos)
{
ByteIOContext *pb = &s->pb;
- INT64 pts;
+ int64_t pts;
ffm_seek1(s, pos);
url_fskip(pb, 4);
@@ -556,11 +556,11 @@ static INT64 get_pts(AVFormatContext *s, offset_t pos)
/* seek to a given time in the file. The file read pointer is
positionned at or before pts. XXX: the following code is quite
approximative */
-static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
+static int ffm_seek(AVFormatContext *s, int64_t wanted_pts)
{
FFMContext *ffm = s->priv_data;
offset_t pos_min, pos_max, pos;
- INT64 pts_min, pts_max, pts;
+ int64_t pts_min, pts_max, pts;
double pos1;
#ifdef DEBUG_SEEK
@@ -576,7 +576,7 @@ static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
/* linear interpolation */
pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
(double)(pts_max - pts_min);
- pos = (((INT64)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
+ pos = (((int64_t)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
if (pos <= pos_min)
pos = pos_min;
else if (pos >= pos_max)
@@ -601,7 +601,7 @@ static int ffm_seek(AVFormatContext *s, INT64 wanted_pts)
offset_t ffm_read_write_index(int fd)
{
- UINT8 buf[8];
+ uint8_t buf[8];
offset_t pos;
int i;
@@ -615,7 +615,7 @@ offset_t ffm_read_write_index(int fd)
void ffm_write_write_index(int fd, offset_t pos)
{
- UINT8 buf[8];
+ uint8_t buf[8];
int i;
for(i=0;i<8;i++)
diff --git a/libavformat/framehook.c b/libavformat/framehook.c
index b35c970ab5..b731c8beac 100644
--- a/libavformat/framehook.c
+++ b/libavformat/framehook.c
@@ -95,7 +95,7 @@ void frame_hook_process(AVPicture *pict, enum PixelFormat pix_fmt, int width, in
{
if (first_hook) {
FrameHookEntry *fhe;
- INT64 pts = av_gettime();
+ int64_t pts = av_gettime();
for (fhe = first_hook; fhe; fhe = fhe->next) {
fhe->Process(fhe->ctx, pict, pix_fmt, width, height, pts);
diff --git a/libavformat/framehook.h b/libavformat/framehook.h
index 210b3d20f4..61b65e489a 100644
--- a/libavformat/framehook.h
+++ b/libavformat/framehook.h
@@ -13,7 +13,7 @@ typedef FrameHookConfigure *FrameHookConfigureFn;
extern FrameHookConfigure Configure;
/* Function must be called 'Process' */
-typedef void (FrameHookProcess)(void *ctx, struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, INT64 pts);
+typedef void (FrameHookProcess)(void *ctx, struct AVPicture *pict, enum PixelFormat pix_fmt, int width, int height, int64_t pts);
typedef FrameHookProcess *FrameHookProcessFn;
extern FrameHookProcess Process;
diff --git a/libavformat/gif.c b/libavformat/gif.c
index 44f3edcc89..47b32eff79 100644
--- a/libavformat/gif.c
+++ b/libavformat/gif.c
@@ -212,7 +212,7 @@ static int gif_image_write_header(ByteIOContext *pb,
}
/* this is maybe slow, but allows for extensions */
-static inline unsigned char gif_clut_index(UINT8 r, UINT8 g, UINT8 b)
+static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
{
return ((((r)/47)%6)*6*6+(((g)/47)%6)*6+(((b)/47)%6));
}
@@ -223,7 +223,7 @@ static int gif_image_write_image(ByteIOContext *pb,
uint8_t *buf, int linesize, int pix_fmt)
{
PutBitContext p;
- UINT8 buffer[200]; /* 100 * 9 / 8 = 113 */
+ uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */
int i, left, w, v;
uint8_t *ptr;
/* image block */
@@ -287,8 +287,8 @@ static int gif_image_write_image(ByteIOContext *pb,
}
typedef struct {
- INT64 time, file_time;
- UINT8 buffer[100]; /* data chunks */
+ int64_t time, file_time;
+ uint8_t buffer[100]; /* data chunks */
} GIFContext;
static int gif_write_header(AVFormatContext *s)
@@ -331,12 +331,12 @@ static int gif_write_header(AVFormatContext *s)
}
static int gif_write_video(AVFormatContext *s,
- AVCodecContext *enc, UINT8 *buf, int size)
+ AVCodecContext *enc, uint8_t *buf, int size)
{
ByteIOContext *pb = &s->pb;
GIFContext *gif = s->priv_data;
int jiffies;
- INT64 delay;
+ int64_t delay;
/* graphic control extension block */
put_byte(pb, 0x21);
@@ -366,7 +366,7 @@ static int gif_write_video(AVFormatContext *s,
}
static int gif_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AVCodecContext *codec = &s->streams[stream_index]->codec;
if (codec->codec_type == CODEC_TYPE_AUDIO)
diff --git a/libavformat/grab.c b/libavformat/grab.c
index 1c6eafb6c4..7b8a1bcca9 100644
--- a/libavformat/grab.c
+++ b/libavformat/grab.c
@@ -31,11 +31,11 @@ typedef struct {
int use_mmap;
int width, height;
int frame_rate;
- INT64 time_frame;
+ int64_t time_frame;
int frame_size;
struct video_capability video_cap;
struct video_audio audio_saved;
- UINT8 *video_buf;
+ uint8_t *video_buf;
struct video_mbuf gb_buffers;
struct video_mmap gb_buf;
int gb_frame;
@@ -45,8 +45,8 @@ typedef struct {
int aiw_enabled;
int deint;
int halfw;
- UINT8 *src_mem;
- UINT8 *lum_m4_mem;
+ uint8_t *src_mem;
+ uint8_t *lum_m4_mem;
} VideoData;
static int aiw_init(VideoData *s);
@@ -252,9 +252,9 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
return -EIO;
}
-static int v4l_mm_read_picture(VideoData *s, UINT8 *buf)
+static int v4l_mm_read_picture(VideoData *s, uint8_t *buf)
{
- UINT8 *ptr;
+ uint8_t *ptr;
/* Setup to capture the next frame */
s->gb_buf.frame = (s->gb_frame + 1) % s->gb_buffers.frames;
@@ -281,9 +281,9 @@ static int v4l_mm_read_picture(VideoData *s, UINT8 *buf)
static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
VideoData *s = s1->priv_data;
- INT64 curtime, delay;
+ int64_t curtime, delay;
struct timespec ts;
- INT64 per_frame = (INT64_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
+ int64_t per_frame = (int64_t_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
/* Calculate the time of the next frame */
s->time_frame += per_frame;
@@ -617,13 +617,13 @@ static int aiw_init(VideoData *s)
/* Read two fields separately. */
static int aiw_read_picture(VideoData *s, uint8_t *data)
{
- UINT8 *ptr, *lum, *cb, *cr;
+ uint8_t *ptr, *lum, *cb, *cr;
int h;
#ifndef HAVE_MMX
int sum;
#endif
- UINT8* src = s->src_mem;
- UINT8 *ptrend = &src[s->width*2];
+ uint8_t* src = s->src_mem;
+ uint8_t *ptrend = &src[s->width*2];
lum=data;
cb=&lum[s->width*s->height];
cr=&cb[(s->width*s->height)/4];
@@ -715,7 +715,7 @@ static int aiw_read_picture(VideoData *s, uint8_t *data)
read(s->fd,src,s->width*4);
}
} else {
- UINT8 *lum_m1, *lum_m2, *lum_m3, *lum_m4;
+ uint8_t *lum_m1, *lum_m2, *lum_m3, *lum_m4;
#ifdef HAVE_MMX
mmx_t rounder;
rounder.uw[0]=4;
@@ -725,7 +725,7 @@ static int aiw_read_picture(VideoData *s, uint8_t *data)
movq_m2r(rounder,mm6);
pxor_r2r(mm7,mm7);
#else
- UINT8 *cm = cropTbl + MAX_NEG_CROP;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
#endif
/* read two fields and deinterlace them */
diff --git a/libavformat/http.c b/libavformat/http.c
index 7271a6da81..b19c5dbcc2 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -48,7 +48,7 @@ typedef struct {
} HTTPContext;
static int http_connect(URLContext *h, const char *path, const char *hoststr);
-static int http_write(URLContext *h, UINT8 *buf, int size);
+static int http_write(URLContext *h, uint8_t *buf, int size);
/* return non zero if error */
@@ -236,7 +236,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr)
}
-static int http_read(URLContext *h, UINT8 *buf, int size)
+static int http_read(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
int size1, len;
@@ -265,7 +265,7 @@ static int http_read(URLContext *h, UINT8 *buf, int size)
}
/* used only when posting data */
-static int http_write(URLContext *h, UINT8 *buf, int size)
+static int http_write(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
return url_write(s->hd, buf, size);
diff --git a/libavformat/img.c b/libavformat/img.c
index 0571c7ed5e..af6987011a 100644
--- a/libavformat/img.c
+++ b/libavformat/img.c
@@ -157,18 +157,18 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
char filename[1024];
int ret;
ByteIOContext f1, *f;
- static INT64 first_frame; // BUG -> to context FIXME
+ static int64_t first_frame; // BUG -> to context FIXME
if (emulate_frame_rate) {
if (!first_frame) {
first_frame = av_gettime();
} else {
- INT64 pts;
- INT64 nowus;
+ int64_t pts;
+ int64_t nowus;
nowus = av_gettime() - first_frame;
- pts = ((INT64)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate);
+ pts = ((int64_t)s->img_number * FRAME_RATE_BASE * 1000000) / (s1->streams[0]->codec.frame_rate);
if (pts > nowus)
usleep(pts - nowus);
@@ -201,7 +201,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
av_free_packet(pkt);
return -EIO; /* signal EOF */
} else {
- pkt->pts = ((INT64)s->img_number * s1->pts_den * FRAME_RATE_BASE) / (s1->streams[0]->codec.frame_rate * s1->pts_num);
+ pkt->pts = ((int64_t)s->img_number * s1->pts_den * FRAME_RATE_BASE) / (s1->streams[0]->codec.frame_rate * s1->pts_num);
s->img_number++;
return 0;
}
@@ -265,7 +265,7 @@ static int img_write_header(AVFormatContext *s)
}
static int img_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
VideoData *img = s->priv_data;
AVStream *st = s->streams[stream_index];
diff --git a/libavformat/jpeg.c b/libavformat/jpeg.c
index 0aec8f34a2..db4bd81aa6 100644
--- a/libavformat/jpeg.c
+++ b/libavformat/jpeg.c
@@ -56,8 +56,8 @@ static int jpeg_get_buffer(AVCodecContext *c, AVFrame *picture)
}
}
-static void img_copy(UINT8 *dst, int dst_wrap,
- UINT8 *src, int src_wrap,
+static void img_copy(uint8_t *dst, int dst_wrap,
+ uint8_t *src, int src_wrap,
int width, int height)
{
for(;height > 0; height--) {
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 1395458a9a..0e43c54c4f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -61,7 +61,7 @@
* Avoid them. This is here just to help debugging.
*/
static int debug_indent = 0;
-void print_atom(const char *str, UINT32 type, UINT64 offset, UINT64 size)
+void print_atom(const char *str, uint32_t type, uint64_t offset, uint64_t size)
{
unsigned int tag, i;
tag = (unsigned int) type;
@@ -149,7 +149,7 @@ typedef struct MOVStreamContext {
int is_ff_stream; /* Is this stream presented to ffmpeg ? i.e. is this an audio or video stream ? */
long next_chunk;
long chunk_count;
- INT64 *chunk_offsets;
+ int64_t *chunk_offsets;
long sample_to_chunk_sz;
MOV_sample_to_chunk_tbl *sample_to_chunk;
long sample_to_chunk_index;
@@ -170,15 +170,15 @@ typedef struct MOVContext {
long time_scale;
int found_moov; /* when both 'moov' and 'mdat' sections has been found */
int found_mdat; /* we suppose we have enough data to read the file */
- INT64 mdat_size;
- INT64 mdat_offset;
+ int64_t mdat_size;
+ int64_t mdat_offset;
int total_streams;
/* some streams listed here aren't presented to the ffmpeg API, since they aren't either video nor audio
* but we need the info to be able to skip data from those streams in the 'mdat' section
*/
MOVStreamContext *streams[MAX_STREAMS];
- INT64 next_chunk_offset;
+ int64_t next_chunk_offset;
int partial; /* != 0 : there is still to read in the current chunk (=id of the stream + 1) */
} MOVContext;
@@ -195,18 +195,18 @@ struct MOVParseTableEntry;
*/
typedef int (*mov_parse_function)(const struct MOVParseTableEntry *parse_table,
ByteIOContext *pb,
- UINT32 atom_type,
- INT64 atom_offset, /* after the size and type field (and eventually the extended size) */
- INT64 atom_size, /* total size (excluding the size and type fields) */
+ uint32_t atom_type,
+ int64_t atom_offset, /* after the size and type field (and eventually the extended size) */
+ int64_t atom_size, /* total size (excluding the size and type fields) */
void *param);
/* links atom IDs to parse functions */
typedef struct MOVParseTableEntry {
- UINT32 type;
+ uint32_t type;
mov_parse_function func;
} MOVParseTableEntry;
-static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
#ifdef DEBUG
print_atom("leaf", atom_type, atom_offset, atom_size);
@@ -218,11 +218,11 @@ static int parse_leaf(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
}
-static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
- UINT32 type, foo=0;
- UINT64 offset, size;
- UINT64 total_size = 0;
+ uint32_t type, foo=0;
+ uint64_t offset, size;
+ uint64_t total_size = 0;
int i;
int err = 0;
foo=0;
@@ -276,7 +276,7 @@ static int parse_default(const MOVParseTableEntry *parse_table, ByteIOContext *p
return err;
}
-static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
#ifdef DEBUG
@@ -314,7 +314,7 @@ static int parse_mvhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
}
/* this atom should contain all header atoms */
-static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
int err;
MOVContext *c;
@@ -333,7 +333,7 @@ static int parse_moov(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
}
/* this atom contains actual media data */
-static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
#ifdef DEBUG
@@ -355,10 +355,10 @@ static int parse_mdat(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
/* this atom should be null (from specs), but some buggy files put the 'moov' atom inside it... */
/* like the files created with Adobe Premiere 5.0, for samples see */
/* http://graphics.tudelft.nl/~wouter/publications/soundtests/ */
-static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
int err;
- UINT32 type;
+ uint32_t type;
#ifdef DEBUG
print_atom("wide", atom_type, atom_offset, atom_size);
debug_indent++;
@@ -381,7 +381,7 @@ static int parse_wide(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return err;
}
-static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
AVStream *st;
@@ -401,7 +401,7 @@ static int parse_trak(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return parse_default(parse_table, pb, atom_type, atom_offset, atom_size, param);
}
-static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
AVStream *st;
@@ -445,7 +445,7 @@ static int parse_tkhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return 0;
}
-static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
AVStream *st;
@@ -477,14 +477,14 @@ static int parse_mdhd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return 0;
}
-static int parse_hdlr(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_hdlr(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int len = 0;
char *buf;
- UINT32 type;
+ uint32_t type;
AVStream *st;
- UINT32 ctype;
+ uint32_t ctype;
#ifdef DEBUG
print_atom("hdlr", atom_type, atom_offset, atom_size);
#endif
@@ -612,11 +612,11 @@ static int mp4_read_descr(ByteIOContext *pb, int *tag)
return len;
}
-static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int entries, size, samp_sz, frames_per_sample, id;
- UINT32 format;
+ uint32_t format;
AVStream *st;
MOVStreamContext *sc;
#ifdef DEBUG
@@ -691,7 +691,7 @@ static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
size -= (16+8*4+2+32+2*2);
while (size >= 8) {
int atom_size, atom_type;
- INT64 start_pos;
+ int64_t start_pos;
atom_size = get_be32(pb);
atom_type = get_le32(pb);
@@ -800,7 +800,7 @@ static int parse_stsd(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return 0;
}
-static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int entries, i;
@@ -818,7 +818,7 @@ static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
entries = get_be32(pb);
sc->chunk_count = entries;
- sc->chunk_offsets = av_malloc(entries * sizeof(INT64));
+ sc->chunk_offsets = av_malloc(entries * sizeof(int64_t));
if(atom_type == MKTAG('s', 't', 'c', 'o')) {
for(i=0; i<entries; i++) {
sc->chunk_offsets[i] = get_be32(pb);
@@ -839,7 +839,7 @@ static int parse_stco(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return 0;
}
-static int parse_stsc(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_stsc(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int entries, i;
@@ -872,7 +872,7 @@ printf("track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
return 0;
}
-static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int entries, i;
@@ -906,7 +906,7 @@ static int parse_stsz(const MOVParseTableEntry *parse_table, ByteIOContext *pb,
return 0;
}
-static int parse_stts(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_stts(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
int entries, i;
@@ -944,12 +944,12 @@ printf("track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
}
#ifdef CONFIG_ZLIB
-static int null_read_packet(void *opaque, UINT8 *buf, int buf_size)
+static int null_read_packet(void *opaque, uint8_t *buf, int buf_size)
{
return -1;
}
-static int parse_cmov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, UINT32 atom_type, INT64 atom_offset, INT64 atom_size, void *param)
+static int parse_cmov(const MOVParseTableEntry *parse_table, ByteIOContext *pb, uint32_t atom_type, int64_t atom_offset, int64_t atom_size, void *param)
{
MOVContext *c;
ByteIOContext ctx;
@@ -1130,7 +1130,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
MOVContext *mov = s->priv_data;
ByteIOContext *pb = &s->pb;
int i, j, nb, err;
- INT64 size;
+ int64_t size;
mov->fc = s;
#if 0
@@ -1200,7 +1200,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVContext *mov = s->priv_data;
MOVStreamContext *sc;
- INT64 offset = 0x0FFFFFFFFFFFFFFF;
+ int64_t offset = 0x0FFFFFFFFFFFFFFF;
int i;
int st_id = 0, size;
size = 0x0FFFFFFF;
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index dcbd8f0457..f9000a74d8 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -22,12 +22,12 @@
#define NB_STREAMS 2
typedef struct {
- UINT8 buffer[MAX_PAYLOAD_SIZE];
+ uint8_t buffer[MAX_PAYLOAD_SIZE];
int buffer_ptr;
- UINT8 id;
+ uint8_t id;
int max_buffer_size; /* in bytes */
int packet_number;
- INT64 start_pts;
+ int64_t start_pts;
} StreamInfo;
typedef struct {
@@ -66,7 +66,7 @@ extern AVOutputFormat mpeg1vcd_mux;
extern AVOutputFormat mpeg2vob_mux;
static int put_pack_header(AVFormatContext *ctx,
- UINT8 *buf, INT64 timestamp)
+ uint8_t *buf, int64_t timestamp)
{
MpegMuxContext *s = ctx->priv_data;
PutBitContext pb;
@@ -79,11 +79,11 @@ static int put_pack_header(AVFormatContext *ctx,
} else {
put_bits(&pb, 4, 0x2);
}
- put_bits(&pb, 3, (UINT32)((timestamp >> 30) & 0x07));
+ put_bits(&pb, 3, (uint32_t)((timestamp >> 30) & 0x07));
put_bits(&pb, 1, 1);
- put_bits(&pb, 15, (UINT32)((timestamp >> 15) & 0x7fff));
+ put_bits(&pb, 15, (uint32_t)((timestamp >> 15) & 0x7fff));
put_bits(&pb, 1, 1);
- put_bits(&pb, 15, (UINT32)((timestamp) & 0x7fff));
+ put_bits(&pb, 15, (uint32_t)((timestamp) & 0x7fff));
put_bits(&pb, 1, 1);
if (s->is_mpeg2) {
/* clock extension */
@@ -101,7 +101,7 @@ static int put_pack_header(AVFormatContext *ctx,
return pbBufPtr(&pb) - pb.buf;
}
-static int put_system_header(AVFormatContext *ctx, UINT8 *buf)
+static int put_system_header(AVFormatContext *ctx, uint8_t *buf)
{
MpegMuxContext *s = ctx->priv_data;
int size, rate_bound, i, private_stream_coded, id;
@@ -254,10 +254,10 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
{
MpegMuxContext *s = ctx->priv_data;
StreamInfo *stream = ctx->streams[stream_index]->priv_data;
- UINT8 *buf_ptr;
+ uint8_t *buf_ptr;
int size, payload_size, startcode, id, len, stuffing_size, i, header_len;
- INT64 timestamp;
- UINT8 buffer[128];
+ int64_t timestamp;
+ uint8_t buffer[128];
int last = last_pkt ? 4 : 0;
id = stream->id;
@@ -314,8 +314,8 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
(0x02 << 4) |
(((timestamp >> 30) & 0x07) << 1) |
1);
- put_be16(&ctx->pb, (UINT16)((((timestamp >> 15) & 0x7fff) << 1) | 1));
- put_be16(&ctx->pb, (UINT16)((((timestamp) & 0x7fff) << 1) | 1));
+ put_be16(&ctx->pb, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
+ put_be16(&ctx->pb, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
if (startcode == PRIVATE_STREAM_1) {
put_byte(&ctx->pb, id);
@@ -347,7 +347,7 @@ static void flush_packet(AVFormatContext *ctx, int stream_index, int last_pkt)
}
static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,
- UINT8 *buf, int size, int pts)
+ uint8_t *buf, int size, int pts)
{
MpegMuxContext *s = ctx->priv_data;
AVStream *st = ctx->streams[stream_index];
@@ -440,7 +440,7 @@ typedef struct MpegDemuxContext {
} MpegDemuxContext;
static int find_start_code(ByteIOContext *pb, int *size_ptr,
- UINT32 *header_state)
+ uint32_t *header_state)
{
unsigned int state, v;
int val, n;
@@ -475,18 +475,18 @@ static int mpegps_read_header(AVFormatContext *s,
return 0;
}
-static INT64 get_pts(ByteIOContext *pb, int c)
+static int64_t get_pts(ByteIOContext *pb, int c)
{
- INT64 pts;
+ int64_t pts;
int val;
if (c < 0)
c = get_byte(pb);
- pts = (INT64)((c >> 1) & 0x07) << 30;
+ pts = (int64_t)((c >> 1) & 0x07) << 30;
val = get_be16(pb);
- pts |= (INT64)(val >> 1) << 15;
+ pts |= (int64_t)(val >> 1) << 15;
val = get_be16(pb);
- pts |= (INT64)(val >> 1);
+ pts |= (int64_t)(val >> 1);
return pts;
}
@@ -496,7 +496,7 @@ static int mpegps_read_packet(AVFormatContext *s,
MpegDemuxContext *m = s->priv_data;
AVStream *st;
int len, size, startcode, i, c, flags, header_len, type, codec_id;
- INT64 pts, dts;
+ int64_t pts, dts;
/* next start code (should be immediately after) */
redo:
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 2947d960e8..df3aca89b7 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -88,7 +88,7 @@ static int mpegts_read_header(AVFormatContext *s,
ByteIOContext *pb = &s->pb;
unsigned char buf[1024];
int len;
- INT64 pos;
+ int64_t pos;
/* read the first 1024 bytes to get packet size */
pos = url_ftell(pb);
diff --git a/libavformat/mpjpeg.c b/libavformat/mpjpeg.c
index f5ff451121..62e2601aad 100644
--- a/libavformat/mpjpeg.c
+++ b/libavformat/mpjpeg.c
@@ -24,7 +24,7 @@
static int mpjpeg_write_header(AVFormatContext *s)
{
- UINT8 buf1[256];
+ uint8_t buf1[256];
snprintf(buf1, sizeof(buf1), "--%s\n", BOUNDARY_TAG);
put_buffer(&s->pb, buf1, strlen(buf1));
@@ -33,9 +33,9 @@ static int mpjpeg_write_header(AVFormatContext *s)
}
static int mpjpeg_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
- UINT8 buf1[256];
+ uint8_t buf1[256];
snprintf(buf1, sizeof(buf1), "Content-type: image/jpeg\n\n");
put_buffer(&s->pb, buf1, strlen(buf1));
@@ -75,7 +75,7 @@ static int single_jpeg_write_header(AVFormatContext *s)
}
static int single_jpeg_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
put_buffer(&s->pb, buf, size);
put_flush_packet(&s->pb);
diff --git a/libavformat/pnm.c b/libavformat/pnm.c
index a0414c87d1..38d7ab2280 100644
--- a/libavformat/pnm.c
+++ b/libavformat/pnm.c
@@ -161,7 +161,7 @@ static int pnm_write(ByteIOContext *pb, AVImageInfo *info)
{
int i, h, h1, c, n, linesize;
char buf[100];
- UINT8 *ptr, *ptr1, *ptr2;
+ uint8_t *ptr, *ptr1, *ptr2;
h = info->height;
h1 = h;
diff --git a/libavformat/raw.c b/libavformat/raw.c
index f05305aa7e..f32f5eb599 100644
--- a/libavformat/raw.c
+++ b/libavformat/raw.c
@@ -38,7 +38,7 @@ static int raw_write_trailer(struct AVFormatContext *s)
}
/* raw input */
-static static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AVStream *st;
int id;
diff --git a/libavformat/rm.c b/libavformat/rm.c
index e537aed151..f5ae3a3f33 100644
--- a/libavformat/rm.c
+++ b/libavformat/rm.c
@@ -322,16 +322,16 @@ static int rm_write_header(AVFormatContext *s)
return 0;
}
-static int rm_write_audio(AVFormatContext *s, UINT8 *buf, int size)
+static int rm_write_audio(AVFormatContext *s, uint8_t *buf, int size)
{
- UINT8 *buf1;
+ uint8_t *buf1;
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
StreamInfo *stream = rm->audio_stream;
int i;
/* XXX: suppress this malloc */
- buf1= (UINT8*) av_malloc( size * sizeof(UINT8) );
+ buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) );
write_packet_header(s, stream, size, stream->enc->coded_frame->key_frame);
@@ -347,7 +347,7 @@ static int rm_write_audio(AVFormatContext *s, UINT8 *buf, int size)
return 0;
}
-static int rm_write_video(AVFormatContext *s, UINT8 *buf, int size)
+static int rm_write_video(AVFormatContext *s, uint8_t *buf, int size)
{
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
@@ -388,7 +388,7 @@ static int rm_write_video(AVFormatContext *s, UINT8 *buf, int size)
}
static int rm_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
if (s->streams[stream_index]->codec.codec_type ==
CODEC_TYPE_AUDIO)
@@ -472,7 +472,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap)
ByteIOContext *pb = &s->pb;
unsigned int tag, v;
int tag_size, size, codec_data_size, i;
- INT64 codec_pos;
+ int64_t codec_pos;
unsigned int h263_hack_version;
char buf[128];
int flags = 0;
@@ -650,7 +650,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
ByteIOContext *pb = &s->pb;
AVStream *st;
int len, num, timestamp, i, tmp, j;
- UINT8 *ptr;
+ uint8_t *ptr;
int flags;
redo:
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index f36da6d41d..87d28a3f77 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -90,23 +90,23 @@ enum RTPPayloadType {
typedef struct RTPContext {
int payload_type;
- UINT32 ssrc;
- UINT16 seq;
- UINT32 timestamp;
- UINT32 base_timestamp;
- UINT32 cur_timestamp;
+ uint32_t ssrc;
+ uint16_t seq;
+ uint32_t timestamp;
+ uint32_t base_timestamp;
+ uint32_t cur_timestamp;
int max_payload_size;
/* rtcp sender statistics receive */
- INT64 last_rtcp_ntp_time;
- UINT32 last_rtcp_timestamp;
+ int64_t last_rtcp_ntp_time;
+ uint32_t last_rtcp_timestamp;
/* rtcp sender statistics */
unsigned int packet_count;
unsigned int octet_count;
unsigned int last_octet_count;
int first_packet;
/* buffer for output */
- UINT8 buf[RTP_MAX_PACKET_LENGTH];
- UINT8 *buf_ptr;
+ uint8_t buf[RTP_MAX_PACKET_LENGTH];
+ uint8_t *buf_ptr;
} RTPContext;
int rtp_get_codec_info(AVCodecContext *codec, int payload_type)
@@ -184,14 +184,14 @@ int rtp_get_payload_type(AVCodecContext *codec)
return payload_type;
}
-static inline UINT32 decode_be32(const UINT8 *p)
+static inline uint32_t decode_be32(const uint8_t *p)
{
return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}
-static inline UINT32 decode_be64(const UINT8 *p)
+static inline uint32_t decode_be64(const uint8_t *p)
{
- return ((UINT64)decode_be32(p) << 32) | decode_be32(p + 4);
+ return ((uint64_t)decode_be32(p) << 32) | decode_be32(p + 4);
}
static int rtcp_parse_packet(AVFormatContext *s1, const unsigned char *buf, int len)
@@ -221,7 +221,7 @@ int rtp_parse_packet(AVFormatContext *s1, AVPacket *pkt,
unsigned int ssrc, h;
int payload_type, seq, delta_timestamp;
AVStream *st;
- UINT32 timestamp;
+ uint32_t timestamp;
if (len < 12)
return -1;
@@ -390,7 +390,7 @@ static int rtp_write_header(AVFormatContext *s1)
}
/* send an rtcp sender report packet */
-static void rtcp_send_sr(AVFormatContext *s1, INT64 ntp_time)
+static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
{
RTPContext *s = s1->priv_data;
#if defined(DEBUG)
@@ -409,7 +409,7 @@ static void rtcp_send_sr(AVFormatContext *s1, INT64 ntp_time)
/* send an rtp packet. sequence number is incremented, but the caller
must update the timestamp itself */
-static void rtp_send_data(AVFormatContext *s1, UINT8 *buf1, int len)
+static void rtp_send_data(AVFormatContext *s1, uint8_t *buf1, int len)
{
RTPContext *s = s1->priv_data;
@@ -435,7 +435,7 @@ static void rtp_send_data(AVFormatContext *s1, UINT8 *buf1, int len)
/* send an integer number of samples and compute time stamp and fill
the rtp send buffer before sending. */
static void rtp_send_samples(AVFormatContext *s1,
- UINT8 *buf1, int size, int sample_size)
+ uint8_t *buf1, int size, int sample_size)
{
RTPContext *s = s1->priv_data;
int len, max_packet_size, n;
@@ -468,7 +468,7 @@ static void rtp_send_samples(AVFormatContext *s1,
/* NOTE: we suppose that exactly one frame is given as argument here */
/* XXX: test it */
static void rtp_send_mpegaudio(AVFormatContext *s1,
- UINT8 *buf1, int size)
+ uint8_t *buf1, int size)
{
RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0];
@@ -524,12 +524,12 @@ static void rtp_send_mpegaudio(AVFormatContext *s1,
/* NOTE: a single frame must be passed with sequence header if
needed. XXX: use slices. */
static void rtp_send_mpegvideo(AVFormatContext *s1,
- UINT8 *buf1, int size)
+ uint8_t *buf1, int size)
{
RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0];
int len, h, max_packet_size;
- UINT8 *q;
+ uint8_t *q;
max_packet_size = s->max_payload_size;
@@ -572,7 +572,7 @@ static void rtp_send_mpegvideo(AVFormatContext *s1,
}
static void rtp_send_raw(AVFormatContext *s1,
- UINT8 *buf1, int size)
+ uint8_t *buf1, int size)
{
RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0];
@@ -599,12 +599,12 @@ static void rtp_send_raw(AVFormatContext *s1,
/* write an RTP packet. 'buf1' must contain a single specific frame. */
static int rtp_write_packet(AVFormatContext *s1, int stream_index,
- UINT8 *buf1, int size, int force_pts)
+ uint8_t *buf1, int size, int force_pts)
{
RTPContext *s = s1->priv_data;
AVStream *st = s1->streams[0];
int rtcp_bytes;
- INT64 ntp_time;
+ int64_t ntp_time;
#ifdef DEBUG
printf("%d: write len=%d\n", stream_index, size);
@@ -615,7 +615,7 @@ static int rtp_write_packet(AVFormatContext *s1, int stream_index,
RTCP_TX_RATIO_DEN;
if (s->first_packet || rtcp_bytes >= 28) {
/* compute NTP time */
- ntp_time = force_pts; // ((INT64)force_pts << 28) / 5625
+ ntp_time = force_pts; // ((int64_t)force_pts << 28) / 5625
rtcp_send_sr(s1, ntp_time);
s->last_octet_count = s->octet_count;
s->first_packet = 0;
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index 8473a2c8b2..40c7f6a375 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -171,7 +171,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
return -EIO;
}
-static int rtp_read(URLContext *h, UINT8 *buf, int size)
+static int rtp_read(URLContext *h, uint8_t *buf, int size)
{
RTPContext *s = h->priv_data;
struct sockaddr_in from;
@@ -230,7 +230,7 @@ static int rtp_read(URLContext *h, UINT8 *buf, int size)
return len;
}
-static int rtp_write(URLContext *h, UINT8 *buf, int size)
+static int rtp_write(URLContext *h, uint8_t *buf, int size)
{
RTPContext *s = h->priv_data;
int ret;
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 3dd231571e..f237268db8 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -41,7 +41,7 @@ typedef struct RTSPTransportField {
int client_port_min, client_port_max; /* RTP ports */
int server_port_min, server_port_max; /* RTP ports */
int ttl; /* ttl value */
- UINT32 destination; /* destination IP address */
+ uint32_t destination; /* destination IP address */
enum RTSPProtocol protocol;
} RTSPTransportField;
@@ -63,7 +63,7 @@ enum RTSPCallbackAction {
};
typedef struct RTSPActionServerSetup {
- UINT32 ipaddr;
+ uint32_t ipaddr;
char transport_option[512];
} RTSPActionServerSetup;
diff --git a/libavformat/swf.c b/libavformat/swf.c
index 315219056e..9b86b58bee 100644
--- a/libavformat/swf.c
+++ b/libavformat/swf.c
@@ -107,7 +107,7 @@ static void put_swf_rect(ByteIOContext *pb,
int xmin, int xmax, int ymin, int ymax)
{
PutBitContext p;
- UINT8 buf[256];
+ uint8_t buf[256];
int nbits, mask;
init_put_bits(&p, buf, sizeof(buf), NULL, NULL);
@@ -164,7 +164,7 @@ static void put_swf_matrix(ByteIOContext *pb,
int a, int b, int c, int d, int tx, int ty)
{
PutBitContext p;
- UINT8 buf[256];
+ uint8_t buf[256];
init_put_bits(&p, buf, sizeof(buf), NULL, NULL);
@@ -193,7 +193,7 @@ static int swf_write_header(AVFormatContext *s)
ByteIOContext *pb = &s->pb;
AVCodecContext *enc, *audio_enc, *video_enc;
PutBitContext p;
- UINT8 buf1[256];
+ uint8_t buf1[256];
int i, width, height, rate;
swf = av_malloc(sizeof(SWFContext));
@@ -230,7 +230,7 @@ static int swf_write_header(AVFormatContext *s)
put_swf_rect(pb, 0, width, 0, height);
put_le16(pb, (rate * 256) / FRAME_RATE_BASE); /* frame rate */
swf->duration_pos = url_ftell(pb);
- put_le16(pb, (UINT16)(DUMMY_DURATION * (INT64)rate / FRAME_RATE_BASE)); /* frame count */
+ put_le16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / FRAME_RATE_BASE)); /* frame count */
/* define a shape with the jpeg inside */
@@ -316,7 +316,7 @@ static int swf_write_header(AVFormatContext *s)
}
static int swf_write_video(AVFormatContext *s,
- AVCodecContext *enc, UINT8 *buf, int size)
+ AVCodecContext *enc, uint8_t *buf, int size)
{
ByteIOContext *pb = &s->pb;
static int tag_id = 0;
@@ -364,7 +364,7 @@ static int swf_write_video(AVFormatContext *s,
return 0;
}
-static int swf_write_audio(AVFormatContext *s, UINT8 *buf, int size)
+static int swf_write_audio(AVFormatContext *s, uint8_t *buf, int size)
{
ByteIOContext *pb = &s->pb;
@@ -378,7 +378,7 @@ static int swf_write_audio(AVFormatContext *s, UINT8 *buf, int size)
}
static int swf_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AVCodecContext *codec = &s->streams[stream_index]->codec;
if (codec->codec_type == CODEC_TYPE_AUDIO)
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 61d8665525..bc5406292d 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -100,7 +100,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
return -EIO;
}
-static int tcp_read(URLContext *h, UINT8 *buf, int size)
+static int tcp_read(URLContext *h, uint8_t *buf, int size)
{
TCPContext *s = h->priv_data;
int size1, len;
@@ -130,7 +130,7 @@ static int tcp_read(URLContext *h, UINT8 *buf, int size)
return size1 - size;
}
-static int tcp_write(URLContext *h, UINT8 *buf, int size)
+static int tcp_write(URLContext *h, uint8_t *buf, int size)
{
TCPContext *s = h->priv_data;
int ret, size1;
diff --git a/libavformat/udp.c b/libavformat/udp.c
index f28bdcaa4c..cf14d4cb3c 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -208,7 +208,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
return -EIO;
}
-static int udp_read(URLContext *h, UINT8 *buf, int size)
+static int udp_read(URLContext *h, uint8_t *buf, int size)
{
UDPContext *s = h->priv_data;
struct sockaddr_in from;
@@ -228,7 +228,7 @@ static int udp_read(URLContext *h, UINT8 *buf, int size)
return len;
}
-static int udp_write(URLContext *h, UINT8 *buf, int size)
+static int udp_write(URLContext *h, uint8_t *buf, int size)
{
UDPContext *s = h->priv_data;
int ret;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2b7a46191d..d6e888b9f3 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -197,7 +197,7 @@ void fifo_free(FifoBuffer *f)
av_free(f->buffer);
}
-int fifo_size(FifoBuffer *f, UINT8 *rptr)
+int fifo_size(FifoBuffer *f, uint8_t *rptr)
{
int size;
@@ -210,9 +210,9 @@ int fifo_size(FifoBuffer *f, UINT8 *rptr)
}
/* get data from the fifo (return -1 if not enough data) */
-int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr)
+int fifo_read(FifoBuffer *f, uint8_t *buf, int buf_size, uint8_t **rptr_ptr)
{
- UINT8 *rptr = *rptr_ptr;
+ uint8_t *rptr = *rptr_ptr;
int size, len;
if (f->wptr >= rptr) {
@@ -238,10 +238,10 @@ int fifo_read(FifoBuffer *f, UINT8 *buf, int buf_size, UINT8 **rptr_ptr)
return 0;
}
-void fifo_write(FifoBuffer *f, UINT8 *buf, int size, UINT8 **wptr_ptr)
+void fifo_write(FifoBuffer *f, uint8_t *buf, int size, uint8_t **wptr_ptr)
{
int len;
- UINT8 *wptr;
+ uint8_t *wptr;
wptr = *wptr_ptr;
while (size > 0) {
len = f->end - wptr;
@@ -471,7 +471,7 @@ int av_find_stream_info(AVFormatContext *ic)
AVFrame picture;
AVPacketList *pktl=NULL, **ppktl;
short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2];
- UINT8 *ptr;
+ uint8_t *ptr;
int min_read_size, max_read_size;
/* typical mpeg ts rate is 40 Mbits. DVD rate is about 10
@@ -759,11 +759,11 @@ int av_write_header(AVFormatContext *s)
switch (st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
av_frac_init(&st->pts, 0, 0,
- (INT64)s->pts_num * st->codec.sample_rate);
+ (int64_t)s->pts_num * st->codec.sample_rate);
break;
case CODEC_TYPE_VIDEO:
av_frac_init(&st->pts, 0, 0,
- (INT64)s->pts_num * st->codec.frame_rate);
+ (int64_t)s->pts_num * st->codec.frame_rate);
break;
default:
break;
@@ -786,7 +786,7 @@ int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
int size)
{
AVStream *st;
- INT64 pts_mask;
+ int64_t pts_mask;
int ret, frame_size;
st = s->streams[stream_index];
@@ -816,11 +816,11 @@ int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
frame_size = st->codec.frame_size;
}
av_frac_add(&st->pts,
- (INT64)s->pts_den * frame_size);
+ (int64_t)s->pts_den * frame_size);
break;
case CODEC_TYPE_VIDEO:
av_frac_add(&st->pts,
- (INT64)s->pts_den * FRAME_RATE_BASE);
+ (int64_t)s->pts_den * FRAME_RATE_BASE);
break;
default:
break;
@@ -914,16 +914,16 @@ int parse_image_size(int *width_ptr, int *height_ptr, const char *str)
return 0;
}
-INT64 av_gettime(void)
+int64_t av_gettime(void)
{
#ifdef CONFIG_WIN32
struct _timeb tb;
_ftime(&tb);
- return ((INT64)tb.time * INT64_C(1000) + (INT64)tb.millitm) * INT64_C(1000);
+ return ((int64_t)tb.time * int64_t_C(1000) + (int64_t)tb.millitm) * int64_t_C(1000);
#else
struct timeval tv;
gettimeofday(&tv,NULL);
- return (INT64)tv.tv_sec * 1000000 + tv.tv_usec;
+ return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
#endif
}
@@ -955,10 +955,10 @@ static time_t mktimegm(struct tm *tm)
* HH[:MM[:SS[.m...]]]
* S+[.m...]
*/
-INT64 parse_date(const char *datestr, int duration)
+int64_t parse_date(const char *datestr, int duration)
{
const char *p;
- INT64 t;
+ int64_t t;
struct tm dt;
int i;
static const char *date_fmt[] = {
@@ -1027,7 +1027,7 @@ INT64 parse_date(const char *datestr, int duration)
if (duration)
return 0;
else
- return now * INT64_C(1000000);
+ return now * int64_t_C(1000000);
}
if (duration) {
@@ -1167,7 +1167,7 @@ int get_frame_filename(char *buf, int buf_size,
* @param buf buffer
* @param size buffer size
*/
-void av_hex_dump(UINT8 *buf, int size)
+void av_hex_dump(uint8_t *buf, int size)
{
int len, i, j, c;
@@ -1271,7 +1271,7 @@ void av_set_pts_info(AVFormatContext *s, int pts_wrap_bits,
* @param num must be >= 0
* @param den must be >= 1
*/
-void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den)
+void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
{
num += (den >> 1);
if (num >= den) {
@@ -1284,7 +1284,7 @@ void av_frac_init(AVFrac *f, INT64 val, INT64 num, INT64 den)
}
/* set f to (val + 0.5) */
-void av_frac_set(AVFrac *f, INT64 val)
+void av_frac_set(AVFrac *f, int64_t val)
{
f->val = val;
f->num = f->den >> 1;
@@ -1296,9 +1296,9 @@ void av_frac_set(AVFrac *f, INT64 val)
* @param f fractional number
* @param incr increment, can be positive or negative
*/
-void av_frac_add(AVFrac *f, INT64 incr)
+void av_frac_add(AVFrac *f, int64_t incr)
{
- INT64 num, den;
+ int64_t num, den;
num = f->num + incr;
den = f->den;
diff --git a/libavformat/wav.c b/libavformat/wav.c
index f6bcd7b0e5..25e779307b 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -171,7 +171,7 @@ static int wav_write_header(AVFormatContext *s)
}
static int wav_write_packet(AVFormatContext *s, int stream_index_ptr,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
ByteIOContext *pb = &s->pb;
put_buffer(pb, buf, size);
@@ -190,7 +190,7 @@ static int wav_write_trailer(AVFormatContext *s)
/* update file size */
file_size = url_ftell(pb);
url_fseek(pb, 4, SEEK_SET);
- put_le32(pb, (UINT32)(file_size - 8));
+ put_le32(pb, (uint32_t)(file_size - 8));
url_fseek(pb, file_size, SEEK_SET);
put_flush_packet(pb);
@@ -200,7 +200,7 @@ static int wav_write_trailer(AVFormatContext *s)
/* return the size of the found tag */
/* XXX: > 2GB ? */
-static int find_tag(ByteIOContext *pb, UINT32 tag1)
+static int find_tag(ByteIOContext *pb, uint32_t tag1)
{
unsigned int tag;
int size;
diff --git a/libavformat/yuv.c b/libavformat/yuv.c
index 5d09585cdc..61a4590175 100644
--- a/libavformat/yuv.c
+++ b/libavformat/yuv.c
@@ -97,7 +97,7 @@ static int yuv_write(ByteIOContext *pb2, AVImageInfo *info)
ByteIOContext pb1, *pb;
char fname[1024], *p;
int i, j, width, height;
- UINT8 *ptr;
+ uint8_t *ptr;
URLContext *h;
static const char *ext = "YUV";
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index cf451e3210..1659ca7885 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -101,7 +101,7 @@ static int yuv4_write_header(AVFormatContext *s)
}
static int yuv4_write_packet(AVFormatContext *s, int stream_index,
- UINT8 *buf, int size, int force_pts)
+ uint8_t *buf, int size, int force_pts)
{
AVStream *st = s->streams[stream_index];
ByteIOContext *pb = &s->pb;
@@ -109,7 +109,7 @@ static int yuv4_write_packet(AVFormatContext *s, int stream_index,
int width, height;
int i, m;
char buf1[20];
- UINT8 *ptr, *ptr1, *ptr2;
+ uint8_t *ptr, *ptr1, *ptr2;
picture = (AVPicture *)buf;