History

Merge remote branch 'qatar/master'

* qatar/master: avio: add more documentation for AVIOContext. Parse sprite data for WMVP and WVP2, and decode sprites for the latter Replace outdated info on the FAQ Redefine sameq pad: fix example explanation gradfun: add notice from the MPlayer manual eval: add support for trunc, ceil, and floor functions documentation: add setdar and setsar description to filters.texi avio: document some members of AVIOContext. avio: document avio_close(). avio: cosmetics, vertically align comments. avio: cosmetics, group the reading functions. avio: cosmetics, merge all the FF_API_OLD_AVIO blocks. avio: cosmetics, move AVIOContext to start of the file. avio: update file header. os: fix OpenBSD/PowerPC compilation pixfmt: add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE oggdec: fix demuxing chained audio streams fix typo Conflicts: doc/filters.texi libavformat/avio.h libavutil/pixfmt.h

Michael Niedermayer committed 15 years ago

Commit ab8cfd42 parents 2e92a34 d1c5fdf10 files · +315 −164Browse files

Unified · Split

10 files
  1. doc/APIchanges +3 −0
  2. libavcodec/vc1.c +0 −3
  3. libavcodec/vc1.h +6 −0
  4. libavcodec/vc1dec.c +124 −3
  5. libavcodec/version.h +1 −1
  6. libavformat/avio.h +162 −157
  7. libavformat/oggdec.c +16 −0
  8. libavformat/oggdec.h +1 −0
  9. libavformat/riff.c +1 −0
  10. libavutil/ppc/cpu.c +1 −0
