[FFmpeg-devel] [PATCH] ffmpeg: remove ffmpeg_videotoolbox

James Almer jamrial at gmail.com
Sun Nov 14 16:51:06 EET 2021


On 11/13/2021 6:41 PM, rcombs wrote:
> This was almost completely redundant. The only functionality that's no longer
> available after this removal is the videotoolbox_pixfmt arg, which has been
> obsolete for several years.
> ---
>   fftools/Makefile              |   4 -
>   fftools/ffmpeg.c              |  26 -----
>   fftools/ffmpeg.h              |  10 --
>   fftools/ffmpeg_opt.c          |  28 +----
>   fftools/ffmpeg_videotoolbox.c | 200 ----------------------------------
>   5 files changed, 4 insertions(+), 264 deletions(-)
>   delete mode 100644 fftools/ffmpeg_videotoolbox.c
> 
> diff --git a/fftools/Makefile b/fftools/Makefile
> index 5234932ab0..da420786eb 100644
> --- a/fftools/Makefile
> +++ b/fftools/Makefile
> @@ -10,10 +10,6 @@ ALLAVPROGS   = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
>   ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
>   
>   OBJS-ffmpeg                        += fftools/ffmpeg_opt.o fftools/ffmpeg_filter.o fftools/ffmpeg_hw.o
> -ifndef CONFIG_VIDEOTOOLBOX
> -OBJS-ffmpeg-$(CONFIG_VDA)          += fftools/ffmpeg_videotoolbox.o
> -endif
> -OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += fftools/ffmpeg_videotoolbox.o
>   
>   define DOFFTOOL
>   OBJS-$(1) += fftools/cmdutils.o fftools/$(1).o $(OBJS-$(1)-yes)
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 9d4f9d7a2b..358256e589 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -2896,32 +2896,6 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
>                   }
>                   continue;
>               }
> -        } else {

You need to keep this else to do a continue; in order to not break the 
loop, but while at it you could change the if (config) check above with 
if (!config) continue; then reindent the rest of the code.

> -            const HWAccel *hwaccel = NULL;
> -            int i;
> -            for (i = 0; hwaccels[i].name; i++) {
> -                if (hwaccels[i].pix_fmt == *p) {
> -                    hwaccel = &hwaccels[i];
> -                    break;
> -                }
> -            }
> -            if (!hwaccel) {
> -                // No hwaccel supporting this pixfmt.
> -                continue;
> -            }
> -            if (hwaccel->id != ist->hwaccel_id) {
> -                // Does not match requested hwaccel.
> -                continue;
> -            }
> -
> -            ret = hwaccel->init(s);
> -            if (ret < 0) {
> -                av_log(NULL, AV_LOG_FATAL,
> -                       "%s hwaccel requested for input stream #%d:%d, "
> -                       "but cannot be initialized.\n", hwaccel->name,
> -                       ist->file_index, ist->st->index);
> -                return AV_PIX_FMT_NONE;
> -            }
>           }
>   
>           if (ist->hw_frames_ctx) {


More information about the ffmpeg-devel mailing list