From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 3/5] avcodec/hwconfig: Move HWACCEL_CAP_* to a new header
Date: Sat, 5 Aug 2023 12:01:28 +0200
Message-ID: <AS8P250MB0744A22802986FBC31FDD4A28F0EA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1P250MB073780CEBFF0841AC34282908F0BA@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>
Andreas Rheinhardt:
> libavcodec/hwconfig.h currently contains HWACCEL_CAP_* flags
> as well as the definition of AVCodecHWConfigInternal and some
> macros to create them.
>
> The users of these two are nearly disjoint: The flags are used
> by files providing AVHWAccels whereas AVCodecHWConfigInternal
> is used by files providing codecs (for FFCodec.hw_configs).
>
> This patch therefore moves these flags to a new file hwaccel_internal.h.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/hwaccel_internal.h | 29 +++++++++++++++++++++++++++++
> libavcodec/hwconfig.h | 5 -----
> libavcodec/pthread_frame.c | 1 +
> libavcodec/vaapi_av1.c | 3 +--
> libavcodec/vaapi_h264.c | 2 +-
> libavcodec/vaapi_hevc.c | 2 +-
> libavcodec/vaapi_mjpeg.c | 2 +-
> libavcodec/vaapi_mpeg2.c | 2 +-
> libavcodec/vaapi_mpeg4.c | 2 +-
> libavcodec/vaapi_vc1.c | 3 +--
> libavcodec/vaapi_vp8.c | 2 +-
> libavcodec/vaapi_vp9.c | 2 +-
> libavcodec/vdpau_av1.c | 2 +-
> libavcodec/vdpau_h264.c | 2 +-
> libavcodec/vdpau_hevc.c | 2 +-
> libavcodec/vdpau_mpeg12.c | 2 +-
> libavcodec/vdpau_mpeg4.c | 2 +-
> libavcodec/vdpau_vc1.c | 2 +-
> libavcodec/vdpau_vp9.c | 3 +--
> libavcodec/vulkan_decode.h | 2 +-
> 20 files changed, 47 insertions(+), 25 deletions(-)
> create mode 100644 libavcodec/hwaccel_internal.h
>
> diff --git a/libavcodec/hwaccel_internal.h b/libavcodec/hwaccel_internal.h
> new file mode 100644
> index 0000000000..6e6f5c7cf9
> --- /dev/null
> +++ b/libavcodec/hwaccel_internal.h
> @@ -0,0 +1,29 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +/**
> + * Header providing the internals of AVHWAccel.
> + */
> +
> +#ifndef AVCODEC_HWACCEL_INTERNAL_H
> +#define AVCODEC_HWACCEL_INTERNAL_H
> +
> +#define HWACCEL_CAP_ASYNC_SAFE (1 << 0)
> +#define HWACCEL_CAP_THREAD_SAFE (1 << 1)
> +
> +#endif /* AVCODEC_HWACCEL_INTERNAL */
> diff --git a/libavcodec/hwconfig.h b/libavcodec/hwconfig.h
> index e8c6186151..3b19d5edad 100644
> --- a/libavcodec/hwconfig.h
> +++ b/libavcodec/hwconfig.h
> @@ -22,11 +22,6 @@
> #include "avcodec.h"
> #include "hwaccels.h"
>
> -
> -#define HWACCEL_CAP_ASYNC_SAFE (1 << 0)
> -#define HWACCEL_CAP_THREAD_SAFE (1 << 1)
> -
> -
> typedef struct AVCodecHWConfigInternal {
> /**
> * This is the structure which will be returned to the user by
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index bc305f561f..c14010d803 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -31,6 +31,7 @@
> #include "avcodec_internal.h"
> #include "codec_internal.h"
> #include "decode.h"
> +#include "hwaccel_internal.h"
> #include "hwconfig.h"
> #include "internal.h"
> #include "pthread_internal.h"
> diff --git a/libavcodec/vaapi_av1.c b/libavcodec/vaapi_av1.c
> index d0339b2705..67ea6af697 100644
> --- a/libavcodec/vaapi_av1.c
> +++ b/libavcodec/vaapi_av1.c
> @@ -19,8 +19,7 @@
> */
>
> #include "libavutil/frame.h"
> -#include "libavutil/pixdesc.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
> #include "internal.h"
> #include "av1dec.h"
> diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> index 9332aa6f31..e7f8e920b2 100644
> --- a/libavcodec/vaapi_h264.c
> +++ b/libavcodec/vaapi_h264.c
> @@ -22,7 +22,7 @@
>
> #include "h264dec.h"
> #include "h264_ps.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
>
> /**
> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
> index 8b12484fff..87584d1edb 100644
> --- a/libavcodec/vaapi_hevc.c
> +++ b/libavcodec/vaapi_hevc.c
> @@ -25,7 +25,7 @@
>
> #include "avcodec.h"
> #include "hevcdec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
> #include "vaapi_hevc.h"
> #include "h265_profile_level.h"
> diff --git a/libavcodec/vaapi_mjpeg.c b/libavcodec/vaapi_mjpeg.c
> index 81582114b6..1947540ea1 100644
> --- a/libavcodec/vaapi_mjpeg.c
> +++ b/libavcodec/vaapi_mjpeg.c
> @@ -19,7 +19,7 @@
> #include <va/va.h>
> #include <va/va_dec_jpeg.h>
>
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
> #include "mjpegdec.h"
>
> diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
> index 5e2b889137..09636e0d26 100644
> --- a/libavcodec/vaapi_mpeg2.c
> +++ b/libavcodec/vaapi_mpeg2.c
> @@ -20,7 +20,7 @@
> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> */
>
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpegutils.h"
> #include "mpegvideo.h"
> #include "mpegvideodec.h"
> diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
> index 4e74e0382b..ff31ca4d92 100644
> --- a/libavcodec/vaapi_mpeg4.c
> +++ b/libavcodec/vaapi_mpeg4.c
> @@ -23,7 +23,7 @@
> #include "config_components.h"
>
> #include "h263.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpeg4videodec.h"
> #include "mpegvideo.h"
> #include "mpegvideodec.h"
> diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
> index fb2132e814..a179e4df11 100644
> --- a/libavcodec/vaapi_vc1.c
> +++ b/libavcodec/vaapi_vc1.c
> @@ -22,11 +22,10 @@
>
> #include "config_components.h"
>
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpegvideodec.h"
> #include "vaapi_decode.h"
> #include "vc1.h"
> -#include "vc1data.h"
>
> /** Translate FFmpeg MV modes to VA API */
> static int get_VAMvModeVC1(enum MVModes mv_mode)
> diff --git a/libavcodec/vaapi_vp8.c b/libavcodec/vaapi_vp8.c
> index 5b18bf8f34..f833133f9f 100644
> --- a/libavcodec/vaapi_vp8.c
> +++ b/libavcodec/vaapi_vp8.c
> @@ -19,7 +19,7 @@
> #include <va/va.h>
> #include <va/va_dec_vp8.h>
>
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
> #include "vp8.h"
>
> diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c
> index 776382f683..cf735bb7b2 100644
> --- a/libavcodec/vaapi_vp9.c
> +++ b/libavcodec/vaapi_vp9.c
> @@ -22,7 +22,7 @@
>
> #include "libavutil/pixdesc.h"
>
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vaapi_decode.h"
> #include "vp9shared.h"
>
> diff --git a/libavcodec/vdpau_av1.c b/libavcodec/vdpau_av1.c
> index 3c3c8e61d1..557cbcebd7 100644
> --- a/libavcodec/vdpau_av1.c
> +++ b/libavcodec/vdpau_av1.c
> @@ -25,7 +25,7 @@
> #include "avcodec.h"
> #include "internal.h"
> #include "av1dec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
>
> diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
> index 525e208495..1c5622662b 100644
> --- a/libavcodec/vdpau_h264.c
> +++ b/libavcodec/vdpau_h264.c
> @@ -26,7 +26,7 @@
> #include "avcodec.h"
> #include "h264dec.h"
> #include "h264_ps.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpegutils.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
> diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c
> index 2669040f78..fb1b71abdc 100644
> --- a/libavcodec/vdpau_hevc.c
> +++ b/libavcodec/vdpau_hevc.c
> @@ -25,7 +25,7 @@
> #include "avcodec.h"
> #include "hevc_data.h"
> #include "hevcdec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
> #include "h265_profile_level.h"
> diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
> index 79007aa1a8..d7223cdb4a 100644
> --- a/libavcodec/vdpau_mpeg12.c
> +++ b/libavcodec/vdpau_mpeg12.c
> @@ -26,7 +26,7 @@
> #include <vdpau/vdpau.h>
>
> #include "avcodec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpegvideo.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
> diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c
> index 1211b1df2c..ce6d421196 100644
> --- a/libavcodec/vdpau_mpeg4.c
> +++ b/libavcodec/vdpau_mpeg4.c
> @@ -24,7 +24,7 @@
> #include <vdpau/vdpau.h>
>
> #include "avcodec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "mpeg4videodec.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
> diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
> index 00b33f420b..851a89d7cf 100644
> --- a/libavcodec/vdpau_vc1.c
> +++ b/libavcodec/vdpau_vc1.c
> @@ -26,7 +26,7 @@
> #include <vdpau/vdpau.h>
>
> #include "avcodec.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "vc1.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
> diff --git a/libavcodec/vdpau_vp9.c b/libavcodec/vdpau_vp9.c
> index 49fe18189b..1e6a1fc007 100644
> --- a/libavcodec/vdpau_vp9.c
> +++ b/libavcodec/vdpau_vp9.c
> @@ -23,9 +23,8 @@
> #include <vdpau/vdpau.h>
> #include "libavutil/pixdesc.h"
> #include "avcodec.h"
> -#include "vp9data.h"
> +#include "hwaccel_internal.h"
> #include "vp9dec.h"
> -#include "hwconfig.h"
> #include "vdpau.h"
> #include "vdpau_internal.h"
>
> diff --git a/libavcodec/vulkan_decode.h b/libavcodec/vulkan_decode.h
> index 1b4e1cc712..0aaa2e2de0 100644
> --- a/libavcodec/vulkan_decode.h
> +++ b/libavcodec/vulkan_decode.h
> @@ -20,7 +20,7 @@
> #define AVCODEC_VULKAN_DECODE_H
>
> #include "decode.h"
> -#include "hwconfig.h"
> +#include "hwaccel_internal.h"
> #include "internal.h"
>
> #include "vulkan_video.h"
Will apply the hwaccel_internal.h patches in two days 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".
next prev parent reply other threads:[~2023-08-05 10:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 6:38 [FFmpeg-devel] [PATCH 1/5] avcodec/nvdec_(mjpeg|vp8): Constify AVHWAccels Andreas Rheinhardt
2023-08-02 6:43 ` [FFmpeg-devel] [PATCH 2/5] avcodec/error_resilience, mpeg12dec: Remove always-true checks Andreas Rheinhardt
2023-08-02 6:43 ` [FFmpeg-devel] [PATCH 3/5] avcodec/hwconfig: Move HWACCEL_CAP_* to a new header Andreas Rheinhardt
2023-08-05 10:01 ` Andreas Rheinhardt [this message]
2023-08-02 6:43 ` [FFmpeg-devel] [PATCH 4/5] avcodec/decode: Extend ff_hwaccel_frame_priv_alloc()'s task Andreas Rheinhardt
2023-08-02 6:43 ` [FFmpeg-devel] [PATCH 5/5] avcodec/avcodec: Add FFHWAccel, hide internals of AVHWAccel Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 06/15] avcodec/avcodec: Remove unnecessary forward declaration Andreas Rheinhardt
2023-08-04 10:06 ` Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 07/15] avdevice/pulse_audio_common: Avoid inclusion of avcodec.h Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 08/15] avcodec/tak: Use void* instead of AVCodecContext* for logcontext Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 09/15] avcodec/h264dec: Move inline functions only used by CABAC/CAVLC code Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 10/15] avformat/av1dec: Remove avcodec.h inclusion Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 11/15] avformat/evcdec: Remove unused headers Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 12/15] avformat/internal: Use forward declaration for AVCodecDescriptor Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 13/15] avcodec/dirac: Include used headers directly Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 14/15] avformat/rawdec: Don't include avcodec.h Andreas Rheinhardt
2023-08-02 10:58 ` [FFmpeg-devel] [PATCH 15/15] avcodec/h264_metadata_bsf: Improve included headers Andreas Rheinhardt
2023-08-02 12:18 ` [FFmpeg-devel] [PATCH 1/5] avcodec/nvdec_(mjpeg|vp8): Constify AVHWAccels Timo Rothenpieler
2023-08-02 12:54 ` [FFmpeg-devel] [PATCH 16/19] avcodec/internal: Move FF_MAX_EXTRADATA_SIZE to its only user Andreas Rheinhardt
2023-08-02 12:54 ` [FFmpeg-devel] [PATCH 17/19] avcodec/utils: Move ff_color_frame() " Andreas Rheinhardt
2023-08-02 12:54 ` [FFmpeg-devel] [PATCH 18/19] avcodec/utils: Move ff_int_from_list_or_default() " Andreas Rheinhardt
2023-08-02 12:54 ` [FFmpeg-devel] [PATCH 19/19] avcodec/svq1enc: Remove unnecessary cast Andreas Rheinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB0744A22802986FBC31FDD4A28F0EA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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