From patchwork Tue Jul 19 12:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 36835 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1649:b0:8b:613a:194d with SMTP id no9csp1714562pzb; Tue, 19 Jul 2022 05:26:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s39rDnxvYNYU0x1OZ48m26aj7ZVloet/LFXglmldw0+jFRITMN1+in1ts/Y5BBCQcwrhHR X-Received: by 2002:a17:907:1c8c:b0:72b:6b8f:4add with SMTP id nb12-20020a1709071c8c00b0072b6b8f4addmr29970836ejc.556.1658233607097; Tue, 19 Jul 2022 05:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658233607; cv=none; d=google.com; s=arc-20160816; b=JAMuk0iwm8u+csiaA9kqeS5+Z5rgD3MldJGHLzD3ab9JhL2hNxx2psiYWRrQLI20rO hJdSa5uEPks5BS+tXvx8NYCgP5PNuCTcpa+WJVqlpwC5J5UULmymnMw9x37EoLY0hBTw oFH9IHL5AxI2BKLfRDACDC0P1V1gEQFzdRkrov1MCcb66aWMDmHxGDhaO5Noiwug5Z67 NK1Q5N2Dj6RIGOoW3sF2CTO0solq6l6IQGmLNgTdIyF/yJderX521G/Dk1vWNvGdL5bl /fxt4ndMYrh8e6Ooj02FAdvpv5tR9sLa6tToddhJn4POG05stkk9kkbCcNOUnfiOGHdY mRvw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=MhdTUffdozCG+h0ujwp3bwT/Yl6lLVTsj3TY3I5kglY=; b=cWP7j525Iv23xdpBVHzTAqsMZmzf5/79Dpvvxh93HBWRdyp8U8L1JEDtNE9ck1D3VX 0x316obNa8yToY+PB/ZdkOKBFkrOncvByJUh0oSQE5nygjcTbmegXyko3++7hLraIsGW N8ZZ0N5eLYZuNpOb3JEo1OkcQ+4qeQKxSpjM+2H2yqspgDOp26h0jRk/RKtGRRVbYuuH mNn2TxQOUEUL57eabQZdbDW7NxBE8t0OTJihIpLds+bBTd9BynbSOYEjiAGHVBaObGFr 0PdtVk9Ab2IOELZJfcK+YMhBC533caWylkh/SPIJ8vEjdq/uqEApLnqaxYdqN1LbInTj xP2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=EQCkh2Mu; 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 qu16-20020a170907111000b0072642bbc8cfsi17081368ejb.914.2022.07.19.05.26.46; Tue, 19 Jul 2022 05:26:47 -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=@haasn.xyz header.s=mail header.b=EQCkh2Mu; 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 4721968B6A1; Tue, 19 Jul 2022 15:26:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 891BC68B590 for ; Tue, 19 Jul 2022 15:26:10 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 4AA254A9C8; Tue, 19 Jul 2022 14:26:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1658233570; bh=LKvAv0huqSSjfxwu/67t5x5AkfMy5P/jdnymE+Rr1ps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EQCkh2Mu5ksuxeyvYD7+fA0Ug2ZsyBUhLnEC+wROG5SQBNYI49WomWrGWp8Ai08QG EUJU22x1aQJEHMOgO7S+xMtWMAXGiH0sCu5WCMoz8ZRtHqnzuRxybOawtpwqi/v7iQ Ca7G37iNdhCF4ZpTcXx45FevDV5WvhxO9MZ9OF+4= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Jul 2022 14:26:05 +0200 Message-Id: <20220719122608.43974-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719122608.43974-1-ffmpeg@haasn.xyz> References: <20220719122608.43974-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/6] avcodec: add API for automatic handling of icc profiles 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7chal5tzo0Dr From: Niklas Haas This functionally already exists, but as pointed out in #9672 and #9673, requiring users to manually include filters is clumsy, error-prone and hard to use together with tools like ffplay. To streamline ICC profile support, add a new AVCodecContext flag to globally enable reading and writing ICC profiles, automatically, for all appropriate media types. Note that this commit only includes the new API. The implementation is split off to separate commits for readability. Signed-off-by: Niklas Haas --- doc/APIchanges | 5 ++++- libavcodec/avcodec.h | 6 ++++++ libavcodec/version.h | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index b3563cd528..2dab01ab96 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,12 +14,15 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-07-xx - xxxxxxxxx - lavc 59.40.100 - avcodec.h + Add the AV_CODEC_FLAG2_ICC_PROFILES flag to AVCodecContext, to enable + automatic reading and writing of embedded ICC profiles in image files. + 2022-07-xx - xxxxxxxxxx - lavu 57.30.100 - frame.h Add AVFrame.duration, deprecate AVFrame.pkt_duration. -------- 8< --------- FFmpeg 5.1 was cut here -------- 8< --------- -2022-06-12 - 7cae3d8b76 - lavf 59.25.100 - avio.h Add avio_vprintf(), similar to avio_printf() but allow to use it from within a function taking a variable argument list as input. diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index cb5c25bf63..60b215d2e9 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -331,6 +331,12 @@ typedef struct RcOverride{ * Do not reset ASS ReadOrder field on flush (subtitles decoding) */ #define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) +/** + * Generate/parse ICC profiles on encode/decode, as appropriate for the type of + * file. No effect on codecs which cannot contain embedded ICC profiles, or + * when compiled without support for lcms2. + */ +#define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31) /* Unsupported options : * Syntax Arithmetic coding (SAC) diff --git a/libavcodec/version.h b/libavcodec/version.h index f2f14eaed1..19f3f4a272 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 39 +#define LIBAVCODEC_VERSION_MINOR 40 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \