summaryrefslogtreecommitdiff
path: root/libavcodec/vdpau.h
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi@remlab.net>2014-12-19 19:15:09 +0200
committerAnton Khirnov <anton@khirnov.net>2014-12-25 20:47:49 +0100
commitc220a60f92dde9c7c118fc4deddff5c1f617cda9 (patch)
treecc4d108bb778a803260ff6bbfb7c6658a66558ff /libavcodec/vdpau.h
parent6c99c92a42add7f6a462114d5a4a53c93c551058 (diff)
vdpau: add helper for surface chroma type and size
Since the VDPAU pixel format does not distinguish between different VDPAU video surface chroma types, we need another way to pass this data to the application. Originally VDPAU in libavcodec only supported decoding to 8-bits YUV with 4:2:0 chroma sampling. Correspondingly, applications assumed that libavcodec expected VDP_CHROMA_TYPE_420 video surfaces for output. However some of the new HEVC profiles proposed for addition to VDPAU would require different depth and/or sampling: http://lists.freedesktop.org/archives/vdpau/2014-July/000167.html ...as would lossless AVC profiles: http://lists.freedesktop.org/archives/vdpau/2014-November/000241.html To preserve backward binary compatibility with existing applications, a new av_vdpau_bind_context() flag is introduced in a further change. Signed-off-by: Rémi Denis-Courmont <remi@remlab.net> 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 24c3b02c02..4e5c3518e3 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -151,6 +151,26 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
VdpGetProcAddress *get_proc_address, unsigned flags);
/**
+ * Gets the parameters to create an adequate VDPAU video surface for the codec
+ * context using VDPAU hardware decoding acceleration.
+ *
+ * @note Behavior is undefined if the context was not successfully bound to a
+ * VDPAU device using av_vdpau_bind_context().
+ *
+ * @param avctx the codec context being used for decoding the stream
+ * @param type storage space for the VDPAU video surface chroma type
+ * (or NULL to ignore)
+ * @param width storage space for the VDPAU video surface pixel width
+ * (or NULL to ignore)
+ * @param height storage space for the VDPAU video surface pixel height
+ * (or NULL to ignore)
+ *
+ * @return 0 on success, a negative AVERROR code on failure.
+ */
+int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
+ uint32_t *width, uint32_t *height);
+
+/**
* Allocate an AVVDPAUContext.
*
* @return Newly-allocated AVVDPAUContext or NULL on failure.