From: Kacper Michajlow <kasper93@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/3] avutil/xga_font_data: add getters to access the shared arrays
Date: Tue, 22 Jul 2025 04:45:17 +0200
Message-ID: <CABPLASSqmQp7v5KmPJFAcAsoBt6qpe=G461oZcMsZFfqR5-xXA@mail.gmail.com> (raw)
In-Reply-To: <20250722004647.15233-1-jamrial@gmail.com>
On Tue, 22 Jul 2025 at 02:47, James Almer <jamrial@gmail.com> wrote:
>
> And stop exposing the arrays on the next major bump.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> libavutil/xga_font_data.c | 16 ++++++++++++++++
> libavutil/xga_font_data.h | 6 ++++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/libavutil/xga_font_data.c b/libavutil/xga_font_data.c
> index 3aed3142cf..e4b21760f8 100644
> --- a/libavutil/xga_font_data.c
> +++ b/libavutil/xga_font_data.c
> @@ -26,6 +26,9 @@
> #include <stdint.h>
> #include "xga_font_data.h"
>
> +#if LIBAVUTIL_VERSION_MAJOR > 60
> +static
> +#endif
> const uint8_t avpriv_cga_font[2048] = {
> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e,
> 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00,
> @@ -157,6 +160,14 @@ const uint8_t avpriv_cga_font[2048] = {
> 0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> };
>
> +const uint8_t *avpriv_cga_font_get(void)
> +{
> + return avpriv_cga_font;
> +}
> +
> +#if LIBAVUTIL_VERSION_MAJOR > 60
> +static
> +#endif
> const uint8_t avpriv_vga16_font[4096] = {
> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00,
> @@ -415,3 +426,8 @@ const uint8_t avpriv_vga16_font[4096] = {
> 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
> };
> +
> +const uint8_t *avpriv_vga16_font_get(void)
> +{
> + return avpriv_vga16_font;
> +}
> diff --git a/libavutil/xga_font_data.h b/libavutil/xga_font_data.h
> index 69dc337120..90d3cec4ce 100644
> --- a/libavutil/xga_font_data.h
> +++ b/libavutil/xga_font_data.h
> @@ -28,8 +28,14 @@
>
> #include <stdint.h>
> #include "internal.h"
> +#include "version.h"
>
> +#if LIBAVUTIL_VERSION_MAJOR < 61
> extern av_export_avutil const uint8_t avpriv_cga_font[2048];
> extern av_export_avutil const uint8_t avpriv_vga16_font[4096];
> +#endif
> +
> +const uint8_t *avpriv_cga_font_get(void);
> +const uint8_t *avpriv_vga16_font_get(void);
Looks good. Accessing data from DLLs without dllimport requires
manually resolving the indirection. While using a function works even
without dllimport, while it may be used to better code generation and
removing one function patching when dynamic linker loads it. All other
FFmpeg code is not using dllimport, so it should be fine to remove
these two remaining ones. This will allow all objects to be the same
between shared/static build and fix checkasm static linking.
For my information, isn't avpriv_ prefix used for internal symbols
shared between libs? Does it need a deprecation period? Are users
supposed to be accessing them?
- Kacper
_______________________________________________
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-07-22 2:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 0:46 James Almer
2025-07-22 0:46 ` [FFmpeg-devel] [PATCH 2/3] avcodec: use the getters for xGA font data arrays James Almer
2025-07-22 0:46 ` [FFmpeg-devel] [PATCH 3/3] avfilter: " James Almer
2025-07-22 2:45 ` Kacper Michajlow [this message]
2025-07-22 2:48 ` [FFmpeg-devel] [PATCH 1/3] avutil/xga_font_data: add getters to access the shared arrays Kacper Michajlow
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='CABPLASSqmQp7v5KmPJFAcAsoBt6qpe=G461oZcMsZFfqR5-xXA@mail.gmail.com' \
--to=kasper93@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