diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-02-21 18:43:01 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-02-21 19:23:22 +0300 |
commit | b7effd4e8338f6ed5bda630ad7ed0809bf458648 (patch) | |
tree | 53c878f6dd48c313a9bcde1855c2b4e009822c9e /libavformat/nuv.c | |
parent | f8bed30d8b176fa030f6737765338bb4a2bcabc9 (diff) |
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/nuv.c')
-rw-r--r-- | libavformat/nuv.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 055a6dce60..e360a64cfb 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -62,16 +62,16 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, return 1; // no codec data needed while (!url_feof(pb)) { int size, subtype; - frametype = get_byte(pb); + frametype = avio_r8(pb); switch (frametype) { case NUV_EXTRADATA: - subtype = get_byte(pb); + subtype = avio_r8(pb); url_fskip(pb, 6); - size = PKTSIZE(get_le32(pb)); + size = PKTSIZE(avio_rl32(pb)); if (vst && subtype == 'R') { vst->codec->extradata_size = size; vst->codec->extradata = av_malloc(size); - get_buffer(pb, vst->codec->extradata, size); + avio_read(pb, vst->codec->extradata, size); size = 0; if (!myth) return 1; @@ -79,12 +79,12 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, break; case NUV_MYTHEXT: url_fskip(pb, 7); - size = PKTSIZE(get_le32(pb)); + size = PKTSIZE(avio_rl32(pb)); if (size != 128 * 4) break; - get_le32(pb); // version + avio_rl32(pb); // version if (vst) { - vst->codec->codec_tag = get_le32(pb); + vst->codec->codec_tag = avio_rl32(pb); vst->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, vst->codec->codec_tag); if (vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G')) @@ -93,10 +93,10 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, url_fskip(pb, 4); if (ast) { - ast->codec->codec_tag = get_le32(pb); - ast->codec->sample_rate = get_le32(pb); - ast->codec->bits_per_coded_sample = get_le32(pb); - ast->codec->channels = get_le32(pb); + ast->codec->codec_tag = avio_rl32(pb); + ast->codec->sample_rate = avio_rl32(pb); + ast->codec->bits_per_coded_sample = avio_rl32(pb); + ast->codec->channels = avio_rl32(pb); ast->codec->codec_id = ff_wav_codec_get_id(ast->codec->codec_tag, ast->codec->bits_per_coded_sample); @@ -112,7 +112,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, break; default: url_fskip(pb, 7); - size = PKTSIZE(get_le32(pb)); + size = PKTSIZE(avio_rl32(pb)); break; } url_fskip(pb, size); @@ -128,27 +128,27 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { int is_mythtv, width, height, v_packs, a_packs; int stream_nr = 0; AVStream *vst = NULL, *ast = NULL; - get_buffer(pb, id_string, 12); + avio_read(pb, id_string, 12); is_mythtv = !memcmp(id_string, "MythTVVideo", 12); url_fskip(pb, 5); // version string url_fskip(pb, 3); // padding - width = get_le32(pb); - height = get_le32(pb); - get_le32(pb); // unused, "desiredwidth" - get_le32(pb); // unused, "desiredheight" - get_byte(pb); // 'P' == progressive, 'I' == interlaced + width = avio_rl32(pb); + height = avio_rl32(pb); + avio_rl32(pb); // unused, "desiredwidth" + avio_rl32(pb); // unused, "desiredheight" + avio_r8(pb); // 'P' == progressive, 'I' == interlaced url_fskip(pb, 3); // padding - aspect = av_int2dbl(get_le64(pb)); + aspect = av_int2dbl(avio_rl64(pb)); if (aspect > 0.9999 && aspect < 1.0001) aspect = 4.0 / 3.0; - fps = av_int2dbl(get_le64(pb)); + fps = av_int2dbl(avio_rl64(pb)); // number of packets per stream type, -1 means unknown, e.g. streaming - v_packs = get_le32(pb); - a_packs = get_le32(pb); - get_le32(pb); // text + v_packs = avio_rl32(pb); + a_packs = avio_rl32(pb); + avio_rl32(pb); // text - get_le32(pb); // keyframe distance (?) + avio_rl32(pb); // keyframe distance (?) if (v_packs) { ctx->v_id = stream_nr++; @@ -198,7 +198,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { while (!url_feof(pb)) { int copyhdrsize = ctx->rtjpg_video ? HDRSIZE : 0; uint64_t pos = url_ftell(pb); - ret = get_buffer(pb, hdr, HDRSIZE); + ret = avio_read(pb, hdr, HDRSIZE); if (ret < HDRSIZE) return ret < 0 ? ret : AVERROR(EIO); frametype = hdr[0]; @@ -225,7 +225,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) { pkt->pts = AV_RL32(&hdr[4]); pkt->stream_index = ctx->v_id; memcpy(pkt->data, hdr, copyhdrsize); - ret = get_buffer(pb, pkt->data + copyhdrsize, size); + ret = avio_read(pb, pkt->data + copyhdrsize, size); if (ret < 0) { av_free_packet(pkt); return ret; |