From patchwork Sat Sep 18 21:29:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soft Works X-Patchwork-Id: 30363 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp194681iob; Sat, 18 Sep 2021 14:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxxbW9J4mfZdZYMkIfVUlcRSNuhbIHXy3KARemNxb9d/HPmtQhELlyOtMu41Vq2iwYy7FA X-Received: by 2002:a17:906:4cc1:: with SMTP id q1mr19529277ejt.415.1632000567306; Sat, 18 Sep 2021 14:29:27 -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 q20si11448984eds.112.2021.09.18.14.29.26; Sat, 18 Sep 2021 14:29:27 -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=OJX+n34m; 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 A3D8E68AE15; Sun, 19 Sep 2021 00:29:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2049.outbound.protection.outlook.com [40.92.22.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6A94F68AC48 for ; Sun, 19 Sep 2021 00:29:16 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DD0YRmTzWC67koiy1lWJiNndpJL7ohbFtG2FtWhj7HwPVSDQJTi3boKNxAWWnwFxz29fJJOzG8TugNLLqKRUCxXyJ9ilwSfgywjhQ1EphgVbGbPQBf0iSP7xBu2Kus9K1LGg7G5ZLKty2iR5DkcG1a+HWLKQpEGWSAYeihLG8AnctpBokQt6Ai0Yo3u0US4A052dwrOeTbuTx9U2eIyfgCzWrdaCyZnjjg0Pw0NbE+TnP1hauYqO3O9lMprs04L8yPHiQwtR95MkDFSAuDqD1/T7AeAXXp3F2Xv4fS7ByfPL1hPeks7H3UKgJOlCS7p0Y5FWMVPtKZt2/IiwSoFU2w== 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=M2UwDYBRZoZEx8IoIvmAbWBRqrjLpRbfGEsoo53ihCh5rOy2NtjKS6em8x14gMRYkKAaRuFuWkLQNmQSNhTYOiCyQSKncrLQIm2AzkxtxDonaghSC25JCCAjAjXMR2d/NioYah+715kJmAyW4DZddUz6YrbHkbk7AR6jqidRUA2gphzmmbr+cuPtSODTmTt4N8lg3492P8nIyYbAoUIrNxF1AbLtGh8Nb1iBHkS+TgFL7ivfAo4DJl5rf8sxjrGszrcBwiYX1mg96hDNCHyd47UbgoKW24FgblpOngkw6T89QuD48d9unxvPJAmLPZa8YeHmcTMeLYhUY0UvQzEW1g== 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=OJX+n34mz5+mjbFfCZSQl7vWRaIe8tnCqnps5qsuLGWVcwoSEh8WvA1mPcUzjVbuIUCJl7VEZmNndzYsYlsJjB/62uwm4XojZcaBlu8NvQxILSWH0XThEsrbKMJRuSvft6KTlidoX/TgDwH8uqWuAqaOtDIpHlatiDZGKVHJwStJyDl5EPd5n3zlWRcxdA5F6sLtxaYRMJhbMmZqB+BAXGi78SxCYsydErJJxc64XhSwuXpn50hJIRlon81y28NtyOTUTUGKaS+GI1/tOZKe8BBviENewGrsq+dqEzzRgaZ7lmz9VlhiAmFceRx325SrfcOwZuzkUvsNOwuf4BYoKw== Received: from MN2PR04MB5981.namprd04.prod.outlook.com (2603:10b6:208:da::10) by MN2PR04MB5807.namprd04.prod.outlook.com (2603:10b6:208:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.17; Sat, 18 Sep 2021 21:29:13 +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 21:29:13 +0000 From: Soft Works To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH 1/2] avformat/utils: Add av_stream_get_codec_properties() Thread-Index: AQI09Jy4eySOj0vEcqDOTHp+l3W1yA== Date: Sat, 18 Sep 2021 21:29:13 +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: [h+DYCItS5/5ZQA6+lHb9ag8fk62rrEHo] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 96f1d777-f5b9-47df-1fba-08d97aeb5c6f x-ms-traffictypediagnostic: MN2PR04MB5807: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: qtGuUwZDMt/UhcQANcJ15f4UmrGpSEaQT+ZWrT0h1gUjLpUykDA3f4PMd8i0AXFJwRyF/Z5XiKw0nYO87oAGkRX5g3m/7gBanE+pQigm1129oBeJsWk+HH4ZnM4bcPIwG9Ebq/JlicCrQRkE8sn4ehMFUf03nJh7kU8N9zxMn6SDFva4g66ODOnTGjbTWNx9FtQA21UWZzq+2zFKiPIa36fIR7n+AnYsoYuiCONLPA387jF9idmM2Xvllzjf1klVq6WrcQ2LhMoeMb5D9axu/ghi290eJ+OSA7Goqg4u7CEtEp1Z+M56hK+oMqG9bybYcCpyb/LcPKMaUMHKIdibYs0n5/SSPyLDY85gfuwF/KpZ/XhoZZHfHE4r57yvktOu0Lb3z1kV1aRRyCh4VXmLRvU+0ZuAV5vb4vaDk2NAGuzc0KNOeju6OZsSq5Pu68Oy x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: k03O4OjkcGcYMHPxiX70B7CGzMjwcXrUc0HipJng4brcZHBHrt4LPHQHjtSJoyVDni2Hvl3anpBiDZ+fvOdAVn/dWF67iDTWfeg2Z6oo2fpqO/84EADkytJwYb3aCY5/u/jqWmTtx+KfRCjsTQkHPA== 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: 96f1d777-f5b9-47df-1fba-08d97aeb5c6f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2021 21:29:13.5396 (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: MN2PR04MB5807 Subject: [FFmpeg-devel] [PATCH 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: gkZi/WRO0b9k 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, \