aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/r3d.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-02-21 16:43:01 +0100
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-21 11:23:22 -0500
commitb7effd4e8338f6ed5bda630ad7ed0809bf458648 (patch)
tree53c878f6dd48c313a9bcde1855c2b4e009822c9e /libavformat/r3d.c
parentf8bed30d8b176fa030f6737765338bb4a2bcabc9 (diff)
downloadffmpeg-b7effd4e8338f6ed5bda630ad7ed0809bf458648.tar.gz
avio: avio_ prefixes for get_* functions
In the name of consistency: get_byte -> avio_r8 get_<type> -> avio_r<type> get_buffer -> avio_read get_partial_buffer will be made private later get_strz is left out becase I want to change it later to return something useful. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/r3d.c')
-rw-r--r--libavformat/r3d.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/libavformat/r3d.c b/libavformat/r3d.c
index 9c9fa1bbcb..bb39e03e50 100644
--- a/libavformat/r3d.c
+++ b/libavformat/r3d.c
@@ -39,10 +39,10 @@ typedef struct {
static int read_atom(AVFormatContext *s, Atom *atom)
{
atom->offset = url_ftell(s->pb);
- atom->size = get_be32(s->pb);
+ atom->size = avio_rb32(s->pb);
if (atom->size < 8)
return -1;
- atom->tag = get_le32(s->pb);
+ atom->tag = avio_rl32(s->pb);
av_dlog(s, "atom %d %.4s offset %#llx\n",
atom->size, (char*)&atom->tag, atom->offset);
return atom->size;
@@ -59,31 +59,31 @@ static int r3d_read_red1(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_JPEG2000;
- tmp = get_byte(s->pb); // major version
- tmp2 = get_byte(s->pb); // minor version
+ tmp = avio_r8(s->pb); // major version
+ tmp2 = avio_r8(s->pb); // minor version
av_dlog(s, "version %d.%d\n", tmp, tmp2);
- tmp = get_be16(s->pb); // unknown
+ tmp = avio_rb16(s->pb); // unknown
av_dlog(s, "unknown1 %d\n", tmp);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_set_pts_info(st, 32, 1, tmp);
- tmp = get_be32(s->pb); // filenum
+ tmp = avio_rb32(s->pb); // filenum
av_dlog(s, "filenum %d\n", tmp);
url_fskip(s->pb, 32); // unknown
- st->codec->width = get_be32(s->pb);
- st->codec->height = get_be32(s->pb);
+ st->codec->width = avio_rb32(s->pb);
+ st->codec->height = avio_rb32(s->pb);
- tmp = get_be16(s->pb); // unknown
+ tmp = avio_rb16(s->pb); // unknown
av_dlog(s, "unknown2 %d\n", tmp);
- st->codec->time_base.den = get_be16(s->pb);
- st->codec->time_base.num = get_be16(s->pb);
+ st->codec->time_base.den = avio_rb16(s->pb);
+ st->codec->time_base.num = avio_rb16(s->pb);
- tmp = get_byte(s->pb); // audio channels
+ tmp = avio_r8(s->pb); // audio channels
av_dlog(s, "audio channels %d\n", tmp);
if (tmp > 0) {
AVStream *ast = av_new_stream(s, 1);
@@ -95,7 +95,7 @@ static int r3d_read_red1(AVFormatContext *s)
av_set_pts_info(ast, 32, 1, st->time_base.den);
}
- get_buffer(s->pb, filename, 257);
+ avio_read(s->pb, filename, 257);
filename[sizeof(filename)-1] = 0;
av_metadata_set2(&st->metadata, "filename", filename, 0);
@@ -120,7 +120,7 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
return AVERROR(ENOMEM);
for (i = 0; i < r3d->video_offsets_count; i++) {
- r3d->video_offsets[i] = get_be32(s->pb);
+ r3d->video_offsets[i] = avio_rb32(s->pb);
if (!r3d->video_offsets[i]) {
r3d->video_offsets_count = i;
break;
@@ -141,15 +141,15 @@ static void r3d_read_reos(AVFormatContext *s)
R3DContext *r3d = s->priv_data;
int tmp;
- r3d->rdvo_offset = get_be32(s->pb);
- get_be32(s->pb); // rdvs offset
- get_be32(s->pb); // rdao offset
- get_be32(s->pb); // rdas offset
+ r3d->rdvo_offset = avio_rb32(s->pb);
+ avio_rb32(s->pb); // rdvs offset
+ avio_rb32(s->pb); // rdao offset
+ avio_rb32(s->pb); // rdas offset
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "num video chunks %d\n", tmp);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "num audio chunks %d\n", tmp);
url_fskip(s->pb, 6*4);
@@ -214,31 +214,31 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
unsigned dts;
int ret;
- dts = get_be32(s->pb);
+ dts = avio_rb32(s->pb);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "frame num %d\n", tmp);
- tmp = get_byte(s->pb); // major version
- tmp2 = get_byte(s->pb); // minor version
+ tmp = avio_r8(s->pb); // major version
+ tmp2 = avio_r8(s->pb); // minor version
av_dlog(s, "version %d.%d\n", tmp, tmp2);
- tmp = get_be16(s->pb); // unknown
+ tmp = avio_rb16(s->pb); // unknown
av_dlog(s, "unknown %d\n", tmp);
if (tmp > 4) {
- tmp = get_be16(s->pb); // unknown
+ tmp = avio_rb16(s->pb); // unknown
av_dlog(s, "unknown %d\n", tmp);
- tmp = get_be16(s->pb); // unknown
+ tmp = avio_rb16(s->pb); // unknown
av_dlog(s, "unknown %d\n", tmp);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "width %d\n", tmp);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "height %d\n", tmp);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "metadata len %d\n", tmp);
}
tmp = atom->size - 8 - (url_ftell(s->pb) - pos);
@@ -268,23 +268,23 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
unsigned dts;
int ret;
- dts = get_be32(s->pb);
+ dts = avio_rb32(s->pb);
- st->codec->sample_rate = get_be32(s->pb);
+ st->codec->sample_rate = avio_rb32(s->pb);
- samples = get_be32(s->pb);
+ samples = avio_rb32(s->pb);
- tmp = get_be32(s->pb);
+ tmp = avio_rb32(s->pb);
av_dlog(s, "packet num %d\n", tmp);
- tmp = get_be16(s->pb); // unkown
+ tmp = avio_rb16(s->pb); // unkown
av_dlog(s, "unknown %d\n", tmp);
- tmp = get_byte(s->pb); // major version
- tmp2 = get_byte(s->pb); // minor version
+ tmp = avio_r8(s->pb); // major version
+ tmp2 = avio_r8(s->pb); // minor version
av_dlog(s, "version %d.%d\n", tmp, tmp2);
- tmp = get_be32(s->pb); // unknown
+ tmp = avio_rb32(s->pb); // unknown
av_dlog(s, "unknown %d\n", tmp);
size = atom->size - 8 - (url_ftell(s->pb) - pos);