From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id EF95E48A37 for ; Sat, 25 May 2024 14:19:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A548768D586; Sat, 25 May 2024 17:19:02 +0300 (EEST) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7725C68D3BD for ; Sat, 25 May 2024 17:18:55 +0300 (EEST) Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5785f861868so1769319a12.2 for ; Sat, 25 May 2024 07:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716646734; x=1717251534; darn=ffmpeg.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=yrBfMxRVbRa+rHJqDHjdFuibWvnNZ5CTmeRJiFlqBzM=; b=d1tJO7gHQzjD7kqTDrlOroKKZdf/Kvct6jxHN8TsdyV2zbgOPboBiOiQ70Pq7MKszV +GxkAz6MqFYEiCAg1vjVIGoVIWHs86ZYBuerAdk+zZDCm+bNCzhTIgZKWeTg9wKAebEL Wb72u9lpzlJn81FmLDCtbRcV5arZ767f9eBnQ+kBm8EglHDOr7/1xOy+bHiL6/2fjfC+ ikEL2IDCBtoaUXfoq2TjPLELmq8B22FDoGGTm3qI8QKNFBuwBOwSRfJvqWsxnOKAY3cc HDBFMxtkevHCloW+3jNdFt0HObTkmnDQ3PhjhWDBMySi/qzNb8Qs1HqHzuNTTJIp+/jk 6cvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716646734; x=1717251534; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yrBfMxRVbRa+rHJqDHjdFuibWvnNZ5CTmeRJiFlqBzM=; b=n8Dho3iGFGcBuZMhrhn7af2yIjXhPVBk2pr5qhaK+xGeXKoJRSKMzjK/CTuVgLj7h9 2SvxUHSjb8dHZwzjKPrZJKaQZcoul250fxNZ8iKk9hABJqb0gaXwuxCn6i8t69dhoUcw 9BQOGbWUsQ39DEfNEMCLlLzgnIgsT7lGw3weUYJO9T95y3MSLpy6drPvxU0VTsw4AiVr 28PpFLNmZWmebBhny00Jq6uP4RNUZSCDNQYPpxqIHMvSae/nER/sPsXqrX3xn5H2j9jq ZswnIsoIBTnjOMiQmWipfJo9nxlqG/ybkjO+FnipcZkqAvUUYc/6iD/qXGMbkO4C3vya woMw== X-Gm-Message-State: AOJu0Ywj/RFtfCKYH0AaigR8EAx0jjMlnJ002cUGhQ/gaIhKJ3lARcpn ilrl/FNXE4mQE2Bprb4+Xg9qW2xHPnO6sbNiBjRHrMWQckq26jXHji340ozWDuBXHTe3K/g38Yq ijtgAsIbPgXwgEICtEgRrQrCwC5NisQ== X-Google-Smtp-Source: AGHT+IHS9cPbYAeOq9Wph+bNPCfo7BoHPDYb4zI8vg5UwMG/xit9DtsvZhGo5sgIooRAxpkGMSKd1sBc5us8UG56Ol4= X-Received: by 2002:a50:931d:0:b0:578:57b7:9f32 with SMTP id 4fb4d7f45d1cf-57857b7a9a2mr3010624a12.35.1716646734187; Sat, 25 May 2024 07:18:54 -0700 (PDT) MIME-Version: 1.0 References: <20240525103022.1390-1-tong1.wu@intel.com> <20240525103022.1390-7-tong1.wu@intel.com> In-Reply-To: From: Sean McGovern Date: Sat, 25 May 2024 10:18:43 -0400 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v11 07/14] avcodec/vaapi_encode: extract the init and close function to base layer 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi, On Sat, May 25, 2024, 09:07 Lynne via ffmpeg-devel wrote: > On 25/05/2024 12:30, tong1.wu-at-intel.com@ffmpeg.org wrote: > > From: Tong Wu > > > > Related parameters such as device context, frame context are also moved > > to base layer. > > > > Signed-off-by: Tong Wu > > --- > > libavcodec/hw_base_encode.c | 49 ++++++++++++++++++ > > libavcodec/hw_base_encode.h | 17 +++++++ > > libavcodec/vaapi_encode.c | 90 +++++++++++---------------------- > > libavcodec/vaapi_encode.h | 10 ---- > > libavcodec/vaapi_encode_av1.c | 2 +- > > libavcodec/vaapi_encode_h264.c | 2 +- > > libavcodec/vaapi_encode_h265.c | 2 +- > > libavcodec/vaapi_encode_mjpeg.c | 6 ++- > > 8 files changed, 102 insertions(+), 76 deletions(-) > > > > diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c > > index 16afaa37be..c4789380b6 100644 > > --- a/libavcodec/hw_base_encode.c > > +++ b/libavcodec/hw_base_encode.c > > @@ -592,3 +592,52 @@ end: > > > > return 0; > > } > > + > > +int ff_hw_base_encode_init(AVCodecContext *avctx) > > +{ > > + FFHWBaseEncodeContext *ctx = avctx->priv_data; > > This is the issue I was talking about, this requires that > FFHWBaseEncodeContext is always the main context. > > Could you change it so everything takes FFHWBaseEncodeContext as an > argument, rather than AVCodecContext (apart from where the function > absolutely must read some data from it)? > Might this suggestion involve having to do some ugly down-casting? -- Sean McGovern > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".