[FFmpeg-cvslog] avutil/imgutils: Constify some pointees
Andreas Rheinhardt
git at videolan.org
Tue Sep 12 11:05:32 EEST 2023
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Sep 6 22:19:29 2023 +0200| [41285890e0354eb3fcbc0fb09a3924a7e7b20d13] | committer: Andreas Rheinhardt
avutil/imgutils: Constify some pointees
This is done immediately without waiting for the next major bump
just as in 9546b3a1cbcd94e9107f85c8f1d2175efc6cf083 and
4eaaa38d3dfb8863a62f3646a62e4098b1c078d5.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41285890e0354eb3fcbc0fb09a3924a7e7b20d13
---
doc/APIchanges | 4 ++++
libavutil/imgutils.c | 14 +++++++-------
libavutil/imgutils.h | 10 +++++-----
libavutil/version.h | 2 +-
4 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 51586d628f..af6bd30423 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.20.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.12.100 - avio.h
Constify the buffer pointees in the write_packet and write_data_type
callbacks of AVIOContext on the next major bump.
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);
diff --git a/libavutil/version.h b/libavutil/version.h
index 897feff84f..605f85cd41 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 58
-#define LIBAVUTIL_VERSION_MINOR 19
+#define LIBAVUTIL_VERSION_MINOR 20
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
More information about the ffmpeg-cvslog
mailing list