From patchwork Thu Oct 28 22:33:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: quietvoid X-Patchwork-Id: 31245 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:a610:0:0:0:0:0 with SMTP id q16csp1025114ioi; Thu, 28 Oct 2021 15:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU3jISPkKlBCairP+sbPVg3+GkTBC/2fqwIH97FIDbjVj2wH9WcYSiNA2AJuWe/2xkthgN X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr9548129edb.270.1635460532276; Thu, 28 Oct 2021 15:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635460532; cv=none; d=google.com; s=arc-20160816; b=xTRBQ2OuyWvxdJ4NxdLSp/u8ufaP/XmI84O/1OcBK+RVp6Y/2ES1yJQaYPs6ZJszLX SMuDSGoRfJbJDpWbtwlpo86uvYMkYIPzkSZs+90Q61D4QBsgMxlgD/P2RVt/BZX4ITN0 Ue+yslsjwsLbzhleaZ9EZ1jeq61KXv2VbL2WycVOwe2db5cK6W8B2eTbkAckg36FJghr plMel3/+fhYKdUYGAJsW5SXnMka+d9fcW4nuGGG5JTgLwqjBMJs8gaGr9ugAKapX97qc 9czLNqNreEQQz5kH0Q0v3nTLmn20oTDGnLfBxz97sBr1iSkojJe7NracHAch4TIN4dR7 HxpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=IZNBScxZWrBeS7jLbEKZVw4Kv4Z9aQcd8Aa9DT+RKX8=; b=Z1ayHHi5hivlrg232akEAvGlEMjL5r6qK7xm5Aaa2CQkt+LCCnmA9VQxE+WTZ4UNR3 R/bnzZ4q4r2VevLbaIch5Ul0wUAcnQ51jYgeYsKrlczTjv61G5/kY5h23FiTuU0yi/wV TPmlpGDI4k5bQ08jJrsu8tkTQMZzgL8bRK8s5WigwVDZ3pJNvmbna3vuglNNlwG54oSU tFbDkHO5iK27yUT7XGQnYIg99QqKAOsbXyNzfSOTmvJdU2YJVZ8vCiYAvCYND/xGuK9T 3gwXGRy8m76Z2130whf9RUY4N9AtClePHr6EUFkw5/Lg0ceaM4HwQFEzPeVbwcxrVfW8 XvGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=TdpwEf4e; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y17si8716413eda.575.2021.10.28.15.35.31; Thu, 28 Oct 2021 15:35:32 -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=@gmail.com header.s=20210112 header.b=TdpwEf4e; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 978E968AA16; Fri, 29 Oct 2021 01:35:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B6DA68A323 for ; Fri, 29 Oct 2021 01:35:21 +0300 (EEST) Received: by mail-wr1-f46.google.com with SMTP id u18so12812460wrg.5 for ; Thu, 28 Oct 2021 15:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fx/Lfb35DgzFdz6ljjC48jrBAoBrp2UXHd5QkgNsJQ8=; b=TdpwEf4e00uBiP5bimZC4+g4H5GsQ8fUV87AIatvY5bYSgFO39oBoNlNIG3A9hpQc1 hLUiJ+Vq+8r1Zr9wIpV0Cr2ifiUTGSQymz1IQUAL7U4EcbiSlmX/3SM2oLqSpWqvtGWW RnQGKgCdHWcY89Q7bK7qBEpAM3EXrgriOBujaBYKfHDQ97geUZRG+OYtQR8lAWsW+W4K L2TxU6Qz3ty3txG3vz4Gw/RWTftjgOnH0fi6l6WU+CQrqS1LEzajnNb8H55g8XhCoy7T Tcoz2H1+f41HmHq1vF6WCDU3ZfQQI/C5mLRXU5tspgsSu5E8frqhYqNByQpfehIuDr9X pXKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Fx/Lfb35DgzFdz6ljjC48jrBAoBrp2UXHd5QkgNsJQ8=; b=D2MQ+4eVQSfnZeneigYK3bpAKBHTm+uxvYnqL7CL55vJ+vGWvYuIwJaquUl3cej3uH ln91laXWUqUFS9fwG5jwhHEzfux76kLaiiJwG6CCIkZbsqN50Hkndg7EldWpycK0eqYX mzu+hS6CMyp1AQq6LReqQpKuUzeZjtwDp9R8BzgmGI3dQZ1q+VfIr69IUc6fvqg78vao aKSfre0Z/xCeLjT4HXF4Q3N4EQqehxXepBGXX/3t8h/k6jeqRCppdC52TaBKIanA1e6L OMD+MoSvE9tB85ELOcVJaS176C6qSJ8bhf39ntXKTo9gc4ckECl4p/B3pbf0AMoFjzsI iDjg== X-Gm-Message-State: AOAM532OPf4wEL5n5UIIIiwZQOSFFZfRk8rn2XfcJvuIPdHKF3iOXzmH Y8zFNFKltC0mmcUBZBv1kqVljv1pJ5v/nA== X-Received: by 2002:adf:ea81:: with SMTP id s1mr9148815wrm.59.1635460520527; Thu, 28 Oct 2021 15:35:20 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:162:73cc::2]) by smtp.gmail.com with ESMTPSA id x7sm6798265wmi.43.2021.10.28.15.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 15:35:20 -0700 (PDT) From: quietvoid X-Google-Original-From: quietvoid To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Oct 2021 00:33:38 +0200 Message-Id: <20211028223342.1169258-1-tcChlisop0@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v7 0/4] Add support for Matroska BlockAdditionMapping elements 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: quietvoid Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: /qTrX4OIOTHp This patch set adds support for reading/writing the Matroska BlockAdditionMapping elements, as well as for reading/writing dvcC/dvvC blocks in Matroska. Created utility functions to read/write Dolby Vision boxes for ISOM. This was done to avoid duplicating the code, as the Matroska blocks and MOV boxes follow the same specification, defined by Dolby. Refactored the reading/writing in mov/movenc to use the new dovi_isom functions. Differences compared to v6: - Dropped the avformat/mpegts patch as suggested, because the specification is different from the ISOM specification defined by Dolby. - Added a patch to refactor avformat/movenc to further reduce the duplicated code. The implementation in dovi_isom is the same. - Moved init_put_bits after the size validation in ff_isom_put_dvcc_dvvc. - Added dvwC to the ff_isom_put_dvcc_dvvc logging. quietvoid (4): avformat/dovi_isom: Implement Dolby Vision configuration parsing/writing avformat/matroska{dec, enc}: Parse BlockAdditionMapping elements avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvc avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvc libavformat/Makefile | 4 +- libavformat/dovi_isom.c | 121 ++++++++++++++++++++++++++++++++++++++ libavformat/dovi_isom.h | 35 +++++++++++ libavformat/matroska.h | 9 +++ libavformat/matroskadec.c | 58 +++++++++++++++++- libavformat/matroskaenc.c | 45 ++++++++++++++ libavformat/mov.c | 50 +++------------- libavformat/movenc.c | 26 +++----- 8 files changed, 286 insertions(+), 62 deletions(-) create mode 100644 libavformat/dovi_isom.c create mode 100644 libavformat/dovi_isom.h