Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] avformat/mxf: start to add mxf_inspect_mode and skip RIP if needed sponsored by nxtedition
@ 2024-08-14  7:59 Marc-Antoine Arnaud
  2024-08-14  7:59 ` [FFmpeg-devel] [PATCH 2/2] avformat/mxf: stop parsing if index table is coherent Marc-Antoine Arnaud
  0 siblings, 1 reply; 2+ messages in thread
From: Marc-Antoine Arnaud @ 2024-08-14  7:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Marc-Antoine Arnaud

---
 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 },
 };
 
-- 
2.39.3 (Apple Git-146)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-14  7:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-14  7:59 [FFmpeg-devel] [PATCH 1/2] avformat/mxf: start to add mxf_inspect_mode and skip RIP if needed sponsored by nxtedition Marc-Antoine Arnaud
2024-08-14  7:59 ` [FFmpeg-devel] [PATCH 2/2] avformat/mxf: stop parsing if index table is coherent Marc-Antoine Arnaud

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git