From patchwork Mon Mar 16 21:29:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 18251 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 427D744A851 for ; Mon, 16 Mar 2020 23:30:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21F6B68A04F; Mon, 16 Mar 2020 23:30:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D7B996898F7 for ; Mon, 16 Mar 2020 23:30:52 +0200 (EET) Received: by mail-qt1-f173.google.com with SMTP id n5so15660084qtv.7 for ; Mon, 16 Mar 2020 14:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=TtLZsza9s5fffMUgVUqzaIfMg0q2Ux3ddecWH4DnBcI=; b=nwzyqX6fq3koWW+5dmowA77hf05usQTGZmanHj0/RrqDHlA4BNkLSfJD1EOscckI2F 90M7EJjrRONr0ArD77RiF8w/M/giQ1JhMuFg1OjVtVYJxeDsqVavvZqESnTE+B5fbDKK d9vvoLIMxFvau4JqZ3GgJUJuJBNYGB0p8brTLO74JrU/SLIXSXlr262RBn4UNtPWmorw RthqmPR8Euu39YEnDuL+Fu92Q4Mh8vbSReJcqhaEGM+Mad+sxwaF6AFv6RmfoWJoX4VK ni0D7klbits7pTSBAFZ/gs3vmDEMdLQLJtNNWh+4NwXJ3zQPQUp1Ize0HDrJ0Ci8dGKs e59g== 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:mime-version :content-transfer-encoding; bh=TtLZsza9s5fffMUgVUqzaIfMg0q2Ux3ddecWH4DnBcI=; b=jDdBUwruVk+TNW7Gvckc+KMSy7p/7ToEMUvtecIf5zt+GvGDLvTKdunY2/zWJ0gvRg jvKbMxoCHdfRv0dbRnKy/xma1ClhlA78Omd5pQcb8z2BddjANK3QuBLhNNeViDiznN3j JARyFiSge7lQrB4BtfZERo99Q5f0faFyIzSQpnroL3lL1UhmbC0wllMl9Xj8T7a0rvDq xjmbVtJkdOOzrR06q10nkaydaX5vDetMW1X8mInC65qr7WPkCOe2af+TDJ2++2T1SNYc CRgVgGr5ipsmtezzC4SM1zZ37z7XqIJZOQ6JTyNkyLOiaGKoKs+6qmcB6PzNXX2VhDXY LB8Q== X-Gm-Message-State: ANhLgQ2qkzzFoL5yeQM3Dj6LAe5wFHi9VuWtV8GUcPN3icH3C/IYkqc5 d1K6lr91ostQeGhNPlsBmngBG36w X-Google-Smtp-Source: ADFU+vsSL2tchrUBkd6vQ9Wp05k2/nq7dy65KqTgut7oLwl3npaoQFwtyIzB62E0m+yF5AikufT3SA== X-Received: by 2002:ac8:46d2:: with SMTP id h18mr2220317qto.153.1584394251112; Mon, 16 Mar 2020 14:30:51 -0700 (PDT) Received: from localhost.localdomain ([181.23.71.173]) by smtp.gmail.com with ESMTPSA id r10sm601308qkm.23.2020.03.16.14.30.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 14:30:50 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 16 Mar 2020 18:29:59 -0300 Message-Id: <20200316213002.46612-1-jamrial@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/3 v2] Restructuring the encode API 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This set follows the same logic as 061a0c14bb, but for the encode API: The new public API will no longer be a wrapper around the old deprecated one, and the internal API used by the encoders now consists of a single receive_packet() callback that pulls frames as required. Because of the above, PATCH 1/3 can't be applied until all the relevant encoders have been adapted, and said changes squashed into it. This means librav1e, nvenc, amfenc, v4l2_m2m, and vaapi_enc. I have ported librav1e both to test this set and for it to work as an example for the maintainers of the other three encoders in order to get an idea of what they should do. Similarly, Andriy Gelman ported v4l2_m2m_enc in http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2020-March/258192.html James Almer (3): avcodec/encode: restructure the core encoding code avcodec/encode: restructure the old encode API avcodec/librav1e: adapt to the new internal encode API libavcodec/avcodec.h | 12 +- libavcodec/decode.c | 1 - libavcodec/encode.c | 559 +++++++++++++++++++++--------------------- libavcodec/encode.h | 39 +++ libavcodec/internal.h | 8 +- libavcodec/librav1e.c | 51 ++-- libavcodec/utils.c | 18 +- 7 files changed, 381 insertions(+), 307 deletions(-) create mode 100644 libavcodec/encode.h