From patchwork Thu Jan 25 13:43:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 45818 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8888:b0:199:de12:6fa6 with SMTP id d8csp81277pzf; Thu, 25 Jan 2024 05:46:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IExISFcix2pO417xuNzSr7MwErHYfl6tOqjuZ4fmt25I/NZ+9LgyuptRpK5q9aUxCphT3Xi X-Received: by 2002:a19:8c5d:0:b0:510:1b6c:3f1d with SMTP id i29-20020a198c5d000000b005101b6c3f1dmr1147042lfj.6.1706190365965; Thu, 25 Jan 2024 05:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706190365; cv=none; d=google.com; s=arc-20160816; b=0Yp1s9YZPffDLqVFx9kgEOSJuJeC4CtAQnS3NUNpjFBJMNJ1qgeXlMkZC4v3xmr6Vi XxlN3k6WEuAlimxg6ggns4pVhk9YdZ88Yf2uJmKYK16M/vu4voQ0KrsDnFe19+JeKoVa kjWfHGFf/BQqjqSAONTCeDG02wSoi0rliJNfayyb7rtu/rEEoSDZ94HuGOCmbrADfJfb j459azIQQTdF67c5y4QR3At+/0BogIp0os5oHV8VwPBkzIZUql5q022lEGTIqNm2bQTz nSQFZG6xm/M82SHtXx7/IZc79njkvlyjZ4ImvZyHAUhyvf3QCnkAto6rcc/KFE7+lVi6 PkBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=fu2vQMgFeeu1vSoK4PXt1KhN75qtknPwUe5SBrGveKI=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=bgR8j0/Pj1AF4LMTnrlA/bQXAD4Z2Nvhi4W3diXpycwr2gcYjX0z2a3JYfKPVRs5qC UwjYhIBDCtKQMocgZmfGeL3HhbwML8Upu100NL+f4KnIOpG+4i+VQ6CH1pkSKzk0273/ E9S035cwYSpTYrTPBM2d/uLS71tV0gGOMaKLQPn+6iLUymsgvl9E0K+gYXh/LxH6uffj H2YJCWV9U+OHIt5WdafFIYvhtQdl5WZhjbZIHy1LjSrLn8zTFBCTct6awt2eDkhP1Ebc 3Occrfdbnik7SAhKOqNrHxqMzCudoW7PiaXmQ6raeovymSTF1PiQsossY7/GiZfFnMie nCvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=YeuOcCJ7; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u25-20020a170906c41900b00a310d230ca4si932731ejz.902.2024.01.25.05.46.05; Thu, 25 Jan 2024 05:46:05 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=YeuOcCJ7; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8618368D14E; Thu, 25 Jan 2024 15:44:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B5E468D119 for ; Thu, 25 Jan 2024 15:44:40 +0200 (EET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d50d0c98c3so6200935ad.1 for ; Thu, 25 Jan 2024 05:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706190278; x=1706795078; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=MjitALp9XWyfEd6jOA5rNKI/Q80R2V3qc8z+daJ2g8M=; b=YeuOcCJ78niQ6uaMoMxf6g3LaZPh/EVM9+XdQesN3u3BT6p+6EtMs+0VVFH8tzDDlP spsrusv3Mrcun+B0c5bTArFNtR8yQztbZGl/lmez0geQOFftVR8h+8pILmk+E6Q4AJuM BpVRCuN0AP1eu1HZRRPoGiO77TUkQPpBOMPD/tyYoXX18Nay1V3JXJ9fSWII9rx3UcY/ xA/HUyI9raQ6PyDiva15MJOAKOpWir6DL+JXkMiPSHMoohr37CXLhHu1x0JtJ9YsSoUk OEv4gHwOAm5HmRVX69C1mppGBVLJVasQWdTC86PRAGI9Vxzf1CeBWfmFqC4+cFf8k9pH 1fgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706190278; x=1706795078; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MjitALp9XWyfEd6jOA5rNKI/Q80R2V3qc8z+daJ2g8M=; b=CV++quHePSfln93wpt44qTs+VzFet+nhpAKCho8/sePiFNO27KCASkPmgZsglMoKd/ 5o5JYxN6GyHVrxQZrhdR3wA3Q/tmWpOA2etlkOEedAwlkd25SYQYUDZeDPqtbnSu3p6p AzlH4J8juD8mOyzGwE/BKAfXtbzyQAOUwijNpLqmJTA0trox5D5DCsgB1MJu2ghI05+S /2dwTaqlccLxjGLMLaRuZRD+SI3zylrwZMCU67Lwfz9kXOpiAxxXi42lJGsQsBsO0Pvi C526Jt9Y2NfbP8K/S0GEpikIWnbgeLLgrKByZaIuQGNhiIXwXPZrpPBOGzkHfo+uOMez EpFQ== X-Gm-Message-State: AOJu0Yzv9BHHPNubJlsf2qSmDYuHYSEce6fKBwT5FmYLWp7PKpmbhdDq v8qiiCBomENsoWPhgiYXTL4hhJouMn3dKlUV9eoOkmFHyUaymSTTwXf4ki7M X-Received: by 2002:a17:903:452:b0:1d0:af63:2403 with SMTP id iw18-20020a170903045200b001d0af632403mr1139118plb.50.1706190278474; Thu, 25 Jan 2024 05:44:38 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id k17-20020a170902f29100b001d707a14316sm11785146plc.75.2024.01.25.05.44.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:44:38 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Jan 2024 10:43:29 -0300 Message-ID: <20240125134425.374-7-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240125134425.374-1-jamrial@gmail.com> References: <20240125134425.374-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/24] avcodec: remove deprecated FF_API_VT_HWACCEL_CONTEXT X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BCQE5QuWjJKD Signed-off-by: James Almer --- libavcodec/version_major.h | 1 - libavcodec/videotoolbox.c | 31 --------------------- libavcodec/videotoolbox.h | 56 -------------------------------------- 3 files changed, 88 deletions(-) diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h index 88cc975713..79c6f6dd05 100644 --- a/libavcodec/version_major.h +++ b/libavcodec/version_major.h @@ -38,7 +38,6 @@ */ #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61) -#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_SLICE_OFFSET (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_SUBFRAMES (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index f2269766a2..f4da80640d 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -1398,35 +1398,4 @@ const FFHWAccel ff_prores_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; - - -#if FF_API_VT_HWACCEL_CONTEXT -AVVideotoolboxContext *av_videotoolbox_alloc_context(void) -{ - return videotoolbox_alloc_context_with_pix_fmt(AV_PIX_FMT_NONE, false); -} - -int av_videotoolbox_default_init(AVCodecContext *avctx) -{ - return av_videotoolbox_default_init2(avctx, NULL); -} - -int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx) -{ - enum AVPixelFormat pix_fmt = videotoolbox_best_pixel_format(avctx); - bool full_range = avctx->color_range == AVCOL_RANGE_JPEG; - avctx->hwaccel_context = vtctx ?: videotoolbox_alloc_context_with_pix_fmt(pix_fmt, full_range); - if (!avctx->hwaccel_context) - return AVERROR(ENOMEM); - return 0; -} - -void av_videotoolbox_default_free(AVCodecContext *avctx) -{ - - videotoolbox_stop(avctx); - av_freep(&avctx->hwaccel_context); -} -#endif /* FF_API_VT_HWACCEL_CONTEXT */ - #endif /* CONFIG_VIDEOTOOLBOX */ diff --git a/libavcodec/videotoolbox.h b/libavcodec/videotoolbox.h index 11b5315f7d..d68d76e400 100644 --- a/libavcodec/videotoolbox.h +++ b/libavcodec/videotoolbox.h @@ -78,62 +78,6 @@ typedef struct AVVideotoolboxContext { int cm_codec_type; } AVVideotoolboxContext; -#if FF_API_VT_HWACCEL_CONTEXT - -/** - * Allocate and initialize a Videotoolbox context. - * - * This function should be called from the get_format() callback when the caller - * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create - * the decoder object (using the output callback provided by libavcodec) that - * will be used for Videotoolbox-accelerated decoding. - * - * When decoding with Videotoolbox is finished, the caller must destroy the decoder - * object and free the Videotoolbox context using av_free(). - * - * @return the newly allocated context or NULL on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -AVVideotoolboxContext *av_videotoolbox_alloc_context(void); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * - * @return >= 0 on success, a negative AVERROR code on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -int av_videotoolbox_default_init(AVCodecContext *avctx); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * @param vtctx the Videotoolbox context to use - * - * @return >= 0 on success, a negative AVERROR code on failure - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); - -/** - * This function must be called to free the Videotoolbox context initialized with - * av_videotoolbox_default_init(). - * - * @param avctx the corresponding codec context - * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead. - */ -attribute_deprecated -void av_videotoolbox_default_free(AVCodecContext *avctx); - -#endif /* FF_API_VT_HWACCEL_CONTEXT */ - /** * @} */