doc/APIchanges+3−0
@@ -12,6 +12,9 @@ libavutil: 2009-03-08 · 11 unmodified lines
12 12
13API changes, most recent first:13API changes, most recent first:
14 14
152011-04-10 - lavu 50.40.0 - pixfmt.h
16 Add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
17
152011-04-08 - lavf 52.106.0 - avformat.h182011-04-08 - lavf 52.106.0 - avformat.h
16 Minor avformat.h cleanup:19 Minor avformat.h cleanup:
17 a9bf9d8 deprecate av_guess_image2_codec20 a9bf9d8 deprecate av_guess_image2_codec
libavcodec/vc1.c+0−3
@@ -605,9 +605,6 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 604 unmodified lines
605{605{
606 int pqindex, lowquant, status;606 int pqindex, lowquant, status;
607 607
608 if(v->res_sprite) {
609 skip_bits(gb, 2); //not yet deciphered
610 }
611 if(v->finterpflag) v->interpfrm = get_bits1(gb);608 if(v->finterpflag) v->interpfrm = get_bits1(gb);
612 skip_bits(gb, 2); //framecnt unused609 skip_bits(gb, 2); //framecnt unused
613 v->rangeredfrm = 0;610 v->rangeredfrm = 0;
libavcodec/vc1.h+6−0
@@ -306,6 +306,12 @@ typedef struct VC1Context{ · 305 unmodified lines
306 uint8_t range_mapuv;306 uint8_t range_mapuv;
307 //@}307 //@}
308 308
309 /** Frame decoding info for sprite modes */
310 //@{
311 int new_sprite;
312 int two_sprites;
313 //@}
314
309 int p_frame_skipped;315 int p_frame_skipped;
310 int bi_type;316 int bi_type;
311 int x8_type;317 int x8_type;
libavcodec/vc1dec.c+124−3
@@ -3097,6 +3097,116 @@ static void vc1_decode_blocks(VC1Context *v, int mby_start, int mby_end) · 3096 unmodified lines
3097 }3097 }
3098}3098}
3099 3099
3100static inline float get_float_val(GetBitContext* gb)
3101{
3102 return (float)get_bits_long(gb, 30) / (1<<15) - (1<<14);
3103}
3104
3105static void vc1_sprite_parse_transform(VC1Context *v, GetBitContext* gb, float c[7])
3106{
3107 c[1] = c[3] = 0.0f;
3108
3109 switch (get_bits(gb, 2)) {
3110 case 0:
3111 c[0] = 1.0f;
3112 c[2] = get_float_val(gb);
3113 c[4] = 1.0f;
3114 break;
3115 case 1:
3116 c[0] = c[4] = get_float_val(gb);
3117 c[2] = get_float_val(gb);
3118 break;
3119 case 2:
3120 c[0] = get_float_val(gb);
3121 c[2] = get_float_val(gb);
3122 c[4] = get_float_val(gb);
3123 break;
3124 case 3:
3125 av_log_ask_for_sample(v->s.avctx, NULL);
3126 c[0] = get_float_val(gb);
3127 c[1] = get_float_val(gb);
3128 c[2] = get_float_val(gb);
3129 c[3] = get_float_val(gb);
3130 c[4] = get_float_val(gb);
3131 break;
3132 }
3133 c[5] = get_float_val(gb);
3134 if (get_bits1(gb))
3135 c[6] = get_float_val(gb);
3136 else
3137 c[6] = 1.0f;
3138}
3139
3140static void vc1_parse_sprites(VC1Context *v, GetBitContext* gb)
3141{
3142 int effect_type, effect_flag, effect_pcount1, effect_pcount2, i;
3143 float effect_params1[14], effect_params2[10];
3144
3145 float coefs[2][7];
3146 vc1_sprite_parse_transform(v, gb, coefs[0]);
3147 av_log(v->s.avctx, AV_LOG_DEBUG, "S1:");
3148 for (i = 0; i < 7; i++)
3149 av_log(v->s.avctx, AV_LOG_DEBUG, " %.3f", coefs[0][i]);
3150 av_log(v->s.avctx, AV_LOG_DEBUG, "\n");
3151
3152 if (v->two_sprites) {
3153 vc1_sprite_parse_transform(v, gb, coefs[1]);
3154 av_log(v->s.avctx, AV_LOG_DEBUG, "S2:");
3155 for (i = 0; i < 7; i++)
3156 av_log(v->s.avctx, AV_LOG_DEBUG, " %.3f", coefs[1][i]);
3157 av_log(v->s.avctx, AV_LOG_DEBUG, "\n");
3158 }
3159 skip_bits(gb, 2);
3160 if (effect_type = get_bits_long(gb, 30)){
3161 switch (effect_pcount1 = get_bits(gb, 4)) {
3162 case 2:
3163 effect_params1[0] = get_float_val(gb);
3164 effect_params1[1] = get_float_val(gb);
3165 break;
3166 case 7:
3167 vc1_sprite_parse_transform(v, gb, effect_params1);
3168 break;
3169 case 14:
3170 vc1_sprite_parse_transform(v, gb, effect_params1);
3171 vc1_sprite_parse_transform(v, gb, &effect_params1[7]);
3172 break;
3173 default:
3174 av_log_ask_for_sample(v->s.avctx, NULL);
3175 return;
3176 }
3177 if (effect_type != 13 || effect_params1[0] != coefs[0][6]) {
3178 // effect 13 is simple alpha blending and matches the opacity above
3179 av_log(v->s.avctx, AV_LOG_DEBUG, "Effect: %d; params: ", effect_type);
3180 for (i = 0; i < effect_pcount1; i++)
3181 av_log(v->s.avctx, AV_LOG_DEBUG, " %.3f", effect_params1[i]);
3182 av_log(v->s.avctx, AV_LOG_DEBUG, "\n");
3183 }
3184
3185 effect_pcount2 = get_bits(gb, 16);
3186 if (effect_pcount2 > 10) {
3187 av_log(v->s.avctx, AV_LOG_ERROR, "Too many effect parameters\n");
3188 return;
3189 } else if (effect_pcount2) {
3190 i = 0;
3191 av_log(v->s.avctx, AV_LOG_DEBUG, "Effect params 2: ");
3192 while (i < effect_pcount2){
3193 effect_params2[i] = get_float_val(gb);
3194 av_log(v->s.avctx, AV_LOG_DEBUG, " %.3f", effect_params2[i]);
3195 i++;
3196 }
3197 av_log(v->s.avctx, AV_LOG_DEBUG, "\n");
3198 }
3199 }
3200 if (effect_flag = get_bits1(gb))
3201 av_log(v->s.avctx, AV_LOG_DEBUG, "Effect flag set\n");
3202
3203 if (get_bits_count(gb) >= gb->size_in_bits +
3204 (v->s.avctx->codec_id == CODEC_ID_WMV3 ? 64 : 0))
3205 av_log(v->s.avctx, AV_LOG_ERROR, "Buffer overrun\n");
3206 if (get_bits_count(gb) < gb->size_in_bits - 8)
3207 av_log(v->s.avctx, AV_LOG_WARNING, "Buffer not fully read\n");
3208}
3209
3100/** Initialize a VC1/WMV3 decoder3210/** Initialize a VC1/WMV3 decoder
3101 * @todo TODO: Handle VC-1 IDUs (Transport level?)3211 * @todo TODO: Handle VC-1 IDUs (Transport level?)
3102 * @todo TODO: Decypher remaining bits in extra_data3212 * @todo TODO: Decypher remaining bits in extra_data
@@ -3160,7 +3270,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 57 unmodified lines
3160 {3270 {
3161 av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);3271 av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
3162 }3272 }
3163 } else { // VC1/WVC13273 } else { // VC1/WVC1/WVP2
3164 const uint8_t *start = avctx->extradata;3274 const uint8_t *start = avctx->extradata;
3165 uint8_t *end = avctx->extradata + avctx->extradata_size;3275 uint8_t *end = avctx->extradata + avctx->extradata_size;
3166 const uint8_t *next;3276 const uint8_t *next;
@@ -3204,6 +3314,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 37 unmodified lines
3204 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");3314 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
3205 return -1;3315 return -1;
3206 }3316 }
3317 v->res_sprite = (avctx->codec_tag == MKTAG('W','V','P','2'));
3207 }3318 }
3208 avctx->profile = v->profile;3319 avctx->profile = v->profile;
3209 if (v->profile == PROFILE_ADVANCED)3320 if (v->profile == PROFILE_ADVANCED)
@@ -3359,6 +3470,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 149 unmodified lines
3359 init_get_bits(&s->gb, buf2, buf_size2*8);3470 init_get_bits(&s->gb, buf2, buf_size2*8);
3360 } else3471 } else
3361 init_get_bits(&s->gb, buf, buf_size*8);3472 init_get_bits(&s->gb, buf, buf_size*8);
3473
3474 if (v->res_sprite) {
3475 v->new_sprite = !get_bits1(&s->gb);
3476 v->two_sprites = get_bits1(&s->gb);
3477 if (!v->new_sprite)
3478 goto end;
3479 }
3480
3362 // do parse frame header3481 // do parse frame header
3363 if(v->profile < PROFILE_ADVANCED) {3482 if(v->profile < PROFILE_ADVANCED) {
3364 if(vc1_parse_frame_header(v, &s->gb) == -1) {3483 if(vc1_parse_frame_header(v, &s->gb) == -1) {
@@ -3370,8 +3489,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 5 unmodified lines
3370 }3489 }
3371 }3490 }
3372 3491
3373 if(v->res_sprite && (s->pict_type!=FF_I_TYPE)){3492 if (v->res_sprite && s->pict_type!=FF_I_TYPE) {
3374 goto err;3493 av_log(v->s.avctx, AV_LOG_WARNING, "Sprite decoder: expected I-frame\n");
3375 }3494 }
3376 3495
3377 s->current_picture_ptr->repeat_pict = 0;3496 s->current_picture_ptr->repeat_pict = 0;
@@ -3464,6 +3583,8 @@ assert(s->current_picture.pict_type == s->pict_type); · 86 unmodified lines
3464 }3583 }
3465 3584
3466end:3585end:
3586 if (v->res_sprite)
3587 vc1_parse_sprites(v, &s->gb);
3467 av_free(buf2);3588 av_free(buf2);
3468 for (i = 0; i < n_slices; i++)3589 for (i = 0; i < n_slices; i++)
3469 av_free(slices[i].buf);3590 av_free(slices[i].buf);
libavcodec/version.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
22 22
23#define LIBAVCODEC_VERSION_MAJOR 5223#define LIBAVCODEC_VERSION_MAJOR 52
24#define LIBAVCODEC_VERSION_MINOR 11724#define LIBAVCODEC_VERSION_MINOR 117
25#define LIBAVCODEC_VERSION_MICRO 025#define LIBAVCODEC_VERSION_MICRO 1
26 26
27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
28 LIBAVCODEC_VERSION_MINOR, \28 LIBAVCODEC_VERSION_MINOR, \
libavformat/avio.h+162−157
@@ -22,10 +22,7 @@ · 21 unmodified lines
22 22
23/**23/**
24 * @file24 * @file
25 * unbuffered I/O operations25 * Buffered I/O operations
26 *
27 * @warning This file has to be considered an internal but installed
28 * header, so it should not be directly included in your projects.
29 */26 */
30 27
31#include <stdint.h>28#include <stdint.h>
@@ -35,6 +32,63 @@ · 3 unmodified lines
35 32
36#include "libavformat/version.h"33#include "libavformat/version.h"
37 34
35
36#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
37
38/**
39 * Bytestream IO Context.
40 * New fields can be added to the end with minor version bumps.
41 * Removal, reordering and changes to existing fields require a major
42 * version bump.
43 * sizeof(AVIOContext) must not be used outside libav*.
44 *
45 * @note None of the function pointers in AVIOContext should be called
46 * directly, they should only be set by the client application
47 * when implementing custom I/O. Normally these are set to the
48 * function pointers specified in avio_alloc_context()
49 */
50typedef struct {
51 unsigned char *buffer; /**< Start of the buffer. */
52 int buffer_size; /**< Maximum buffer size */
53 unsigned char *buf_ptr; /**< Current position in the buffer */
54 unsigned char *buf_end; /**< End of the data, may be less than
55 buffer+buffer_size if the read function returned
56 less data than requested, e.g. for streams where
57 no more data has been received yet. */
58 void *opaque; /**< A private pointer, passed to the read/write/seek/...
59 functions. */
60 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
61 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
62 int64_t (*seek)(void *opaque, int64_t offset, int whence);
63 int64_t pos; /**< position in the file of the current buffer */
64 int must_flush; /**< true if the next seek should flush */
65 int eof_reached; /**< true if eof reached */
66 int write_flag; /**< true if open for writing */
67#if FF_API_OLD_AVIO
68 attribute_deprecated int is_streamed;
69#endif
70 int max_packet_size;
71 unsigned long checksum;
72 unsigned char *checksum_ptr;
73 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
74 int error; /**< contains the error code or 0 if no error happened */
75 /**
76 * Pause or resume playback for network streaming protocols - e.g. MMS.
77 */
78 int (*read_pause)(void *opaque, int pause);
79 /**
80 * Seek to a given timestamp in stream with the specified stream_index.
81 * Needed for some network streaming protocols which don't support seeking
82 * to byte position.
83 */
84 int64_t (*read_seek)(void *opaque, int stream_index,
85 int64_t timestamp, int flags);
86 /**
87 * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
88 */
89 int seekable;
90} AVIOContext;
91
38/* unbuffered I/O */92/* unbuffered I/O */
39 93
40#if FF_API_OLD_AVIO94#if FF_API_OLD_AVIO
@@ -59,12 +113,38 @@ typedef struct URLContext { · 18 unmodified lines
59 int is_connected;113 int is_connected;
60} URLContext;114} URLContext;
61 115
116#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
117
118/**
119 * @deprecated This struct is to be made private. Use the higher-level
120 * AVIOContext-based API instead.
121 */
122typedef struct URLProtocol {
123 const char *name;
124 int (*url_open)(URLContext *h, const char *url, int flags);
125 int (*url_read)(URLContext *h, unsigned char *buf, int size);
126 int (*url_write)(URLContext *h, const unsigned char *buf, int size);
127 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
128 int (*url_close)(URLContext *h);
129 struct URLProtocol *next;
130 int (*url_read_pause)(URLContext *h, int pause);
131 int64_t (*url_read_seek)(URLContext *h, int stream_index,
132 int64_t timestamp, int flags);
133 int (*url_get_file_handle)(URLContext *h);
134 int priv_data_size;
135 const AVClass *priv_data_class;
136 int flags;
137} URLProtocol;
138
62typedef struct URLPollEntry {139typedef struct URLPollEntry {
63 URLContext *handle;140 URLContext *handle;
64 int events;141 int events;
65 int revents;142 int revents;
66} URLPollEntry;143} URLPollEntry;
67 144
145/* not implemented */
146attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
147
68/**148/**
69 * @defgroup open_modes URL open modes149 * @defgroup open_modes URL open modes
70 * The flags argument to url_open and cosins must be one of the following150 * The flags argument to url_open and cosins must be one of the following
@@ -93,6 +173,7 @@ typedef struct URLPollEntry { · 22 unmodified lines
93#define URL_FLAG_NONBLOCK 4173#define URL_FLAG_NONBLOCK 4
94 174
95typedef int URLInterruptCB(void);175typedef int URLInterruptCB(void);
176extern URLInterruptCB *url_interrupt_cb;
96 177
97/**178/**
98 * @defgroup old_url_funcs Old url_* functions179 * @defgroup old_url_funcs Old url_* functions
@@ -117,130 +198,24 @@ attribute_deprecated int av_url_read_pause(URLContext *h, int pause); · 18 unmodified lines
117attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,198attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
118 int64_t timestamp, int flags);199 int64_t timestamp, int flags);
119attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));200attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
120#endif
121 201
122/**202/**
123 * Return a non-zero value if the resource indicated by url203 * returns the next registered protocol after the given protocol (the first if
124 * exists, 0 otherwise.204 * NULL is given), or NULL if protocol is the last one.
125 */
126int url_exist(const char *url);
127
128/**
129 * The callback is called in blocking functions to test regulary if
130 * asynchronous interruption is needed. AVERROR_EXIT is returned
131 * in this case by the interrupted function. 'NULL' means no interrupt
132 * callback is given.
133 */
134void avio_set_interrupt_cb(int (*interrupt_cb)(void));
135
136#if FF_API_OLD_AVIO
137/* not implemented */
138attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
139
140
141#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
142
143/**
144 * @deprecated This struct is to be made private. Use the higher-level
145 * AVIOContext-based API instead.
146 */
147typedef struct URLProtocol {
148 const char *name;
149 int (*url_open)(URLContext *h, const char *url, int flags);
150 int (*url_read)(URLContext *h, unsigned char *buf, int size);
151 int (*url_write)(URLContext *h, const unsigned char *buf, int size);
152 int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
153 int (*url_close)(URLContext *h);
154 struct URLProtocol *next;
155 int (*url_read_pause)(URLContext *h, int pause);
156 int64_t (*url_read_seek)(URLContext *h, int stream_index,
157 int64_t timestamp, int flags);
158 int (*url_get_file_handle)(URLContext *h);
159 int priv_data_size;
160 const AVClass *priv_data_class;
161 int flags;
162} URLProtocol;
163#endif
164
165#if FF_API_REGISTER_PROTOCOL
166extern URLProtocol *first_protocol;
167#endif
168
169#if FF_API_OLD_AVIO
170extern URLInterruptCB *url_interrupt_cb;
171#endif
172
173/**
174 * If protocol is NULL, returns the first registered protocol,
175 * if protocol is non-NULL, returns the next registered protocol after protocol,
176 * or NULL if protocol is the last one.
177 */205 */
178URLProtocol *av_protocol_next(URLProtocol *p);206URLProtocol *av_protocol_next(URLProtocol *p);
179 207
180#if FF_API_REGISTER_PROTOCOL
181/**
182 * @deprecated Use av_register_protocol() instead.
183 */
184attribute_deprecated int register_protocol(URLProtocol *protocol);
185
186/**
187 * @deprecated Use av_register_protocol2() instead.
188 */
189attribute_deprecated int av_register_protocol(URLProtocol *protocol);
190#endif
191
192#if FF_API_OLD_AVIO
193/**208/**
194 * Register the URLProtocol protocol.209 * Register the URLProtocol protocol.
195 *210 *
196 * @param size the size of the URLProtocol struct referenced211 * @param size the size of the URLProtocol struct referenced
197 */212 */
198attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size);213attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size);
199#endif
200
201#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
202
203/**214/**
204 * @}215 * @}
205 */216 */
206 217
207/**
208 * Bytestream IO Context.
209 * New fields can be added to the end with minor version bumps.
210 * Removal, reordering and changes to existing fields require a major
211 * version bump.
212 * sizeof(AVIOContext) must not be used outside libav*.
213 */
214typedef struct {
215 unsigned char *buffer;
216 int buffer_size;
217 unsigned char *buf_ptr, *buf_end;
218 void *opaque;
219 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
220 int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
221 int64_t (*seek)(void *opaque, int64_t offset, int whence);
222 int64_t pos; /**< position in the file of the current buffer */
223 int must_flush; /**< true if the next seek should flush */
224 int eof_reached; /**< true if eof reached */
225 int write_flag; /**< true if open for writing */
226#if FF_API_OLD_AVIO
227 attribute_deprecated int is_streamed;
228#endif
229 int max_packet_size;
230 unsigned long checksum;
231 unsigned char *checksum_ptr;
232 unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
233 int error; ///< contains the error code or 0 if no error happened
234 int (*read_pause)(void *opaque, int pause);
235 int64_t (*read_seek)(void *opaque, int stream_index,
236 int64_t timestamp, int flags);
237 /**
238 * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
239 */
240 int seekable;
241} AVIOContext;
242 218
243#if FF_API_OLD_AVIO
244typedef attribute_deprecated AVIOContext ByteIOContext;219typedef attribute_deprecated AVIOContext ByteIOContext;
245 220
246attribute_deprecated int init_put_byte(AVIOContext *s,221attribute_deprecated int init_put_byte(AVIOContext *s,
@@ -334,6 +309,62 @@ attribute_deprecated void init_checksum(AVIOContext *s, · 87 unmodified lines
334 unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),309 unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
335 unsigned long checksum);310 unsigned long checksum);
336attribute_deprecated unsigned long get_checksum(AVIOContext *s);311attribute_deprecated unsigned long get_checksum(AVIOContext *s);
312attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
313/** @note unlike fgets, the EOL character is not returned and a whole
314 line is parsed. return NULL if first char read was EOF */
315attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
316/**
317 * @deprecated use avio_get_str instead
318 */
319attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
320/**
321 * @deprecated Use AVIOContext.seekable field directly.
322 */
323attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
324{
325 return !s->seekable;
326}
327attribute_deprecated URLContext *url_fileno(AVIOContext *s);
328
329/**
330 * @deprecated use AVIOContext.max_packet_size directly.
331 */
332attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
333
334attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
335
336/** return the written or read size */
337attribute_deprecated int url_close_buf(AVIOContext *s);
338#endif // FF_API_OLD_AVIO
339
340/**
341 * Return a non-zero value if the resource indicated by url
342 * exists, 0 otherwise.
343 */
344int url_exist(const char *url);
345
346/**
347 * The callback is called in blocking functions to test regulary if
348 * asynchronous interruption is needed. AVERROR_EXIT is returned
349 * in this case by the interrupted function. 'NULL' means no interrupt
350 * callback is given.
351 */
352void avio_set_interrupt_cb(int (*interrupt_cb)(void));
353
354#if FF_API_REGISTER_PROTOCOL
355extern URLProtocol *first_protocol;
356#endif
357
358#if FF_API_REGISTER_PROTOCOL
359/**
360 * @deprecated Use av_register_protocol() instead.
361 */
362attribute_deprecated int register_protocol(URLProtocol *protocol);
363
364/**
365 * @deprecated Use av_register_protocol2() instead.
366 */
367attribute_deprecated int av_register_protocol(URLProtocol *protocol);
337#endif368#endif
338 369
339/**370/**
@@ -372,10 +403,6 @@ void avio_wb24(AVIOContext *s, unsigned int val); · 32 unmodified lines
372void avio_wl16(AVIOContext *s, unsigned int val);403void avio_wl16(AVIOContext *s, unsigned int val);
373void avio_wb16(AVIOContext *s, unsigned int val);404void avio_wb16(AVIOContext *s, unsigned int val);
374 405
375#if FF_API_OLD_AVIO
376attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
377#endif
378
379/**406/**
380 * Write a NULL-terminated string.407 * Write a NULL-terminated string.
381 * @return number of bytes written.408 * @return number of bytes written.
@@ -443,12 +470,6 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ · 61 unmodified lines
443int avio_printf(AVIOContext *s, const char *fmt, ...);470int avio_printf(AVIOContext *s, const char *fmt, ...);
444#endif471#endif
445 472
446#if FF_API_OLD_AVIO
447/** @note unlike fgets, the EOL character is not returned and a whole
448 line is parsed. return NULL if first char read was EOF */
449attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
450#endif
451
452void avio_flush(AVIOContext *s);473void avio_flush(AVIOContext *s);
453 474
454 475
@@ -458,13 +479,25 @@ void avio_flush(AVIOContext *s); · 3 unmodified lines
458 */479 */
459int avio_read(AVIOContext *s, unsigned char *buf, int size);480int avio_read(AVIOContext *s, unsigned char *buf, int size);
460 481
461/** @note return 0 if EOF, so you cannot use it if EOF handling is482/**
462 necessary */483 * @defgroup avio_read Functions for reading from AVIOContext.
484 * @{
485 *
486 * @note return 0 if EOF, so you cannot use it if EOF handling is
487 * necessary
488 */
463int avio_r8 (AVIOContext *s);489int avio_r8 (AVIOContext *s);
464unsigned int avio_rl16(AVIOContext *s);490unsigned int avio_rl16(AVIOContext *s);
465unsigned int avio_rl24(AVIOContext *s);491unsigned int avio_rl24(AVIOContext *s);
466unsigned int avio_rl32(AVIOContext *s);492unsigned int avio_rl32(AVIOContext *s);
467uint64_t avio_rl64(AVIOContext *s);493uint64_t avio_rl64(AVIOContext *s);
494unsigned int avio_rb16(AVIOContext *s);
495unsigned int avio_rb24(AVIOContext *s);
496unsigned int avio_rb32(AVIOContext *s);
497uint64_t avio_rb64(AVIOContext *s);
498/**
499 * @}
500 */
468 501
469/**502/**
470 * Read a string from pb into buf. The reading will terminate when either503 * Read a string from pb into buf. The reading will terminate when either
@@ -489,26 +522,6 @@ int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen); · 18 unmodified lines
489int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);522int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
490int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);523int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
491 524
492#if FF_API_OLD_AVIO
493/**
494 * @deprecated use avio_get_str instead
495 */
496attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
497#endif
498unsigned int avio_rb16(AVIOContext *s);
499unsigned int avio_rb24(AVIOContext *s);
500unsigned int avio_rb32(AVIOContext *s);
501uint64_t avio_rb64(AVIOContext *s);
502
503#if FF_API_OLD_AVIO
504/**
505 * @deprecated Use AVIOContext.seekable field directly.
506 */
507attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
508{
509 return !s->seekable;
510}
511#endif
512 525
513#if FF_API_URL_RESETBUF526#if FF_API_URL_RESETBUF
514/** Reset the buffer for reading or writing.527/** Reset the buffer for reading or writing.
@@ -560,21 +573,13 @@ int url_resetbuf(AVIOContext *s, int flags); · 45 unmodified lines
560 */573 */
561int avio_open(AVIOContext **s, const char *url, int flags);574int avio_open(AVIOContext **s, const char *url, int flags);
562 575
563int avio_close(AVIOContext *s);
564
565#if FF_API_OLD_AVIO
566attribute_deprecated URLContext *url_fileno(AVIOContext *s);
567
568/**576/**
569 * @deprecated use AVIOContext.max_packet_size directly.577 * Close the resource accessed by the AVIOContext s and free it.
578 * This function can only be used if s was opened by avio_open().
579 *
580 * @return 0 on success, an AVERROR < 0 on error.
570 */581 */
571attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);582int avio_close(AVIOContext *s);
572
573attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
574
575/** return the written or read size */
576attribute_deprecated int url_close_buf(AVIOContext *s);
577#endif
578 583
579/**584/**
580 * Open a write only memory stream.585 * Open a write only memory stream.
libavformat/oggdec.c+16−0
@@ -164,6 +164,7 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) · 163 unmodified lines
164 os->bufsize = DECODER_BUFFER_SIZE;164 os->bufsize = DECODER_BUFFER_SIZE;
165 os->buf = av_malloc(os->bufsize);165 os->buf = av_malloc(os->bufsize);
166 os->header = -1;166 os->header = -1;
167 os->page_begin = 1;
167 168
168 st = av_new_stream (s, idx);169 st = av_new_stream (s, idx);
169 if (!st)170 if (!st)
@@ -241,12 +242,27 @@ ogg_read_page (AVFormatContext * s, int *str) · 71 unmodified lines
241 242
242 idx = ogg_find_stream (ogg, serial);243 idx = ogg_find_stream (ogg, serial);
243 if (idx < 0){244 if (idx < 0){
245 for (i = 0; i < ogg->nstreams; i++) {
246 if (!ogg->streams[i].page_begin) {
247 int n;
248
249 for (n = 0; n < ogg->nstreams; n++) {
250 av_free(ogg->streams[n].buf);
251 av_free(ogg->streams[n].private);
252 }
253 ogg->curidx = -1;
254 ogg->nstreams = 0;
255 break;
256 }
257 }
244 idx = ogg_new_stream (s, serial);258 idx = ogg_new_stream (s, serial);
245 if (idx < 0)259 if (idx < 0)
246 return -1;260 return -1;
247 }261 }
248 262
249 os = ogg->streams + idx;263 os = ogg->streams + idx;
264 if (!(flags & OGG_FLAG_BOS))
265 os->page_begin = 0;
250 os->page_pos = avio_tell(bc) - 27;266 os->page_pos = avio_tell(bc) - 27;
251 267
252 if(os->psize > 0)268 if(os->psize > 0)
libavformat/oggdec.h+1−0
@@ -75,6 +75,7 @@ struct ogg_stream { · 74 unmodified lines
75 int incomplete; ///< whether we're expecting a continuation in the next page75 int incomplete; ///< whether we're expecting a continuation in the next page
76 int page_end; ///< current packet is the last one completed in the page76 int page_end; ///< current packet is the last one completed in the page
77 int keyframe_seek;77 int keyframe_seek;
78 int page_begin; ///< set to 1 if the stream only received a begin-of-stream packet, otherwise 0
78 void *private;79 void *private;
79};80};
80 81
libavformat/riff.c+1−0
@@ -232,6 +232,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { · 231 unmodified lines
232 { CODEC_ID_WMV3, MKTAG('W', 'M', 'V', 'P') },232 { CODEC_ID_WMV3, MKTAG('W', 'M', 'V', 'P') },
233 { CODEC_ID_VC1, MKTAG('W', 'V', 'C', '1') },233 { CODEC_ID_VC1, MKTAG('W', 'V', 'C', '1') },
234 { CODEC_ID_VC1, MKTAG('W', 'M', 'V', 'A') },234 { CODEC_ID_VC1, MKTAG('W', 'M', 'V', 'A') },
235 { CODEC_ID_VC1, MKTAG('W', 'V', 'P', '2') },
235 { CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },236 { CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },
236 { CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },237 { CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },
237 { CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },238 { CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },
libavutil/ppc/cpu.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
20#undef _POSIX_C_SOURCE20#undef _POSIX_C_SOURCE
21#include <sys/sysctl.h>21#include <sys/sysctl.h>
22#elif defined(__OpenBSD__)22#elif defined(__OpenBSD__)
23#undef _POSIX_C_SOURCE
23#include <sys/param.h>24#include <sys/param.h>
24#include <sys/sysctl.h>25#include <sys/sysctl.h>
25#include <machine/cpu.h>26#include <machine/cpu.h>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t