From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH 1/7] avformat/apvenc: Only allow APV Date: Sun, 27 Apr 2025 20:42:41 +0200 Message-ID: <GV1P250MB0737F0E6261E13C3667C923B8F862@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw) [-- Attachment #1: Type: text/plain, Size: 29 bytes --] Patches attached. - Andreas [-- Attachment #2: 0001-avformat-apvenc-Only-allow-APV.patch --] [-- Type: text/x-patch, Size: 904 bytes --] From c0dbda4a3a63a451618e4578c779cd999d365819 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:11:50 +0200 Subject: [PATCH 1/7] avformat/apvenc: Only allow APV Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/apvenc.c b/libavformat/apvenc.c index 9c4d33fdae..c7827cd5b5 100644 --- a/libavformat/apvenc.c +++ b/libavformat/apvenc.c @@ -35,6 +35,6 @@ const FFOutputFormat ff_apv_muxer = { .p.audio_codec = AV_CODEC_ID_NONE, .p.video_codec = AV_CODEC_ID_APV, .p.subtitle_codec = AV_CODEC_ID_NONE, - .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH, + .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, .write_packet = apv_write_packet, }; -- 2.45.2 [-- Attachment #3: 0002-avformat-apvenc-Remove-unused-header.patch --] [-- Type: text/x-patch, Size: 699 bytes --] From c7eca20695decf6ed5a2d48fdc51bb3e4dc154f9 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:12:19 +0200 Subject: [PATCH 2/7] avformat/apvenc: Remove unused header Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apvenc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/apvenc.c b/libavformat/apvenc.c index c7827cd5b5..823cc0e601 100644 --- a/libavformat/apvenc.c +++ b/libavformat/apvenc.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavcodec/apv.h" - #include "avformat.h" #include "mux.h" -- 2.45.2 [-- Attachment #4: 0003-avformat-apvdec-Use-ffio_read_size.patch --] [-- Type: text/x-patch, Size: 896 bytes --] From 8fd6d853835e053a9617a28b7024ec9ce3abfddc Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:14:35 +0200 Subject: [PATCH 3/7] avformat/apvdec: Use ffio_read_size() Fixes potential use of uninitialized data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apvdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/apvdec.c b/libavformat/apvdec.c index e1ac34b003..9f94a901ec 100644 --- a/libavformat/apvdec.c +++ b/libavformat/apvdec.c @@ -164,7 +164,7 @@ static int apv_read_header(AVFormatContext *s) err = ffio_ensure_seekback(s->pb, sizeof(buffer)); if (err < 0) return err; - size = avio_read(s->pb, buffer, sizeof(buffer)); + size = ffio_read_size(s->pb, buffer, sizeof(buffer)); if (size < 0) return size; -- 2.45.2 [-- Attachment #5: 0004-avformat-apvdec-Remove-inappropriate-flags.patch --] [-- Type: text/x-patch, Size: 1232 bytes --] From 8132d6218d5945dc2267627b36deb3a191552ed9 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:20:02 +0200 Subject: [PATCH 4/7] avformat/apvdec: Remove inappropriate flags The init-cleanup flag makes no sense for a demuxer without a read_close() function; and the generic index is wrong, as the packet positions are off by four (they point to the actual packet data, not to the access unit size field). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apvdec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/apvdec.c b/libavformat/apvdec.c index 9f94a901ec..85e875a0d4 100644 --- a/libavformat/apvdec.c +++ b/libavformat/apvdec.c @@ -240,8 +240,7 @@ const FFInputFormat ff_apv_demuxer = { .p.name = "apv", .p.long_name = NULL_IF_CONFIG_SMALL("APV raw bitstream"), .p.extensions = "apv", - .p.flags = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS, - .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP, + .p.flags = AVFMT_NOTIMESTAMPS, .read_probe = apv_probe, .read_header = apv_read_header, .read_packet = apv_read_packet, -- 2.45.2 [-- Attachment #6: 0005-avformat-apvenc-Add-AVFMT_NOTIMESTAMPS-flag.patch --] [-- Type: text/x-patch, Size: 914 bytes --] From a0b0e7796c85d4b77d5ead8cf8baccb4c75e1523 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:23:23 +0200 Subject: [PATCH 5/7] avformat/apvenc: Add AVFMT_NOTIMESTAMPS flag This is a raw format. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavformat/apvenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/apvenc.c b/libavformat/apvenc.c index 823cc0e601..1e58ca8903 100644 --- a/libavformat/apvenc.c +++ b/libavformat/apvenc.c @@ -33,6 +33,7 @@ const FFOutputFormat ff_apv_muxer = { .p.audio_codec = AV_CODEC_ID_NONE, .p.video_codec = AV_CODEC_ID_APV, .p.subtitle_codec = AV_CODEC_ID_NONE, + .p.flags = AVFMT_NOTIMESTAMPS, .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, .write_packet = apv_write_packet, }; -- 2.45.2 [-- Attachment #7: 0006-avcodec-apv_decode-Fix-shadowing.patch --] [-- Type: text/x-patch, Size: 1433 bytes --] From d65d8f934d8b66509f20ff279d7343ffc90f01d8 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:25:21 +0200 Subject: [PATCH 6/7] avcodec/apv_decode: Fix shadowing Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/apv_decode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/apv_decode.c b/libavcodec/apv_decode.c index e28bc29c8f..3b638795ea 100644 --- a/libavcodec/apv_decode.c +++ b/libavcodec/apv_decode.c @@ -313,11 +313,11 @@ static int apv_decode_metadata(AVCodecContext *avctx, AVFrame *frame, return err; if (mdm) { - for (int i = 0; i < 3; i++) { - mdm->display_primaries[i][0] = - av_make_q(mdcv->primary_chromaticity_x[i], 1 << 16); - mdm->display_primaries[i][1] = - av_make_q(mdcv->primary_chromaticity_y[i], 1 << 16); + for (int j = 0; j < 3; j++) { + mdm->display_primaries[j][0] = + av_make_q(mdcv->primary_chromaticity_x[j], 1 << 16); + mdm->display_primaries[j][1] = + av_make_q(mdcv->primary_chromaticity_y[j], 1 << 16); } mdm->white_point[0] = -- 2.45.2 [-- Attachment #8: 0007-avcodec-apv_decode-Remove-redundant-log-message.patch --] [-- Type: text/x-patch, Size: 932 bytes --] From 1b608bef36141eb6cef0d98042a2db1b9234ed08 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sun, 27 Apr 2025 20:29:53 +0200 Subject: [PATCH 7/7] avcodec/apv_decode: Remove redundant log message ff_thread_get_buffer() already emits its own logmessage. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/apv_decode.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/apv_decode.c b/libavcodec/apv_decode.c index 3b638795ea..6fe52ffd84 100644 --- a/libavcodec/apv_decode.c +++ b/libavcodec/apv_decode.c @@ -277,10 +277,8 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output, } err = ff_thread_get_buffer(avctx, output, 0); - if (err) { - av_log(avctx, AV_LOG_ERROR, "No output frame supplied.\n"); + if (err < 0) return err; - } apv->output_frame = output; -- 2.45.2 [-- Attachment #9: 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".
next reply other threads:[~2025-04-27 18:42 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-04-27 18:42 Andreas Rheinhardt [this message] 2025-04-27 19:41 ` Mark Thompson 2025-04-27 20:48 ` Andreas Rheinhardt
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=GV1P250MB0737F0E6261E13C3667C923B8F862@GV1P250MB0737.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