Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue
@ 2023-09-07  1:02 Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 02/22] avformat/avio: Don't use incompatible function pointer type for call Andreas Rheinhardt
                   ` (30 more replies)
  0 siblings, 31 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

This is a workaround for an issue introduced in commit
1652f2492f88434010053289d946dab6a57e4d58. It is not meant to be applied
to the tree.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 tests/fate-run.sh             | 2 +-
 tests/fate/demux.mak          | 2 +-
 tests/fate/lavf-container.mak | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 5a71ac001e..276f97489d 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -383,7 +383,7 @@ lavf_container_fate()
     file=${outdir}/lavf.$t
     cleanfiles="$cleanfiles $file"
     input="${target_samples}/$1"
-    do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" "$ENC_OPTS -metadata title=lavftest" -vcodec copy -acodec copy
+    do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" "$ENC_OPTS -metadata title=lavftest" $4 -vcodec copy -acodec copy
     do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $3
 }
 
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index ace8fa0b52..7a091de851 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -14,7 +14,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_AEA_DEMUXER) += fate-aea-demux
 fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -c:a copy
 
 FATE_SAMPLES_DEMUX-$(call DEMDEC, AV1, AV1) += fate-av1-annexb-demux
-fate-av1-annexb-demux: CMD = framecrc -c:v av1 -i $(TARGET_SAMPLES)/av1/annexb.obu -c:v copy
+fate-av1-annexb-demux: CMD = framecrc -c:v av1 -i $(TARGET_SAMPLES)/av1/annexb.obu -c:v copy -sar 1:1
 
 FATE_SAMPLES_DEMUX-$(CONFIG_AST_DEMUXER) += fate-ast
 fate-ast: CMD = crc -i $(TARGET_SAMPLES)/ast/demo11_02_partial.ast -c copy
diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
index 0d4a224601..047dd1d7f4 100644
--- a/tests/fate/lavf-container.mak
+++ b/tests/fate/lavf-container.mak
@@ -86,8 +86,8 @@ FATE_LAVF_CONTAINER_FATE = $(FATE_LAVF_CONTAINER_FATE-yes:%=fate-lavf-fate-%)
 $(FATE_LAVF_CONTAINER_FATE): REF = $(SRC_PATH)/tests/ref/lavf-fate/$(@:fate-lavf-fate-%=%)
 $(FATE_LAVF_CONTAINER_FATE): $(AREF) $(VREF)
 
-fate-lavf-fate-av1.mp4: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
-fate-lavf-fate-av1.mkv: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
+fate-lavf-fate-av1.mp4: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy" "-sar 1:1"
+fate-lavf-fate-av1.mkv: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy" "-sar 1:1"
 fate-lavf-fate-evc.mp4: CMD = lavf_container_fate "evc/akiyo_cif.evc" "" "-c:v copy"
 fate-lavf-fate-h264.mp4: CMD = lavf_container_fate "h264/intra_refresh.h264" "" "-c:v copy"
 fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" "-idct auto"
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 02/22] avformat/avio: Don't use incompatible function pointer type for call
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 03/22] avformat/internal: Avoid casting const away Andreas Rheinhardt
                   ` (29 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It is undefined behaviour even in cases where it works
(it works because it is only a const uint8_t* vs. uint8_t* difference).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avio.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index ab1c19a58d..d53da5cb0c 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -354,10 +354,15 @@ fail:
 }
 
 static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
+                                         const uint8_t *cbuf,
                                          int size, int size_min,
