diff --git a/doc/APIchanges b/doc/APIchanges index 81970f17f4..3737bca01b 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28 API changes, most recent first: +2025-08-xx - xxxxxxxx - lavc 62.13.101 - exif.h + Add AV_EXIF_FLAG_RECURSIVE + 2025-08-19 - ad77345a5d1..fe496b0308f - lavc 62.13.100 - exif.h Add: - enum AVTiffDataType, enum AVExifHeaderMode diff --git a/libavcodec/exif.c b/libavcodec/exif.c index 1332fa68bb..16635e1678 100644 --- a/libavcodec/exif.c +++ b/libavcodec/exif.c @@ -1038,9 +1038,9 @@ static int exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int de return 0; } -int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive, AVExifEntry **value) +int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags, AVExifEntry **value) { - return exif_get_entry(logctx, ifd, id, recursive ? 0 : INT_MAX, value); + return exif_get_entry(logctx, ifd, id, (flags & AV_EXIF_FLAG_RECURSIVE) ? 0 : INT_MAX, value); } int av_exif_set_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, enum AVTiffDataType type, @@ -1127,9 +1127,9 @@ static int exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int return 1 + (ifd->count - index); } -int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive) +int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags) { - return exif_remove_entry(logctx, ifd, id, recursive ? 0 : INT_MAX); + return exif_remove_entry(logctx, ifd, id, (flags & AV_EXIF_FLAG_RECURSIVE) ? 0 : INT_MAX); } AVExifMetadata *av_exif_clone_ifd(const AVExifMetadata *ifd) diff --git a/libavcodec/exif.h b/libavcodec/exif.h index 944d7ee666..1824a38d1c 100644 --- a/libavcodec/exif.h +++ b/libavcodec/exif.h @@ -144,26 +144,29 @@ int32_t av_exif_get_tag_id(const char *name); int av_exif_set_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, enum AVTiffDataType type, uint32_t count, const uint8_t *ifd_lead, uint32_t ifd_offset, const void *value); +/** + * Also check subdirectories. + */ +#define AV_EXIF_FLAG_RECURSIVE (1 << 0) + /** * Get an entry with the tagged ID from the EXIF metadata struct. A pointer to the entry - * will be written into *value. If the recursive flag is set to true, this function will check - * subdirectories as well. + * will be written into *value. * * If the entry was present and returned successfully, a positive number is returned. * If the entry was not found, *value is left untouched and zero is returned. * If an error occurred, a negative number is returned. */ -int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive, AVExifEntry **value); +int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags, AVExifEntry **value); /** - * Remove an entry from the provided EXIF metadata struct. If the recursive flag is set - * to true, then this function will check subdirectories as well. + * Remove an entry from the provided EXIF metadata struct. * * If the entry was present and removed successfully, a positive number is returned. * If the entry was not found, zero is returned. * If an error occurred, a negative number is returned. */ -int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive); +int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags); /** * Decodes the EXIF data provided in the buffer and writes it into the diff --git a/libavcodec/version.h b/libavcodec/version.h index 755c90bbc1..d394a022a6 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #include "version_major.h" #define LIBAVCODEC_VERSION_MINOR 13 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \