From patchwork Mon Apr 19 14:09:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 27113 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:49c5:0:0:0:0:0 with SMTP id w188csp1093864yba; Mon, 19 Apr 2021 07:14:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxavlXyrFF5s+gEA98ZnSEZBmCEiq9vcNBN+kCMBEX2Y4IedYcDY6qkFm2J6dIyZCt1VFNj X-Received: by 2002:a17:906:b28c:: with SMTP id q12mr22630829ejz.284.1618841648222; Mon, 19 Apr 2021 07:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618841648; cv=none; d=google.com; s=arc-20160816; b=xnHOafIQPxiJmEFndmTnEZRNRtPtND71/eIk/xufMcXAA/AK+LrwxyUO2hH6wBrRlU j2ioLcV7s9teL0N/FsMWCO0fFCNTiSunQg6pAKUYQKvpVMJlfzbD3zj+YTZjYTUnJWpd boeCmvDtY1ANL1AgiNKajlwxER9/KqUqBrTdseeJem/2E72YUw9BgmdJm+JtNMwZANHG VA7CWsQP7m3/S2G4hJ+YL5p3jMVSggNr3kD40p3BO+N/Ws5P52ZP+tA48Dl+eCRobl7S T/9hitqP2dN7zd7ty/WrEw4EKsBNZn7yJ8IfZcN7VRDye2iYTU/HyFz6oO0LU0eo1BbP pCNw== 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=157CSiA2xExYE9n2IXvzyimufz3rSxjm5Dju4NjJgcA=; b=Nl1RzjGsk60AFYe7Emd/xdxe7T4JJru46LY7T18azm0kwgqoYLWYP/soIAvX3WNZGm dWzBu07b61h/ZLupkNnM29zjIB4OKIb2iRCwgAcU24C0uxjPhLSdU+pDCyILDGt4Q9Xm iNvToEQ8ltucSKoPqxF1OxBW/pm04u3Y/EUTQd8CwndvEdda72FMzWodjQsWSfrdhkdm 02gDeNt9EfmPiC+9jaECR+Oq0N02C7hM8R5eclRJSSEL8lz5ghIvx7AFZ5YPlX/pxWJm KNVhHheRqNj/CdD4v7k3/NUgFKegm2G+U+B3QyJeUeGcr3OeA8Q9XLMUKn8x8xy7MQf6 fJNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=nalUfiJa; 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 c17si12479201edj.86.2021.04.19.07.14.07; Mon, 19 Apr 2021 07:14:08 -0700 (PDT) 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=20161025 header.b=nalUfiJa; 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 17CDE68185F; Mon, 19 Apr 2021 17:11:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94CDA680CF4 for ; Mon, 19 Apr 2021 17:11:38 +0300 (EEST) Received: by mail-qt1-f175.google.com with SMTP id o2so12709992qtr.4 for ; Mon, 19 Apr 2021 07:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=gHnZb9FQxfPFMTsuMCGpIiDfOSheDvmBKGaGC+ULbUQ=; b=nalUfiJanUvFQgjfrhxFC+ODd5BKCSCd75uBgNqk3IA+AlrdvqvR6Q5DHtVR2aisTv qwSufRn7M6eDUoGR0YY2qO8ZdzqdCoOB8dlPLqZPURTF8IrO5T1PPUF0OuUVuKpWua0M iirtqIhc9WBaQ4wU9BWSSIBmB8pd6lWZG90JYGWNHHZsqyY+sE8i1qjJS4A1VUM866+u g2lHkXE/3yeXkmRGu04BkK0D30e0C/Fym+2DsdMwogWaQOEHGki8shJ31KeMmd5KrM9i kF+w8h6FmnSV3cYk+7HfphlrtxffFO1Y+glcndywIU03zXPRwEydlbaYoYUOG1CGy5fy Zr0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gHnZb9FQxfPFMTsuMCGpIiDfOSheDvmBKGaGC+ULbUQ=; b=J8iJ4Y1cYD6Euw027xnUn8A0/FZedqFR2E9CqjU5KqjvrAzaFOeE63drhPsoBqCGhn tWar7nJW8Da9bZ/jjkoOJ12tuJUm8tBEgMBzNqcXDqAw/PM9GRBdO4UJhd9uzMLvSGPR BQGjO0mUdhDOF4mIP6gSWXUnzsyKeCb+bO+Uf81SdMn/J+i+ptV3vUjYGXgsx4MAiQW6 6xRU0BFYMNggBGWE7qED0j5lgXgvcLw2Jv0vyL5eROyRHJP8BlsX4dWKstDtPvJigcGt HoVWSp0Tz24j/iWnsG7wbzn1Caaavd+E5x4kHseOnhMmY4ABMnXNRgSgPptITN0XTSKD VHMg== X-Gm-Message-State: AOAM5330Vk7cfALZItrJ8CGeyR7a8qlkHEreD7raXl7ybE79TRfdrfaf dy+NRrtM0/vFInMRmjuOtM0f1sYRz1I= X-Received: by 2002:ac8:58c2:: with SMTP id u2mr11833706qta.209.1618841496808; Mon, 19 Apr 2021 07:11:36 -0700 (PDT) Received: from localhost.localdomain ([191.83.209.133]) by smtp.gmail.com with ESMTPSA id f7sm2049494qtv.53.2021.04.19.07.11.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 07:11:36 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 19 Apr 2021 11:09:26 -0300 Message-Id: <20210419141024.8174-30-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419141024.8174-1-jamrial@gmail.com> References: <20210419141024.8174-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 29/87] avcodec/vaapi: Remove old and deprecated VAAPI context and header 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: 11g+MRx7HpLh Content-Length: 8856 From: Andreas Rheinhardt Deprecated in 851960f6f8cf1f946fe42fa36cf6598fac68072c. Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 1 - libavcodec/avcodec.h | 3 +- libavcodec/vaapi.h | 86 --------------------------------------- libavcodec/vaapi_decode.c | 53 ------------------------ libavcodec/vaapi_decode.h | 13 ------ libavcodec/version.h | 3 -- 6 files changed, 1 insertion(+), 158 deletions(-) delete mode 100644 libavcodec/vaapi.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 31b220025b..a640c548e5 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -19,7 +19,6 @@ HEADERS = ac3_parser.h \ mediacodec.h \ packet.h \ qsv.h \ - vaapi.h \ vdpau.h \ version.h \ videotoolbox.h \ diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 89e32f1c80..e817befa1c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1522,8 +1522,7 @@ typedef struct AVCodecContext { * For some hardware accelerators, a global context needs to be * provided by the user. In that case, this holds display-dependent * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this - * is. e.g. for VA API, this is a struct vaapi_context. + * FFmpeg HW accelerator documentation to know how to fill this. * - encoding: unused * - decoding: Set by user */ diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h deleted file mode 100644 index 2cf7da5889..0000000000 --- a/libavcodec/vaapi.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Video Acceleration API (shared data between FFmpeg and the video player) - * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 - * - * Copyright (C) 2008-2009 Splitted-Desktop Systems - * - * 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 - */ - -#ifndef AVCODEC_VAAPI_H -#define AVCODEC_VAAPI_H - -/** - * @file - * @ingroup lavc_codec_hwaccel_vaapi - * Public libavcodec VA API header. - */ - -#include -#include "libavutil/attributes.h" -#include "version.h" - -#if FF_API_STRUCT_VAAPI_CONTEXT - -/** - * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding - * @ingroup lavc_codec_hwaccel - * @{ - */ - -/** - * This structure is used to share data between the FFmpeg library and - * the client video application. - * This shall be zero-allocated and available as - * AVCodecContext.hwaccel_context. All user members can be set once - * during initialization or through each AVCodecContext.get_buffer() - * function call. In any case, they must be valid prior to calling - * decoding functions. - * - * Deprecated: use AVCodecContext.hw_frames_ctx instead. - */ -struct attribute_deprecated vaapi_context { - /** - * Window system dependent data - * - * - encoding: unused - * - decoding: Set by user - */ - void *display; - - /** - * Configuration ID - * - * - encoding: unused - * - decoding: Set by user - */ - uint32_t config_id; - - /** - * Context ID (video decode pipeline) - * - * - encoding: unused - * - decoding: Set by user - */ - uint32_t context_id; -}; - -/* @} */ - -#endif /* FF_API_STRUCT_VAAPI_CONTEXT */ - -#endif /* AVCODEC_VAAPI_H */ diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c index 57a0eb4e6e..958ddf49da 100644 --- a/libavcodec/vaapi_decode.c +++ b/libavcodec/vaapi_decode.c @@ -640,46 +640,6 @@ int ff_vaapi_decode_init(AVCodecContext *avctx) ctx->va_config = VA_INVALID_ID; ctx->va_context = VA_INVALID_ID; -#if FF_API_STRUCT_VAAPI_CONTEXT - if (avctx->hwaccel_context) { - av_log(avctx, AV_LOG_WARNING, "Using deprecated struct " - "vaapi_context in decode.\n"); - - ctx->have_old_context = 1; - ctx->old_context = avctx->hwaccel_context; - - // Really we only want the VAAPI device context, but this - // allocates a whole generic device context because we don't - // have any other way to determine how big it should be. - ctx->device_ref = - av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VAAPI); - if (!ctx->device_ref) { - err = AVERROR(ENOMEM); - goto fail; - } - ctx->device = (AVHWDeviceContext*)ctx->device_ref->data; - ctx->hwctx = ctx->device->hwctx; - - ctx->hwctx->display = ctx->old_context->display; - - // The old VAAPI decode setup assumed this quirk was always - // present, so set it here to avoid the behaviour changing. - ctx->hwctx->driver_quirks = - AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS; - - } -#endif - -#if FF_API_STRUCT_VAAPI_CONTEXT - if (ctx->have_old_context) { - ctx->va_config = ctx->old_context->config_id; - ctx->va_context = ctx->old_context->context_id; - - av_log(avctx, AV_LOG_DEBUG, "Using user-supplied decoder " - "context: %#x/%#x.\n", ctx->va_config, ctx->va_context); - } else { -#endif - err = ff_decode_get_hw_frames_ctx(avctx, AV_HWDEVICE_TYPE_VAAPI); if (err < 0) goto fail; @@ -709,9 +669,6 @@ int ff_vaapi_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_DEBUG, "Decode context initialised: " "%#x/%#x.\n", ctx->va_config, ctx->va_context); -#if FF_API_STRUCT_VAAPI_CONTEXT - } -#endif return 0; @@ -725,12 +682,6 @@ int ff_vaapi_decode_uninit(AVCodecContext *avctx) VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data; VAStatus vas; -#if FF_API_STRUCT_VAAPI_CONTEXT - if (ctx->have_old_context) { - av_buffer_unref(&ctx->device_ref); - } else { -#endif - if (ctx->va_context != VA_INVALID_ID) { vas = vaDestroyContext(ctx->hwctx->display, ctx->va_context); if (vas != VA_STATUS_SUCCESS) { @@ -748,9 +699,5 @@ int ff_vaapi_decode_uninit(AVCodecContext *avctx) } } -#if FF_API_STRUCT_VAAPI_CONTEXT - } -#endif - return 0; } diff --git a/libavcodec/vaapi_decode.h b/libavcodec/vaapi_decode.h index 6b415dd1d3..6beda14e52 100644 --- a/libavcodec/vaapi_decode.h +++ b/libavcodec/vaapi_decode.h @@ -27,11 +27,6 @@ #include "avcodec.h" -#include "version.h" -#if FF_API_STRUCT_VAAPI_CONTEXT -#include "vaapi.h" -#endif - static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic) { return (uintptr_t)pic->data[3]; @@ -56,14 +51,6 @@ typedef struct VAAPIDecodeContext { VAConfigID va_config; VAContextID va_context; -#if FF_API_STRUCT_VAAPI_CONTEXT -FF_DISABLE_DEPRECATION_WARNINGS - int have_old_context; - struct vaapi_context *old_context; - AVBufferRef *device_ref; -FF_ENABLE_DEPRECATION_WARNINGS -#endif - AVHWDeviceContext *device; AVVAAPIDeviceContext *hwctx; diff --git a/libavcodec/version.h b/libavcodec/version.h index 6e4a665b07..da36f1790d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -54,9 +54,6 @@ #ifndef FF_API_CODED_FRAME #define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59) #endif -#ifndef FF_API_STRUCT_VAAPI_CONTEXT -#define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) -#endif #ifndef FF_API_UNSANITIZED_BITRATES #define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59) #endif