This is consistent with struct naming in the rest of Libav.
---
 doc/APIchanges              |    1 +
 libavcodec/avcodec.h        |    2 +-
 libavcodec/vaapi.c          |   18 +++---
 libavcodec/vaapi.h          |  130 ++++++++++++++++++++++++++++++++++++++++++-
 libavcodec/vaapi_h264.c     |    4 +-
 libavcodec/vaapi_internal.h |   12 ++--
 libavcodec/vaapi_mpeg2.c    |    2 +-
 libavcodec/vaapi_mpeg4.c    |    2 +-
 libavcodec/vaapi_vc1.c      |    2 +-
 libavcodec/version.h        |    3 +
 10 files changed, 153 insertions(+), 23 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index efc96f1..66c2590 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,7 @@ API changes, most recent first:
 
 2013-11-xx - xxxxxxx - lavc 55.28.0 - vaapi.h
   Add av_vaapi_get_profile().
+  Rename struct vaapi_context to AVVAAPIContext.
 
 2013-11-xx - xxxxxxx - lavu 52.18.0 - mem.h
   Move av_fast_malloc() and av_fast_realloc() for libavcodec to libavutil.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 4ce6d61..8f85578 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2418,7 +2418,7 @@ typedef struct AVCodecContext {
      * provided by the user. In that case, this holds display-dependent
      * data Libav cannot instantiate itself. Please refer to the
      * Libav HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
+     * is. e.g. for VA API, this is a AVVAAPIContext.
      * - encoding: unused
      * - decoding: Set by user
      */
diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 4c5fb9f..d45c983 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -44,7 +44,7 @@ static void destroy_buffers(VADisplay display, VABufferID 
*buffers, unsigned int
     }
 }
 
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
+int ff_vaapi_render_picture(AVVAAPIContext *vactx, VASurfaceID surface)
 {
     VABufferID va_buffers[3];
     unsigned int n_va_buffers = 0;
@@ -81,7 +81,7 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, 
VASurfaceID surface)
     return 0;
 }
 
-int ff_vaapi_commit_slices(struct vaapi_context *vactx)
+int ff_vaapi_commit_slices(AVVAAPIContext *vactx)
 {
     VABufferID *slice_buf_ids;
     VABufferID slice_param_buf_id, slice_data_buf_id;
@@ -121,7 +121,7 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
     return 0;
 }
 
