The allocators have been superseded by av_vdpau_bind_context(). The latter have only been added "to allow multiple forks to add fields to the structure without breaking ABI" [1], but libav is no more, so this is not needed any longer. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2013-August/146954.html
Unified · Split
| @@ -2,6 +2,12 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | API changes, most recent first: |
| 4 | 4 | |
| 5 | +2024-03-08 - xxxxxxxxxx - lavc 61.0.100 - vdpau.h | |
| 6 | + Deprecate av_vdpau_alloc_context(), av_alloc_vdpaucontext(), | |
| 7 | + av_vdpau_hwaccel_get_render2() and av_vdpau_hwaccel_set_render2(). | |
| 8 | + The former are superseded by av_vdpau_bind_context(), the latter | |
| 9 | + are unneeded as the relevant field is public and can be accessed directly. | |
| 10 | + | |
| 5 | 11 | 2024-03-06 - xxxxxxxxxx - lavf 60.25.100 - avformat.h |
| 6 | 12 | Deprecate av_fmt_ctx_get_duration_estimation_method(). |
| 7 | 13 | The relevant field is public and needs no getter to access. |
| @@ -64,15 +64,19 @@ static int vdpau_error(VdpStatus status) · 63 unmodified lines | ||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | +#if FF_API_VDPAU_ALLOC_GET_SET | |
| 67 | 68 | AVVDPAUContext *av_alloc_vdpaucontext(void) |
| 68 | 69 | { |
| 70 | +FF_DISABLE_DEPRECATION_WARNINGS | |
| 69 | 71 | return av_vdpau_alloc_context(); |
| 72 | +FF_ENABLE_DEPRECATION_WARNINGS | |
| 70 | 73 | } |
| 71 | 74 | |
| 72 | 75 | #define MAKE_ACCESSORS(str, name, type, field) \ |
| 73 | 76 | type av_##name##_get_##field(const str *s) { return s->field; } \ |
| 74 | 77 | void av_##name##_set_##field(str *s, type v) { s->field = v; } |
| 75 | 78 | MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2) |
| 79 | +#endif | |
| 76 | 80 | |
| 77 | 81 | int av_vdpau_get_surface_parameters(AVCodecContext *avctx, |
| 78 | 82 | VdpChromaType *type, |
| @@ -400,10 +404,12 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, · 321 unmodified lines | ||
| 400 | 404 | return 0; |
| 401 | 405 | } |
| 402 | 406 | |
| 407 | +#if FF_API_VDPAU_ALLOC_GET_SET | |
| 403 | 408 | AVVDPAUContext *av_vdpau_alloc_context(void) |
| 404 | 409 | { |
| 405 | 410 | return av_mallocz(sizeof(VDPAUHWContext)); |
| 406 | 411 | } |
| 412 | +#endif | |
| 407 | 413 | |
| 408 | 414 | int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, |
| 409 | 415 | VdpGetProcAddress *get_proc, unsigned flags) |
| @@ -66,16 +66,14 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, · 65 unmodified lines | ||
| 66 | 66 | /** |
| 67 | 67 | * This structure is used to share data between the libavcodec library and |
| 68 | 68 | * the client video application. |
| 69 | − * The user shall allocate the structure via the av_alloc_vdpau_hwaccel | |
| 70 | − * function and make it available as | |
| 71 | − * AVCodecContext.hwaccel_context. Members can be set by the user once | |
| 69 | + * This structure will be allocated and stored in AVCodecContext.hwaccel_context | |
| 70 | + * by av_vdpau_bind_context(). Members can be set by the user once | |
| 72 | 71 | * during initialization or through each AVCodecContext.get_buffer() |
| 73 | 72 | * function call. In any case, they must be valid prior to calling |
| 74 | 73 | * decoding functions. |
| 75 | 74 | * |
| 76 | 75 | * The size of this structure is not a part of the public ABI and must not |
| 77 | − * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an | |
| 78 | − * AVVDPAUContext. | |
| 76 | + * be used outside of libavcodec. | |
| 79 | 77 | */ |
| 80 | 78 | typedef struct AVVDPAUContext { |
| 81 | 79 | /** |
| @@ -95,15 +93,27 @@ typedef struct AVVDPAUContext { · 13 unmodified lines | ||
| 95 | 93 | AVVDPAU_Render2 render2; |
| 96 | 94 | } AVVDPAUContext; |
| 97 | 95 | |
| 96 | +#if FF_API_VDPAU_ALLOC_GET_SET | |
| 98 | 97 | /** |
| 99 | 98 | * @brief allocation function for AVVDPAUContext |
| 100 | 99 | * |
| 101 | 100 | * Allows extending the struct without breaking API/ABI |
| 101 | + * @deprecated use av_vdpau_bind_context() instead | |
| 102 | 102 | */ |
| 103 | +attribute_deprecated | |
| 103 | 104 | AVVDPAUContext *av_alloc_vdpaucontext(void); |
| 104 | 105 | |
| 106 | +/** | |
| 107 | + * @deprecated render2 is public and can be accessed directly | |
| 108 | + */ | |
| 109 | +attribute_deprecated | |
| 105 | 110 | AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); |
| 111 | +/** | |
| 112 | + * @deprecated render2 is public and can be accessed directly | |
| 113 | + */ | |
| 114 | +attribute_deprecated | |
| 106 | 115 | void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); |
| 116 | +#endif | |
| 107 | 117 | |
| 108 | 118 | /** |
| 109 | 119 | * Associate a VDPAU device with a codec context for hardware acceleration. |
| @@ -145,12 +155,16 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, · 35 unmodified lines | ||
| 145 | 155 | int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, |
| 146 | 156 | uint32_t *width, uint32_t *height); |
| 147 | 157 | |
| 158 | +#if FF_API_VDPAU_ALLOC_GET_SET | |
| 148 | 159 | /** |
| 149 | 160 | * Allocate an AVVDPAUContext. |
| 150 | 161 | * |
| 151 | 162 | * @return Newly-allocated AVVDPAUContext or NULL on failure. |
| 163 | + * @deprecated use av_vdpau_bind_context() instead | |
| 152 | 164 | */ |
| 165 | +attribute_deprecated | |
| 153 | 166 | AVVDPAUContext *av_vdpau_alloc_context(void); |
| 167 | +#endif | |
| 154 | 168 | |
| 155 | 169 | /** @} */ |
| 156 | 170 | |
| @@ -46,5 +46,6 @@ · 45 unmodified lines | ||
| 46 | 46 | #define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) |
| 47 | 47 | #define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62) |
| 48 | 48 | #define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62) |
| 49 | +#define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62) | |
| 49 | 50 | |
| 50 | 51 | #endif /* AVCODEC_VERSION_MAJOR_H */ |