1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-06 05:47:18 +02:00

avcodec/decode: use av_exif_get_tag_id() where useful

Removes dependency on exif_internal.h

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-08-22 20:30:40 -03:00
parent 310be1c5a4
commit 75bd5056a4
3 changed files with 10 additions and 10 deletions

View File

@@ -47,7 +47,7 @@
#include "codec_desc.h"
#include "codec_internal.h"
#include "decode.h"
#include "exif_internal.h"
#include "exif.h"
#include "hwaccel_internal.h"
#include "hwconfig.h"
#include "internal.h"
@@ -2278,7 +2278,8 @@ static int exif_attach_ifd(AVCodecContext *avctx, AVFrame *frame, const AVExifMe
for (size_t i = 0; i < ifd->count; i++) {
const AVExifEntry *entry = &ifd->entries[i];
if (entry->id == ORIENTATION_TAG && entry->count > 0 && entry->type == AV_TIFF_SHORT) {
if (entry->id == av_exif_get_tag_id("Orientation") &&
entry->count > 0 && entry->type == AV_TIFF_SHORT) {
orient = entry;
break;
}

View File

@@ -46,6 +46,13 @@
#define IFD_EXTRA_SIZE 6
#define EXIF_TAG_NAME_LENGTH 32
#define MAKERNOTE_TAG 0x927c
#define ORIENTATION_TAG 0x112
#define EXIFIFD_TAG 0x8769
#define IMAGE_WIDTH_TAG 0x100
#define IMAGE_LENGTH_TAG 0x101
#define PIXEL_X_TAG 0xa002
#define PIXEL_Y_TAG 0xa003
struct exif_tag {
const char name[EXIF_TAG_NAME_LENGTH];

View File

@@ -42,14 +42,6 @@ int avpriv_exif_decode_ifd(void *logctx, const uint8_t *buf, int size,
int le, int depth, AVDictionary **metadata);
#endif
#define MAKERNOTE_TAG 0x927c
#define ORIENTATION_TAG 0x112
#define EXIFIFD_TAG 0x8769
#define IMAGE_WIDTH_TAG 0x100
#define IMAGE_LENGTH_TAG 0x101
#define PIXEL_X_TAG 0xa002
#define PIXEL_Y_TAG 0xa003
/**
* Compares values in the IFD with data in the provided AVFrame and sets the values
* in that IFD to match the ones in that AVFrame. This is mostly useful for an