summaryrefslogtreecommitdiff
path: root/libavformat/avio.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-14 03:21:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-14 03:21:38 +0200
commitc55780dcef1ba87564d8003cded7d045dce9ba34 (patch)
treef685b7150db1c7e0f5e65fb2761f3f8bd843f056 /libavformat/avio.h
parentff5278d8f6203a9486c0cd63a3aecef4bc2e4f6f (diff)
parent651b276ef7ad8d89e89bfc94a4232ab6c36f3a8a (diff)
Merge remote branch 'qatar/master'
* qatar/master: (32 commits) libopencore-amr, libvo-amrwbenc: Allow enabling DTX via private AVOptions libopencore-amr, libvo-amrwbenc: Only check the bitrate when changed libopencore-amr, libvo-amrwbenc: Find the closest matching bitrate libvo-*: Fix up the long codec names libavcodec: Mark AVCodec->priv_class const swscale: Factorize FAST_BGR2YV12 definition. libvo-aacenc: Only produce extradata if the global header flag is set lavf: postpone removal of public metadata conversion API lavc: postpone removal of request_channels lavc: postpone removal of audioconvert and sample_fmt wrappers lavf: postpone removal of deprecated avio functions libopencore-amr: Cosmetics: Rewrap and align libopencore-amr, libvo-amrbwenc: Rename variables and functions libopencore-amr: Convert commented out debug logging into av_dlog libopencore-amr: Remove an unused state variable libvo-amrwbenc: Don't explicitly store bitrate modes in the bitrate table libopencore-amr: Remove a useless local variable libopencore-amr, libvo-amrwbenc: Make the bitrate/mode mapping array static const libopencore-amr, libvo-amrwbenc: Return proper error codes in most places libopencore-amr: Don't print carriage returns in log messages ... Conflicts: doc/developer.texi libavcodec/avcodec.h libavcodec/libvo-aacenc.c libavcodec/libvo-amrwbenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avio.h')
-rw-r--r--libavformat/avio.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 7deca337cf..9d805822d4 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -134,6 +134,7 @@ typedef struct URLProtocol {
int priv_data_size;
const AVClass *priv_data_class;
int flags;
+ int (*url_check)(URLContext *h, int mask);
} URLProtocol;
typedef struct URLPollEntry {
@@ -335,13 +336,31 @@ attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_siz
/** return the written or read size */
attribute_deprecated int url_close_buf(AVIOContext *s);
-#endif // FF_API_OLD_AVIO
/**
* Return a non-zero value if the resource indicated by url
* exists, 0 otherwise.
+ * @deprecated Use avio_check instead.
*/
-int url_exist(const char *url);
+attribute_deprecated int url_exist(const char *url);
+#endif // FF_API_OLD_AVIO
+
+/**
+ * Return AVIO_* 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.
+ *
+ * @note This function is intrinsically unsafe, in the sense that the
+ * checked resource may change its existence or permission status from
+ * 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);
/**
* The callback is called in blocking functions to test regulary if
@@ -537,9 +556,15 @@ int url_resetbuf(AVIOContext *s, int flags);
* 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
/**
* @}
*/
@@ -556,7 +581,11 @@ int url_resetbuf(AVIOContext *s, int flags);
* 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