-                                         int (*transfer_func)(URLContext *h,
-                                                              uint8_t *buf,
-                                                              int size))
+                                         int (*read_func)(URLContext *h,
+                                                          uint8_t *buf,
+                                                          int size),
+                                         int (*write_func)(URLContext *h,
+                                                           const uint8_t *buf,
+                                                           int size),
+                                         int read)
 {
     int ret, len;
     int fast_retries = 5;
@@ -367,7 +372,8 @@ static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
     while (len < size_min) {
         if (ff_check_interrupt(&h->interrupt_callback))
             return AVERROR_EXIT;
-        ret = transfer_func(h, buf + len, size - len);
+        ret = read ? read_func (h,  buf + len, size - len)
+                   : write_func(h, cbuf + len, size - len);
         if (ret == AVERROR(EINTR))
             continue;
         if (h->flags & AVIO_FLAG_NONBLOCK)
@@ -402,14 +408,16 @@ int ffurl_read(URLContext *h, unsigned char *buf, int size)
 {
     if (!(h->flags & AVIO_FLAG_READ))
         return AVERROR(EIO);
-    return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
+    return retry_transfer_wrapper(h, buf, NULL, size, 1,
+                                  h->prot->url_read, NULL, 1);
 }
 
 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
 {
     if (!(h->flags & AVIO_FLAG_READ))
         return AVERROR(EIO);
-    return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
+    return retry_transfer_wrapper(h, buf, NULL, size, size,
+                                  h->prot->url_read, NULL, 1);
 }
 
 int ffurl_write(URLContext *h, const unsigned char *buf, int size)
@@ -420,9 +428,8 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size)
     if (h->max_packet_size && size > h->max_packet_size)
         return AVERROR(EIO);
 
-    return retry_transfer_wrapper(h, (unsigned char *)buf, size, size,
-                                  (int (*)(struct URLContext *, uint8_t *, int))
-                                  h->prot->url_write);
+    return retry_transfer_wrapper(h, NULL, buf, size, size,
+                                  NULL, h->prot->url_write, 0);
 }
 
 int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 03/22] avformat/internal: Avoid casting const away
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 02/22] avformat/avio: Don't use incompatible function pointer type for call Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 04/22] avformat/aviobuf: Don't use incompatible function pointer type for call Andreas Rheinhardt
                   ` (28 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Fixes many warnings when using -Wcast-qual.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 051e8e2893..c7512898b5 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -418,7 +418,7 @@ static av_always_inline FFStream *ffstream(AVStream *st)
 
 static av_always_inline const FFStream *cffstream(const AVStream *st)
 {
-    return (FFStream*)st;
+    return (const FFStream*)st;
 }
 
 #ifdef __GNUC__
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 04/22] avformat/aviobuf: Don't use incompatible function pointer type for call
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 02/22] avformat/avio: Don't use incompatible function pointer type for call Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 03/22] avformat/internal: Avoid casting const away Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 05/22] avformat/dashenc: Avoid unnecessary casts Andreas Rheinhardt
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It is undefined behaviour even in cases where it works
(it works because both are pointers). Instead change
the functions involved to use the type expected by the AVIO-API
and add inline wrappers for our internal callers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avio.c    | 15 +++++++++++----
 libavformat/aviobuf.c |  6 ++----
 libavformat/url.h     | 20 ++++++++++++++++----
 3 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index d53da5cb0c..fd40f9ce43 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -404,8 +404,10 @@ static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf,
     return len;
 }
 
-int ffurl_read(URLContext *h, unsigned char *buf, int size)
+int ffurl_read2(void *urlcontext, uint8_t *buf, int size)
 {
+    URLContext *h = urlcontext;
+
     if (!(h->flags & AVIO_FLAG_READ))
         return AVERROR(EIO);
     return retry_transfer_wrapper(h, buf, NULL, size, 1,
@@ -420,8 +422,10 @@ int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
                                   h->prot->url_read, NULL, 1);
 }
 
-int ffurl_write(URLContext *h, const unsigned char *buf, int size)
+int ffurl_write2(void *urlcontext, uint8_t *buf, int size)
 {
+    URLContext *h = urlcontext;
+
     if (!(h->flags & AVIO_FLAG_WRITE))
         return AVERROR(EIO);
     /* avoid sending too big packets */
@@ -432,8 +436,9 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size)
                                   NULL, h->prot->url_write, 0);
 }
 
-int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
+int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence)
 {
+    URLContext *h = urlcontext;
     int64_t ret;
 
     if (!h->prot->url_seek)
@@ -654,8 +659,10 @@ int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles)
     return h->prot->url_get_multi_file_handle(h, handles, numhandles);
 }
 
-int ffurl_get_short_seek(URLContext *h)
+int ffurl_get_short_seek(void *urlcontext)
 {
+    URLContext *h = urlcontext;
+
     if (!h || !h->prot || !h->prot->url_get_short_seek)
         return AVERROR(ENOSYS);
     return h->prot->url_get_short_seek(h);
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 029a9e966b..ad5827f216 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -976,9 +976,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
         return AVERROR(ENOMEM);
 
     *s = avio_alloc_context(buffer, buffer_size, h->flags & AVIO_FLAG_WRITE, h,
-                            (int (*)(void *, uint8_t *, int))  ffurl_read,
-                            (int (*)(void *, uint8_t *, int))  ffurl_write,
-                            (int64_t (*)(void *, int64_t, int))ffurl_seek);
+                            ffurl_read2, ffurl_write2, ffurl_seek2);
     if (!*s) {
         av_freep(&buffer);
         return AVERROR(ENOMEM);
@@ -1006,7 +1004,7 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
         if (h->prot->url_read_seek)
             (*s)->seekable |= AVIO_SEEKABLE_TIME;
     }
-    ((FFIOContext*)(*s))->short_seek_get = (int (*)(void *))ffurl_get_short_seek;
+    ((FFIOContext*)(*s))->short_seek_get = ffurl_get_short_seek;
     (*s)->av_class = &ff_avio_class;
     return 0;
 }
diff --git a/libavformat/url.h b/libavformat/url.h
index 3cfe3ecc5c..bba1a9a1df 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -170,6 +170,7 @@ int ffurl_accept(URLContext *s, URLContext **c);
  */
 int ffurl_handshake(URLContext *c);
 
+int ffurl_read2(void *urlcontext, unsigned char *buf, int size);
 /**
  * Read up to size bytes from the resource accessed by h, and store
  * the read bytes in buf.
@@ -179,7 +180,10 @@ int ffurl_handshake(URLContext *c);
  * indicates that it is not possible to read more from the accessed
  * resource (except if the value of the size argument is also zero).
  */
-int ffurl_read(URLContext *h, unsigned char *buf, int size);
+static inline int ffurl_read(URLContext *h, uint8_t *buf, int size)
+{
+    return ffurl_read2(h, buf, size);
+}
 
 /**
  * Read as many bytes as possible (up to size), calling the
@@ -190,14 +194,19 @@ int ffurl_read(URLContext *h, unsigned char *buf, int size);
  */
 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
 
+int ffurl_write2(void *urlcontext, uint8_t *buf, int size);
 /**
  * Write size bytes from buf to the resource accessed by h.
  *
  * @return the number of bytes actually written, or a negative value
  * corresponding to an AVERROR code in case of failure
  */
-int ffurl_write(URLContext *h, const unsigned char *buf, int size);
+static inline int ffurl_write(URLContext *h, const uint8_t *buf, int size)
+{
+    return ffurl_write2(h, (uint8_t*)buf, size);
+}
 
+int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence);
 /**
  * Change the position that will be used by the next read/write
  * operation on the resource accessed by h.
@@ -212,7 +221,10 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size);
  * the beginning of the file. You can use this feature together with
  * SEEK_CUR to read the current file position.
  */
-int64_t ffurl_seek(URLContext *h, int64_t pos, int whence);
+static inline int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
+{
+    return ffurl_seek2(h, pos, whence);
+}
 
 /**
  * Close the resource accessed by the URLContext h, and free the
@@ -251,7 +263,7 @@ int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles);
  *
  * @return threshold (>0) on success or <=0 on error.
  */
-int ffurl_get_short_seek(URLContext *h);
+int ffurl_get_short_seek(void *urlcontext);
 
 /**
  * Signal the URLContext that we are done reading or writing the stream.
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 05/22] avformat/dashenc: Avoid unnecessary casts
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (2 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 04/22] avformat/aviobuf: Don't use incompatible function pointer type for call Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 06/22] avformat/dashenc: Use proper type for AVCodecIDs Andreas Rheinhardt
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/dashenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 69ceae2cbf..5615430d86 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1292,7 +1292,7 @@ static int write_manifest(AVFormatContext *s, int final)
                 if (os->segment_type != SEGMENT_TYPE_MP4)
                     continue;
                 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i);
-                ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group,
+                ff_hls_write_audio_rendition(c->m3u8_out, audio_group,
                                              playlist_file, NULL, i, is_default);
                 max_audio_bitrate = FFMAX(st->codecpar->bit_rate +
                                           os->muxer_overhead, max_audio_bitrate);
@@ -1309,7 +1309,7 @@ static int write_manifest(AVFormatContext *s, int final)
                 char codec_str[128];
                 AVStream *st = s->streams[i];
                 OutputStream *os = &c->streams[i];
-                char *agroup = NULL;
+                const char *agroup = NULL;
                 int stream_bitrate = os->muxer_overhead;
                 if (os->bit_rate > 0)
                     stream_bitrate += os->bit_rate;
@@ -1323,7 +1323,7 @@ static int write_manifest(AVFormatContext *s, int final)
                     continue;
                 av_strlcpy(codec_str, os->codec_str, sizeof(codec_str));
                 if (max_audio_bitrate) {
-                    agroup = (char *)audio_group;
+                    agroup = audio_group;
                     stream_bitrate += max_audio_bitrate;
                     av_strlcat(codec_str, ",", sizeof(codec_str));
                     av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 06/22] avformat/dashenc: Use proper type for AVCodecIDs
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (3 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 05/22] avformat/dashenc: Avoid unnecessary casts Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 07/22] avformat/dashenc: Add const where appropriate Andreas Rheinhardt
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/dashenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 5615430d86..1fac35a909 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -206,7 +206,7 @@ typedef struct DASHContext {
 } DASHContext;
 
 static struct codec_string {
-    int id;
+    enum AVCodecID id;
     const char *str;
 } codecs[] = {
     { AV_CODEC_ID_VP8, "vp8" },
@@ -214,7 +214,7 @@ static struct codec_string {
     { AV_CODEC_ID_VORBIS, "vorbis" },
     { AV_CODEC_ID_OPUS, "opus" },
     { AV_CODEC_ID_FLAC, "flac" },
-    { 0, NULL }
+    { AV_CODEC_ID_NONE, NULL }
 };
 
 static struct format_string {
@@ -360,7 +360,7 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par,
     int i;
 
     // common Webm codecs are not part of RFC 6381
-    for (i = 0; codecs[i].id; i++)
+    for (i = 0; codecs[i].id != AV_CODEC_ID_NONE; i++)
         if (codecs[i].id == par->codec_id) {
             if (codecs[i].id == AV_CODEC_ID_VP9) {
                 set_vp9_codec_str(s, par, frame_rate, str, size);
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 07/22] avformat/dashenc: Add const where appropriate
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (4 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 06/22] avformat/dashenc: Use proper type for AVCodecIDs Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 08/22] avformat/dashenc: Simplify getting format string Andreas Rheinhardt
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 1fac35a909..9c3ba2c389 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -205,7 +205,7 @@ typedef struct DASHContext {
     int64_t update_period;
 } DASHContext;
 
-static struct codec_string {
+static const struct codec_string {
     enum AVCodecID id;
     const char *str;
 } codecs[] = {
@@ -217,7 +217,7 @@ static struct codec_string {
     { AV_CODEC_ID_NONE, NULL }
 };
 
-static struct format_string {
+static const struct format_string {
     SegmentType segment_type;
     const char *str;
 } formats[] = {
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 08/22] avformat/dashenc: Simplify getting format string
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (5 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 07/22] avformat/dashenc: Add const where appropriate Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 09/22] avformat/dashenc: Avoid relocations for short strings Andreas Rheinhardt
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

A switch is simpler than a lookup over a table with
three entries, only two of which can happen at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/dashenc.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 9c3ba2c389..e98d54a61d 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -217,16 +217,6 @@ static const struct codec_string {
     { AV_CODEC_ID_NONE, NULL }
 };
 
-static const struct format_string {
-    SegmentType segment_type;
-    const char *str;
-} formats[] = {
-    { SEGMENT_TYPE_AUTO, "auto" },
-    { SEGMENT_TYPE_MP4, "mp4" },
-    { SEGMENT_TYPE_WEBM, "webm" },
-    { 0, NULL }
-};
-
 static int dashenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename,
                            AVDictionary **options) {
     DASHContext *c = s->priv_data;
@@ -265,11 +255,12 @@ static void dashenc_io_close(AVFormatContext *s, AVIOContext **pb, char *filenam
     }
 }
 
-static const char *get_format_str(SegmentType segment_type) {
-    int i;
-    for (i = 0; i < SEGMENT_TYPE_NB; i++)
-        if (formats[i].segment_type == segment_type)
-            return formats[i].str;
+static const char *get_format_str(SegmentType segment_type)
+{
+    switch (segment_type) {
+    case SEGMENT_TYPE_MP4:  return "mp4";
+    case SEGMENT_TYPE_WEBM: return "webm";
+    }
     return NULL;
 }
 
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 09/22] avformat/dashenc: Avoid relocations for short strings
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (6 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 08/22] avformat/dashenc: Simplify getting format string Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 10/22] avformat/teeproto: Remove useless AVClass without options Andreas Rheinhardt
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index e98d54a61d..96f4a5fbdf 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -207,14 +207,14 @@ typedef struct DASHContext {
 
 static const struct codec_string {
     enum AVCodecID id;
-    const char *str;
+    const char str[8];
 } codecs[] = {
     { AV_CODEC_ID_VP8, "vp8" },
     { AV_CODEC_ID_VP9, "vp9" },
     { AV_CODEC_ID_VORBIS, "vorbis" },
     { AV_CODEC_ID_OPUS, "opus" },
     { AV_CODEC_ID_FLAC, "flac" },
-    { AV_CODEC_ID_NONE, NULL }
+    { AV_CODEC_ID_NONE }
 };
 
 static int dashenc_io_open(AVFormatContext *s, AVIOContext **pb, char *filename,
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 10/22] avformat/teeproto: Remove useless AVClass without options
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (7 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 09/22] avformat/dashenc: Avoid relocations for short strings Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 11/22] avdevice/lavfi: Remove unnecessary avio_internal.h inclusion Andreas Rheinhardt
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/teeproto.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/libavformat/teeproto.c b/libavformat/teeproto.c
index dca97a6741..7dd5065f4b 100644
--- a/libavformat/teeproto.c
+++ b/libavformat/teeproto.c
@@ -20,7 +20,6 @@
  */
 
 #include "libavutil/avstring.h"
-#include "libavutil/opt.h"
 #include "avformat.h"
 #include "avio_internal.h"
 #include "tee_common.h"
@@ -30,22 +29,10 @@ typedef struct ChildContext {
 } ChildContext;
 
 typedef struct TeeContext {
-    const AVClass *class;
     int child_count;
     ChildContext *child;
 } TeeContext;
 
-static const AVOption tee_options[] = {
-    { NULL }
-};
-
-static const AVClass tee_class = {
-    .class_name = "tee",
-    .item_name  = av_default_item_name,
-    .option     = tee_options,
-    .version    = LIBAVUTIL_VERSION_INT,
-};
-
 static const char *const child_delim = "|";
 
 static int tee_write(URLContext *h, const unsigned char *buf, int size)
@@ -154,6 +141,5 @@ const URLProtocol ff_tee_protocol = {
     .url_write           = tee_write,
     .url_close           = tee_close,
     .priv_data_size      = sizeof(TeeContext),
-    .priv_data_class     = &tee_class,
     .default_whitelist   = "crypto,file,http,https,httpproxy,rtmp,tcp,tls"
 };
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 11/22] avdevice/lavfi: Remove unnecessary avio_internal.h inclusion
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (8 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 10/22] avformat/teeproto: Remove useless AVClass without options Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 12/22] avformat: Remove avformat and avio headers from protocols Andreas Rheinhardt
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

The stuff declared in said header is actually unusable in libavdevice.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavdevice/lavfi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index b2cec0400b..ec7ebdbc90 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -39,7 +39,6 @@
 #include "libavutil/pixdesc.h"
 #include "libavfilter/avfilter.h"
 #include "libavfilter/buffersink.h"
-#include "libavformat/avio_internal.h"
 #include "libavformat/internal.h"
 #include "avdevice.h"
 
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 12/22] avformat: Remove avformat and avio headers from protocols
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (9 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 11/22] avdevice/lavfi: Remove unnecessary avio_internal.h inclusion Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 13/22] avformat/teeproto: Remove always-false check Andreas Rheinhardt
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avio.c         | 1 -
 libavformat/bluray.c       | 1 -
 libavformat/concat.c       | 4 +++-
 libavformat/crypto.c       | 2 --
 libavformat/hlsproto.c     | 1 -
 libavformat/httpauth.c     | 1 -
 libavformat/libsmbclient.c | 2 --
 libavformat/md5proto.c     | 1 -
 libavformat/rtpproto.c     | 1 -
 libavformat/srtpproto.c    | 2 --
 libavformat/subfile.c      | 1 -
 libavformat/teeproto.c     | 9 +++++++--
 libavformat/udp.c          | 2 --
 libavformat/url.c          | 6 ++++--
 14 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index fd40f9ce43..5e1acba31b 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -25,7 +25,6 @@
 #include "libavutil/time.h"
 #include "libavutil/avassert.h"
 #include "os_support.h"
-#include "avformat.h"
 #include "internal.h"
 #if CONFIG_NETWORK
 #include "network.h"
diff --git a/libavformat/bluray.c b/libavformat/bluray.c
index 635c4f1b87..1845551c34 100644
--- a/libavformat/bluray.c
+++ b/libavformat/bluray.c
@@ -23,7 +23,6 @@
 #include <libbluray/bluray.h>
 
 #include "libavutil/avstring.h"
-#include "libavformat/avformat.h"
 #include "libavformat/url.h"
 #include "libavutil/opt.h"
 
diff --git a/libavformat/concat.c b/libavformat/concat.c
index 825e43a7fa..e1d57de557 100644
--- a/libavformat/concat.c
+++ b/libavformat/concat.c
@@ -21,13 +21,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "config_components.h"
 
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
+#include "libavutil/error.h"
 #include "libavutil/mem.h"
 
-#include "avformat.h"
 #include "avio_internal.h"
 #include "url.h"
 
diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index 1d4514e0f2..75b00020bc 100644
--- a/libavformat/crypto.c
+++ b/libavformat/crypto.c
@@ -19,11 +19,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "avformat.h"
 #include "libavutil/aes.h"
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
-#include "internal.h"
 #include "url.h"
 
 // encourage reads of 4096 bytes - 1 block is always retained.
diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index 6a2765bbe9..4db61dee30 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -27,7 +27,6 @@
 
 #include "libavutil/avstring.h"
 #include "libavutil/time.h"
-#include "avformat.h"
 #include "avio_internal.h"
 #include "internal.h"
 #include "url.h"
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index 0a98ff80a5..9780928357 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -26,7 +26,6 @@
 #include "libavutil/random_seed.h"
 #include "libavutil/md5.h"
 #include "urldecode.h"
-#include "avformat.h"
 
 static void handle_basic_params(HTTPAuthState *state, const char *key,
                                 int key_len, char **dest, int *dest_len)
diff --git a/libavformat/libsmbclient.c b/libavformat/libsmbclient.c
index 3285868957..f81fff2dfc 100644
--- a/libavformat/libsmbclient.c
+++ b/libavformat/libsmbclient.c
@@ -21,8 +21,6 @@
 #include <libsmbclient.h>
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
-#include "avformat.h"
-#include "internal.h"
 #include "url.h"
 
 typedef struct {
diff --git a/libavformat/md5proto.c b/libavformat/md5proto.c
index 14cefe719c..653bf10e66 100644
--- a/libavformat/md5proto.c
+++ b/libavformat/md5proto.c
@@ -23,7 +23,6 @@
 #include "libavutil/md5.h"
 #include "libavutil/mem.h"
 #include "libavutil/error.h"
-#include "avformat.h"
 #include "avio.h"
 #include "internal.h"
 #include "url.h"
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index b970901d01..cac361047a 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -28,7 +28,6 @@
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "avformat.h"
-#include "avio_internal.h"
 #include "rtp.h"
 #include "rtpproto.h"
 #include "url.h"
diff --git a/libavformat/srtpproto.c b/libavformat/srtpproto.c
index 13e2245015..61669e05ad 100644
--- a/libavformat/srtpproto.c
+++ b/libavformat/srtpproto.c
@@ -21,10 +21,8 @@
 
 #include "libavutil/opt.h"
 #include "avformat.h"
-#include "avio_internal.h"
 #include "url.h"
 
-#include "internal.h"
 #include "rtpdec.h"
 #include "srtp.h"
 
diff --git a/libavformat/subfile.c b/libavformat/subfile.c
index 2936c79e06..633a9e3c62 100644
--- a/libavformat/subfile.c
+++ b/libavformat/subfile.c
@@ -20,7 +20,6 @@
 
 #include "libavutil/avstring.h"
 #include "libavutil/opt.h"
-#include "avformat.h"
 #include "url.h"
 
 typedef struct SubfileContext {
diff --git a/libavformat/teeproto.c b/libavformat/teeproto.c
index 7dd5065f4b..33877ed808 100644
--- a/libavformat/teeproto.c
+++ b/libavformat/teeproto.c
@@ -19,10 +19,15 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
+
 #include "libavutil/avstring.h"
-#include "avformat.h"
-#include "avio_internal.h"
+#include "libavutil/dict.h"
+#include "libavutil/error.h"
+#include "libavutil/mem.h"
+#include "avio.h"
 #include "tee_common.h"
+#include "url.h"
 
 typedef struct ChildContext {
     URLContext *url_context;
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 909213a467..d9514f5026 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -28,12 +28,10 @@
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
 
 #include "avformat.h"
-#include "avio_internal.h"
 #include "libavutil/avassert.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/fifo.h"
 #include "libavutil/intreadwrite.h"
-#include "libavutil/avstring.h"
 #include "libavutil/opt.h"
 #include "libavutil/log.h"
 #include "libavutil/time.h"
diff --git a/libavformat/url.c b/libavformat/url.c
index f53fdf59d8..d5dd6a4666 100644
--- a/libavformat/url.c
+++ b/libavformat/url.c
@@ -19,16 +19,18 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <string.h>
 
-#include "avformat.h"
-#include "internal.h"
 #include "config.h"
+#include "avio.h"
 #include "url.h"
 #if CONFIG_NETWORK
 #include "network.h"
 #endif
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
+#include "libavutil/error.h"
+#include "libavutil/mem.h"
 
 /**
  * @file
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 13/22] avformat/teeproto: Remove always-false check
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (10 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 12/22] avformat: Remove avformat and avio headers from protocols Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 14/22] avformat/avio_internal: Don't include url.h Andreas Rheinhardt
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Incompatibility of the flags and the protocol's capabilities
are checked generically (see url_alloc_for_protocol()).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/teeproto.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavformat/teeproto.c b/libavformat/teeproto.c
index 33877ed808..5a74e0f113 100644
--- a/libavformat/teeproto.c
+++ b/libavformat/teeproto.c
@@ -25,7 +25,6 @@
 #include "libavutil/dict.h"
 #include "libavutil/error.h"
 #include "libavutil/mem.h"
-#include "avio.h"
 #include "tee_common.h"
 #include "url.h"
 
@@ -78,9 +77,6 @@ static int tee_open(URLContext *h, const char *filename, int flags)
 
     av_strstart(filename, "tee:", &filename);
 
-    if (flags & AVIO_FLAG_READ)
-        return AVERROR(ENOSYS);
-
     while (*filename) {
         char *child_string = av_get_token(&filename, child_delim);
         char *child_name = NULL;
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 14/22] avformat/avio_internal: Don't include url.h
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (11 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 13/22] avformat/teeproto: Remove always-false check Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks Andreas Rheinhardt
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It is only included because two very rarely used functions
use pointers to URLContexts; use struct URLContext instead.
Also move ffio_geturlcontext() so that one can avoid
a forward declaration of struct URLContext (which would be
necessary as soon as FF_API_AVIODIRCONTEXT is no more).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avio_internal.h | 19 +++++++++----------
 libavformat/dashdec.c       |  1 +
 libavformat/format.c        |  1 +
 libavformat/hls.c           |  1 +
 libavformat/hlsenc.c        |  1 +
 libavformat/rtpenc_chain.c  |  1 +
 6 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index 57796ade03..aef6ab660e 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -20,7 +20,6 @@
 #define AVFORMAT_AVIO_INTERNAL_H
 
 #include "avio.h"
-#include "url.h"
 
 #include "libavutil/log.h"
 
@@ -194,6 +193,14 @@ unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf,
  */
 int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
 
+/**
+ * Return the URLContext associated with the AVIOContext
+ *
+ * @param s IO context
+ * @return pointer to URLContext or NULL.
+ */
+struct URLContext *ffio_geturlcontext(AVIOContext *s);
+
 /**
  * Create and initialize a AVIOContext for accessing the
  * resource referenced by the URLContext h.
@@ -205,15 +212,7 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
  * @return >= 0 in case of success, a negative value corresponding to an
  * AVERROR code in case of failure
  */
-int ffio_fdopen(AVIOContext **s, URLContext *h);
-
-/**
- * Return the URLContext associated with the AVIOContext
- *
- * @param s IO context
- * @return pointer to URLContext or NULL.
- */
-URLContext *ffio_geturlcontext(AVIOContext *s);
+int ffio_fdopen(AVIOContext **s, struct URLContext *h);
 
 
 /**
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index f4af625814..cbe34f4f50 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -29,6 +29,7 @@
 #include "avio_internal.h"
 #include "dash.h"
 #include "demux.h"
+#include "url.h"
 
 #define INITIAL_BUFFER_SIZE 32768
 
diff --git a/libavformat/format.c b/libavformat/format.c
index c91f71057a..477ad6b43b 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -30,6 +30,7 @@
 #include "avformat.h"
 #include "id3v2.h"
 #include "internal.h"
+#include "url.h"
 
 
 /**
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 276e4ee333..b2a93d578b 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -43,6 +43,7 @@
 #include "internal.h"
 #include "avio_internal.h"
 #include "id3v2.h"
+#include "url.h"
 
 #include "hls_sample_encryption.h"
 
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 12e20580ee..08f3746ce7 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -51,6 +51,7 @@
 #include "internal.h"
 #include "mux.h"
 #include "os_support.h"
+#include "url.h"
 
 typedef enum {
     HLS_START_SEQUENCE_AS_START_NUMBER = 0,
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index cd751f48b6..45d0e313fd 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -23,6 +23,7 @@
 #include "avio_internal.h"
 #include "rtpenc_chain.h"
 #include "rtp.h"
+#include "url.h"
 #include "libavutil/opt.h"
 
 int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s,
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (12 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 14/22] avformat/avio_internal: Don't include url.h Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07 15:02   ` Anton Khirnov
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees Andreas Rheinhardt
                   ` (16 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

They are currently non-const for reasons unknown, although
avio_write() accepts a const buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
rtmpcrypt.c sometimes modifies the buffer whose content
it is supposed to write.

 doc/APIchanges                   |  4 ++++
 libavformat/avio.c               |  4 ++++
 libavformat/avio.h               | 13 +++++++++++++
 libavformat/avio_internal.h      |  4 ++++
 libavformat/aviobuf.c            | 28 ++++++++++++++++++++++++++++
 libavformat/hdsenc.c             |  4 ++++
 libavformat/smoothstreamingenc.c |  4 ++++
 libavformat/url.h                |  8 ++++++++
 libavformat/version_major.h      |  1 +
 9 files changed, 70 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 762c2d6628..963ad477bf 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
+  Constify the buffer pointees in the write_packet and write_data_type
+  callbacks of AVIOContext.
+
 2023-09-07 - xxxxxxxxxx - lavc 60.26.100 - defs.h
   Add AV_PROFILE_* and AV_LEVEL_* replacements in defs.h for the
   defines from avcodec.h. The latter are deprecated.
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 5e1acba31b..053cb2e05a 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -421,7 +421,11 @@ int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
                                   h->prot->url_read, NULL, 1);
 }
 
+#if FF_API_AVIO_WRITE_NONCONST
 int ffurl_write2(void *urlcontext, uint8_t *buf, int size)
+#else
+int ffurl_write2(void *urlcontext, const uint8_t *buf, int size)
+#endif
 {
     URLContext *h = urlcontext;
 
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 5f13e0622d..887a397c37 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -238,7 +238,11 @@ typedef struct AVIOContext {
     void *opaque;           /**< A private pointer, passed to the read/write/seek/...
                                  functions. */
     int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
+#if FF_API_AVIO_WRITE_NONCONST
     int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
+#else
+    int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size);
+#endif
     int64_t (*seek)(void *opaque, int64_t offset, int whence);
     int64_t pos;            /**< position in the file of the current buffer */
     int eof_reached;        /**< true if was unable to read due to error or eof */
@@ -286,8 +290,13 @@ typedef struct AVIOContext {
     /**
      * A callback that is used instead of write_packet.
      */
+#if FF_API_AVIO_WRITE_NONCONST
     int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size,
                            enum AVIODataMarkerType type, int64_t time);
+#else
+    int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size,
+                           enum AVIODataMarkerType type, int64_t time);
+#endif
     /**
      * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT,
      * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly
@@ -407,7 +416,11 @@ AVIOContext *avio_alloc_context(
                   int write_flag,
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+#if FF_API_AVIO_WRITE_NONCONST
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+#else
+                  int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
+#endif
                   int64_t (*seek)(void *opaque, int64_t offset, int whence));
 
 /**
diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
index aef6ab660e..bd58499b64 100644
--- a/libavformat/avio_internal.h
+++ b/libavformat/avio_internal.h
@@ -89,7 +89,11 @@ void ffio_init_context(FFIOContext *s,
                   int write_flag,
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+#if FF_API_AVIO_WRITE_NONCONST
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+#else
+                  int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
+#endif
                   int64_t (*seek)(void *opaque, int64_t offset, int whence));
 
 /**
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index ad5827f216..c55fe8a837 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -84,7 +84,11 @@ void ffio_init_context(FFIOContext *ctx,
                   int write_flag,
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+#if FF_API_AVIO_WRITE_NONCONST
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+#else
+                  int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
+#endif
                   int64_t (*seek)(void *opaque, int64_t offset, int whence))
 {
     AVIOContext *const s = &ctx->pub;
@@ -143,7 +147,11 @@ AVIOContext *avio_alloc_context(
                   int write_flag,
                   void *opaque,
                   int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+#if FF_API_AVIO_WRITE_NONCONST
                   int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+#else
+                  int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
+#endif
                   int64_t (*seek)(void *opaque, int64_t offset, int whence))
 {
     FFIOContext *s = av_malloc(sizeof(*s));
@@ -165,12 +173,20 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len)
     if (!s->error) {
         int ret = 0;
         if (s->write_data_type)
+#if FF_API_AVIO_WRITE_NONCONST
             ret = s->write_data_type(s->opaque, (uint8_t *)data,
+#else
+            ret = s->write_data_type(s->opaque, data,
+#endif
                                      len,
                                      ctx->current_type,
                                      ctx->last_time);
         else if (s->write_packet)
+#if FF_API_AVIO_WRITE_NONCONST
             ret = s->write_packet(s->opaque, (uint8_t *)data, len);
+#else
+            ret = s->write_packet(s->opaque, data, len);
+#endif
         if (ret < 0) {
             s->error = ret;
         } else {
@@ -1396,7 +1412,11 @@ typedef struct DynBuffer {
     uint8_t io_buffer[1];
 } DynBuffer;
 
+#if FF_API_AVIO_WRITE_NONCONST
 static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
+#else
+static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size)
+#endif
 {
     DynBuffer *d = opaque;
     unsigned new_size;
@@ -1428,7 +1448,11 @@ static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
     return buf_size;
 }
 
+#if FF_API_AVIO_WRITE_NONCONST
 static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
+#else
+static int dyn_packet_buf_write(void *opaque, const uint8_t *buf, int buf_size)
+#endif
 {
     unsigned char buf1[4];
     int ret;
@@ -1565,7 +1589,11 @@ void ffio_free_dyn_buf(AVIOContext **s)
     avio_context_free(s);
 }
 
+#if FF_API_AVIO_WRITE_NONCONST
 static int null_buf_write(void *opaque, uint8_t *buf, int buf_size)
+#else
+static int null_buf_write(void *opaque, const uint8_t *buf, int buf_size)
+#endif
 {
     DynBuffer *d = opaque;
 
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 080a873ee8..7062441b70 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -112,7 +112,11 @@ static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)
     return 0;
 }
 
+#if FF_API_AVIO_WRITE_NONCONST
 static int hds_write(void *opaque, uint8_t *buf, int buf_size)
+#else
+static int hds_write(void *opaque, const uint8_t *buf, int buf_size)
+#endif
 {
     OutputStream *os = opaque;
     if (os->out) {
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 3c050ca54e..0379e9a079 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -75,7 +75,11 @@ typedef struct SmoothStreamingContext {
     int nb_fragments;
 } SmoothStreamingContext;
 
+#if FF_API_AVIO_WRITE_NONCONST
 static int ism_write(void *opaque, uint8_t *buf, int buf_size)
+#else
+static int ism_write(void *opaque, const uint8_t *buf, int buf_size)
+#endif
 {
     OutputStream *os = opaque;
     if (os->out)
diff --git a/libavformat/url.h b/libavformat/url.h
index bba1a9a1df..f0327218d4 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -194,7 +194,11 @@ static inline int ffurl_read(URLContext *h, uint8_t *buf, int size)
  */
 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
 
+#if FF_API_AVIO_WRITE_NONCONST
 int ffurl_write2(void *urlcontext, uint8_t *buf, int size);
+#else
+int ffurl_write2(void *urlcontext, const uint8_t *buf, int size);
+#endif
 /**
  * Write size bytes from buf to the resource accessed by h.
  *
@@ -203,7 +207,11 @@ int ffurl_write2(void *urlcontext, uint8_t *buf, int size);
  */
 static inline int ffurl_write(URLContext *h, const uint8_t *buf, int size)
 {
+#if FF_API_AVIO_WRITE_NONCONST
     return ffurl_write2(h, (uint8_t*)buf, size);
+#else
+    return ffurl_write2(h, buf, size);
+#endif
 }
 
 int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence);
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 293fbd3397..1b43fe64cb 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -45,6 +45,7 @@
 #define FF_API_GET_END_PTS              (LIBAVFORMAT_VERSION_MAJOR < 61)
 #define FF_API_AVIODIRCONTEXT           (LIBAVFORMAT_VERSION_MAJOR < 61)
 #define FF_API_AVFORMAT_IO_CLOSE        (LIBAVFORMAT_VERSION_MAJOR < 61)
+#define FF_API_AVIO_WRITE_NONCONST      (LIBAVFORMAT_VERSION_MAJOR < 61)
 
 
 #define FF_API_R_FRAME_RATE            1
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (13 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-10 11:09   ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 17/22] avutil/samplefmt: " Andreas Rheinhardt
                   ` (15 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

This is done immediately without waiting for the next major bump
just as in 9546b3a1cbcd94e9107f85c8f1d2175efc6cf083 and
4eaaa38d3dfb8863a62f3646a62e4098b1c078d5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges       |  4 ++++
 libavutil/imgutils.c | 14 +++++++-------
 libavutil/imgutils.h | 10 +++++-----
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 963ad477bf..048232b2eb 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - imgutils.h
+  Constify some pointees in av_image_copy(), av_image_copy_uc_from() and
+  av_image_fill_black().
+
 2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
   Constify the buffer pointees in the write_packet and write_data_type
   callbacks of AVIOContext.
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 9ab5757cf6..da3812698e 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
     image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height);
 }
 
