1 /*
2 * Format register and lookup
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
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
26
27 /**
28 * @file
29 * Format register and lookup
30 */
31 /** head of registered input format linked list */
33 /** head of registered output format linked list */
35
37 {
38 if (f)
40 else
42 }
43
45 {
46 if (f)
48 else
50 }
51
53 {
55
59 }
60
62 {
64
68 }
69
71 {
72 const char *ext, *p;
73 char ext1[32], *q;
74
75 if (!filename)
76 return 0;
77
78 ext = strrchr(filename, '.');
79 if (ext) {
80 ext++;
81 p = extensions;
82 for (;;) {
83 q = ext1;
84 while (*p != '0円' && *p != ',' && q - ext1 < sizeof(ext1) - 1)
85 *q++ = *p++;
86 *q = '0円';
88 return 1;
89 if (*p == '0円')
90 break;
91 p++;
92 }
93 }
94 return 0;
95 }
96
98 {
99 const char *p;
101
102 if (!name || !names)
103 return 0;
104
105 namelen = strlen(name);
106 while ((p = strchr(names, ','))) {
107 len =
FFMAX(p - names, namelen);
109 return 1;
110 names = p + 1;
111 }
113 }
114
116 const char *mime_type)
117 {
119 int score_max, score;
120
121 /* specific test for image sequences */
122 #if CONFIG_IMAGE2_MUXER
123 if (!short_name && filename &&
127 }
128 #endif
129 /* Find the proper file type. */
130 fmt_found = NULL;
131 score_max = 0;
133 score = 0;
135 score += 100;
137 score += 10;
140 score += 5;
141 }
142 if (score > score_max) {
143 score_max = score;
145 }
146 }
147 return fmt_found;
148 }
149
151 const char *filename, const char *mime_type,
153 {
154 if (!strcmp(fmt->
name,
"segment") || !strcmp(fmt->
name,
"ssegment")) {
156 }
157
160
161 #if CONFIG_IMAGE2_MUXER
162 if (!strcmp(fmt->
name,
"image2") || !strcmp(fmt->
name,
"image2pipe")) {
164 }
165 #endif
173 else
175 }
176
178 {
183 return NULL;
184 }