Skip to content

Commit

Permalink
avio: rename ByteIOContext to AVIOContext.
Browse files Browse the repository at this point in the history
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ae628ec)
  • Loading branch information
elenril authored and michaelni committed Feb 20, 2011
1 parent a8858ee commit 471fe57
Show file tree
Hide file tree
Showing 140 changed files with 838 additions and 834 deletions.
10 changes: 5 additions & 5 deletions ffserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ typedef struct HTTPContext {

/* RTSP state specific */
uint8_t *pb_buffer; /* XXX: use that in all the code */
ByteIOContext *pb;
AVIOContext *pb;
int seq; /* RTSP sequence number */

/* RTP state specific */
Expand Down Expand Up @@ -1854,7 +1854,7 @@ static int http_parse_request(HTTPContext *c)
return 0;
}

static void fmt_bytecount(ByteIOContext *pb, int64_t count)
static void fmt_bytecount(AVIOContext *pb, int64_t count)
{
static const char *suffix = " kMGTP";
const char *s;
Expand All @@ -1871,7 +1871,7 @@ static void compute_status(HTTPContext *c)
char *p;
time_t ti;
int i, len;
ByteIOContext *pb;
AVIOContext *pb;

if (url_open_dyn_buf(&pb) < 0) {
/* XXX: return an error ? */
Expand Down Expand Up @@ -2491,7 +2491,7 @@ static int http_send_data(HTTPContext *c)

if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP) {
/* RTP packets are sent inside the RTSP TCP connection */
ByteIOContext *pb;
AVIOContext *pb;
int interleaved_index, size;
uint8_t header[4];
HTTPContext *rtsp_c;
Expand Down Expand Up @@ -2712,7 +2712,7 @@ static int http_receive_data(HTTPContext *c)
} else {
/* We have a header in our hands that contains useful data */
AVFormatContext *s = NULL;
ByteIOContext *pb;
AVIOContext *pb;
AVInputFormat *fmt_in;
int i;

Expand Down
4 changes: 2 additions & 2 deletions libavformat/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static int fourxm_probe(AVProbeData *p)
static int fourxm_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size;
int header_size;
Expand Down Expand Up @@ -244,7 +244,7 @@ static int fourxm_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
FourxmDemuxContext *fourxm = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size, out_size;
int ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion libavformat/adtsenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int ff_adts_write_frame_header(ADTSContext *ctx,
static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ADTSContext *adts = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
uint8_t buf[ADTS_HEADER_SIZE];

if (!pkt->size)
Expand Down
6 changes: 3 additions & 3 deletions libavformat/aiffdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static enum CodecID aiff_codec_get_id(int bps)
}

/* returns the size of the found tag */
static int get_tag(ByteIOContext *pb, uint32_t * tag)
static int get_tag(AVIOContext *pb, uint32_t * tag)
{
int size;

Expand Down Expand Up @@ -83,7 +83,7 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
}

/* Returns the number of sound data frames or negative on error */
static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
int size, unsigned version)
{
AVExtFloat ext;
Expand Down Expand Up @@ -177,7 +177,7 @@ static int aiff_read_header(AVFormatContext *s,
int64_t offset = 0;
uint32_t tag;
unsigned version = AIFF_C_VERSION1;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVStream * st;
AIFFInputContext *aiff = s->priv_data;

Expand Down
6 changes: 3 additions & 3 deletions libavformat/aiffenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef struct {
static int aiff_write_header(AVFormatContext *s)
{
AIFFOutputContext *aiff = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
AVExtFloat sample_rate;
int aifc = 0;
Expand Down Expand Up @@ -104,14 +104,14 @@ static int aiff_write_header(AVFormatContext *s)

static int aiff_write_packet(AVFormatContext *s, AVPacket *pkt)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
put_buffer(pb, pkt->data, pkt->size);
return 0;
}

static int aiff_write_trailer(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AIFFOutputContext *aiff = s->priv_data;
AVCodecContext *enc = s->streams[0]->codec;

Expand Down
4 changes: 2 additions & 2 deletions libavformat/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static const char AMRWB_header [] = "#!AMR-WB\n";
#if CONFIG_AMR_MUXER
static int amr_write_header(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;

s->priv_data = NULL;
Expand Down Expand Up @@ -78,7 +78,7 @@ static int amr_probe(AVProbeData *p)
static int amr_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVStream *st;
uint8_t header[9];

Expand Down
4 changes: 2 additions & 2 deletions libavformat/anm.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
AnmDemuxContext *anm = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVStream *st;
int i, ret;

Expand Down Expand Up @@ -177,7 +177,7 @@ static int read_packet(AVFormatContext *s,
AVPacket *pkt)
{
AnmDemuxContext *anm = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
Page *p;
int tmp, record_size;

Expand Down
2 changes: 1 addition & 1 deletion libavformat/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int apc_probe(AVProbeData *p)

static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVStream *st;

get_le32(pb); /* CRYO */
Expand Down
2 changes: 1 addition & 1 deletion libavformat/ape.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)

static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
APEContext *ape = s->priv_data;
AVStream *st;
uint32_t tag;
Expand Down
4 changes: 2 additions & 2 deletions libavformat/apetag.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

static int ape_tag_read_field(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
uint8_t key[1024], *value;
uint32_t size, flags;
int i, c;
Expand Down Expand Up @@ -65,7 +65,7 @@ static int ape_tag_read_field(AVFormatContext *s)

void ff_ape_parse_tag(AVFormatContext *s)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
int file_size = url_fsize(pb);
uint32_t val, fields, tag_bytes;
uint8_t buf[8];
Expand Down
8 changes: 4 additions & 4 deletions libavformat/applehttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ struct segment {

/*
* Each variant has its own demuxer. If it currently is active,
* it has an open ByteIOContext too, and potentially an AVPacket
* it has an open AVIOContext too, and potentially an AVPacket
* containing the next packet from this stream.
*/
struct variant {
int bandwidth;
char url[MAX_URL_SIZE];
ByteIOContext *pb;
AVIOContext *pb;
AVFormatContext *ctx;
AVPacket pkt;
int stream_offset;
Expand All @@ -78,7 +78,7 @@ typedef struct AppleHTTPContext {
int max_start_seq, min_end_seq;
} AppleHTTPContext;

static int read_chomp_line(ByteIOContext *s, char *buf, int maxlen)
static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
{
int len = ff_get_line(s, buf, maxlen);
while (len > 0 && isspace(buf[len - 1]))
Expand Down Expand Up @@ -202,7 +202,7 @@ static void handle_variant_args(struct variant_info *info, const char *key,
}

static int parse_playlist(AppleHTTPContext *c, const char *url,
struct variant *var, ByteIOContext *in)
struct variant *var, AVIOContext *in)
{
int ret = 0, duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
char line[1024];
Expand Down
2 changes: 1 addition & 1 deletion libavformat/asf.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,6 @@ static av_always_inline int ff_guidcmp(const void *g1, const void *g2)
return memcmp(g1, g2, sizeof(ff_asf_guid));
}

void ff_get_guid(ByteIOContext *s, ff_asf_guid *g);
void ff_get_guid(AVIOContext *s, ff_asf_guid *g);

#endif /* AVFORMAT_ASF_H */
28 changes: 14 additions & 14 deletions libavformat/asfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static void print_guid(const ff_asf_guid *g)
#define print_guid(g)
#endif

void ff_get_guid(ByteIOContext *s, ff_asf_guid *g)
void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
assert(sizeof(*g) == 16);
get_buffer(s, *g, sizeof(*g));
Expand All @@ -147,7 +147,7 @@ static int asf_probe(AVProbeData *pd)
return 0;
}

static int get_value(ByteIOContext *pb, int type){
static int get_value(AVIOContext *pb, int type){
switch(type){
case 2: return get_le32(pb);
case 3: return get_le32(pb);
Expand Down Expand Up @@ -187,7 +187,7 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len)
static int asf_read_file_properties(AVFormatContext *s, int64_t size)
{
ASFContext *asf = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;

ff_get_guid(pb, &asf->hdr.guid);
asf->hdr.file_size = get_le64(pb);
Expand All @@ -209,7 +209,7 @@ static int asf_read_file_properties(AVFormatContext *s, int64_t size)
static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
{
ASFContext *asf = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
AVStream *st;
ASFStream *asf_st;
ff_asf_guid g;
Expand Down Expand Up @@ -395,7 +395,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)
{
ASFContext *asf = s->priv_data;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
ff_asf_guid g;
int ext_len, payload_ext_ct, stream_ct, i;
uint32_t ext_d, leak_rate, stream_num;
Expand Down Expand Up @@ -442,7 +442,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size)

static int asf_read_content_desc(AVFormatContext *s, int64_t size)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
int len1, len2, len3, len4, len5;

len1 = get_le16(pb);
Expand All @@ -461,7 +461,7 @@ static int asf_read_content_desc(AVFormatContext *s, int64_t size)

static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
ASFContext *asf = s->priv_data;
int desc_count, i, ret;

Expand Down Expand Up @@ -496,7 +496,7 @@ static int asf_read_ext_content_desc(AVFormatContext *s, int64_t size)

static int asf_read_language_list(AVFormatContext *s, int64_t size)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
ASFContext *asf = s->priv_data;
int j, ret;
int stream_count = get_le16(pb);
Expand All @@ -514,7 +514,7 @@ static int asf_read_language_list(AVFormatContext *s, int64_t size)

static int asf_read_metadata(AVFormatContext *s, int64_t size)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
ASFContext *asf = s->priv_data;
int n, stream_num, name_len, value_len, value_type, value_num;
int ret, i;
Expand Down Expand Up @@ -546,7 +546,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size)

static int asf_read_marker(AVFormatContext *s, int64_t size)
{
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
int i, count, name_len, ret;
char name[1024];

Expand Down Expand Up @@ -581,7 +581,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
ASFContext *asf = s->priv_data;
ff_asf_guid g;
ByteIOContext *pb = s->pb;
AVIOContext *pb = s->pb;
int i;
int64_t gsize;

Expand Down Expand Up @@ -715,7 +715,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
* @param pb context to read data from
* @return 0 on success, <0 on error
*/
static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
static int ff_asf_get_packet(AVFormatContext *s, AVIOContext *pb)
{
ASFContext *asf = s->priv_data;
uint32_t packet_length, padsize;
Expand Down Expand Up @@ -800,7 +800,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
*
* @return <0 if error
*/
static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
ASFContext *asf = s->priv_data;
int rsize = 1;
int num = get_byte(pb);
Expand Down Expand Up @@ -879,7 +879,7 @@ static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
* @return 0 if data was stored in pkt, <0 on error or 1 if more ASF
* packets need to be loaded (through asf_get_packet())
*/
static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
{
ASFContext *asf = s->priv_data;
ASFStream *asf_st = 0;
Expand Down
Loading

0 comments on commit 471fe57

Please sign in to comment.