From: "softworkz ." <softworkz-at-hotmail.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3 1/2] fftools/resources: clean up and improve resource manager build system
Date: Fri, 30 May 2025 22:56:15 +0000
Message-ID: <DM8P223MB0365AEA52ADF2539ACDFC62CBA61A@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250530105206.15164-1-ramiro.polla@gmail.com>
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Ramiro Polla
> Sent: Freitag, 30. Mai 2025 12:52
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v3 1/2] fftools/resources: clean up and improve
> resource manager build system
>
> - move .gitignore entries to main .gitignore;
> - move vpath directives to main Makefile;
> - remove superfluous comments;
> - turn css minification sed command into a one-liner;
> - deduplicate targets depending on CONFIG_RESOURCE_COMPRESSION;
> - introduce common .res pattern for resource files;
> - remove RESOURCEOBJS noop from common.mak (it was never populated);
> - add fftools/graph/Makefile;
> - rename OBJS-resman to RESMAN-OBJS for consistency;
> - move graph.{css,html} to fftools/graph/graphprint.{css,html};
> - disable dependency checking for resource files, to prevent spurious
> rebuilds;
> - generate resources list at build-time based on all resource files;
> - the resource manager now uses the resource filename instead of an ID.
>
> Adding resource files now works from any subdir. Suppose you want to
> add a resource file named "foo.html", then all you have to do is:
>
> OBJS-$(CONDITION) += foo.html.res.o
>
> To access the resource, you retrieve it by its name:
>
> data = ff_resman_get_string("foo.html");
> ---
Hi Ramiro,
here's my review:
1. General
First of all, I think there are a bit too many different changes at once
in this patch. It would be better to have each kind of change
separate and then apply it uniformly to both, .ptx and .res compression
(where applicable). Having different logic for both seems pretty odd,
that's why I had talked to Timo about his opinion and we had agreed to
still keep the ptx files, but treat the others as intermediate.
That applied to the .SECONDARY and CCDEPS setting, and in your patch
it would also apply to the replacement of the ifdef blocks with the
inline condition. I'm not against this change, even though will make
it quite hard for others to understand, when dealing with it in
the future.
2. Moving vpath to the top level Makefile
The reasons why I didn't add them in the top Makefile is that there are
other .html and .css files in subfolders to which the vpath directive
would apply when added to the top Makefile.
I don't know whether this could cause any regressions, to the change might
or might not be okay.
3. Downlevel Makefile dependency
Your changes introduce a (logical) dependency in a level-3 Makefile on
another level-3 Makefile, i.e. fftools/resources/Makefile controls
what's happening to files in fftools/graph/Makefile.
4. fftools/resources/Makefile: #.SECONDARY line
It does not retain min file when uncommented and resource compression is
enabled.
5. Is this a suitable pattern for a generalized resource handling?
You recently asked me about a plan for this, and I said I don't have
one yet and that's why I wanted to keep things flexible for now.
It's not that I haven't thought about it - it's not as easy as one
might think.
The solution you are proposing doesn't seem suitable to fulfill these
requirements - for the following reasons:
- It doesn't allow to include different resources for ffprobe and
ffmpeg - it would include all resourced in both.
- Putting resource files into the individual folders of the code that
is using them is not a good idea, because it doesn't allow them to
be re-used by other features. E.g.: a feature in ffprobe might need
the same html as graphprint but a different css.
That's why I have put them all in the same directly, which is also
better for clarity.
- You are removing the resource ID definitions and are relying on
string matching only. Of course, this simplifies the code, but I
had decided against doing so, in order to have a compile-time
mechanism that guarantees that the build includes all the resources
that are needed by the included features.
Otherwise, it might too easily happen that builds are omitting
resources and it would be discovered much later only by a runtime
error
6. common.mak Cleanup
Please also see the second path in my update patchset for futher
way to consolidate and simplify common.mak rules.
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=14627
Thanks,
sw
_______________________________________________
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:[~2025-05-30 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 10:52 Ramiro Polla
2025-05-30 10:52 ` [FFmpeg-devel] [PATCH v3 2/2] fftools/Makefile: clean files from fftools/textformat Ramiro Polla
2025-05-30 22:56 ` softworkz . [this message]
2025-06-01 22:07 ` [FFmpeg-devel] [PATCH v3 1/2] fftools/resources: clean up and improve resource manager build system Ramiro Polla
2025-06-02 2:24 ` softworkz .
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=DM8P223MB0365AEA52ADF2539ACDFC62CBA61A@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
--to=softworkz-at-hotmail.com@ffmpeg.org \
--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