MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / parse_header

Function parse_header

libavformat/ifv.c:91–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static int parse_header(AVFormatContext *s)
92{
93 IFVContext *ifv = s->priv_data;
94 uint32_t aud_magic;
95 uint32_t vid_magic;
96
97 avio_skip(s->pb, 0x34);
98 ff_dict_set_timestamp(&s->metadata, "creation_time", avio_rl32(s->pb) * 1000000LL);
99 avio_skip(s->pb, 0x24);
100
101 ifv->width = avio_rl16(s->pb);
102 ifv->height = avio_rl16(s->pb);
103
104 avio_skip(s->pb, 0x8);
105 vid_magic = avio_rl32(s->pb);
106
107 if (vid_magic != MKTAG('H','2','6','4'))
108 avpriv_request_sample(s, "Unknown video codec %x", vid_magic);
109
110 avio_skip(s->pb, 0x2c);
111 ifv->sample_rate = avio_rl32(s->pb);
112 aud_magic = avio_rl32(s->pb);
113
114 if (aud_magic == MKTAG('G','R','A','W')) {
115 ifv->is_audio_present = 1;
116 } else if (aud_magic == MKTAG('P','C','M','U')) {
117 ifv->is_audio_present = 0;
118 } else {
119 avpriv_request_sample(s, "Unknown audio codec %x", aud_magic);
120 }
121
122 avio_skip(s->pb, 0x44);
123 ifv->total_vframes = avio_rl32(s->pb);
124 ifv->total_aframes = avio_rl32(s->pb);
125
126 return 0;
127}
128
129static int ifv_read_header(AVFormatContext *s)
130{

Callers 1

ifv_read_headerFunction · 0.70

Calls 5

avio_skipFunction · 0.85
ff_dict_set_timestampFunction · 0.85
avio_rl32Function · 0.85
avio_rl16Function · 0.85
avpriv_request_sampleFunction · 0.85

Tested by

no test coverage detected