45 unsigned v = le ? bytestream2_get_le16(gb) : bytestream2_get_be16(gb);
52 unsigned v = le ? bytestream2_get_le32(gb) : bytestream2_get_be32(gb);
59 av_alias64 i = { .u64 = le ? bytestream2_get_le64(gb) : bytestream2_get_be64(gb)};
68 return bytestream2_get_byte(gb);
85 return columns < count ?
"\n" :
"";
96 if (count >= INT_MAX /
sizeof(int64_t) || count <= 0)
103 for (i = 0; i <
count; i++) {
129 if (count >= INT_MAX /
sizeof(
int32_t) || count <= 0)
136 for (i = 0; i <
count; i++) {
160 if (count >= INT_MAX /
sizeof(int64_t) || count <= 0)
167 for (i = 0; i <
count; i++) {
191 if (count >= INT_MAX /
sizeof(int16_t) || count <= 0)
198 for (i = 0; i <
count; i++) {
222 if (count >= INT_MAX /
sizeof(int8_t) || count < 0)
229 for (i = 0; i <
count; i++) {
271 *le = bytestream2_get_le16u(gb);
274 }
else if (*le ==
AV_RB16(
"MM")) {
291 unsigned *
count,
int *next)
int ff_tadd_doubles_metadata(int count, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata)
Adds count doubles converted to a string into the metadata dictionary.
int ff_tadd_shorts_metadata(int count, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata)
Adds count shorts converted to a string into the metadata dictionary.
int ff_tadd_rational_metadata(int count, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata)
Adds count rationals converted to a string into the metadata dictionary.
static char * auto_sep(int count, char *sep, int i, int columns)
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
static const uint8_t type_sizes[14]
sizes of various TIFF field types (string size = 100)
#define AV_BPRINT_SIZE_UNLIMITED
Convenience macros for special values for av_bprint_init() size_max parameter.
unsigned ff_tget_short(GetByteContext *gb, int le)
Reads a short from the bytestream using given endianess.
unsigned ff_tget(GetByteContext *gb, int type, int le)
Reads a byte from the bytestream using given endianess.
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Init a print buffer.
#define FF_ARRAY_ELEMS(a)
Buffer to print data progressively.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
unsigned ff_tget_long(GetByteContext *gb, int le)
Reads a long from the bytestream using given endianess.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static const uint16_t ifd_tags[]
int ff_tis_ifd(unsigned tag)
Returns a value > 0 if the tag is a known IFD-tag.
static av_always_inline int bytestream2_tell(GetByteContext *g)
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_tadd_long_metadata(int count, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata)
Adds count longs converted to a string into the metadata dictionary.
void av_bprintf(AVBPrint *buf, const char *fmt,...) av_printf_format(2
Append a formatted string to a print buffer.
#define AVERROR_INVALIDDATA
int ff_tadd_string_metadata(int count, const char *name, GetByteContext *gb, int le, AVDictionary **metadata)
Adds a string of count characters into the metadata dictionary.
static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, int whence)
int ff_tread_tag(GetByteContext *gb, int le, unsigned *tag, unsigned *type, unsigned *count, int *next)
Reads the first 3 fields of a TIFF tag, which are the tag id, the tag type and the count of values fo...
int ff_tdecode_header(GetByteContext *gb, int *le, int *ifd_offset)
Decodes a TIFF header from the input bytestream and sets the endianess in *le and the offset to the f...
double ff_tget_double(GetByteContext *gb, int le)
Reads a double from the bytestream using given endianess.
int ff_tadd_bytes_metadata(int count, const char *name, const char *sep, GetByteContext *gb, int le, AVDictionary **metadata)
Adds count bytes converted to a string into the metadata dictionary.