X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favio.h;h=d022820a6edf301a06389f83f2ce01f93a3decae;hb=a04ad248a05e7b613abe09b3bb067f555108d794;hp=dcb8dcdf93ade80ba2bb767f2f008fb26ac168cc;hpb=f32d2939555706365ad1d39aadd5ee7ce1d9fa4f;p=ffmpeg diff --git a/libavformat/avio.h b/libavformat/avio.h index dcb8dcdf93a..d022820a6ed 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -571,9 +571,29 @@ int64_t avio_size(AVIOContext *s); */ int avio_feof(AVIOContext *s); -/** @warning Writes up to 4 KiB per call */ +/** + * Writes a formatted string to the context. + * @return number of bytes written, < 0 on error. + */ int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); +/** + * Write a NULL terminated array of strings to the context. + * Usually you don't need to use this function directly but its macro wrapper, + * avio_print. + */ +void avio_print_string_array(AVIOContext *s, const char *strings[]); + +/** + * Write strings (const char *) to the context. + * This is a convenience macro around avio_print_string_array and it + * automatically creates the string array from the variable argument list. + * For simple string concatenations this function is more performant than using + * avio_printf since it does not need a temporary buffer. + */ +#define avio_print(s, ...) \ + avio_print_string_array(s, (const char*[]){__VA_ARGS__, NULL}) + /** * Force flushing of buffered data. * @@ -787,6 +807,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).