-static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
-                       const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
+static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4],
+                       const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4],
                        enum AVPixelFormat pix_fmt, int width, int height,
                        void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *,
                                           ptrdiff_t, ptrdiff_t, int))
@@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
     }
 }
 
-void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
+void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4],
+                   const uint8_t * const src_data[4], const int src_linesizes[4],
                    enum AVPixelFormat pix_fmt, int width, int height)
 {
     ptrdiff_t dst_linesizes1[4], src_linesizes1[4];
@@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
                width, height, image_copy_plane);
 }
 
-void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
-                           const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
+void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4],
+                           const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
                            enum AVPixelFormat pix_fmt, int width, int height)
 {
     image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt,
@@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
 // if it's a subsampled packed format).
 #define MAX_BLOCK_SIZE 32
 
-int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
+int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
                         enum AVPixelFormat pix_fmt, enum AVColorRange range,
                         int width, int height)
 {
diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index e10ac14952..91312a72d3 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -170,8 +170,8 @@ void av_image_copy_plane_uc_from(uint8_t       *dst, ptrdiff_t dst_linesize,
  * @param width         width of the image in pixels
  * @param height        height of the image in pixels
  */
-void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
+void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4],
+                   const uint8_t * const src_data[4], const int src_linesizes[4],
                    enum AVPixelFormat pix_fmt, int width, int height);
 
 /**
@@ -188,8 +188,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
  * @note On x86, the linesizes currently need to be aligned to the cacheline
  *       size (i.e. 64) to get improved performance.
  */