-static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned int 
size, uint32_t *buf_id)
+static void *alloc_buffer(AVVAAPIContext *vactx, int type, unsigned int size, 
uint32_t *buf_id)
 {
     void *data = NULL;
 
@@ -133,22 +133,22 @@ static void *alloc_buffer(struct vaapi_context *vactx, 
int type, unsigned int si
     return data;
 }
 
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_pic_param(AVVAAPIContext *vactx, unsigned int size)
 {
     return alloc_buffer(vactx, VAPictureParameterBufferType, size, 
&vactx->pic_param_buf_id);
 }
 
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_iq_matrix(AVVAAPIContext *vactx, unsigned int size)
 {
     return alloc_buffer(vactx, VAIQMatrixBufferType, size, 
&vactx->iq_matrix_buf_id);
 }
 
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
+uint8_t *ff_vaapi_alloc_bitplane(AVVAAPIContext *vactx, uint32_t size)
 {
     return alloc_buffer(vactx, VABitPlaneBufferType, size, 
&vactx->bitplane_buf_id);
 }
 
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, 
const uint8_t *buffer, uint32_t size)
+VASliceParameterBufferBase *ff_vaapi_alloc_slice(AVVAAPIContext *vactx, const 
uint8_t *buffer, uint32_t size)
 {
     uint8_t *slice_params;
     VASliceParameterBufferBase *slice_param;
@@ -181,7 +181,7 @@ VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct 
vaapi_context *vactx, co
 
 void ff_vaapi_common_end_frame(AVCodecContext *avctx)
 {
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
 
     av_dlog(avctx, "ff_vaapi_common_end_frame()\n");
 
@@ -199,7 +199,7 @@ void ff_vaapi_common_end_frame(AVCodecContext *avctx)
 
 int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
 {
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     MpegEncContext *s = avctx->priv_data;
     int ret;
 
diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
index fbfe572..f427f65 100644
--- a/libavcodec/vaapi.h
+++ b/libavcodec/vaapi.h
@@ -42,6 +42,132 @@
  * @{
  */
 
+#if FF_API_VAAPI_CONTEXT
+/**
+ * @deprecated use AVVAAPIContext instead
+ */
+struct vaapi_context {
+    /**
+     * Window system dependent data
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *display;
+
+    /**
+     * Configuration ID
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t config_id;
+
+    /**
+     * Context ID (video decode pipeline)
+     *
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    uint32_t context_id;
+
+    /**
+     * VAPictureParameterBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t pic_param_buf_id;
+
+    /**
+     * VAIQMatrixBuffer ID
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t iq_matrix_buf_id;
+
+    /**
+     * VABitPlaneBuffer ID (for VC-1 decoding)
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t bitplane_buf_id;
+
+    /**
+     * Slice parameter/data buffer IDs
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t *slice_buf_ids;
+
+    /**
+     * Number of effective slice buffer IDs to send to the HW
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int n_slice_buf_ids;
+
+    /**
+     * Size of pre-allocated slice_buf_ids
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_buf_ids_alloc;
+
+    /**
+     * Pointer to VASliceParameterBuffers
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    void *slice_params;
+
+    /**
+     * Size of a VASliceParameterBuffer element
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_param_size;
+
+    /**
+     * Size of pre-allocated slice_params
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_params_alloc;
+
+    /**
+     * Number of slices currently filled in
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    unsigned int slice_count;
+
+    /**
+     * Pointer to slice data buffer base
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    const uint8_t *slice_data;
+
+    /**
+     * Current size of slice data
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec
+     */
+    uint32_t slice_data_size;
+} attribute_deprecated;
+#endif
+
 /**
  * This structure is used to share data between the Libav library and
  * the client video application.
@@ -51,7 +177,7 @@
  * function call. In any case, they must be valid prior to calling
  * decoding functions.
  */
-struct vaapi_context {
+typedef struct AVVAAPIContext {
     /**
      * Window system dependent data
      *
@@ -170,7 +296,7 @@ struct vaapi_context {
      * - decoding: Set by libavcodec
      */
     uint32_t slice_data_size;
-};
+} AVVAAPIContext;
 
 /**
  * Get a decoder profile that should be used for initializing a VAAPI config.
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index dfa2ec7..00f3a33 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -224,7 +224,7 @@ static int vaapi_h264_start_frame(AVCodecContext          
*avctx,
                                   av_unused uint32_t       size)
 {
     H264Context * const h = avctx->priv_data;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferH264 *pic_param;
     VAIQMatrixBufferH264 *iq_matrix;
 
@@ -288,7 +288,7 @@ static int vaapi_h264_start_frame(AVCodecContext          
*avctx,
 /** End a hardware decoding based frame. */
 static int vaapi_h264_end_frame(AVCodecContext *avctx)
 {
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     H264Context * const h = avctx->priv_data;
     int ret;
 
diff --git a/libavcodec/vaapi_internal.h b/libavcodec/vaapi_internal.h
index 0292654..517ba11 100644
--- a/libavcodec/vaapi_internal.h
+++ b/libavcodec/vaapi_internal.h
@@ -45,13 +45,13 @@ static inline VASurfaceID ff_vaapi_get_surface_id(Picture 
*pic)
 void ff_vaapi_common_end_frame(AVCodecContext *avctx);
 
 /** Allocate a new picture parameter buffer */
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size);
+void *ff_vaapi_alloc_pic_param(AVVAAPIContext *vactx, unsigned int size);
 
 /** Allocate a new IQ matrix buffer */
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size);
+void *ff_vaapi_alloc_iq_matrix(AVVAAPIContext *vactx, unsigned int size);
 
 /** Allocate a new bit-plane buffer */
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size);
+uint8_t *ff_vaapi_alloc_bitplane(AVVAAPIContext *vactx, uint32_t size);
 
 /**
  * Allocate a new slice descriptor for the input slice.
@@ -61,11 +61,11 @@ uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context 
*vactx, uint32_t size);
  * @param size the size of the slice in bytes
  * @return the newly allocated slice parameter
  */
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, 
const uint8_t *buffer, uint32_t size);
+VASliceParameterBufferBase *ff_vaapi_alloc_slice(AVVAAPIContext *vactx, const 
uint8_t *buffer, uint32_t size);
 
 int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx);
-int ff_vaapi_commit_slices(struct vaapi_context *vactx);
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface);
+int ff_vaapi_commit_slices(AVVAAPIContext *vactx);
+int ff_vaapi_render_picture(AVVAAPIContext *vactx, VASurfaceID surface);
 
 /* @} */
 
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index cf0a4b5..b773765 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -38,7 +38,7 @@ static inline int mpeg2_get_is_frame_start(MpegEncContext *s)
 static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const 
uint8_t *buffer, av_unused uint32_t size)
 {
     struct MpegEncContext * const s = avctx->priv_data;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferMPEG2 *pic_param;
     VAIQMatrixBufferMPEG2 *iq_matrix;
     int i;
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index a0f2966..f4633b1 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -42,7 +42,7 @@ static int mpeg4_get_intra_dc_vlc_thr(MpegEncContext *s)
 static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const 
uint8_t *buffer, av_unused uint32_t size)
 {
     MpegEncContext * const s = avctx->priv_data;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferMPEG4 *pic_param;
     VAIQMatrixBufferMPEG4 *iq_matrix;
     int i;
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index a9ab3c7..e3ba699 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -147,7 +147,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, 
av_unused const uint8_t
 {
     VC1Context * const v = avctx->priv_data;
     MpegEncContext * const s = &v->s;
-    struct vaapi_context * const vactx = avctx->hwaccel_context;
+    AVVAAPIContext * const vactx = avctx->hwaccel_context;
     VAPictureParameterBufferVC1 *pic_param;
 
     av_dlog(avctx, "vaapi_vc1_start_frame()\n");
diff --git a/libavcodec/version.h b/libavcodec/version.h
index c828dc8..b6bf90f 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -118,5 +118,8 @@
 #ifndef FF_API_NEG_LINESIZES
 #define FF_API_NEG_LINESIZES     (LIBAVCODEC_VERSION_MAJOR < 56)
 #endif
+#ifndef FF_API_VAAPI_CONTEXT
+#define FF_API_VAAPI_CONTEXT     (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
 
 #endif /* AVCODEC_VERSION_H */
-- 
1.7.10.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to