* @deprecated This struct will be made private
*/
typedef struct URLContext {
-#if FF_API_URL_CLASS
const AVClass *av_class; ///< information for av_log(). Set by url_open().
-#endif
struct URLProtocol *prot;
int flags;
int is_streamed; /**< true if streamed (no seek possible), default = false */
attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
/**
- * @defgroup open_modes URL open modes
+ * @name URL open modes
* The flags argument to url_open and cosins must be one of the following
* constants, optionally ORed with other flags.
* @{
*/
-#define URL_RDONLY 0 /**< read-only */
-#define URL_WRONLY 1 /**< write-only */
-#define URL_RDWR 2 /**< read-write */
+#define URL_RDONLY 1 /**< read-only */
+#define URL_WRONLY 2 /**< write-only */
+#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */
/**
* @}
*/
/**
* @defgroup old_url_funcs Old url_* functions
- * @deprecated use the buffered API based on AVIOContext instead
+ * The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
* @{
*/
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
/**
* @defgroup old_avio_funcs Old put_/get_*() functions
- * @deprecated use the avio_ -prefixed functions instead.
+ * The following functions are deprecated. Use the "avio_"-prefixed functions instead.
* @{
*/
attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size);
/**
* @defgroup old_url_f_funcs Old url_f* functions
- * @deprecated use the avio_ -prefixed functions instead.
+ * The following functions are deprecated, use the "avio_"-prefixed functions instead.
* @{
*/
attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
#define URL_EOF (-1)
attribute_deprecated int url_fgetc(AVIOContext *s);
attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
-#ifdef __GNUC__
-attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
-#endif
+attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
attribute_deprecated void put_flush_packet(AVIOContext *s);
attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
#endif // FF_API_OLD_AVIO
/**
- * Return AVIO_* access flags corresponding to the access permissions
+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
* of the resource in url, or a negative value corresponding to an
* AVERROR code in case of failure. The returned access flags are
* masked by the value in flags.
* one call to another. Thus you should not trust the returned value,
* unless you are sure that no other processes are accessing the
* checked resource.
- *
- * @note This function is slightly broken until next major bump
- * because of AVIO_RDONLY == 0. Don't use it until then.
*/
int avio_check(const char *url, int flags);
*/
void avio_set_interrupt_cb(int (*interrupt_cb)(void));
-#if FF_API_REGISTER_PROTOCOL
-extern URLProtocol *first_protocol;
-#endif
-
-#if FF_API_REGISTER_PROTOCOL
-/**
- * @deprecated Use av_register_protocol() instead.
- */
-attribute_deprecated int register_protocol(URLProtocol *protocol);
-
-/**
- * @deprecated Use av_register_protocol2() instead.
- */
-attribute_deprecated int av_register_protocol(URLProtocol *protocol);
-#endif
-
/**
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
* freed with av_free().
*
* @param buffer Memory block for input/output operations via AVIOContext.
+ * The buffer must be allocated with av_malloc() and friends.
* @param buffer_size The buffer size is very important for performance.
* For protocols with fixed blocksize it should be set to this blocksize.
* For others a typical size is a cache page, e.g. 4kb.
int64_t avio_size(AVIOContext *s);
/** @warning currently size is limited */
-#ifdef __GNUC__
-int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
-#else
-int avio_printf(AVIOContext *s, const char *fmt, ...);
-#endif
+int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
void avio_flush(AVIOContext *s);
int avio_read(AVIOContext *s, unsigned char *buf, int size);
/**
- * @defgroup avio_read Functions for reading from AVIOContext.
+ * @name Functions for reading from AVIOContext
* @{
*
* @note return 0 if EOF, so you cannot use it if EOF handling is
/**
- * @defgroup open_modes URL open modes
+ * @name URL open modes
* The flags argument to avio_open must be one of the following
* constants, optionally ORed with other flags.
* @{
*/
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-#define AVIO_RDONLY 0 /**< read-only */
-#define AVIO_WRONLY 1 /**< write-only */
-#define AVIO_RDWR 2 /**< read-write */
-#else
-#define AVIO_RDONLY 1 /**< read-only */
-#define AVIO_WRONLY 2 /**< write-only */
-#define AVIO_RDWR 4 /**< read-write */
-#endif
+#define AVIO_FLAG_READ 1 /**< read-only */
+#define AVIO_FLAG_WRITE 2 /**< write-only */
+#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
/**
* @}
*/
* Warning: non-blocking protocols is work-in-progress; this flag may be
* silently ignored.
*/
-#if LIBAVFORMAT_VERSION_MAJOR < 53
-#define AVIO_FLAG_NONBLOCK 4
-#else
#define AVIO_FLAG_NONBLOCK 8
-#endif
/**
* Create and initialize a AVIOContext for accessing the
*/
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
-#if FF_API_UDP_GET_FILE
-int udp_get_file_handle(URLContext *h);
-#endif
-
/**
* Iterate through names of available protocols.
*