From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH 1/2] avutil/attributes_internal: Add EXTERN macro for extern+hidden Date: Sun, 2 Mar 2025 21:23:13 +0100 Message-ID: <AS8P250MB07449B589E4D26FC025E18DF8FCE2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) [-- Attachment #1: Type: text/plain, Size: 16 bytes --] Patches attached [-- Attachment #2: 0001-avutil-attributes_internal-Add-EXTERN-macro-for-exte.patch --] [-- Type: text/x-patch, Size: 2394 bytes --] From d0aa40a0f8c2a7e959628ee2d13c42e1bbbb643a Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 2 Mar 2025 15:27:48 +0100 Subject: [PATCH 1/2] avutil/attributes_internal: Add EXTERN macro for extern+hidden This is inspired by the equivalent dav1d attribute introduced by Henrik Gramner in e4c4af02f3de5e6cea6f81272a2981c0fa7bae28. Also already use it to beautify declarations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/mathops.h | 2 +- libavcodec/me_cmp.h | 2 +- libavcodec/vp9dsp.h | 2 +- libavutil/attributes_internal.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h index 84a924f31b..3e074ddf47 100644 --- a/libavcodec/mathops.h +++ b/libavcodec/mathops.h @@ -33,7 +33,7 @@ extern const uint32_t ff_inverse[257]; extern const uint8_t ff_log2_run[41]; extern const uint8_t ff_sqrt_tab[256]; -extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; +EXTERN const uint8_t ff_crop_tab[256 + 2 * MAX_NEG_CROP]; extern const uint8_t ff_zigzag_direct[64]; extern const uint8_t ff_zigzag_scan[16+1]; diff --git a/libavcodec/me_cmp.h b/libavcodec/me_cmp.h index 9053327c4c..8fcfa38dae 100644 --- a/libavcodec/me_cmp.h +++ b/libavcodec/me_cmp.h @@ -25,7 +25,7 @@ #include "avcodec.h" -extern const uint32_t attribute_visibility_hidden ff_square_tab[512]; +EXTERN const uint32_t ff_square_tab[512]; /* minimum alignment rules ;) diff --git a/libavcodec/vp9dsp.h b/libavcodec/vp9dsp.h index 772848e349..0e93224e17 100644 --- a/libavcodec/vp9dsp.h +++ b/libavcodec/vp9dsp.h @@ -121,7 +121,7 @@ typedef struct VP9DSPContext { vp9_scaled_mc_func smc[5][N_FILTERS][2]; } VP9DSPContext; -extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][16][8]; +EXTERN const int16_t ff_vp9_subpel_filters[3][16][8]; void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact); diff --git a/libavutil/attributes_internal.h b/libavutil/attributes_internal.h index 3df1ee6af3..bc85ce77ff 100644 --- a/libavutil/attributes_internal.h +++ b/libavutil/attributes_internal.h @@ -31,4 +31,6 @@ # define FF_VISIBILITY_POP_HIDDEN #endif +#define EXTERN extern attribute_visibility_hidden + #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */ -- 2.45.2 [-- Attachment #3: 0002-avformat-mpegenc-mpegts.-mxfenc-Mark-de-muxers-decla.patch --] [-- Type: text/x-patch, Size: 2887 bytes --] From 279f6e146472d787043591082ddc129f309bc790 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 2 Mar 2025 15:56:31 +0100 Subject: [PATCH 2/2] avformat/mpegenc, mpegts. mxfenc: Mark (de)muxers declarations as internal Otherwise compilers might emit code that presumes there to be a GOT which can't be fixed by the linker. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/mpegenc.c | 9 +++++---- libavformat/mpegts.c | 3 ++- libavformat/mxfenc.c | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 6b6763c30f..30a034a418 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -24,6 +24,7 @@ #include <stdint.h> #include "libavutil/attributes.h" +#include "libavutil/attributes_internal.h" #include "libavutil/fifo.h" #include "libavutil/log.h" #include "libavutil/mathematics.h" @@ -88,10 +89,10 @@ typedef struct MpegMuxContext { int preload; } MpegMuxContext; -extern const FFOutputFormat ff_mpeg1vcd_muxer; -extern const FFOutputFormat ff_mpeg2dvd_muxer; -extern const FFOutputFormat ff_mpeg2svcd_muxer; -extern const FFOutputFormat ff_mpeg2vob_muxer; +EXTERN const FFOutputFormat ff_mpeg1vcd_muxer; +EXTERN const FFOutputFormat ff_mpeg2dvd_muxer; +EXTERN const FFOutputFormat ff_mpeg2svcd_muxer; +EXTERN const FFOutputFormat ff_mpeg2vob_muxer; static int put_pack_header(AVFormatContext *ctx, uint8_t *buf, int64_t timestamp) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 765bedec5c..54594b3a11 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -21,6 +21,7 @@ #include "config_components.h" +#include "libavutil/attributes_internal.h" #include "libavutil/buffer.h" #include "libavutil/crc.h" #include "libavutil/internal.h" @@ -274,7 +275,7 @@ typedef struct PESContext { int merged_st; } PESContext; -extern const FFInputFormat ff_mpegts_demuxer; +EXTERN const FFInputFormat ff_mpegts_demuxer; static struct Program * get_program(MpegTSContext *ts, unsigned int programid) { diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index a482a6a352..ffb207576a 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -40,6 +40,7 @@ #include <inttypes.h> #include <time.h> +#include "libavutil/attributes_internal.h" #include "libavutil/mem.h" #include "libavutil/opt.h" #include "libavutil/random_seed.h" @@ -66,8 +67,8 @@ #include "config.h" #include "version.h" -extern const FFOutputFormat ff_mxf_d10_muxer; -extern const FFOutputFormat ff_mxf_opatom_muxer; +EXTERN const FFOutputFormat ff_mxf_d10_muxer; +EXTERN const FFOutputFormat ff_mxf_opatom_muxer; #define IS_D10(s) ((s)->oformat == &ff_mxf_d10_muxer.p) #define IS_OPATOM(s) ((s)->oformat == &ff_mxf_opatom_muxer.p) -- 2.45.2 [-- Attachment #4: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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".
reply other threads:[~2025-03-02 20:23 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=AS8P250MB07449B589E4D26FC025E18DF8FCE2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.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