Mercurial > libavcodec.hg
comparison bytestream.h @ 6218:dfdff1ca78a7 libavcodec
consts
I have underestimated this a little, and these are just some ...
author | michael |
---|---|
date | Fri, 01 Feb 2008 03:26:31 +0000 |
parents | 9975783f1cb2 |
children | f7cbb7733146 |
comparison
equal
deleted
inserted
replaced
6217:f838213ca91b | 6218:dfdff1ca78a7 |
---|---|
23 #define FFMPEG_BYTESTREAM_H | 23 #define FFMPEG_BYTESTREAM_H |
24 | 24 |
25 #include "common.h" | 25 #include "common.h" |
26 | 26 |
27 #define DEF_T(type, name, bytes, read, write) \ | 27 #define DEF_T(type, name, bytes, read, write) \ |
28 static av_always_inline type bytestream_get_ ## name(uint8_t **b){\ | 28 static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\ |
29 (*b) += bytes;\ | 29 (*b) += bytes;\ |
30 return read(*b - bytes);\ | 30 return read(*b - bytes);\ |
31 }\ | 31 }\ |
32 static av_always_inline void bytestream_put_ ##name(uint8_t **b, const type value){\ | 32 static av_always_inline void bytestream_put_ ##name(uint8_t **b, const type value){\ |
33 write(*b, value);\ | 33 write(*b, value);\ |
51 | 51 |
52 #undef DEF | 52 #undef DEF |
53 #undef DEF64 | 53 #undef DEF64 |
54 #undef DEF_T | 54 #undef DEF_T |
55 | 55 |
56 static av_always_inline unsigned int bytestream_get_buffer(uint8_t **b, uint8_t *dst, unsigned int size) | 56 static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size) |
57 { | 57 { |
58 memcpy(dst, *b, size); | 58 memcpy(dst, *b, size); |
59 (*b) += size; | 59 (*b) += size; |
60 return size; | 60 return size; |
61 } | 61 } |