summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-12-12 19:01:58 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-12-12 19:01:58 +0000
commit84be6e723930e540ee105949af1a7a498164560c (patch)
treed92e440279d6a8b407ba691705fb97f717a15ae9 /libavformat
parent562b216307ab1e7a62fe85ef9dcf3c485bc647f7 (diff)
av_*_next() API for libavformat
Originally committed as revision 11206 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h9
-rw-r--r--libavformat/avio.c6
-rw-r--r--libavformat/avio.h2
-rw-r--r--libavformat/utils.c12
4 files changed, 27 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 5ac2b23441..9c8419a6a9 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -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 @@ typedef struct AVPacketList {
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 --git a/libavformat/avio.c b/libavformat/avio.c
index 234a99a15d..3447889988 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -26,6 +26,12 @@ static int default_interrupt_cb(void);
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 --git a/libavformat/avio.h b/libavformat/avio.h
index 5a8d19f354..95d4672d08 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -136,6 +136,8 @@ typedef struct URLProtocol {
extern URLProtocol *first_protocol;
extern URLInterruptCB *url_interrupt_cb;
+URLProtocol *av_protocol_next(URLProtocol *p);
+
int register_protocol(URLProtocol *protocol);
typedef struct {
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ae1659f4c8..3cd07552c5 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -41,6 +41,18 @@ AVInputFormat *first_iformat = NULL;
/** 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;