From patchwork Wed Nov 27 03:11:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 16424 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 429CA44AC54 for ; Wed, 27 Nov 2019 05:12:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10A5068AFBB; Wed, 27 Nov 2019 05:12:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 80FF868AF5E for ; Wed, 27 Nov 2019 05:12:10 +0200 (EET) X-QQ-mid: bizesmtp18t1574824294tc79ho3g Received: from localhost (unknown [47.90.47.25]) by esmtp6.qq.com (ESMTP) with id ; Wed, 27 Nov 2019 11:11:34 +0800 (CST) X-QQ-SSF: 01100000000000K0ZSF1000A0000000 X-QQ-FEAT: tHZj8EofyIUhtycPQ9YEH2x4aX8ou1/YvIGNASiKYvLFFy2xHknhqK1Gvt/pY tQVp10JzCDoR5D5kltnsB8j/HLcT1EMRH8MKAZstnGZIEpWqnVkmjtrq9SLRn0sOCzg+uPs 6TLxHFgvx2GTfWz6mhwtgNt+xrNhyw7zhynBgf3n/t58uW0FKDyRkknJnCVFc+4+A8uHG0Q qH0OWpnKvmHUOubD4KRNFCsyq2heqRgS2uYpsRra2Jc6peEO3DBNckGGlyHL+NX7DloI8NI Nc/Vf+j7imxPh/JCs+/2TTIjLEQ2vSj/d/H99d8mTwx4s+ZoYfMINcL9IN0PXicKnBC0gKD LhJbPJV X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Nov 2019 11:11:30 +0800 Message-Id: <20191127031130.13313-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v2 1/2] avformat/avio: add avio_protocol_get_class X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Suggested-by: Hendrik Leppkes Suggested-by: Nicolas George Signed-off-by: Steven Liu --- doc/APIchanges | 3 +++ libavformat/avio.h | 7 +++++++ libavformat/protocols.c | 10 ++++++++++ libavformat/version.h | 2 +- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 401c65a753..2798bec400 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2019-11-26 - xxxxxxxxxx - lavf 58.36.100 - avio.h + Add avio_protocol_get_class(). + 2019-11-17 - 1c23abc88f - lavu 56.36.100 - eval API Add av_expr_count_vars(). diff --git a/libavformat/avio.h b/libavformat/avio.h index 9141642e75..d022820a6e 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -807,6 +807,13 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); */ const char *avio_enum_protocols(void **opaque, int output); +/** + * Get AVClass by names of available protocols. + * + * @return A AVClass of input protocol name or NULL + */ +const AVClass *avio_protocol_get_class(const char *name); + /** * Pause and resume playing - only meaningful if using a network streaming * protocol (e.g. MMS). diff --git a/libavformat/protocols.c b/libavformat/protocols.c index face5b29b5..29fb99e7fa 100644 --- a/libavformat/protocols.c +++ b/libavformat/protocols.c @@ -107,6 +107,16 @@ const char *avio_enum_protocols(void **opaque, int output) return avio_enum_protocols(opaque, output); } +const AVClass *avio_protocol_get_class(const char *name) +{ + int i = 0; + for (i = 0; url_protocols[i]; i++) { + if (!strcmp(url_protocols[i]->name, name)) + return url_protocols[i]->priv_data_class; + } + return NULL; +} + const URLProtocol **ffurl_get_protocols(const char *whitelist, const char *blacklist) { diff --git a/libavformat/version.h b/libavformat/version.h index bac54aed9d..f72fb9478a 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 58 -#define LIBAVFORMAT_VERSION_MINOR 35 +#define LIBAVFORMAT_VERSION_MINOR 36 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \