* [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment
@ 2024-03-05 16:32 Andreas Rheinhardt
2024-03-05 16:32 ` [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter Andreas Rheinhardt
2024-03-07 8:12 ` [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
0 siblings, 2 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-03-05 16:32 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in b773a8d8c1dfe4cfc6eabf509e26ab011270b9ed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vdpau.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 2b9b78d8d0..c56ee1f44c 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -34,9 +34,6 @@
#include "vdpau.h"
#include "vdpau_internal.h"
-// XXX: at the time of adding this ifdefery, av_assert* wasn't use outside.
-// When dropping it, make sure other av_assert* were not added since then.
-
/**
* @addtogroup VDPAU_Decoding
*
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter
2024-03-05 16:32 [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
@ 2024-03-05 16:32 ` Andreas Rheinhardt
2024-03-05 16:34 ` Andreas Rheinhardt
2024-03-07 8:12 ` [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
1 sibling, 1 reply; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-03-05 16:32 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
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
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
doc/APIchanges | 6 ++++++
libavcodec/vdpau.c | 6 ++++++
libavcodec/vdpau.h | 24 +++++++++++++++++++-----
libavcodec/version_major.h | 1 +
4 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 523945e511..16098fce90 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,12 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
+2024-03-05 - xxxxxxxxxx - lavc 60.xx.100 - vdpau.h
+ Deprecate av_vdpau_alloc_context(), av_alloc_vdpaucontext(),
+ av_vdpau_hwaccel_get_render2() and av_vdpau_hwaccel_set_render2().
+ The former are superseded by av_vdpau_bind_context(), the latter
+ are unneeded as the relevant field is public and can be accessed directly.
+
2024-03-05 - xxxxxxxxxx - lavf 60.24.100 - avformat.h
Add avformat_stream_group_name().
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index c56ee1f44c..538c57f9e8 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -64,15 +64,19 @@ static int vdpau_error(VdpStatus status)
}
}
+#if FF_API_VDPAU_ALLOC_GET_SET
AVVDPAUContext *av_alloc_vdpaucontext(void)
{
+FF_DISABLE_DEPRECATION_WARNINGS
return av_vdpau_alloc_context();
+FF_ENABLE_DEPRECATION_WARNINGS
}
#define MAKE_ACCESSORS(str, name, type, field) \
type av_##name##_get_##field(const str *s) { return s->field; } \
void av_##name##_set_##field(str *s, type v) { s->field = v; }
MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
+#endif
int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
VdpChromaType *type,
@@ -400,10 +404,12 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
return 0;
}
+#if FF_API_VDPAU_ALLOC_GET_SET
AVVDPAUContext *av_vdpau_alloc_context(void)
{
return av_mallocz(sizeof(VDPAUHWContext));
}
+#endif
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
VdpGetProcAddress *get_proc, unsigned flags)
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 35c4b1096b..8021c25761 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -66,16 +66,14 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
/**
* This structure is used to share data between the libavcodec library and
* the client video application.
- * The user shall allocate the structure via the av_alloc_vdpau_hwaccel
- * function and make it available as
- * AVCodecContext.hwaccel_context. Members can be set by the user once
+ * This structure will be allocated and stored in AVCodecContext.hwaccel_context
+ * by av_vdpau_bind_context(). Members can be set by the user once
* during initialization or through each AVCodecContext.get_buffer()
* function call. In any case, they must be valid prior to calling
* decoding functions.
*
* The size of this structure is not a part of the public ABI and must not
- * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
- * AVVDPAUContext.
+ * be used outside of libavcodec.
*/
typedef struct AVVDPAUContext {
/**
@@ -95,15 +93,27 @@ typedef struct AVVDPAUContext {
AVVDPAU_Render2 render2;
} AVVDPAUContext;
+#if FF_API_VDPAU_ALLOC_GET_SET
/**
* @brief allocation function for AVVDPAUContext
*
* Allows extending the struct without breaking API/ABI
+ * @deprecated use av_vdpau_bind_context() instead
*/
+attribute_deprecated
AVVDPAUContext *av_alloc_vdpaucontext(void);
+/**
+ * @deprecated render2 is public and can be accessed directly
+ */
+attribute_deprecated
AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
+/**
+ * @deprecated render2 is public and can be accessed directly
+ */
+attribute_deprecated
void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
+#endif
/**
* Associate a VDPAU device with a codec context for hardware acceleration.
@@ -145,12 +155,16 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
uint32_t *width, uint32_t *height);
+#if FF_API_VDPAU_ALLOC_GET_SET
/**
* Allocate an AVVDPAUContext.
*
* @return Newly-allocated AVVDPAUContext or NULL on failure.
+ * @deprecated use av_vdpau_bind_context() instead
*/
+attribute_deprecated
AVVDPAUContext *av_vdpau_alloc_context(void);
+#endif
/** @} */
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index 161442df95..9e75303ed6 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -54,6 +54,7 @@
#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
#define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62)
#define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62)
+#define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62)
// reminder to remove CrystalHD decoders on next major bump
#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter
2024-03-05 16:32 ` [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter Andreas Rheinhardt
@ 2024-03-05 16:34 ` Andreas Rheinhardt
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-03-05 16:34 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> 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
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> doc/APIchanges | 6 ++++++
> libavcodec/vdpau.c | 6 ++++++
> libavcodec/vdpau.h | 24 +++++++++++++++++++-----
> libavcodec/version_major.h | 1 +
> 4 files changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 523945e511..16098fce90 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,12 @@ The last version increases of all libraries were on 2023-02-09
>
> API changes, most recent first:
>
> +2024-03-05 - xxxxxxxxxx - lavc 60.xx.100 - vdpau.h
> + Deprecate av_vdpau_alloc_context(), av_alloc_vdpaucontext(),
> + av_vdpau_hwaccel_get_render2() and av_vdpau_hwaccel_set_render2().
> + The former are superseded by av_vdpau_bind_context(), the latter
> + are unneeded as the relevant field is public and can be accessed directly.
> +
> 2024-03-05 - xxxxxxxxxx - lavf 60.24.100 - avformat.h
> Add avformat_stream_group_name().
>
> diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
> index c56ee1f44c..538c57f9e8 100644
> --- a/libavcodec/vdpau.c
> +++ b/libavcodec/vdpau.c
> @@ -64,15 +64,19 @@ static int vdpau_error(VdpStatus status)
> }
> }
>
> +#if FF_API_VDPAU_ALLOC_GET_SET
> AVVDPAUContext *av_alloc_vdpaucontext(void)
> {
> +FF_DISABLE_DEPRECATION_WARNINGS
> return av_vdpau_alloc_context();
> +FF_ENABLE_DEPRECATION_WARNINGS
> }
>
> #define MAKE_ACCESSORS(str, name, type, field) \
> type av_##name##_get_##field(const str *s) { return s->field; } \
> void av_##name##_set_##field(str *s, type v) { s->field = v; }
> MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2)
> +#endif
>
> int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
> VdpChromaType *type,
> @@ -400,10 +404,12 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
> return 0;
> }
>
> +#if FF_API_VDPAU_ALLOC_GET_SET
> AVVDPAUContext *av_vdpau_alloc_context(void)
> {
> return av_mallocz(sizeof(VDPAUHWContext));
> }
> +#endif
>
> int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
> VdpGetProcAddress *get_proc, unsigned flags)
> diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
> index 35c4b1096b..8021c25761 100644
> --- a/libavcodec/vdpau.h
> +++ b/libavcodec/vdpau.h
> @@ -66,16 +66,14 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
> /**
> * This structure is used to share data between the libavcodec library and
> * the client video application.
> - * The user shall allocate the structure via the av_alloc_vdpau_hwaccel
> - * function and make it available as
> - * AVCodecContext.hwaccel_context. Members can be set by the user once
> + * This structure will be allocated and stored in AVCodecContext.hwaccel_context
> + * by av_vdpau_bind_context(). Members can be set by the user once
> * during initialization or through each AVCodecContext.get_buffer()
> * function call. In any case, they must be valid prior to calling
> * decoding functions.
> *
> * The size of this structure is not a part of the public ABI and must not
> - * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
> - * AVVDPAUContext.
> + * be used outside of libavcodec.
> */
> typedef struct AVVDPAUContext {
> /**
> @@ -95,15 +93,27 @@ typedef struct AVVDPAUContext {
> AVVDPAU_Render2 render2;
> } AVVDPAUContext;
>
> +#if FF_API_VDPAU_ALLOC_GET_SET
> /**
> * @brief allocation function for AVVDPAUContext
> *
> * Allows extending the struct without breaking API/ABI
> + * @deprecated use av_vdpau_bind_context() instead
> */
> +attribute_deprecated
> AVVDPAUContext *av_alloc_vdpaucontext(void);
>
> +/**
> + * @deprecated render2 is public and can be accessed directly
> + */
> +attribute_deprecated
> AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
> +/**
> + * @deprecated render2 is public and can be accessed directly
> + */
> +attribute_deprecated
> void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
> +#endif
>
> /**
> * Associate a VDPAU device with a codec context for hardware acceleration.
> @@ -145,12 +155,16 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
> int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
> uint32_t *width, uint32_t *height);
>
> +#if FF_API_VDPAU_ALLOC_GET_SET
> /**
> * Allocate an AVVDPAUContext.
> *
> * @return Newly-allocated AVVDPAUContext or NULL on failure.
> + * @deprecated use av_vdpau_bind_context() instead
> */
> +attribute_deprecated
> AVVDPAUContext *av_vdpau_alloc_context(void);
> +#endif
>
> /** @} */
>
> diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
> index 161442df95..9e75303ed6 100644
> --- a/libavcodec/version_major.h
> +++ b/libavcodec/version_major.h
> @@ -54,6 +54,7 @@
> #define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
> #define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62)
> #define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62)
> +#define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62)
>
> // reminder to remove CrystalHD decoders on next major bump
> #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
Fixed the typo in the commit title locally.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment
2024-03-05 16:32 [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
2024-03-05 16:32 ` [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter Andreas Rheinhardt
@ 2024-03-07 8:12 ` Andreas Rheinhardt
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-03-07 8:12 UTC (permalink / raw)
To: ffmpeg-devel
Andreas Rheinhardt:
> Forgotten in b773a8d8c1dfe4cfc6eabf509e26ab011270b9ed.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/vdpau.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
> index 2b9b78d8d0..c56ee1f44c 100644
> --- a/libavcodec/vdpau.c
> +++ b/libavcodec/vdpau.c
> @@ -34,9 +34,6 @@
> #include "vdpau.h"
> #include "vdpau_internal.h"
>
> -// XXX: at the time of adding this ifdefery, av_assert* wasn't use outside.
> -// When dropping it, make sure other av_assert* were not added since then.
> -
> /**
> * @addtogroup VDPAU_Decoding
> *
Will apply this patchset tomorrow unless there are objections.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-07 8:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-05 16:32 [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
2024-03-05 16:32 ` [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter Andreas Rheinhardt
2024-03-05 16:34 ` Andreas Rheinhardt
2024-03-07 8:12 ` [FFmpeg-devel] [PATCH 1/2] avcodec/vdpau: Remove outdated comment Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git