-void av_image_copy_uc_from(uint8_t *dst_data[4],       const ptrdiff_t dst_linesizes[4],
-                           const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
+void av_image_copy_uc_from(uint8_t * const dst_data[4],       const ptrdiff_t dst_linesizes[4],
+                           const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
                            enum AVPixelFormat pix_fmt, int width, int height);
 
 /**
@@ -319,7 +319,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar);
  * @param height        the height of the image in pixels
  * @return 0 if the image data was cleared, a negative AVERROR code otherwise
  */
-int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
+int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
                         enum AVPixelFormat pix_fmt, enum AVColorRange range,
                         int width, int height);
 
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 17/22] avutil/samplefmt: Constify some pointees
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (14 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 18/22] avutil/audio_fifo: " Andreas Rheinhardt
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

This is the samplefmt analogon of the imgutils changes
from the preceding commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges        | 3 +++
 libavutil/samplefmt.c | 4 ++--
 libavutil/samplefmt.h | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 048232b2eb..c9f7a61e4d 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-09-07 - xxxxxxxxxx - lavu 58.xx.100 - samplefmt.h
+  Constify some pointees in av_samples_copy() and av_samples_set_silence().
+
 2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - imgutils.h
   Constify some pointees in av_image_copy(), av_image_copy_uc_from() and
   av_image_fill_black().
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index 6d3ec34dab..e1be5f0547 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -219,7 +219,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int
     return ret;
 }
 
-int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset,
                     int src_offset, int nb_samples, int nb_channels,
                     enum AVSampleFormat sample_fmt)
 {
@@ -243,7 +243,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
     return 0;
 }
 
-int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples,
                            int nb_channels, enum AVSampleFormat sample_fmt)
 {
     int planar      = av_sample_fmt_is_planar(sample_fmt);
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index 6bad0e254a..43a57a422c 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -246,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int
  * @param nb_channels number of audio channels
  * @param sample_fmt audio sample format
  */
-int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
+int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset,
                     int src_offset, int nb_samples, int nb_channels,
                     enum AVSampleFormat sample_fmt);
 
@@ -259,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
  * @param nb_channels number of audio channels
  * @param sample_fmt  audio sample format
  */
-int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
+int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples,
                            int nb_channels, enum AVSampleFormat sample_fmt);
 
 /**
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 18/22] avutil/audio_fifo: Constify some pointees
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (15 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 17/22] avutil/samplefmt: " Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 19/22] avutil/fifo: Constify AVFifo pointees in peek functions Andreas Rheinhardt
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Also constify AVAudioFifo* in the peek functions
besides constifying intermediate pointers (void**->void * const *).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges         | 4 ++++
 libavutil/audio_fifo.c | 9 +++++----
 libavutil/audio_fifo.h | 9 +++++----
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index c9f7a61e4d..2dbcd47fc3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - audio_fifo.h
+  Constify some pointees in av_audio_fifo_write(), av_audio_fifo_read(),
+  av_audio_fifo_peek() and av_audio_fifo_peek_at().
+
 2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - samplefmt.h
   Constify some pointees in av_samples_copy() and av_samples_set_silence().
 
diff --git a/libavutil/audio_fifo.c b/libavutil/audio_fifo.c
index f4103178ba..dc2dea9b2d 100644
--- a/libavutil/audio_fifo.c
+++ b/libavutil/audio_fifo.c
@@ -116,7 +116,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples)
     return 0;
 }
 
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples)
 {
     int i, ret, size;
 
@@ -142,12 +142,13 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
     return nb_samples;
 }
 
-int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples)
 {
     return av_audio_fifo_peek_at(af, data, nb_samples, 0);
 }
 
-int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset)
+int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data,
+                          int nb_samples, int offset)
 {
     int i, ret, size;
 
@@ -171,7 +172,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs
     return nb_samples;
 }
 
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples)
 {
     int i, size;
 
diff --git a/libavutil/audio_fifo.h b/libavutil/audio_fifo.h
index d1e4c856dc..fa5f59a2be 100644
--- a/libavutil/audio_fifo.h
+++ b/libavutil/audio_fifo.h
@@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
  *                    code on failure. If successful, the number of samples
  *                    actually written will always be nb_samples.
  */
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Peek data from an AVAudioFifo.
@@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Peek data from an AVAudioFifo.
@@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset);
+int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data,
+                          int nb_samples, int offset);
 
 /**
  * Read data from an AVAudioFifo.
@@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Drain data from an AVAudioFifo.
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 19/22] avutil/fifo: Constify AVFifo pointees in peek functions
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (16 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 18/22] avutil/audio_fifo: " Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away Andreas Rheinhardt
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

They do not modify the AVFifo state.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges   | 3 +++
 libavutil/fifo.c | 4 ++--
 libavutil/fifo.h | 4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 2dbcd47fc3..0914a4da32 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-09-07 - xxxxxxxxxx - lavu 58.xx.100 - fifo.h
+  Constify the AVFifo pointees in av_fifo_peek() and av_fifo_peek_to_cb().
+
 2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - audio_fifo.h
   Constify some pointees in av_audio_fifo_write(), av_audio_fifo_read(),
   av_audio_fifo_peek() and av_audio_fifo_peek_at().
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 9b32f708fc..b0807abbf7 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -252,12 +252,12 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb,
     return ret;
 }
 
-int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset)
+int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset)
 {
     return fifo_peek_common(f, buf, &nb_elems, offset, NULL, NULL);
 }
 
-int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque,
+int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque,
                        size_t *nb_elems, size_t offset)
 {
     return fifo_peek_common(f, NULL, nb_elems, offset, write_cb, opaque);
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 70f9376d97..ce3a2aed7c 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb,
  *
  * @return a non-negative number on success, a negative error code on failure
  */
-int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset);
+int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset);
 
 /**
  * Feed data from a FIFO into a user-provided callback.
@@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset);
  *
  * @return a non-negative number on success, a negative error code on failure
  */
-int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque,
+int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque,
                        size_t *nb_elems, size_t offset);
 
 /**
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (17 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 19/22] avutil/fifo: Constify AVFifo pointees in peek functions Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  7:36   ` Paul B Mahol
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 21/22] avutil/imgutils: Add wrapper for av_image_copy() to avoid casts Andreas Rheinhardt
                   ` (11 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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

diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 814d65bbda..04bcc612b7 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -33,7 +33,7 @@
 
 typedef struct ThreadData {
     AVFrame *frame;
-    uint8_t *buf;
+    const uint8_t *buf;
     int stride;
 } ThreadData;
 
@@ -111,7 +111,7 @@ static int v210_decode_slice(AVCodecContext *avctx, void *arg, int jobnr, int th
     int stride = td->stride;
     int slice_start = (avctx->height *  jobnr) / s->thread_count;
     int slice_end = (avctx->height * (jobnr+1)) / s->thread_count;
-    uint8_t *psrc = td->buf + stride * slice_start;
+    const uint8_t *psrc = td->buf + stride * slice_start;
     int16_t *py = (uint16_t*)frame->data[0] + slice_start * frame->linesize[0] / 2;
     int16_t *pu = (uint16_t*)frame->data[1] + slice_start * frame->linesize[1] / 2;
     int16_t *pv = (uint16_t*)frame->data[2] + slice_start * frame->linesize[2] / 2;
@@ -191,7 +191,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic,
 
     if (stride) {
         td.stride = stride;
-        td.buf = (uint8_t*)psrc;
+        td.buf = psrc;
         td.frame = pic;
         avctx->execute2(avctx, v210_decode_slice, &td, NULL, s->thread_count);
     } else {
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 21/22] avutil/imgutils: Add wrapper for av_image_copy() to avoid casts
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (18 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 22/22] avfilter/vf_framepack: Use dedicated pointer for access Andreas Rheinhardt
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

av_image_copy() accepts const uint8_t* const * as source;
lots of user have uint8_t* const * and therefore either
cast (the majority) or copy the array of pointers.

This commit changes this by adding a static inline wrapper
for av_image_copy() that casts between the two types
so that we do not need to add casts everywhere else.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
The same can of course be done for the other functions
affected by this issue. I just wanted to get feedback
about this before investing time into it.

 doc/APIchanges                |  4 ++++
 doc/examples/demux_decode.c   |  6 +++---
 libavcodec/amfenc.c           |  6 +++---
 libavcodec/libkvazaar.c       |  6 +++---
 libavcodec/libopenh264dec.c   |  3 ++-
 libavcodec/libvpxdec.c        |  4 ++--
 libavcodec/mediacodecenc.c    |  7 ++-----
 libavcodec/mmaldec.c          |  4 ++--
 libavcodec/nuv.c              |  4 ++--
 libavcodec/nvenc.c            |  6 +++---
 libavcodec/omx.c              |  3 ++-
 libavcodec/v210dec.c          |  3 ++-
 libavdevice/xv.c              |  4 ++--
 libavfilter/lavfutils.c       |  3 ++-
 libavfilter/vf_framepack.c    | 28 ++++++++++------------------
 libavfilter/vf_pullup.c       | 12 ++++++------
 libavfilter/yadif_common.c    |  6 +++---
 libavutil/frame.c             |  8 +++-----
 libavutil/hwcontext_d3d11va.c |  8 ++++----
 libavutil/hwcontext_dxva2.c   |  4 ++--
 libavutil/imgutils.h          | 16 ++++++++++++++++
 21 files changed, 78 insertions(+), 67 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 0914a4da32..17e7c91f02 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - imgutils.h
+  Add av_image_copy2(), a wrapper around the av_image_copy()
+  to overcome limitations of automatic conversions.
+
 2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - fifo.h
   Constify the AVFifo pointees in av_fifo_peek() and av_fifo_peek_to_cb().
 
diff --git a/doc/examples/demux_decode.c b/doc/examples/demux_decode.c
index 298a369f43..f26611d8f4 100644
--- a/doc/examples/demux_decode.c
+++ b/doc/examples/demux_decode.c
@@ -78,9 +78,9 @@ static int output_video_frame(AVFrame *frame)
 
     /* copy decoded frame to destination buffer:
      * this is required since rawvideo expects non aligned data */
-    av_image_copy(video_dst_data, video_dst_linesize,
-                  (const uint8_t **)(frame->data), frame->linesize,
-                  pix_fmt, width, height);
+    av_image_copy2(video_dst_data, video_dst_linesize,
+                   frame->data, frame->linesize,
+                   pix_fmt, width, height);
 
     /* write to rawvideo file */
     fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
index 518b8396e7..061859f85c 100644
--- a/libavcodec/amfenc.c
+++ b/libavcodec/amfenc.c
@@ -430,9 +430,9 @@ static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame,
         dst_data[i] = plane->pVtbl->GetNative(plane);
         dst_linesize[i] = plane->pVtbl->GetHPitch(plane);
     }
-    av_image_copy(dst_data, dst_linesize,
-        (const uint8_t**)frame->data, frame->linesize, frame->format,
-        avctx->width, avctx->height);
+    av_image_copy2(dst_data, dst_linesize,
+                   frame->data, frame->linesize, frame->format,
+                   avctx->width, avctx->height);
 
     return 0;
 }
diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 2ef34dd82e..0ebf37607a 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -221,9 +221,9 @@ static int libkvazaar_encode(AVCodecContext *avctx,
               frame->width / 2,
               0
             };
-            av_image_copy(dst, dst_linesizes,
-                          (const uint8_t **)frame->data, frame->linesize,
-                          frame->format, frame->width, frame->height);
+            av_image_copy2(dst, dst_linesizes,
+                           frame->data, frame->linesize,
+                           frame->format, frame->width, frame->height);
         }
 
         input_pic->pts = frame->pts;
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index af53219b41..7d650ae03e 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -141,7 +141,8 @@ static int svc_decode_frame(AVCodecContext *avctx, AVFrame *avframe,
     linesize[0] = info.UsrData.sSystemBuffer.iStride[0];
     linesize[1] = linesize[2] = info.UsrData.sSystemBuffer.iStride[1];
     linesize[3] = 0;
-    av_image_copy(avframe->data, avframe->linesize, (const uint8_t **) ptrs, linesize, avctx->pix_fmt, avctx->width, avctx->height);
+    av_image_copy2(avframe->data, avframe->linesize, ptrs, linesize,
+                   avctx->pix_fmt, avctx->width, avctx->height);
 
     avframe->pts     = info.uiOutYuvTimeStamp;
     avframe->pkt_dts = AV_NOPTS_VALUE;
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 40c8caf887..72ef5fa9a7 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -329,8 +329,8 @@ static int vpx_decode(AVCodecContext *avctx, AVFrame *picture,
         } else {
             if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
                 return ret;
-            av_image_copy(picture->data, picture->linesize, (const uint8_t**)planes,
-                          linesizes, avctx->pix_fmt, img->d_w, img->d_h);
+            av_image_copy2(picture->data, picture->linesize, planes,
+                           linesizes, avctx->pix_fmt, img->d_w, img->d_h);
         }
         *got_frame           = 1;
     }
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 485ab7b4ed..a1ae5d5ec5 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -428,9 +428,6 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui
     MediaCodecEncContext *s = avctx->priv_data;
     uint8_t *dst_data[4] = {};
     int dst_linesize[4] = {};
