1 /*
2 * Linux Media Labs MPEG-4 demuxer
3 * Copyright (c) 2008 Ivo van Poorten
4 *
5 * Due to a lack of sample files, only files with one channel are supported.
6 * u-law and ADPCM audio are unsupported for the same reason.
7 *
8 * This file is part of FFmpeg.
9 *
10 * FFmpeg is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * FFmpeg is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with FFmpeg; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
26
30
31 #define LMLM4_I_FRAME 0x00
32 #define LMLM4_P_FRAME 0x01
33 #define LMLM4_B_FRAME 0x02
34 #define LMLM4_INVALID 0x03
35 #define LMLM4_MPEG1L2 0x04
36
37 #define LMLM4_MAX_PACKET_SIZE 1024 * 1024
38
40 {
41 const unsigned char *buf = pd->
buf;
43
46
50 if ((
AV_RB16(buf + 8) & 0xfffe) != 0xfffc)
51 return 0;
52 /* I could calculate the audio framesize and compare with
53 * packet_size-8, but that seems overkill */
55 }
else if (
AV_RB24(buf + 8) == 0x000001) {
/* PES Signal */
57 }
58 }
59
60 return 0;
61 }
62
64 {
66
73
79
80 /* the parameters will be extracted from the compressed bitstream */
81 return 0;
82 }
83
85 {
89
93 padding = -packet_size & 511;
95
99 }
103 }
104
107
109
116 break;
119 break;
120 }
121
123 }
124
131 };