From patchwork Sun Nov 26 20:51:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 6368 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp881090jah; Sun, 26 Nov 2017 12:51:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMYI8PrWRsgs4zAewWTjKc6IOxfOLGd//OazDiaDrq4ramu81LxiMgkmb/uqLU12hjEVRdFO X-Received: by 10.28.45.214 with SMTP id t205mr15423157wmt.94.1511729517764; Sun, 26 Nov 2017 12:51:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511729517; cv=none; d=google.com; s=arc-20160816; b=dFuDEr3HsCry/vfrQ9SSFtO3+uer8T5NO6tebhX8NaIpMKUjl7qtZkhab/iDdHeJEm ArKYeAjaXO/65hK/YAxfml195RMyn0jkdNRPNPgBgn19OZpds0mJCALBiBrIKwwTkKNq l93AXWkDRgRXAwI1hSxsrWlC6Q1JmZXF72txblgLc6jsKa90U6rKOZQbMgCgo9DwIVH3 X1d+/6k0FTJRAxEr/fWKyB4QiAoxzQYjC6ao3xKY+ynZqKqFxOQsPNafV0XP6ztPdoQF 8SzSrlVzjsUD4vc70kYYqa1BZy5ynv/21TuUtp1eY6FaH9MLB6d7DACgzzAf8P+7s1XW k/Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=IIKOzvkA7sTp1CXVyjOUudYXd+CUs1+bKRpwvxpW/qw=; b=f30cBl3e3fKgVrcd/H3ymbs/BPdNW1dYEWS63EgOrdZzXEBZ3zJEMeveXfJJ8hzSQT Ur/JNog7oRxxmdf7sNwA6+ClQyOF+OoB6QTuxRP4FcEfRiRcIxhNcY4i2ewr6GwnqmcF T3W7SBmqFWarVFo8o/5xrhubQV/1MCM5olWbpU5MDrRhifqjg5V4518L4+MsPn2HJENc VOhdqWd2/UJsRYTNIaJ5DSpB/plva97OVc6TfnFsD5wNPag0aDgDP6FckyYk4AErGW08 aYZTHArXmKtQIJ2Rxe0esf406x4KWXULWsJpGTVzqR2Tqy554h2DMg4QxtXjj2y+FGoy /8mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=HQHfbrQg; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d9si10049001wma.72.2017.11.26.12.51.57; Sun, 26 Nov 2017 12:51:57 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=HQHfbrQg; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D298368A281; Sun, 26 Nov 2017 22:51:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 80EC768A084 for ; Sun, 26 Nov 2017 22:51:34 +0200 (EET) Received: by mail-qk0-f194.google.com with SMTP id p19so30065972qke.2 for ; Sun, 26 Nov 2017 12:51:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=6nosFZ5W1pNd/1irrK82WXLuc6rCGWTvrnwB7wu9rTA=; b=HQHfbrQgFIvg2goD8XKm1m2zOgl/8CuMHvR3/eEAinuF1Ah3c80+r+PfAnqss3wLKp UJqufYV5NQwkubPhRSlGu0bGjq0DfwHeBUJg0giXqg40kR84DY3JiIEZME6Y/UwELgOu Vc18hzHHXNSJGturkHj056yKWsRCCkZozE3Lfu01gM7WD/AbikzAhjTdwOBdlucY1fhs vP26rP9O17+F22KhvfrYlxqaUAJuQW0C0i6OhZs3L7y+58Fbm9pbB5l97+jYP6uz1eHs 8/hFwgvTX9w+DgC3g7ECPLFYXcVRWK7iQhpxxy/lDAOqXbqLbFT7KYLSLGlPTsesmjTM isVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=6nosFZ5W1pNd/1irrK82WXLuc6rCGWTvrnwB7wu9rTA=; b=aPrXdNBMMLVpN/0H1dWWPi4s+WoieLrIZXvuxZd73lK00Qj3h+HNcBvhqivInxn2MS kX8KK7ltgyl8ipU1USBmF90KH5RdTC2qrXpbcOusLq/Gb/tfAqqYORSZsP7685ULvzuj cTQGCgiHAo0Zze/SZPVf6UOBPAWECYn0YqQACJr4Eoa1M40KcSH270goP3GHhRSJ9bJP hbtMsbK+C4jccAUVD5KlwGCklZlA0wSUNUYhmbYYD6mUvHGV+9nSsRI5t+P9VSRYDwtO o978ME0m+JFrHeI64vVNJvW7pZL9mfevLd5qooWA6kAczLSMwUloQqBjntzNa14ryrrI RrEQ== X-Gm-Message-State: AJaThX4qYXPe6P7wrmYy0F02H1qzZO+9d/BL/IRApvjkTq/5EudKbAoi Qc7xPDZDsxQ3kudscOswM3P+OQ== X-Received: by 10.55.142.4 with SMTP id q4mr30649388qkd.35.1511729495293; Sun, 26 Nov 2017 12:51:35 -0800 (PST) Received: from localhost.localdomain ([181.231.59.220]) by smtp.gmail.com with ESMTPSA id g35sm15425640qtk.88.2017.11.26.12.51.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Nov 2017 12:51:34 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 26 Nov 2017 17:51:04 -0300 Message-Id: <20171126205104.1064-3-jamrial@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171126205104.1064-1-jamrial@gmail.com> References: <20171126205104.1064-1-jamrial@gmail.com> Subject: [FFmpeg-devel] [PATCH 3/3] avformat: deprecate AVFMT_FLAG_AUTO_BSF 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The bitstream filters inserted by this option should not be optional. They are needed to succesfully mux files in some cases, and to prevent muxing broken files in others. This is more in line with AVCodec.bsfs() Signed-off-by: James Almer --- libavformat/avformat.h | 4 +++- libavformat/mux.c | 3 --- libavformat/options_table.h | 6 ++++-- libavformat/version.h | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 4f2798a871..e39e5e4ada 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1449,7 +1449,9 @@ typedef struct AVFormatContext { #endif #define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats #define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops. -#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer +#if FF_API_LAVF_AUTO_BSF_FLAG +#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Deprecated, does nothing. +#endif /** * Maximum size of the data read from input for determining diff --git a/libavformat/mux.c b/libavformat/mux.c index ebb9102f11..382c20fc63 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -825,9 +825,6 @@ static int do_packet_auto_bsf(AVFormatContext *s, AVPacket *pkt) { AVStream *st = s->streams[pkt->stream_index]; int i, ret; - if (!(s->flags & AVFMT_FLAG_AUTO_BSF)) - return 1; - if (s->oformat->check_bitstream) { if (!st->internal->bitstream_checked) { if ((ret = s->oformat->check_bitstream(s, pkt)) < 0) diff --git a/libavformat/options_table.h b/libavformat/options_table.h index b8fa47c6fd..8b1e6f3d18 100644 --- a/libavformat/options_table.h +++ b/libavformat/options_table.h @@ -39,7 +39,7 @@ static const AVOption avformat_options[] = { {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D}, {"formatprobesize", "number of bytes to probe file format", OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, INT_MAX-1, D}, {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E}, -{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, "fflags"}, +{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, D|E, "fflags"}, {"flush_packets", "reduce the latency by flushing out packets immediately", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, "fflags"}, {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"}, {"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, "fflags"}, @@ -57,7 +57,9 @@ static const AVOption avformat_options[] = { {"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, D}, {"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, "fflags" }, {"shortest", "stop muxing with the shortest stream", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_SHORTEST }, 0, 0, E, "fflags" }, -{"autobsf", "add needed bsfs automatically", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF }, 0, 0, E, "fflags" }, +#if FF_API_LAVF_AUTO_BSF_FLAG +{"autobsf", "deprecated, does nothing", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF }, 0, 0, E, "fflags" }, +#endif {"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D}, {"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D}, {"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D}, diff --git a/libavformat/version.h b/libavformat/version.h index feb1461c41..d2427dd875 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -82,6 +82,9 @@ #ifndef FF_API_OLD_AVIO_EOF_0 #define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 59) #endif +#ifndef FF_API_LAVF_AUTO_BSF_FLAG +#define FF_API_LAVF_AUTO_BSF_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59) +#endif #ifndef FF_API_R_FRAME_RATE