Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 2/6] avcodec/mmaldec: Avoid using AVCodec.pix_fmts
Date: Tue,  6 Feb 2024 00:36:10 +0100
Message-ID: <AS8P250MB0744AD2E8C9ECA0E6F2FE70F8F472@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB0744694CDB4F9751AE9419C88F472@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

It is entirely unnecessary to use it given that all decoders
here share the same set of supported pixel formats. So just
hardcode this list.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mmaldec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 2dc7bbee04..a8cda27570 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -101,6 +101,10 @@ typedef struct MMALDecodeContext {
 // packets (where each packet contains 1 frame).
 #define MAX_DELAYED_FRAMES 16
 
+static const enum AVPixelFormat mmal_pixfmts[] = {
+    AV_PIX_FMT_MMAL, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
+};
+
 static void ffmmal_poolref_unref(FFPoolRef *ref)
 {
     if (ref &&
@@ -367,7 +371,7 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
         return AVERROR(ENOSYS);
     }
 
-    if ((ret = ff_get_format(avctx, avctx->codec->pix_fmts)) < 0)
+    if ((ret = ff_get_format(avctx, mmal_pixfmts)) < 0)
         return ret;
 
     avctx->pix_fmt = ret;
@@ -844,9 +848,6 @@ static const AVClass ffmmal_dec_class = {
         .p.priv_class   = &ffmmal_dec_class, \
         .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
         .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
-        .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL, \
-                                                         AV_PIX_FMT_YUV420P, \
-                                                         AV_PIX_FMT_NONE}, \
         .hw_configs     = mmal_hw_configs, \
         .p.wrapper_name = "mmal", \
     };
-- 
2.34.1

_______________________________________________
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:[~2024-02-05 23:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 23:33 [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders Andreas Rheinhardt
2024-02-05 23:36 ` Andreas Rheinhardt [this message]
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 3/6] avcodec/vc1dec: Set pointers for hwaccel even without hwaccel Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 4/6] avcodec/vc1dec: Don't call ff_get_format() twice Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 5/6] avcodec/vc1dec: Remove AVCodec.pix_fmts arrays Andreas Rheinhardt
2024-02-05 23:36 ` [FFmpeg-devel] [PATCH 6/6] avcodec/h263dec: " Andreas Rheinhardt
2024-02-08  1:05 ` [FFmpeg-devel] [PATCH 1/6] avcodec: Remove redundant pix_fmts from decoders 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=AS8P250MB0744AD2E8C9ECA0E6F2FE70F8F472@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