|
FFmpeg
|
#include "libavutil/buffer.h"#include "libavutil/frame.h"#include "exif.h"#include "version_major.h"Go to the source code of this file.
Functions | |
| int | avpriv_exif_decode_ifd (void *logctx, const uint8_t *buf, int size, int le, int depth, AVDictionary **metadata) |
| 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 the ones in that AVFrame. More... | |
| int | ff_exif_get_buffer (void *logctx, const AVFrame *frame, AVBufferRef **buffer, enum AVExifHeaderMode header_mode) |
| Gets all relevant side data, collects it into an IFD, and writes it into the corresponding buffer pointer. More... | |
| int | ff_decode_exif_attach_buffer (struct AVCodecContext *avctx, AVFrame *frame, AVBufferRef **buf, enum AVExifHeaderMode header_mode) |
| Attach the data buffer to the frame. More... | |
| int | ff_decode_exif_attach_ifd (struct AVCodecContext *avctx, AVFrame *frame, const struct AVExifMetadata *ifd) |
| Attach an already-parsed EXIF metadata struct to the frame as a side data buffer. More... | |
EXIF metadata parser - internal functions
Definition in file exif_internal.h.
| int avpriv_exif_decode_ifd | ( | void * | logctx, |
| const uint8_t * | buf, | ||
| int | size, | ||
| int | le, | ||
| int | depth, | ||
| AVDictionary ** | metadata | ||
| ) |
| 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 the ones in that AVFrame.
This is mostly useful for an encoder that wishes to use ff_exif_get_buffer, but would prefer to modify the IFD after it is sanitized and call av_exif_write afterward.
Definition at line 1381 of file exif.c.
Referenced by ff_exif_get_buffer(), and libjxl_preprocess_stream().
| int ff_exif_get_buffer | ( | void * | logctx, |
| const AVFrame * | frame, | ||
| AVBufferRef ** | buffer, | ||
| enum AVExifHeaderMode | header_mode | ||
| ) |
Gets all relevant side data, collects it into an IFD, and writes it into the corresponding buffer pointer.
This includes both AV_FRAME_DATA_EXIF and other side data types that are included in the frame data, such as possibly an instance of AV_FRAME_DATA_DISPLAYMATRIX. It also sets width and height tags to match those of the AVFrame if they are different. The *buffer argument must be NULL before calling.
On success, a positive number is returned, and the buffer becomes owned by the caller. A negative AVERROR return value means that an error occurred. A zero return value means that there was no EXIF data to write. In both the negative and zero cases, *buffer will be NULL.
Definition at line 1510 of file exif.c.
Referenced by encode_headers().
| int ff_decode_exif_attach_buffer | ( | struct AVCodecContext * | avctx, |
| AVFrame * | frame, | ||
| AVBufferRef ** | buf, | ||
| enum AVExifHeaderMode | header_mode | ||
| ) |
Attach the data buffer to the frame.
This is mostly a wrapper for av_side_data_new_from_buffer, but it checks if the orientation tag is present in the provided EXIF buffer. If it is, it zeroes it out and attaches that information as an AV_FRAME_DATA_DISPLAYMATRIX instead of including it in the AV_FRAME_DATA_EXIF side data buffer.
*buf is ALWAYS consumed by this function and NULL written in its place, even on failure.
Definition at line 2488 of file decode.c.
Referenced by decode_frame_common(), and webp_decode_frame().
| int ff_decode_exif_attach_ifd | ( | struct AVCodecContext * | avctx, |
| AVFrame * | frame, | ||
| const struct AVExifMetadata * | ifd | ||
| ) |
Attach an already-parsed EXIF metadata struct to the frame as a side data buffer.
It writes the EXIF IFD into the buffer and attaches the buffer to the frame.
If the metadata struct contains an orientation tag, it will be zeroed before writing, and instead, an AV_FRAME_DATA_DISPLAYMATRIX will be attached in addition to the AV_FRAME_DATA_EXIF side data.
1.8.17