From patchwork Thu Jun 7 23:43:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 9286 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp192784jad; Thu, 7 Jun 2018 16:44:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJUjCTCmiBXCXPxD+tEJbd7cY2YCWWy2NZcyKe9Yk1L1/fL+YWz57XVFyQpkisGWJYx5qMF X-Received: by 2002:adf:a148:: with SMTP id r8-v6mr3079495wrr.104.1528415073173; Thu, 07 Jun 2018 16:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528415073; cv=none; d=google.com; s=arc-20160816; b=VCYSegRDjB5yii6nxLJmnqAJmkqRkpcR7GyyJjR+EehvAWQl+pQ9VSowOQ4QscmYp1 spo9cK+eJq3Rgtt+Ss31NOow3g54OzdAfk5VX7fr1uIR3Ddwhhwx7EX41guX6bonVAH9 9t/F3sp/Ki4PuJrU6S6ADeBE45JXPlPF+z15aHJHZi4fV7fgHPbbTj5mwFm6QYUUa3d3 fJ5uZ4pquiGsdrHulOuV6vUss1n4n7K2vMg+CXm7zn6b+MFGDMiEjhUZyu1HD3HaQuig UUiEgNLDBL/6SdrfLR6S97ZtRivJmJ7NhWNbfHLqWo/qbMepP+2QWsfnQ3ugCfv0Sx98 vygQ== 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=yxteB1QU+6BYOMik1AxayE67j96XeEbYBnWK9b/D6rc=; b=CI5943wqIf5nrHN2DJO+Ks2pMaqtntyTw5UUGQdjEAicziJEozuvtWIxHmkXOK4VcS 2NMJfDnTdlwcwk/3I3nAvEqwql3dzDA3fTYnuHcKRyJJtB1zNyqDKIwj+yX8gwmpIh9r F7KZZmJLvkkFiOeED7VYm1M9SsPhoxtYZMET0HIplkjCGbvmqUULL0ct61gM2pMIPRbS zPlbMsF6T+kPBExJ8QPasZdUsmUlQ08lWCi/jmzE5t5SVk6j+5XYu80SgeuHXb5AOn+1 ahpFju325zcAwIsrsDjyNn1/VdL1RT55drc28qkjnMy10jtpre9mQKsaFZHoromAmRQQ UOGQ== 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=sCOKztCW; 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 d129-v6si77483wme.168.2018.06.07.16.44.31; Thu, 07 Jun 2018 16:44:33 -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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=sCOKztCW; 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 7787C68A696; Fri, 8 Jun 2018 02:43:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3007A68A6C3 for ; Fri, 8 Jun 2018 02:43:00 +0300 (EEST) Received: by mail-wm0-f53.google.com with SMTP id v131-v6so271697wma.1 for ; Thu, 07 Jun 2018 16:43:48 -0700 (PDT) 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=dxOEX+RMOE446dfNOkNMX/6q+BXBOlwNCwY/D0QVjSk=; b=sCOKztCWZxHEQOJJYVDT9jsHdm+ozJM0ub4dAFYqx+gmT3fGFamsNS/MEggh55B3AZ IuYbstUKGnz7JyU9s5UYfe9+5KXYzeUUbJF/Z0YeX05KY/MSPWkhv1so4U1Ztjc2bZ2b sbYdtqCwZxT7fTbLnwjVFeFKE1KLdc6wh6HbAgYzHy81mqZxDui9RLD2Kro6NjXQQ8bY 2bU36jTQpJaHMwvuJbfrihUBcXtbz63VK18RQXKZZY6MLqWUJ5Yo6wsAidoWuWmLIfa4 /u16HNbrBNJD4D0ElkWG0dw1vZehW0y5gm//wauxUCbeMBBNtlJsSCL7p15s0s8jcPE6 r4QQ== 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=dxOEX+RMOE446dfNOkNMX/6q+BXBOlwNCwY/D0QVjSk=; b=cknf1jZTeJOe6VAJbWwzJlHfY5GSGz0Bw3sng9xI2TDVC4azsReEsmXltvt2jXT24X CryXySOZnXeynUAL4h6oJoxw28L5esdVTgie+LnrteNlm2kCl5hUUzywYVWXrm0m7M98 RiXaxqeX/h9d0emiB8SYzg0wOI7eH47IQah7AMVKgA+Gf6LjWFmIbm3I5EmrPLS3JvJ8 wWpEe3Yz/pnVuG8YR3PfjRXOIS315hk1IVChoM3Ljp8qWgk4CqIWKowb3YNJ9rGYpwmz X3MJm4LNEaLghkgsIiH1XeC7Hfp8j3Pf7HiJ4mfo7Eyo1n97obka+i1OTIdf17yX9J4T /lUA== X-Gm-Message-State: APt69E0zXxGRRGVGAMm1AwXfzN44d/j8/Ue/+9m9y3LfnknPpkYcfftt Vr/5EWykiLaeCm69WuZJZxtkNJqe X-Received: by 2002:a1c:a54e:: with SMTP id o75-v6mr2971173wme.157.1528415027342; Thu, 07 Jun 2018 16:43:47 -0700 (PDT) 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 r2-v6sm18640545wrq.55.2018.06.07.16.43.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 16:43:46 -0700 (PDT) From: Mark Thompson To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 Jun 2018 00:43:03 +0100 Message-Id: <20180607234331.32139-9-sw@jkqxz.net> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180607234331.32139-1-sw@jkqxz.net> References: <20180607234331.32139-1-sw@jkqxz.net> Subject: [FFmpeg-devel] [PATCH v2 08/36] vaapi_encode: Remove common priv_data and options fields 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" The codec-specific context now contains both the common context and the codec-specific options directly. --- libavcodec/vaapi_encode.c | 10 ---------- libavcodec/vaapi_encode.h | 11 ----------- libavcodec/vaapi_encode_h264.c | 2 -- libavcodec/vaapi_encode_h265.c | 2 -- libavcodec/vaapi_encode_mjpeg.c | 2 -- libavcodec/vaapi_encode_mpeg2.c | 2 -- libavcodec/vaapi_encode_vp8.c | 2 -- libavcodec/vaapi_encode_vp9.c | 2 -- 8 files changed, 33 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index 910fd1b365..cedf3d3549 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -1372,17 +1372,9 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - ctx->codec_options = ctx->codec_options_data; - ctx->va_config = VA_INVALID_ID; ctx->va_context = VA_INVALID_ID; - ctx->priv_data = av_mallocz(ctx->codec->priv_data_size); - if (!ctx->priv_data) { - err = AVERROR(ENOMEM); - goto fail; - } - ctx->input_frames_ref = av_buffer_ref(avctx->hw_frames_ctx); if (!ctx->input_frames_ref) { err = AVERROR(ENOMEM); @@ -1583,7 +1575,5 @@ av_cold int ff_vaapi_encode_close(AVCodecContext *avctx) av_buffer_unref(&ctx->input_frames_ref); av_buffer_unref(&ctx->device_ref); - av_freep(&ctx->priv_data); - return 0; } diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index bcb9d57371..c7370a17e2 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -113,9 +113,6 @@ typedef struct VAAPIEncodeContext { // Everything above this point must be set before calling // ff_vaapi_encode_init(). - // Codec-specific state. - void *priv_data; - // Configuration attributes to use when creating va_config. VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]; int nb_config_attributes; @@ -205,18 +202,10 @@ typedef struct VAAPIEncodeContext { int gop_counter; int p_counter; int end_of_stream; - - // Codec-local options are allocated to follow this structure in - // memory (in the AVCodec definition, set priv_data_size to - // sizeof(VAAPIEncodeContext) + sizeof(VAAPIEncodeFooOptions)). - void *codec_options; - char codec_options_data[0]; } VAAPIEncodeContext; typedef struct VAAPIEncodeType { - size_t priv_data_size; - // Perform any extra codec-specific configuration after the // codec context is initialised (set up the private data and // add any necessary global parameters). diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 26061974a4..8f999b2311 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -867,8 +867,6 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) } static const VAAPIEncodeType vaapi_encode_type_h264 = { - .priv_data_size = sizeof(VAAPIEncodeH264Context), - .configure = &vaapi_encode_h264_configure, .sequence_params_size = sizeof(VAEncSequenceParameterBufferH264), diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index 757fd74c30..8f191efc4b 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -1026,8 +1026,6 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx) } static const VAAPIEncodeType vaapi_encode_type_h265 = { - .priv_data_size = sizeof(VAAPIEncodeH265Context), - .configure = &vaapi_encode_h265_configure, .sequence_params_size = sizeof(VAEncSequenceParameterBufferHEVC), diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c index 983c77d194..481981a71c 100644 --- a/libavcodec/vaapi_encode_mjpeg.c +++ b/libavcodec/vaapi_encode_mjpeg.c @@ -360,8 +360,6 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx) } static const VAAPIEncodeType vaapi_encode_type_mjpeg = { - .priv_data_size = sizeof(VAAPIEncodeMJPEGContext), - .configure = &vaapi_encode_mjpeg_configure, .picture_params_size = sizeof(VAEncPictureParameterBufferJPEG), diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c index ae77a9ce76..5577fa9e04 100644 --- a/libavcodec/vaapi_encode_mpeg2.c +++ b/libavcodec/vaapi_encode_mpeg2.c @@ -553,8 +553,6 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx) } static const VAAPIEncodeType vaapi_encode_type_mpeg2 = { - .priv_data_size = sizeof(VAAPIEncodeMPEG2Context), - .configure = &vaapi_encode_mpeg2_configure, .sequence_params_size = sizeof(VAEncSequenceParameterBufferMPEG2), diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c index ab5e0b2dda..6cdd30abda 100644 --- a/libavcodec/vaapi_encode_vp8.c +++ b/libavcodec/vaapi_encode_vp8.c @@ -178,8 +178,6 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx) static const VAAPIEncodeType vaapi_encode_type_vp8 = { .configure = &vaapi_encode_vp8_configure, - .priv_data_size = sizeof(VAAPIEncodeVP8Context), - .sequence_params_size = sizeof(VAEncSequenceParameterBufferVP8), .init_sequence_params = &vaapi_encode_vp8_init_sequence_params, diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c index 6e62213bc9..bf99597e4c 100644 --- a/libavcodec/vaapi_encode_vp9.c +++ b/libavcodec/vaapi_encode_vp9.c @@ -206,8 +206,6 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx) static const VAAPIEncodeType vaapi_encode_type_vp9 = { .configure = &vaapi_encode_vp9_configure, - .priv_data_size = sizeof(VAAPIEncodeVP9Context), - .sequence_params_size = sizeof(VAEncSequenceParameterBufferVP9), .init_sequence_params = &vaapi_encode_vp9_init_sequence_params,