1 /*
2 * Microsoft Windows ICO demuxer
3 * Copyright (c) 2011 Peter Ross (pross@xvid.org)
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
22 /**
23 * @file
24 * Microsoft Windows ICO demuxer
25 */
26
32
38
44
46 {
49 return 0;
50 }
51
53 {
56 int i, codec;
57
60
64
67 int tmp;
68
69 if (
avio_seek(pb, 6 + i * 16, SEEK_SET) < 0)
70 break;
71
73 if (!st)
75
82
84
87
89 break;
90
92 switch (codec) {
93 case MKTAG(0x89,
'P',
'N',
'G'):
97 break;
98 case 40:
103 if (tmp)
106 if (tmp)
108 break;
109 default:
112 }
113 }
114
115 return 0;
116 }
117
119 {
125
128
130
133
137 } else {
142
143 /* add BMP header */
144 bytestream_put_byte(&buf, 'B');
145 bytestream_put_byte(&buf, 'M');
146 bytestream_put_le32(&buf, pkt->
size);
147 bytestream_put_le16(&buf, 0);
148 bytestream_put_le16(&buf, 0);
149 bytestream_put_le32(&buf, 0);
150
153
155
158
162 }
163
166 }
167
170
171 return 0;
172 }
173
182 };