42 #define ID_8SVX MKTAG('8','S','V','X')
43 #define ID_16SV MKTAG('1','6','S','V')
44 #define ID_MAUD MKTAG('M','A','U','D')
45 #define ID_MHDR MKTAG('M','H','D','R')
46 #define ID_MDAT MKTAG('M','D','A','T')
47 #define ID_VHDR MKTAG('V','H','D','R')
48 #define ID_ATAK MKTAG('A','T','A','K')
49 #define ID_RLSE MKTAG('R','L','S','E')
50 #define ID_CHAN MKTAG('C','H','A','N')
51 #define ID_PBM MKTAG('P','B','M',' ')
52 #define ID_ILBM MKTAG('I','L','B','M')
53 #define ID_BMHD MKTAG('B','M','H','D')
54 #define ID_DGBL MKTAG('D','G','B','L')
55 #define ID_CAMG MKTAG('C','A','M','G')
56 #define ID_CMAP MKTAG('C','M','A','P')
57 #define ID_ACBM MKTAG('A','C','B','M')
58 #define ID_DEEP MKTAG('D','E','E','P')
59 #define ID_RGB8 MKTAG('R','G','B','8')
60 #define ID_RGBN MKTAG('R','G','B','N')
61 #define ID_DSD MKTAG('D','S','D',' ')
62 #define ID_ANIM MKTAG('A','N','I','M')
64 #define ID_FORM MKTAG('F','O','R','M')
65 #define ID_FRM8 MKTAG('F','R','M','8')
66 #define ID_ANNO MKTAG('A','N','N','O')
67 #define ID_AUTH MKTAG('A','U','T','H')
68 #define ID_CHRS MKTAG('C','H','R','S')
69 #define ID_COPYRIGHT MKTAG('(','c',')',' ')
70 #define ID_CSET MKTAG('C','S','E','T')
71 #define ID_FVER MKTAG('F','V','E','R')
72 #define ID_NAME MKTAG('N','A','M','E')
73 #define ID_TEXT MKTAG('T','E','X','T')
74 #define ID_ABIT MKTAG('A','B','I','T')
75 #define ID_BODY MKTAG('B','O','D','Y')
76 #define ID_DBOD MKTAG('D','B','O','D')
77 #define ID_DPEL MKTAG('D','P','E','L')
78 #define ID_DLOC MKTAG('D','L','O','C')
79 #define ID_TVDC MKTAG('T','V','D','C')
93 #define IFF_EXTRA_VIDEO_SIZE 41
120 const char *
const tag,
121 const unsigned data_size)
128 if (
avio_read(s->
pb, buf, data_size) != data_size) {
164 #define DSD_SLFT MKTAG('S','L','F','T')
165 #define DSD_SRGT MKTAG('S','R','G','T')
166 #define DSD_MLFT MKTAG('M','L','F','T')
167 #define DSD_MRGT MKTAG('M','R','G','T')
168 #define DSD_C MKTAG('C',' ',' ',' ')
169 #define DSD_LS MKTAG('L','S',' ',' ')
170 #define DSD_RS MKTAG('R','S',' ',' ')
171 #define DSD_LFE MKTAG('L','F','E',' ')
195 "dsd_source_comment",
196 "analogue_source_comment",
197 "pcm_source_comment",
216 const char * metadata_tag =
NULL;
219 case MKTAG(
'D',
'I',
'A',
'R'): metadata_tag =
"artist";
break;
220 case MKTAG(
'D',
'I',
'T',
'I'): metadata_tag =
"title";
break;
223 if (metadata_tag && size > 4) {
252 case MKTAG(
'A',
'B',
'S',
'S'):
258 snprintf(abss,
sizeof(abss),
"%02dh:%02dm:%02ds:%d", hour, min, sec,
avio_rb32(pb));
262 case MKTAG(
'C',
'H',
'N',
'L'):
285 case MKTAG(
'C',
'M',
'P',
'R'):
292 tag&0xFF, (tag>>8)&0xFF, (tag>>16)&0xFF, (tag>>24)&0xFF);
297 case MKTAG(
'F',
'S',
' ',
' '):
303 case MKTAG(
'I',
'D',
'3',
' '):
304 id3v2_extra_meta =
NULL;
306 if (id3v2_extra_meta) {
320 case MKTAG(
'L',
'S',
'C',
'O'):
324 if (config != 0xFFFF) {
339 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
340 static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
341 static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
342 static const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
343 static const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
353 uint32_t screenmode = 0, num, den;
354 unsigned transparency = 0;
355 unsigned masking = 0;
381 const char *metadata_tag =
NULL;
395 if (data_size >= 16) {
452 if (data_size < 3 || data_size > 768 || data_size % 3) {
477 if (data_size >= 14) {
481 if (data_size >= 16) {
488 if (data_size < 4 || (data_size & 3))
490 if ((fmt_size =
avio_read(pb, fmt,
sizeof(fmt))) < 0)
528 if (data_size <
sizeof(iff->
tvdc))
536 case ID_TEXT: metadata_tag =
"comment";
break;
537 case ID_AUTH: metadata_tag =
"artist";
break;
539 case ID_NAME: metadata_tag =
"title";
break;
543 case MKTAG(
'F',
'V',
'E',
'R'):
547 av_log(s,
AV_LOG_DEBUG,
"DSIFF v%d.%d.%d.%d\n",version >> 24, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
551 case MKTAG(
'D',
'I',
'I',
'N'):
557 case MKTAG(
'P',
'R',
'O',
'P'):
569 case MKTAG(
'C',
'O',
'M',
'T'):
573 for (i = 0; i < nb_comments; i++) {
574 int year, mon, day, hour,
min,
type, ref;
584 snprintf(tmp,
sizeof(tmp),
"%04d-%02d-%02d %02d:%02d", year, mon, day, hour, min);
592 tag =
"channel_comment";
594 snprintf(tmp,
sizeof(tmp),
"channel%d_comment", ref);
614 if (metadata_size & 1)
621 if ((res =
get_metadata(s, metadata_tag, data_size)) < 0) {
675 if ((screenmode & 0x800 ) && iff->
bpp <= 8) {
676 iff->
ham = iff->
bpp > 6 ? 6 : 4;
679 iff->
flags = (screenmode & 0x80 ) && iff->
bpp <= 8;
693 bytestream_put_byte(&buf, iff->
bpp);
694 bytestream_put_byte(&buf, iff->
ham);
695 bytestream_put_byte(&buf, iff->
flags);
697 bytestream_put_byte(&buf, iff->
masking);
738 bytestream_put_be16(&buf, 2);
742 }
else if (ret < iff->body_size)
unsigned transparency
transparency color index in palette
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
unsigned ham
0 if non-HAM or number of hold bits (6 for bpp > 6, 4 otherwise)
int64_t bit_rate
the average bitrate
packed RGB 8:8:8, 24bpp, RGBRGB...
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
static FFServerConfig config
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define ID3v2_DEFAULT_MAGIC
Default magic bytes for ID3v2 header: "ID3".
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
unsigned maud_compression
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define AV_CH_LAYOUT_STEREO
unsigned int avio_rb16(AVIOContext *s)
svx8_compression_type svx8_compression
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
Create a stream for each APIC (attached picture) extracted from the ID3v2 header. ...
#define AV_CH_LAYOUT_5POINT0
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
uint8_t tvdc[32]
TVDC lookup table.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned int avio_rb32(AVIOContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
#define AVERROR_EOF
End of file.
uint64_t avio_rb64(AVIOContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_CH_LAYOUT_5POINT1
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVDictionary * metadata
Metadata that applies to the whole file.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
Free memory allocated parsing special (non-text) metadata.
simple assert() macros that are a bit more flexible than ISO C assert().
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned flags
1 for EHB, 0 is no extra half darkening
audio channel layout utility functions
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int width
picture width / height.
#define FF_ARRAY_ELEMS(a)
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
unsigned bpp
bits per plane to decode (differs from bits_per_coded_sample if HAM)
int sample_rate
samples per second
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
This structure contains the data a format has to probe a file.
const uint32_t * dsd_layout
unsigned bitmap_compression
delta compression method used
int is_64bit
chunk size is 64-bit
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
Read an ID3v2 tag, including supported extra metadata and chapters.
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int channels
number of audio channels
void * priv_data
Format private data.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
unsigned masking
masking method used