From patchwork Wed Aug 14 07:59:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc-Antoine ARNAUD X-Patchwork-Id: 51009 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a746:0:b0:489:2eb3:e4c4 with SMTP id f6csp739138vqm; Wed, 14 Aug 2024 00:59:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWd/rYniCthtREodvr6/rhK3LgwMcLoYgvRRuK/V/3HEpREKWdejsyCOUqDqAzTZO6hKedfZ5AbJ8GFWFyVQhj3aBllwm86MDv42A== X-Google-Smtp-Source: AGHT+IF8jaAL06W1rZgPC4WAt3PpYSc16nrNkbim6FbaRLsi8URWxI46jCtlUzWQTulnZxKeDfK5 X-Received: by 2002:a05:6512:282b:b0:530:db20:1f0f with SMTP id 2adb3069b0e04-532edbaa79cmr804582e87.4.1723622365945; Wed, 14 Aug 2024 00:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723622365; cv=none; d=google.com; s=arc-20160816; b=JS+daih2heF2tO+HdusCuVaDIKXr8JLjgY4MAjxdeA84PcIQC//KNdzoGWKJk8GwGc cDbbXGH+ZAzDZ9l229Vno9AEo1ErNsmMWbFBdDnFFLZExs601GSiJEe54k78M/cuaUTf V4Z/AiD9kRlbf0V6DyT497Wnp0qu2cN281vjIhQ0t6M9PeIToo6p33M38AkB1L6iRdDG rxS4TQDbkaYBHyKW9/hjN4FwZRh9ac0KotvJNuD7efwBBzAVaC8Teh0J2dJGu9ALu8mc JoZbuRJZH6jgVBg0dzieuBZzb5bfJ5A7XB/01Wp27yCL4HI+AMRUYSiTne5v2EZXi+fz LjhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=548aUmyTlaL3zPTnV6CQSnl65Qs0NXkxVnk+VdwNJDg=; fh=qIKMPQ0WIlCOJ5tYFeKZn20/nitovp7T9NT4xv7Flp8=; b=BVKmbsMPb+OW9dBiJ3K/LUAt9B8mp9mYBQWWBAnCQX0ckDRA02nqU+4unttz0kvp9x btHrfbgH1TrYku0hw3GyZqX8Po8qwRBtdKvj1SSyjJHCysoClBV2jJb9NpfeDxQp04B+ qKlw6daoDMaREJMBLSKDC4CBOi36O+Puuc0bG6ih3ILsZzfgEnYb3wh9J7lyyRlY+pdR 6FBi4OO0zEHApyCcz8Bi7ZeEJTipBAjL4wN0Qjomwxyyw90ZRzEgGvxHrI9cTB3RhgJ9 9JdoCsCWZly4whPkfbhDllK1F1qZ6WYO2OfnrlUOrPsBjDx56OnkWKuTjDIN2+5cvpU7 SAWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@media-io-com.20230601.gappssmtp.com header.s=20230601 header.b=dbJs6WU1; 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=luminvent.com; dara=fail header.i=@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 2adb3069b0e04-53200e969c4si2580774e87.92.2024.08.14.00.59.25; Wed, 14 Aug 2024 00:59:25 -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=@media-io-com.20230601.gappssmtp.com header.s=20230601 header.b=dbJs6WU1; 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=luminvent.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3FA568DA6B; Wed, 14 Aug 2024 10:59:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 021A268D997 for ; Wed, 14 Aug 2024 10:59:13 +0300 (EEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a83597ce5beso96279066b.1 for ; Wed, 14 Aug 2024 00:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=media-io-com.20230601.gappssmtp.com; s=20230601; t=1723622353; x=1724227153; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=j8AXNmGhLetOfnLCAcH0AxCHOKlwm0HdKkJubH2Bemo=; b=dbJs6WU1WkFBNemZZLH98Uyp5OBjCM9+eyJDekBRbBq0rN/woAmjrieUEM71hptnU2 8/VDfQpchRJnT3AyidJLqLMdfi74hs2kSpZy4vz/ipolle1fw1CVka76yyVSJu9/Hofw E66K+roYRZuI2GHViva3kOYG/XB3vZWFTFiK71doTUGPDST0+aL8089RfSY5p8X10uJV WcuGI88iHVOzZigtherYA//d7pw47PCw4nCaSkI03/GhSS7mH1Ui+fNqMltNRHnoaRJP 8y9298hn+BJ8xN35MKzWLv/FSU6fm3LEJ3AM9gsuK7IBV5FIjqpwFVxLBXpZWJx9Z/WS ClOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723622353; x=1724227153; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j8AXNmGhLetOfnLCAcH0AxCHOKlwm0HdKkJubH2Bemo=; b=gT0oeaO7vPgzWlQbnLifNwB0fUvx3T19a6rJ0OLQmIM6q5UUZgPNGsvNqC9HTLiQPd UjHV6HzP8llGtEmOLl5gKQvFYG3JI8vR3OswU2cVImUzgOkea/CiMSblY2K+GRCDM3jI u7TC9CHS8ANOZBcumv1r0AOYaOL5RrOaIPY//wK5iKykMb7dDAyf1iYbuSV+nISXQQR+ UlD74U8ZLTHpc3ujix/E/wHC6cGai/wyYD9xvvIm4LzrSzsPabcvK30+53I1OW/v94jx QtsRa4Wsv8y59O1qWkXPZrF6erjzkaEf3Rr1m7FlU/07OdsGS/JKTWDCgVnoqLolNsNe 4b7Q== X-Gm-Message-State: AOJu0YwzTCwmvBU4SJc6oU0qCZVIJ/Qx23i2/p9G08Q3YOUn8nOiD8wa xUrZWDxws/XxZjQxrHBZHVkEBfXIvmzhsmJTVUzR3yGni4UqP22Z+HcXaGncD4HQ0au17Jk/h95 eaTHnNQ== X-Received: by 2002:a17:906:dc8e:b0:a7a:8284:c8d6 with SMTP id a640c23a62f3a-a836afcbfcdmr87195466b.24.1723622352153; Wed, 14 Aug 2024 00:59:12 -0700 (PDT) Received: from MBPdeMacAntoine.numericable.fr.numericable.fr (154.217.245.213.rev.sfr.net. [213.245.217.154]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a80f3f45b8bsm143287866b.42.2024.08.14.00.59.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Aug 2024 00:59:11 -0700 (PDT) From: Marc-Antoine Arnaud To: ffmpeg-devel@ffmpeg.org Date: Wed, 14 Aug 2024 09:59:07 +0200 Message-Id: <20240814075908.92916-1-marc-antoine.arnaud@luminvent.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/mxf: start to add mxf_inspect_mode and skip RIP if needed sponsored by nxtedition 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 Cc: Marc-Antoine Arnaud Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: FcxG4lYjGdbL --- libavformat/mxfdec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a5863445ab5..df958819300 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -321,6 +321,7 @@ typedef struct MXFContext { int nb_index_tables; MXFIndexTable *index_tables; int eia608_extract; + int mxf_inspect_mode; } MXFContext; /* NOTE: klv_offset is not set (-1) for local keys */ @@ -3713,7 +3714,9 @@ static int mxf_read_header(AVFormatContext *s) return AVERROR_INVALIDDATA; mxf->run_in = run_in; - mxf_read_random_index_pack(s); + if (mxf->mxf_inspect_mode == 0) { + mxf_read_random_index_pack(s); + } while (!avio_feof(s->pb)) { const MXFMetadataReadTableEntry *metadata; @@ -4261,6 +4264,15 @@ static const AVOption options[] = { { "eia608_extract", "extract eia 608 captions from s436m track", offsetof(MXFContext, eia608_extract), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, + { "mxf_inspect_mode", "the way to inspect MXF file", + offsetof(MXFContext, mxf_inspect_mode), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, + AV_OPT_FLAG_DECODING_PARAM, .unit = "mxf_inspect_mode" }, + { "rip", "Parse RIP, then every body partition", + 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, + AV_OPT_FLAG_DECODING_PARAM, .unit = "mxf_inspect_mode" }, + { "header", "Parse Header, first partition and next partitions if needed", + 0, AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX, + AV_OPT_FLAG_DECODING_PARAM, .unit = "mxf_inspect_mode" }, { NULL }, };