[FFmpeg-cvslog] avio: deprecate av_protocol_next().

Anton Khirnov git at videolan.org
Sat Apr 9 03:25:00 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Apr  4 20:28:58 2011 +0200| [cdc6a87f193b1bf99a640a44374d4f2597118959] | committer: Anton Khirnov

avio: deprecate av_protocol_next().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cdc6a87f193b1bf99a640a44374d4f2597118959
---

 cmdutils.c         |   20 ++++++++------------
 libavformat/avio.c |    2 ++
 libavformat/avio.h |    4 +++-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 6901f56..cc10b48 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -653,20 +653,16 @@ void show_bsfs(void)
 
 void show_protocols(void)
 {
-    URLProtocol *up=NULL;
+    void *opaque = NULL;
+    const char *name;
 
     printf("Supported file protocols:\n"
-           "I.. = Input  supported\n"
-           ".O. = Output supported\n"
-           "..S = Seek   supported\n"
-           "FLAGS NAME\n"
-           "----- \n");
-    while((up = av_protocol_next(up)))
-        printf("%c%c%c   %s\n",
-               up->url_read  ? 'I' : '.',
-               up->url_write ? 'O' : '.',
-               up->url_seek  ? 'S' : '.',
-               up->name);
+           "Input:\n");
+    while ((name = avio_enum_protocols(&opaque, 0)))
+        printf("%s\n", name);
+    printf("Output:\n");
+    while ((name = avio_enum_protocols(&opaque, 1)))
+        printf("%s\n", name);
 }
 
 void show_filters(void)
diff --git a/libavformat/avio.c b/libavformat/avio.c
index ab7a7f5..ad1f1b4 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -51,11 +51,13 @@ static int default_interrupt_cb(void);
 URLProtocol *first_protocol = NULL;
 int (*url_interrupt_cb)(void) = default_interrupt_cb;
 
+#if FF_API_OLD_AVIO
 URLProtocol *av_protocol_next(URLProtocol *p)
 {
     if(p) return p->next;
     else  return first_protocol;
 }
+#endif
 
 const char *avio_enum_protocols(void **opaque, int output)
 {
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 9ea138e..7bb8d17 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -170,12 +170,14 @@ extern URLProtocol *first_protocol;
 extern URLInterruptCB *url_interrupt_cb;
 #endif
 
+#if FF_API_OLD_AVIO
 /**
  * If protocol is NULL, returns the first registered protocol,
  * if protocol is non-NULL, returns the next registered protocol after protocol,
  * or NULL if protocol is the last one.
  */
-URLProtocol *av_protocol_next(URLProtocol *p);
+attribute_deprecated URLProtocol *av_protocol_next(URLProtocol *p);
+#endif
 
 #if FF_API_REGISTER_PROTOCOL
 /**



More information about the ffmpeg-cvslog mailing list