From f8270bbf8ce891cc614a5562c02ce18a50a89f1d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 4 Apr 2011 08:18:54 +0200 Subject: avio: add a function for iterating though protocol names. --- libavformat/avio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libavformat/avio.c') diff --git a/libavformat/avio.c b/libavformat/avio.c index e043058974..ab7a7f51ec 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -57,6 +57,16 @@ URLProtocol *av_protocol_next(URLProtocol *p) else return first_protocol; } +const char *avio_enum_protocols(void **opaque, int output) +{ + URLProtocol **p = opaque; + *p = *p ? (*p)->next : first_protocol; + if (!*p) return NULL; + if ((output && (*p)->url_write) || (!output && (*p)->url_read)) + return (*p)->name; + return avio_enum_protocols(opaque, output); +} + int ffurl_register_protocol(URLProtocol *protocol, int size) { URLProtocol **p; -- cgit v1.2.3