From bda56e7d1259047e65c02cc40ab53728eedbfc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Wed, 22 Oct 2025 11:01:21 +0200 Subject: [PATCH 1/2] lavf/mxfdec: Add C++ context --- libavformat/mxfdec.cpp | 5 +++++ libavformat/mxfdec.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/libavformat/mxfdec.cpp b/libavformat/mxfdec.cpp index 1b3c00c07c..522d870981 100644 --- a/libavformat/mxfdec.cpp +++ b/libavformat/mxfdec.cpp @@ -333,6 +333,9 @@ typedef struct MXFIndexTable { int8_t *offsets; /* temporal offsets for display order to stored order conversion */ } MXFIndexTable; +struct MXFCppContext { +}; + /* NOTE: klv_offset is not set (-1) for local keys */ typedef int MXFMetadataReadFunc(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset); @@ -3786,6 +3789,7 @@ int mxf_read_header(AVFormatContext *s) int ret; int64_t run_in; + mxf->cpp_context = new MXFCppContext(); mxf->last_forward_tell = INT64_MAX; if (!mxf_read_sync(s->pb, mxf_header_partition_pack_key, 14)) { @@ -4206,6 +4210,7 @@ int mxf_read_close(AVFormatContext *s) } } av_freep(&mxf->index_tables); + delete mxf->cpp_context; return 0; } diff --git a/libavformat/mxfdec.h b/libavformat/mxfdec.h index 3680e0a8ac..f4ad85fb46 100644 --- a/libavformat/mxfdec.h +++ b/libavformat/mxfdec.h @@ -41,6 +41,7 @@ typedef enum { struct MXFIndexTable; struct MXFMetadataSet; struct MXFPartition; +struct MXFCppContext; typedef struct MXFMetadataSetGroup { struct MXFMetadataSet **metadata_sets; @@ -71,6 +72,7 @@ typedef struct MXFContext { int nb_index_tables; struct MXFIndexTable *index_tables; int eia608_extract; + struct MXFCppContext *cpp_context; //< C++ context } MXFContext; int mxf_probe(const AVProbeData *p); -- 2.47.2