-    const uint8_t *src_data[4] = {
-            frame->data[0], frame->data[1], frame->data[2], frame->data[3]
-    };
 
     if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
         dst_data[0] = dst;
@@ -449,8 +446,8 @@ static void copy_frame_to_buffer(AVCodecContext *avctx, const AVFrame *frame, ui
         av_assert0(0);
     }
 
-    av_image_copy(dst_data, dst_linesize, src_data, frame->linesize,
-                  avctx->pix_fmt, avctx->width, avctx->height);
+    av_image_copy2(dst_data, dst_linesize, frame->data, frame->linesize,
+                   avctx->pix_fmt, avctx->width, avctx->height);
 }
 
 static int mediacodec_send(AVCodecContext *avctx,
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 8d67d10cd9..4bb3eb22ef 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -648,8 +648,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx,  AVFrame *frame,
         av_image_fill_arrays(src, linesize,
                              buffer->data + buffer->type->video.offset[0],
                              avctx->pix_fmt, w, h, 1);
-        av_image_copy(frame->data, frame->linesize, (const uint8_t **)src, linesize,
-                      avctx->pix_fmt, avctx->width, avctx->height);
+        av_image_copy2(frame->data, frame->linesize, src, linesize,
+                       avctx->pix_fmt, avctx->width, avctx->height);
     }
 
     frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index 82048e9326..1dda770c97 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -56,8 +56,8 @@ static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height)
     int src_linesize[4];
     av_image_fill_arrays(src_data, src_linesize, src,
                          f->format, width, height, 1);
-    av_image_copy(f->data, f->linesize, (const uint8_t **)src_data, src_linesize,
-                  f->format, width, height);
+    av_image_copy2(f->data, f->linesize, src_data, src_linesize,
+                   f->format, width, height);
 }
 
 /**
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 9875f02dc8..65b96d6cf6 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2008,9 +2008,9 @@ static int nvenc_copy_frame(AVCodecContext *avctx, NvencSurface *nv_surface,
     if (frame->format == AV_PIX_FMT_YUV420P)
         FFSWAP(uint8_t*, dst_data[1], dst_data[2]);
 
-    av_image_copy(dst_data, dst_linesize,
-                  (const uint8_t**)frame->data, frame->linesize, frame->format,
-                  avctx->width, avctx->height);
+    av_image_copy2(dst_data, dst_linesize,
+                   frame->data, frame->linesize, frame->format,
+                   avctx->width, avctx->height);
 
     return 0;
 }
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 8d6519d141..82fd492071 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -793,7 +793,8 @@ static int omx_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
             need_copy = 1;
         }
         if (need_copy)
-            av_image_copy(dst, linesize, (const uint8_t**) frame->data, frame->linesize, avctx->pix_fmt, avctx->width, avctx->height);
+            av_image_copy2(dst, linesize, frame->data, frame->linesize,
+                           avctx->pix_fmt, avctx->width, avctx->height);
         buffer->nFlags = OMX_BUFFERFLAG_ENDOFFRAME;
         buffer->nOffset = 0;
         // Convert the timestamps to microseconds; some encoders can ignore
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 04bcc612b7..d80fb4e7c6 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -201,7 +201,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *pic,
         if (ret < 0)
             return ret;
         decode_row((const uint32_t *)psrc, (uint16_t *)pointers[0], (uint16_t *)pointers[1], (uint16_t *)pointers[2], avctx->width * avctx->height, s->unpack_frame);
-        av_image_copy(pic->data, pic->linesize, (const uint8_t **)pointers, linesizes, avctx->pix_fmt, avctx->width, avctx->height);
+        av_image_copy2(pic->data, pic->linesize, pointers, linesizes,
+                       avctx->pix_fmt, avctx->width, avctx->height);
         av_freep(&pointers[0]);
     }
 
diff --git a/libavdevice/xv.c b/libavdevice/xv.c
index b3d79d57a8..cba933ef17 100644
--- a/libavdevice/xv.c
+++ b/libavdevice/xv.c
@@ -315,8 +315,8 @@ static int write_picture(AVFormatContext *s, uint8_t *input_data[4],
         }
     }
 
-    av_image_copy(data, img->pitches, (const uint8_t **)input_data, linesize,
-                  xv->image_format, img->width, img->height);
+    av_image_copy2(data, img->pitches, input_data, linesize,
+                   xv->image_format, img->width, img->height);
     return xv_repaint(s);
 }
 
diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index 9aa781ef7b..6130f21e7f 100644
--- a/libavfilter/lavfutils.c
+++ b/libavfilter/lavfutils.c
@@ -117,7 +117,8 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
         goto end;
     ret = 0;
 
-    av_image_copy(data, linesize, (const uint8_t **)frame->data, frame->linesize, *pix_fmt, *w, *h);
+    av_image_copy2(data, linesize, frame->data, frame->linesize,
+                   *pix_fmt, *w, *h);
 
 end:
     avcodec_free_context(&codec_ctx);
diff --git a/libavfilter/vf_framepack.c b/libavfilter/vf_framepack.c
index 8693ad6488..cbfcf1e036 100644
--- a/libavfilter/vf_framepack.c
+++ b/libavfilter/vf_framepack.c
@@ -234,22 +234,18 @@ static void horizontal_frame_pack(AVFilterLink *outlink,
     } else {
         for (i = 0; i < 2; i++) {
             const int psize = 1 + (s->depth > 8);
-            const uint8_t *src[4];
             uint8_t *dst[4];
             int sub_w = psize * s->input_views[i]->width >> s->pix_desc->log2_chroma_w;
 
-            src[0] = s->input_views[i]->data[0];
-            src[1] = s->input_views[i]->data[1];
-            src[2] = s->input_views[i]->data[2];
-
             dst[0] = out->data[0] + i * s->input_views[i]->width * psize;
             dst[1] = out->data[1] + i * sub_w;
             dst[2] = out->data[2] + i * sub_w;
 
-            av_image_copy(dst, out->linesize, src, s->input_views[i]->linesize,
-                          s->input_views[i]->format,
-                          s->input_views[i]->width,
-                          s->input_views[i]->height);
+            av_image_copy2(dst, out->linesize,
+                           s->input_views[i]->data, s->input_views[i]->linesize,
+                           s->input_views[i]->format,
+                           s->input_views[i]->width,
+                           s->input_views[i]->height);
         }
     }
 }
@@ -263,15 +259,10 @@ static void vertical_frame_pack(AVFilterLink *outlink,
     int i;
 
     for (i = 0; i < 2; i++) {
-        const uint8_t *src[4];
         uint8_t *dst[4];
         int linesizes[4];
         int sub_h = s->input_views[i]->height >> s->pix_desc->log2_chroma_h;
 
-        src[0] = s->input_views[i]->data[0];
-        src[1] = s->input_views[i]->data[1];
-        src[2] = s->input_views[i]->data[2];
-
         dst[0] = out->data[0] + i * out->linesize[0] *
                  (interleaved + s->input_views[i]->height * (1 - interleaved));
         dst[1] = out->data[1] + i * out->linesize[1] *
@@ -286,10 +277,11 @@ static void vertical_frame_pack(AVFilterLink *outlink,
         linesizes[2] = out->linesize[2] +
                        interleaved * out->linesize[2];
 
-        av_image_copy(dst, linesizes, src, s->input_views[i]->linesize,
-                      s->input_views[i]->format,
-                      s->input_views[i]->width,
-                      s->input_views[i]->height);
+        av_image_copy2(dst, linesizes,
+                       s->input_views[i]->data, s->input_views[i]->linesize,
+                       s->input_views[i]->format,
+                       s->input_views[i]->width,
+                       s->input_views[i]->height);
     }
 }
 
diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c
index 7245684085..14beb972c5 100644
--- a/libavfilter/vf_pullup.c
+++ b/libavfilter/vf_pullup.c
@@ -666,9 +666,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         goto end;
     }
 
-    av_image_copy(b->planes, s->planewidth,
-                  (const uint8_t**)in->data, in->linesize,
-                  inlink->format, inlink->w, inlink->h);
+    av_image_copy2(b->planes, s->planewidth,
+                   in->data, in->linesize,
+                   inlink->format, inlink->w, inlink->h);
 
     p = (in->flags & AV_FRAME_FLAG_INTERLACED) ?
         !(in->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) : 0;
@@ -714,9 +714,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
     av_frame_copy_props(out, in);
 
-    av_image_copy(out->data, out->linesize,
-                  (const uint8_t**)f->buffer->planes, s->planewidth,
-                  inlink->format, inlink->w, inlink->h);
+    av_image_copy2(out->data, out->linesize,
+                   f->buffer->planes, s->planewidth,
+                   inlink->format, inlink->w, inlink->h);
 
     ret = ff_filter_frame(outlink, out);
     pullup_release_frame(f);
diff --git a/libavfilter/yadif_common.c b/libavfilter/yadif_common.c
index 561659e346..b26989f574 100644
--- a/libavfilter/yadif_common.c
+++ b/libavfilter/yadif_common.c
@@ -89,9 +89,9 @@ static void fixstride(AVFilterLink *link, AVFrame *f)
     if(!dst)
         return;
     av_frame_copy_props(dst, f);
-    av_image_copy(dst->data, dst->linesize,
-                  (const uint8_t **)f->data, f->linesize,
-                  dst->format, dst->width, dst->height);
+    av_image_copy2(dst->data, dst->linesize,
+                   f->data, f->linesize,
+                   dst->format, dst->width, dst->height);
     av_frame_unref(f);
     av_frame_move_ref(f, dst);
     av_frame_free(&dst);
diff --git a/libavutil/frame.c b/libavutil/frame.c
index b6cee2d886..a3f07ca089 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -833,7 +833,6 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
 
 static int frame_copy_video(AVFrame *dst, const AVFrame *src)
 {
-    const uint8_t *src_data[4];
     int planes;
 
     if (dst->width  < src->width ||
@@ -848,10 +847,9 @@ static int frame_copy_video(AVFrame *dst, const AVFrame *src)
         if (!dst->data[i] || !src->data[i])
             return AVERROR(EINVAL);
 
-    memcpy(src_data, src->data, sizeof(src_data));
-    av_image_copy(dst->data, dst->linesize,
-                  src_data, src->linesize,
-                  dst->format, src->width, src->height);
+    av_image_copy2(dst->data, dst->linesize,
+                   src->data, src->linesize,
+                   dst->format, src->width, src->height);
 
     return 0;
 }
diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index aa50538d64..cc8c97d2b6 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -452,8 +452,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
 
         fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map);
 
-        av_image_copy(dst->data, dst->linesize, (const uint8_t **)map_data, map_linesize,
-                      ctx->sw_format, w, h);
+        av_image_copy2(dst->data, dst->linesize, map_data, map_linesize,
+                       ctx->sw_format, w, h);
 
         ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0);
     } else {
@@ -464,8 +464,8 @@ static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
 
         fill_texture_ptrs(map_data, map_linesize, ctx, &desc, &map);
 
-        av_image_copy(map_data, map_linesize, (const uint8_t **)src->data, src->linesize,
-                      ctx->sw_format, w, h);
+        av_image_copy2(map_data, map_linesize, src->data, src->linesize,
+                       ctx->sw_format, w, h);
 
         ID3D11DeviceContext_Unmap(device_hwctx->device_context, staging, 0);
 
diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index ea378df720..2c11f151ff 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -356,8 +356,8 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
     if (ret < 0)
         goto fail;
 
-    av_image_copy(map->data, map->linesize, (const uint8_t **)src->data, src->linesize,
-                  ctx->sw_format, src->width, src->height);
+    av_image_copy2(map->data, map->linesize, src->data, src->linesize,
+                   ctx->sw_format, src->width, src->height);
 
 fail:
     av_frame_free(&map);
diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 91312a72d3..c7fc330117 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -174,6 +174,22 @@ void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4],
                    const uint8_t * const src_data[4], const int src_linesizes[4],
                    enum AVPixelFormat pix_fmt, int width, int height);
 
+/**
+ * Wrapper around av_image_copy() to workaround the limitation
+ * that the conversion from uint8_t * const * to const uint8_t * const *
+ * is not performed automatically in C.
+ * @see av_image_copy
+ */
+static inline
+void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4],
+                    uint8_t * const src_data[4], const int src_linesizes[4],
+                    enum AVPixelFormat pix_fmt, int width, int height)
+{
+    av_image_copy(dst_data, dst_linesizes,
+                  (const uint8_t * const *)src_data, src_linesizes,
+                  pix_fmt, width, height);
+}
+
 /**
  * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
  * available, this function will use special functionality for reading from such
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH v2 22/22] avfilter/vf_framepack: Use dedicated pointer for access
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (19 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 21/22] avutil/imgutils: Add wrapper for av_image_copy() to avoid casts Andreas Rheinhardt
@ 2023-09-07  1:05 ` Andreas Rheinhardt
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 23/26] avformat/avio: Remove duplicated freeing code Andreas Rheinhardt
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07  1:05 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Improves readability.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_framepack.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/libavfilter/vf_framepack.c b/libavfilter/vf_framepack.c
index cbfcf1e036..3b915ddddf 100644
--- a/libavfilter/vf_framepack.c
+++ b/libavfilter/vf_framepack.c
@@ -233,19 +233,20 @@ static void horizontal_frame_pack(AVFilterLink *outlink,
         }
     } else {
         for (i = 0; i < 2; i++) {
+            const AVFrame *const input_view = s->input_views[i];
             const int psize = 1 + (s->depth > 8);
             uint8_t *dst[4];
-            int sub_w = psize * s->input_views[i]->width >> s->pix_desc->log2_chroma_w;
+            int sub_w = psize * input_view->width >> s->pix_desc->log2_chroma_w;
 
-            dst[0] = out->data[0] + i * s->input_views[i]->width * psize;
+            dst[0] = out->data[0] + i * input_view->width * psize;
             dst[1] = out->data[1] + i * sub_w;
             dst[2] = out->data[2] + i * sub_w;
 
             av_image_copy2(dst, out->linesize,
-                           s->input_views[i]->data, s->input_views[i]->linesize,
-                           s->input_views[i]->format,
-                           s->input_views[i]->width,
-                           s->input_views[i]->height);
+                           input_view->data, input_view->linesize,
+                           input_view->format,
+                           input_view->width,
+                           input_view->height);
         }
     }
 }
@@ -259,12 +260,13 @@ static void vertical_frame_pack(AVFilterLink *outlink,
     int i;
 
     for (i = 0; i < 2; i++) {
+        const AVFrame *const input_view = s->input_views[i];
         uint8_t *dst[4];
         int linesizes[4];
-        int sub_h = s->input_views[i]->height >> s->pix_desc->log2_chroma_h;
+        int sub_h = input_view->height >> s->pix_desc->log2_chroma_h;
 
         dst[0] = out->data[0] + i * out->linesize[0] *
-                 (interleaved + s->input_views[i]->height * (1 - interleaved));
+                 (interleaved + input_view->height * (1 - interleaved));
         dst[1] = out->data[1] + i * out->linesize[1] *
                  (interleaved + sub_h * (1 - interleaved));
         dst[2] = out->data[2] + i * out->linesize[2] *
@@ -278,10 +280,10 @@ static void vertical_frame_pack(AVFilterLink *outlink,
                        interleaved * out->linesize[2];
 
         av_image_copy2(dst, linesizes,
-                       s->input_views[i]->data, s->input_views[i]->linesize,
-                       s->input_views[i]->format,
-                       s->input_views[i]->width,
-                       s->input_views[i]->height);
+                       input_view->data, input_view->linesize,
+                       input_view->format,
+                       input_view->width,
+                       input_view->height);
     }
 }
 
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away Andreas Rheinhardt
@ 2023-09-07  7:36   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07  7:36 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 23/26] avformat/avio: Remove duplicated freeing code
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (20 preceding siblings ...)
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 22/22] avfilter/vf_framepack: Use dedicated pointer for access Andreas Rheinhardt
@ 2023-09-07 10:38 ` Andreas Rheinhardt
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 24/26] avformat/avio: Remove redundant checks Andreas Rheinhardt
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 10:38 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

The target of the jump frees this stuff, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/avio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 053cb2e05a..a4572d2f05 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -136,8 +136,6 @@ static int url_alloc_for_protocol(URLContext **puc, const URLProtocol *up,
                 }
                 if(ret<0 || p!=key){
                     av_log(uc, AV_LOG_ERROR, "Error parsing options string %s\n", start);
-                    av_freep(&uc->priv_data);
-                    av_freep(&uc);
                     err = AVERROR(EINVAL);
                     goto fail;
                 }
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 24/26] avformat/avio: Remove redundant checks
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (21 preceding siblings ...)
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 23/26] avformat/avio: Remove duplicated freeing code Andreas Rheinhardt
@ 2023-09-07 10:38 ` Andreas Rheinhardt
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 25/26] all: Use av_frame_replace() where appropriate Andreas Rheinhardt
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 10:38 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Checking the return value of av_opt_set() is equivalent
to the current checks.

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

diff --git a/libavformat/avio.c b/libavformat/avio.c
index a4572d2f05..617c1c0ac0 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -125,10 +125,7 @@ static int url_alloc_for_protocol(URLContext **puc, const URLProtocol *up,
 
                 while(ret >= 0 && (key= strchr(p, sep)) && p<key && (val = strchr(key+1, sep))){
                     *val= *key= 0;
-                    if (strcmp(p, "start") && strcmp(p, "end")) {
-                        ret = AVERROR_OPTION_NOT_FOUND;
-                    } else
-                        ret= av_opt_set(uc->priv_data, p, key+1, 0);
+                    ret = av_opt_set(uc->priv_data, p, key+1, 0);
                     if (ret == AVERROR_OPTION_NOT_FOUND)
                         av_log(uc, AV_LOG_ERROR, "Key '%s' not found.\n", p);
                     *val= *key= sep;
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 25/26] all: Use av_frame_replace() where appropriate
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (22 preceding siblings ...)
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 24/26] avformat/avio: Remove redundant checks Andreas Rheinhardt
@ 2023-09-07 10:38 ` Andreas Rheinhardt
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() " Andreas Rheinhardt
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 10:38 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/agm.c             | 3 +--
 libavcodec/arbc.c            | 3 +--
 libavcodec/audiotoolboxenc.c | 3 +--
 libavcodec/bink.c            | 3 +--
 libavcodec/cdgraphics.c      | 3 +--
 libavcodec/dxa.c             | 3 +--
 libavcodec/eacmv.c           | 5 ++---
 libavcodec/eamad.c           | 3 +--
 libavcodec/eatgv.c           | 3 +--
 libavcodec/escape124.c       | 3 +--
 libavcodec/gif.c             | 3 +--
 libavcodec/imm4.c            | 3 +--
 libavcodec/interplayvideo.c  | 3 +--
 libavcodec/mss2.c            | 3 +--
 libavcodec/mv30.c            | 3 +--
 libavcodec/mwsc.c            | 3 +--
 libavcodec/pdvdec.c          | 3 +--
 libavcodec/pngenc.c          | 3 +--
 libavcodec/qpeg.c            | 3 +--
 libavcodec/qsvenc.c          | 3 +--
 libavcodec/qtrleenc.c        | 3 +--
 libavcodec/smcenc.c          | 3 +--
 libavcodec/snowenc.c         | 3 +--
 libavcodec/svq1dec.c         | 3 +--
 libavcodec/vmdvideo.c        | 3 +--
 libavcodec/vp56.c            | 6 ++----
 libavcodec/xan.c             | 3 +--
 libavcodec/zerocodec.c       | 3 +--
 libavfilter/vf_paletteuse.c  | 3 +--
 libavfilter/vsrc_ddagrab.c   | 3 +--
 libavutil/hwcontext.c        | 6 ++----
 31 files changed, 34 insertions(+), 67 deletions(-)

diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 55cf0b47c8..84c96d22b5 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -1203,8 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
     if (ret < 0)
         return ret;
 
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
         return ret;
 
     frame->crop_top  = avctx->coded_height - avctx->height;
diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
index 1b349f4dd6..46b0275e9a 100644
--- a/libavcodec/arbc.c
+++ b/libavcodec/arbc.c
@@ -166,8 +166,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
             prev_pixels -= fill_tile4(avctx, fill, frame);
     }
 
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
         return ret;
 
     frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 1b4e2a6c43..42ab7ae6e4 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -483,8 +483,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_pac
     if (*nb_packets > frame->nb_samples)
         *nb_packets = frame->nb_samples;
 
-    av_frame_unref(at->encoding_frame);
-    ret = av_frame_ref(at->encoding_frame, frame);
+    ret = av_frame_replace(at->encoding_frame, frame);
     if (ret < 0) {
         *nb_packets = 0;
         return ret;
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 8d96dee705..9024c388f3 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1300,8 +1300,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
     emms_c();
 
     if (c->version > 'b') {
-        av_frame_unref(c->last);
-        if ((ret = av_frame_ref(c->last, frame)) < 0)
+        if ((ret = av_frame_replace(c->last, frame)) < 0)
             return ret;
     }
 
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 0c5022a5d6..7b0666a3e2 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -344,8 +344,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
                 return ret;
 
             cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
-            av_frame_unref(cc->frame);
-            ret = av_frame_ref(cc->frame, frame);
+            ret = av_frame_replace(cc->frame, frame);
             if (ret < 0)
                 return ret;
             break;
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index d903b7ecd4..650502ad23 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -317,8 +317,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         return AVERROR_INVALIDDATA;
     }
 
-    av_frame_unref(c->prev);
-    if ((ret = av_frame_ref(c->prev, frame)) < 0)
+    if ((ret = av_frame_replace(c->prev, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index e73e310c4a..43dba20fae 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
         cmv_decode_intra(s, frame, buf+2, buf_end);
     }
 
-    av_frame_unref(s->last2_frame);
-    av_frame_move_ref(s->last2_frame, s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+    FFSWAP(AVFrame*, s->last2_frame, s->last_frame);
+    if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 45012c62b8..287575e073 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -317,8 +317,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
     *got_frame = 1;
 
     if (chunk_type != MADe_TAG) {
-        av_frame_unref(s->last_frame);
-        if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+        if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
             return ret;
     }
 
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index a2aead46eb..35bd88b740 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -338,8 +338,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, AVFrame *frame,
         }
     }
 
-    av_frame_unref(s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index 592de09a9f..cd62f8d1f0 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -362,8 +362,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVFrame *frame,
            "Escape sizes: %i, %i, %i\n",
            frame_size, buf_size, get_bits_count(&gb) / 8);
 
-    av_frame_unref(s->frame);
-    if ((ret = av_frame_ref(s->frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 131af6198a..11add64468 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -503,8 +503,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
 
     if (!s->image) {
-        av_frame_unref(s->last_frame);
-        ret = av_frame_ref(s->last_frame, pict);
+        ret = av_frame_replace(s->last_frame, pict);
         if (ret < 0)
             return ret;
     }
diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c
index b95ad86921..25e7570a2c 100644
--- a/libavcodec/imm4.c
+++ b/libavcodec/imm4.c
@@ -453,8 +453,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
         if (ret < 0)
             return ret;
 
-        av_frame_unref(s->prev_frame);
-        if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+        if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
             return ret;
     } else {
         if (!s->prev_frame->data[0]) {
diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index 1f0414bbaf..9c13707f87 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -1340,9 +1340,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
     *got_frame = send_buffer;
 
     /* shuffle frames */
