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
28
29 #define LMLM4_I_FRAME 0x00
30 #define LMLM4_P_FRAME 0x01
31 #define LMLM4_B_FRAME 0x02
32 #define LMLM4_INVALID 0x03
33 #define LMLM4_MPEG1L2 0x04
34
35 #define LMLM4_MAX_PACKET_SIZE 1024 * 1024
36
38 const unsigned char *
buf = pd->
buf;
39 unsigned int frame_type, packet_size;
40
43
46
48 if ((
AV_RB16(buf+8) & 0xfffe) != 0xfffc)
49 return 0;
50 /* I could calculate the audio framesize and compare with
51 * packet_size-8, but that seems overkill */
53 }
else if (
AV_RB24(buf+8) == 0x000001) {
/* PES Signal */
55 }
56 }
57
58 return 0;
59 }
60
63
70
76
77 /* the parameters will be extracted from the compressed bitstream */
78 return 0;
79 }
80
84 unsigned int frame_type, packet_size, padding,
frame_size;
85
89 padding = -packet_size & 511;
90 frame_size = packet_size - 8;
91
95 }
99 }
100
103
105
106 switch (frame_type) {
112 break;
115 break;
116 }
117
119 }
120
127 };