]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.h
Remove return statements following infinite loops without break
[ffmpeg] / libavformat / avio.h
index 213baaab7287a7ffc1d8fb0ee50624f79f50a97f..be14e3c89d362625a9ccd8592e3ed8e32e02ccb3 100644 (file)
@@ -101,9 +101,7 @@ typedef struct {
  * @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 */
@@ -147,14 +145,14 @@ typedef struct URLPollEntry {
 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 */
 /**
  * @}
  */
@@ -178,7 +176,7 @@ extern URLInterruptCB *url_interrupt_cb;
 
 /**
  * @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,
@@ -237,7 +235,7 @@ attribute_deprecated AVIOContext *av_alloc_put_byte(
 
 /**
  * @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);
@@ -274,7 +272,7 @@ attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h,    int stream_in
 
 /**
  * @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);
@@ -286,11 +284,7 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s);
 #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);
@@ -349,7 +343,7 @@ attribute_deprecated int url_exist(const char *url);
 #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.
@@ -359,9 +353,6 @@ attribute_deprecated int url_exist(const char *url);
  * 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);
 
@@ -373,27 +364,12 @@ 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.
@@ -483,11 +459,7 @@ static av_always_inline int64_t avio_tell(AVIOContext *s)
 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);
 
@@ -499,7 +471,7 @@ 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
@@ -543,20 +515,14 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
 
 
 /**
- * @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 */
 /**
  * @}
  */
@@ -573,11 +539,7 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
  * 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
@@ -621,10 +583,6 @@ int avio_open_dyn_buf(AVIOContext **s);
  */
 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.
  *