diff mbox series

[FFmpeg-devel,16/16] avutil/fifo: Properly deprecate av_tempfile()

Message ID AS8P250MB07440D868C918F653D5E19208F779@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,01/11] avcodec/mpeg4video: Factor non-codec stuff out into a header of its own | expand

Commit Message

Andreas Rheinhardt Aug. 28, 2022, 11:34 p.m. UTC
It has been deprecated in b4f59beeb4c2171879d0d7607a4a7d6165f07791,
but the attribute_deprecated was not set and there was no entry
in APIchanges. This commit adds these and schedules it for removal.
Given that the reason behind the deprecation is exactly the same
as in av_fopen_utf8(), reuse its FF_API_AV_FOPEN_UTF8.

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

Comments

Anton Khirnov Aug. 31, 2022, 3:30 a.m. UTC | #1
Quoting Andreas Rheinhardt (2022-08-29 01:34:48)
> Subject: Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate av_tempfile()
                                                   ^^^^
you mean file
Andreas Rheinhardt Aug. 31, 2022, 3:34 a.m. UTC | #2
Anton Khirnov:
> Quoting Andreas Rheinhardt (2022-08-29 01:34:48)
>> Subject: Re: [FFmpeg-devel] [PATCH 16/16] avutil/fifo: Properly deprecate av_tempfile()
>                                                    ^^^^
> you mean file
> 

Thanks for noticing, will fix.
(It is btw not the only bug in this patchset: #15 got the header
inclusion guards wrong (there is space before the #define and I have no
clue where it comes from).)

- Andreas
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index 1cd13d4ed3..45fd8f251d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@  libavutil:     2021-04-27
 
 API changes, most recent first:
 
+2022-08-28 - xxxxxxxxxx - lavu 57.xx.100 - file.h
+  Deprecate av_tempfile() without replacement.
+
 2022-08-03 - xxxxxxxxxx - lavu 57.34.100 - pixfmt.h
   Add AV_PIX_FMT_VUYX.
 
diff --git a/libavutil/file.c b/libavutil/file.c
index edee6aaf80..6a2f3aa91c 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -155,6 +155,8 @@  void av_file_unmap(uint8_t *bufptr, size_t size)
 #endif
 }
 
+#if FF_API_AV_FOPEN_UTF8
 int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx) {
     return avpriv_tempfile(prefix, filename, log_offset, log_ctx);
 }
+#endif
diff --git a/libavutil/file.h b/libavutil/file.h
index 8ec210e783..511c100db4 100644
--- a/libavutil/file.h
+++ b/libavutil/file.h
@@ -22,6 +22,7 @@ 
 #include <stddef.h>
 #include <stdint.h>
 
+#include "version.h"
 #include "attributes.h"
 
 /**
@@ -55,6 +56,7 @@  int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
  */
 void av_file_unmap(uint8_t *bufptr, size_t size);
 
+#if FF_API_AV_FOPEN_UTF8
 /**
  * Wrapper to work around the lack of mkstemp() on mingw.
  * Also, tries to create file in /tmp first, if possible.
@@ -67,6 +69,8 @@  void av_file_unmap(uint8_t *bufptr, size_t size);
  *       libraries and could interfere with the calling application.
  * @deprecated as fd numbers cannot be passed saftely between libs on some platforms
  */
+attribute_deprecated
 int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
+#endif
 
 #endif /* AVUTIL_FILE_H */