From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4316B45CCA for ; Mon, 3 Apr 2023 08:41:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DA05168BE25; Mon, 3 Apr 2023 11:41:05 +0300 (EEST) Received: from gandalf.ektacom.com (gandalf.ektacom.com [62.23.45.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C481F68BCF2 for ; Mon, 3 Apr 2023 11:40:58 +0300 (EEST) Received: from ektacom.com (82-64-203-93.subs.proxad.net [82.64.203.93]) by gandalf.ektacom.com (Postfix) with ESMTP id 6F93245A266 for ; Mon, 3 Apr 2023 10:40:58 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------76LxQIPsoYQ8tOSvPWjd1QrQ" Message-ID: <98f713bd-d8ba-72f2-1fc3-5fd13f7f396e@ektacom.com> Date: Mon, 3 Apr 2023 10:40:54 +0200 MIME-Version: 1.0 Content-Language: en-US From: =?UTF-8?Q?C=c3=a9dric_Le_Barz?= To: ffmpeg-devel@ffmpeg.org References: <7a2b39bf-9036-7bfa-3448-335c11f51cac@ektacom.com> In-Reply-To: <7a2b39bf-9036-7bfa-3448-335c11f51cac@ektacom.com> X-MailScanner-ID: 7CEE31B1BC09.A88FF X-MailScanner: Found to be clean X-MailScanner-From: clebarz@ektacom.com X-Spam-Status: No Subject: Re: [FFmpeg-devel] [PATCH] MXF - Declare unused JPEG2000 tags in MXF file - Sponsored by INA 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This is a multi-part message in MIME format. --------------76LxQIPsoYQ8tOSvPWjd1QrQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I've attached the patch to this mail, in order to solve newlines insertion issue. Regards, Cédric Le 29/03/2023 à 23:31, Cédric Le Barz a écrit : > > Declare unused JPEG2000 tags in MXF file. > > Signed-off-by: Cedric Le Barz > --- >  ffmpeg/libavformat/mxfenc.c | 22 +++++++++++++++++++--- >  1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/ffmpeg/libavformat/mxfenc.c b/ffmpeg/libavformat/mxfenc.c > index bfbd5a6..67d8f67 100644 > --- a/ffmpeg/libavformat/mxfenc.c > +++ b/ffmpeg/libavformat/mxfenc.c > @@ -542,7 +542,7 @@ static void mxf_write_primer_pack(AVFormatContext *s) >      MXFContext *mxf = s->priv_data; >      AVIOContext *pb = s->pb; >      int local_tag_number = MXF_NUM_TAGS, i; > -    int will_have_avc_tags = 0, will_have_mastering_tags = 0; > +    int will_have_avc_tags = 0, will_have_mastering_tags = 0, > will_have_jpeg2000_tags = 0; >       for (i = 0; i < s->nb_streams; i++) { >          MXFStreamContext *sc = s->streams[i]->priv_data; > @@ -552,6 +552,9 @@ static void mxf_write_primer_pack(AVFormatContext *s) >          if (av_stream_get_side_data(s->streams[i], > AV_PKT_DATA_MASTERING_DISPLAY_METADATA, NULL)) { >              will_have_mastering_tags = 1; >          } > +        if (s->streams[i]->codecpar->codec_id == AV_CODEC_ID_JPEG2000){ > +            will_have_jpeg2000_tags = 1; > +        } >      } >       if (!mxf->store_user_comments) { > @@ -574,6 +577,21 @@ static void mxf_write_primer_pack(AVFormatContext > *s) >          mxf_mark_tag_unused(mxf, 0x8304); >      } >  +    if (!will_have_jpeg2000_tags) { > +        mxf_mark_tag_unused(mxf, 0x8401); > +        mxf_mark_tag_unused(mxf, 0x8402); > +        mxf_mark_tag_unused(mxf, 0x8403); > +        mxf_mark_tag_unused(mxf, 0x8404); > +        mxf_mark_tag_unused(mxf, 0x8405); > +        mxf_mark_tag_unused(mxf, 0x8406); > +        mxf_mark_tag_unused(mxf, 0x8407); > +        mxf_mark_tag_unused(mxf, 0x8408); > +        mxf_mark_tag_unused(mxf, 0x8409); > +        mxf_mark_tag_unused(mxf, 0x840A); > +        mxf_mark_tag_unused(mxf, 0x840B); > +        mxf_mark_tag_unused(mxf, 0x840C); > +    } > + >      for (i = 0; i < MXF_NUM_TAGS; i++) { >          if (mxf->unused_tags[i]) { >              local_tag_number--; > @@ -1297,7 +1315,6 @@ static int64_t > mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID >          f1 *= 2; >      } >  - >      mxf_write_local_tag(s, 16, 0x320D); >      avio_wb32(pb, 2); >      avio_wb32(pb, 4); > @@ -3406,4 +3423,3 @@ const FFOutputFormat ff_mxf_opatom_muxer = { >      .p.priv_class      = &mxf_opatom_muxer_class, >  }; >  - --------------76LxQIPsoYQ8tOSvPWjd1QrQ Content-Type: message/rfc822; name="0001-Declare-unused-JPEG2000-tags-in-MXF-file.eml" Content-Disposition: attachment; filename="0001-Declare-unused-JPEG2000-tags-in-MXF-file.eml" Content-Transfer-Encoding: 7bit From: Cedric Le Barz Date: Wed, 29 Mar 2023 23:28:56 +0200 Subject: [PATCH] Declare unused JPEG2000 tags in MXF file. X-Unsent: 1 To: ffmpeg-devel@ffmpeg.org Signed-off-by: Cedric Le Barz --- ffmpeg/libavformat/mxfenc.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/ffmpeg/libavformat/mxfenc.c b/ffmpeg/libavformat/mxfenc.c index bfbd5a6..67d8f67 100644 --- a/ffmpeg/libavformat/mxfenc.c +++ b/ffmpeg/libavformat/mxfenc.c @@ -542,7 +542,7 @@ static void mxf_write_primer_pack(AVFormatContext *s) MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; int local_tag_number = MXF_NUM_TAGS, i; - int will_have_avc_tags = 0, will_have_mastering_tags = 0; + int will_have_avc_tags = 0, will_have_mastering_tags = 0, will_have_jpeg2000_tags = 0; for (i = 0; i < s->nb_streams; i++) { MXFStreamContext *sc = s->streams[i]->priv_data; @@ -552,6 +552,9 @@ static void mxf_write_primer_pack(AVFormatContext *s) if (av_stream_get_side_data(s->streams[i], AV_PKT_DATA_MASTERING_DISPLAY_METADATA, NULL)) { will_have_mastering_tags = 1; } + if (s->streams[i]->codecpar->codec_id == AV_CODEC_ID_JPEG2000){ + will_have_jpeg2000_tags = 1; + } } if (!mxf->store_user_comments) { @@ -574,6 +577,21 @@ static void mxf_write_primer_pack(AVFormatContext *s) mxf_mark_tag_unused(mxf, 0x8304); } + if (!will_have_jpeg2000_tags) { + mxf_mark_tag_unused(mxf, 0x8401); + mxf_mark_tag_unused(mxf, 0x8402); + mxf_mark_tag_unused(mxf, 0x8403); + mxf_mark_tag_unused(mxf, 0x8404); + mxf_mark_tag_unused(mxf, 0x8405); + mxf_mark_tag_unused(mxf, 0x8406); + mxf_mark_tag_unused(mxf, 0x8407); + mxf_mark_tag_unused(mxf, 0x8408); + mxf_mark_tag_unused(mxf, 0x8409); + mxf_mark_tag_unused(mxf, 0x840A); + mxf_mark_tag_unused(mxf, 0x840B); + mxf_mark_tag_unused(mxf, 0x840C); + } + for (i = 0; i < MXF_NUM_TAGS; i++) { if (mxf->unused_tags[i]) { local_tag_number--; @@ -1297,7 +1315,6 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID f1 *= 2; } - mxf_write_local_tag(s, 16, 0x320D); avio_wb32(pb, 2); avio_wb32(pb, 4); @@ -3406,4 +3423,3 @@ const FFOutputFormat ff_mxf_opatom_muxer = { .p.priv_class = &mxf_opatom_muxer_class, }; - -- 2.34.1 --------------76LxQIPsoYQ8tOSvPWjd1QrQ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --------------76LxQIPsoYQ8tOSvPWjd1QrQ--