1 /*
2 * VC-1 demuxer
3 * Copyright (c) 2015 Carl Eugen Hoyos
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
26
28 {
29 int seq = 0, entry = 0,
frame = 0, i;
30
31 for (i = 0; i < p->
buf_size + 5; i++) {
33 if ((code & 0xffffffe0) == 0x100) {
34 int type = code & 0x11f;
35 i += 4;
36 switch (type) {
39 profile = (p->
buf[i] & 0xc0) >> 6;
41 seq = 0;
42 continue;
43 }
44 level = (p->
buf[i] & 0x38) >> 3;
45 if (level >= 5) {
46 seq = 0;
47 continue;
48 }
49 chromaformat = (p->
buf[i] & 0x6) >> 1;
50 if (chromaformat != 1) {
51 seq = 0;
52 continue;
53 }
54 seq++;
55 i += 6;
56 break;
57 }
59 if (!seq)
60 continue;
61 entry++;
62 i += 2;
63 break;
67 if (seq && entry)
69 break;
70 }
71 }
72 }
73
78 return 0;
79 }
80
#define FF_DEF_RAWVIDEO_DEMUXER2(shortname, longname, probe, ext, id, flag)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
This structure contains the data a format has to probe a file.