From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v2 1/3] avcodec/jpegxl_parser: add JPEG XL parser
Date: Wed, 21 Jun 2023 22:21:25 -0300
Message-ID: <d4a73cde-b0ce-72ea-2316-4f7d7f16ca1a@gmail.com> (raw)
In-Reply-To: <4c842347-9cec-5205-36f4-9da7355d6c28@gmail.com>
On 6/21/2023 10:06 PM, Leo Izen wrote:
> On 6/21/23 20:59, James Almer wrote:
>> On 6/21/2023 9:43 PM, Leo Izen wrote:
>>> diff --git a/libavcodec/jpegxl_parse.c b/libavcodec/jpegxl_parse.c
>>> new file mode 100644
>>> index 0000000000..be360acb08
>>> --- /dev/null
>>> +++ b/libavcodec/jpegxl_parse.c
>>> @@ -0,0 +1,22 @@
>>> +/*
>>> + * JPEG XL Header Parser
>>> + * Copyright (c) 2023 Leo Izen<leo.izen@gmail.com>
>>> + *
>>> + * This file is part of FFmpeg.
>>> + *
>>> + * FFmpeg is free software; you can redistribute it and/or
>>> + * modify it under the terms of the GNU Lesser General Public
>>> + * License as published by the Free Software Foundation; either
>>> + * version 2.1 of the License, or (at your option) any later version.
>>> + *
>>> + * FFmpeg is distributed in the hope that it will be useful,
>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>>> + * Lesser General Public License for more details.
>>> + *
>>> + * You should have received a copy of the GNU Lesser General Public
>>> + * License along with FFmpeg; if not, write to the Free Software
>>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
>>> 02110-1301 USA
>>> + */
>>> +
>>> +#include "jpegxl_parse.h"
>>
>> This is a really weird way to achieve code sharing between libraries.
>> What you named jpegxl_parse.h should be jpegxl_parse.c instead, and
>> jpegxl_parse.h should only have the prototypes for
>> ff_jpegxl_collect_codestream_header() and
>> ff_jpegxl_parse_codestream_header(), plus the definition of
>> FFJXLMetadata. The enums can stay in jpegxl.h, and they for that
>> matter don't need the FF_ prefix.
>
>
> This is based on JEEB's recommendation. He provided these as examples:
>
> https://github.com/jeeb/ffmpeg/commit/b74e47c4ff5bca998936c0d8b9a0892104a7403d
> https://github.com/jeeb/ffmpeg/commit/d7a75d21635eab4f4a1efea22945933059c2e36f
>
> How else should I do it? If I do the usual thing where I put prototypes
> and structs in the header file and the implementation in the C file,
> then I won't be able to compile them into avformat as well, as it will
> just grab the stubs, and the ff_funcs won't be exported from avcodec.
Create a jpegxl_parse.c file in libavformat with the only line being
#include "libavcodec/jpegxl_parse.c"
Then add jpegxl_parse.o to SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) in
libavformat/Makefile.
You can remove jpegxl_parse.o from libavcodec's STLIBOBJS list too.
_______________________________________________
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-22 1:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 0:43 [FFmpeg-devel] [PATCH v2 0/3] JXL Parser and FATE tests Leo Izen
2023-06-22 0:43 ` [FFmpeg-devel] [PATCH v2 1/3] avcodec/jpegxl_parser: add JPEG XL parser Leo Izen
2023-06-22 0:59 ` James Almer
2023-06-22 1:06 ` Leo Izen
2023-06-22 1:21 ` James Almer [this message]
2023-06-22 14:19 ` James Almer
2023-06-22 0:43 ` [FFmpeg-devel] [PATCH v2 2/3] avformat/jpegxl: remove jpegxl_probe, instead call avcodec/jpegxl_parse Leo Izen
2023-06-22 0:43 ` [FFmpeg-devel] [PATCH v2 3/3] fate/jpegxl_anim: add demuxer fate test for jpegxl_anim Leo Izen
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=d4a73cde-b0ce-72ea-2316-4f7d7f16ca1a@gmail.com \
--to=jamrial@gmail.com \
--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