mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/exif: make the get and remove helpers take a flags argument as input
This makes the functions extensible, as future behavior change flags can be introduced. This is strictly speaking not an API break. Only if a user was setting recursive to anything other than 1 it would now behave differently, but given these functions have been in the tree for only a few days, the chances for that are practically zero. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, \
|
||||
|
||||
Reference in New Issue
Block a user