# HG changeset patch # User michael # Date 1197486118 0 # Node ID 173b5cb7efde1bdce72920ecef4e26f7944d2501 # Parent cbc58d02f91236ec1cc9979e14c1bfb01a5ab2bf av_*_next() API for libavformat diff -r cbc58d02f912 -r 173b5cb7efde avformat.h --- a/avformat.h Sun Dec 09 14:39:01 2007 +0000 +++ b/avformat.h Wed Dec 12 19:01:58 2007 +0000 @@ -21,8 +21,8 @@ #ifndef FFMPEG_AVFORMAT_H #define FFMPEG_AVFORMAT_H -#define LIBAVFORMAT_VERSION_INT ((52<<16)+(1<<8)+0) -#define LIBAVFORMAT_VERSION 52.1.0 +#define LIBAVFORMAT_VERSION_INT ((52<<16)+(2<<8)+0) +#define LIBAVFORMAT_VERSION 52.2.0 #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) @@ -452,8 +452,13 @@ struct AVPacketList *next; } AVPacketList; +#if LIBAVFORMAT_VERSION_INT < (53<<16) extern AVInputFormat *first_iformat; extern AVOutputFormat *first_oformat; +#endif + +AVInputFormat *av_iformat_next(AVInputFormat *f); +AVOutputFormat *av_oformat_next(AVOutputFormat *f); enum CodecID av_guess_image2_codec(const char *filename); diff -r cbc58d02f912 -r 173b5cb7efde avio.c --- a/avio.c Sun Dec 09 14:39:01 2007 +0000 +++ b/avio.c Wed Dec 12 19:01:58 2007 +0000 @@ -26,6 +26,12 @@ URLProtocol *first_protocol = NULL; URLInterruptCB *url_interrupt_cb = default_interrupt_cb; +URLProtocol *av_protocol_next(URLProtocol *p) +{ + if(p) return p->next; + else return first_protocol; +} + int register_protocol(URLProtocol *protocol) { URLProtocol **p; diff -r cbc58d02f912 -r 173b5cb7efde avio.h --- a/avio.h Sun Dec 09 14:39:01 2007 +0000 +++ b/avio.h Wed Dec 12 19:01:58 2007 +0000 @@ -136,6 +136,8 @@ extern URLProtocol *first_protocol; extern URLInterruptCB *url_interrupt_cb; +URLProtocol *av_protocol_next(URLProtocol *p); + int register_protocol(URLProtocol *protocol); typedef struct { diff -r cbc58d02f912 -r 173b5cb7efde utils.c --- a/utils.c Sun Dec 09 14:39:01 2007 +0000 +++ b/utils.c Wed Dec 12 19:01:58 2007 +0000 @@ -41,6 +41,18 @@ /** head of registered output format linked list. */ AVOutputFormat *first_oformat = NULL; +AVInputFormat *av_iformat_next(AVInputFormat *f) +{ + if(f) return f->next; + else return first_iformat; +} + +AVOutputFormat *av_oformat_next(AVOutputFormat *f) +{ + if(f) return f->next; + else return first_oformat; +} + void av_register_input_format(AVInputFormat *format) { AVInputFormat **p;