Go to the documentation of this file.
32 #include "libavutil/avconfig.h"
42 #define EXIF_II_LONG 0x49492a00
43 #define EXIF_MM_LONG 0x4d4d002a
45 #define BASE_TAG_SIZE 12
46 #define IFD_EXTRA_SIZE 6
48 #define EXIF_TAG_NAME_LENGTH 32
49 #define MAKERNOTE_TAG 0x927c
50 #define ORIENTATION_TAG 0x112
51 #define EXIFIFD_TAG 0x8769
52 #define IMAGE_WIDTH_TAG 0x100
53 #define IMAGE_LENGTH_TAG 0x101
54 #define PIXEL_X_TAG 0xa002
55 #define PIXEL_Y_TAG 0xa003
63 {
"GPSVersionID", 0x00},
64 {
"GPSLatitudeRef", 0x01},
65 {
"GPSLatitude", 0x02},
66 {
"GPSLongitudeRef", 0x03},
67 {
"GPSLongitude", 0x04},
68 {
"GPSAltitudeRef", 0x05},
69 {
"GPSAltitude", 0x06},
70 {
"GPSTimeStamp", 0x07},
71 {
"GPSSatellites", 0x08},
73 {
"GPSMeasureMode", 0x0A},
75 {
"GPSSpeedRef", 0x0C},
77 {
"GPSTrackRef", 0x0E},
79 {
"GPSImgDirectionRef", 0x10},
80 {
"GPSImgDirection", 0x11},
81 {
"GPSMapDatum", 0x12},
82 {
"GPSDestLatitudeRef", 0x13},
83 {
"GPSDestLatitude", 0x14},
84 {
"GPSDestLongitudeRef", 0x15},
85 {
"GPSDestLongitude", 0x16},
86 {
"GPSDestBearingRef", 0x17},
87 {
"GPSDestBearing", 0x18},
88 {
"GPSDestDistanceRef", 0x19},
89 {
"GPSDestDistance", 0x1A},
90 {
"GPSProcessingMethod", 0x1B},
91 {
"GPSAreaInformation", 0x1C},
92 {
"GPSDateStamp", 0x1D},
93 {
"GPSDifferential", 0x1E},
94 {
"ImageWidth", 0x100},
95 {
"ImageLength", 0x101},
96 {
"BitsPerSample", 0x102},
97 {
"Compression", 0x103},
98 {
"PhotometricInterpretation", 0x106},
99 {
"Orientation", 0x112},
100 {
"SamplesPerPixel", 0x115},
101 {
"PlanarConfiguration", 0x11C},
102 {
"YCbCrSubSampling", 0x212},
103 {
"YCbCrPositioning", 0x213},
104 {
"XResolution", 0x11A},
105 {
"YResolution", 0x11B},
106 {
"ResolutionUnit", 0x128},
107 {
"StripOffsets", 0x111},
108 {
"RowsPerStrip", 0x116},
109 {
"StripByteCounts", 0x117},
110 {
"JPEGInterchangeFormat", 0x201},
111 {
"JPEGInterchangeFormatLength",0x202},
112 {
"TransferFunction", 0x12D},
113 {
"WhitePoint", 0x13E},
114 {
"PrimaryChromaticities", 0x13F},
115 {
"YCbCrCoefficients", 0x211},
116 {
"ReferenceBlackWhite", 0x214},
118 {
"ImageDescription", 0x10E},
123 {
"Copyright", 0x8298},
124 {
"ExifVersion", 0x9000},
125 {
"FlashpixVersion", 0xA000},
126 {
"ColorSpace", 0xA001},
127 {
"ComponentsConfiguration", 0x9101},
128 {
"CompressedBitsPerPixel", 0x9102},
129 {
"PixelXDimension", 0xA002},
130 {
"PixelYDimension", 0xA003},
131 {
"MakerNote", 0x927C},
132 {
"UserComment", 0x9286},
133 {
"RelatedSoundFile", 0xA004},
134 {
"DateTimeOriginal", 0x9003},
135 {
"DateTimeDigitized", 0x9004},
136 {
"SubSecTime", 0x9290},
137 {
"SubSecTimeOriginal", 0x9291},
138 {
"SubSecTimeDigitized", 0x9292},
139 {
"ImageUniqueID", 0xA420},
140 {
"ExposureTime", 0x829A},
142 {
"ExposureProgram", 0x8822},
143 {
"SpectralSensitivity", 0x8824},
144 {
"ISOSpeedRatings", 0x8827},
146 {
"ShutterSpeedValue", 0x9201},
147 {
"ApertureValue", 0x9202},
148 {
"BrightnessValue", 0x9203},
149 {
"ExposureBiasValue", 0x9204},
150 {
"MaxApertureValue", 0x9205},
151 {
"SubjectDistance", 0x9206},
152 {
"MeteringMode", 0x9207},
153 {
"LightSource", 0x9208},
155 {
"FocalLength", 0x920A},
156 {
"SubjectArea", 0x9214},
157 {
"FlashEnergy", 0xA20B},
158 {
"SpatialFrequencyResponse", 0xA20C},
159 {
"FocalPlaneXResolution", 0xA20E},
160 {
"FocalPlaneYResolution", 0xA20F},
161 {
"FocalPlaneResolutionUnit", 0xA210},
162 {
"SubjectLocation", 0xA214},
163 {
"ExposureIndex", 0xA215},
164 {
"SensingMethod", 0xA217},
165 {
"FileSource", 0xA300},
166 {
"SceneType", 0xA301},
167 {
"CFAPattern", 0xA302},
168 {
"CustomRendered", 0xA401},
169 {
"ExposureMode", 0xA402},
170 {
"WhiteBalance", 0xA403},
171 {
"DigitalZoomRatio", 0xA404},
172 {
"FocalLengthIn35mmFilm", 0xA405},
173 {
"SceneCaptureType", 0xA406},
174 {
"GainControl", 0xA407},
175 {
"Contrast", 0xA408},
176 {
"Saturation", 0xA409},
177 {
"Sharpness", 0xA40A},
178 {
"DeviceSettingDescription", 0xA40B},
179 {
"SubjectDistanceRange", 0xA40C},
182 {
"RelatedImageFileFormat", 0x1000},
183 {
"RelatedImageWidth", 0x1001},
184 {
"RelatedImageLength", 0x1002},
187 {
"PrintImageMatching", 0xC4A5},
192 {
"InteropIFD", 0xA005},
193 {
"GlobalParametersIFD", 0x0190},
194 {
"ProfileIFD", 0xc6f5},
240 le ? bytestream2_put_le16(pb,
value) : bytestream2_put_be16(pb,
value);
245 le ? bytestream2_put_le32(pb,
value) : bytestream2_put_be32(pb,
value);
250 le ? bytestream2_put_le64(pb,
value) : bytestream2_put_be64(pb,
value);
255 switch (
entry->type) {
286 if (!
entry->value.ptr)
288 switch (
entry->type) {
290 for (
size_t i = 0;
i <
entry->count;
i++)
294 for (
size_t i = 0;
i <
entry->count;
i++)
298 for (
size_t i = 0;
i <
entry->count;
i++)
302 for (
size_t i = 0;
i <
entry->count;
i++)
306 for (
size_t i = 0;
i <
entry->count;
i++)
310 for (
size_t i = 0;
i <
entry->count;
i++) {
317 for (
size_t i = 0;
i <
entry->count;
i++) {
340 switch (
entry->type) {
342 for (
size_t i = 0;
i <
entry->count;
i++)
346 for (
size_t i = 0;
i <
entry->count;
i++)
350 for (
size_t i = 0;
i <
entry->count;
i++)
354 for (
size_t i = 0;
i <
entry->count;
i++)
358 for (
size_t i = 0;
i <
entry->count;
i++) {
359 const av_alias64
a = { .f64 =
entry->value.dbl[
i] };
364 for (
size_t i = 0;
i <
entry->count;
i++) {
365 const av_alias32
a = { .f32 =
entry->value.dbl[
i] };
371 for (
size_t i = 0;
i <
entry->count;
i++) {
391 static const uint8_t
foveon_header[] = {
'F',
'O',
'V',
'E',
'O',
'N', 0, 0, };
395 static const uint8_t
olympus2_header[] = {
'O',
'L',
'Y',
'M',
'P',
'U',
'S', 0,
'I',
'I', };
396 static const uint8_t
panasonic_header[] = {
'P',
'a',
'n',
'a',
's',
'o',
'n',
'i',
'c', 0, 0, 0, };
397 static const uint8_t
sigma_header[] = {
'S',
'I',
'G',
'M',
'A', 0, 0, 0, };
398 static const uint8_t
sony_header[] = {
'S',
'O',
'N',
'Y',
' ',
'D',
'S',
'C',
' ', 0, 0, 0, };
406 #define MAKERNOTE_STRUCT(h, r) { \
408 .header_size = sizeof((h)), \
456 int ret = 0, makernote_offset = -1,
tell, is_ifd, count;
471 av_log(logctx,
AV_LOG_DEBUG,
"TIFF Tag: id: 0x%04x, type: %d, count: %u, offset: %d, "
472 "payload: %" PRIu32
"\n",
entry->id,
type, count,
tell, payload);
484 if (makernote_offset < 0)
491 entry->ifd_offset = makernote_offset > 0 ? makernote_offset : 0;
492 if (
entry->ifd_offset) {
494 if (!
entry->ifd_lead)
514 entry->count = count;
529 size_t required_size;
535 av_log(logctx,
AV_LOG_ERROR,
"not enough bytes remaining in EXIF buffer: 2 required\n");
541 av_log(logctx,
AV_LOG_ERROR,
"not enough bytes remaining in EXIF buffer. entries: %" PRIu32
"\n", entries);
545 ifd->
count = entries;
559 memset(ifd->
entries, 0, required_size);
561 for (uint32_t
i = 0;
i < entries;
i++) {
599 for (
size_t i = 0;
i < ifd->
count;
i++) {
613 for (
size_t i = 0;
i < ifd->
count;
i++) {
619 total_size +=
BASE_TAG_SIZE + (payload_size > 4 ? payload_size : 0);
632 for (
size_t i = 0;
i < ifd->
count;
i++) {
634 av_log(logctx,
AV_LOG_DEBUG,
"writing TIFF entry: id: 0x%04" PRIx16
", type: %d, count: %"
635 PRIu32
", offset: %d, offset value: %d\n",
651 if (
entry->ifd_offset)
660 if (payload_size > 4) {
687 size_t size, headsize = 8;
691 #if AV_HAVE_BIGENDIAN
701 switch (header_mode) {
756 switch (header_mode) {
813 if (orientation < 2 || orientation > 8)
825 #define COLUMN_SEP(i, c) ((i) ? ((i) % (c) ? ", " : "\n") : "")
837 for (uint16_t
i = 0;
i < ifd->
count;
i++) {
851 switch (
entry->type) {
859 for (uint32_t j = 0; j <
entry->count; j++)
864 for (uint32_t j = 0; j <
entry->count; j++)
869 for (uint32_t j = 0; j <
entry->count; j++)
874 for (uint32_t j = 0; j <
entry->count; j++)
882 for (uint32_t j = 0; j <
entry->count; j++)
886 for (uint32_t j = 0; j <
entry->count; j++)
945 for (
size_t i = 0;
i < ifd->
count;
i++) {
953 if (orient && orient->
value.
uint[0] > 1) {
992 if (og && written &&
ret >= 0)
999 #define EXIF_COPY(fname, srcname) do { \
1001 if (av_size_mult(src->count, sizeof(*(fname)), &sz) < 0) { \
1002 ret = AVERROR(ENOMEM); \
1005 (fname) = av_memdup((srcname), sz); \
1007 ret = AVERROR(ENOMEM); \
1020 dst->ifd_offset =
src->ifd_offset;
1021 if (
src->ifd_lead) {
1023 if (!
dst->ifd_lead) {
1038 dst->value.ifd = *cloned;
1078 memset(
dst, 0,
sizeof(*
dst));
1090 for (
size_t i = 0;
i < ifd->
count;
i++) {
1114 uint32_t count,
const uint8_t *ifd_lead, uint32_t ifd_offset,
const void *
value)
1122 || ifd_lead && !ifd_offset || !ifd_lead && ifd_offset
1133 size_t required_size;
1147 src.ifd_lead = (uint8_t *) ifd_lead;
1148 src.ifd_offset = ifd_offset;
1170 for (
size_t i = 0;
i < ifd->
count;
i++) {
1210 size_t required_size;
1218 for (
size_t i = 0;
i <
ret->count;
i++) {
1256 {1, 8, 3, 6}, {4, 7, 2, 5},
1267 int rot = (int)(rotation + 0.5);
1268 rot = (((rot % 360) + 360) % 360) / 90;
1274 switch (orientation) {
1319 uint64_t orientation = 1;
1320 uint64_t
w =
frame->width;
1321 uint64_t
h =
frame->height;
1328 if (orientation != 1)
1329 av_log(logctx,
AV_LOG_DEBUG,
"matrix contains nontrivial EXIF orientation: %" PRIu64
"\n", orientation);
1331 for (
size_t i = 0;
i < ifd->
count;
i++) {
1347 for (
size_t j = 0; j < exif->
count; j++) {
1361 if (or && or->
value.
uint[0] != orientation) {
1377 if (
ph &&
ph->value.uint[0] !=
h) {
1379 ph->value.uint[0] =
h;
1381 if (!or && orientation != 1) {
1399 if (!pw &&
w &&
w < 0xFFFFu || !
ph &&
h &&
h < 0xFFFFu) {
1406 if (exif_found > 0) {
1417 if (!pw &&
w &&
w < 0xFFFFu) {
1422 if (!
ph &&
h &&
h < 0xFFFFu) {
1443 if (!buffer_ptr || *buffer_ptr)
int av_size_mult(size_t a, size_t b, size_t *r)
Multiply two size_t values checking for overflow.
@ AV_EXIF_T_OFF
The first four bytes point to the actual start, then it's AV_EXIF_TIFF_HEADER.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_BPRINT_SIZE_UNLIMITED
const char name[EXIF_TAG_NAME_LENGTH]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static size_t exif_get_ifd_size(const AVExifMetadata *ifd)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
int av_exif_parse_buffer(void *logctx, const uint8_t *buf, size_t size, AVExifMetadata *ifd, enum AVExifHeaderMode header_mode)
Decodes the EXIF data provided in the buffer and writes it into the struct *ifd.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
AVFrameSideData * av_frame_get_side_data(const AVFrame *frame, enum AVFrameSideDataType type)
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, size_t size)
Add a new side data to a frame.
int av_exif_write(void *logctx, const AVExifMetadata *ifd, AVBufferRef **buffer, enum AVExifHeaderMode header_mode)
Allocates a buffer using av_malloc of an appropriate size and writes the EXIF data represented by ifd...
static av_always_inline int bytestream2_tell(const GetByteContext *g)
uint8_t * data
The data buffer.
static const size_t exif_sizes[]
int av_exif_ifd_to_dict(void *logctx, const AVExifMetadata *ifd, AVDictionary **metadata)
Recursively reads all tags from the IFD and stores them in the provided metadata dictionary.
int av_exif_orientation_to_matrix(int32_t *matrix, int orientation)
Convert an orientation constant used by EXIF's orientation tag into a display matrix used by AV_FRAME...
static int FUNC() ph(CodedBitstreamContext *ctx, RWContext *rw, H266RawPH *current)
This structure describes decoded (raw) audio or video data.
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
Flip the input matrix horizontally and/or vertically.
static int exif_decode_tag(void *logctx, GetByteContext *gb, int le, int depth, AVExifEntry *entry)
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)
Add an entry to the provided EXIF metadata struct.
static const uint8_t sony_header[]
void av_display_rotation_set(int32_t matrix[9], double angle)
Initialize a transformation matrix describing a pure clockwise rotation by the specified angle (in de...
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int avpriv_exif_decode_ifd(void *logctx, const uint8_t *buf, int size, int le, int depth, AVDictionary **metadata)
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
static const uint8_t casio_header[]
static int exif_read_values(void *logctx, GetByteContext *gb, int le, AVExifEntry *entry)
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
static int exif_clone_entry(AVExifEntry *dst, const AVExifEntry *src)
void av_exif_free(AVExifMetadata *ifd)
Frees all resources associated with the given EXIF metadata struct.
static int exif_parse_ifd_list(void *logctx, GetByteContext *gb, int le, int depth, AVExifMetadata *ifd)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
static av_always_inline void bytestream2_init_writer(PutByteContext *p, uint8_t *buf, int buf_size)
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
static av_always_inline int bytestream2_tell_p(const PutByteContext *p)
static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, const uint8_t *src, unsigned int size)
static int exif_ifd_to_dict(void *logctx, const char *prefix, const AVExifMetadata *ifd, AVDictionary **metadata)
@ AV_EXIF_EXIF00
The first six bytes contain "Exif\0\0", then it's AV_EXIF_TIFF_HEADER.
AVExifMetadata * av_exif_clone_ifd(const AVExifMetadata *ifd)
Allocates a duplicate of the provided EXIF metadata struct.
static void tput64(PutByteContext *pb, const int le, const uint64_t value)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
@ AV_EXIF_ASSUME_BE
skip the TIFF header, assume big endian
static int exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int depth)
static void exif_write_values(PutByteContext *pb, int le, const AVExifEntry *entry)
static int attach_displaymatrix(void *logctx, AVFrame *frame, int orientation)
int32_t av_exif_get_tag_id(const char *name)
Retrieves the tag ID associated with the provided tag string name.
unsigned ff_tget_short(GetByteContext *gb, int le)
Reads a short from the bytestream using given endianness.
and forward the result(frame or status change) to the corresponding input. If nothing is possible
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
@ AV_EXIF_TIFF_HEADER
The TIFF header starts with 0x49492a00, or 0x4d4d002a.
static const uint8_t fuji_header[]
int ff_exif_attach_buffer(void *logctx, AVFrame *frame, AVBufferRef *data, enum AVExifHeaderMode header_mode)
Attach the data buffer to the frame.
static int BS_FUNC() tell(const BSCTX *bc)
Return number of bits already read.
static const uint8_t olympus1_header[]
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
AVFrameSideData * av_frame_new_side_data_from_buf(AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
Add a new side data to a frame from an existing AVBufferRef.
#define MAKERNOTE_STRUCT(h, r)
static const uint8_t olympus2_header[]
@ AV_EXIF_ASSUME_LE
skip the TIFF header, assume little endian
static const uint8_t foveon_header[]
static int exif_write_ifd(void *logctx, PutByteContext *pb, int le, int depth, const AVExifMetadata *ifd)
static const uint8_t panasonic_header[]
union AVExifEntry::@120 value
AVTiffDataType
Data type identifiers for TIFF tags.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int ff_tis_ifd(unsigned tag)
Returns a value > 0 if the tag is a known IFD-tag.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static int exif_attach_ifd(void *logctx, AVFrame *frame, const AVExifMetadata *ifd, AVBufferRef *og)
static const uint8_t sigma_header[]
static AVRational av_make_q(int num, int den)
Create an AVRational.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
static const struct exif_makernote_data makernote_data[]
AVBufferRef * av_buffer_alloc(size_t size)
Allocate an AVBuffer of the given size using av_malloc().
int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive)
Remove an entry from the provided EXIF metadata struct.
static const uint8_t nikon_header[]
size_t size
Size of data in bytes.
static void tput16(PutByteContext *pb, const int le, const uint16_t value)
static void tput32(PutByteContext *pb, const int le, const uint32_t value)
#define i(width, name, range_min, range_max)
unsigned ff_tget_long(GetByteContext *gb, int le)
Reads a long from the bytestream using given endianness.
static int exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int depth, AVExifEntry **value)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
int ff_exif_attach_ifd(void *logctx, AVFrame *frame, const AVExifMetadata *ifd)
Attach an already-parsed EXIF metadata struct to the frame as a side data buffer.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static int exif_get_makernote_offset(GetByteContext *gb)
void * av_calloc(size_t nmemb, size_t size)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
void av_bprintf(AVBPrint *buf, const char *fmt,...)
static const uint8_t aoc_header[]
double ff_tget_double(GetByteContext *gb, int le)
Reads a double from the bytestream using given endianness.
#define EXIF_TAG_NAME_LENGTH
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
#define EXIF_COPY(fname, srcname)
static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, int whence)
int ff_tdecode_header(GetByteContext *gb, int *le, int *ifd_offset)
Decodes a TIFF header from the input bytestream and sets the endianness in *le and the offset to the ...
static const struct exif_tag tag_list[]
int ff_exif_sanitize_ifd(void *logctx, const AVFrame *frame, AVExifMetadata *ifd)
Compares values in the IFD with data in the provided AVFrame and sets the values in that IFD to match...
int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int recursive, AVExifEntry **value)
Get an entry with the tagged ID from the EXIF metadata struct.
static void exif_free_entry(AVExifEntry *entry)
A reference to a data buffer.
Structure to hold side data for an AVFrame.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int ff_exif_get_buffer(void *logctx, const AVFrame *frame, AVBufferRef **buffer_ptr, enum AVExifHeaderMode header_mode)
Gets all relevant side data, collects it into an IFD, and writes it into the corresponding buffer poi...
@ AV_FRAME_DATA_EXIF
Extensible image file format metadata.
const char * av_exif_get_tag_name(uint16_t id)
Retrieves the tag name associated with the provided tag ID.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static const int rotation_lut[2][4]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
int av_exif_matrix_to_orientation(const int32_t *matrix)
Convert a display matrix used by AV_FRAME_DATA_DISPLAYMATRIX into an orientation constant used by EXI...
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function.
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.