From patchwork Fri Nov 24 00:51:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 6307 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp1464232jah; Thu, 23 Nov 2017 16:52:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMYy4a/JNc5yqYqKc78f2ilIPGGygM71OjZGJjyDRRQ6WSiTADniPsdGthEPqMLZpQl3PvWf X-Received: by 10.223.135.121 with SMTP id 54mr22347085wrz.160.1511484738267; Thu, 23 Nov 2017 16:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511484738; cv=none; d=google.com; s=arc-20160816; b=cjhhb3FL/sH63T8xi4WeJCfW/9PeVb+LzWxGGlh5fqCqgdBPgbkWrf8O12loeXmgb8 VdsJhjDc2B2fWZW+xKgYYLcan00xOtCX0MFrgI05y6KfX2q9dQQYgzmp3lPMiz1Mwx8n dQRL7bAhKwn6Sv6/E0TTggl5rDwdoWYGGZpI/72tGj5UDqyjfBBhB6Mz4Juyn7emDraZ WTMGVG8Cnan7J7NDZNpiWUevbbrud+L7aW1eUHb5WrnRjzrQzkG2dxKVAVRrUaQ3Als2 ilK+Ywo+0dix7oWVF6DsYL2nv4JdAn+2ASnSFqN0+ULzHLcvfWCQmWVVLh7AE4J7WuyR WQ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=ZyaTnCiW3H7gndSAeRNlIl1q85MlMCB1oV8N1Vho61Y=; b=E4mbMLEXnFvm4y44IMpBfMjwmEyNYqw2Cgpeh9vCi6xyjAZIgybgHIDAoup93Ufn4l MObvP6405RAXZ0bxxWM6hRLUYvtCQxvCW8vGFllWf+6co9zE1PJthnmjJPoi+7JIilH8 8SrLnD5ck17Kpd/dPZA40lSNJA6TI3ja9xV7SurBV6CkMrxxHGi9k0VU5U0XWvmEdqnQ ubge9yApSY63d4WUQiE90yHxE2SHpI2K3gSEDaV44yX/ELA8ra1lDa3Qjbt4+Xtq322W bN35Kuj2xDFN2wHJkENXnrxMXSXauUdqKW8xcoqmK783+jHSz4bx/jyCkoRpXgNa3OOF nhgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=iDTOzREp; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c27si10465259wrb.52.2017.11.23.16.52.17; Thu, 23 Nov 2017 16:52:18 -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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=iDTOzREp; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 36E5E68A1F3; Fri, 24 Nov 2017 02:51:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8216068A18C for ; Fri, 24 Nov 2017 02:51:42 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id x63so19479169wmf.4 for ; Thu, 23 Nov 2017 16:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=nm1fd9iz4hD/G5oqDNt+QqSakOkPWLfHUkgb+MrPVUs=; b=iDTOzREp446v0Tlsjg2tHOB3kOa4eXRitu9A1GRZelFd3XlYYAMZBVtSXnOrqGft++ TUMwDoDD6iQQfxhSmBZ19B8+1BFY4p0NgdNXSvFzzXtfdhBO7eeK8vdJQ50JULAj3PR+ aZLHJiASmXhq4wyu7tRmYlwLHdi9jWRgJTDYuossh/y76NUCcwcY0wKueFpSaUKY0Rvs 8d8xMhTXrorFYF0Mnm5l6K8NqW9MICvhUHw69FLdG4lFb7nyxHUYzVEKCiq7WeC4QYnt kjcndoPjKYNEMaMRFHgBYCEJ6Bwhxd8CGJ7n/tanVTRCuh36gx3CN+1EPxEjAwcuBTWD Y73g== 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; bh=nm1fd9iz4hD/G5oqDNt+QqSakOkPWLfHUkgb+MrPVUs=; b=T3Zet1KPiFXeSJ+UnVQp+tNlWKvxpDNQK1YGhEqVoLdY8QpVrLxrZds9JutRnUgKYo EnaT8x7BPNgTeVaufygszo2qRQ5eRWfVBieCuq3OpkyQdgpwLVKhmGdSXQfzW9FSlc4k Tb7AQz8yu8onJ0cCHQCAbXLb0r37D0EeAZXgT/q5jG9QkmdlNp65bd2uQ81c2vu9dGBx 2n5dKuk55XQv4NmBt9mdb6kBQlM6PInlBc6QLSTsrgTL96IDSnWn5gSJT/YvdpYQf6+j XZZudSgiLaPAmSMIKnBGLByC/rSt5BQu7wx0abL2JWlTHSIcx5CuKZkQYesUGg+vQYIY X4yQ== X-Gm-Message-State: AJaThX4Zn5ucfc4HAH4bvjMFWpDXGGNMK9/UAOoFiHpjXY5KhvXahih1 xM0nBMDgASTAukJYCwl84irT8pV6 X-Received: by 10.28.87.207 with SMTP id l198mr8543253wmb.45.1511484702658; Thu, 23 Nov 2017 16:51:42 -0800 (PST) Received: from rywe.jkqxz.net (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id h7sm4489655wrb.35.2017.11.23.16.51.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 16:51:41 -0800 (PST) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Nov 2017 00:51:21 +0000 Message-Id: <20171124005134.5683-4-sw@jkqxz.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171124005134.5683-1-sw@jkqxz.net> References: <20171124005134.5683-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 04/17] lavc: Deprecate av_hwaccel_next() and av_register_hwaccel() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- doc/APIchanges | 4 ++++ libavcodec/avcodec.h | 14 +++++++++++++- libavcodec/utils.c | 16 +++++----------- libavcodec/version.h | 3 +++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 704efe1719..a3afa8b2a6 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -16,6 +16,10 @@ libavutil: 2017-10-21 API changes, most recent first: 2017-xx-xx - xxxxxxx - lavc 58.x+1.0 - avcodec.h + Deprecate user visibility of the AVHWAccel structure and the functions + av_register_hwaccel() and av_hwaccel_next(). + +2017-xx-xx - xxxxxxx - lavc 58.x+1.0 - avcodec.h Add AVCodecHWConfig and avcodec_get_hw_config(). 2017-11-xx - xxxxxxx - lavu 55.3.0 - opencl.h diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a78c69a708..1ae0344bb2 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3489,6 +3489,10 @@ const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index); /** * @defgroup lavc_hwaccel AVHWAccel + * + * @note Nothing in this structure should be accessed by the user. At some + * point in future it will not be externally visible at all. + * * @{ */ typedef struct AVHWAccel { @@ -3533,7 +3537,6 @@ typedef struct AVHWAccel { * New public fields should be added right above. ***************************************************************** */ - struct AVHWAccel *next; /** * Allocate a custom buffer @@ -5874,17 +5877,26 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size); */ unsigned int av_xiphlacing(unsigned char *s, unsigned int v); +#if FF_API_USER_VISIBLE_AVHWACCEL /** * Register the hardware accelerator hwaccel. + * + * @deprecated This function doesn't do anything. */ +attribute_deprecated void av_register_hwaccel(AVHWAccel *hwaccel); /** * If hwaccel is NULL, returns the first registered hardware accelerator, * if hwaccel is non-NULL, returns the next registered hardware accelerator * after hwaccel, or NULL if hwaccel is the last one. + * + * @deprecated AVHWaccel structures contain no user-serviceable parts, so + * this function should not be used. */ +attribute_deprecated AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel); +#endif /** diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 01bf7556f7..417ebcb770 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1897,22 +1897,16 @@ const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index) return &codec->hw_configs[index]->public; } -static AVHWAccel *first_hwaccel = NULL; -static AVHWAccel **last_hwaccel = &first_hwaccel; - -void av_register_hwaccel(AVHWAccel *hwaccel) +#if FF_API_USER_VISIBLE_AVHWACCEL +AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) { - AVHWAccel **p = last_hwaccel; - hwaccel->next = NULL; - while(*p || avpriv_atomic_ptr_cas((void * volatile *)p, NULL, hwaccel)) - p = &(*p)->next; - last_hwaccel = &hwaccel->next; + return NULL; } -AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel) +void av_register_hwaccel(AVHWAccel *hwaccel) { - return hwaccel ? hwaccel->next : first_hwaccel; } +#endif int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) { diff --git a/libavcodec/version.h b/libavcodec/version.h index c8550bca9a..1bd8f1b411 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -123,6 +123,9 @@ #ifndef FF_API_CODEC_GET_SET #define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59) #endif +#ifndef FF_API_USER_VISIBLE_AVHWACCEL +#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59) +#endif #endif /* AVCODEC_VERSION_H */