summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-03-05 22:31:45 +0000
committerMartin Storsjö <martin@martin.st>2010-03-05 22:31:45 +0000
commit780d7897a9c9295b43f1f0e9b49a11f99cd402c3 (patch)
tree11e98db4dbed4d56423e99e097e0089e250ec468 /libavformat/avformat.h
parent67d4b3f2054ee30d0329f82212078e9a243393de (diff)
Add a function ff_url_join for assembling URLs
Originally committed as revision 22225 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index e7426aa16d..aa727979ba 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1350,6 +1350,30 @@ void url_split(char *proto, int proto_size,
char *path, int path_size,
const char *url);
+/**
+ * Assembles a URL string from components. This is the reverse operation
+ * of url_split.
+ *
+ * Note, this requires networking to be initialized, so the caller must
+ * ensure ff_network_init has been called.
+ *
+ * @see url_split
+ *
+ * @param str the buffer to fill with the url
+ * @param size the size of the str buffer
+ * @param proto the protocol identifier, if null, the separator
+ * after the identifier is left out, too
+ * @param authorization an optional authorization string, may be null
+ * @param hostname the host name string
+ * @param port the port number, left out from the string if negative
+ * @param fmt a generic format string for everything to add after the
+ * host/port, may be null
+ * @return the number of characters written to the destination buffer
+ */
+int ff_url_join(char *str, int size, const char *proto,
+ const char *authorization, const char *hostname,
+ int port, const char *fmt, ...);
+
#if LIBAVFORMAT_VERSION_MAJOR < 53
/**
* @deprecated Use av_match_ext() instead.