aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vdpau.h
diff options
context:
space:
mode:
authorRĂ©mi Denis-Courmont <remi@remlab.net>2013-01-12 17:53:43 +0200
committerDiego Biurrun <diego@biurrun.de>2013-01-13 14:41:27 +0100
commit44e065d56c87d6a9d0effccec5f31517f72924ec (patch)
tree1a3b2b88390b09144c718450adc107936cc914bd /libavcodec/vdpau.h
parent22c436c85e0dd81702b4e9289b90755b7310982f (diff)
downloadffmpeg-44e065d56c87d6a9d0effccec5f31517f72924ec.tar.gz
vdpau: Add context and common helpers for hwaccel support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/vdpau.h')
-rw-r--r--libavcodec/vdpau.h69
1 files changed, 63 insertions, 6 deletions
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 241ff19051..7e692f767b 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -52,6 +52,68 @@
#include <vdpau/vdpau.h>
#include <vdpau/vdpau_x11.h>
+union VdpPictureInfo {
+ VdpPictureInfoH264 h264;
+ VdpPictureInfoMPEG1Or2 mpeg;
+ VdpPictureInfoVC1 vc1;
+ VdpPictureInfoMPEG4Part2 mpeg4;
+};
+
+/**
+ * This structure is used to share data between the libavcodec library and
+ * the client video application.
+ * The user shall zero-allocate the structure and make it available as
+ * AVCodecContext.hwaccel_context. Members can be set by the user once
+ * during initialization or through each AVCodecContext.get_buffer()
+ * function call. In any case, they must be valid prior to calling
+ * decoding functions.
+ */
+typedef struct AVVDPAUContext {
+ /**
+ * VDPAU decoder handle
+ *
+ * Set by user.
+ */
+ VdpDecoder decoder;
+
+ /**
+ * VDPAU decoder render callback
+ *
+ * Set by the user.
+ */
+ VdpDecoderRender *render;
+
+ /**
+ * VDPAU picture information
+ *
+ * Set by libavcodec.
+ */
+ union VdpPictureInfo info;
+
+ /**
+ * Allocated size of the bitstream_buffers table.
+ *
+ * Set by libavcodec.
+ */
+ int bitstream_buffers_allocated;
+
+ /**
+ * Useful bitstream buffers in the bitstream buffers table.
+ *
+ * Set by libavcodec.
+ */
+ int bitstream_buffers_used;
+
+ /**
+ * Table of bitstream buffers.
+ * The user is responsible for freeing this buffer using av_freep().
+ *
+ * Set by libavcodec.
+ */
+ VdpBitstreamBuffer *bitstream_buffers;
+} AVVDPAUContext;
+
+
/** @brief The videoSurface is used for rendering. */
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
@@ -74,12 +136,7 @@ struct vdpau_render_state {
int state; ///< Holds FF_VDPAU_STATE_* values.
/** picture parameter information for all supported codecs */
- union VdpPictureInfo {
- VdpPictureInfoH264 h264;
- VdpPictureInfoMPEG1Or2 mpeg;
- VdpPictureInfoVC1 vc1;
- VdpPictureInfoMPEG4Part2 mpeg4;
- } info;
+ union VdpPictureInfo info;
/** Describe size/location of the compressed video data.
Set to 0 when freeing bitstream_buffers. */