]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vdpau.h
configure: Check for -no_weak_imports in ldflags on macOS
[ffmpeg] / libavcodec / vdpau.h
index 24c3b02c02bf850d2f04924e87a6e07ed4637ffd..acd63ccfafb74e31062f75983f7ed07a425262b0 100644 (file)
@@ -50,7 +50,6 @@
  */
 
 #include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
 
 #include "libavutil/attributes.h"
 
@@ -138,7 +137,7 @@ typedef struct AVVDPAUContext {
  * display preemption).
  *
  * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes
- * succesfully.
+ * successfully.
  *
  * @param avctx decoding context whose get_format() callback is invoked
  * @param device VDPAU device handle to use for hardware acceleration
@@ -150,6 +149,26 @@ typedef struct AVVDPAUContext {
 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.
  *
@@ -157,10 +176,13 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
  */
 AVVDPAUContext *av_vdpau_alloc_context(void);
 
+#if FF_API_VDPAU_PROFILE
 /**
  * Get a decoder profile that should be used for initializing a VDPAU decoder.
  * Should be called from the AVCodecContext.get_format() callback.
  *
+ * @deprecated Use av_vdpau_bind_context() instead.
+ *
  * @param avctx the codec context being used for decoding the stream
  * @param profile a pointer into which the result will be written on success.
  *                The contents of profile are undefined if this function returns
@@ -168,7 +190,9 @@ AVVDPAUContext *av_vdpau_alloc_context(void);
  *
  * @return 0 on success (non-negative), a negative AVERROR on failure.
  */
+attribute_deprecated
 int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
+#endif
 
 #if FF_API_CAP_VDPAU
 /** @brief The videoSurface is used for rendering. */