1 /*
2 * SMJPEG demuxer
3 * Copyright (c) 2011 Paul B Mahol
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 * This is a demuxer for Loki SDL Motion JPEG files
25 */
26
31
36
38 {
41 return 0;
42 }
43
45 {
50 char *comment;
51
54 if (version)
56
58
61 switch (htype) {
64 if (!hlength || hlength > 512)
67 if (!comment)
69 if (
avio_read(pb, comment, hlength) != hlength) {
73 }
74 comment[hlength] = 0;
77 break;
79 if (ast) {
82 }
84 if (hlength < 8)
87 if (!ast)
100 break;
102 if (vst) {
105 }
107 if (hlength < 12)
110 if (!vst)
118 vst->codec->codec_tag);
123 break;
125 return 0;
126 default:
129 }
130 }
131
133 }
134
136 {
138 uint32_t dtype,
size, timestamp;
139 int64_t pos;
141
146 switch (dtype) {
152 pkt->
pts = timestamp;
154 break;
160 pkt->
pts = timestamp;
162 break;
165 break;
166 default:
169 break;
170 }
172 }
173
181 .extensions = "mjpg",
183 };