Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/3] avutil/frame: deprecate palette_has_changed
Date: Tue, 11 Apr 2023 17:38:51 -0300
Message-ID: <20230411203851.65044-3-jamrial@gmail.com> (raw)
In-Reply-To: <20230411203851.65044-1-jamrial@gmail.com>

This field doesn't provide information about the frame itself but rather about
the frame as part of a decoding context, as as such has no place here.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 doc/APIchanges      | 3 +++
 libavcodec/decode.c | 4 ++++
 libavutil/frame.c   | 4 ++++
 libavutil/frame.h   | 4 ++++
 libavutil/version.h | 3 ++-
 5 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 85060768b3..77a7022f28 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-04-11 - xxxxxxxxxx - lavu 58.6.101 - avframe.h
+  Deprecate AVFrame.palette_has_changed
+
 2023-04-11 - xxxxxxxxxx - lavc 60.10.100 - avcodec.h
   Add event_flags to AVCodecContext.
   Add AVCTX_EVENT_FLAG_PALETTE_HAS_CHANGED.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index e3d803da3b..b4bd15687c 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -570,7 +570,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
     }
 
     if (!ret) {
+#if FF_API_PALETTE_HAS_CHANGED
+FF_DISABLE_DEPRECATION_WARNINGS
         frame->palette_has_changed = !!(avctx->event_flags & AVCTX_EVENT_FLAG_PALETTE_HAS_CHANGED);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
         frame->best_effort_timestamp = guess_correct_pts(avctx,
                                                          frame->pts,
                                                          frame->pkt_dts);
diff --git a/libavutil/frame.c b/libavutil/frame.c
index c905e8d611..cd714d0b58 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -277,7 +277,11 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
     dst->repeat_pict            = src->repeat_pict;
     dst->interlaced_frame       = src->interlaced_frame;
     dst->top_field_first        = src->top_field_first;
+#if FF_API_PALETTE_HAS_CHANGED
+FF_DISABLE_DEPRECATION_WARNINGS
     dst->palette_has_changed    = src->palette_has_changed;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
     dst->sample_rate            = src->sample_rate;
     dst->opaque                 = src->opaque;
     dst->pkt_dts                = src->pkt_dts;
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 5b58c14ac3..981db9e247 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -501,10 +501,14 @@ typedef struct AVFrame {
      */
     int top_field_first;
 
+#if FF_API_PALETTE_HAS_CHANGED
     /**
      * Tell user application that palette has changed from previous frame.
+     * @deprecated Check for AVCTX_EVENT_FLAG_PALETTE_HAS_CHANGED instead.
      */
+    attribute_deprecated
     int palette_has_changed;
+#endif
 
 #if FF_API_REORDERED_OPAQUE
     /**
diff --git a/libavutil/version.h b/libavutil/version.h
index 40f92af055..96b6259f7d 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR  58
 #define LIBAVUTIL_VERSION_MINOR   6
-#define LIBAVUTIL_VERSION_MICRO 100
+#define LIBAVUTIL_VERSION_MICRO 101
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \
@@ -115,6 +115,7 @@
 #define FF_API_FRAME_PICTURE_NUMBER     (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_HDR_VIVID_THREE_SPLINE   (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_FRAME_PKT                (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_PALETTE_HAS_CHANGED      (LIBAVUTIL_VERSION_MAJOR < 59)
 
 /**
  * @}
-- 
2.40.0

_______________________________________________
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".

      parent reply	other threads:[~2023-04-11 20:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 20:38 [FFmpeg-devel] [PATCH 1/3] avcodec/avcodec: add an event flags field to AVCodecContext James Almer
2023-04-11 20:38 ` [FFmpeg-devel] [PATCH 2/3] avcodec: use the new event flags field instead of setting AVFrame.palette_has_changed James Almer
2023-04-12  8:09   ` Anton Khirnov
2023-04-12 11:26     ` James Almer
2023-04-12 11:55       ` Anton Khirnov
2023-04-12 11:59         ` James Almer
2023-04-12 12:39           ` Anton Khirnov
2023-04-11 20:38 ` James Almer [this message]

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=20230411203851.65044-3-jamrial@gmail.com \
    --to=jamrial@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