1 /*
2 * G.729 bit format muxer and demuxer
3 * Copyright (c) 2007-2008 Vladimir Voroshilov
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 */
25
26 #define MAX_FRAME_SIZE 10
27
28 #define SYNC_WORD 0x6b21
31
33 {
34 int i, j;
35
37 return 0;
38
39 for(i=0; i+3<p->
buf_size && i< 10*0x50; ){
41 return 0;
43 if(j!=0x40 && j!=0x50)
44 return 0;
45 i+=j;
46 }
48 }
49
51 {
53
55 if (!st)
57
63
65 return 0;
66 }
67
70 {
74 int packet_size;
75 uint16_t* src=buf;
76 int i, j, ret;
78
81
86
88 if(ret<0)
89 return ret;
90 if(ret != 8 * packet_size * sizeof(uint16_t))
92
95
97 for(j=0; j < packet_size; j++)
98 for(i=0; i<8;i++)
100
102
105 return 0;
106 }
107
114 .extensions = "bit",
115 };
116
117 #if CONFIG_MUXERS
119 {
121
126
127 return 0;
128 }
129
131 {
134 int i;
135
138
140 for(i=0; i< 8 * 10; i++)
143
144 return 0;
145 }
146
150 .mime_type = "audio/bit",
151 .extensions = "bit",
156 };
157 #endif