From: "Tomas Härdin" <git@haerdin.se>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] MXF - Add jpeg2000 subdescriptor - Sponsored by INA
Date: Sun, 04 Jun 2023 20:24:31 +0200
Message-ID: <ab7c601f0ab3ad7b39693737a6118854ab4041b9.camel@haerdin.se> (raw)
In-Reply-To: <9072a57e-d067-f28b-010c-f36586a4ba3e@ektacom.com>
tor 2023-06-01 klockan 17:19 +0200 skrev Cédric Le Barz:
> Attach to this mail, is my new patch for adding jpeg2000 sub-
> descriptor
> in MXF file taking into account remarks from FFmpeg community
> (remarks
> from Pierre-Anthony above as well as this from Tomas), i.e. :
>
> 1 - When there is a mismatch in components number, this is now
> process
> as an error.
>
> 2 - When defining and using the J2K descriptor items, I now refer to
> the
> symbol name from the SMPTE registers (X0siz, XT0siz...)
>
> 3 - As suggested, I make use of jpeg2000_read_main_headers() in
> libavcodec. But, I let the parsing function in mxfenc.c file as all
> other parsing functions are in this file (mxf_parse_mpeg2_frame,
> mxf_parse_h264_frame...). The use of jpeg2000_read_main_headers() in
> mxfenc implies some minor modifications in jpeg2000 files :
>
> * rename of Jpeg2000Tile structure to J2kTile in j2kenc.c (to avoid
> redefinition)
>
> * move some structure declarations from jpeg2000dec.c to jpeg2000.h
>
> * make jpeg2000_read_main_headers() function "public"
For this you need to prefix the name with ff_ and bump libavcodec's
minor version number
> +static int mxf_parse_jpeg2000_frame(AVFormatContext *s, AVStream
> *st, AVPacket *pkt)
> +{
> + MXFContext *mxf = s->priv_data;
> + MXFStreamContext *sc = st->priv_data;
> + int component_count = av_pix_fmt_count_planes(st->codecpar-
> >format);
> + Jpeg2000DecoderContext jpeg2000ctx;
This makes sizeof(Jpeg2000DecoderContext) part of the public API which
is a big no-no. Consider making the fields part of a different smaller
struct instead that is also included in Jpeg2000DecoderContext. The
safest option is to have a function that allocates that struct. The
reason for this is because we might want to read other things from the
headers at a later date. Another possibility is to pass a bunch of
pointers to ints that the parsed values get written to. If at a later
date we need to parse more fields then we can introduce
ff_jpeg2000_read_main_headers_2() and so on. The latter seems easier
API stability wise, if a bit tedious with the number of function
arguments.
/Tomas
_______________________________________________
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".
next prev parent reply other threads:[~2023-06-04 18:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 20:54 Cédric Le Barz
2023-03-31 21:47 ` Michael Niedermayer
2023-04-03 8:08 ` Cédric Le Barz
2023-04-03 15:14 ` Michael Niedermayer
2023-04-05 13:05 ` Cédric Le Barz
2023-04-05 13:53 ` Tomas Härdin
2023-04-25 14:33 ` Cédric Le Barz
2023-04-27 12:45 ` Tomas Härdin
2023-05-02 15:43 ` Cédric Le Barz
2023-05-09 9:49 ` Tomas Härdin
2023-05-09 14:28 ` Pierre-Anthony Lemieux
2023-06-01 15:19 ` Cédric Le Barz
2023-06-04 18:24 ` Tomas Härdin [this message]
2023-09-22 9:26 ` Cédric Le Barz
2023-04-05 12:39 ` Tomas Härdin
2023-04-23 1:07 ` Pierre-Anthony Lemieux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab7c601f0ab3ad7b39693737a6118854ab4041b9.camel@haerdin.se \
--to=git@haerdin.se \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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