-    av_frame_unref(s->second_last_frame);
     FFSWAP(AVFrame*, s->second_last_frame, s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
         return ret;
 
     /* report that the buffer was completely consumed */
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 98103f7fed..94211ffc5e 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -797,8 +797,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, AVFrame *frame,
         av_log(avctx, AV_LOG_WARNING, "buffer not fully consumed\n");
 
     if (c->mvX < 0 || c->mvY < 0) {
-        av_frame_unref(ctx->last_pic);
-        ret = av_frame_ref(ctx->last_pic, frame);
+        ret = av_frame_replace(ctx->last_pic, frame);
         if (ret < 0)
             return ret;
     }
diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index c2d0547053..92c567c620 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -643,8 +643,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
             return ret;
     }
 
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/mwsc.c b/libavcodec/mwsc.c
index c7045ac793..f8c53c33ff 100644
--- a/libavcodec/mwsc.c
+++ b/libavcodec/mwsc.c
@@ -127,8 +127,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
 
     frame->pict_type = (frame->flags & AV_FRAME_FLAG_KEY) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
 
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/pdvdec.c b/libavcodec/pdvdec.c
index d50c4e729c..e2c03e7e0d 100644
--- a/libavcodec/pdvdec.c
+++ b/libavcodec/pdvdec.c
@@ -102,8 +102,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
         dst += frame->linesize[0];
     }
 
-    av_frame_unref(s->previous_frame);
-    if ((ret = av_frame_ref(s->previous_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->previous_frame, frame)) < 0)
         return ret;
 
     if (avpkt->flags & AV_PKT_FLAG_KEY) {
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 21b033ea16..f0650962d2 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -1059,8 +1059,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
             }
         }
 
-        av_frame_unref(s->last_frame);
-        ret = av_frame_ref(s->last_frame, pict);
+        ret = av_frame_replace(s->last_frame, pict);
         if (ret < 0)
             return ret;
 
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index 1f76ebc5a1..9b4ad8e25d 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -307,8 +307,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
     memcpy(p->data[1], a->pal, AVPALETTE_SIZE);
 
-    av_frame_unref(ref);
-    if ((ret = av_frame_ref(ref, p)) < 0)
+    if ((ret = av_frame_replace(ref, p)) < 0)
         return ret;
 
     if (intra)
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 4efc8d551e..a0144b0760 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1996,8 +1996,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame *frame,
                 return ret;
             }
         } else {
-            av_frame_unref(qf->frame);
-            ret = av_frame_ref(qf->frame, frame);
+            ret = av_frame_replace(qf->frame, frame);
             if (ret < 0)
                 return ret;
         }
diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c
index 3846762745..92e6e84380 100644
--- a/libavcodec/qtrleenc.c
+++ b/libavcodec/qtrleenc.c
@@ -385,8 +385,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     pkt->size = encode_frame(s, pict, pkt->data);
 
     /* save the current frame */
-    av_frame_unref(s->previous_frame);
-    ret = av_frame_ref(s->previous_frame, pict);
+    ret = av_frame_replace(s->previous_frame, pict);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "cannot add reference\n");
         return ret;
diff --git a/libavcodec/smcenc.c b/libavcodec/smcenc.c
index fb15489ad2..789aef4f77 100644
--- a/libavcodec/smcenc.c
+++ b/libavcodec/smcenc.c
@@ -566,8 +566,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     // write chunk length
     AV_WB24(pkt->data + 1, pkt->size);
 
