From patchwork Fri Nov 24 00:51:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 6319 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp1464753jah; Thu, 23 Nov 2017 16:53:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMbLFe8kVpLSvRMaNEVBWg/yJImwosL18Tlaar8Ck1sffii1mcT4GA9iCkTwcKaFDhNaR1cf X-Received: by 10.223.163.22 with SMTP id c22mr14248782wrb.145.1511484785181; Thu, 23 Nov 2017 16:53:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511484785; cv=none; d=google.com; s=arc-20160816; b=umpn5wmBeJF1eGOdJfR2pqgnS5qHw6Wa5XYI3fy37kP+K6W+r1BheVXySQrGEpdqJp EWNWvnbWOddRRNV3UnUrCaxwZpvF3/QWma1KfN5M61TJFrd2ohhBMrXdIliFlIMChmFl HiIzNFgCDg7LENADVKdimwpO93yOmA6K5X+scCuMWYJKoGimyImaSh61g9Lrl3W05ZvR Bhg2zdYCSSp3LjHXTc5Y8ohf8+LvxeD9+P/DRq60iiyJGGAoCbCiho1l9zmhCDZHC4vu 3d0/6kNyL1FRViKnhRrxOMi3d+aBEu2yA7BCgfwEiMSTKNwxK/JqInDvL2G9yBJIeuNs n+FA== 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=8t03WBInjylbjcwWZ+y7A1NuTDhkT8Nx70ueQB7F66U=; b=DKounQA7xJ9EsdKntudXbJMIfFtCxo96WRYD7pGmMvfUl1MhVbOmoHSn+6QeVdezN+ ELJfL2P6QZXZYCzlx3uOhS3Gkg+kUq+4kXQfNPqFAuaGX5bvXc0WJB/E/YUXxr1UzaJC zkIgTeZV28mH4zzcJe3hCNbCdZ1pmezDANY7pIm6Vknz1CNsNMGiO3hgDIMiMKDUZPEb GbKV9bqq3lVA8ry6cVp4QBuypySVOIHxdheGB4nI/RJSXt59s1aM9MjnCnt1hbiGKxhk UlkqrZXxv+F6uC+c1wPdVZ++xpuSTFS3JSIcV215Yf/RJ2ji0R9u6MxX2Ye51XqMGQHd yb2A== 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=AuaksD8A; 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 l5si16272810wrh.161.2017.11.23.16.53.04; Thu, 23 Nov 2017 16:53: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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=AuaksD8A; 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 7BED268A25E; Fri, 24 Nov 2017 02:51:54 +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 B9C4C68A200 for ; Fri, 24 Nov 2017 02:51:45 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id y82so18692385wmg.1 for ; Thu, 23 Nov 2017 16:51:46 -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=lUCASXdHtCimrZ9u56A/LT3J7u2HonYJIlbPRQ4GF4g=; b=AuaksD8A0qJfykp+ylyjowMLfnn/7hPW5QmiilZ7FtV8ANB1qkvg3nJBUqYmSNl5eb RkTUskHb3PKP8ltLig3a/0GLafEAYwRDV9lZ0txXM23F7TW9SPm9WnlBbbUTT3zodfAQ DOwshUImlvOZwXDnBM03mvcCuGkZ4elUDmKJxZwchHgrD88vi+1YtYoMIz93vr8uJySY s0UnAzB10XzwT6iOr4St6TvT7DqKLLvAn+RR8RLCcW7KWpvgiBR4EAUbSd+eDHOcYYII Iw4ptzTioV/H+wvjO1UMEzEU54hoiaO7UBIoJGAAguCxctgm6wpxEelSxryqX0Kk+o84 CyVA== 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=lUCASXdHtCimrZ9u56A/LT3J7u2HonYJIlbPRQ4GF4g=; b=gsaKtul2vnRbOYhKjSPeF18kLqslj0VnURbwSR3JKHuv9nrcxjm3RrNUBWA4PQ2F8G 2192G+qLBXHZjBQpQAHRn1/dTEr97ctt1EZEgck/eccAmmZG0+IrjbjnCvnSueOE0K40 ubVj96cPG0jvmRY/Y3oB0KARq7bwCapRy6OoT00rvYBjUWc2gkS3AC2AA52B68ke0DfX muv4m/UW79ttc1Hkq/YmLybefSu3HTGAJDyVgvUcRsf7E09nHwS1F8WaprM2j+22q2HV 7oPF9OuhhFEEAFXo+sF0Vcdvo0mwdiR3LkxaJQ/kBJhjzDUU0UneKCKDlS+TW6w+Jp43 By+Q== X-Gm-Message-State: AJaThX48Gw3G3bLE4KTF8KAs3lSd3G329waFpxHQTDFYZgvhZweEO3xT TGBt+BOGWIhO1dQM/RVa76qye+gy X-Received: by 10.28.59.133 with SMTP id i127mr8870689wma.30.1511484705690; Thu, 23 Nov 2017 16:51:45 -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.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 16:51:44 -0800 (PST) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Nov 2017 00:51:24 +0000 Message-Id: <20171124005134.5683-7-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 07/17] lavc: Mark all AVHWAccel structures as const 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" --- libavcodec/avcodec.h | 2 +- libavcodec/decode.c | 2 +- libavcodec/dxva2_h264.c | 6 +-- libavcodec/dxva2_hevc.c | 6 +-- libavcodec/dxva2_mpeg2.c | 6 +-- libavcodec/dxva2_vc1.c | 12 +++--- libavcodec/dxva2_vp9.c | 6 +-- libavcodec/hwaccels.h | 98 ++++++++++++++++++++++----------------------- libavcodec/mpegvideo_xvmc.c | 4 +- libavcodec/nvdec_h264.c | 2 +- libavcodec/nvdec_hevc.c | 2 +- libavcodec/nvdec_mpeg12.c | 2 +- libavcodec/nvdec_vc1.c | 4 +- libavcodec/nvdec_vp9.c | 2 +- libavcodec/vaapi_h264.c | 2 +- libavcodec/vaapi_hevc.c | 2 +- libavcodec/vaapi_mpeg2.c | 2 +- libavcodec/vaapi_mpeg4.c | 4 +- libavcodec/vaapi_vc1.c | 4 +- libavcodec/vaapi_vp9.c | 2 +- libavcodec/vdpau_h264.c | 2 +- libavcodec/vdpau_hevc.c | 2 +- libavcodec/vdpau_mpeg12.c | 4 +- libavcodec/vdpau_mpeg4.c | 2 +- libavcodec/vdpau_vc1.c | 4 +- libavcodec/videotoolbox.c | 12 +++--- 26 files changed, 98 insertions(+), 98 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1ae0344bb2..0972df0bde 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2635,7 +2635,7 @@ typedef struct AVCodecContext { * - encoding: unused. * - decoding: Set by libavcodec */ - struct AVHWAccel *hwaccel; + const struct AVHWAccel *hwaccel; /** * Hardware accelerator context. diff --git a/libavcodec/decode.c b/libavcodec/decode.c index dd6fce86eb..3feaa6c426 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1252,7 +1252,7 @@ static int hwaccel_init(AVCodecContext *avctx, return AVERROR(ENOMEM); } - avctx->hwaccel = (AVHWAccel*)hwaccel; + avctx->hwaccel = hwaccel; err = hwaccel->init(avctx); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed setup for format %s: " diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index ee35b20e82..a4278c80b5 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -518,7 +518,7 @@ static int dxva2_h264_end_frame(AVCodecContext *avctx) } #if CONFIG_H264_DXVA2_HWACCEL -AVHWAccel ff_h264_dxva2_hwaccel = { +const AVHWAccel ff_h264_dxva2_hwaccel = { .name = "h264_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, @@ -535,7 +535,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = { #endif #if CONFIG_H264_D3D11VA_HWACCEL -AVHWAccel ff_h264_d3d11va_hwaccel = { +const AVHWAccel ff_h264_d3d11va_hwaccel = { .name = "h264_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, @@ -552,7 +552,7 @@ AVHWAccel ff_h264_d3d11va_hwaccel = { #endif #if CONFIG_H264_D3D11VA2_HWACCEL -AVHWAccel ff_h264_d3d11va2_hwaccel = { +const AVHWAccel ff_h264_d3d11va2_hwaccel = { .name = "h264_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c index 542afc383a..0ae07d304f 100644 --- a/libavcodec/dxva2_hevc.c +++ b/libavcodec/dxva2_hevc.c @@ -422,7 +422,7 @@ static int dxva2_hevc_end_frame(AVCodecContext *avctx) } #if CONFIG_HEVC_DXVA2_HWACCEL -AVHWAccel ff_hevc_dxva2_hwaccel = { +const AVHWAccel ff_hevc_dxva2_hwaccel = { .name = "hevc_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, @@ -439,7 +439,7 @@ AVHWAccel ff_hevc_dxva2_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA_HWACCEL -AVHWAccel ff_hevc_d3d11va_hwaccel = { +const AVHWAccel ff_hevc_d3d11va_hwaccel = { .name = "hevc_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, @@ -456,7 +456,7 @@ AVHWAccel ff_hevc_d3d11va_hwaccel = { #endif #if CONFIG_HEVC_D3D11VA2_HWACCEL -AVHWAccel ff_hevc_d3d11va2_hwaccel = { +const AVHWAccel ff_hevc_d3d11va2_hwaccel = { .name = "hevc_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index df5fe59a7d..a57778b427 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -317,7 +317,7 @@ static int dxva2_mpeg2_end_frame(AVCodecContext *avctx) } #if CONFIG_MPEG2_DXVA2_HWACCEL -AVHWAccel ff_mpeg2_dxva2_hwaccel = { +const AVHWAccel ff_mpeg2_dxva2_hwaccel = { .name = "mpeg2_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, @@ -334,7 +334,7 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA_HWACCEL -AVHWAccel ff_mpeg2_d3d11va_hwaccel = { +const AVHWAccel ff_mpeg2_d3d11va_hwaccel = { .name = "mpeg2_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, @@ -351,7 +351,7 @@ AVHWAccel ff_mpeg2_d3d11va_hwaccel = { #endif #if CONFIG_MPEG2_D3D11VA2_HWACCEL -AVHWAccel ff_mpeg2_d3d11va2_hwaccel = { +const AVHWAccel ff_mpeg2_d3d11va2_hwaccel = { .name = "mpeg2_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index f21c5d5544..f22c73cd1e 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -378,7 +378,7 @@ static int dxva2_vc1_end_frame(AVCodecContext *avctx) } #if CONFIG_WMV3_DXVA2_HWACCEL -AVHWAccel ff_wmv3_dxva2_hwaccel = { +const AVHWAccel ff_wmv3_dxva2_hwaccel = { .name = "wmv3_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, @@ -395,7 +395,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = { #endif #if CONFIG_VC1_DXVA2_HWACCEL -AVHWAccel ff_vc1_dxva2_hwaccel = { +const AVHWAccel ff_vc1_dxva2_hwaccel = { .name = "vc1_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, @@ -412,7 +412,7 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA_HWACCEL -AVHWAccel ff_wmv3_d3d11va_hwaccel = { +const AVHWAccel ff_wmv3_d3d11va_hwaccel = { .name = "wmv3_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, @@ -429,7 +429,7 @@ AVHWAccel ff_wmv3_d3d11va_hwaccel = { #endif #if CONFIG_WMV3_D3D11VA2_HWACCEL -AVHWAccel ff_wmv3_d3d11va2_hwaccel = { +const AVHWAccel ff_wmv3_d3d11va2_hwaccel = { .name = "wmv3_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, @@ -446,7 +446,7 @@ AVHWAccel ff_wmv3_d3d11va2_hwaccel = { #endif #if CONFIG_VC1_D3D11VA_HWACCEL -AVHWAccel ff_vc1_d3d11va_hwaccel = { +const AVHWAccel ff_vc1_d3d11va_hwaccel = { .name = "vc1_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, @@ -463,7 +463,7 @@ AVHWAccel ff_vc1_d3d11va_hwaccel = { #endif #if CONFIG_VC1_D3D11VA2_HWACCEL -AVHWAccel ff_vc1_d3d11va2_hwaccel = { +const AVHWAccel ff_vc1_d3d11va2_hwaccel = { .name = "vc1_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, diff --git a/libavcodec/dxva2_vp9.c b/libavcodec/dxva2_vp9.c index a2e55f5736..5a5b226422 100644 --- a/libavcodec/dxva2_vp9.c +++ b/libavcodec/dxva2_vp9.c @@ -309,7 +309,7 @@ static int dxva2_vp9_end_frame(AVCodecContext *avctx) } #if CONFIG_VP9_DXVA2_HWACCEL -AVHWAccel ff_vp9_dxva2_hwaccel = { +const AVHWAccel ff_vp9_dxva2_hwaccel = { .name = "vp9_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP9, @@ -326,7 +326,7 @@ AVHWAccel ff_vp9_dxva2_hwaccel = { #endif #if CONFIG_VP9_D3D11VA_HWACCEL -AVHWAccel ff_vp9_d3d11va_hwaccel = { +const AVHWAccel ff_vp9_d3d11va_hwaccel = { .name = "vp9_d3d11va", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP9, @@ -343,7 +343,7 @@ AVHWAccel ff_vp9_d3d11va_hwaccel = { #endif #if CONFIG_VP9_D3D11VA2_HWACCEL -AVHWAccel ff_vp9_d3d11va2_hwaccel = { +const AVHWAccel ff_vp9_d3d11va2_hwaccel = { .name = "vp9_d3d11va2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP9, diff --git a/libavcodec/hwaccels.h b/libavcodec/hwaccels.h index 9a3008a92c..8a3c29e435 100644 --- a/libavcodec/hwaccels.h +++ b/libavcodec/hwaccels.h @@ -21,54 +21,54 @@ #include "avcodec.h" -extern AVHWAccel ff_h263_vaapi_hwaccel; -extern AVHWAccel ff_h263_videotoolbox_hwaccel; -extern AVHWAccel ff_h264_d3d11va_hwaccel; -extern AVHWAccel ff_h264_d3d11va2_hwaccel; -extern AVHWAccel ff_h264_dxva2_hwaccel; -extern AVHWAccel ff_h264_nvdec_hwaccel; -extern AVHWAccel ff_h264_vaapi_hwaccel; -extern AVHWAccel ff_h264_vdpau_hwaccel; -extern AVHWAccel ff_h264_videotoolbox_hwaccel; -extern AVHWAccel ff_hevc_d3d11va_hwaccel; -extern AVHWAccel ff_hevc_d3d11va2_hwaccel; -extern AVHWAccel ff_hevc_dxva2_hwaccel; -extern AVHWAccel ff_hevc_nvdec_hwaccel; -extern AVHWAccel ff_hevc_vaapi_hwaccel; -extern AVHWAccel ff_hevc_vdpau_hwaccel; -extern AVHWAccel ff_hevc_videotoolbox_hwaccel; -extern AVHWAccel ff_mpeg1_nvdec_hwaccel; -extern AVHWAccel ff_mpeg1_vdpau_hwaccel; -extern AVHWAccel ff_mpeg1_videotoolbox_hwaccel; -extern AVHWAccel ff_mpeg1_xvmc_hwaccel; -extern AVHWAccel ff_mpeg2_d3d11va_hwaccel; -extern AVHWAccel ff_mpeg2_d3d11va2_hwaccel; -extern AVHWAccel ff_mpeg2_nvdec_hwaccel; -extern AVHWAccel ff_mpeg2_dxva2_hwaccel; -extern AVHWAccel ff_mpeg2_vaapi_hwaccel; -extern AVHWAccel ff_mpeg2_vdpau_hwaccel; -extern AVHWAccel ff_mpeg2_videotoolbox_hwaccel; -extern AVHWAccel ff_mpeg2_xvmc_hwaccel; -extern AVHWAccel ff_mpeg4_nvdec_hwaccel; -extern AVHWAccel ff_mpeg4_vaapi_hwaccel; -extern AVHWAccel ff_mpeg4_vdpau_hwaccel; -extern AVHWAccel ff_mpeg4_videotoolbox_hwaccel; -extern AVHWAccel ff_vc1_d3d11va_hwaccel; -extern AVHWAccel ff_vc1_d3d11va2_hwaccel; -extern AVHWAccel ff_vc1_dxva2_hwaccel; -extern AVHWAccel ff_vc1_nvdec_hwaccel; -extern AVHWAccel ff_vc1_vaapi_hwaccel; -extern AVHWAccel ff_vc1_vdpau_hwaccel; -extern AVHWAccel ff_vp9_d3d11va_hwaccel; -extern AVHWAccel ff_vp9_d3d11va2_hwaccel; -extern AVHWAccel ff_vp9_dxva2_hwaccel; -extern AVHWAccel ff_vp9_nvdec_hwaccel; -extern AVHWAccel ff_vp9_vaapi_hwaccel; -extern AVHWAccel ff_wmv3_d3d11va_hwaccel; -extern AVHWAccel ff_wmv3_d3d11va2_hwaccel; -extern AVHWAccel ff_wmv3_dxva2_hwaccel; -extern AVHWAccel ff_wmv3_nvdec_hwaccel; -extern AVHWAccel ff_wmv3_vaapi_hwaccel; -extern AVHWAccel ff_wmv3_vdpau_hwaccel; +extern const AVHWAccel ff_h263_vaapi_hwaccel; +extern const AVHWAccel ff_h263_videotoolbox_hwaccel; +extern const AVHWAccel ff_h264_d3d11va_hwaccel; +extern const AVHWAccel ff_h264_d3d11va2_hwaccel; +extern const AVHWAccel ff_h264_dxva2_hwaccel; +extern const AVHWAccel ff_h264_nvdec_hwaccel; +extern const AVHWAccel ff_h264_vaapi_hwaccel; +extern const AVHWAccel ff_h264_vdpau_hwaccel; +extern const AVHWAccel ff_h264_videotoolbox_hwaccel; +extern const AVHWAccel ff_hevc_d3d11va_hwaccel; +extern const AVHWAccel ff_hevc_d3d11va2_hwaccel; +extern const AVHWAccel ff_hevc_dxva2_hwaccel; +extern const AVHWAccel ff_hevc_nvdec_hwaccel; +extern const AVHWAccel ff_hevc_vaapi_hwaccel; +extern const AVHWAccel ff_hevc_vdpau_hwaccel; +extern const AVHWAccel ff_hevc_videotoolbox_hwaccel; +extern const AVHWAccel ff_mpeg1_nvdec_hwaccel; +extern const AVHWAccel ff_mpeg1_vdpau_hwaccel; +extern const AVHWAccel ff_mpeg1_videotoolbox_hwaccel; +extern const AVHWAccel ff_mpeg1_xvmc_hwaccel; +extern const AVHWAccel ff_mpeg2_d3d11va_hwaccel; +extern const AVHWAccel ff_mpeg2_d3d11va2_hwaccel; +extern const AVHWAccel ff_mpeg2_nvdec_hwaccel; +extern const AVHWAccel ff_mpeg2_dxva2_hwaccel; +extern const AVHWAccel ff_mpeg2_vaapi_hwaccel; +extern const AVHWAccel ff_mpeg2_vdpau_hwaccel; +extern const AVHWAccel ff_mpeg2_videotoolbox_hwaccel; +extern const AVHWAccel ff_mpeg2_xvmc_hwaccel; +extern const AVHWAccel ff_mpeg4_nvdec_hwaccel; +extern const AVHWAccel ff_mpeg4_vaapi_hwaccel; +extern const AVHWAccel ff_mpeg4_vdpau_hwaccel; +extern const AVHWAccel ff_mpeg4_videotoolbox_hwaccel; +extern const AVHWAccel ff_vc1_d3d11va_hwaccel; +extern const AVHWAccel ff_vc1_d3d11va2_hwaccel; +extern const AVHWAccel ff_vc1_dxva2_hwaccel; +extern const AVHWAccel ff_vc1_nvdec_hwaccel; +extern const AVHWAccel ff_vc1_vaapi_hwaccel; +extern const AVHWAccel ff_vc1_vdpau_hwaccel; +extern const AVHWAccel ff_vp9_d3d11va_hwaccel; +extern const AVHWAccel ff_vp9_d3d11va2_hwaccel; +extern const AVHWAccel ff_vp9_dxva2_hwaccel; +extern const AVHWAccel ff_vp9_nvdec_hwaccel; +extern const AVHWAccel ff_vp9_vaapi_hwaccel; +extern const AVHWAccel ff_wmv3_d3d11va_hwaccel; +extern const AVHWAccel ff_wmv3_d3d11va2_hwaccel; +extern const AVHWAccel ff_wmv3_dxva2_hwaccel; +extern const AVHWAccel ff_wmv3_nvdec_hwaccel; +extern const AVHWAccel ff_wmv3_vaapi_hwaccel; +extern const AVHWAccel ff_wmv3_vdpau_hwaccel; #endif /* AVCODEC_HWACCELS_H */ diff --git a/libavcodec/mpegvideo_xvmc.c b/libavcodec/mpegvideo_xvmc.c index 519a448161..f06583768c 100644 --- a/libavcodec/mpegvideo_xvmc.c +++ b/libavcodec/mpegvideo_xvmc.c @@ -348,7 +348,7 @@ static void ff_xvmc_decode_mb(struct MpegEncContext *s) } #if CONFIG_MPEG1_XVMC_HWACCEL -AVHWAccel ff_mpeg1_xvmc_hwaccel = { +const AVHWAccel ff_mpeg1_xvmc_hwaccel = { .name = "mpeg1_xvmc", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG1VIDEO, @@ -362,7 +362,7 @@ AVHWAccel ff_mpeg1_xvmc_hwaccel = { #endif #if CONFIG_MPEG2_XVMC_HWACCEL -AVHWAccel ff_mpeg2_xvmc_hwaccel = { +const AVHWAccel ff_mpeg2_xvmc_hwaccel = { .name = "mpeg2_xvmc", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, diff --git a/libavcodec/nvdec_h264.c b/libavcodec/nvdec_h264.c index b0e756c734..35f54f2ed5 100644 --- a/libavcodec/nvdec_h264.c +++ b/libavcodec/nvdec_h264.c @@ -163,7 +163,7 @@ static int nvdec_h264_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->ref_frame_count + sps->num_reorder_frames); } -AVHWAccel ff_h264_nvdec_hwaccel = { +const AVHWAccel ff_h264_nvdec_hwaccel = { .name = "h264_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, diff --git a/libavcodec/nvdec_hevc.c b/libavcodec/nvdec_hevc.c index f02a7a15fe..58f3fa9b45 100644 --- a/libavcodec/nvdec_hevc.c +++ b/libavcodec/nvdec_hevc.c @@ -266,7 +266,7 @@ static int nvdec_hevc_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering + 1); } -AVHWAccel ff_hevc_nvdec_hwaccel = { +const AVHWAccel ff_hevc_nvdec_hwaccel = { .name = "hevc_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, diff --git a/libavcodec/nvdec_mpeg12.c b/libavcodec/nvdec_mpeg12.c index e29d085a79..249893a168 100644 --- a/libavcodec/nvdec_mpeg12.c +++ b/libavcodec/nvdec_mpeg12.c @@ -91,7 +91,7 @@ static int nvdec_mpeg12_frame_params(AVCodecContext *avctx, } #if CONFIG_MPEG2_NVDEC_HWACCEL -AVHWAccel ff_mpeg2_nvdec_hwaccel = { +const AVHWAccel ff_mpeg2_nvdec_hwaccel = { .name = "mpeg2_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, diff --git a/libavcodec/nvdec_vc1.c b/libavcodec/nvdec_vc1.c index c04b153a86..7257692d66 100644 --- a/libavcodec/nvdec_vc1.c +++ b/libavcodec/nvdec_vc1.c @@ -110,7 +110,7 @@ static int nvdec_vc1_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 2); } -AVHWAccel ff_vc1_nvdec_hwaccel = { +const AVHWAccel ff_vc1_nvdec_hwaccel = { .name = "vc1_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, @@ -125,7 +125,7 @@ AVHWAccel ff_vc1_nvdec_hwaccel = { }; #if CONFIG_WMV3_NVDEC_HWACCEL -AVHWAccel ff_wmv3_nvdec_hwaccel = { +const AVHWAccel ff_wmv3_nvdec_hwaccel = { .name = "wmv3_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, diff --git a/libavcodec/nvdec_vp9.c b/libavcodec/nvdec_vp9.c index ed06d91416..3b665a9bc7 100644 --- a/libavcodec/nvdec_vp9.c +++ b/libavcodec/nvdec_vp9.c @@ -169,7 +169,7 @@ static int nvdec_vp9_frame_params(AVCodecContext *avctx, return ff_nvdec_frame_params(avctx, hw_frames_ctx, 8); } -AVHWAccel ff_vp9_nvdec_hwaccel = { +const AVHWAccel ff_vp9_nvdec_hwaccel = { .name = "vp9_nvdec", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP9, diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index c7f9d7bcb4..5854587a25 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -388,7 +388,7 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, return 0; } -AVHWAccel ff_h264_vaapi_hwaccel = { +const AVHWAccel ff_h264_vaapi_hwaccel = { .name = "h264_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c index 718ccc92a2..19aabcdb52 100644 --- a/libavcodec/vaapi_hevc.c +++ b/libavcodec/vaapi_hevc.c @@ -423,7 +423,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx, return 0; } -AVHWAccel ff_hevc_vaapi_hwaccel = { +const AVHWAccel ff_hevc_vaapi_hwaccel = { .name = "hevc_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index fd5be8d8ae..aaed434c88 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -172,7 +172,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer return 0; } -AVHWAccel ff_mpeg2_vaapi_hwaccel = { +const AVHWAccel ff_mpeg2_vaapi_hwaccel = { .name = "mpeg2_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index 3fe029186e..11860ff747 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -178,7 +178,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer } #if CONFIG_MPEG4_VAAPI_HWACCEL -AVHWAccel ff_mpeg4_vaapi_hwaccel = { +const AVHWAccel ff_mpeg4_vaapi_hwaccel = { .name = "mpeg4_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4, @@ -196,7 +196,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = { #endif #if CONFIG_H263_VAAPI_HWACCEL -AVHWAccel ff_h263_vaapi_hwaccel = { +const AVHWAccel ff_h263_vaapi_hwaccel = { .name = "h263_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H263, diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 49675744cd..525376790e 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -388,7 +388,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, } #if CONFIG_WMV3_VAAPI_HWACCEL -AVHWAccel ff_wmv3_vaapi_hwaccel = { +const AVHWAccel ff_wmv3_vaapi_hwaccel = { .name = "wmv3_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, @@ -405,7 +405,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { }; #endif -AVHWAccel ff_vc1_vaapi_hwaccel = { +const AVHWAccel ff_vc1_vaapi_hwaccel = { .name = "vc1_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, diff --git a/libavcodec/vaapi_vp9.c b/libavcodec/vaapi_vp9.c index f295dc9ebb..f384ba7873 100644 --- a/libavcodec/vaapi_vp9.c +++ b/libavcodec/vaapi_vp9.c @@ -168,7 +168,7 @@ static int vaapi_vp9_decode_slice(AVCodecContext *avctx, return 0; } -AVHWAccel ff_vp9_vaapi_hwaccel = { +const AVHWAccel ff_vp9_vaapi_hwaccel = { .name = "vp9_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VP9, diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c index 70f83d76f5..2a260f76ab 100644 --- a/libavcodec/vdpau_h264.c +++ b/libavcodec/vdpau_h264.c @@ -262,7 +262,7 @@ static int vdpau_h264_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -AVHWAccel ff_h264_vdpau_hwaccel = { +const AVHWAccel ff_h264_vdpau_hwaccel = { .name = "h264_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c index 70e76cfcaa..421135bce2 100644 --- a/libavcodec/vdpau_hevc.c +++ b/libavcodec/vdpau_hevc.c @@ -413,7 +413,7 @@ static int vdpau_hevc_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, level); } -AVHWAccel ff_hevc_vdpau_hwaccel = { +const AVHWAccel ff_hevc_vdpau_hwaccel = { .name = "hevc_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c index 71fe889abf..d286e7e57d 100644 --- a/libavcodec/vdpau_mpeg12.c +++ b/libavcodec/vdpau_mpeg12.c @@ -103,7 +103,7 @@ static int vdpau_mpeg1_init(AVCodecContext *avctx) VDP_DECODER_LEVEL_MPEG1_NA); } -AVHWAccel ff_mpeg1_vdpau_hwaccel = { +const AVHWAccel ff_mpeg1_vdpau_hwaccel = { .name = "mpeg1_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG1VIDEO, @@ -138,7 +138,7 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL); } -AVHWAccel ff_mpeg2_vdpau_hwaccel = { +const AVHWAccel ff_mpeg2_vdpau_hwaccel = { .name = "mpeg2_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c index 653ef7e7e7..96f83026a8 100644 --- a/libavcodec/vdpau_mpeg4.c +++ b/libavcodec/vdpau_mpeg4.c @@ -110,7 +110,7 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx) return ff_vdpau_common_init(avctx, profile, avctx->level); } -AVHWAccel ff_mpeg4_vdpau_hwaccel = { +const AVHWAccel ff_mpeg4_vdpau_hwaccel = { .name = "mpeg4_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4, diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c index 73d83f6577..671baf96b4 100644 --- a/libavcodec/vdpau_vc1.c +++ b/libavcodec/vdpau_vc1.c @@ -136,7 +136,7 @@ static int vdpau_vc1_init(AVCodecContext *avctx) } #if CONFIG_WMV3_VDPAU_HWACCEL -AVHWAccel ff_wmv3_vdpau_hwaccel = { +const AVHWAccel ff_wmv3_vdpau_hwaccel = { .name = "wm3_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, @@ -153,7 +153,7 @@ AVHWAccel ff_wmv3_vdpau_hwaccel = { }; #endif -AVHWAccel ff_vc1_vdpau_hwaccel = { +const AVHWAccel ff_vc1_vdpau_hwaccel = { .name = "vc1_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index d29607363c..c275e0111e 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -1028,7 +1028,7 @@ static int videotoolbox_frame_params(AVCodecContext *avctx, return 0; } -AVHWAccel ff_h263_videotoolbox_hwaccel = { +const AVHWAccel ff_h263_videotoolbox_hwaccel = { .name = "h263_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H263, @@ -1043,7 +1043,7 @@ AVHWAccel ff_h263_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -AVHWAccel ff_hevc_videotoolbox_hwaccel = { +const AVHWAccel ff_hevc_videotoolbox_hwaccel = { .name = "hevc_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_HEVC, @@ -1059,7 +1059,7 @@ AVHWAccel ff_hevc_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -AVHWAccel ff_h264_videotoolbox_hwaccel = { +const AVHWAccel ff_h264_videotoolbox_hwaccel = { .name = "h264_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, @@ -1075,7 +1075,7 @@ AVHWAccel ff_h264_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { +const AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .name = "mpeg1_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG1VIDEO, @@ -1090,7 +1090,7 @@ AVHWAccel ff_mpeg1_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { +const AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .name = "mpeg2_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, @@ -1105,7 +1105,7 @@ AVHWAccel ff_mpeg2_videotoolbox_hwaccel = { .priv_data_size = sizeof(VTContext), }; -AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { +const AVHWAccel ff_mpeg4_videotoolbox_hwaccel = { .name = "mpeg4_videotoolbox", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4,