From patchwork Thu May 4 22:02:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 34922 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp12499pzb; Thu, 4 May 2023 14:07:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ApGMb2sWGw8WQ7b9F3Y9kGHfl6jB3Eb9+SR9+GtQN88/Ji3dV5Zs0OhPrPpO+IpGGR/IZ X-Received: by 2002:a05:6402:1644:b0:50b:d701:ea2f with SMTP id s4-20020a056402164400b0050bd701ea2fmr2628922edx.40.1683234424222; Thu, 04 May 2023 14:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234424; cv=none; d=google.com; s=arc-20160816; b=G7oyAX798gs9TIZC3tQLo8Bp39deJR9JO2Vak4psxMyol433jO96iGb+9oCAMMTMtO HiM97bCanA5ErthR57KYxaa+ay18wavDWkyrJc1HRvpkCU+KXJuLGy6YQCeTtZIrat8G fi0sckd0bXOeZ557dLOstWTia4uRc0VuUTO1k04QKwdmSivR3TF2QIcSI30jUJ07mKWi VIRxjOILQesXhchJrqWgOO0BOFRYDI53rL5MUcFmMJUD8AJvyPImtcjJ9g+MHcIQVjgE flsSffvdgFzwbQGrIGBchhhDiFzu6N4REoy6VBOQ9Cjqrdbam6VtWkSJwAvmq9G+oWuS /CTg== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=r5Y+X/BG3tYoGuc3+LdtXwPthf5oaEhc8S/SNG/hcaA=; b=tcCLlGXUF9jU7FwVUB8IIcjX/LODiIdPrFDXFeqjsH/yXZYqRZX1j0YI0PADRIaDYj rSqKpac2Bb8bOeG1DyRYUtgJH4nfjQi4+S+fXJuceDsCb4Bilvg89t/iSpNg8f5kykey DORTc0+LTh8CiVx/G/YHeJ0fuSZ8FpF//sR6g9JmOIpZ+tFj4Md3RQ7WVJOW98pqkX7z OUDTD/NAVLoeXSht7ngSjubAs4GqnlEsL3o8EoJBJ1oYtp3+Lv5rcKzry0W9/akD+9KI Ut/PQemzXng/olMtm+5kIC1GbOr2OZgy30Iotk1FmYN554uiB/CJg1r9VxIVh2Z7nKT0 MszQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ltnglobal-com.20221208.gappssmtp.com header.s=20221208 header.b=0rYVwL3a; 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 b14-20020aa7df8e000000b0050bfcc76f33si2349041edy.260.2023.05.04.14.06.51; Thu, 04 May 2023 14:07:04 -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=@ltnglobal-com.20221208.gappssmtp.com header.s=20221208 header.b=0rYVwL3a; 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 C23EC68C0FE; Fri, 5 May 2023 00:06:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA06C68BF32 for ; Fri, 5 May 2023 00:06:37 +0300 (EEST) Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-3ee339e8c2fso4723731cf.0 for ; Thu, 04 May 2023 14:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20221208.gappssmtp.com; s=20221208; t=1683234395; x=1685826395; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X69K6gjN7meo7LDhY+F+1ue4lQP/KGrvcK0xz2rwQII=; b=0rYVwL3aesSfGNh6xwq8PdLJSo8DVOqSFSBr0BQiGO53kNeMo2bjfAR4brQHITh8ds f4trp5w8p9qmqDQkGOIp+1ZEMO2L008ClafK6we7Nq9+oKfhcG/iSKLudKjj5m0eNnqJ TCZnZ3nrTU50A0DMKWnJx2nosYENrfMyPinXAfirCUPXnO+D8IKtxEGX0bOBV/h3bWaC w8QhZXe5F7SORN/363brrjNDOa5agP39Y1gqoiuvDyDWzzJc+rb/yPG2bgS8p531zbwN qR1l+UsXhzujZ4lw52QS/MfvFxvHU3T2ZxJMY98opzU9zzKcSKd0qGzjxBjnwhLGsJkQ /EXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683234395; x=1685826395; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X69K6gjN7meo7LDhY+F+1ue4lQP/KGrvcK0xz2rwQII=; b=CSl5f+K6Avg9mILCaLCXC5oZKrjoEg01XfDEN6WneR5GF5iQLoc+BO14vjgvCvJchz 5YQ1aCOKSiKcB0oabSVg0v83sqJwjUGtJrV9ACh/jniSBw8ffOPuLdgntG5WfjHjvoaa lwCqdRB8+64thY79Pc/hNJBk8YXZah3e0/O5TmQ4V4FiTmiK74MTMUrWeACJi5/1h6B5 /b+yKqhMXHPruO5Ez/7CxXRyxLlrqWDddoQvJcXX/AptKto7fmYXXJ08xWsfz9jn2MeM nQdUWGnjd6YqfBAiovaGo9m/RNhusCj72MNpQEevQ05qozDZ02ES2NHySwbSNJuQVgX1 QC6w== X-Gm-Message-State: AC+VfDwbsXHyboz1XUqkkDoRueGlO86n0vnbuQzIgLRts/ag/AvXDlZ6 Px0eUktxBsjSTjTS/m3QMs4KYB/aMgAGnUqVTkU= X-Received: by 2002:a05:622a:1011:b0:3ef:3191:f31a with SMTP id d17-20020a05622a101100b003ef3191f31amr7789367qte.54.1683234395603; Thu, 04 May 2023 14:06:35 -0700 (PDT) Received: from ltnt-nyc-580testdevin.livetimenet.com (pool-71-105-132-214.nycmny.fios.verizon.net. [71.105.132.214]) by smtp.gmail.com with ESMTPSA id 4-20020a05620a070400b0074e21c3bc8asm67996qkc.126.2023.05.04.14.06.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 May 2023 14:06:34 -0700 (PDT) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 May 2023 18:02:14 -0400 Message-Id: <1683237740-32743-1-git-send-email-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH v5 0/6] Add support for Closed Caption FIFO 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 Cc: Devin Heitmueller MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: isKMgzOpYeRW This latest update to the patch series includes several fixes from Lance Wang to the vf_ccrepack, as well as incorporating feedback from Anton Khirnov. The primary change across all the filters was to make the filter error out if the ff_ccfifo_alloc() call failed. This is reasonable because as a result of recent changes it cannot fail for any reason other than a memory allocation error. This also dovetails with the change that you're no longer allowed to call inject/extract with the AVCCFifo structure being a NULL pointer, which is what would have happened if we had allowed filters to continue even if the allocation of the ccfifo failed. We've also changed the logic such that now the caller allocates the memory for the buffer to be injected into (per Anton's suggestion), based on a new API call to get the size of the expected output buffer. This avoids dynamically allocating the buffer beforehand and then having to memcpy() the result into whatever memory it really needs to be in (e.g. AVPacket side data). Devin Heitmueller (6): ccfifo: Properly handle CEA-708 captions through framerate conversion vf_fps: properly preserve CEA-708 captions yadif: Properly preserve CEA-708 closed captions tinterlace: Properly preserve CEA-708 closed captions vf_ccrepack: Add new filter to repack CEA-708 side data decklink_enc: add support for playout of 608 captions in MOV files doc/filters.texi | 10 ++ libavdevice/Makefile | 1 + libavdevice/ccfifo.c | 24 +++++ libavdevice/decklink_common.h | 3 + libavdevice/decklink_enc.cpp | 65 +++++++++++++ libavdevice/decklink_enc_c.c | 2 +- libavfilter/Makefile | 2 + libavfilter/allfilters.c | 1 + libavfilter/ccfifo.c | 222 ++++++++++++++++++++++++++++++++++++++++++ libavfilter/ccfifo.h | 110 +++++++++++++++++++++ libavfilter/tinterlace.h | 2 + libavfilter/vf_bwdif.c | 8 ++ libavfilter/vf_ccrepack.c | 102 +++++++++++++++++++ libavfilter/vf_fps.c | 11 ++- libavfilter/vf_tinterlace.c | 11 +++ libavfilter/vf_yadif.c | 8 ++ libavfilter/vf_yadif_cuda.c | 9 ++ libavfilter/yadif.h | 2 + libavfilter/yadif_common.c | 5 + 19 files changed, 596 insertions(+), 2 deletions(-) create mode 100644 libavdevice/ccfifo.c create mode 100644 libavfilter/ccfifo.c create mode 100644 libavfilter/ccfifo.h create mode 100644 libavfilter/vf_ccrepack.c