FFmpeg
Loading...
Searching...
No Matches
dhav.c
Go to the documentation of this file.
1/*
2 * DHAV demuxer
3 *
4 * Copyright (c) 2018 Paul B Mahol
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <time.h>
24
26#include "libavutil/mem.h"
28#include "avio_internal.h"
29#include "avformat.h"
30#include "demux.h"
31#include "internal.h"
32
53
60
61static int dhav_probe(const AVProbeData *p)
62{
63 if (!memcmp(p->buf, "DAHUA", 5))
64 return AVPROBE_SCORE_MAX;
65
66 if (memcmp(p->buf, "DHAV", 4))
67 return 0;
68
69 if (p->buf[4] == 0xf0 ||
70 p->buf[4] == 0xf1 ||
71 p->buf[4] == 0xfc ||
72 p->buf[4] == 0xfd)
73 return AVPROBE_SCORE_MAX;
74 return 0;
75}
76
77static const uint32_t sample_rates[] = {
78 8000, 4000, 8000, 11025, 16000,
79 20000, 22050, 32000, 44100, 48000,
80 96000, 192000, 64000,
81};
82
83static int parse_ext(AVFormatContext *s, int length)
84{
85 DHAVContext *dhav = s->priv_data;
86 int64_t ret = 0;
87
88 while (length > 0) {
89 int type = avio_r8(s->pb);
90 int index;
91
92 switch (type) {
93 case 0x80:
94 ret = avio_skip(s->pb, 1);
95 dhav->width = 8 * avio_r8(s->pb);
96 dhav->height = 8 * avio_r8(s->pb);
97 length -= 4;
98 break;
99 case 0x81:
100 ret = avio_skip(s->pb, 1);
101 dhav->video_codec = avio_r8(s->pb);
102 dhav->frame_rate = avio_r8(s->pb);
103 length -= 4;
104 break;
105 case 0x82:
106 ret = avio_skip(s->pb, 3);
107 dhav->width = avio_rl16(s->pb);
108 dhav->height = avio_rl16(s->pb);
109 length -= 8;
110 break;
111 case 0x83:
112 dhav->audio_channels = avio_r8(s->pb);
113 dhav->audio_codec = avio_r8(s->pb);
114 index = avio_r8(s->pb);
117 } else {
118 dhav->sample_rate = 8000;
119 }
120 length -= 4;
121 break;
122 case 0x88:
123 ret = avio_skip(s->pb, 7);
124 length -= 8;
125 break;
126 case 0x8c:
127 ret = avio_skip(s->pb, 1);
128 dhav->audio_channels = avio_r8(s->pb);
129 dhav->audio_codec = avio_r8(s->pb);
130 index = avio_r8(s->pb);
133 } else {
134 dhav->sample_rate = 8000;
135 }
136 ret = avio_skip(s->pb, 3);
137 length -= 8;
138 break;
139 case 0x91:
140 case 0x92:
141 case 0x93:
142 case 0x95:
143 case 0x9a:
144 case 0x9b: // sample aspect ratio
145 case 0xb3:
146 ret = avio_skip(s->pb, 7);
147 length -= 8;
148 break;
149 case 0x84:
150 case 0x85:
151 case 0x8b:
152 case 0x94:
153 case 0x96:
154 case 0xa0:
155 case 0xb2:
156 case 0xb4:
157 ret = avio_skip(s->pb, 3);
158 length -= 4;
159 break;
160 default:
161 av_log(s, AV_LOG_INFO, "Unknown type: %X, skipping rest of header.\n", type);
162 ret = avio_skip(s->pb, length - 1);
163 length = 0;
164 }
165
166 if (ret < 0)
167 return ret;
168 }
169
170 return 0;
171}
172
174{
175 DHAVContext *dhav = s->priv_data;
176 int frame_length, ext_length;
177 int64_t start, end, ret;
178
179 if (avio_feof(s->pb))
180 return AVERROR_EOF;
181
182 while (avio_r8(s->pb) != 'D' || avio_r8(s->pb) != 'H' || avio_r8(s->pb) != 'A' || avio_r8(s->pb) != 'V') {
183 if (avio_feof(s->pb))
184 return AVERROR_EOF;
185 }
186
187 start = avio_tell(s->pb) - 4;
188 dhav->last_good_pos = start;
189 dhav->type = avio_r8(s->pb);
190 dhav->subtype = avio_r8(s->pb);
191 dhav->channel = avio_r8(s->pb);
192 dhav->frame_subnumber = avio_r8(s->pb);
193 dhav->frame_number = avio_rl32(s->pb);
194 frame_length = avio_rl32(s->pb);
195 dhav->date = avio_rl32(s->pb);
196
197 if (frame_length < 24)
198 return AVERROR_INVALIDDATA;
199 if (dhav->type == 0xf1) {
200 ret = avio_skip(s->pb, frame_length - 20);
201 return ret < 0 ? ret : 0;
202 }
203
204 dhav->timestamp = avio_rl16(s->pb);
205 ext_length = avio_r8(s->pb);
206 avio_skip(s->pb, 1); // checksum
207
208 ret = parse_ext(s, ext_length);
209 if (ret < 0)
210 return ret;
211
212 end = avio_tell(s->pb);
213
214 return frame_length - 8 - (end - start);
215}
216
217static void get_timeinfo(unsigned date, struct tm *timeinfo)
218{
219 int year, month, day, hour, min, sec;
220
221 sec = date & 0x3F;
222 min = (date >> 6) & 0x3F;
223 hour = (date >> 12) & 0x1F;
224 day = (date >> 17) & 0x1F;
225 month = (date >> 22) & 0x0F;
226 year = ((date >> 26) & 0x3F) + 2000;
227
228 timeinfo->tm_year = year - 1900;
229 timeinfo->tm_mon = month - 1;
230 timeinfo->tm_mday = day;
231 timeinfo->tm_hour = hour;
232 timeinfo->tm_min = min;
233 timeinfo->tm_sec = sec;
234}
235
236#define MAX_DURATION_BUFFER_SIZE (1024*1024)
237
239{
240 if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL))
241 return 0;
242
243 int64_t start_pos = avio_tell(s->pb);
244 int64_t pos = -1;
245 int64_t start = 0;
246 struct tm timeinfo;
247 uint8_t *buffer;
248 int64_t buffer_size;
249 int64_t buffer_pos;
251 unsigned date;
252 int64_t size = avio_size(s->pb);
253 int64_t ret = 0;
254
255 if (start_pos < 0 || start_pos > size - 20)
256 return 0;
257
258 avio_skip(s->pb, 16);
259 date = avio_rl32(s->pb);
260 get_timeinfo(date, &timeinfo);
261 start = av_timegm(&timeinfo) * 1000LL;
262
263 buffer_size = FFMIN(MAX_DURATION_BUFFER_SIZE, size);
264 buffer = av_malloc(buffer_size);
265 if (!buffer)
266 goto fail;
267 buffer_pos = size - buffer_size;
268 avio_seek(s->pb, buffer_pos, SEEK_SET);
269 if (ffio_read_size(s->pb, buffer, buffer_size) < 0)
270 goto fail;
271
272 offset = buffer_size - 8;
273 while (offset > 0) {
274 if (AV_RL32(buffer + offset) == MKTAG('d','h','a','v')) {
276 pos = buffer_pos + offset - seek_back + 8;
277 break;
278 } else {
279 offset -= 9;
280 }
281 }
282
283 if (pos < buffer_pos || pos - buffer_pos > buffer_size - 20)
284 goto fail;
285
286 date = AV_RL32(buffer + (pos - buffer_pos) + 16);
287 get_timeinfo(date, &timeinfo);
288
289 ret = av_timegm(&timeinfo) * 1000LL - start;
290fail:
292 avio_seek(s->pb, start_pos, SEEK_SET);
293 return ret;
294}
295
297{
298 DHAVContext *dhav = s->priv_data;
299 uint8_t signature[5];
300 int ret = ffio_ensure_seekback(s->pb, 5);
301
302 if (ret < 0)
303 return ret;
304
305 ret = ffio_read_size(s->pb, signature, sizeof(signature));
306 if (ret < 0)
307 return ret;
308 if (!memcmp(signature, "DAHUA", 5)) {
309 avio_skip(s->pb, 0x400 - 5);
310 dhav->last_good_pos = avio_tell(s->pb);
311 } else {
312 if (!memcmp(signature, "DHAV", 4)) {
313 avio_seek(s->pb, -5, SEEK_CUR);
314 dhav->last_good_pos = avio_tell(s->pb);
315 } else if (s->pb->seekable) {
316 avio_seek(s->pb, avio_size(s->pb) - 8, SEEK_SET);
317 while (avio_rl32(s->pb) == MKTAG('d','h','a','v')) {
318 int seek_back;
319
320 seek_back = avio_rl32(s->pb) + 8;
321 if (seek_back < 9)
322 break;
323 dhav->last_good_pos = avio_tell(s->pb);
324 int64_t ret64 = avio_seek(s->pb, -seek_back, SEEK_CUR);
325 if (ret64 < 0)
326 return ret64;
327 }
328 avio_seek(s->pb, dhav->last_good_pos, SEEK_SET);
329 }
330 }
331
332 dhav->duration = get_duration(s);
333 dhav->last_good_pos = avio_tell(s->pb);
334 s->ctx_flags |= AVFMTCTX_NOHEADER;
335 dhav->video_stream_index = -1;
336 dhav->audio_stream_index = -1;
337
338 return 0;
339}
340
341static int64_t get_pts(AVFormatContext *s, int stream_index)
342{
343 DHAVStream *dst = s->streams[stream_index]->priv_data;
344 DHAVContext *dhav = s->priv_data;
345 struct tm timeinfo;
346 time_t t;
347
348 get_timeinfo(dhav->date, &timeinfo);
349
350 t = av_timegm(&timeinfo);
351 if (dst->last_time == t) {
352 int64_t diff = dhav->timestamp - dst->last_timestamp;
353
354 if (diff < 0)
355 diff += 65535;
356 if (diff == 0 && dhav->frame_rate)
357 diff = av_rescale(dhav->frame_number - dst->last_frame_number, 1000, dhav->frame_rate);
358 dst->pts += diff;
359 } else {
360 dst->pts = t * 1000LL;
361 }
362
363 dst->last_time = t;
364 dst->last_timestamp = dhav->timestamp;
365 dst->last_frame_number = dhav->frame_number;
366
367 return dst->pts;
368}
369
371{
372 DHAVContext *dhav = s->priv_data;
373 int size, ret, stream_index;
374
375retry:
376 while ((ret = read_chunk(s)) == 0)
377 ;
378
379 if (ret < 0)
380 return ret;
381
382 if (dhav->type == 0xfd && dhav->video_stream_index == -1) {
385
386 if (!st)
387 return AVERROR(ENOMEM);
388
390 switch (dhav->video_codec) {
391 case 0x1: st->codecpar->codec_id = AV_CODEC_ID_MPEG4; break;
392 case 0x3: st->codecpar->codec_id = AV_CODEC_ID_MJPEG; break;
393 case 0x2:
394 case 0x4:
395 case 0x8: st->codecpar->codec_id = AV_CODEC_ID_H264; break;
396 case 0xc: st->codecpar->codec_id = AV_CODEC_ID_HEVC; break;
397 default: avpriv_request_sample(s, "Unknown video codec %X", dhav->video_codec);
398 }
399 st->duration = dhav->duration;
400 st->codecpar->width = dhav->width;
401 st->codecpar->height = dhav->height;
402 st->avg_frame_rate.num = dhav->frame_rate;
403 st->avg_frame_rate.den = 1;
404 st->priv_data = dst = av_mallocz(sizeof(DHAVStream));
405 if (!st->priv_data)
406 return AVERROR(ENOMEM);
407 dst->last_time = AV_NOPTS_VALUE;
408 dhav->video_stream_index = st->index;
409
410 avpriv_set_pts_info(st, 64, 1, 1000);
411 } else if (dhav->type == 0xf0 && dhav->audio_stream_index == -1) {
414
415 if (!st)
416 return AVERROR(ENOMEM);
417
419 switch (dhav->audio_codec) {
420 case 0x07: st->codecpar->codec_id = AV_CODEC_ID_PCM_S8; break;
421 case 0x0c: st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; break;
422 case 0x10: st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; break;
423 case 0x0a: st->codecpar->codec_id = AV_CODEC_ID_PCM_MULAW; break;
424 case 0x16: st->codecpar->codec_id = AV_CODEC_ID_PCM_MULAW; break;
425 case 0x0e: st->codecpar->codec_id = AV_CODEC_ID_PCM_ALAW; break;
426 case 0x1a: st->codecpar->codec_id = AV_CODEC_ID_AAC; break;
427 case 0x1f: st->codecpar->codec_id = AV_CODEC_ID_MP2; break;
428 case 0x21: st->codecpar->codec_id = AV_CODEC_ID_MP3; break;
429 case 0x0d: st->codecpar->codec_id = AV_CODEC_ID_ADPCM_MS; break;
430 default: avpriv_request_sample(s, "Unknown audio codec %X", dhav->audio_codec);
431 }
432 st->duration = dhav->duration;
434 st->codecpar->sample_rate = dhav->sample_rate;
435 st->priv_data = dst = av_mallocz(sizeof(DHAVStream));
436 if (!st->priv_data)
437 return AVERROR(ENOMEM);
438 dst->last_time = AV_NOPTS_VALUE;
439 dhav->audio_stream_index = st->index;
440
441 avpriv_set_pts_info(st, 64, 1, 1000);
442 }
443
444 stream_index = dhav->type == 0xf0 ? dhav->audio_stream_index : dhav->video_stream_index;
445 if (stream_index < 0) {
446 avio_skip(s->pb, ret);
447 if (avio_rl32(s->pb) == MKTAG('d','h','a','v'))
448 avio_skip(s->pb, 4);
449 goto retry;
450 }
451
452 size = ret;
453 ret = av_get_packet(s->pb, pkt, size);
454 if (ret < 0)
455 return ret;
456 pkt->stream_index = stream_index;
457 if (dhav->type != 0xfc)
458 pkt->flags |= AV_PKT_FLAG_KEY;
459 pkt->duration = 1;
460 if (pkt->stream_index >= 0)
461 pkt->pts = get_pts(s, pkt->stream_index);
462 pkt->pos = dhav->last_good_pos;
463 if (avio_rl32(s->pb) == MKTAG('d','h','a','v'))
464 avio_skip(s->pb, 4);
465
466 return ret;
467}
468
469static int dhav_read_seek(AVFormatContext *s, int stream_index,
470 int64_t timestamp, int flags)
471{
472 DHAVContext *dhav = s->priv_data;
473 AVStream *st = s->streams[stream_index];
474 FFStream *const sti = ffstream(st);
475 int index = av_index_search_timestamp(st, timestamp, flags);
476 int64_t pts;
477
478 if (index < 0)
479 return -1;
481 if (pts < timestamp)
482 return AVERROR(EAGAIN);
483 if (avio_seek(s->pb, sti->index_entries[index].pos, SEEK_SET) < 0)
484 return -1;
485
486 for (int n = 0; n < s->nb_streams; n++) {
487 DHAVStream *const dst = s->streams[n]->priv_data;
488
489 dst->pts = pts;
490 dst->last_time = AV_NOPTS_VALUE;
491 }
492 dhav->last_good_pos = avio_tell(s->pb);
493
494 return 0;
495}
496
498 .p.name = "dhav",
499 .p.long_name = NULL_IF_CONFIG_SMALL("Video DAV"),
500 .p.extensions = "dav",
502 .priv_data_size = sizeof(DHAVContext),
507};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const FFInputFormat ff_dhav_demuxer
Definition dhav.c:497
#define get_duration(index)
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition avformat.c:834
Main libavformat public API header.
#define AVPROBE_SCORE_MAX
maximum score
Definition avformat.h:483
#define AVFMTCTX_NOHEADER
signal that no header is present (streams are added dynamically)
Definition avformat.h:1284
#define AVFMT_TS_DISCONT
Format allows timestamp discontinuities.
Definition avformat.h:500
#define AVFMT_NO_BYTE_SEEK
Format does not allow seeking by bytes.
Definition avformat.h:506
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition avformat.h:507
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition utils.c:98
#define AVFMT_SEEK_TO_PTS
Seeking is based on PTS.
Definition avformat.h:520
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition avformat.h:499
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition aviobuf.c:236
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition avio.h:41
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition aviobuf.c:326
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition aviobuf.c:349
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition avio.h:494
unsigned int avio_rl16(AVIOContext *s)
Definition aviobuf.c:717
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition aviobuf.c:321
unsigned int avio_rl32(AVIOContext *s)
Definition aviobuf.c:733
int avio_r8(AVIOContext *s)
Definition aviobuf.c:606
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
Definition aviobuf.c:1026
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition aviobuf.c:665
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define s(width, name)
Definition cbs_vp9.c:198
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
#define min(a, b)
static const int sample_rates[]
Definition dcaenc.h:34
static AVPacket * pkt
static int dhav_probe(const AVProbeData *p)
Definition dhav.c:61
static int parse_ext(AVFormatContext *s, int length)
Definition dhav.c:83
static int dhav_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition dhav.c:370
static int read_chunk(AVFormatContext *s)
Definition dhav.c:173
static int dhav_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition dhav.c:469
#define MAX_DURATION_BUFFER_SIZE
Definition dhav.c:236
static int64_t get_pts(AVFormatContext *s, int stream_index)
Definition dhav.c:341
static int dhav_read_header(AVFormatContext *s)
Definition dhav.c:296
static void get_timeinfo(unsigned date, struct tm *timeinfo)
Definition dhav.c:217
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define fail
Definition test.h:479
@ AV_CODEC_ID_PCM_S16LE
Definition codec_id.h:330
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AV_CODEC_ID_PCM_S8
Definition codec_id.h:334
@ AV_CODEC_ID_ADPCM_MS
Definition codec_id.h:376
@ AV_CODEC_ID_PCM_ALAW
Definition codec_id.h:337
@ AV_CODEC_ID_MP2
Definition codec_id.h:453
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
@ AV_CODEC_ID_AAC
Definition codec_id.h:455
@ AV_CODEC_ID_MPEG4
Definition codec_id.h:62
@ AV_CODEC_ID_MJPEG
Definition codec_id.h:57
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition codec_id.h:454
@ AV_CODEC_ID_PCM_MULAW
Definition codec_id.h:336
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition packet.h:650
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
Definition seek.c:245
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_INFO
Standard information.
Definition log.h:221
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition avutil.h:247
int index
Definition gxfenc.c:90
cl_device_type type
#define AV_RL32(p)
static const char signature[]
Definition ipmovie.c:592
unsigned offset
Definition libaomenc.c:763
static av_always_inline FFStream * ffstream(AVStream *st)
Definition internal.h:365
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition libcdio.c:151
#define FFMIN(a, b)
Definition macros.h:49
#define MKTAG(a, b, c, d)
Definition macros.h:55
Memory handling functions.
static void seek_back(AVFormatContext *s, AVIOContext *pb, int64_t pos)
Definition mpegts.c:3541
#define av_malloc(s)
Definition ops_static.c:52
time_t av_timegm(struct tm *tm)
Convert the decomposed UTC time in tm to a time_t value.
Definition parseutils.c:573
misc parsing utilities
#define FF_ARRAY_ELEMS(a)
unsigned int pos
Definition spdifenc.c:431
int nb_channels
Number of channels in this layout.
int height
The height of the video frame in pixels.
Definition codec_par.h:150
AVChannelLayout ch_layout
The channel layout and number of channels.
Definition codec_par.h:207
int width
The width of the video frame in pixels.
Definition codec_par.h:143
enum AVMediaType codec_type
General type of the encoded data.
Definition codec_par.h:53
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition codec_par.h:57
int sample_rate
The number of audio samples per second.
Definition codec_par.h:213
Format I/O context.
Definition avformat.h:1333
int64_t pos
Definition avformat.h:621
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
Definition avformat.h:622
This structure stores compressed data.
Definition packet.h:580
This structure contains the data a format has to probe a file.
Definition avformat.h:471
int num
Numerator.
Definition rational.h:59
int den
Denominator.
Definition rational.h:60
Stream structure.
Definition avformat.h:766
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition avformat.h:789
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition avformat.h:825
void * priv_data
Definition avformat.h:791
int index
stream index in AVFormatContext
Definition avformat.h:772
AVRational avg_frame_rate
Average framerate.
Definition avformat.h:855
unsigned timestamp
Definition dhav.c:40
unsigned subtype
Definition dhav.c:35
unsigned frame_subnumber
Definition dhav.c:37
int audio_channels
Definition dhav.c:44
int height
Definition dhav.c:41
unsigned channel
Definition dhav.c:36
int frame_rate
Definition dhav.c:43
unsigned type
Definition dhav.c:34
int64_t last_good_pos
Definition dhav.c:47
int audio_codec
Definition dhav.c:45
unsigned frame_number
Definition dhav.c:38
int video_stream_index
Definition dhav.c:50
int audio_stream_index
Definition dhav.c:51
int sample_rate
Definition dhav.c:46
int width
Definition dhav.c:41
unsigned date
Definition dhav.c:39
int video_codec
Definition dhav.c:42
int64_t duration
Definition dhav.c:48
int64_t last_time
Definition dhav.c:57
int64_t last_frame_number
Definition dhav.c:55
int64_t pts
Definition dhav.c:58
int64_t last_timestamp
Definition dhav.c:56
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
Definition internal.h:191
#define av_mallocz(s)
#define avpriv_request_sample(...)
#define av_freep(p)
#define av_log(a,...)
static char buffer[20]
Definition seek.c:32
static int64_t pts
int size
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)