Updating to .23
Tiago Bortoletto Vaz
11 years ago
0 | ||
1 | GNU GENERAL PUBLIC LICENSE | |
2 | Version 3, 29 June 2007 | |
3 | ||
4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., | |
4 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
5 | 5 | Everyone is permitted to copy and distribute verbatim copies |
6 | 6 | of this license document, but changing it is not allowed. |
7 | 7 | |
8 | Preamble | |
9 | ||
10 | The GNU General Public License is a free, copyleft license for | |
11 | software and other kinds of works. | |
12 | ||
13 | The licenses for most software and other practical works are designed | |
14 | to take away your freedom to share and change the works. By contrast, | |
15 | the GNU General Public License is intended to guarantee your freedom to | |
16 | share and change all versions of a program--to make sure it remains free | |
17 | software for all its users. We, the Free Software Foundation, use the | |
18 | GNU General Public License for most of our software; it applies also to | |
19 | any other work released this way by its authors. You can apply it to | |
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Lesser General Public License instead.) You can apply it to | |
20 | 18 | your programs, too. |
21 | 19 | |
22 | 20 | When we speak of free software, we are referring to freedom, not |
23 | 21 | price. Our General Public Licenses are designed to make sure that you |
24 | 22 | have the freedom to distribute copies of free software (and charge for |
25 | them if you wish), that you receive source code or can get it if you | |
26 | want it, that you can change the software or use pieces of it in new | |
27 | free programs, and that you know you can do these things. | |
28 | ||
29 | To protect your rights, we need to prevent others from denying you | |
30 | these rights or asking you to surrender the rights. Therefore, you have | |
31 | certain responsibilities if you distribute copies of the software, or if | |
32 | you modify it: responsibilities to respect the freedom of others. | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
33 | 31 | |
34 | 32 | For example, if you distribute copies of such a program, whether |
35 | gratis or for a fee, you must pass on to the recipients the same | |
36 | freedoms that you received. You must make sure that they, too, receive | |
37 | or can get the source code. And you must show them these terms so they | |
38 | know their rights. | |
39 | ||
40 | Developers that use the GNU GPL protect your rights with two steps: | |
41 | (1) assert copyright on the software, and (2) offer you this License | |
42 | giving you legal permission to copy, distribute and/or modify it. | |
43 | ||
44 | For the developers' and authors' protection, the GPL clearly explains | |
45 | that there is no warranty for this free software. For both users' and | |
46 | authors' sake, the GPL requires that modified versions be marked as | |
47 | changed, so that their problems will not be attributed erroneously to | |
48 | authors of previous versions. | |
49 | ||
50 | Some devices are designed to deny users access to install or run | |
51 | modified versions of the software inside them, although the manufacturer | |
52 | can do so. This is fundamentally incompatible with the aim of | |
53 | protecting users' freedom to change the software. The systematic | |
54 | pattern of such abuse occurs in the area of products for individuals to | |
55 | use, which is precisely where it is most unacceptable. Therefore, we | |
56 | have designed this version of the GPL to prohibit the practice for those | |
57 | products. If such problems arise substantially in other domains, we | |
58 | stand ready to extend this provision to those domains in future versions | |
59 | of the GPL, as needed to protect the freedom of users. | |
60 | ||
61 | Finally, every program is threatened constantly by software patents. | |
62 | States should not allow patents to restrict development and use of | |
63 | software on general-purpose computers, but in those that do, we wish to | |
64 | avoid the special danger that patents applied to a free program could | |
65 | make it effectively proprietary. To prevent this, the GPL assures that | |
66 | patents cannot be used to render the program non-free. | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
67 | 54 | |
68 | 55 | The precise terms and conditions for copying, distribution and |
69 | 56 | modification follow. |
70 | 57 | |
71 | TERMS AND CONDITIONS | |
72 | ||
73 | 0. Definitions. | |
74 | ||
75 | "This License" refers to version 3 of the GNU General Public License. | |
76 | ||
77 | "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | works, such as semiconductor masks. | |
79 | ||
80 | "The Program" refers to any copyrightable work licensed under this | |
81 | License. Each licensee is addressed as "you". "Licensees" and | |
82 | "recipients" may be individuals or organizations. | |
83 | ||
84 | To "modify" a work means to copy from or adapt all or part of the work | |
85 | in a fashion requiring copyright permission, other than the making of an | |
86 | exact copy. The resulting work is called a "modified version" of the | |
87 | earlier work or a work "based on" the earlier work. | |
88 | ||
89 | A "covered work" means either the unmodified Program or a work based | |
90 | on the Program. | |
91 | ||
92 | To "propagate" a work means to do anything with it that, without | |
93 | permission, would make you directly or secondarily liable for | |
94 | infringement under applicable copyright law, except executing it on a | |
95 | computer or modifying a private copy. Propagation includes copying, | |
96 | distribution (with or without modification), making available to the | |
97 | public, and in some countries other activities as well. | |
98 | ||
99 | To "convey" a work means any kind of propagation that enables other | |
100 | parties to make or receive copies. Mere interaction with a user through | |
101 | a computer network, with no transfer of a copy, is not conveying. | |
102 | ||
103 | An interactive user interface displays "Appropriate Legal Notices" | |
104 | to the extent that it includes a convenient and prominently visible | |
105 | feature that (1) displays an appropriate copyright notice, and (2) | |
106 | tells the user that there is no warranty for the work (except to the | |
107 | extent that warranties are provided), that licensees may convey the | |
108 | work under this License, and how to view a copy of this License. If | |
109 | the interface presents a list of user commands or options, such as a | |
110 | menu, a prominent item in the list meets this criterion. | |
111 | ||
112 | 1. Source Code. | |
113 | ||
114 | The "source code" for a work means the preferred form of the work | |
115 | for making modifications to it. "Object code" means any non-source | |
116 | form of a work. | |
117 | ||
118 | A "Standard Interface" means an interface that either is an official | |
119 | standard defined by a recognized standards body, or, in the case of | |
120 | interfaces specified for a particular programming language, one that | |
121 | is widely used among developers working in that language. | |
122 | ||
123 | The "System Libraries" of an executable work include anything, other | |
124 | than the work as a whole, that (a) is included in the normal form of | |
125 | packaging a Major Component, but which is not part of that Major | |
126 | Component, and (b) serves only to enable use of the work with that | |
127 | Major Component, or to implement a Standard Interface for which an | |
128 | implementation is available to the public in source code form. A | |
129 | "Major Component", in this context, means a major essential component | |
130 | (kernel, window system, and so on) of the specific operating system | |
131 | (if any) on which the executable work runs, or a compiler used to | |
132 | produce the work, or an object code interpreter used to run it. | |
133 | ||
134 | The "Corresponding Source" for a work in object code form means all | |
135 | the source code needed to generate, install, and (for an executable | |
136 | work) run the object code and to modify the work, including scripts to | |
137 | control those activities. However, it does not include the work's | |
138 | System Libraries, or general-purpose tools or generally available free | |
139 | programs which are used unmodified in performing those activities but | |
140 | which are not part of the work. For example, Corresponding Source | |
141 | includes interface definition files associated with source files for | |
142 | the work, and the source code for shared libraries and dynamically | |
143 | linked subprograms that the work is specifically designed to require, | |
144 | such as by intimate data communication or control flow between those | |
145 | subprograms and other parts of the work. | |
146 | ||
147 | The Corresponding Source need not include anything that users | |
148 | can regenerate automatically from other parts of the Corresponding | |
149 | Source. | |
150 | ||
151 | The Corresponding Source for a work in source code form is that | |
152 | same work. | |
153 | ||
154 | 2. Basic Permissions. | |
155 | ||
156 | All rights granted under this License are granted for the term of | |
157 | copyright on the Program, and are irrevocable provided the stated | |
158 | conditions are met. This License explicitly affirms your unlimited | |
159 | permission to run the unmodified Program. The output from running a | |
160 | covered work is covered by this License only if the output, given its | |
161 | content, constitutes a covered work. This License acknowledges your | |
162 | rights of fair use or other equivalent, as provided by copyright law. | |
163 | ||
164 | You may make, run and propagate covered works that you do not | |
165 | convey, without conditions so long as your license otherwise remains | |
166 | in force. You may convey covered works to others for the sole purpose | |
167 | of having them make modifications exclusively for you, or provide you | |
168 | with facilities for running those works, provided that you comply with | |
169 | the terms of this License in conveying all material for which you do | |
170 | not control copyright. Those thus making or running the covered works | |
171 | for you must do so exclusively on your behalf, under your direction | |
172 | and control, on terms that prohibit them from making any copies of | |
173 | your copyrighted material outside their relationship with you. | |
174 | ||
175 | Conveying under any other circumstances is permitted solely under | |
176 | the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | makes it unnecessary. | |
178 | ||
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | ||
181 | No covered work shall be deemed part of an effective technological | |
182 | measure under any applicable law fulfilling obligations under article | |
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | similar laws prohibiting or restricting circumvention of such | |
185 | measures. | |
186 | ||
187 | When you convey a covered work, you waive any legal power to forbid | |
188 | circumvention of technological measures to the extent such circumvention | |
189 | is effected by exercising rights under this License with respect to | |
190 | the covered work, and you disclaim any intention to limit operation or | |
191 | modification of the work as a means of enforcing, against the work's | |
192 | users, your or third parties' legal rights to forbid circumvention of | |
193 | technological measures. | |
194 | ||
195 | 4. Conveying Verbatim Copies. | |
196 | ||
197 | You may convey verbatim copies of the Program's source code as you | |
198 | receive it, in any medium, provided that you conspicuously and | |
199 | appropriately publish on each copy an appropriate copyright notice; | |
200 | keep intact all notices stating that this License and any | |
201 | non-permissive terms added in accord with section 7 apply to the code; | |
202 | keep intact all notices of the absence of any warranty; and give all | |
203 | recipients a copy of this License along with the Program. | |
204 | ||
205 | You may charge any price or no price for each copy that you convey, | |
206 | and you may offer support or warranty protection for a fee. | |
207 | ||
208 | 5. Conveying Modified Source Versions. | |
209 | ||
210 | You may convey a work based on the Program, or the modifications to | |
211 | produce it from the Program, in the form of source code under the | |
212 | terms of section 4, provided that you also meet all of these conditions: | |
213 | ||
214 | a) The work must carry prominent notices stating that you modified | |
215 | it, and giving a relevant date. | |
216 | ||
217 | b) The work must carry prominent notices stating that it is | |
218 | released under this License and any conditions added under section | |
219 | 7. This requirement modifies the requirement in section 4 to | |
220 | "keep intact all notices". | |
221 | ||
222 | c) You must license the entire work, as a whole, under this | |
223 | License to anyone who comes into possession of a copy. This | |
224 | License will therefore apply, along with any applicable section 7 | |
225 | additional terms, to the whole of the work, and all its parts, | |
226 | regardless of how they are packaged. This License gives no | |
227 | permission to license the work in any other way, but it does not | |
228 | invalidate such permission if you have separately received it. | |
229 | ||
230 | d) If the work has interactive user interfaces, each must display | |
231 | Appropriate Legal Notices; however, if the Program has interactive | |
232 | interfaces that do not display Appropriate Legal Notices, your | |
233 | work need not make them do so. | |
234 | ||
235 | A compilation of a covered work with other separate and independent | |
236 | works, which are not by their nature extensions of the covered work, | |
237 | and which are not combined with it such as to form a larger program, | |
238 | in or on a volume of a storage or distribution medium, is called an | |
239 | "aggregate" if the compilation and its resulting copyright are not | |
240 | used to limit the access or legal rights of the compilation's users | |
241 | beyond what the individual works permit. Inclusion of a covered work | |
242 | in an aggregate does not cause this License to apply to the other | |
243 | parts of the aggregate. | |
244 | ||
245 | 6. Conveying Non-Source Forms. | |
246 | ||
247 | You may convey a covered work in object code form under the terms | |
248 | of sections 4 and 5, provided that you also convey the | |
249 | machine-readable Corresponding Source under the terms of this License, | |
250 | in one of these ways: | |
251 | ||
252 | a) Convey the object code in, or embodied in, a physical product | |
253 | (including a physical distribution medium), accompanied by the | |
254 | Corresponding Source fixed on a durable physical medium | |
255 | customarily used for software interchange. | |
256 | ||
257 | b) Convey the object code in, or embodied in, a physical product | |
258 | (including a physical distribution medium), accompanied by a | |
259 | written offer, valid for at least three years and valid for as | |
260 | long as you offer spare parts or customer support for that product | |
261 | model, to give anyone who possesses the object code either (1) a | |
262 | copy of the Corresponding Source for all the software in the | |
263 | product that is covered by this License, on a durable physical | |
264 | medium customarily used for software interchange, for a price no | |
265 | more than your reasonable cost of physically performing this | |
266 | conveying of source, or (2) access to copy the | |
267 | Corresponding Source from a network server at no charge. | |
268 | ||
269 | c) Convey individual copies of the object code with a copy of the | |
270 | written offer to provide the Corresponding Source. This | |
271 | alternative is allowed only occasionally and noncommercially, and | |
272 | only if you received the object code with such an offer, in accord | |
273 | with subsection 6b. | |
274 | ||
275 | d) Convey the object code by offering access from a designated | |
276 | place (gratis or for a charge), and offer equivalent access to the | |
277 | Corresponding Source in the same way through the same place at no | |
278 | further charge. You need not require recipients to copy the | |
279 | Corresponding Source along with the object code. If the place to | |
280 | copy the object code is a network server, the Corresponding Source | |
281 | may be on a different server (operated by you or a third party) | |
282 | that supports equivalent copying facilities, provided you maintain | |
283 | clear directions next to the object code saying where to find the | |
284 | Corresponding Source. Regardless of what server hosts the | |
285 | Corresponding Source, you remain obligated to ensure that it is | |
286 | available for as long as needed to satisfy these requirements. | |
287 | ||
288 | e) Convey the object code using peer-to-peer transmission, provided | |
289 | you inform other peers where the object code and Corresponding | |
290 | Source of the work are being offered to the general public at no | |
291 | charge under subsection 6d. | |
292 | ||
293 | A separable portion of the object code, whose source code is excluded | |
294 | from the Corresponding Source as a System Library, need not be | |
295 | included in conveying the object code work. | |
296 | ||
297 | A "User Product" is either (1) a "consumer product", which means any | |
298 | tangible personal property which is normally used for personal, family, | |
299 | or household purposes, or (2) anything designed or sold for incorporation | |
300 | into a dwelling. In determining whether a product is a consumer product, | |
301 | doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | product received by a particular user, "normally used" refers to a | |
303 | typical or common use of that class of product, regardless of the status | |
304 | of the particular user or of the way in which the particular user | |
305 | actually uses, or expects or is expected to use, the product. A product | |
306 | is a consumer product regardless of whether the product has substantial | |
307 | commercial, industrial or non-consumer uses, unless such uses represent | |
308 | the only significant mode of use of the product. | |
309 | ||
310 | "Installation Information" for a User Product means any methods, | |
311 | procedures, authorization keys, or other information required to install | |
312 | and execute modified versions of a covered work in that User Product from | |
313 | a modified version of its Corresponding Source. The information must | |
314 | suffice to ensure that the continued functioning of the modified object | |
315 | code is in no case prevented or interfered with solely because | |
316 | modification has been made. | |
317 | ||
318 | If you convey an object code work under this section in, or with, or | |
319 | specifically for use in, a User Product, and the conveying occurs as | |
320 | part of a transaction in which the right of possession and use of the | |
321 | User Product is transferred to the recipient in perpetuity or for a | |
322 | fixed term (regardless of how the transaction is characterized), the | |
323 | Corresponding Source conveyed under this section must be accompanied | |
324 | by the Installation Information. But this requirement does not apply | |
325 | if neither you nor any third party retains the ability to install | |
326 | modified object code on the User Product (for example, the work has | |
327 | been installed in ROM). | |
328 | ||
329 | The requirement to provide Installation Information does not include a | |
330 | requirement to continue to provide support service, warranty, or updates | |
331 | for a work that has been modified or installed by the recipient, or for | |
332 | the User Product in which it has been modified or installed. Access to a | |
333 | network may be denied when the modification itself materially and | |
334 | adversely affects the operation of the network or violates the rules and | |
335 | protocols for communication across the network. | |
336 | ||
337 | Corresponding Source conveyed, and Installation Information provided, | |
338 | in accord with this section must be in a format that is publicly | |
339 | documented (and with an implementation available to the public in | |
340 | source code form), and must require no special password or key for | |
341 | unpacking, reading or copying. | |
342 | ||
343 | 7. Additional Terms. | |
344 | ||
345 | "Additional permissions" are terms that supplement the terms of this | |
346 | License by making exceptions from one or more of its conditions. | |
347 | Additional permissions that are applicable to the entire Program shall | |
348 | be treated as though they were included in this License, to the extent | |
349 | that they are valid under applicable law. If additional permissions | |
350 | apply only to part of the Program, that part may be used separately | |
351 | under those permissions, but the entire Program remains governed by | |
352 | this License without regard to the additional permissions. | |
353 | ||
354 | When you convey a copy of a covered work, you may at your option | |
355 | remove any additional permissions from that copy, or from any part of | |
356 | it. (Additional permissions may be written to require their own | |
357 | removal in certain cases when you modify the work.) You may place | |
358 | additional permissions on material, added by you to a covered work, | |
359 | for which you have or can give appropriate copyright permission. | |
360 | ||
361 | Notwithstanding any other provision of this License, for material you | |
362 | add to a covered work, you may (if authorized by the copyright holders of | |
363 | that material) supplement the terms of this License with terms: | |
364 | ||
365 | a) Disclaiming warranty or limiting liability differently from the | |
366 | terms of sections 15 and 16 of this License; or | |
367 | ||
368 | b) Requiring preservation of specified reasonable legal notices or | |
369 | author attributions in that material or in the Appropriate Legal | |
370 | Notices displayed by works containing it; or | |
371 | ||
372 | c) Prohibiting misrepresentation of the origin of that material, or | |
373 | requiring that modified versions of such material be marked in | |
374 | reasonable ways as different from the original version; or | |
375 | ||
376 | d) Limiting the use for publicity purposes of names of licensors or | |
377 | authors of the material; or | |
378 | ||
379 | e) Declining to grant rights under trademark law for use of some | |
380 | trade names, trademarks, or service marks; or | |
381 | ||
382 | f) Requiring indemnification of licensors and authors of that | |
383 | material by anyone who conveys the material (or modified versions of | |
384 | it) with contractual assumptions of liability to the recipient, for | |
385 | any liability that these contractual assumptions directly impose on | |
386 | those licensors and authors. | |
387 | ||
388 | All other non-permissive additional terms are considered "further | |
389 | restrictions" within the meaning of section 10. If the Program as you | |
390 | received it, or any part of it, contains a notice stating that it is | |
391 | governed by this License along with a term that is a further | |
392 | restriction, you may remove that term. If a license document contains | |
393 | a further restriction but permits relicensing or conveying under this | |
394 | License, you may add to a covered work material governed by the terms | |
395 | of that license document, provided that the further restriction does | |
396 | not survive such relicensing or conveying. | |
397 | ||
398 | If you add terms to a covered work in accord with this section, you | |
399 | must place, in the relevant source files, a statement of the | |
400 | additional terms that apply to those files, or a notice indicating | |
401 | where to find the applicable terms. | |
402 | ||
403 | Additional terms, permissive or non-permissive, may be stated in the | |
404 | form of a separately written license, or stated as exceptions; | |
405 | the above requirements apply either way. | |
406 | ||
407 | 8. Termination. | |
408 | ||
409 | You may not propagate or modify a covered work except as expressly | |
410 | provided under this License. Any attempt otherwise to propagate or | |
411 | modify it is void, and will automatically terminate your rights under | |
412 | this License (including any patent licenses granted under the third | |
413 | paragraph of section 11). | |
414 | ||
415 | However, if you cease all violation of this License, then your | |
416 | license from a particular copyright holder is reinstated (a) | |
417 | provisionally, unless and until the copyright holder explicitly and | |
418 | finally terminates your license, and (b) permanently, if the copyright | |
419 | holder fails to notify you of the violation by some reasonable means | |
420 | prior to 60 days after the cessation. | |
421 | ||
422 | Moreover, your license from a particular copyright holder is | |
423 | reinstated permanently if the copyright holder notifies you of the | |
424 | violation by some reasonable means, this is the first time you have | |
425 | received notice of violation of this License (for any work) from that | |
426 | copyright holder, and you cure the violation prior to 30 days after | |
427 | your receipt of the notice. | |
428 | ||
429 | Termination of your rights under this section does not terminate the | |
430 | licenses of parties who have received copies or rights from you under | |
431 | this License. If your rights have been terminated and not permanently | |
432 | reinstated, you do not qualify to receive new licenses for the same | |
433 | material under section 10. | |
434 | ||
435 | 9. Acceptance Not Required for Having Copies. | |
436 | ||
437 | You are not required to accept this License in order to receive or | |
438 | run a copy of the Program. Ancillary propagation of a covered work | |
439 | occurring solely as a consequence of using peer-to-peer transmission | |
440 | to receive a copy likewise does not require acceptance. However, | |
441 | nothing other than this License grants you permission to propagate or | |
442 | modify any covered work. These actions infringe copyright if you do | |
443 | not accept this License. Therefore, by modifying or propagating a | |
444 | covered work, you indicate your acceptance of this License to do so. | |
445 | ||
446 | 10. Automatic Licensing of Downstream Recipients. | |
447 | ||
448 | Each time you convey a covered work, the recipient automatically | |
449 | receives a license from the original licensors, to run, modify and | |
450 | propagate that work, subject to this License. You are not responsible | |
451 | for enforcing compliance by third parties with this License. | |
452 | ||
453 | An "entity transaction" is a transaction transferring control of an | |
454 | organization, or substantially all assets of one, or subdividing an | |
455 | organization, or merging organizations. If propagation of a covered | |
456 | work results from an entity transaction, each party to that | |
457 | transaction who receives a copy of the work also receives whatever | |
458 | licenses to the work the party's predecessor in interest had or could | |
459 | give under the previous paragraph, plus a right to possession of the | |
460 | Corresponding Source of the work from the predecessor in interest, if | |
461 | the predecessor has it or can get it with reasonable efforts. | |
462 | ||
463 | You may not impose any further restrictions on the exercise of the | |
464 | rights granted or affirmed under this License. For example, you may | |
465 | not impose a license fee, royalty, or other charge for exercise of | |
466 | rights granted under this License, and you may not initiate litigation | |
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | any patent claim is infringed by making, using, selling, offering for | |
469 | sale, or importing the Program or any portion of it. | |
470 | ||
471 | 11. Patents. | |
472 | ||
473 | A "contributor" is a copyright holder who authorizes use under this | |
474 | License of the Program or a work on which the Program is based. The | |
475 | work thus licensed is called the contributor's "contributor version". | |
476 | ||
477 | A contributor's "essential patent claims" are all patent claims | |
478 | owned or controlled by the contributor, whether already acquired or | |
479 | hereafter acquired, that would be infringed by some manner, permitted | |
480 | by this License, of making, using, or selling its contributor version, | |
481 | but do not include claims that would be infringed only as a | |
482 | consequence of further modification of the contributor version. For | |
483 | purposes of this definition, "control" includes the right to grant | |
484 | patent sublicenses in a manner consistent with the requirements of | |
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
485 | 194 | this License. |
486 | 195 | |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | patent license under the contributor's essential patent claims, to | |
489 | make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | propagate the contents of its contributor version. | |
491 | ||
492 | In the following three paragraphs, a "patent license" is any express | |
493 | agreement or commitment, however denominated, not to enforce a patent | |
494 | (such as an express permission to practice a patent or covenant not to | |
495 | sue for patent infringement). To "grant" such a patent license to a | |
496 | party means to make such an agreement or commitment not to enforce a | |
497 | patent against the party. | |
498 | ||
499 | If you convey a covered work, knowingly relying on a patent license, | |
500 | and the Corresponding Source of the work is not available for anyone | |
501 | to copy, free of charge and under the terms of this License, through a | |
502 | publicly available network server or other readily accessible means, | |
503 | then you must either (1) cause the Corresponding Source to be so | |
504 | available, or (2) arrange to deprive yourself of the benefit of the | |
505 | patent license for this particular work, or (3) arrange, in a manner | |
506 | consistent with the requirements of this License, to extend the patent | |
507 | license to downstream recipients. "Knowingly relying" means you have | |
508 | actual knowledge that, but for the patent license, your conveying the | |
509 | covered work in a country, or your recipient's use of the covered work | |
510 | in a country, would infringe one or more identifiable patents in that | |
511 | country that you have reason to believe are valid. | |
512 | ||
513 | If, pursuant to or in connection with a single transaction or | |
514 | arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | covered work, and grant a patent license to some of the parties | |
516 | receiving the covered work authorizing them to use, propagate, modify | |
517 | or convey a specific copy of the covered work, then the patent license | |
518 | you grant is automatically extended to all recipients of the covered | |
519 | work and works based on it. | |
520 | ||
521 | A patent license is "discriminatory" if it does not include within | |
522 | the scope of its coverage, prohibits the exercise of, or is | |
523 | conditioned on the non-exercise of one or more of the rights that are | |
524 | specifically granted under this License. You may not convey a covered | |
525 | work if you are a party to an arrangement with a third party that is | |
526 | in the business of distributing software, under which you make payment | |
527 | to the third party based on the extent of your activity of conveying | |
528 | the work, and under which the third party grants, to any of the | |
529 | parties who would receive the covered work from you, a discriminatory | |
530 | patent license (a) in connection with copies of the covered work | |
531 | conveyed by you (or copies made from those copies), or (b) primarily | |
532 | for and in connection with specific products or compilations that | |
533 | contain the covered work, unless you entered into that arrangement, | |
534 | or that patent license was granted, prior to 28 March 2007. | |
535 | ||
536 | Nothing in this License shall be construed as excluding or limiting | |
537 | any implied license or other defenses to infringement that may | |
538 | otherwise be available to you under applicable patent law. | |
539 | ||
540 | 12. No Surrender of Others' Freedom. | |
541 | ||
542 | If conditions are imposed on you (whether by court order, agreement or | |
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
543 | 199 | otherwise) that contradict the conditions of this License, they do not |
544 | excuse you from the conditions of this License. If you cannot convey a | |
545 | covered work so as to satisfy simultaneously your obligations under this | |
546 | License and any other pertinent obligations, then as a consequence you may | |
547 | not convey it at all. For example, if you agree to terms that obligate you | |
548 | to collect a royalty for further conveying from those to whom you convey | |
549 | the Program, the only way you could satisfy both those terms and this | |
550 | License would be to refrain entirely from conveying the Program. | |
551 | ||
552 | 13. Use with the GNU Affero General Public License. | |
553 | ||
554 | Notwithstanding any other provision of this License, you have | |
555 | permission to link or combine any covered work with a work licensed | |
556 | under version 3 of the GNU Affero General Public License into a single | |
557 | combined work, and to convey the resulting work. The terms of this | |
558 | License will continue to apply to the part which is the covered work, | |
559 | but the special requirements of the GNU Affero General Public License, | |
560 | section 13, concerning interaction through a network will apply to the | |
561 | combination as such. | |
562 | ||
563 | 14. Revised Versions of this License. | |
564 | ||
565 | The Free Software Foundation may publish revised and/or new versions of | |
566 | the GNU General Public License from time to time. Such new versions will | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
567 | 238 | be similar in spirit to the present version, but may differ in detail to |
568 | 239 | address new problems or concerns. |
569 | 240 | |
570 | Each version is given a distinguishing version number. If the | |
571 | Program specifies that a certain numbered version of the GNU General | |
572 | Public License "or any later version" applies to it, you have the | |
573 | option of following the terms and conditions either of that numbered | |
574 | version or of any later version published by the Free Software | |
575 | Foundation. If the Program does not specify a version number of the | |
576 | GNU General Public License, you may choose any version ever published | |
577 | by the Free Software Foundation. | |
578 | ||
579 | If the Program specifies that a proxy can decide which future | |
580 | versions of the GNU General Public License can be used, that proxy's | |
581 | public statement of acceptance of a version permanently authorizes you | |
582 | to choose that version for the Program. | |
583 | ||
584 | Later license versions may give you additional or different | |
585 | permissions. However, no additional obligations are imposed on any | |
586 | author or copyright holder as a result of your choosing to follow a | |
587 | later version. | |
588 | ||
589 | 15. Disclaimer of Warranty. | |
590 | ||
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | ||
600 | 16. Limitation of Liability. | |
601 | ||
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | SUCH DAMAGES. | |
611 | ||
612 | 17. Interpretation of Sections 15 and 16. | |
613 | ||
614 | If the disclaimer of warranty and limitation of liability provided | |
615 | above cannot be given local legal effect according to their terms, | |
616 | reviewing courts shall apply local law that most closely approximates | |
617 | an absolute waiver of all civil liability in connection with the | |
618 | Program, unless a warranty or assumption of liability accompanies a | |
619 | copy of the Program in return for a fee. | |
620 | ||
621 | END OF TERMS AND CONDITIONS | |
622 | ||
623 | How to Apply These Terms to Your New Programs | |
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
624 | 282 | |
625 | 283 | If you develop a new program, and you want it to be of the greatest |
626 | 284 | possible use to the public, the best way to achieve this is to make it |
628 | 286 | |
629 | 287 | To do so, attach the following notices to the program. It is safest |
630 | 288 | to attach them to the start of each source file to most effectively |
631 | state the exclusion of warranty; and each file should have at least | |
289 | convey the exclusion of warranty; and each file should have at least | |
632 | 290 | the "copyright" line and a pointer to where the full notice is found. |
633 | 291 | |
634 | 292 | <one line to give the program's name and a brief idea of what it does.> |
635 | 293 | Copyright (C) <year> <name of author> |
636 | 294 | |
637 | This program is free software: you can redistribute it and/or modify | |
295 | This program is free software; you can redistribute it and/or modify | |
638 | 296 | it under the terms of the GNU General Public License as published by |
639 | the Free Software Foundation, either version 3 of the License, or | |
297 | the Free Software Foundation; either version 2 of the License, or | |
640 | 298 | (at your option) any later version. |
641 | 299 | |
642 | 300 | This program is distributed in the hope that it will be useful, |
644 | 302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
645 | 303 | GNU General Public License for more details. |
646 | 304 | |
647 | You should have received a copy of the GNU General Public License | |
648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
305 | You should have received a copy of the GNU General Public License along | |
306 | with this program; if not, write to the Free Software Foundation, Inc., | |
307 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
649 | 308 | |
650 | 309 | Also add information on how to contact you by electronic and paper mail. |
651 | 310 | |
652 | If the program does terminal interaction, make it output a short | |
653 | notice like this when it starts in an interactive mode: | |
654 | ||
655 | <program> Copyright (C) <year> <name of author> | |
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
311 | If the program is interactive, make it output a short notice like this | |
312 | when it starts in an interactive mode: | |
313 | ||
314 | Gnomovision version 69, Copyright (C) year name of author | |
315 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | 316 | This is free software, and you are welcome to redistribute it |
658 | 317 | under certain conditions; type `show c' for details. |
659 | 318 | |
660 | 319 | The hypothetical commands `show w' and `show c' should show the appropriate |
661 | parts of the General Public License. Of course, your program's commands | |
662 | might be different; for a GUI interface, you would use an "about box". | |
663 | ||
664 | You should also get your employer (if you work as a programmer) or school, | |
665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | For more information on this, and how to apply and follow the GNU GPL, see | |
667 | <http://www.gnu.org/licenses/>. | |
668 | ||
669 | The GNU General Public License does not permit incorporating your program | |
670 | into proprietary programs. If your program is a subroutine library, you | |
671 | may consider it more useful to permit linking proprietary applications with | |
672 | the library. If this is what you want to do, use the GNU Lesser General | |
673 | Public License instead of this License. But first, please read | |
674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | |
675 | ||
320 | parts of the General Public License. Of course, the commands you use may | |
321 | be called something other than `show w' and `show c'; they could even be | |
322 | mouse-clicks or menu items--whatever suits your program. | |
323 | ||
324 | You should also get your employer (if you work as a programmer) or your | |
325 | school, if any, to sign a "copyright disclaimer" for the program, if | |
326 | necessary. Here is a sample; alter the names: | |
327 | ||
328 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
329 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
330 | ||
331 | <signature of Ty Coon>, 1 April 1989 | |
332 | Ty Coon, President of Vice | |
333 | ||
334 | This General Public License does not permit incorporating your program into | |
335 | proprietary programs. If your program is a subroutine library, you may | |
336 | consider it more useful to permit linking proprietary applications with the | |
337 | library. If this is what you want to do, use the GNU Lesser General | |
338 | Public License instead of this License. |
0 | 0.29 2012-06-25 | |
1 | - use GPL 2 or later, to make use of some decoders only available | |
2 | in GPL 2 version of ffmpeg | |
3 | - update to current ffmpeg api | |
4 | - output version information of libraries used | |
5 | ||
6 | 0.28 2011-07-30 | |
7 | - select resize method via commandline | |
8 | - fix 5.1 channel ordering | |
9 | - update to FFmpeg 0.7 branch | |
10 | ||
0 | 11 | 0.27 2010-06-18 |
1 | 12 | - Use Skeleton 4.0 by default (including index), |
2 | 13 | can be disabled with --skeleton-3 or --no-skeleton |
2 | 2 | you need |
3 | 3 | - scons (http://www.scons.org/) |
4 | 4 | - the latest version of libtheora <http://downloads.xiph.org/releases/theora/> |
5 | - ffmpeg svn <http://ffmpeg.sf.net> by running ./get_ffmpeg_svn.sh | |
5 | - ffmpeg git <http://ffmpeg.org> by running ./get_ffmpeg.sh | |
6 | 6 | (this script downloads ffmpeg and runs configure and compiles ffmpeg) |
7 | 7 | - for subtitles support, libkate <http://code.google.com/p/libkate/>, |
8 | 8 | or by running ./get_libkate.sh (this script downloads libkate, and |
0 | 0 | # SCons build specification |
1 | # vi:si:et:sw=2:sts=2:ts=2 | |
1 | 2 | from glob import glob |
2 | 3 | import os |
3 | 4 | |
4 | 5 | import SCons |
5 | 6 | |
6 | def svnversion(): | |
7 | f = os.popen("svnversion") | |
7 | def version(): | |
8 | f = os.popen("./version.sh") | |
8 | 9 | version = f.read().strip() |
9 | 10 | f.close() |
10 | 11 | return version |
11 | 12 | |
12 | pkg_version="0.27" | |
13 | #pkg_version +="+svn" + svnversion() | |
13 | pkg_version="0.29" | |
14 | 14 | |
15 | 15 | pkg_name="ffmpeg2theora" |
16 | 16 | |
17 | scons_version=(0,97,0) | |
18 | #this is needed to make scons -h work, so not checking for it right now | |
19 | #(i.e. ubuntu hardy only ships with 0.97..) | |
20 | #scons_version=(0,98,0) | |
17 | scons_version=(1,2,0) | |
21 | 18 | |
22 | 19 | try: |
23 | 20 | EnsureSConsVersion(*scons_version) |
25 | 22 | print 'SCons %d.%d.%d or greater is required, but you have an older version' % scons_version |
26 | 23 | Exit(2) |
27 | 24 | |
28 | opts = Options() | |
29 | opts.AddOptions( | |
30 | BoolOption('static', 'Set to 1 for static linking', 0), | |
31 | BoolOption('debug', 'Set to 1 to enable debugging', 0), | |
25 | opts = Variables() | |
26 | opts.AddVariables( | |
27 | BoolVariable('static', 'Set to 1 for static linking', 0), | |
28 | BoolVariable('debug', 'Set to 1 to enable debugging', 0), | |
29 | BoolVariable('build_ffmpeg', 'Set to 1 to build local copy of ffmpeg', 0), | |
32 | 30 | ('prefix', 'install files in', '/usr/local'), |
33 | 31 | ('bindir', 'user executables', 'PREFIX/bin'), |
34 | 32 | ('mandir', 'man documentation', 'PREFIX/man'), |
35 | 33 | ('destdir', 'extra install time prefix', ''), |
36 | 34 | ('APPEND_CCFLAGS', 'Additional C/C++ compiler flags'), |
37 | 35 | ('APPEND_LINKFLAGS', 'Additional linker flags'), |
38 | BoolOption('libkate', 'enable libkate support', 1), | |
39 | BoolOption('crossmingw', 'Set to 1 for crosscompile with mingw', 0) | |
36 | BoolVariable('libkate', 'enable libkate support', 1), | |
37 | BoolVariable('crossmingw', 'Set to 1 for crosscompile with mingw', 0) | |
40 | 38 | ) |
41 | 39 | env = Environment(options = opts) |
42 | 40 | Help(opts.GenerateHelpText(env)) |
72 | 70 | |
73 | 71 | if GetOption("help"): |
74 | 72 | Return() |
75 | ||
76 | env.PrependENVPath ('PATH', os.environ['PATH']) | |
77 | 73 | |
78 | 74 | def ParsePKGConfig(env, name): |
79 | 75 | if os.environ.get('PKG_CONFIG_PATH', ''): |
105 | 101 | context.Result( ret ) |
106 | 102 | return ret |
107 | 103 | |
104 | env.PrependENVPath ('PATH', os.environ['PATH']) | |
105 | ||
108 | 106 | conf = Configure(env, custom_tests = { |
109 | 107 | 'CheckPKGConfig' : CheckPKGConfig, |
110 | 108 | 'CheckPKG' : CheckPKG, |
111 | }) | |
112 | ||
113 | pkgconfig_version='0.15.0' | |
114 | if not conf.CheckPKGConfig(pkgconfig_version): | |
115 | print 'pkg-config >= %s not found.' % pkgconfig_version | |
116 | Exit(1) | |
117 | ||
118 | if not conf.CheckPKG("ogg >= 1.1"): | |
119 | print 'ogg >= 1.1 missing' | |
120 | Exit(1) | |
121 | ||
122 | if not conf.CheckPKG("vorbis"): | |
123 | print 'vorbis missing' | |
124 | Exit(1) | |
125 | ||
126 | if not conf.CheckPKG("vorbisenc"): | |
127 | print 'vorbisenc missing' | |
128 | Exit(1) | |
129 | ||
130 | if not conf.CheckPKG("theoraenc >= 1.1.0"): | |
131 | print 'theoraenc >= 1.1.0 missing' | |
132 | Exit(1) | |
133 | ||
134 | XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoraenc >= 1.1.0" | |
135 | ||
136 | if not conf.CheckPKG(XIPH_LIBS): | |
137 | print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS | |
138 | Exit(1) | |
139 | ParsePKGConfig(env, XIPH_LIBS) | |
140 | ||
141 | FFMPEG_LIBS=["libavcodec >= 52.30.0", "libavdevice", "libavformat", "libpostproc", "libswscale"] | |
142 | if os.path.exists("./ffmpeg"): | |
143 | os.environ['PKG_CONFIG_PATH'] = "./ffmpeg/libavutil:./ffmpeg/libavformat:./ffmpeg/libavcodec:./ffmpeg/libavdevice:./ffmpeg/libswscale:./ffmpeg/libpostproc:" + os.environ.get('PKG_CONFIG_PATH', '') | |
144 | if not conf.CheckPKG(' '.join(FFMPEG_LIBS)): | |
145 | print """ | |
146 | Could not find %s. | |
147 | You can install it via | |
148 | sudo apt-get install %s | |
149 | or update PKG_CONFIG_PATH to point to ffmpeg's source folder | |
150 | or run ./get_ffmpeg_svn.sh (for more information see INSTALL) | |
151 | """ %(" ".join(FFMPEG_LIBS), " ".join(["%s-dev"%l.split()[0] for l in FFMPEG_LIBS])) | |
152 | Exit(1) | |
153 | ||
154 | for lib in FFMPEG_LIBS: | |
155 | ParsePKGConfig(env, lib) | |
156 | ||
157 | if conf.CheckCHeader('libavformat/framehook.h'): | |
109 | }) | |
110 | ||
111 | if env["build_ffmpeg"]: | |
112 | if env.GetOption('clean'): | |
113 | TryAction("cd ffmpeg;make distclean") | |
114 | else: | |
115 | TryAction("./build_ffmpeg.sh") | |
116 | ||
117 | if not env.GetOption('clean'): | |
118 | pkgconfig_version='0.15.0' | |
119 | if not conf.CheckPKGConfig(pkgconfig_version): | |
120 | print 'pkg-config >= %s not found.' % pkgconfig_version | |
121 | Exit(1) | |
122 | ||
123 | if not conf.CheckPKG("ogg >= 1.1"): | |
124 | print 'ogg >= 1.1 missing' | |
125 | Exit(1) | |
126 | ||
127 | if not conf.CheckPKG("vorbis"): | |
128 | print 'vorbis missing' | |
129 | Exit(1) | |
130 | ||
131 | if not conf.CheckPKG("vorbisenc"): | |
132 | print 'vorbisenc missing' | |
133 | Exit(1) | |
134 | ||
135 | if not conf.CheckPKG("theoraenc >= 1.1.0"): | |
136 | print 'theoraenc >= 1.1.0 missing' | |
137 | Exit(1) | |
138 | ||
139 | XIPH_LIBS="ogg >= 1.1 vorbis vorbisenc theoraenc >= 1.1.0" | |
140 | ||
141 | if not conf.CheckPKG(XIPH_LIBS): | |
142 | print 'some xiph libs are missing, ffmpeg2theora depends on %s' % XIPH_LIBS | |
143 | Exit(1) | |
144 | ParsePKGConfig(env, XIPH_LIBS) | |
145 | ||
146 | FFMPEG_LIBS=[ | |
147 | "libavdevice", | |
148 | "libavformat", | |
149 | "libavfilter", | |
150 | "libavcodec >= 52.30.0", | |
151 | "libpostproc", | |
152 | "libswscale", | |
153 | "libswresample", | |
154 | "libavutil", | |
155 | ] | |
156 | if os.path.exists("./ffmpeg"): | |
157 | pkg_path = list(set(map(os.path.dirname, glob('./ffmpeg/*/*.pc')))) | |
158 | pkg_path.append(os.environ.get('PKG_CONFIG_PATH', '')) | |
159 | os.environ['PKG_CONFIG_PATH'] = ':'.join(pkg_path) | |
158 | 160 | env.Append(CCFLAGS=[ |
159 | '-DHAVE_FRAMEHOOK' | |
161 | '-Iffmpeg' | |
160 | 162 | ]) |
161 | 163 | |
162 | KATE_LIBS="oggkate" | |
163 | if env['libkate']: | |
164 | if os.path.exists("./libkate/misc/pkgconfig"): | |
165 | os.environ['PKG_CONFIG_PATH'] = "./libkate/misc/pkgconfig:" + os.environ.get('PKG_CONFIG_PATH', '') | |
166 | if os.path.exists("./libkate/pkg/pkgconfig"): | |
167 | os.environ['PKG_CONFIG_PATH'] = "./libkate/pkg/pkgconfig:" + os.environ.get('PKG_CONFIG_PATH', '') | |
168 | if conf.CheckPKG(KATE_LIBS): | |
169 | ParsePKGConfig(env, KATE_LIBS) | |
170 | env.Append(CCFLAGS=['-DHAVE_KATE', '-DHAVE_OGGKATE']) | |
171 | else: | |
164 | if not conf.CheckPKG(' '.join(FFMPEG_LIBS)): | |
172 | 165 | print """ |
173 | Could not find libkate. Subtitles support will be disabled. | |
174 | You can also run ./get_libkate.sh (for more information see INSTALL) | |
175 | or update PKG_CONFIG_PATH to point to libkate's source folder | |
176 | """ | |
177 | ||
178 | if conf.CheckCHeader('iconv.h'): | |
179 | env.Append(CCFLAGS=[ | |
180 | '-DHAVE_ICONV' | |
181 | ]) | |
182 | if conf.CheckLib('iconv'): | |
183 | env.Append(LIBS=['iconv']) | |
184 | ||
185 | if env['static']: | |
186 | env.Append(LIBS=['m', 'dl']) | |
166 | Could not find %s. | |
167 | You can install it via | |
168 | sudo apt-get install %s | |
169 | or update PKG_CONFIG_PATH to point to ffmpeg's source folder | |
170 | or run ./get_ffmpeg.sh (for more information see INSTALL) | |
171 | """ %(" ".join(FFMPEG_LIBS), " ".join(["%s-dev"%l.split()[0] for l in FFMPEG_LIBS])) | |
172 | Exit(1) | |
173 | ||
174 | for lib in FFMPEG_LIBS: | |
175 | ParsePKGConfig(env, lib) | |
176 | ||
177 | if conf.CheckCHeader('libavformat/framehook.h'): | |
178 | env.Append(CCFLAGS=[ | |
179 | '-DHAVE_FRAMEHOOK' | |
180 | ]) | |
181 | ||
182 | KATE_LIBS="oggkate" | |
183 | if env['libkate']: | |
184 | if os.path.exists("./libkate/misc/pkgconfig"): | |
185 | os.environ['PKG_CONFIG_PATH'] = "./libkate/misc/pkgconfig:" + os.environ.get('PKG_CONFIG_PATH', '') | |
186 | if os.path.exists("./libkate/pkg/pkgconfig"): | |
187 | os.environ['PKG_CONFIG_PATH'] = "./libkate/pkg/pkgconfig:" + os.environ.get('PKG_CONFIG_PATH', '') | |
188 | if conf.CheckPKG(KATE_LIBS): | |
189 | ParsePKGConfig(env, KATE_LIBS) | |
190 | env.Append(CCFLAGS=['-DHAVE_KATE', '-DHAVE_OGGKATE']) | |
191 | else: | |
192 | print """ | |
193 | Could not find libkate. Subtitles support will be disabled. | |
194 | You can also run ./get_libkate.sh (for more information see INSTALL) | |
195 | or update PKG_CONFIG_PATH to point to libkate's source folder | |
196 | """ | |
197 | ||
198 | if conf.CheckCHeader('iconv.h'): | |
199 | env.Append(CCFLAGS=[ | |
200 | '-DHAVE_ICONV' | |
201 | ]) | |
202 | if conf.CheckLib('iconv'): | |
203 | env.Append(LIBS=['iconv']) | |
204 | ||
205 | if env['crossmingw']: | |
206 | env.Append(CCFLAGS=['-Wl,-subsystem,windows']) | |
207 | env.Append(LIBS=['m']) | |
208 | elif env['static']: | |
209 | env.Append(LIBS=['m', 'dl']) | |
210 | ||
187 | 211 | |
188 | 212 | env = conf.Finish() |
189 | 213 | |
195 | 219 | ffmpeg2theora.Install(bin_dir, 'ffmpeg2theora') |
196 | 220 | ffmpeg2theora.Install(man_dir + "/man1", 'ffmpeg2theora.1') |
197 | 221 | ffmpeg2theora.Alias('install', prefix) |
198 |
0 | #!/bin/sh | |
1 | . ./ffmpegrev | |
2 | ||
3 | ||
4 | common="--enable-gpl --enable-postproc --disable-muxers --disable-encoders --enable-libvorbis" | |
5 | common="$common --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-doc" | |
6 | ||
7 | #optional, if you have those libs installed(requires GPL3): | |
8 | #extra="$extra --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb" | |
9 | ||
10 | #apt-get install liba52-dev libgsm1-dev | |
11 | #extra="$extra --enable-libgsm" | |
12 | ||
13 | #optional, if you have libvpx installed: | |
14 | #extra="$extra --enable-libvpx" | |
15 | ||
16 | #linux | |
17 | options="$common --enable-pthreads $extra" | |
18 | ||
19 | #mingw32 | |
20 | uname | grep MINGW && options="$common --enable-memalign-hack --enable-mingw32 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib $extra" | |
21 | ||
22 | #configure and build ffmpeg | |
23 | cd $FFMPEG_CO_DIR && ./configure $options && make | |
24 |
0 | Source: ffmpeg2theora | |
1 | Section: video | |
2 | Priority: optional | |
3 | Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org> | |
4 | Uploaders: Tiago Bortoletto Vaz <tiago@debian.org>, RISKO Gergely <risko@debian.org> | |
5 | DM-Upload-Allowed: yes | |
6 | Build-Depends: quilt, debhelper (>= 7.0.50~), libavcodec-dev (>= 4:0.6), libavutil-dev, libpostproc-dev (>= 4:0.6), | |
7 | libswscale-dev (>= 4:0.6), libavformat-dev (>= 4:0.6), libavdevice-dev (>= 4:0.6), libogg-dev, libvorbis-dev, | |
8 | libtheora-dev, scons, pkg-config, libkate-dev, liboggkate-dev | |
9 | Standards-Version: 3.9.2 | |
10 | Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/ffmpeg2theora.git | |
11 | Vcs-Git: git://git.debian.org/git/pkg-multimedia/ffmpeg2theora.git | |
12 | Homepage: http://v2v.cc/~j/ffmpeg2theora/ | |
13 | ||
14 | Package: ffmpeg2theora | |
15 | Architecture: any | |
16 | Depends: ${shlibs:Depends}, ${misc:Depends} | |
17 | Description: Theora video encoder using ffmpeg | |
18 | This package provides a command-line tool to encode/recode various | |
19 | video formats (basically everything that ffmpeg can read) into Theora, | |
20 | the free video codec. |
0 | This package was debianized by RISKO Gergely <risko@debian.org> on | |
1 | Thu, 09 Jun 2005 15:55:02 +0200. | |
2 | ||
3 | It was downloaded from http://www.v2v.cc/~j/ffmpeg2theora/index.html | |
4 | ||
5 | Upstream Author: jan gerber <j@v2v.cc> | |
6 | ||
7 | Copyright as mentioned in ffmpeg2theora.c source file: | |
8 | /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */ | |
9 | /* | |
10 | * ffmpeg2theora.c -- Convert ffmpeg supported a/v files to Ogg Theora | |
11 | * Copyright (C) 2003-2004 <j@v2v.cc> | |
12 | * | |
13 | * This program is free software; you can redistribute it and/or modify | |
14 | * it under the terms of the GNU General Public License as published by | |
15 | * the Free Software Foundation; either version 2 of the License, or | |
16 | * (at your option) any later version. | |
17 | * | |
18 | * This program is distributed in the hope that it will be useful, | |
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | * GNU General Public License for more details. | |
22 | * | |
23 | * You should have received a copy of the GNU General Public License | |
24 | * along with this program; if not, write to the Free Software Foundation, | |
25 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
26 | * | |
27 | */ | |
28 | ||
29 | You can find the mentioned GNU General Public License (GPL) (on a | |
30 | Debian system) in the file /usr/share/common-licenses/GPL. |
0 | diff -pruN 0.27-1.1/src/avinfo.c 0.27-1.1ubuntu1/src/avinfo.c | |
1 | --- 0.27-1.1/src/avinfo.c 2010-06-23 01:07:49.000000000 +0100 | |
2 | +++ 0.27-1.1ubuntu1/src/avinfo.c 2011-07-14 09:06:37.000000000 +0100 | |
3 | @@ -196,7 +196,7 @@ void json_codec_info(FILE *output, AVCod | |
4 | } | |
5 | ||
6 | switch(enc->codec_type) { | |
7 | - case CODEC_TYPE_VIDEO: | |
8 | + case AVMEDIA_TYPE_VIDEO: | |
9 | codec_name = fix_codec_name(codec_name); | |
10 | json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent); | |
11 | if (enc->pix_fmt != PIX_FMT_NONE) { | |
12 | @@ -224,7 +224,7 @@ void json_codec_info(FILE *output, AVCod | |
13 | json_add_key_value(output, "bitrate", &t, JSON_FLOAT, 0, indent); | |
14 | } | |
15 | break; | |
16 | - case CODEC_TYPE_AUDIO: | |
17 | + case AVMEDIA_TYPE_AUDIO: | |
18 | codec_name = fix_codec_name(codec_name); | |
19 | json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent); | |
20 | if (enc->sample_rate) { | |
21 | @@ -277,15 +277,15 @@ void json_codec_info(FILE *output, AVCod | |
22 | } | |
23 | break; | |
24 | /* | |
25 | - case CODEC_TYPE_DATA: | |
26 | + case AVMEDIA_TYPE_DATA: | |
27 | fprintf(output, "datacodec: %s\n", codec_name); | |
28 | bitrate = enc->bit_rate; | |
29 | break; | |
30 | - case CODEC_TYPE_SUBTITLE: | |
31 | + case AVMEDIA_TYPE_SUBTITLE: | |
32 | fprintf(output, "subtitle: %s\n", codec_name); | |
33 | bitrate = enc->bit_rate; | |
34 | break; | |
35 | - case CODEC_TYPE_ATTACHMENT: | |
36 | + case AVMEDIA_TYPE_ATTACHMENT: | |
37 | fprintf(output, "attachment: : %s\n", codec_name); | |
38 | bitrate = enc->bit_rate; | |
39 | break; | |
40 | @@ -330,7 +330,7 @@ static void json_stream_format(FILE *out | |
41 | display_aspect_ratio.num, display_aspect_ratio.den); | |
42 | json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent + 1); | |
43 | } | |
44 | - if(st->codec->codec_type == CODEC_TYPE_VIDEO){ | |
45 | + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ | |
46 | if (st->time_base.den && st->time_base.num && av_q2d(st->time_base) > 0.001) { | |
47 | snprintf(buf1, sizeof(buf1), "%d:%d", | |
48 | st->time_base.den, st->time_base.num); | |
49 | @@ -340,6 +340,20 @@ static void json_stream_format(FILE *out | |
50 | st->r_frame_rate.num, st->r_frame_rate.den); | |
51 | json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1); | |
52 | } | |
53 | + if (st->sample_aspect_ratio.num && // default | |
54 | + av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { | |
55 | + AVRational display_aspect_ratio; | |
56 | + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, | |
57 | + st->codec->width*st->sample_aspect_ratio.num, | |
58 | + st->codec->height*st->sample_aspect_ratio.den, | |
59 | + 1024*1024); | |
60 | + snprintf(buf1, sizeof(buf1), "%d:%d", | |
61 | + st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); | |
62 | + json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent+1); | |
63 | + snprintf(buf1, sizeof(buf1), "%d:%d", | |
64 | + display_aspect_ratio.num, display_aspect_ratio.den); | |
65 | + json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent+1); | |
66 | + } | |
67 | } | |
68 | json_add_key_value(output, "id", &i, JSON_INT, 1, indent + 1); | |
69 | do_indent(output, indent-1); | |
70 | @@ -484,11 +498,11 @@ void json_format_info(FILE* output, AVFo | |
71 | int j, k; | |
72 | for(j=0; j<ic->nb_programs; j++) { | |
73 | for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) | |
74 | - json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_VIDEO); | |
75 | + json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_VIDEO); | |
76 | } | |
77 | } else { | |
78 | for(i=0;i<ic->nb_streams;i++) { | |
79 | - json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_VIDEO); | |
80 | + json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_VIDEO); | |
81 | } | |
82 | } | |
83 | fprintf(output, "],\n"); | |
84 | @@ -499,11 +513,11 @@ void json_format_info(FILE* output, AVFo | |
85 | int j, k; | |
86 | for(j=0; j<ic->nb_programs; j++) { | |
87 | for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) | |
88 | - json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_AUDIO); | |
89 | + json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_AUDIO); | |
90 | } | |
91 | } else { | |
92 | for(i=0;i<ic->nb_streams;i++) { | |
93 | - json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_AUDIO); | |
94 | + json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_AUDIO); | |
95 | } | |
96 | } | |
97 | fprintf(output, "],\n"); | |
98 | diff -pruN 0.27-1.1/src/ffmpeg2theora.c 0.27-1.1ubuntu1/src/ffmpeg2theora.c | |
99 | --- 0.27-1.1/src/ffmpeg2theora.c 2010-06-23 01:07:49.000000000 +0100 | |
100 | +++ 0.27-1.1ubuntu1/src/ffmpeg2theora.c 2011-07-14 09:06:37.000000000 +0100 | |
101 | @@ -341,7 +341,7 @@ static void prepare_ycbcr_buffer(ff2theo | |
102 | static const char *find_category_for_subtitle_stream (ff2theora this, int idx, int included_subtitles) | |
103 | { | |
104 | AVCodecContext *enc = this->context->streams[idx]->codec; | |
105 | - if (enc->codec_type != CODEC_TYPE_SUBTITLE) return 0; | |
106 | + if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0; | |
107 | switch (enc->codec_id) { | |
108 | case CODEC_ID_TEXT: | |
109 | case CODEC_ID_SSA: | |
110 | @@ -500,9 +500,11 @@ static void extra_info_from_ssa(AVPacket | |
111 | ||
112 | static const char *find_language_for_subtitle_stream(const AVStream *s) | |
113 | { | |
114 | - const char *lang=find_iso639_1(s->language); | |
115 | + AVMetadataTag *language = av_metadata_get(s->metadata, "language", NULL, 0); | |
116 | + const char *lang=find_iso639_1(language->value); | |
117 | if (!lang) { | |
118 | - fprintf(stderr,"WARNING - unrecognized ISO 639-2 language code: %s\n",s->language); | |
119 | + fprintf(stderr, "WARNING - unrecognized ISO 639-2 language code: %s\n", | |
120 | + language->value); | |
121 | } | |
122 | return lang; | |
123 | } | |
124 | @@ -516,8 +518,8 @@ void ff2theora_output(ff2theora this) { | |
125 | AVStream *vstream = NULL; | |
126 | AVCodec *acodec = NULL; | |
127 | AVCodec *vcodec = NULL; | |
128 | - pp_mode_t *ppMode = NULL; | |
129 | - pp_context_t *ppContext = NULL; | |
130 | + pp_mode *ppMode = NULL; | |
131 | + pp_context *ppContext = NULL; | |
132 | int sws_flags; | |
133 | float frame_aspect = 0; | |
134 | double fps = 0.0; | |
135 | @@ -530,7 +532,7 @@ void ff2theora_output(ff2theora this) { | |
136 | ||
137 | if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) { | |
138 | AVCodecContext *enc = this->context->streams[this->audiostream]->codec; | |
139 | - if (enc->codec_type == CODEC_TYPE_AUDIO) { | |
140 | + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { | |
141 | this->audio_index = this->audiostream; | |
142 | fprintf(stderr, " Using stream #0.%d as audio input\n",this->audio_index); | |
143 | } | |
144 | @@ -540,7 +542,7 @@ void ff2theora_output(ff2theora this) { | |
145 | } | |
146 | if (this->videostream >= 0 && this->context->nb_streams > this->videostream) { | |
147 | AVCodecContext *enc = this->context->streams[this->videostream]->codec; | |
148 | - if (enc->codec_type == CODEC_TYPE_VIDEO) { | |
149 | + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { | |
150 | this->video_index = this->videostream; | |
151 | fprintf(stderr, " Using stream #0.%d as video input\n",this->video_index); | |
152 | } | |
153 | @@ -552,11 +554,11 @@ void ff2theora_output(ff2theora this) { | |
154 | for (i = 0; i < this->context->nb_streams; i++) { | |
155 | AVCodecContext *enc = this->context->streams[i]->codec; | |
156 | switch (enc->codec_type) { | |
157 | - case CODEC_TYPE_VIDEO: | |
158 | + case AVMEDIA_TYPE_VIDEO: | |
159 | if (this->video_index < 0 && !this->disable_video) | |
160 | this->video_index = i; | |
161 | break; | |
162 | - case CODEC_TYPE_AUDIO: | |
163 | + case AVMEDIA_TYPE_AUDIO: | |
164 | if (this->audio_index < 0 && !this->disable_audio) | |
165 | this->audio_index = i; | |
166 | break; | |
167 | @@ -980,7 +982,7 @@ void ff2theora_output(ff2theora this) { | |
168 | AVStream *stream = this->context->streams[i]; | |
169 | AVCodecContext *enc = stream->codec; | |
170 | const char *category; | |
171 | - if (enc->codec_type == CODEC_TYPE_SUBTITLE) { | |
172 | + if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { | |
173 | AVCodec *codec = avcodec_find_decoder (enc->codec_id); | |
174 | if (codec && avcodec_open (enc, codec) >= 0) { | |
175 | subtitles_opened[i] = 1; | |
176 | @@ -1451,9 +1453,11 @@ void ff2theora_output(ff2theora this) { | |
177 | } | |
178 | if (this->sws_scale_ctx) { | |
179 | sws_scale(this->sws_scale_ctx, | |
180 | - output_cropped->data, output_cropped->linesize, 0, | |
181 | - display_height - (this->frame_topBand + this->frame_bottomBand), | |
182 | - output_resized->data, output_resized->linesize); | |
183 | + output_cropped->data, | |
184 | + output_cropped->linesize, 0, | |
185 | + display_height - (this->frame_topBand + this->frame_bottomBand), | |
186 | + output_resized->data, | |
187 | + output_resized->linesize); | |
188 | } | |
189 | else{ | |
190 | output_resized = output_cropped; | |
191 | @@ -1512,7 +1516,7 @@ void ff2theora_output(ff2theora this) { | |
192 | int samples=0; | |
193 | int samples_out=0; | |
194 | int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE; | |
195 | - int bytes_per_sample = av_get_bits_per_sample_format(aenc->sample_fmt)/8; | |
196 | + int bytes_per_sample = av_get_bits_per_sample_fmt(aenc->sample_fmt)/8; | |
197 | ||
198 | if (avpkt.size > 0) { | |
199 | len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt); | |
200 | @@ -2726,8 +2730,7 @@ int main(int argc, char **argv) { | |
201 | ||
202 | for(info.passno=(info.twopass==3?1:info.twopass);info.passno<=(info.twopass==3?2:info.twopass);info.passno++){ | |
203 | //detect image sequences and set framerate if provided | |
204 | - if (av_guess_image2_codec(inputfile_name) != CODEC_ID_NONE || \ | |
205 | - (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0)) { | |
206 | + if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) { | |
207 | formatParams = ¶ms; | |
208 | memset(formatParams, 0, sizeof(*formatParams)); | |
209 | if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) { | |
210 | @@ -2748,7 +2751,6 @@ int main(int argc, char **argv) { | |
211 | formatParams->time_base.den = convert->framerate_new.num; | |
212 | formatParams->time_base.num = convert->framerate_new.den; | |
213 | } | |
214 | - formatParams->video_codec_id = av_guess_image2_codec(inputfile_name); | |
215 | } | |
216 | if (av_open_input_file(&convert->context, inputfile_name, input_fmt, 0, formatParams) >= 0) { | |
217 | if (av_find_stream_info(convert->context) >= 0) { | |
218 | @@ -2760,9 +2762,9 @@ int main(int argc, char **argv) { | |
219 | for (i = 0; i < convert->context->nb_streams; i++) { | |
220 | AVCodecContext *enc = convert->context->streams[i]->codec; | |
221 | switch (enc->codec_type) { | |
222 | - case CODEC_TYPE_VIDEO: has_video = 1; break; | |
223 | - case CODEC_TYPE_AUDIO: has_audio = 1; break; | |
224 | - case CODEC_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break; | |
225 | + case AVMEDIA_TYPE_VIDEO: has_video = 1; break; | |
226 | + case AVMEDIA_TYPE_AUDIO: has_audio = 1; break; | |
227 | + case AVMEDIA_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break; | |
228 | default: break; | |
229 | } | |
230 | } | |
231 | @@ -2828,7 +2830,7 @@ int main(int argc, char **argv) { | |
232 | ||
233 | if (!info.frontend) { | |
234 | if (info.twopass!=3 || info.passno==1) { | |
235 | - dump_format(convert->context, 0,inputfile_name, 0); | |
236 | + av_dump_format(convert->context, 0,inputfile_name, 0); | |
237 | } | |
238 | } | |
239 | if (convert->disable_audio) { |
0 | --- ffmpeg2theora-0.27.orig/Makefile | |
1 | +++ ffmpeg2theora-0.27/Makefile | |
2 | @@ -5,7 +5,7 @@ clean: | |
3 | scons -c | |
4 | ||
5 | install: | |
6 | - scons install $(PREFIX) | |
7 | + scons install destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/ffmpeg2theora/usr/share/man | |
8 | ||
9 | dist: | |
10 | svn export . ffmpeg2theora-`grep ^pkg_version= SConstruct | cut -d\" -f2` |
0 | #!/usr/bin/make -f | |
1 | ||
2 | #DEB_SCONS_OPTIONS := prefix=/usr destdir=$(DEB_DESTDIR) mandir=PREFIX/share/man | |
3 | ||
4 | #PREFIX="prefix=$(CURDIR)/debian/ffmpeg2theora/usr destdir=$(CURDIR)/debian/ffmpeg2theora mandir=$(CURDIR)/debian/usr/share/man" | |
5 | ||
6 | %: | |
7 | dh $@ --with quilt | |
8 | ||
9 | #override_dh_auto_build: | |
10 | # scons | |
11 | # | |
12 | #override_dh_auto_install: | |
13 | # PREFIX="destdir=$(CURDIR)/debian/ffmpeg2theora prefix=/usr mandir=$(CURDIR)/debian/usr/share/man"; make install | |
14 | ||
15 | override_dh_auto_clean: | |
16 | dh_auto_clean | |
17 | rm -rf .sconf_temp/ .sconsign.dblite config.log |
0 | # watch control file for uscan | |
1 | version=2 | |
2 | http://www.v2v.cc/~j/ffmpeg2theora/download.html ffmpeg2theora-([\d\.]*)\.tar\.bz2 |
88 | 88 | but it is slower and therefore is disabled by default. |
89 | 89 | .TP |
90 | 90 | .B \-\-speedlevel |
91 | encoding is faster with higher values the cost is quality and bandwidth | |
92 | 0: Slowest (best) | |
93 | 1: Enable early skip (default) | |
94 | 2: Disable motion compensation | |
91 | encoding is faster with higher values | |
92 | the cost is quality and bandwidth (default 1) | |
93 | available values depend on the version of libtheora | |
94 | check ffmpeg2theora --help for supported values. | |
95 | 95 | .TP |
96 | 96 | .B \-x, \-\-width |
97 | 97 | Scale to given width (in pixels). |
170 | 170 | Force deinterlace. Otherwise only material marked as interlaced will be |
171 | 171 | deinterlaced. |
172 | 172 | .TP |
173 | .B \-\-no-deinterlace | |
174 | Force deinterlace off. | |
175 | .TP | |
173 | 176 | .B \-\-vhook |
174 | 177 | you can use ffmpeg's vhook system, example: |
175 | 178 | ffmpeg2theora \-\-vhook '/path/watermark.so \-f wm.gif' input.dv |
308 | 311 | ffmpeg2theora frame%06d.png -o output.ogv |
309 | 312 | |
310 | 313 | Live streaming from V4L Device: |
311 | ffmpeg2theora /dev/video0 \-f video4linux \-\-inputfps 15 \-x 160 \-y 128 \\ | |
312 | \-o \- | oggfwd icast2server 8000 password /theora.ogv | |
314 | ffmpeg2theora \-\-no\-skeleton /dev/video0 \-f video4linux \\ | |
315 | \-\-inputfps 15 \-x 160 \-y 128 \\ | |
316 | \-o \- | oggfwd icast2server 8000 password /theora.ogv | |
317 | ||
313 | 318 | (you might have to use video4linux2 depending on your hardware) |
314 | 319 | |
315 | 320 | Live encoding from a DV camcorder (needs a fast machine): |
317 | 322 | |
318 | 323 | Live encoding and streaming to icecast server: |
319 | 324 | dvgrab \-\-format raw \- \\ |
320 | | ffmpeg2theora \-f dv \-x 160 \-y 128 \-o /dev/stdout \- \\ | |
321 | | oggfwd icast2server 8000 password /theora.ogv | |
325 | | ffmpeg2theora \-\-no\-skeleton \-f dv \-x 160 \-y 128 \-o /dev/stdout \- \\ | |
326 | | oggfwd icast2server 8000 password /theora.ogv | |
322 | 327 | |
323 | 328 | |
324 | 329 | .SH AUTHOR |
0 | <pkg-contents spec="1.12"><f n="ffmpeg2theora" o="root" g="wheel" p="16877" pt="/tmp/ffmpeg2theora/" m="false" t="file"><f n="usr" o="root" g="wheel" p="16877"><f n="local" o="root" g="wheel" p="16877"><f n="bin" o="root" g="wheel" p="16877"><f n="ffmpeg2theora" o="root" g="wheel" p="33261"><mod>owner</mod></f><mod>owner</mod></f><mod>owner</mod></f><mod>owner</mod></f><mod>owner</mod></f></pkg-contents>⏎ |
0 | <pkgref spec="1.12" uuid="01291888-CCA4-41A5-AAB3-BC2E3CFE6477"><config><identifier>cc.v2v.ffmpeg2theora</identifier><version>0.28</version><description/><post-install type="none"/><requireAuthorization/><installFrom mod="true">/tmp/ffmpeg2theora/</installFrom><installTo>/</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>installTo.isAbsoluteType</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod></config><contents><file-list>01ffmpeg-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass</filter></contents></pkgref>⏎ |
0 | <pkmkdoc spec="1.12"><properties><title>ffmpeg2theora</title><build>/Users/build/ffmpeg2theora-0.28.pkg</build><organization>org.xiph</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Commandline tool to encode video in Ogg Theora</description><contents><choice title="ffmpeg2theora" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="cc.v2v.ffmpeg2theora"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/><item type="file">01ffmpeg.xml</item></pkmkdoc> |
0 | 0 | FFMPEG_CO_DIR=ffmpeg |
1 | FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/branches/0.6 | |
2 | #not required fro 0.6 branch | |
3 | # Because ffmpeg checks out libswscale via an svn:externals, checking | |
4 | # out an old ffmpeg does not check out a corresponding libswscale. | |
5 | # Keep the swscale checkout manually synchronized, then. Update this | |
6 | # when you update FFMPEG_REVISION. | |
7 | #FFMPEG_REVISION=23309 | |
8 | #FFMPEG_EXTERNALS_REVISION=31211 | |
1 | FFMPEG_URL=git://git.videolan.org/ffmpeg | |
2 | #FFMPEG_REVISION=54bc6403620286f595becd01842947395020e2f4 |
0 | #!/bin/sh | |
1 | cd `dirname $0` | |
2 | ||
3 | # load FFMPEG specific properties | |
4 | . ./ffmpegrev | |
5 | ||
6 | test -e $FFMPEG_CO_DIR || git clone --depth 1 $FFMPEG_URL $FFMPEG_CO_DIR | |
7 | cd $FFMPEG_CO_DIR | |
8 | #git pull -r $FFMPEG_REVISION | |
9 | #git checkout release/0.7 | |
10 | git checkout master | |
11 | git pull | |
12 | cd .. | |
13 | ||
14 | apply_patches() { | |
15 | cd $FFMPEG_CO_DIR | |
16 | for patch in ../patches/*.patch; do | |
17 | patch -p0 < $patch | |
18 | done | |
19 | touch .ffmpeg2theora_patched | |
20 | cd .. | |
21 | } | |
22 | ||
23 | ./build_ffmpeg.sh | |
24 |
0 | #!/bin/sh | |
1 | ||
2 | common="--enable-version3 --enable-gpl --enable-postproc --disable-muxers --disable-encoders --enable-libvorbis" | |
3 | common="$common --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-doc" | |
4 | ||
5 | #optional, if you have those libs installed: | |
6 | #extra="--enable-libopencore-amrnb --enable-libopencore-amrwb" | |
7 | ||
8 | #apt-get install liba52-dev libfaad-dev libgsm1-dev | |
9 | #extra="$extra--enable-libfaad --enable-libgsm" | |
10 | ||
11 | #optional, if you have libvpx installed: | |
12 | #extra="--enable-libvpx" | |
13 | ||
14 | #linux | |
15 | options="$common --enable-pthreads $extra" | |
16 | ||
17 | #mingw32 | |
18 | uname | grep MINGW && options="$common --enable-memalign-hack --enable-mingw32 --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib $extra" | |
19 | ||
20 | # load FFMPEG specific properties | |
21 | . ./ffmpegrev | |
22 | ||
23 | #Get ffmpeg from svn | |
24 | #svn -r $FFMPEG_REVISION co $FFMPEG_SVN $FFMPEG_CO_DIR | |
25 | #svn update -r $FFMPEG_EXTERNALS_REVISION $FFMPEG_CO_DIR/libswscale | |
26 | ||
27 | #Get ffmpeg from svn 0.6 branch | |
28 | svn co $FFMPEG_SVN $FFMPEG_CO_DIR | |
29 | ||
30 | apply_patches() { | |
31 | cd ffmpeg | |
32 | for patch in ../patches/*.patch; do | |
33 | patch -p0 < $patch | |
34 | done | |
35 | touch .ffmpeg2theora_patched | |
36 | cd .. | |
37 | } | |
38 | ||
39 | test -e ffmpeg/.ffmpeg2theora_patched || apply_patches | |
40 | #configure and build ffmpeg | |
41 | cd ffmpeg && ./configure $options && make | |
42 |
0 | 0 | #!/bin/bash |
1 | 1 | |
2 | version=0.3.7 | |
2 | version=0.4.1 | |
3 | 3 | baseurl="http://libkate.googlecode.com/files/libkate-$version.tar.gz" |
4 | 4 | |
5 | 5 | which wget >& /dev/null |
0 | Index: libavcodec/resample.c | |
1 | =================================================================== | |
2 | --- libavcodec/resample.c (revision 22168) | |
3 | +++ libavcodec/resample.c (working copy) | |
4 | @@ -52,6 +52,17 @@ | |
5 | unsigned buffer_size[2]; ///< sizes of allocated buffers | |
6 | }; | |
7 | ||
8 | +/* | |
9 | +*/ | |
10 | +static short clip_short(int v) { | |
11 | + if (v < -32768) | |
12 | + v = -32768; | |
13 | + else if (v > 32767) | |
14 | + v = 32767; | |
15 | + return (short) v; | |
16 | +} | |
17 | + | |
18 | + | |
19 | /* n1: number of samples */ | |
20 | static void stereo_to_mono(short *output, short *input, int n1) | |
21 | { | |
22 | @@ -103,14 +114,43 @@ | |
23 | } | |
24 | } | |
25 | ||
26 | -/* XXX: should use more abstract 'N' channels system */ | |
27 | -static void stereo_split(short *output1, short *output2, short *input, int n) | |
28 | -{ | |
29 | +/* XXX: make this better. channels will always be >= 2. | |
30 | + - Left = front_left + rear_gain * rear_left + center_gain * center | |
31 | + - Right = front_right + rear_gain * rear_right + center_gain * center | |
32 | + where rear_gain is usually around 0.5-1.0 and center_gain is almost always 0.7 (-3 dB) if I recall correctly. */ | |
33 | +static void multi_to_stereo_split(short *output1, short *output2, short *input, int n, int channels) { | |
34 | int i; | |
35 | + short l,r; | |
36 | ||
37 | for(i=0;i<n;i++) { | |
38 | - *output1++ = *input++; | |
39 | - *output2++ = *input++; | |
40 | + if (channels == 2) { | |
41 | + /* simple stereo to stereo. Input is: l, r */ | |
42 | + l = input[0]; | |
43 | + r = input[1]; | |
44 | + } else if (channels == 6) { | |
45 | + /* 5.1 to stereo input: [fl, fr, c, lfe, rl, rr] */ | |
46 | + int fl,fr,c,rl,rr,lfe; | |
47 | + fl = input[0]; | |
48 | + fr = input[1]; | |
49 | + c = input[2]; | |
50 | + lfe = input[3]; | |
51 | + rl = input[4]; | |
52 | + rr = input[5]; | |
53 | + | |
54 | + l = clip_short(fl + (0.5 * rl) + (0.7 * c)); | |
55 | + r = clip_short(fr + (0.5 * rr) + (0.7 * c)); | |
56 | + } else { | |
57 | + /* channels must be 3-5, or >= 7. l, c, r, ? */ | |
58 | + l = input[0]; | |
59 | + r = input[2]; | |
60 | + } | |
61 | + | |
62 | + /* output l & r. */ | |
63 | + *output1++ = l; | |
64 | + *output2++ = r; | |
65 | + | |
66 | + /* increment input. */ | |
67 | + input += channels; | |
68 | } | |
69 | } | |
70 | ||
71 | @@ -150,9 +190,9 @@ | |
72 | { | |
73 | ReSampleContext *s; | |
74 | ||
75 | - if ( input_channels > 2) | |
76 | + if ((input_channels > 2) && (input_channels != 6)) | |
77 | { | |
78 | - av_log(NULL, AV_LOG_ERROR, "Resampling with input channels greater than 2 unsupported.\n"); | |
79 | + av_log(NULL, AV_LOG_ERROR, "Resampling with input channels other than 1,2, or 6 is unsupported.\n"); | |
80 | return NULL; | |
81 | } | |
82 | ||
83 | @@ -312,7 +352,7 @@ | |
84 | } else if (s->output_channels >= 2) { | |
85 | buftmp3[0] = bufout[0]; | |
86 | buftmp3[1] = bufout[1]; | |
87 | - stereo_split(buftmp2[0], buftmp2[1], input, nb_samples); | |
88 | + multi_to_stereo_split(buftmp2[0], buftmp2[1], input, nb_samples, s->input_channels); | |
89 | } else { | |
90 | buftmp3[0] = output; | |
91 | memcpy(buftmp2[0], input, nb_samples*sizeof(short)); |
0 | Index: libavformat/oggdec.c | |
1 | =================================================================== | |
2 | --- libavformat/oggdec.c (revision 19439) | |
3 | +++ libavformat/oggdec.c (working copy) | |
4 | @@ -469,6 +469,18 @@ | |
5 | ogg->size = size; | |
6 | ogg_restore (s, 0); | |
7 | ||
8 | + ogg_save (s); | |
9 | + url_fseek (s->pb, 0, SEEK_SET); | |
10 | + while (!ogg_read_page (s, &i)){ | |
11 | + if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 && | |
12 | + ogg->streams[i].codec) { | |
13 | + s->streams[i]->duration -= | |
14 | + ogg_gptopts (s, i, ogg->streams[i].granule, NULL); | |
15 | + break; | |
16 | + } | |
17 | + } | |
18 | + ogg_restore (s, 0); | |
19 | + | |
20 | return 0; | |
21 | } | |
22 |
43 | 43 | i486-mingw32msvc- |
44 | 44 | i586-mingw32msvc- |
45 | 45 | i686-mingw32msvc- |
46 | i686-w64-mingw32- | |
46 | 47 | """) |
47 | 48 | |
48 | 49 | def find(env): |
0 | 0 | /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */ |
1 | 1 | /* |
2 | 2 | * avinfo.c -- Convert ffmpeg supported a/v files to Ogg Theora / Vorbis |
3 | * Copyright (C) 2003-2009 <j@v2v.cc> | |
3 | * Copyright (C) 2003-2011 <j@v2v.cc> | |
4 | 4 | * |
5 | 5 | * gcc -o avinfo avinfo.c -DAVINFO `pkg-config --cflags --libs libavcodec libavformat` |
6 | 6 | * |
7 | 7 | * This program is free software: you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * the Free Software Foundation, either version 2 of the License, or | |
10 | 10 | * (at your option) any later version. |
11 | 11 | * |
12 | 12 | * This program is distributed in the hope that it will be useful, |
41 | 41 | #include <sys/stat.h> |
42 | 42 | |
43 | 43 | #include "libavformat/avformat.h" |
44 | #include "libavutil/pixdesc.h" | |
44 | 45 | |
45 | 46 | #ifndef WIN32 |
46 | 47 | #if !defined(off64_t) |
195 | 196 | } |
196 | 197 | |
197 | 198 | switch(enc->codec_type) { |
198 | case CODEC_TYPE_VIDEO: | |
199 | case AVMEDIA_TYPE_VIDEO: | |
199 | 200 | codec_name = fix_codec_name(codec_name); |
200 | 201 | json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent); |
201 | 202 | if (enc->pix_fmt != PIX_FMT_NONE) { |
202 | json_add_key_value(output, "pixel_format", (void *)avcodec_get_pix_fmt_name(enc->pix_fmt), JSON_STRING, 0, indent); | |
203 | json_add_key_value(output, "pixel_format", (void *)av_get_pix_fmt_name(enc->pix_fmt), JSON_STRING, 0, indent); | |
203 | 204 | } |
204 | 205 | if (enc->width) { |
205 | 206 | json_add_key_value(output, "width", &enc->width, JSON_INT, 0, indent); |
223 | 224 | json_add_key_value(output, "bitrate", &t, JSON_FLOAT, 0, indent); |
224 | 225 | } |
225 | 226 | break; |
226 | case CODEC_TYPE_AUDIO: | |
227 | case AVMEDIA_TYPE_AUDIO: | |
227 | 228 | codec_name = fix_codec_name(codec_name); |
228 | 229 | json_add_key_value(output, "codec", (void *)codec_name, JSON_STRING, 0, indent); |
229 | 230 | if (enc->sample_rate) { |
276 | 277 | } |
277 | 278 | break; |
278 | 279 | /* |
279 | case CODEC_TYPE_DATA: | |
280 | case AVMEDIA_TYPE_DATA: | |
280 | 281 | fprintf(output, "datacodec: %s\n", codec_name); |
281 | 282 | bitrate = enc->bit_rate; |
282 | 283 | break; |
283 | case CODEC_TYPE_SUBTITLE: | |
284 | case AVMEDIA_TYPE_SUBTITLE: | |
284 | 285 | fprintf(output, "subtitle: %s\n", codec_name); |
285 | 286 | bitrate = enc->bit_rate; |
286 | 287 | break; |
287 | case CODEC_TYPE_ATTACHMENT: | |
288 | case AVMEDIA_TYPE_ATTACHMENT: | |
288 | 289 | fprintf(output, "attachment: : %s\n", codec_name); |
289 | 290 | bitrate = enc->bit_rate; |
290 | 291 | break; |
315 | 316 | fprintf(output, "{\n"); |
316 | 317 | |
317 | 318 | json_codec_info(output, st->codec, indent + 1); |
318 | if (st->sample_aspect_ratio.num && // default | |
319 | av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { | |
320 | AVRational display_aspect_ratio; | |
321 | av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, | |
322 | st->codec->width*st->sample_aspect_ratio.num, | |
323 | st->codec->height*st->sample_aspect_ratio.den, | |
324 | 1024*1024); | |
325 | snprintf(buf1, sizeof(buf1), "%d:%d", | |
326 | st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); | |
327 | json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent + 1); | |
328 | snprintf(buf1, sizeof(buf1), "%d:%d", | |
329 | display_aspect_ratio.num, display_aspect_ratio.den); | |
330 | json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent + 1); | |
331 | } | |
332 | if(st->codec->codec_type == CODEC_TYPE_VIDEO){ | |
319 | if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ | |
333 | 320 | if (st->time_base.den && st->time_base.num && av_q2d(st->time_base) > 0.001) { |
334 | 321 | snprintf(buf1, sizeof(buf1), "%d:%d", |
335 | 322 | st->time_base.den, st->time_base.num); |
339 | 326 | st->r_frame_rate.num, st->r_frame_rate.den); |
340 | 327 | json_add_key_value(output, "framerate", buf1, JSON_STRING, 0, indent + 1); |
341 | 328 | } |
329 | if (st->sample_aspect_ratio.num && // default | |
330 | av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { | |
331 | AVRational display_aspect_ratio; | |
332 | av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, | |
333 | st->codec->width*st->sample_aspect_ratio.num, | |
334 | st->codec->height*st->sample_aspect_ratio.den, | |
335 | 1024*1024); | |
336 | snprintf(buf1, sizeof(buf1), "%d:%d", | |
337 | st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); | |
338 | json_add_key_value(output, "pixel_aspect_ratio", buf1, JSON_STRING, 0, indent+1); | |
339 | snprintf(buf1, sizeof(buf1), "%d:%d", | |
340 | display_aspect_ratio.num, display_aspect_ratio.den); | |
341 | json_add_key_value(output, "display_aspect_ratio", buf1, JSON_STRING, 0, indent+1); | |
342 | } | |
342 | 343 | } |
343 | 344 | json_add_key_value(output, "id", &i, JSON_INT, 1, indent + 1); |
344 | 345 | do_indent(output, indent-1); |
357 | 358 | i+=4; |
358 | 359 | continue; |
359 | 360 | } |
361 | if (s[i] < 0) goto error; | |
360 | 362 | if (s[i] < 128) { |
361 | 363 | i++; |
362 | 364 | continue; |
384 | 386 | error: |
385 | 387 | return i == n; |
386 | 388 | } |
387 | ||
388 | void json_metadata(FILE *output, const AVFormatContext *av) | |
389 | int _json_metadata(FILE *output, AVDictionary *m, int first, int indent) | |
389 | 390 | { |
390 | int first = 1, indent=2; | |
391 | AVMetadataTag *tag = NULL; | |
392 | while ((tag = av_metadata_get(av->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) { | |
391 | int i = 0; | |
392 | AVDictionaryEntry *tag = NULL; | |
393 | while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { | |
393 | 394 | if (strlen(tag->value) && utf8_validate (tag->value, strlen(tag->value))) { |
394 | 395 | if (first) { |
395 | 396 | first = 0; |
402 | 403 | } |
403 | 404 | json_add_key_value(output, tag->key, tag->value, JSON_STRING, 1, indent); |
404 | 405 | } |
406 | } | |
407 | return first; | |
408 | } | |
409 | ||
410 | void json_metadata(FILE *output, const AVFormatContext *av) | |
411 | { | |
412 | int first = 1, indent=2, i=0; | |
413 | first = _json_metadata(output, av->metadata, first, indent); | |
414 | ||
415 | for(i=0;i<av->nb_streams;i++) { | |
416 | first = _json_metadata(output, av->streams[i]->metadata, first, indent); | |
405 | 417 | } |
406 | 418 | if (!first) { |
407 | 419 | do_indent(output, 1); |
483 | 495 | int j, k; |
484 | 496 | for(j=0; j<ic->nb_programs; j++) { |
485 | 497 | for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) |
486 | json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_VIDEO); | |
498 | json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_VIDEO); | |
487 | 499 | } |
488 | 500 | } else { |
489 | 501 | for(i=0;i<ic->nb_streams;i++) { |
490 | json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_VIDEO); | |
502 | json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_VIDEO); | |
491 | 503 | } |
492 | 504 | } |
493 | 505 | fprintf(output, "],\n"); |
498 | 510 | int j, k; |
499 | 511 | for(j=0; j<ic->nb_programs; j++) { |
500 | 512 | for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) |
501 | json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, CODEC_TYPE_AUDIO); | |
513 | json_stream_format(output, ic, ic->programs[j]->stream_index[k], 2, !k && !j, AVMEDIA_TYPE_AUDIO); | |
502 | 514 | } |
503 | 515 | } else { |
504 | 516 | for(i=0;i<ic->nb_streams;i++) { |
505 | json_stream_format(output, ic, i, 2, !i, CODEC_TYPE_AUDIO); | |
517 | json_stream_format(output, ic, i, 2, !i, AVMEDIA_TYPE_AUDIO); | |
506 | 518 | } |
507 | 519 | } |
508 | 520 | fprintf(output, "],\n"); |
0 | 0 | /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */ |
1 | 1 | /* |
2 | 2 | * ffmpeg2theora.c -- Convert ffmpeg supported a/v files to Ogg Theora / Vorbis |
3 | * Copyright (C) 2003-2009 <j@v2v.cc> | |
3 | * Copyright (C) 2003-2011 <j@v2v.cc> | |
4 | 4 | * |
5 | 5 | * This program is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * the Free Software Foundation, either version 2 of the License, or | |
8 | 8 | * (at your option) any later version. |
9 | 9 | * |
10 | 10 | * This program is distributed in the hope that it will be useful, |
51 | 51 | enum { |
52 | 52 | NULL_FLAG, |
53 | 53 | DEINTERLACE_FLAG, |
54 | NODEINTERLACE_FLAG, | |
54 | 55 | SOFTTARGET_FLAG, |
55 | 56 | TWOPASS_FLAG, |
56 | 57 | FIRSTPASS_FLAG, |
84 | 85 | FRONTENDFILE_FLAG, |
85 | 86 | SPEEDLEVEL_FLAG, |
86 | 87 | PP_FLAG, |
88 | RESIZE_METHOD_FLAG, | |
87 | 89 | NOSKELETON, |
88 | 90 | SKELETON_3, |
89 | 91 | INDEX_INTERVAL, |
232 | 234 | this->uv_lut_used = 0; |
233 | 235 | this->sws_colorspace_ctx = NULL; |
234 | 236 | this->sws_scale_ctx = NULL; |
237 | ||
238 | this->resize_method = -1; | |
235 | 239 | } |
236 | 240 | return this; |
237 | 241 | } |
340 | 344 | static const char *find_category_for_subtitle_stream (ff2theora this, int idx, int included_subtitles) |
341 | 345 | { |
342 | 346 | AVCodecContext *enc = this->context->streams[idx]->codec; |
343 | if (enc->codec_type != CODEC_TYPE_SUBTITLE) return 0; | |
347 | if (enc->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0; | |
344 | 348 | switch (enc->codec_id) { |
345 | 349 | case CODEC_ID_TEXT: |
346 | 350 | case CODEC_ID_SSA: |
499 | 503 | |
500 | 504 | static const char *find_language_for_subtitle_stream(const AVStream *s) |
501 | 505 | { |
502 | const char *lang=find_iso639_1(s->language); | |
506 | AVDictionaryEntry *language = av_dict_get(s->metadata, "language", NULL, 0); | |
507 | const char *lang=find_iso639_1(language->value); | |
503 | 508 | if (!lang) { |
504 | fprintf(stderr,"WARNING - unrecognized ISO 639-2 language code: %s\n",s->language); | |
509 | fprintf(stderr, "WARNING - unrecognized ISO 639-2 language code: %s\n", | |
510 | language->value); | |
505 | 511 | } |
506 | 512 | return lang; |
507 | 513 | } |
510 | 516 | unsigned int i; |
511 | 517 | AVCodecContext *aenc = NULL; |
512 | 518 | AVCodecContext *venc = NULL; |
513 | int venc_pix_fmt; | |
519 | int venc_pix_fmt = 0; | |
514 | 520 | AVStream *astream = NULL; |
515 | 521 | AVStream *vstream = NULL; |
516 | 522 | AVCodec *acodec = NULL; |
517 | 523 | AVCodec *vcodec = NULL; |
518 | pp_mode_t *ppMode = NULL; | |
519 | pp_context_t *ppContext = NULL; | |
520 | int sws_flags; | |
524 | pp_mode *ppMode = NULL; | |
525 | pp_context *ppContext = NULL; | |
526 | int sws_flags = this->resize_method; | |
521 | 527 | float frame_aspect = 0; |
522 | 528 | double fps = 0.0; |
523 | 529 | AVRational vstream_fps; |
524 | int display_width, display_height; | |
530 | int display_width = -1, display_height = -1; | |
525 | 531 | char *subtitles_enabled = (char*)alloca(this->context->nb_streams); |
526 | 532 | char *subtitles_opened = (char*)alloca(this->context->nb_streams); |
527 | 533 | int synced = this->start_time == 0.0; |
529 | 535 | |
530 | 536 | if (this->audiostream >= 0 && this->context->nb_streams > this->audiostream) { |
531 | 537 | AVCodecContext *enc = this->context->streams[this->audiostream]->codec; |
532 | if (enc->codec_type == CODEC_TYPE_AUDIO) { | |
538 | if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { | |
533 | 539 | this->audio_index = this->audiostream; |
534 | 540 | fprintf(stderr, " Using stream #0.%d as audio input\n",this->audio_index); |
535 | 541 | } |
539 | 545 | } |
540 | 546 | if (this->videostream >= 0 && this->context->nb_streams > this->videostream) { |
541 | 547 | AVCodecContext *enc = this->context->streams[this->videostream]->codec; |
542 | if (enc->codec_type == CODEC_TYPE_VIDEO) { | |
548 | if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { | |
543 | 549 | this->video_index = this->videostream; |
544 | 550 | fprintf(stderr, " Using stream #0.%d as video input\n",this->video_index); |
545 | 551 | } |
551 | 557 | for (i = 0; i < this->context->nb_streams; i++) { |
552 | 558 | AVCodecContext *enc = this->context->streams[i]->codec; |
553 | 559 | switch (enc->codec_type) { |
554 | case CODEC_TYPE_VIDEO: | |
560 | case AVMEDIA_TYPE_VIDEO: | |
555 | 561 | if (this->video_index < 0 && !this->disable_video) |
556 | 562 | this->video_index = i; |
557 | 563 | break; |
558 | case CODEC_TYPE_AUDIO: | |
564 | case AVMEDIA_TYPE_AUDIO: | |
559 | 565 | if (this->audio_index < 0 && !this->disable_audio) |
560 | 566 | this->audio_index = i; |
561 | 567 | break; |
568 | 574 | vstream = this->context->streams[this->video_index]; |
569 | 575 | venc = vstream->codec; |
570 | 576 | vcodec = avcodec_find_decoder (venc->codec_id); |
577 | ||
571 | 578 | display_width = venc->width; |
572 | 579 | display_height = venc->height; |
573 | 580 | venc_pix_fmt = venc->pix_fmt; |
587 | 594 | } |
588 | 595 | this->fps = fps = av_q2d(vstream_fps); |
589 | 596 | |
590 | if (vcodec == NULL || avcodec_open (venc, vcodec) < 0) { | |
597 | if (vcodec == NULL || avcodec_open2 (venc, vcodec, NULL) < 0) { | |
591 | 598 | this->video_index = -1; |
592 | 599 | } |
593 | 600 | this->fps = fps; |
697 | 704 | this->frame_aspect.num = width; |
698 | 705 | this->frame_aspect.den = height; |
699 | 706 | } |
700 | if (av_q2d(this->frame_aspect) <= 1.5) { | |
701 | this->picture_width=128; | |
702 | this->picture_height=96; | |
703 | } | |
704 | else { | |
705 | this->picture_width=128; | |
706 | this->picture_height=72; | |
707 | } | |
707 | ||
708 | this->picture_width=128; | |
709 | this->picture_height=128/av_q2d(this->frame_aspect); | |
710 | ||
708 | 711 | this->frame_aspect.num = this->picture_width; |
709 | 712 | this->frame_aspect.den = this->picture_height; |
710 | 713 | } |
850 | 853 | fprintf(stderr, " Frame Aspect Ratio: %.2f/1\n", frame_aspect); |
851 | 854 | } |
852 | 855 | |
853 | if (!(info.twopass==3 && info.passno==2) && !info.frontend && this->deinterlace==1) | |
856 | if (!(info.twopass==3 && info.passno==2) && !info.frontend && | |
857 | this->deinterlace==1) | |
854 | 858 | fprintf(stderr, " Deinterlace: on\n"); |
859 | if (!(info.twopass==3 && info.passno==2) && !info.frontend && | |
860 | this->deinterlace==-1) | |
861 | fprintf(stderr, " Deinterlace: off\n"); | |
855 | 862 | |
856 | 863 | if (strcmp(this->pp_mode, "")) { |
857 | 864 | ppContext = pp_get_context(display_width, display_height, PP_FORMAT_420); |
881 | 888 | this->frame_y_offset = this->frame_height-this->picture_height>>1&~1; |
882 | 889 | |
883 | 890 | //Bicubic (best for upscaling), |
884 | if(display_width - (this->frame_leftBand + this->frame_rightBand) < this->picture_width || | |
885 | display_height - (this->frame_topBand + this->frame_bottomBand) < this->picture_height) { | |
886 | sws_flags = SWS_BICUBIC; | |
887 | } else { //Bilinear (best for downscaling), | |
888 | sws_flags = SWS_BILINEAR; | |
891 | if (sws_flags < 0) { | |
892 | if(display_width - (this->frame_leftBand + this->frame_rightBand) < this->picture_width || | |
893 | display_height - (this->frame_topBand + this->frame_bottomBand) < this->picture_height) { | |
894 | sws_flags = SWS_BICUBIC; | |
895 | } else { //Bilinear (best for downscaling), | |
896 | sws_flags = SWS_BILINEAR; | |
897 | } | |
889 | 898 | } |
890 | 899 | |
891 | 900 | if (this->frame_width > 0 || this->frame_height > 0) { |
930 | 939 | astream = this->context->streams[this->audio_index]; |
931 | 940 | aenc = this->context->streams[this->audio_index]->codec; |
932 | 941 | acodec = avcodec_find_decoder (aenc->codec_id); |
942 | int sample_rate = aenc->sample_rate; | |
933 | 943 | if (this->channels < 1) { |
934 | 944 | this->channels = aenc->channels; |
935 | 945 | } |
944 | 954 | this->channels = aenc->channels; |
945 | 955 | } |
946 | 956 | |
947 | if (acodec != NULL && avcodec_open (aenc, acodec) >= 0) { | |
948 | if (this->sample_rate != aenc->sample_rate | |
957 | if (acodec != NULL && avcodec_open2 (aenc, acodec, NULL) >= 0) { | |
958 | if (this->sample_rate != sample_rate | |
949 | 959 | || this->channels != aenc->channels |
950 | || aenc->sample_fmt != SAMPLE_FMT_S16) { | |
960 | || aenc->sample_fmt != AV_SAMPLE_FMT_S16) { | |
951 | 961 | // values take from libavcodec/resample.c |
952 | 962 | this->audio_resample_ctx = av_audio_resample_init(this->channels, aenc->channels, |
953 | this->sample_rate, aenc->sample_rate, | |
954 | SAMPLE_FMT_S16, aenc->sample_fmt, | |
963 | this->sample_rate, sample_rate, | |
964 | AV_SAMPLE_FMT_S16, aenc->sample_fmt, | |
955 | 965 | 16, 10, 0, 0.8); |
956 | 966 | if (!this->audio_resample_ctx) { |
957 | 967 | this->channels = aenc->channels; |
958 | 968 | } |
959 | if (!info.frontend && this->sample_rate!=aenc->sample_rate) | |
960 | fprintf(stderr, " Resample: %dHz => %dHz\n",aenc->sample_rate,this->sample_rate); | |
969 | if (!info.frontend && this->sample_rate!=sample_rate) | |
970 | fprintf(stderr, " Resample: %dHz => %dHz\n", sample_rate,this->sample_rate); | |
961 | 971 | if (!info.frontend && this->channels!=aenc->channels) |
962 | 972 | fprintf(stderr, " Channels: %d => %d\n",aenc->channels,this->channels); |
963 | 973 | } |
979 | 989 | AVStream *stream = this->context->streams[i]; |
980 | 990 | AVCodecContext *enc = stream->codec; |
981 | 991 | const char *category; |
982 | if (enc->codec_type == CODEC_TYPE_SUBTITLE) { | |
992 | if (enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { | |
983 | 993 | AVCodec *codec = avcodec_find_decoder (enc->codec_id); |
984 | if (codec && avcodec_open (enc, codec) >= 0) { | |
994 | if (codec && avcodec_open2 (enc, codec, NULL) >= 0) { | |
985 | 995 | subtitles_opened[i] = 1; |
986 | 996 | } |
987 | 997 | category = find_category_for_subtitle_stream(this, i, this->included_subtitles); |
1282 | 1292 | ki->gps_denominator = 1; |
1283 | 1293 | } |
1284 | 1294 | ki->granule_shift = 32; |
1285 | ki->original_canvas_width = display_width; | |
1286 | ki->original_canvas_height = display_height; | |
1295 | if (display_width >= 0) | |
1296 | ki->original_canvas_width = display_width; | |
1297 | if (display_height >= 0) | |
1298 | ki->original_canvas_height = display_height; | |
1287 | 1299 | } |
1288 | 1300 | } |
1289 | 1301 | } |
1292 | 1304 | oggmux_init(&info); |
1293 | 1305 | /*seek to start time*/ |
1294 | 1306 | if (this->start_time) { |
1295 | av_seek_frame( this->context, -1, (int64_t)AV_TIME_BASE*this->start_time, 1); | |
1307 | int64_t timestamp = this->start_time * AV_TIME_BASE; | |
1308 | /* add the stream start time */ | |
1309 | if (this->context->start_time != AV_NOPTS_VALUE) | |
1310 | timestamp += this->context->start_time; | |
1311 | av_seek_frame( this->context, -1, timestamp, AVSEEK_FLAG_BACKWARD); | |
1296 | 1312 | /* discard subtitles by their end time, so we still have those that start before the start time, |
1297 | 1313 | but end after it */ |
1298 | 1314 | if (info.passno != 1) { |
1415 | 1431 | display_width, display_height); |
1416 | 1432 | output_tmp_p=NULL; |
1417 | 1433 | } |
1418 | if (frame->interlaced_frame || this->deinterlace) { | |
1434 | if ((this->deinterlace==0 && frame->interlaced_frame) || | |
1435 | this->deinterlace==1) { | |
1419 | 1436 | if (avpicture_deinterlace((AVPicture *)output,(AVPicture *)output_tmp,this->pix_fmt,display_width,display_height)<0) { |
1420 | 1437 | fprintf(stderr, "Deinterlace failed.\n"); |
1421 | 1438 | exit(1); |
1450 | 1467 | } |
1451 | 1468 | if (this->sws_scale_ctx) { |
1452 | 1469 | sws_scale(this->sws_scale_ctx, |
1453 | output_cropped->data, output_cropped->linesize, 0, | |
1454 | display_height - (this->frame_topBand + this->frame_bottomBand), | |
1455 | output_resized->data, output_resized->linesize); | |
1470 | output_cropped->data, | |
1471 | output_cropped->linesize, 0, | |
1472 | display_height - (this->frame_topBand + this->frame_bottomBand), | |
1473 | output_resized->data, | |
1474 | output_resized->linesize); | |
1456 | 1475 | } |
1457 | 1476 | else{ |
1458 | 1477 | output_resized = output_cropped; |
1511 | 1530 | int samples=0; |
1512 | 1531 | int samples_out=0; |
1513 | 1532 | int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE; |
1514 | int bytes_per_sample = av_get_bits_per_sample_format(aenc->sample_fmt)/8; | |
1533 | int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt); | |
1515 | 1534 | |
1516 | 1535 | if (avpkt.size > 0) { |
1517 | 1536 | len1 = avcodec_decode_audio3(astream->codec, audio_buf, &data_size, &avpkt); |
1683 | 1702 | while (ks->subtitles_count < ks->num_subtitles && sub->t0-1.0 <= avtime+this->start_time) { |
1684 | 1703 | #ifdef HAVE_KATE |
1685 | 1704 | if (sub->text) { |
1686 | oggmux_add_kate_text(&info, i, sub->t0, sub->t1, sub->text, sub->len); | |
1705 | oggmux_add_kate_text(&info, i, sub->t0, sub->t1, sub->text, sub->len, sub->x1, sub->x2, sub->y1, sub->y2); | |
1687 | 1706 | } |
1688 | 1707 | else { |
1689 | 1708 | oggmux_add_kate_image(&info, i, sub->t0, sub->t1, &sub->kr, &sub->kp, &sub->kb); |
1766 | 1785 | /* clear out state */ |
1767 | 1786 | if (info.passno != 1) |
1768 | 1787 | free_subtitles(this); |
1788 | this->context = NULL; | |
1769 | 1789 | if (info.twopass != 3) { |
1770 | 1790 | av_free(this); |
1771 | 1791 | } |
1846 | 1866 | return crop_value; |
1847 | 1867 | } |
1848 | 1868 | |
1869 | static const struct { | |
1870 | const char *name; | |
1871 | int method; | |
1872 | } resize_methods[] = { | |
1873 | { "fast-bilinear", SWS_FAST_BILINEAR }, | |
1874 | { "bilinear", SWS_BILINEAR }, | |
1875 | { "bicubic", SWS_BICUBIC }, | |
1876 | { "x", SWS_X }, | |
1877 | { "point", SWS_POINT }, | |
1878 | { "area", SWS_AREA }, | |
1879 | { "bicublin", SWS_BICUBLIN }, | |
1880 | { "gauss", SWS_GAUSS }, | |
1881 | { "sinc", SWS_SINC }, | |
1882 | { "lanczos", SWS_LANCZOS }, | |
1883 | { "spline", SWS_SPLINE }, | |
1884 | }; | |
1885 | ||
1886 | static int get_resize_method_by_name(const char *name) | |
1887 | { | |
1888 | int n; | |
1889 | for (n=0; n<sizeof(resize_methods)/sizeof(resize_methods[0]); ++n) { | |
1890 | if (!strcmp(resize_methods[n].name, name)) | |
1891 | return resize_methods[n].method; | |
1892 | } | |
1893 | return -1; | |
1894 | } | |
1895 | ||
1896 | static void print_resize_help(void) | |
1897 | { | |
1898 | int n; | |
1899 | printf("Known resize methods:\n"); | |
1900 | for (n=0; n<sizeof(resize_methods)/sizeof(resize_methods[0]); ++n) { | |
1901 | printf(" %s\n",resize_methods[n].name); | |
1902 | } | |
1903 | } | |
1904 | ||
1849 | 1905 | void copy_metadata(const AVFormatContext *av) |
1850 | 1906 | { |
1851 | 1907 | static const char *allowed[] = { |
1867 | 1923 | |
1868 | 1924 | "AUTHOR" |
1869 | 1925 | }; |
1870 | AVMetadataTag *tag = NULL; | |
1871 | while ((tag = av_metadata_get(av->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) { | |
1926 | AVDictionaryEntry *tag = NULL; | |
1927 | while ((tag = av_dict_get(av->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { | |
1872 | 1928 | char uc_key[16]; |
1873 | 1929 | int i; |
1874 | 1930 | for (i = 0; tag->key[i] != '\0' && i < LENGTH(uc_key) - 1; i++) |
1917 | 1973 | } |
1918 | 1974 | |
1919 | 1975 | void print_usage() { |
1976 | th_info ti; | |
1977 | th_enc_ctx *td; | |
1978 | int max_speed_level = -1; | |
1979 | ||
1980 | th_info_init(&ti); | |
1981 | ti.pic_width = ti.frame_width = 320; | |
1982 | ti.pic_height = ti.frame_height = 240; | |
1983 | td = th_encode_alloc(&ti); | |
1984 | th_encode_ctl(td, TH_ENCCTL_GET_SPLEVEL_MAX, &max_speed_level, sizeof(int)); | |
1985 | th_encode_free(td); | |
1986 | ||
1920 | 1987 | fprintf(stdout, |
1921 | PACKAGE " " PACKAGE_VERSION " - %s\n", th_version_string()); | |
1988 | PACKAGE " " PACKAGE_VERSION "\n\n" | |
1989 | "\t%s\n" | |
1990 | "\t%s\n", | |
1991 | th_version_string(), | |
1992 | vorbis_version_string()); | |
1993 | ||
1994 | unsigned int version = avcodec_version(); | |
1995 | fprintf(stdout, "\tFFmpeg\t libavcodec %02d.%d.%d\n", | |
1996 | version >> 16, version >> 8 & 0xff, version & 0xff); | |
1997 | version = avformat_version(); | |
1998 | fprintf(stdout, "\tFFmpeg\t libavformat %02d.%d.%d\n", | |
1999 | version >> 16, version >> 8 & 0xff, version & 0xff); | |
2000 | ||
1922 | 2001 | fprintf(stdout, |
1923 | "\n" | |
2002 | "\n\n" | |
1924 | 2003 | " Usage: " PACKAGE " [options] input\n" |
1925 | 2004 | "\n" |
1926 | 2005 | "General output options:\n" |
1959 | 2038 | " --optimize optimize video output filesize (slower)\n" |
1960 | 2039 | " (same as speedlevel 0)\n" |
1961 | 2040 | " --speedlevel encoding is faster with higher values\n" |
1962 | " the cost is quality and bandwidth\n" | |
1963 | " - 0: Slowest (best)\n" | |
1964 | " - 1: Enable early skip (default)\n" | |
1965 | " - 2: Disable motion compensation\n" | |
2041 | " the cost is quality and bandwidth (default 1)\n" | |
2042 | " available values depend on the version of libtheora\n" | |
2043 | " your version supports speedlevels 0 to %d\n" | |
1966 | 2044 | |
1967 | 2045 | " -x, --width scale to given width (in pixels)\n" |
1968 | 2046 | " -y, --height scale to given height (in pixels)\n" |
1985 | 2063 | " two-pass encoding. (only works in bitrate mode)\n" |
1986 | 2064 | " --no-upscaling only scale video or resample audio if input is\n" |
1987 | 2065 | " bigger than provided parameters\n" |
2066 | " --resize-method <method> Use this method for rescaling the video\n" | |
2067 | " See --resize-method help for a list of available\n" | |
2068 | " resizing methods\n" | |
1988 | 2069 | "\n" |
1989 | 2070 | "Video transfer options:\n" |
1990 | 2071 | " --pp Video Postprocessing, denoise, deblock, deinterlacer\n" |
2010 | 2091 | "Input options:\n" |
2011 | 2092 | " --deinterlace force deinterlace, otherwise only material\n" |
2012 | 2093 | " marked as interlaced will be deinterlaced\n" |
2094 | " --no-deinterlace force deinterlace off\n" | |
2013 | 2095 | #ifdef HAVE_FRAMEHOOK |
2014 | 2096 | " --vhook you can use ffmpeg's vhook system, example:\n" |
2015 | 2097 | " ffmpeg2theora --vhook '/path/watermark.so -f wm.gif' input.dv\n" |
2080 | 2162 | " ffmpeg2theora frame%%06d.png -o output.ogv\n" |
2081 | 2163 | "\n" |
2082 | 2164 | " Live streaming from V4L Device:\n" |
2083 | " ffmpeg2theora /dev/video0 -f video4linux --inputfps 15 -x 160 -y 128 -o - \\\n" | |
2084 | " | oggfwd icast2server 8000 password /theora.ogv\n" | |
2165 | " ffmpeg2theora --no-skeleton /dev/video0 -f video4linux \\\n" | |
2166 | " --inputfps 15 -x 160 -y 128 -o - \\\n" | |
2167 | " | oggfwd icast2server 8000 password /theora.ogv\n" | |
2168 | "\n" | |
2085 | 2169 | " (you might have to use video4linux2 depending on your hardware)\n" |
2086 | 2170 | "\n" |
2087 | 2171 | " Live encoding from a DV camcorder (needs a fast machine):\n" |
2088 | 2172 | " dvgrab - | ffmpeg2theora -f dv -x 352 -y 288 -o output.ogv -\n" |
2089 | 2173 | "\n" |
2090 | 2174 | " Live encoding and streaming to icecast server:\n" |
2091 | " dvgrab --format raw - \\\n" | |
2092 | " | ffmpeg2theora -f dv -x 160 -y 128 -o /dev/stdout - \\\n" | |
2093 | " | oggfwd icast2server 8000 password /theora.ogv\n" | |
2175 | " dvgrab --format raw - \\\n" | |
2176 | " | ffmpeg2theora --no-skeleton -f dv -x 160 -y 128 -o /dev/stdout - \\\n" | |
2177 | " | oggfwd icast2server 8000 password /theora.ogv\n" | |
2094 | 2178 | "\n" |
2095 | ); | |
2179 | ,max_speed_level); | |
2096 | 2180 | exit(0); |
2097 | 2181 | } |
2098 | 2182 | |
2109 | 2193 | static int metadata_flag = -1; |
2110 | 2194 | |
2111 | 2195 | AVInputFormat *input_fmt = NULL; |
2112 | AVFormatParameters params, *formatParams = NULL; | |
2196 | AVDictionary *format_opts = NULL; | |
2113 | 2197 | |
2114 | 2198 | int c,long_option_index; |
2115 | 2199 | const char *optstring = "P:o:k:f:F:x:y:v:V:a:A:K:d:H:c:G:Z:C:B:p:N:s:e:D:h::"; |
2138 | 2222 | {"keyint",required_argument,NULL,'K'}, |
2139 | 2223 | {"buf-delay",required_argument,NULL,'d'}, |
2140 | 2224 | {"deinterlace",0,&flag,DEINTERLACE_FLAG}, |
2225 | {"no-deinterlace",0,&flag,NODEINTERLACE_FLAG}, | |
2141 | 2226 | {"pp",required_argument,&flag,PP_FLAG}, |
2227 | {"resize-method",required_argument,&flag,RESIZE_METHOD_FLAG}, | |
2142 | 2228 | {"samplerate",required_argument,NULL,'H'}, |
2143 | 2229 | {"channels",required_argument,NULL,'c'}, |
2144 | 2230 | {"gamma",required_argument,NULL,'G'}, |
2224 | 2310 | convert->deinterlace = 1; |
2225 | 2311 | flag = -1; |
2226 | 2312 | break; |
2313 | case NODEINTERLACE_FLAG: | |
2314 | convert->deinterlace = -1; | |
2315 | flag = -1; | |
2316 | break; | |
2227 | 2317 | case SOFTTARGET_FLAG: |
2228 | 2318 | convert->soft_target = 1; |
2229 | 2319 | flag = -1; |
2273 | 2363 | exit(1); |
2274 | 2364 | } |
2275 | 2365 | snprintf(convert->pp_mode,sizeof(convert->pp_mode),"%s",optarg); |
2366 | flag = -1; | |
2367 | break; | |
2368 | case RESIZE_METHOD_FLAG: | |
2369 | if (!strcmp(optarg, "help")) { | |
2370 | print_resize_help(); | |
2371 | exit(1); | |
2372 | } | |
2373 | convert->resize_method = get_resize_method_by_name(optarg); | |
2276 | 2374 | flag = -1; |
2277 | 2375 | break; |
2278 | 2376 | case VHOOK_FLAG: |
2697 | 2795 | |
2698 | 2796 | if (convert->soft_target) { |
2699 | 2797 | if (convert->video_bitrate <= 0) { |
2700 | fprintf(stderr,"Soft rate target (--soft-tagret) requested without a bitrate (-V).\n"); | |
2798 | fprintf(stderr,"Soft rate target (--soft-target) requested without a bitrate (-V).\n"); | |
2701 | 2799 | exit(1); |
2702 | 2800 | } |
2703 | 2801 | if (convert->video_quality == -1) |
2725 | 2823 | |
2726 | 2824 | for(info.passno=(info.twopass==3?1:info.twopass);info.passno<=(info.twopass==3?2:info.twopass);info.passno++){ |
2727 | 2825 | //detect image sequences and set framerate if provided |
2728 | if (av_guess_image2_codec(inputfile_name) != CODEC_ID_NONE || \ | |
2729 | (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0)) { | |
2730 | formatParams = ¶ms; | |
2731 | memset(formatParams, 0, sizeof(*formatParams)); | |
2732 | if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) { | |
2733 | formatParams->channel = 0; | |
2734 | formatParams->width = PAL_HALF_WIDTH; | |
2735 | formatParams->height = PAL_HALF_HEIGHT; | |
2736 | formatParams->time_base.den = 25; | |
2737 | formatParams->time_base.num = 2; | |
2738 | if (convert->picture_width) | |
2739 | formatParams->width = convert->picture_width; | |
2740 | if (convert->picture_height) | |
2741 | formatParams->height = convert->picture_height; | |
2826 | if (input_fmt != NULL && strcmp(input_fmt->name, "video4linux") >= 0) { | |
2827 | char buf[100]; | |
2828 | av_dict_set(&format_opts, "channel", "0", 0); | |
2829 | if (convert->picture_width || convert->picture_height) { | |
2830 | snprintf(buf, sizeof(buf), "%dx%d", | |
2831 | convert->picture_width, convert->picture_height); | |
2832 | av_dict_set(&format_opts,"video_size", buf, 0); | |
2742 | 2833 | } |
2743 | 2834 | if (convert->force_input_fps.num > 0) { |
2744 | formatParams->time_base.den = convert->force_input_fps.num; | |
2745 | formatParams->time_base.num = convert->force_input_fps.den; | |
2835 | snprintf(buf, sizeof(buf), "%d/%d", | |
2836 | convert->force_input_fps.den, convert->force_input_fps.num); | |
2837 | av_dict_set(&format_opts, "framerate", buf, 0); | |
2746 | 2838 | } else if (convert->framerate_new.num > 0) { |
2747 | formatParams->time_base.den = convert->framerate_new.num; | |
2748 | formatParams->time_base.num = convert->framerate_new.den; | |
2749 | } | |
2750 | formatParams->video_codec_id = av_guess_image2_codec(inputfile_name); | |
2751 | } | |
2752 | if (av_open_input_file(&convert->context, inputfile_name, input_fmt, 0, formatParams) >= 0) { | |
2753 | if (av_find_stream_info(convert->context) >= 0) { | |
2839 | snprintf(buf, sizeof(buf), "%d/%d", | |
2840 | convert->framerate_new.den, convert->framerate_new.num); | |
2841 | av_dict_set(&format_opts, "framerate", buf, 0); | |
2842 | } | |
2843 | } | |
2844 | if (avformat_open_input(&convert->context, inputfile_name, input_fmt, &format_opts) >= 0) { | |
2845 | if (avformat_find_stream_info(convert->context, NULL) >= 0) { | |
2754 | 2846 | |
2755 | 2847 | if (output_filename_needs_building) { |
2756 | 2848 | int i; |
2759 | 2851 | for (i = 0; i < convert->context->nb_streams; i++) { |
2760 | 2852 | AVCodecContext *enc = convert->context->streams[i]->codec; |
2761 | 2853 | switch (enc->codec_type) { |
2762 | case CODEC_TYPE_VIDEO: has_video = 1; break; | |
2763 | case CODEC_TYPE_AUDIO: has_audio = 1; break; | |
2764 | case CODEC_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break; | |
2854 | case AVMEDIA_TYPE_VIDEO: has_video = 1; break; | |
2855 | case AVMEDIA_TYPE_AUDIO: has_audio = 1; break; | |
2856 | case AVMEDIA_TYPE_SUBTITLE: if (is_supported_subtitle_stream(convert, i, convert->included_subtitles)) has_kate = 1; break; | |
2765 | 2857 | default: break; |
2766 | 2858 | } |
2767 | 2859 | } |
2780 | 2872 | /* reserve 4 bytes in the buffer for the `.og[va]' extension */ |
2781 | 2873 | snprintf(outputfile_name, sizeof(outputfile_name) - strlen(ext), "%s",inputfile_name); |
2782 | 2874 | if ((str_ptr = strrchr(outputfile_name, '.'))) { |
2783 | sprintf(str_ptr, ext); | |
2875 | sprintf(str_ptr, "%s", ext); | |
2784 | 2876 | if (!strcmp(inputfile_name, outputfile_name)) { |
2785 | 2877 | snprintf(outputfile_name, sizeof(outputfile_name), "%s%s", inputfile_name, ext); |
2786 | 2878 | } |
2827 | 2919 | |
2828 | 2920 | if (!info.frontend) { |
2829 | 2921 | if (info.twopass!=3 || info.passno==1) { |
2830 | dump_format(convert->context, 0,inputfile_name, 0); | |
2922 | av_dump_format(convert->context, 0,inputfile_name, 0); | |
2831 | 2923 | } |
2832 | } | |
2833 | if (convert->disable_audio) { | |
2834 | fprintf(stderr, " [audio disabled].\n"); | |
2835 | } | |
2836 | if (convert->disable_video) { | |
2837 | fprintf(stderr, " [video disabled].\n"); | |
2838 | } | |
2839 | if (!convert->included_subtitles) { | |
2840 | fprintf(stderr, " [subtitles disabled].\n"); | |
2924 | if (convert->disable_audio) { | |
2925 | fprintf(stderr, " [audio disabled].\n"); | |
2926 | } | |
2927 | if (convert->disable_video) { | |
2928 | fprintf(stderr, " [video disabled].\n"); | |
2929 | } | |
2930 | if (!convert->included_subtitles) { | |
2931 | fprintf(stderr, " [subtitles disabled].\n"); | |
2932 | } | |
2841 | 2933 | } |
2842 | 2934 | if (convert->disable_metadata) { |
2843 | fprintf(stderr, " [metadata disabled].\n"); | |
2935 | if (!info.frontend) | |
2936 | fprintf(stderr, " [metadata disabled].\n"); | |
2844 | 2937 | } else { |
2845 | 2938 | copy_metadata(convert->context); |
2846 | 2939 | } |
2847 | 2940 | |
2848 | if (!convert->sync) { | |
2941 | if (!convert->sync && !info.frontend) { | |
2849 | 2942 | fprintf(stderr, " Ignore A/V Sync from input container.\n"); |
2850 | 2943 | } |
2851 | 2944 | |
2876 | 2969 | fprintf(stderr,"\nUnable to decode input.\n"); |
2877 | 2970 | return(1); |
2878 | 2971 | } |
2879 | av_close_input_file(convert->context); | |
2972 | avformat_close_input(&convert->context); | |
2880 | 2973 | } |
2881 | 2974 | else{ |
2882 | 2975 | if (info.frontend) |
2898 | 2991 | if (info.twopass_file) |
2899 | 2992 | fclose(info.twopass_file); |
2900 | 2993 | |
2901 | if (info.frontend) | |
2994 | if (info.frontend) { | |
2902 | 2995 | fprintf(info.frontend, "{\"result\": \"ok\"}\n"); |
2903 | if (info.frontend && info.frontend != stderr) | |
2996 | fflush(info.frontend); | |
2997 | } | |
2998 | if (info.frontend && info.frontend != stdout) | |
2904 | 2999 | fclose(info.frontend); |
2905 | 3000 | #ifdef WIN32 |
2906 | 3001 | if (info.twopass==3) |
2907 | 3002 | unlink(_tmp_2pass); |
2908 | 3003 | #endif |
3004 | av_dict_free(&format_opts); | |
2909 | 3005 | return(0); |
2910 | 3006 | } |
12 | 12 | kate_palette kp; |
13 | 13 | kate_bitmap kb; |
14 | 14 | #endif |
15 | int x1,x2,y1,y2; | |
15 | 16 | } ff2theora_subtitle; |
16 | 17 | |
17 | 18 | typedef struct ff2theora_kate_stream{ |
74 | 75 | int video_bitrate; |
75 | 76 | ogg_uint32_t keyint; |
76 | 77 | char pp_mode[255]; |
78 | int resize_method; | |
77 | 79 | |
78 | 80 | AVRational force_input_fps; |
79 | 81 | int sync; |
6 | 6 | * |
7 | 7 | * This program is free software: you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * the Free Software Foundation, either version 2 of the License, or | |
10 | 10 | * (at your option) any later version. |
11 | 11 | * |
12 | 12 | * This program is distributed in the hope that it will be useful, |
6 | 6 | * |
7 | 7 | * This program is free software: you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * the Free Software Foundation, either version 2 of the License, or | |
10 | 10 | * (at your option) any later version. |
11 | 11 | * |
12 | 12 | * This program is distributed in the hope that it will be useful, |
0 | 0 | /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */ |
1 | 1 | /* |
2 | 2 | * subtitles.c -- Kate Subtitles |
3 | * Copyright (C) 2003-2009 <j@v2v.cc> | |
3 | * Copyright (C) 2003-2011 <j@v2v.cc> | |
4 | 4 | * |
5 | 5 | * This program is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * the Free Software Foundation, either version 2 of the License, or | |
8 | 8 | * (at your option) any later version. |
9 | 9 | * |
10 | 10 | * This program is distributed in the hope that it will be useful, |
180 | 180 | |
181 | 181 | static char *fgets2(char *s,size_t sz,FILE *f) |
182 | 182 | { |
183 | char *ret = fgets(s, sz, f); | |
183 | char *ret = fgets(s, sz, f); | |
184 | if (ret) { | |
184 | 185 | /* fixup DOS newline character */ |
185 | 186 | char *ptr=strchr(s, '\r'); |
186 | 187 | if (ptr) { |
187 | 188 | *ptr='\n'; |
188 | 189 | *(ptr+1)=0; |
189 | 190 | } |
190 | return ret; | |
191 | } | |
192 | else *s=0; | |
193 | return ret; | |
191 | 194 | } |
192 | 195 | |
193 | 196 | static double hmsms2s(int h,int m,int s,int ms) |
330 | 333 | } |
331 | 334 | } |
332 | 335 | |
336 | static int store_subtitle(ff2theora_kate_stream *this, | |
337 | char *text, double t0, double t1, int x1, int x2, int y1, int y2, | |
338 | int ignore_non_utf8,int *warned, unsigned int line, FILE *frontend) | |
339 | { | |
340 | char *utf8; | |
341 | size_t len; | |
342 | int ret; | |
343 | ||
344 | remove_last_newline(text); | |
345 | ||
346 | /* we want all text to be UTF-8 */ | |
347 | utf8=convert_subtitle_to_utf8(this->subtitles_encoding,text,ignore_non_utf8, frontend); | |
348 | if (!utf8) { | |
349 | warn(frontend, this->filename, line, "Failed to get UTF-8 text"); | |
350 | return -1; | |
351 | } | |
352 | ||
353 | len = strlen(utf8); | |
354 | this->subtitles = (ff2theora_subtitle*)realloc(this->subtitles, (this->num_subtitles+1)*sizeof(ff2theora_subtitle)); | |
355 | if (!this->subtitles) { | |
356 | free(utf8); | |
357 | warn(frontend, NULL, 0, "Out of memory"); | |
358 | return -1; | |
359 | } | |
360 | ret=kate_text_validate(kate_utf8,utf8,len+1); | |
361 | if (ret<0) { | |
362 | if (!*warned) { | |
363 | warn(frontend, this->filename, line, "subtitle is not valid UTF-8: %s",utf8); | |
364 | if (!frontend) | |
365 | fprintf(stderr," further invalid subtitles will NOT be flagged\n"); | |
366 | *warned=1; | |
367 | } | |
368 | } | |
369 | else { | |
370 | /* kill off trailing \n characters */ | |
371 | while (len>0) { | |
372 | if (utf8[len-1]=='\n') utf8[--len]=0; else break; | |
373 | } | |
374 | this->subtitles[this->num_subtitles].text = utf8; | |
375 | this->subtitles[this->num_subtitles].len = len; | |
376 | this->subtitles[this->num_subtitles].t0 = t0; | |
377 | this->subtitles[this->num_subtitles].t1 = t1; | |
378 | this->subtitles[this->num_subtitles].x1 = x1; | |
379 | this->subtitles[this->num_subtitles].x2 = x2; | |
380 | this->subtitles[this->num_subtitles].y1 = y1; | |
381 | this->subtitles[this->num_subtitles].y2 = y2; | |
382 | this->num_subtitles++; | |
383 | } | |
384 | ||
385 | return 0; | |
386 | } | |
387 | ||
333 | 388 | #endif |
334 | 389 | |
335 | 390 | int load_subtitles(ff2theora_kate_stream *this, int ignore_non_utf8, FILE *frontend) |
342 | 397 | int id; |
343 | 398 | static char text[4096]; |
344 | 399 | int h0,m0,s0,ms0,h1,m1,s1,ms1; |
400 | int x1,x2,y1,y2; | |
345 | 401 | double t0=0.0; |
346 | 402 | double t1=0.0; |
347 | 403 | static char str[4096]; |
348 | 404 | int warned=0; |
349 | 405 | FILE *f; |
350 | size_t len; | |
351 | 406 | unsigned int line=0; |
352 | char *utf8; | |
353 | 407 | |
354 | 408 | this->subtitles = NULL; |
355 | 409 | |
373 | 427 | |
374 | 428 | fgets2(str,sizeof(str),f); |
375 | 429 | ++line; |
376 | while (!feof(f)) { | |
430 | while (!feof(f) || *str) { | |
377 | 431 | switch (need) { |
378 | 432 | case need_id: |
379 | 433 | if (!strcmp(str,"\n")) { |
396 | 450 | } |
397 | 451 | break; |
398 | 452 | case need_timing: |
399 | ret=sscanf(str,"%d:%d:%d%*[.,]%d --> %d:%d:%d%*[.,]%d\n",&h0,&m0,&s0,&ms0,&h1,&m1,&s1,&ms1); | |
400 | if (ret!=8 || (h0|m0|s0|ms0)<0 || (h1|m1|s1|ms1)<0) { | |
401 | warn(frontend, this->filename, line, "Syntax error: %s",str); | |
453 | ret=sscanf(str,"%d:%d:%d%*[.,]%d --> %d:%d:%d%*[.,]%d %*[xX]1: %d %*[xX]2: %d %*[yY]1: %d %*[yY]2: %d\n",&h0,&m0,&s0,&ms0,&h1,&m1,&s1,&ms1,&x1,&x2,&y1,&y2); | |
454 | if (ret!=12) { | |
455 | x1=y1=x2=y2=-INT_MAX; | |
456 | ret=sscanf(str,"%d:%d:%d%*[.,]%d --> %d:%d:%d%*[.,]%d\n",&h0,&m0,&s0,&ms0,&h1,&m1,&s1,&ms1); | |
457 | if (ret!=8) { | |
458 | warn(frontend, this->filename, line, "Syntax error: %s",str); | |
459 | fclose(f); | |
460 | free(this->subtitles); | |
461 | return -1; | |
462 | } | |
463 | } | |
464 | t0=hmsms2s(h0,m0,s0,ms0); | |
465 | t1=hmsms2s(h1,m1,s1,ms1); | |
466 | if ((h0|m0|s0|ms0)<0 || (h1|m1|s1|ms1)<0) { | |
467 | warn(frontend, this->filename, line, "Bad timestamp specification: %s",str); | |
402 | 468 | fclose(f); |
403 | 469 | free(this->subtitles); |
404 | 470 | return -1; |
405 | } | |
406 | else { | |
407 | t0=hmsms2s(h0,m0,s0,ms0); | |
408 | t1=hmsms2s(h1,m1,s1,ms1); | |
409 | 471 | } |
410 | 472 | need=need_text; |
411 | 473 | break; |
412 | 474 | case need_text: |
413 | 475 | if (str[0]=='\n') { |
414 | 476 | /* we have all the lines for that subtitle, remove the last \n */ |
415 | remove_last_newline(text); | |
416 | ||
417 | /* we want all text to be UTF-8 */ | |
418 | utf8=convert_subtitle_to_utf8(this->subtitles_encoding,text,ignore_non_utf8, frontend); | |
419 | if (!utf8) { | |
420 | warn(frontend, this->filename, line, "Failed to get UTF-8 text"); | |
477 | int ret = store_subtitle(this, text, t0, t1, x1, x2, y1, y2, ignore_non_utf8, &warned, line, frontend); | |
478 | if (ret < 0) { | |
421 | 479 | fclose(f); |
422 | 480 | free(this->subtitles); |
423 | return -1; | |
424 | break; | |
425 | } | |
426 | ||
427 | len = strlen(utf8); | |
428 | this->subtitles = (ff2theora_subtitle*)realloc(this->subtitles, (this->num_subtitles+1)*sizeof(ff2theora_subtitle)); | |
429 | if (!this->subtitles) { | |
430 | free(utf8); | |
431 | warn(frontend, NULL, 0, "Out of memory"); | |
432 | fclose(f); | |
433 | free(this->subtitles); | |
434 | return -1; | |
435 | } | |
436 | ret=kate_text_validate(kate_utf8,utf8,len+1); | |
437 | if (ret<0) { | |
438 | if (!warned) { | |
439 | warn(frontend, this->filename, line, "subtitle is not valid UTF-8: %s",utf8); | |
440 | if (!frontend) | |
441 | fprintf(stderr," further invalid subtitles will NOT be flagged\n"); | |
442 | warned=1; | |
443 | } | |
444 | } | |
445 | else { | |
446 | /* kill off trailing \n characters */ | |
447 | while (len>0) { | |
448 | if (utf8[len-1]=='\n') utf8[--len]=0; else break; | |
449 | } | |
450 | this->subtitles[this->num_subtitles].text = utf8; | |
451 | this->subtitles[this->num_subtitles].len = len; | |
452 | this->subtitles[this->num_subtitles].t0 = t0; | |
453 | this->subtitles[this->num_subtitles].t1 = t1; | |
454 | this->num_subtitles++; | |
481 | return ret; | |
455 | 482 | } |
456 | 483 | need=need_id; |
457 | 484 | } |
458 | 485 | else { |
459 | 486 | /* in case of very long subtitles */ |
460 | len=strlen(text); | |
487 | size_t len=strlen(text); | |
461 | 488 | if (len+strlen(str) >= sizeof(text)) { |
462 | 489 | warn(frontend, this->filename, line, "Subtitle text is too long - truncated"); |
463 | 490 | } |
472 | 499 | |
473 | 500 | fclose(f); |
474 | 501 | |
475 | #if 0 | |
476 | // there seems to be quite a lot of files like this, so disable this test. | |
477 | 502 | if (need!=need_id) { |
478 | 503 | /* shouldn't be a problem though, but warn */ |
479 | 504 | warn(frontend, this->filename, line, "Missing data in - truncated file ?"); |
480 | } | |
481 | #endif | |
505 | ||
506 | /* add any leftover text we've accumulated */ | |
507 | if (need == need_text && text[0]) { | |
508 | int ret = store_subtitle(this, text, t0, t1, x1, x2, y1, y2, ignore_non_utf8, &warned, line, frontend); | |
509 | if (ret < 0) { | |
510 | fclose(f); | |
511 | free(this->subtitles); | |
512 | return ret; | |
513 | } | |
514 | } | |
515 | } | |
482 | 516 | |
483 | 517 | /* fprintf(stderr," %u subtitles loaded.\n", this->num_subtitles); */ |
484 | 518 | |
521 | 555 | ks->subtitles[ks->num_subtitles].len = utf8len; |
522 | 556 | ks->subtitles[ks->num_subtitles].t0 = t; |
523 | 557 | ks->subtitles[ks->num_subtitles].t1 = t+duration; |
558 | ks->subtitles[ks->num_subtitles].x1 = -INT_MAX; | |
559 | ks->subtitles[ks->num_subtitles].x2 = -INT_MAX; | |
560 | ks->subtitles[ks->num_subtitles].y1 = -INT_MAX; | |
561 | ks->subtitles[ks->num_subtitles].y2 = -INT_MAX; | |
524 | 562 | ks->num_subtitles++; |
525 | 563 | } |
526 | 564 | } |
0 | 0 | /* -*- tab-width:4;c-file-style:"cc-mode"; -*- */ |
1 | 1 | /* |
2 | 2 | * theorautils.c - Ogg Theora/Ogg Vorbis Abstraction and Muxing |
3 | * Copyright (C) 2003-2009 <j@v2v.cc> | |
3 | * Copyright (C) 2003-2011 <j@v2v.cc> | |
4 | 4 | * |
5 | 5 | * This program is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * the Free Software Foundation, either version 2 of the License, or | |
8 | 8 | * (at your option) any later version. |
9 | 9 | * |
10 | 10 | * This program is distributed in the hope that it will be useful, |
35 | 35 | #endif |
36 | 36 | #endif |
37 | 37 | |
38 | #ifdef WIN32 | |
39 | #define fseeko fseeko64 | |
40 | #define ftello ftello64 | |
41 | #endif | |
42 | ||
43 | 38 | #include <stdio.h> |
44 | 39 | #include <stdlib.h> |
45 | 40 | #include <unistd.h> |
49 | 44 | #include <assert.h> |
50 | 45 | #include <math.h> |
51 | 46 | #include <limits.h> |
47 | ||
48 | #ifdef WIN32 | |
49 | #if !defined(fseeko) | |
50 | #define fseeko fseeko64 | |
51 | #define ftello ftello64 | |
52 | #endif | |
53 | #endif | |
52 | 54 | |
53 | 55 | #include "theora/theoraenc.h" |
54 | 56 | #include "vorbis/codec.h" |
105 | 107 | |
106 | 108 | info->prev_vorbis_window = -1; |
107 | 109 | info->content_offset = 0; |
110 | ||
111 | info->serialno = 0; | |
108 | 112 | } |
109 | 113 | |
110 | 114 | void oggmux_setup_kate_streams(oggmux_info *info, int n_kate_streams) |
530 | 534 | int index_bytes = 0; |
531 | 535 | int keypoints_cutoff = 0; |
532 | 536 | |
533 | /* Must have indexed keypoints. */ | |
534 | assert(index->max_keypoints > 0 && index->packet_num > 0); | |
537 | /* Must have indexed keypoints to go on */ | |
538 | if (index->max_keypoints == 0 || index->packet_num == 0) { | |
539 | fprintf(stderr, "WARNING: no key points for %s stream %08x\n", name, serialno); | |
540 | return 0; | |
541 | } | |
542 | ||
535 | 543 | /* Must have placeholder packet to rewrite. */ |
536 | 544 | assert(index->page_location > 0); |
537 | 545 | |
812 | 820 | |
813 | 821 | /* yayness. Set up Ogg output stream */ |
814 | 822 | srand (time (NULL)); |
815 | ogg_stream_init (&info->vo, rand ()); | |
823 | info->serialno = rand(); | |
824 | ogg_stream_init (&info->vo, info->serialno++); | |
816 | 825 | |
817 | 826 | if (info->passno!=1) { |
818 | 827 | th_comment_add_tag(&info->tc, "ENCODER", PACKAGE_STRING); |
824 | 833 | } |
825 | 834 | |
826 | 835 | if (!info->audio_only) { |
827 | ogg_stream_init (&info->to, rand ()); /* oops, add one ot the above */ | |
836 | ogg_stream_init (&info->to, info->serialno++); | |
828 | 837 | seek_index_init(&info->theora_index, info->index_interval); |
829 | 838 | } |
830 | 839 | /* init theora done */ |
850 | 859 | vorbis_block_init (&info->vd, &info->vb); |
851 | 860 | |
852 | 861 | seek_index_init(&info->vorbis_index, info->index_interval); |
862 | info->vorbis_granulepos = 0; | |
853 | 863 | } |
854 | 864 | /* audio init done */ |
855 | 865 | |
859 | 869 | int ret, n; |
860 | 870 | for (n=0; n<info->n_kate_streams; ++n) { |
861 | 871 | oggmux_kate_stream *ks=info->kate_streams+n; |
862 | ogg_stream_init (&ks->ko, rand ()); /* oops, add one ot the above */ | |
872 | ogg_stream_init (&ks->ko, info->serialno++); | |
863 | 873 | ret = kate_encode_init (&ks->k, &ks->ki); |
864 | 874 | if (ret<0) { |
865 | 875 | fprintf(stderr, "kate_encode_init: %d\n",ret); |
878 | 888 | } |
879 | 889 | /* kate init done */ |
880 | 890 | |
881 | if (!info->skeleton_3 && | |
891 | if (info->with_skeleton && | |
892 | !info->skeleton_3 && | |
882 | 893 | info->duration == -1) |
883 | 894 | { |
884 | 895 | /* We've not got a duration, we can't index the keyframes. */ |
896 | 907 | page with a Skeleton4.0 header page. */ |
897 | 908 | int skeleton_3 = info->skeleton_3; |
898 | 909 | info->skeleton_3 = 1; |
899 | ogg_stream_init (&info->so, rand()); | |
910 | ogg_stream_init (&info->so, info->serialno++); | |
900 | 911 | add_fishead_packet (info, 3, 0); |
901 | 912 | if (ogg_stream_pageout (&info->so, &og) != 1) { |
902 | 913 | fprintf (stderr, "Internal Ogg library error.\n"); |
920 | 931 | exit (1); |
921 | 932 | } |
922 | 933 | ogg_stream_clear (&info->so); |
923 | ogg_stream_init (&info->so, rand()); | |
934 | ogg_stream_init (&info->so, info->serialno++); | |
924 | 935 | add_fishead_packet (info, 4, 0); |
925 | 936 | if (ogg_stream_pageout (&info->so, &og) != 1) { |
926 | 937 | fprintf (stderr, "Internal Ogg library error.\n"); |
1214 | 1225 | void oggmux_add_audio (oggmux_info *info, int16_t * buffer, int bytes, int samples, int e_o_s) { |
1215 | 1226 | ogg_packet op; |
1216 | 1227 | |
1217 | int i,j, count = 0; | |
1228 | int i, j, k, count = 0; | |
1218 | 1229 | float **vorbis_buffer; |
1219 | 1230 | |
1220 | 1231 | if (bytes <= 0 && samples <= 0) { |
1227 | 1238 | /* uninterleave samples */ |
1228 | 1239 | for (i = 0; i < samples; i++) { |
1229 | 1240 | for (j=0;j<info->channels;j++) { |
1230 | vorbis_buffer[j][i] = buffer[count++] / 32768.f; | |
1241 | k = j; | |
1242 | /* 5.1 input: [fl, fr, c, lfe, rl, rr] */ | |
1243 | if(info->channels == 6) { | |
1244 | switch(j) { | |
1245 | case 0: k = 0; break; | |
1246 | case 1: k = 2; break; | |
1247 | case 2: k = 1; break; | |
1248 | case 3: k = 5; break; | |
1249 | case 4: k = 3; break; | |
1250 | case 5: k = 4; break; | |
1251 | default: k = j; | |
1252 | } | |
1253 | } | |
1254 | vorbis_buffer[k][i] = buffer[count++] / 32768.f; | |
1231 | 1255 | } |
1232 | 1256 | } |
1233 | 1257 | vorbis_analysis_wrote (&info->vd, samples); |
1258 | 1282 | info->prev_vorbis_window = info->vb.pcmend; |
1259 | 1283 | |
1260 | 1284 | ogg_int64_t start_granule = op.granulepos - num_samples; |
1285 | if (start_granule < 0) { | |
1286 | /* The first vorbis content packet can have more samples than | |
1287 | its granulepos reports. This is allowed by the spec, and | |
1288 | players should discard the leading samples and not play them. | |
1289 | Thus the indexer needs to discard them as well.*/ | |
1290 | if (op.packetno != 4) { | |
1291 | /* We only expect negative start granule in the first content | |
1292 | packet, not any of the others... */ | |
1293 | fprintf(stderr, "WARNING: vorbis packet %lld has calculated start" | |
1294 | " granule of %lld, but it should be non-negative!", | |
1295 | op.packetno, start_granule); | |
1296 | } | |
1297 | start_granule = 0; | |
1298 | } | |
1299 | if (start_granule < info->vorbis_granulepos) { | |
1300 | /* This packet starts before the end of the previous packet. This is | |
1301 | allowed by the specification in the last packet only, and the | |
1302 | trailing samples should be discarded and not played/indexed. */ | |
1303 | if (!op.e_o_s) { | |
1304 | fprintf(stderr, "WARNING: vorbis packet %lld (granulepos %lld) starts before" | |
1305 | " the end of the preceeding packet!", op.packetno, op.granulepos); | |
1306 | } | |
1307 | start_granule = info->vorbis_granulepos; | |
1308 | } | |
1309 | info->vorbis_granulepos = op.granulepos; | |
1261 | 1310 | ogg_int64_t start_time = vorbis_time (&info->vd, start_granule); |
1262 | 1311 | |
1263 | 1312 | if (op.granulepos != -1 && |
1302 | 1351 | * @param text the utf-8 text |
1303 | 1352 | * @param len the number of bytes in the text |
1304 | 1353 | */ |
1305 | void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len) { | |
1354 | void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len, int x1, int x2, int y1, int y2) { | |
1306 | 1355 | ogg_packet op; |
1307 | 1356 | oggmux_kate_stream *ks=info->kate_streams+idx; |
1308 | 1357 | int ret; |
1358 | if (x1!=-INT_MAX && y1!=-INT_MAX && x2!=-INT_MAX && y2!=-INT_MAX) { | |
1359 | kate_region kr; | |
1360 | kate_region_init(&kr); | |
1361 | kr.metric=kate_pixel; | |
1362 | kr.x=x1; | |
1363 | kr.y=y1; | |
1364 | kr.w=x2-x1+1; | |
1365 | kr.h=y2-y1+1; | |
1366 | ret=kate_encode_set_region(&ks->k,&kr); | |
1367 | if (ret<0) { | |
1368 | fprintf(stderr,"Error setting region: %d\n",ret); | |
1369 | return; | |
1370 | } | |
1371 | } | |
1309 | 1372 | ret = kate_ogg_encode_text(&ks->k, t0, t1, text, len, &op); |
1310 | 1373 | if (ret>=0) { |
1311 | 1374 | if (!info->skeleton_3 && info->passno != 1) { |
1444 | 1507 | else if (timebase - last > 0.5 || timebase < last || !remaining) { |
1445 | 1508 | last = timebase; |
1446 | 1509 | if (info->frontend) { |
1510 | #ifdef WIN32 | |
1511 | fprintf(info->frontend, "{\"duration\": %f, \"position\": %.02f, \"audio_kbps\": %d, \"video_kbps\": %d, \"remaining\": %.02f}\n", | |
1512 | info->duration, | |
1513 | timebase, | |
1514 | info->akbps, info->vkbps, | |
1515 | remaining | |
1516 | ); | |
1517 | #else | |
1447 | 1518 | fprintf(info->frontend, "{\"duration\": %lf, \"position\": %.02lf, \"audio_kbps\": %d, \"video_kbps\": %d, \"remaining\": %.02lf}\n", |
1448 | 1519 | info->duration, |
1449 | 1520 | timebase, |
1450 | 1521 | info->akbps, info->vkbps, |
1451 | 1522 | remaining |
1452 | 1523 | ); |
1524 | #endif | |
1453 | 1525 | fflush (info->frontend); |
1454 | 1526 | } |
1455 | 1527 | else if (timebase > 0) { |
4 | 4 | * |
5 | 5 | * This program is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU General Public License as published by |
7 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * the Free Software Foundation, either version 2 of the License, or | |
8 | 8 | * (at your option) any later version. |
9 | 9 | * |
10 | 10 | * This program is distributed in the hope that it will be useful, |
156 | 156 | calculate duration of vorbis packets. */ |
157 | 157 | /* The offset of the first non header page in bytes. */ |
158 | 158 | ogg_int64_t content_offset; |
159 | /* Granulepos of the last encoded packet. */ | |
160 | ogg_int64_t vorbis_granulepos; | |
161 | ||
162 | ogg_int32_t serialno; | |
159 | 163 | } |
160 | 164 | oggmux_info; |
161 | 165 | |
165 | 169 | extern void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s); |
166 | 170 | extern void oggmux_add_audio (oggmux_info *info, int16_t * readbuffer, int bytesread, int samplesread,int e_o_s); |
167 | 171 | #ifdef HAVE_KATE |
168 | extern void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len); | |
172 | extern void oggmux_add_kate_text (oggmux_info *info, int idx, double t0, double t1, const char *text, size_t len, int x1, int x2, int y1, int y2); | |
169 | 173 | extern void oggmux_add_kate_image (oggmux_info *info, int idx, double t0, double t1, const kate_region *kr, const kate_palette *kp, const kate_bitmap *kb); |
170 | 174 | extern void oggmux_add_kate_end_packet (oggmux_info *info, int idx, double t); |
171 | 175 | #endif |