[vlc-commits] avcodec: va: document the returned type of the get() callback

Steve Lhomme git at videolan.org
Tue Jan 8 11:39:01 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan  8 11:16:11 2019 +0100| [86c35d6e19385acfa490a067d7458753e4789132] | committer: Steve Lhomme

avcodec: va: document the returned type of the get() callback

The picture is not being allocated, nor the surface. It's only about getting
the proper surface for lavc.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=86c35d6e19385acfa490a067d7458753e4789132
---

 modules/codec/avcodec/va.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/va.h b/modules/codec/avcodec/va.h
index 178047ad16..f860036493 100644
--- a/modules/codec/avcodec/va.h
+++ b/modules/codec/avcodec/va.h
@@ -36,7 +36,7 @@ struct vlc_va_t {
     module_t *module;
     const char *description;
 
-    int  (*get)(vlc_va_t *, picture_t *pic, uint8_t **data);
+    int  (*get)(vlc_va_t *, picture_t *pic, uint8_t **surface);
 };
 
 /**
@@ -59,20 +59,26 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *,
                      void *p_sys);
 
 /**
- * Allocates a hardware video surface for a libavcodec frame.
+ * Get a hardware video surface for a libavcodec frame.
  * The surface will be used as output for the hardware decoder, and possibly
  * also as a reference frame to decode other surfaces.
  *
- * @param pic pointer to VLC picture being allocated [IN/OUT]
- * @param data pointer to the AVFrame data[0] and data[3] pointers [OUT]
+ * The type of the surface depends on the hardware pixel format:
+ * AV_PIX_FMT_D3D11VA_VLD - ID3D11VideoDecoderOutputView*
+ * AV_PIX_FMT_DXVA2_VLD   - IDirect3DSurface9*
+ * AV_PIX_FMT_VDPAU       - VdpVideoSurface
+ * AV_PIX_FMT_VAAPI_VLD   - VASurfaceID
+ *
+ * @param pic pointer to VLC picture containing the surface [IN/OUT]
+ * @param surface pointer to the AVFrame data[0] and data[3] pointers [OUT]
  *
  * @note This function needs not be reentrant.
  *
  * @return VLC_SUCCESS on success, otherwise an error code.
  */
-static inline int vlc_va_Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
+static inline int vlc_va_Get(vlc_va_t *va, picture_t *pic, uint8_t **surface)
 {
-    return va->get(va, pic, data);
+    return va->get(va, pic, surface);
 }
 
 /**



More information about the vlc-commits mailing list