From patchwork Tue Jan 28 07:44:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 17594 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 015A544A229 for ; Tue, 28 Jan 2020 09:45:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFF6868B31F; Tue, 28 Jan 2020 09:45:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 084D468AF5D for ; Tue, 28 Jan 2020 09:45:24 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 486JYv3w77zQlBc for ; Tue, 28 Jan 2020 08:45:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id NauV1BIKBB3m for ; Tue, 28 Jan 2020 08:45:20 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jan 2020 13:14:42 +0530 Message-Id: <20200128074446.7546-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avformat/format: add av_find_input_format2 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Identifies demuxer by extension if search by short name fails. --- libavformat/avformat.h | 7 +++++++ libavformat/format.c | 14 +++++++++++++- libavformat/version.h | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 9b9b634ec3..c81c4f18fd 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -2246,6 +2246,13 @@ ff_const59 AVInputFormat *av_find_input_format(const char *short_name); */ ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened); +/** + * Find AVInputFormat based on the short name of the input format. + * If that fails and as_extension is set, find demuxer which has registered the + * name as an extension. + */ +ff_const59 AVInputFormat *av_find_input_format2(const char *short_name, int as_extension); + /** * Guess the file format. * diff --git a/libavformat/format.c b/libavformat/format.c index c47490c8eb..d2382d1cd0 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -115,16 +115,28 @@ enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_ return AV_CODEC_ID_NONE; } -ff_const59 AVInputFormat *av_find_input_format(const char *short_name) +ff_const59 AVInputFormat *av_find_input_format2(const char *short_name, int as_extension) { const AVInputFormat *fmt = NULL; void *i = 0; while ((fmt = av_demuxer_iterate(&i))) if (av_match_name(short_name, fmt->name)) return (AVInputFormat*)fmt; + + if (as_extension) { + i = 0; + while ((fmt = av_demuxer_iterate(&i))) + if (fmt->extensions && av_match_name(short_name, fmt->extensions)) + return (AVInputFormat*)fmt; + } return NULL; } +ff_const59 AVInputFormat *av_find_input_format(const char *short_name) +{ + return av_find_input_format2(short_name, 0); +} + ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened, int *score_ret) { diff --git a/libavformat/version.h b/libavformat/version.h index f72fb9478a..15fdb73e3e 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 36 +#define LIBAVFORMAT_VERSION_MINOR 37 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ From patchwork Tue Jan 28 07:44:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 17595 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 EEC1D44A229 for ; Tue, 28 Jan 2020 09:45:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D71FD68B368; Tue, 28 Jan 2020 09:45:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5EB6F68AF5D for ; Tue, 28 Jan 2020 09:45:24 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 486JYv72gQzQl97 for ; Tue, 28 Jan 2020 08:45:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id JuwQOvWpvlBx for ; Tue, 28 Jan 2020 08:45:21 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jan 2020 13:14:43 +0530 Message-Id: <20200128074446.7546-2-ffmpeg@gyani.pro> In-Reply-To: <20200128074446.7546-1-ffmpeg@gyani.pro> References: <20200128074446.7546-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/5] doc/APIchanges: add entry for av_find_input_format2 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- doc/APIchanges | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index 2977b00b60..dc9549f0c8 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2020-01-28 - xxxxxxxxxx - lavf 58.37.100 - avformat.h + Add av_find_input_format2. + 2020-01-15 - xxxxxxxxxx - lavc 58.66.100 - avcodec.h Add AV_PKT_DATA_PRFT and AVProducerReferenceTime. From patchwork Tue Jan 28 07:44:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 17596 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 CA30644A229 for ; Tue, 28 Jan 2020 09:45:33 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B75E068B390; Tue, 28 Jan 2020 09:45:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 38CA168AF5D for ; Tue, 28 Jan 2020 09:45:25 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 486JYw5H89zKmjH for ; Tue, 28 Jan 2020 08:45:24 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id wZDhhWqlifhH for ; Tue, 28 Jan 2020 08:45:22 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jan 2020 13:14:44 +0530 Message-Id: <20200128074446.7546-3-ffmpeg@gyani.pro> In-Reply-To: <20200128074446.7546-1-ffmpeg@gyani.pro> References: <20200128074446.7546-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5] fftools/ffmpeg: switch to av_find_input_format2 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Identifies and sets demuxer based on extension if short name search fails. --- fftools/ffmpeg_opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 1510e026ea..9e1055495b 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1026,7 +1026,7 @@ static int open_input_file(OptionsContext *o, const char *filename) } if (o->format) { - if (!(file_iformat = av_find_input_format(o->format))) { + if (!(file_iformat = av_find_input_format2(o->format, 1))) { av_log(NULL, AV_LOG_FATAL, "Unknown input format: '%s'\n", o->format); exit_program(1); } From patchwork Tue Jan 28 07:44:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 17597 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 DA11544A229 for ; Tue, 28 Jan 2020 09:45:34 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C842868B075; Tue, 28 Jan 2020 09:45:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DFAA468B311 for ; Tue, 28 Jan 2020 09:45:25 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 486JYx3J9mzQlFy for ; Tue, 28 Jan 2020 08:45:25 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id lf3vFLlnbOnD for ; Tue, 28 Jan 2020 08:45:22 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jan 2020 13:14:45 +0530 Message-Id: <20200128074446.7546-4-ffmpeg@gyani.pro> In-Reply-To: <20200128074446.7546-1-ffmpeg@gyani.pro> References: <20200128074446.7546-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] fftools/cmdutils: switch to av_find_input_format2 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Allows matching demuxer by extension e.g. ffmpeg -h demuxer=string will identify demuxer by extension match if id by short name fails. --- fftools/cmdutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 7954f23430..6e507ab552 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -1854,7 +1854,7 @@ static void show_help_codec(const char *name, int encoder) static void show_help_demuxer(const char *name) { - const AVInputFormat *fmt = av_find_input_format(name); + const AVInputFormat *fmt = av_find_input_format2(name, 1); if (!fmt) { av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); From patchwork Tue Jan 28 07:44:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 17598 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 C471044A229 for ; Tue, 28 Jan 2020 09:45:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B1DA768041C; Tue, 28 Jan 2020 09:45:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98A8268B368 for ; Tue, 28 Jan 2020 09:45:26 +0200 (EET) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 486JYy1qtmzQlJK for ; Tue, 28 Jan 2020 08:45:26 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id tXA8JWh1I43A for ; Tue, 28 Jan 2020 08:45:23 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jan 2020 13:14:46 +0530 Message-Id: <20200128074446.7546-5-ffmpeg@gyani.pro> In-Reply-To: <20200128074446.7546-1-ffmpeg@gyani.pro> References: <20200128074446.7546-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avformat/mov: correct to representative names for mov.c 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/mov.c | 6 +++--- libavformat/utils.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 064fa88137..064d2b5f6e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8062,15 +8062,15 @@ static const AVOption mov_options[] = { }; static const AVClass mov_class = { - .class_name = "mov,mp4,m4a,3gp,3g2,mj2", + .class_name = "qt,isobmff", .item_name = av_default_item_name, .option = mov_options, .version = LIBAVUTIL_VERSION_INT, }; AVInputFormat ff_mov_demuxer = { - .name = "mov,mp4,m4a,3gp,3g2,mj2", - .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), + .name = "qt,isobmff", + .long_name = NULL_IF_CONFIG_SMALL("QuickTime / ISO Base Media File Format"), .priv_class = &mov_class, .priv_data_size = sizeof(MOVContext), .extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v", diff --git a/libavformat/utils.c b/libavformat/utils.c index e22ca7cab8..b007127223 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1304,7 +1304,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if (delay == 1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE && presentation_delayed) { av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination %"PRIi64"\n", pkt->dts); - if ( strcmp(s->iformat->name, "mov,mp4,m4a,3gp,3g2,mj2") + if ( strcmp(s->iformat->name, "qt,isobmff") && strcmp(s->iformat->name, "flv")) // otherwise we discard correct timestamps for vc1-wmapro.ism pkt->dts = AV_NOPTS_VALUE; }