-    av_frame_unref(s->prev_frame);
-    ret = av_frame_ref(s->prev_frame, frame);
+    ret = av_frame_replace(s->prev_frame, frame);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "cannot add reference\n");
         return ret;
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index c330303317..14a59ca67b 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1887,8 +1887,7 @@ redo_frame:
                                    (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? SNOW_MAX_PLANES : 0,
                                    s->current_picture->pict_type);
     if (s->avctx->flags & AV_CODEC_FLAG_RECON_FRAME) {
-        av_frame_unref(avci->recon_frame);
-        av_frame_ref(avci->recon_frame, s->current_picture);
+        av_frame_replace(avci->recon_frame, s->current_picture);
     }
 
     pkt->size = ff_rac_terminate(c, 0);
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index c7269456e2..e3f22f108c 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -764,8 +764,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, AVFrame *cur,
     }
 
     if (!s->nonref) {
-        av_frame_unref(s->prev);
-        result = av_frame_ref(s->prev, cur);
+        result = av_frame_replace(s->prev, cur);
         if (result < 0)
             return result;
     }
diff --git a/libavcodec/vmdvideo.c b/libavcodec/vmdvideo.c
index 226ae0d316..2da8af31f5 100644
--- a/libavcodec/vmdvideo.c
+++ b/libavcodec/vmdvideo.c
@@ -454,8 +454,7 @@ static int vmdvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     memcpy(frame->data[1], s->palette, PALETTE_COUNT * 4);
 
     /* shuffle frames */
-    av_frame_unref(s->prev_frame);
-    if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
         return ret;
 
     *got_frame      = 1;
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index a5c5b23622..f2ee3fafd4 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -607,8 +607,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
     }
 
     if (avctx->pix_fmt == AV_PIX_FMT_YUVA420P) {
-        av_frame_unref(s->alpha_context->frames[VP56_FRAME_CURRENT]);
-        if ((ret = av_frame_ref(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) {
+        if ((ret = av_frame_replace(s->alpha_context->frames[VP56_FRAME_CURRENT], p)) < 0) {
             av_frame_unref(p);
             if (res == VP56_SIZE_CHANGE)
                 ff_set_dimensions(avctx, 0, 0);
@@ -764,8 +763,7 @@ static int ff_vp56_decode_mbs(AVCodecContext *avctx, void *data,
 
 next:
     if ((p->flags & AV_FRAME_FLAG_KEY) || s->golden_frame) {
-        av_frame_unref(s->frames[VP56_FRAME_GOLDEN]);
-        if ((res = av_frame_ref(s->frames[VP56_FRAME_GOLDEN], p)) < 0)
+        if ((res = av_frame_replace(s->frames[VP56_FRAME_GOLDEN], p)) < 0)
             return res;
     }
 
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 14fc2443c5..cc0ecea5eb 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -622,8 +622,7 @@ static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     if (xan_wc3_decode_frame(s, frame) < 0)
         return AVERROR_INVALIDDATA;
 
-    av_frame_unref(s->last_frame);
-    if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+    if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c
index 6c3bcebce0..48f78d1d86 100644
--- a/libavcodec/zerocodec.c
+++ b/libavcodec/zerocodec.c
@@ -93,8 +93,7 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, AVFrame *pic,
         dst  -= pic->linesize[0];
     }
 
-    av_frame_unref(zc->previous_frame);
-    if ((ret = av_frame_ref(zc->previous_frame, pic)) < 0)
+    if ((ret = av_frame_replace(zc->previous_frame, pic)) < 0)
         return ret;
 
     *got_frame = 1;
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index 79d8fb2e51..bc767c508c 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -781,9 +781,8 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, AVFrame **outf)
 
     set_processing_window(s->diff_mode, s->last_in, in,
                           s->last_out, out, &x, &y, &w, &h);
-    av_frame_unref(s->last_in);
     av_frame_unref(s->last_out);
-    if ((ret = av_frame_ref(s->last_in, in))       < 0 ||
+    if ((ret = av_frame_replace(s->last_in, in))   < 0 ||
         (ret = av_frame_ref(s->last_out, out))     < 0 ||
         (ret = ff_inlink_make_frame_writable(inlink, &s->last_in)) < 0) {
         av_frame_free(&out);
diff --git a/libavfilter/vsrc_ddagrab.c b/libavfilter/vsrc_ddagrab.c
index c3107e11b4..2d9d71a7ba 100644
--- a/libavfilter/vsrc_ddagrab.c
+++ b/libavfilter/vsrc_ddagrab.c
@@ -1076,8 +1076,7 @@ static int ddagrab_request_frame(AVFilterLink *outlink)
         goto fail;
     }
 
-    av_frame_unref(dda->last_frame);
-    ret = av_frame_ref(dda->last_frame, frame);
+    ret = av_frame_replace(dda->last_frame, frame);
     if (ret < 0)
         return ret;
 
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 3396598269..3650d4653a 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -819,8 +819,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
                 return AVERROR(EINVAL);
             }
             hwmap = (HWMapDescriptor*)src->buf[0]->data;
-            av_frame_unref(dst);
-            return av_frame_ref(dst, hwmap->source);
+            return av_frame_replace(dst, hwmap->source);
         }
     }
 
@@ -950,6 +949,5 @@ fail:
 int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src)
 {
     HWMapDescriptor *hwmap = (HWMapDescriptor*)dst->buf[0]->data;
-    av_frame_unref(hwmap->source);
-    return av_frame_ref(hwmap->source, src);
+    return av_frame_replace(hwmap->source, src);
 }
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() where appropriate
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (23 preceding siblings ...)
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 25/26] all: Use av_frame_replace() where appropriate Andreas Rheinhardt
@ 2023-09-07 10:38 ` Andreas Rheinhardt
  2023-09-07 11:09   ` Nicolas George
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily Andreas Rheinhardt
                   ` (5 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 10:38 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/buffersrc.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index ea50713701..453fc0fd5c 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
     }
 
-    if (!(copy = av_frame_alloc()))
-        return AVERROR(ENOMEM);
-
     if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
+        if (!(copy = av_frame_alloc()))
+            return AVERROR(ENOMEM);
         av_frame_move_ref(copy, frame);
     } else {
-        ret = av_frame_ref(copy, frame);
-        if (ret < 0) {
-            av_frame_free(&copy);
-            return ret;
-        }
+        copy = av_frame_clone(frame);
+        if (!copy)
+            return AVERROR(ENOMEM);
     }
 
 #if FF_API_PKT_DURATION
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() where appropriate
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() " Andreas Rheinhardt
@ 2023-09-07 11:09   ` Nicolas George
  0 siblings, 0 replies; 42+ messages in thread
From: Nicolas George @ 2023-09-07 11:09 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

Andreas Rheinhardt (12023-09-07):
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavfilter/buffersrc.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)

No objection.

Regards,

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (24 preceding siblings ...)
  2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() " Andreas Rheinhardt
