From patchwork Sat Sep 18 22:08:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soft Works X-Patchwork-Id: 30364 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp213253iob; Sat, 18 Sep 2021 15:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCDzLOUy+lwcVvxLfaOTmQ0WIAgnyATcgtfbcanTeMgowejYT0yRBKkt5j/YwlQpdRNuQl X-Received: by 2002:a17:906:3591:: with SMTP id o17mr20651726ejb.158.1632002912535; Sat, 18 Sep 2021 15:08:32 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n10si15235546edx.474.2021.09.18.15.08.31; Sat, 18 Sep 2021 15:08: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=@hotmail.com header.s=selector1 header.b=JgL00SoB; arc=fail (body hash mismatch); 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=NONE dis=NONE) header.from=hotmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0209D68AE3C; Sun, 19 Sep 2021 01:08:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10olkn2032.outbound.protection.outlook.com [40.92.41.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D022368AA5D for ; Sun, 19 Sep 2021 01:08:21 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KDol1+f/+6gxjWAVaCHt0Quj6gTh2urgxAaTTlDWxypXe2c53n1l+Mgd7lQsxmUHraQ0+sqNRAM+F8JV5b+cQs4UlM4gNZzjsb0lkmvrvinHDNR3peNAMUC5ZNC1IeMD0qgzhrG+FmINA2XGTnY3GW+t/GcVekIDL2wW+OUhKBhK2BpgbBxCv+Ti9Q9pt2ZXh3WuEBtY9pTzfn7nrCQ+KwQB2dkXYKSUoTrPLzUhTL59bDi1jms9975EDrXcU9aZ9MZx0KqtaTjpjFlH35dP4zSp0Ph/AhNYndB8xZRmPXT/W8fAINmTJXFMcMz46QrqZYe+lZAgPpDi7hmGndV1Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0KDVKQFeAt0qJ2R6H0eMlKBUt3mLY9+bk870X3QCmUU=; b=EBssGPlmhJ+vcoel8rQfkL2F8UraIBH/dbtSnO+aTQjfKObSByXZPr8znGQppJjnUOxJoafDzY9nPBpgVxKRK+2WBUTW4u79wXBBXIxkXW39HNUu/CuE2s1q+LNz58h6tYhogB3pxnWw4uBj81V12vHgzZ5mNPaH9kLz7W7A+RnBRC9p1w5aKXleMOlTnaliKjM6ySLga+TrDG95Qj4xh2Ybe1x5mXbBH5R903OkNmQqucYajattFcOOvbLnROK8laMNdjmB0Fr16QwDRJDokOeR8oN12J2gd5fh12IJnDMm5yS19Yo391ytzQSbuw1DtAm9IJNfBb7fC+qf7Q1EbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0KDVKQFeAt0qJ2R6H0eMlKBUt3mLY9+bk870X3QCmUU=; b=JgL00SoBwb9ugmFn18R7Kg1qv6czH2vjRcmnV9zngg1tzALmTS/Gy54ZWrmZ168XR645f561WeM9TYunQBtHkh+lqNiTb+vsfXhce1y+6KGBLapQsoyqpBytjtWKX7lPJxx1LhLIk9KKozwfAuthDeHjxluqBGj7cmF1dp4CVmETQIxvQLDintZ3wTVvg8NqTOZPTnuCGwRUi/BbPnJr+CgHigHu3Qh5oMI/u6OyBgcMVUH1S38gCC9IM/NqeUROl7S7+jPfSt9lJWNkL/2i+55BFPAGMR1SKAty/CqOSzU6iOX9yF2xYs40DwLtwIcHaY3jXEwj9uNlRStQl7t4lA== Received: from MN2PR04MB5981.namprd04.prod.outlook.com (2603:10b6:208:da::10) by MN2PR04MB6271.namprd04.prod.outlook.com (2603:10b6:208:d6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Sat, 18 Sep 2021 22:08:18 +0000 Received: from MN2PR04MB5981.namprd04.prod.outlook.com ([fe80::ecfe:2528:2012:22cb]) by MN2PR04MB5981.namprd04.prod.outlook.com ([fe80::ecfe:2528:2012:22cb%5]) with mapi id 15.20.4523.018; Sat, 18 Sep 2021 22:08:18 +0000 From: Soft Works To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH v2 1/2] avformat/utils: Add av_stream_get_codec_properties() Thread-Index: AQGqwHKlruLiefxvAGtgYfO4XTJ+Qg== Date: Sat, 18 Sep 2021 22:08:18 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [E5+RBXN6YDE+Cd+61X/tAKVEBUeREmQI] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bc791ad6-f601-4d75-a1c7-08d97af0d252 x-ms-traffictypediagnostic: MN2PR04MB6271: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ud2lQ4Z/ifPkgCepj47oD1VCKXOmGZLFwwe21H4cFJbJHxfSojXKgzUfmY5gZzLSwq1CyrDC8aFfNLt19fsv5qlRjzcF94iyz9tfVKfhWgRG3BMSKZkXbIbnp+EwE4orTWiM+4Jw4pjkK+ITwivEHGe6Hc1xWehNVW+luZaKJGvSqtBTSwLmvDKfwt8J9i9frFhoZS5pbSgCnG0+hI8yKiZkn4i2ZWmmL/DJPUow0jmjvuC3LowkQLBYRlPwBTLJZex5XKiEOpbw20O8zA44wHloV7u3+hQNoF3tBCP9lKymBR+VyTUWaNVTGtE8jue0N1rdJOPzkDCHW1rf3U+7YpYJm2nO/yh5LYGF6oHOwIcNpv29GrHcu63q8EUPdh9jFHfcLBMw+Aj4zTgA3HqH1IPrR3XO1X12IJWNTCSrtCIutMY5Yqua03uGB47VFe5F x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 39q7WWvhLJRWmP4TeqGZuq3qTBuRJltO9AWPj++O8hxXnAdBAII2usqjLFFihaKwAhEJKPzPDwgjXJpdLuXZ+z1M3uMfkfuf0nRy0N1o2SNACuMJp1kC1Dekf5/3Nbv0/Wnq3zhLYX7iYDZMpJbVWg== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-529c7.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB5981.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: bc791ad6-f601-4d75-a1c7-08d97af0d252 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2021 22:08:18.7377 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6271 Subject: [FFmpeg-devel] [PATCH v2 1/2] avformat/utils: Add av_stream_get_codec_properties() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tt9J0Dq3mv/K Signed-off-by: softworkz --- doc/APIchanges | 3 +++ libavformat/avformat.h | 9 +++++++++ libavformat/utils.c | 5 +++++ libavformat/version.h | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index cf6105c99e..fee94ccadd 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2021-04-27 - xxxxxxxxxx - lavf 59.6.100 - avformat.h + Add av_stream_get_codec_properties() + 2021-09-17 - xxxxxxxxxx - lavu 57.5.101 - buffer.h Constified the input parameters in av_buffer_replace(), av_buffer_ref(), and av_buffer_pool_buffer_get_opaque(). diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 3a5bc8a06d..89ed984d1d 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -2763,6 +2763,15 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, */ AVRational av_stream_get_codec_timebase(const AVStream *st); +/** + * Get the internal codec properties from a stream. + * + * See @ref AVCodecContext.properties. + * + * @param st input stream to extract the timebase from + */ +unsigned av_stream_get_codec_properties(const AVStream *st); + /** * @} */ diff --git a/libavformat/utils.c b/libavformat/utils.c index 2b6208e8dc..76d3b0c85e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1945,6 +1945,11 @@ AVRational av_stream_get_codec_timebase(const AVStream *st) return cffstream(st)->avctx->time_base; } +unsigned av_stream_get_codec_properties(const AVStream *st) +{ + return cffstream(st)->avctx->properties; +} + void ff_format_set_url(AVFormatContext *s, char *url) { av_assert0(url); diff --git a/libavformat/version.h b/libavformat/version.h index 13df244d97..d5dd22059b 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -32,7 +32,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 59 -#define LIBAVFORMAT_VERSION_MINOR 5 +#define LIBAVFORMAT_VERSION_MINOR 6 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \