aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vdpau.h
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2014-10-04 16:55:07 +0300
committerAnton Khirnov <anton@khirnov.net>2014-10-06 06:20:40 +0000
commite3e158e81f0666b8fe66be9ce1cad63a535920e0 (patch)
tree6fdef8ebf681dc7adb60ed733a48089c24569441 /libavcodec/vdpau.h
parent502cde409ca5ee97ef70c2cdede88b9101746ff6 (diff)
downloadffmpeg-e3e158e81f0666b8fe66be9ce1cad63a535920e0.tar.gz
vdpau: add av_vdpau_bind_context()
This function provides an explicit VDPAU device and VDPAU driver to libavcodec, so that the application is relieved from codec specifics and VdpDevice life cycle management. A stub flags parameter is added for future extension. For instance, it could be used to ignore codec level capabilities (if someone feels dangerous). Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vdpau.h')
-rw-r--r--libavcodec/vdpau.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 75cb1bf7a3..1714b1e1fb 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -131,6 +131,26 @@ typedef struct AVVDPAUContext {
} AVVDPAUContext;
/**
+ * Associate a VDPAU device with a codec context for hardware acceleration.
+ * This function is meant to be called from the get_format() codec callback,
+ * or earlier. It can also be called after avcodec_flush_buffers() to change
+ * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent
+ * display preemption).
+ *
+ * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes
+ * succesfully.
+ *
+ * @param avctx decoding context whose get_format() callback is invoked
+ * @param device VDPAU device handle to use for hardware acceleration
+ * @param get_proc_address VDPAU device driver
+ * @param flags for future use, must be zero
+ *
+ * @return 0 on success, an AVERROR code on failure.
+ */
+int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
+ VdpGetProcAddress *get_proc_address, unsigned flags);
+
+/**
* Allocate an AVVDPAUContext.
*
* @return Newly-allocated AVVDPAUContext or NULL on failure.