@ 2023-09-07 14:03 ` Andreas Rheinhardt
  2023-09-07 14:32   ` Paul B Mahol
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes Andreas Rheinhardt
                   ` (4 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 14:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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

diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c
index 3c662491b2..a927abaf6f 100644
--- a/libavfilter/vf_vif.c
+++ b/libavfilter/vf_vif.c
@@ -301,8 +301,8 @@ static int compute_vif2(AVFilterContext *ctx,
     float *main_sq_filt = data_buf[11];
     float *ref_main_filt = data_buf[12];
 
-    float *curr_ref_scale = (float *)ref;
-    float *curr_main_scale = (float *)main;
+    const float *curr_ref_scale  = ref;
+    const float *curr_main_scale = main;
     int curr_ref_stride = ref_stride;
     int curr_main_stride = main_stride;
 
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (25 preceding siblings ...)
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily Andreas Rheinhardt
@ 2023-09-07 14:03 ` Andreas Rheinhardt
  2023-09-07 14:47   ` Paul B Mahol
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away Andreas Rheinhardt
                   ` (3 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 14:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

The const makes no sense and is later cast away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vsrc_testsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index d24481e6c4..5e41416464 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -327,7 +327,7 @@ static void haldclutsrc_fill_picture(AVFilterContext *ctx, AVFrame *frame)
     float scale;
     const int w = frame->width;
     const int h = frame->height;
-    const uint8_t *data = frame->data[0];
+    uint8_t *data = frame->data[0];
     const int linesize  = frame->linesize[0];
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
     const int depth = desc->comp[0].depth;
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (26 preceding siblings ...)
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes Andreas Rheinhardt
@ 2023-09-07 14:03 ` Andreas Rheinhardt
  2023-09-07 17:58   ` Paul B Mahol
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination Andreas Rheinhardt
                   ` (2 subsequent siblings)
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 14:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

lzma_stream.next_in is const for more than 15 years now
and has been so in every release of liblzma.

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

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 148964590b..adb49e4525 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -337,7 +337,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri
            (split vertically in the middle). */
         for (line = 0; line < height / 2; line++) {
             uint16_t *dst_u16 = (uint16_t *)dst;
-            uint16_t *src_u16 = (uint16_t *)src;
+            const uint16_t *src_u16 = (const uint16_t *)src;
 
             /* Blit first half of input row row to initial row of output */
             for (col = 0; col < width; col++)
@@ -360,7 +360,7 @@ static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stri
         if (is_u16) {
             for (line = 0; line < height; line++) {
                 uint16_t *dst_u16 = (uint16_t *)dst;
-                uint16_t *src_u16 = (uint16_t *)src;
+                const uint16_t *src_u16 = (const uint16_t *)src;
 
                 for (col = 0; col < width; col++)
                     *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut,
@@ -570,7 +570,7 @@ static int tiff_uncompress_lzma(uint8_t *dst, uint64_t *len, const uint8_t *src,
     lzma_stream stream = LZMA_STREAM_INIT;
     lzma_ret ret;
 
-    stream.next_in   = (uint8_t *)src;
+    stream.next_in   = src;
     stream.avail_in  = size;
     stream.next_out  = dst;
     stream.avail_out = *len;
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (27 preceding siblings ...)
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away Andreas Rheinhardt
@ 2023-09-07 14:03 ` Andreas Rheinhardt
  2023-09-07 14:31   ` Paul B Mahol
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness Andreas Rheinhardt
  2023-09-10 10:23 ` [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 14:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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

diff --git a/libavfilter/vf_varblur.c b/libavfilter/vf_varblur.c
index f6f8382adc..6ebb9c0663 100644
--- a/libavfilter/vf_varblur.c
+++ b/libavfilter/vf_varblur.c
@@ -45,7 +45,7 @@ typedef struct VarBlurContext {
     void (*compute_sat)(const uint8_t *ssrc,
                         int linesize,
                         int w, int h,
-                        const uint8_t *dstp,
+                        uint8_t *dstp,
                         int dst_linesize);
 
     int (*blur_plane)(AVFilterContext *ctx,
@@ -98,7 +98,7 @@ static const enum AVPixelFormat pix_fmts[] = {
 static void compute_sat##depth(const uint8_t *ssrc,  \
                                int linesize,         \
                                int w, int h,         \
-                               const uint8_t *dstp,  \
+                               uint8_t *dstp,        \
                                int dst_linesize)     \
 {                                                    \
     const type *src = (const type *)ssrc;            \
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (28 preceding siblings ...)
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination Andreas Rheinhardt
@ 2023-09-07 14:03 ` Andreas Rheinhardt
  2023-09-07 14:32   ` Paul B Mahol
  2023-09-10 10:23 ` [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
  30 siblings, 1 reply; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 14:03 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

These casts cast const away temporarily; they are safe, because
the pointers that are initialized point to const data. But this
is nevertheless not nice and leads to warnings when using
-Wcast-qual. blend_modes.c generates 546 (2*39*7) such warnings
which is the majority of such warnings for FFmpeg as a whole.
vf_blend.c and vf_blend_init.h also use this pattern;
they have also been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/blend_modes.c   | 4 ++--
 libavfilter/vf_blend.c      | 4 ++--
 libavfilter/vf_blend_init.h | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/blend_modes.c b/libavfilter/blend_modes.c
index e2be676243..65c5e6f890 100644
--- a/libavfilter/blend_modes.c
+++ b/libavfilter/blend_modes.c
@@ -93,8 +93,8 @@ static void fn0(NAME)(const uint8_t *_top, ptrdiff_t top_linesize, \
      ptrdiff_t width, ptrdiff_t height,                       \
      FilterParams *param, double *values, int starty)         \
 {                                                                                   \
-    const PIXEL *top = (PIXEL *)_top;                                               \
-    const PIXEL *bottom = (PIXEL *)_bottom;                                         \
+    const PIXEL *top = (const PIXEL *)_top;                                         \
+    const PIXEL *bottom = (const PIXEL *)_bottom;                                   \
     PIXEL *dst = (PIXEL *)_dst;                                                     \
     const float opacity = param->opacity;                                           \
                                                                                     \
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index dfe2b8b174..7100d9f372 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -133,8 +133,8 @@ static void blend_expr_## name(const uint8_t *_top, ptrdiff_t top_linesize,
                                ptrdiff_t width, ptrdiff_t height,              \
                                FilterParams *param, double *values, int starty) \
 {                                                                              \
-    const type *top = (type*)_top;                                             \
-    const type *bottom = (type*)_bottom;                                       \
+    const type *top = (const type*)_top;                                       \
+    const type *bottom = (const type*)_bottom;                                 \
     type *dst = (type*)_dst;                                                   \
     AVExpr *e = param->e;                                                      \
     int y, x;                                                                  \
diff --git a/libavfilter/vf_blend_init.h b/libavfilter/vf_blend_init.h
index f531338a54..d24f178032 100644
--- a/libavfilter/vf_blend_init.h
+++ b/libavfilter/vf_blend_init.h
@@ -82,8 +82,8 @@ static void blend_normal_##name(const uint8_t *_top, ptrdiff_t top_linesize,
                                 ptrdiff_t width, ptrdiff_t height,                \
                                 FilterParams *param, double *values, int starty)  \
 {                                                                                 \
-    const type *top = (type*)_top;                                                \
-    const type *bottom = (type*)_bottom;                                          \
+    const type *top = (const type*)_top;                                          \
+    const type *bottom = (const type*)_bottom;                                    \
     type *dst = (type*)_dst;                                                      \
     const float opacity = param->opacity;                                         \
                                                                                   \
-- 
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".

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination Andreas Rheinhardt
@ 2023-09-07 14:31   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07 14:31 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness Andreas Rheinhardt
@ 2023-09-07 14:32   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07 14:32 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily Andreas Rheinhardt
@ 2023-09-07 14:32   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07 14:32 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes Andreas Rheinhardt
@ 2023-09-07 14:47   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07 14:47 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks
@ 2023-09-07 15:02   ` Anton Khirnov
  2023-09-07 17:08     ` Andreas Rheinhardt
  0 siblings, 1 reply; 42+ messages in thread
From: Anton Khirnov @ 2023-09-07 15:02 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

Quoting Andreas Rheinhardt (2023-09-07 03:05:31)
> They are currently non-const for reasons unknown, although
> avio_write() accepts a const buffer.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> rtmpcrypt.c sometimes modifies the buffer whose content
> it is supposed to write.
> 
>  doc/APIchanges                   |  4 ++++
>  libavformat/avio.c               |  4 ++++
>  libavformat/avio.h               | 13 +++++++++++++
>  libavformat/avio_internal.h      |  4 ++++
>  libavformat/aviobuf.c            | 28 ++++++++++++++++++++++++++++
>  libavformat/hdsenc.c             |  4 ++++
>  libavformat/smoothstreamingenc.c |  4 ++++
>  libavformat/url.h                |  8 ++++++++
>  libavformat/version_major.h      |  1 +
>  9 files changed, 70 insertions(+)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 762c2d6628..963ad477bf 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
>  
>  API changes, most recent first:
>  
> +2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
> +  Constify the buffer pointees in the write_packet and write_data_type
> +  callbacks of AVIOContext.

This implies that the change happens immediately, not that it's
scheduled for the next major version.

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks
  2023-09-07 15:02   ` Anton Khirnov
@ 2023-09-07 17:08     ` Andreas Rheinhardt
  0 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-07 17:08 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Anton Khirnov:
> Quoting Andreas Rheinhardt (2023-09-07 03:05:31)
>> They are currently non-const for reasons unknown, although
>> avio_write() accepts a const buffer.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> rtmpcrypt.c sometimes modifies the buffer whose content
>> it is supposed to write.
>>
>>  doc/APIchanges                   |  4 ++++
>>  libavformat/avio.c               |  4 ++++
>>  libavformat/avio.h               | 13 +++++++++++++
>>  libavformat/avio_internal.h      |  4 ++++
>>  libavformat/aviobuf.c            | 28 ++++++++++++++++++++++++++++
>>  libavformat/hdsenc.c             |  4 ++++
>>  libavformat/smoothstreamingenc.c |  4 ++++
>>  libavformat/url.h                |  8 ++++++++
>>  libavformat/version_major.h      |  1 +
>>  9 files changed, 70 insertions(+)
>>
>> diff --git a/doc/APIchanges b/doc/APIchanges
>> index 762c2d6628..963ad477bf 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
>>  
>>  API changes, most recent first:
>>  
>> +2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
>> +  Constify the buffer pointees in the write_packet and write_data_type
>> +  callbacks of AVIOContext.
> 
> This implies that the change happens immediately, not that it's
> scheduled for the next major version.
> 

Thanks for noticing, will amend.

- Andreas

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away Andreas Rheinhardt
@ 2023-09-07 17:58   ` Paul B Mahol
  0 siblings, 0 replies; 42+ messages in thread
From: Paul B Mahol @ 2023-09-07 17:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue
  2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
                   ` (29 preceding siblings ...)
  2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness Andreas Rheinhardt
@ 2023-09-10 10:23 ` Andreas Rheinhardt
  30 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-10 10:23 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> This is a workaround for an issue introduced in commit
> 1652f2492f88434010053289d946dab6a57e4d58. It is not meant to be applied
> to the tree.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  tests/fate-run.sh             | 2 +-
>  tests/fate/demux.mak          | 2 +-
>  tests/fate/lavf-container.mak | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/fate-run.sh b/tests/fate-run.sh
> index 5a71ac001e..276f97489d 100755
> --- a/tests/fate-run.sh
> +++ b/tests/fate-run.sh
> @@ -383,7 +383,7 @@ lavf_container_fate()
>      file=${outdir}/lavf.$t
>      cleanfiles="$cleanfiles $file"
>      input="${target_samples}/$1"
> -    do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" "$ENC_OPTS -metadata title=lavftest" -vcodec copy -acodec copy
> +    do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" "$ENC_OPTS -metadata title=lavftest" $4 -vcodec copy -acodec copy
>      do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i $target_path/$file $3
>  }
>  
> diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
> index ace8fa0b52..7a091de851 100644
> --- a/tests/fate/demux.mak
> +++ b/tests/fate/demux.mak
> @@ -14,7 +14,7 @@ FATE_SAMPLES_DEMUX-$(CONFIG_AEA_DEMUXER) += fate-aea-demux
>  fate-aea-demux: CMD = crc -i $(TARGET_SAMPLES)/aea/chirp.aea -c:a copy
>  
>  FATE_SAMPLES_DEMUX-$(call DEMDEC, AV1, AV1) += fate-av1-annexb-demux
> -fate-av1-annexb-demux: CMD = framecrc -c:v av1 -i $(TARGET_SAMPLES)/av1/annexb.obu -c:v copy
> +fate-av1-annexb-demux: CMD = framecrc -c:v av1 -i $(TARGET_SAMPLES)/av1/annexb.obu -c:v copy -sar 1:1
>  
>  FATE_SAMPLES_DEMUX-$(CONFIG_AST_DEMUXER) += fate-ast
>  fate-ast: CMD = crc -i $(TARGET_SAMPLES)/ast/demo11_02_partial.ast -c copy
> diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
> index 0d4a224601..047dd1d7f4 100644
> --- a/tests/fate/lavf-container.mak
> +++ b/tests/fate/lavf-container.mak
> @@ -86,8 +86,8 @@ FATE_LAVF_CONTAINER_FATE = $(FATE_LAVF_CONTAINER_FATE-yes:%=fate-lavf-fate-%)
>  $(FATE_LAVF_CONTAINER_FATE): REF = $(SRC_PATH)/tests/ref/lavf-fate/$(@:fate-lavf-fate-%=%)
>  $(FATE_LAVF_CONTAINER_FATE): $(AREF) $(VREF)
>  
> -fate-lavf-fate-av1.mp4: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
> -fate-lavf-fate-av1.mkv: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
> +fate-lavf-fate-av1.mp4: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy" "-sar 1:1"
> +fate-lavf-fate-av1.mkv: CMD = lavf_container_fate "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy" "-sar 1:1"
>  fate-lavf-fate-evc.mp4: CMD = lavf_container_fate "evc/akiyo_cif.evc" "" "-c:v copy"
>  fate-lavf-fate-h264.mp4: CMD = lavf_container_fate "h264/intra_refresh.h264" "" "-c:v copy"
>  fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" "-idct auto"

Will apply patches 4-15 as well as 22-25 tonight unless there are
objections.

- Andreas

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees
  2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees Andreas Rheinhardt
@ 2023-09-10 11:09   ` Andreas Rheinhardt
  0 siblings, 0 replies; 42+ messages in thread
From: Andreas Rheinhardt @ 2023-09-10 11:09 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> This is done immediately without waiting for the next major bump
> just as in 9546b3a1cbcd94e9107f85c8f1d2175efc6cf083 and
> 4eaaa38d3dfb8863a62f3646a62e4098b1c078d5.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  doc/APIchanges       |  4 ++++
>  libavutil/imgutils.c | 14 +++++++-------
>  libavutil/imgutils.h | 10 +++++-----
>  3 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 963ad477bf..048232b2eb 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
>  
>  API changes, most recent first:
>  
> +2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - imgutils.h
> +  Constify some pointees in av_image_copy(), av_image_copy_uc_from() and
> +  av_image_fill_black().
> +
>  2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
>    Constify the buffer pointees in the write_packet and write_data_type
>    callbacks of AVIOContext.
> diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> index 9ab5757cf6..da3812698e 100644
> --- a/libavutil/imgutils.c
> +++ b/libavutil/imgutils.c
> @@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
>      image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height);
>  }
>  
> -static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
> -                       const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
> +static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4],
> +                       const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4],
>                         enum AVPixelFormat pix_fmt, int width, int height,
>                         void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *,
>                                            ptrdiff_t, ptrdiff_t, int))
> @@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
>      }
>  }
>  
> -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
> -                   const uint8_t *src_data[4], const int src_linesizes[4],
> +void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4],
> +                   const uint8_t * const src_data[4], const int src_linesizes[4],
>                     enum AVPixelFormat pix_fmt, int width, int height)
>  {
>      ptrdiff_t dst_linesizes1[4], src_linesizes1[4];
> @@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
>                 width, height, image_copy_plane);
>  }
>  
> -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
> -                           const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
> +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4],
> +                           const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
>                             enum AVPixelFormat pix_fmt, int width, int height)
>  {
>      image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt,
> @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
>  // if it's a subsampled packed format).
>  #define MAX_BLOCK_SIZE 32
>  
> -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
> +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
>                          enum AVPixelFormat pix_fmt, enum AVColorRange range,
>                          int width, int height)
>  {
> diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
> index e10ac14952..91312a72d3 100644
> --- a/libavutil/imgutils.h
> +++ b/libavutil/imgutils.h
> @@ -170,8 +170,8 @@ void av_image_copy_plane_uc_from(uint8_t       *dst, ptrdiff_t dst_linesize,
>   * @param width         width of the image in pixels
>   * @param height        height of the image in pixels
>   */
> -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
> -                   const uint8_t *src_data[4], const int src_linesizes[4],
> +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4],
> +                   const uint8_t * const src_data[4], const int src_linesizes[4],
>                     enum AVPixelFormat pix_fmt, int width, int height);
>  
>  /**
> @@ -188,8 +188,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
>   * @note On x86, the linesizes currently need to be aligned to the cacheline
>   *       size (i.e. 64) to get improved performance.
>   */
> -void av_image_copy_uc_from(uint8_t *dst_data[4],       const ptrdiff_t dst_linesizes[4],
> -                           const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
> +void av_image_copy_uc_from(uint8_t * const dst_data[4],       const ptrdiff_t dst_linesizes[4],
> +                           const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4],
>                             enum AVPixelFormat pix_fmt, int width, int height);
>  
>  /**
> @@ -319,7 +319,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar);
>   * @param height        the height of the image in pixels
>   * @return 0 if the image data was cleared, a negative AVERROR code otherwise
>   */
> -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
> +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4],
>                          enum AVPixelFormat pix_fmt, enum AVColorRange range,
>                          int width, int height);
>  

Will apply this patch and the other constification patches (i.e. patches
#16-#19 as well as #21) in two days unless there are objections.

- Andreas

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

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2023-09-10 11:07 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07  1:02 [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 02/22] avformat/avio: Don't use incompatible function pointer type for call Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 03/22] avformat/internal: Avoid casting const away Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 04/22] avformat/aviobuf: Don't use incompatible function pointer type for call Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 05/22] avformat/dashenc: Avoid unnecessary casts Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 06/22] avformat/dashenc: Use proper type for AVCodecIDs Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 07/22] avformat/dashenc: Add const where appropriate Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 08/22] avformat/dashenc: Simplify getting format string Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 09/22] avformat/dashenc: Avoid relocations for short strings Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 10/22] avformat/teeproto: Remove useless AVClass without options Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 11/22] avdevice/lavfi: Remove unnecessary avio_internal.h inclusion Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 12/22] avformat: Remove avformat and avio headers from protocols Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 13/22] avformat/teeproto: Remove always-false check Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 14/22] avformat/avio_internal: Don't include url.h Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks Andreas Rheinhardt
2023-09-07 15:02   ` Anton Khirnov
2023-09-07 17:08     ` Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees Andreas Rheinhardt
2023-09-10 11:09   ` Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 17/22] avutil/samplefmt: " Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 18/22] avutil/audio_fifo: " Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 19/22] avutil/fifo: Constify AVFifo pointees in peek functions Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away Andreas Rheinhardt
2023-09-07  7:36   ` Paul B Mahol
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 21/22] avutil/imgutils: Add wrapper for av_image_copy() to avoid casts Andreas Rheinhardt
2023-09-07  1:05 ` [FFmpeg-devel] [PATCH v2 22/22] avfilter/vf_framepack: Use dedicated pointer for access Andreas Rheinhardt
2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 23/26] avformat/avio: Remove duplicated freeing code Andreas Rheinhardt
2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 24/26] avformat/avio: Remove redundant checks Andreas Rheinhardt
2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 25/26] all: Use av_frame_replace() where appropriate Andreas Rheinhardt
2023-09-07 10:38 ` [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() " Andreas Rheinhardt
2023-09-07 11:09   ` Nicolas George
2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily Andreas Rheinhardt
2023-09-07 14:32   ` Paul B Mahol
2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes Andreas Rheinhardt
2023-09-07 14:47   ` Paul B Mahol
2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away Andreas Rheinhardt
2023-09-07 17:58   ` Paul B Mahol
2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination Andreas Rheinhardt
2023-09-07 14:31   ` Paul B Mahol
2023-09-07 14:03 ` [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness Andreas Rheinhardt
2023-09-07 14:32   ` Paul B Mahol
2023-09-10 10:23 ` [FFmpeg-devel] [PATCH v2 01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue Andreas Rheinhardt

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