summaryrefslogtreecommitdiff
path: root/ffmpeg/linux-x86_64/include/libavformat/avio.h
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/linux-x86_64/include/libavformat/avio.h')
-rw-r--r--ffmpeg/linux-x86_64/include/libavformat/avio.h43
1 files changed, 32 insertions, 11 deletions
diff --git a/ffmpeg/linux-x86_64/include/libavformat/avio.h b/ffmpeg/linux-x86_64/include/libavformat/avio.h
index f9c5972..d022820 100644
--- a/ffmpeg/linux-x86_64/include/libavformat/avio.h
+++ b/ffmpeg/linux-x86_64/include/libavformat/avio.h
@@ -236,8 +236,7 @@ typedef struct AVIOContext {
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
int64_t (*seek)(void *opaque, int64_t offset, int whence);
int64_t pos; /**< position in the file of the current buffer */
- int must_flush; /**< unused */
- int eof_reached; /**< true if eof reached */
+ int eof_reached; /**< true if was unable to read due to error or eof */
int write_flag; /**< true if open for writing */
int max_packet_size;
unsigned long checksum;
@@ -452,6 +451,8 @@ void avio_free_directory_entry(AVIODirEntry **entry);
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
* @param opaque An opaque pointer to user-specific data.
* @param read_packet A function for refilling the buffer, may be NULL.
+ * For stream protocols, must never return 0 but rather
+ * a proper AVERROR code.
* @param write_packet A function for writing the buffer contents, may be NULL.
* The function may not change the input buffers content.
* @param seek A function for seeking to specified byte position, may be NULL.
@@ -565,22 +566,35 @@ static av_always_inline int64_t avio_tell(AVIOContext *s)
int64_t avio_size(AVIOContext *s);
/**
- * feof() equivalent for AVIOContext.
- * @return non zero if and only if end of file
+ * Similar to feof() but also returns nonzero on read errors.
+ * @return non zero if and only if at end of file or a read error happened when reading.
*/
int avio_feof(AVIOContext *s);
-#if FF_API_URL_FEOF
+
/**
- * @deprecated use avio_feof()
+ * Writes a formatted string to the context.
+ * @return number of bytes written, < 0 on error.
*/
-attribute_deprecated
-int url_feof(AVIOContext *s);
-#endif
-
-/** @warning Writes up to 4 KiB per call */
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.
*
* For write streams, force the buffered data to be immediately written to the output,
@@ -794,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).
*