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
1212
1313 API changes, most recent first:
1414
15+2011-04-10 - lavu 50.40.0 - pixfmt.h
16+ Add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats
17+
1518 2011-04-08 - lavf 52.106.0 - avformat.h
1619 Minor avformat.h cleanup:
1720 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
605605 {
606606 int pqindex, lowquant, status;
607607
608− if(v->res_sprite) {
609− skip_bits(gb, 2); //not yet deciphered
610− }
611608 if(v->finterpflag) v->interpfrm = get_bits1(gb);
612609 skip_bits(gb, 2); //framecnt unused
613610 v->rangeredfrm = 0;
libavcodec/vc1.h+6−0
@@ -306,6 +306,12 @@ typedef struct VC1Context{ · 305 unmodified lines
306306 uint8_t range_mapuv;
307307 //@}
308308
309+ /** Frame decoding info for sprite modes */
310+ //@{
311+ int new_sprite;
312+ int two_sprites;
313+ //@}
314+
309315 int p_frame_skipped;
310316 int bi_type;
311317 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
30973097 }
30983098 }
30993099
3100+static inline float get_float_val(GetBitContext* gb)
3101+{
3102+ return (float)get_bits_long(gb, 30) / (1<<15) - (1<<14);
3103+}
3104+
3105+static 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+
3140+static 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+
31003210 /** Initialize a VC1/WMV3 decoder
31013211 * @todo TODO: Handle VC-1 IDUs (Transport level?)
31023212 * @todo TODO: Decypher remaining bits in extra_data
@@ -3160,7 +3270,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 57 unmodified lines
31603270 {
31613271 av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count);
31623272 }
3163− } else { // VC1/WVC1
3273+ } else { // VC1/WVC1/WVP2
31643274 const uint8_t *start = avctx->extradata;
31653275 uint8_t *end = avctx->extradata + avctx->extradata_size;
31663276 const uint8_t *next;
@@ -3204,6 +3314,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) · 37 unmodified lines
32043314 av_log(avctx, AV_LOG_ERROR, "Incomplete extradata\n");
32053315 return -1;
32063316 }
3317+ v->res_sprite = (avctx->codec_tag == MKTAG('W','V','P','2'));
32073318 }
32083319 avctx->profile = v->profile;
32093320 if (v->profile == PROFILE_ADVANCED)
@@ -3359,6 +3470,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 149 unmodified lines
33593470 init_get_bits(&s->gb, buf2, buf_size2*8);
33603471 } else
33613472 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+
33623481 // do parse frame header
33633482 if(v->profile < PROFILE_ADVANCED) {
33643483 if(vc1_parse_frame_header(v, &s->gb) == -1) {
@@ -3370,8 +3489,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 5 unmodified lines
33703489 }
33713490 }
33723491
3373− if(v->res_sprite && (s->pict_type!=FF_I_TYPE)){
3374− goto err;
3492+ if (v->res_sprite && s->pict_type!=FF_I_TYPE) {
3493+ av_log(v->s.avctx, AV_LOG_WARNING, "Sprite decoder: expected I-frame\n");
33753494 }
33763495
33773496 s->current_picture_ptr->repeat_pict = 0;
@@ -3464,6 +3583,8 @@ assert(s->current_picture.pict_type == s->pict_type); · 86 unmodified lines
34643583 }
34653584
34663585 end:
3586+ if (v->res_sprite)
3587+ vc1_parse_sprites(v, &s->gb);
34673588 av_free(buf2);
34683589 for (i = 0; i < n_slices; i++)
34693590 av_free(slices[i].buf);
libavcodec/version.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222
2323 #define LIBAVCODEC_VERSION_MAJOR 52
2424 #define LIBAVCODEC_VERSION_MINOR 117
25−#define LIBAVCODEC_VERSION_MICRO 0
25+#define LIBAVCODEC_VERSION_MICRO 1
2626
2727 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
2828 LIBAVCODEC_VERSION_MINOR, \
libavformat/avio.h+162−157
@@ -22,10 +22,7 @@ · 21 unmodified lines
2222
2323 /**
2424 * @file
25− * unbuffered 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.
25+ * Buffered I/O operations
2926 */
3027
3128 #include <stdint.h>
@@ -35,6 +32,63 @@ · 3 unmodified lines
3532
3633 #include "libavformat/version.h"
3734
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+ */
50+typedef 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+
3892 /* unbuffered I/O */
3993
4094 #if FF_API_OLD_AVIO
@@ -59,12 +113,38 @@ typedef struct URLContext { · 18 unmodified lines
59113 int is_connected;
60114 } URLContext;
61115
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+ */
122+typedef 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+
62139 typedef struct URLPollEntry {
63140 URLContext *handle;
64141 int events;
65142 int revents;
66143 } URLPollEntry;
67144
145+/* not implemented */
146+attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
147+
68148 /**
69149 * @defgroup open_modes URL open modes
70150 * The flags argument to url_open and cosins must be one of the following
@@ -93,6 +173,7 @@ typedef struct URLPollEntry { · 22 unmodified lines
93173 #define URL_FLAG_NONBLOCK 4
94174
95175 typedef int URLInterruptCB(void);
176+extern URLInterruptCB *url_interrupt_cb;
96177
97178 /**
98179 * @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
117198 attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
118199 int64_t timestamp, int flags);
119200 attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
120−#endif
121201
122202 /**
123− * Return a non-zero value if the resource indicated by url
124− * exists, 0 otherwise.
125− */
126−int 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− */
134−void avio_set_interrupt_cb(int (*interrupt_cb)(void));
135−
136−#if FF_API_OLD_AVIO
137−/* not implemented */
138−attribute_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− */
147−typedef 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
166−extern URLProtocol *first_protocol;
167−#endif
168−
169−#if FF_API_OLD_AVIO
170−extern 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.
203+ * returns the next registered protocol after the given protocol (the first if
204+ * NULL is given), or NULL if protocol is the last one.
177205 */
178206 URLProtocol *av_protocol_next(URLProtocol *p);
179207
180−#if FF_API_REGISTER_PROTOCOL
181−/**
182− * @deprecated Use av_register_protocol() instead.
183− */
184−attribute_deprecated int register_protocol(URLProtocol *protocol);
185−
186−/**
187− * @deprecated Use av_register_protocol2() instead.
188− */
189−attribute_deprecated int av_register_protocol(URLProtocol *protocol);
190−#endif
191−
192−#if FF_API_OLD_AVIO
193208 /**
194209 * Register the URLProtocol protocol.
195210 *
196211 * @param size the size of the URLProtocol struct referenced
197212 */
198213 attribute_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−
203214 /**
204215 * @}
205216 */
206217
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− */
214−typedef 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;
242218
243−#if FF_API_OLD_AVIO
244219 typedef attribute_deprecated AVIOContext ByteIOContext;
245220
246221 attribute_deprecated int init_put_byte(AVIOContext *s,
@@ -334,6 +309,62 @@ attribute_deprecated void init_checksum(AVIOContext *s, · 87 unmodified lines
334309 unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len),
335310 unsigned long checksum);
336311 attribute_deprecated unsigned long get_checksum(AVIOContext *s);
312+attribute_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 */
315+attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
316+/**
317+ * @deprecated use avio_get_str instead
318+ */
319+attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
320+/**
321+ * @deprecated Use AVIOContext.seekable field directly.
322+ */
323+attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
324+{
325+ return !s->seekable;
326+}
327+attribute_deprecated URLContext *url_fileno(AVIOContext *s);
328+
329+/**
330+ * @deprecated use AVIOContext.max_packet_size directly.
331+ */
332+attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
333+
334+attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
335+
336+/** return the written or read size */
337+attribute_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+ */
344+int 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+ */
352+void avio_set_interrupt_cb(int (*interrupt_cb)(void));
353+
354+#if FF_API_REGISTER_PROTOCOL
355+extern URLProtocol *first_protocol;
356+#endif
357+
358+#if FF_API_REGISTER_PROTOCOL
359+/**
360+ * @deprecated Use av_register_protocol() instead.
361+ */
362+attribute_deprecated int register_protocol(URLProtocol *protocol);
363+
364+/**
365+ * @deprecated Use av_register_protocol2() instead.
366+ */
367+attribute_deprecated int av_register_protocol(URLProtocol *protocol);
337368 #endif
338369
339370 /**
@@ -372,10 +403,6 @@ void avio_wb24(AVIOContext *s, unsigned int val); · 32 unmodified lines
372403 void avio_wl16(AVIOContext *s, unsigned int val);
373404 void avio_wb16(AVIOContext *s, unsigned int val);
374405
375−#if FF_API_OLD_AVIO
376−attribute_deprecated void put_strz(AVIOContext *s, const char *buf);
377−#endif
378−
379406 /**
380407 * Write a NULL-terminated string.
381408 * @return number of bytes written.
@@ -443,12 +470,6 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ · 61 unmodified lines
443470 int avio_printf(AVIOContext *s, const char *fmt, ...);
444471 #endif
445472
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 */
449−attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size);
450−#endif
451−
452473 void avio_flush(AVIOContext *s);
453474
454475
@@ -458,13 +479,25 @@ void avio_flush(AVIOContext *s); · 3 unmodified lines
458479 */
459480 int avio_read(AVIOContext *s, unsigned char *buf, int size);
460481
461−/** @note return 0 if EOF, so you cannot use it if EOF handling is
462− necessary */
482+/**
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+ */
463489 int avio_r8 (AVIOContext *s);
464490 unsigned int avio_rl16(AVIOContext *s);
465491 unsigned int avio_rl24(AVIOContext *s);
466492 unsigned int avio_rl32(AVIOContext *s);
467493 uint64_t avio_rl64(AVIOContext *s);
494+unsigned int avio_rb16(AVIOContext *s);
495+unsigned int avio_rb24(AVIOContext *s);
496+unsigned int avio_rb32(AVIOContext *s);
497+uint64_t avio_rb64(AVIOContext *s);
498+/**
499+ * @}
500+ */
468501
469502 /**
470503 * 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
489522 int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
490523 int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
491524
492−#if FF_API_OLD_AVIO
493−/**
494− * @deprecated use avio_get_str instead
495− */
496−attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen);
497−#endif
498−unsigned int avio_rb16(AVIOContext *s);
499−unsigned int avio_rb24(AVIOContext *s);
500−unsigned int avio_rb32(AVIOContext *s);
501−uint64_t avio_rb64(AVIOContext *s);
502−
503−#if FF_API_OLD_AVIO
504−/**
505− * @deprecated Use AVIOContext.seekable field directly.
506− */
507−attribute_deprecated static inline int url_is_streamed(AVIOContext *s)
508−{
509− return !s->seekable;
510−}
511−#endif
512525
513526 #if FF_API_URL_RESETBUF
514527 /** Reset the buffer for reading or writing.
@@ -560,21 +573,13 @@ int url_resetbuf(AVIOContext *s, int flags); · 45 unmodified lines
560573 */
561574 int avio_open(AVIOContext **s, const char *url, int flags);
562575
563−int avio_close(AVIOContext *s);
564−
565−#if FF_API_OLD_AVIO
566−attribute_deprecated URLContext *url_fileno(AVIOContext *s);
567−
568576 /**
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.
570581 */
571−attribute_deprecated int url_fget_max_packet_size(AVIOContext *s);
572−
573−attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags);
574−
575−/** return the written or read size */
576−attribute_deprecated int url_close_buf(AVIOContext *s);
577−#endif
582+int avio_close(AVIOContext *s);
578583
579584 /**
580585 * 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
164164 os->bufsize = DECODER_BUFFER_SIZE;
165165 os->buf = av_malloc(os->bufsize);
166166 os->header = -1;
167+ os->page_begin = 1;
167168
168169 st = av_new_stream (s, idx);
169170 if (!st)
@@ -241,12 +242,27 @@ ogg_read_page (AVFormatContext * s, int *str) · 71 unmodified lines
241242
242243 idx = ogg_find_stream (ogg, serial);
243244 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+ }
244258 idx = ogg_new_stream (s, serial);
245259 if (idx < 0)
246260 return -1;
247261 }
248262
249263 os = ogg->streams + idx;
264+ if (!(flags & OGG_FLAG_BOS))
265+ os->page_begin = 0;
250266 os->page_pos = avio_tell(bc) - 27;
251267
252268 if(os->psize > 0)
libavformat/oggdec.h+1−0
@@ -75,6 +75,7 @@ struct ogg_stream { · 74 unmodified lines
7575 int incomplete; ///< whether we're expecting a continuation in the next page
7676 int page_end; ///< current packet is the last one completed in the page
7777 int keyframe_seek;
78+ int page_begin; ///< set to 1 if the stream only received a begin-of-stream packet, otherwise 0
7879 void *private;
7980 };
8081
libavformat/riff.c+1−0
@@ -232,6 +232,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { · 231 unmodified lines
232232 { CODEC_ID_WMV3, MKTAG('W', 'M', 'V', 'P') },
233233 { CODEC_ID_VC1, MKTAG('W', 'V', 'C', '1') },
234234 { CODEC_ID_VC1, MKTAG('W', 'M', 'V', 'A') },
235+ { CODEC_ID_VC1, MKTAG('W', 'V', 'P', '2') },
235236 { CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },
236237 { CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },
237238 { CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },
libavutil/ppc/cpu.c+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #undef _POSIX_C_SOURCE
2121 #include <sys/sysctl.h>
2222 #elif defined(__OpenBSD__)
23+#undef _POSIX_C_SOURCE
2324 #include <sys/param.h>
2425 #include <sys/sysctl.h>
2526 #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