aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2020-01-30 17:03:48 +0800
committerSteven Liu <lq@chinaffmpeg.org>2020-01-30 17:10:12 +0800
commit27529eeb27cf0d7f574ae60d5cef22baa0e8a850 (patch)
treeda4a11f1f0c59905b7294415bdfcbd16423ea1b9 /libavformat
parent3bce9e9b3ea35c54bacccc793d7da99ea5157532 (diff)
downloadffmpeg-27529eeb27cf0d7f574ae60d5cef22baa0e8a850.tar.gz
avformat/avio: add avio_protocol_get_class
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com> Suggested-by: Nicolas George <george@nsup.org> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avio.h7
-rw-r--r--libavformat/protocols.c10
-rw-r--r--libavformat/version.h2
3 files changed, 18 insertions, 1 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 9141642e75..d022820a6e 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -808,6 +808,13 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
const char *avio_enum_protocols(void **opaque, int output);
/**
+ * Get AVClass by names of available protocols.
+ *
+ * @return A AVClass of input protocol name or NULL
+ */
+const AVClass *avio_protocol_get_class(const char *name);
+
+/**
* Pause and resume playing - only meaningful if using a network streaming
* protocol (e.g. MMS).
*
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index face5b29b5..29fb99e7fa 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -107,6 +107,16 @@ const char *avio_enum_protocols(void **opaque, int output)
return avio_enum_protocols(opaque, output);
}
+const AVClass *avio_protocol_get_class(const char *name)
+{
+ int i = 0;
+ for (i = 0; url_protocols[i]; i++) {
+ if (!strcmp(url_protocols[i]->name, name))
+ return url_protocols[i]->priv_data_class;
+ }
+ return NULL;
+}
+
const URLProtocol **ffurl_get_protocols(const char *whitelist,
const char *blacklist)
{
diff --git a/libavformat/version.h b/libavformat/version.h
index f72fb9478a..15fdb73e3e 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
-#define LIBAVFORMAT_VERSION_MINOR 36
+#define LIBAVFORMAT_VERSION_MINOR 37
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \