Init Repo
This commit is contained in:
Vendored
+674
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+5
File diff suppressed because one or more lines are too long
+227
@@ -0,0 +1,227 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Community
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Community
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Organisation-1" href="#Organisation-1">1 Organisation</a></li>
|
||||
<li><a id="toc-General-Assembly-1" href="#General-Assembly-1">2 General Assembly</a></li>
|
||||
<li><a id="toc-Voting-1" href="#Voting-1">3 Voting</a></li>
|
||||
<li><a id="toc-Technical-Committee-1" href="#Technical-Committee-1">4 Technical Committee</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Resolution-Process-1" href="#Resolution-Process-1">4.1 Resolution Process</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Seizing" href="#Seizing">4.1.1 Seizing</a></li>
|
||||
<li><a id="toc-Announcement" href="#Announcement">4.1.2 Announcement</a></li>
|
||||
<li><a id="toc-RFC-call" href="#RFC-call">4.1.3 RFC call</a></li>
|
||||
<li><a id="toc-Within-TC" href="#Within-TC">4.1.4 Within TC</a></li>
|
||||
<li><a id="toc-Decisions" href="#Decisions">4.1.5 Decisions</a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Community-Committee-1" href="#Community-Committee-1">5 Community Committee</a></li>
|
||||
<li><a id="toc-Code-of-Conduct-1" href="#Code-of-Conduct-1">6 Code of Conduct</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="anchor" id="Organisation"></a><a name="Organisation-1"></a>
|
||||
<h2 class="chapter">1 Organisation<span class="pull-right"><a class="anchor hidden-xs" href="#Organisation-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Organisation-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg project is organized through a community working on global consensus.
|
||||
</p>
|
||||
<p>Decisions are taken by the ensemble of active members, through voting and are aided by two committees.
|
||||
</p>
|
||||
<a class="anchor" id="General-Assembly"></a><a name="General-Assembly-1"></a>
|
||||
<h2 class="chapter">2 General Assembly<span class="pull-right"><a class="anchor hidden-xs" href="#General-Assembly-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-General-Assembly-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The ensemble of active members is called the General Assembly (GA).
|
||||
</p>
|
||||
<p>The General Assembly is sovereign and legitimate for all its decisions regarding the FFmpeg project.
|
||||
</p>
|
||||
<p>The General Assembly is made up of active contributors.
|
||||
</p>
|
||||
<p>Contributors are considered "active contributors" if they have authored more than 20 patches in the last 36 months in the main FFmpeg repository, or if they have been voted in by the GA.
|
||||
</p>
|
||||
<p>The list of active contributors is updated twice each year, on 1st January and 1st July, 0:00 UTC.
|
||||
</p>
|
||||
<p>Additional members are added to the General Assembly through a vote after proposal by a member of the General Assembly. They are part of the GA for two years, after which they need a confirmation by the GA.
|
||||
</p>
|
||||
<p>A script to generate the current members of the general assembly (minus members voted in) can be found in ‘tools/general_assembly.pl‘.
|
||||
</p>
|
||||
<a class="anchor" id="Voting"></a><a name="Voting-1"></a>
|
||||
<h2 class="chapter">3 Voting<span class="pull-right"><a class="anchor hidden-xs" href="#Voting-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Voting-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Voting is done using a ranked voting system, currently running on https://vote.ffmpeg.org/ .
|
||||
</p>
|
||||
<p>Majority vote means more than 50% of the expressed ballots.
|
||||
</p>
|
||||
<a class="anchor" id="Technical-Committee"></a><a name="Technical-Committee-1"></a>
|
||||
<h2 class="chapter">4 Technical Committee<span class="pull-right"><a class="anchor hidden-xs" href="#Technical-Committee-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Technical-Committee-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The Technical Committee (TC) is here to arbitrate and make decisions when technical conflicts occur in the project. They will consider the merits of all the positions, judge them and make a decision.
|
||||
</p>
|
||||
<p>The TC resolves technical conflicts but is not a technical steering committee.
|
||||
</p>
|
||||
<p>Decisions by the TC are binding for all the contributors.
|
||||
</p>
|
||||
<p>Decisions made by the TC can be re-opened after 1 year or by a majority vote of the General Assembly, requested by one of the member of the GA.
|
||||
</p>
|
||||
<p>The TC is elected by the General Assembly for a duration of 1 year, and is composed of 5 members. Members can be re-elected if they wish. A majority vote in the General Assembly can trigger a new election of the TC.
|
||||
</p>
|
||||
<p>The members of the TC can be elected from outside of the GA. Candidates for election can either be suggested or self-nominated.
|
||||
</p>
|
||||
<p>The conflict resolution process is detailed in the resolution process document.
|
||||
</p>
|
||||
<p>The TC can be contacted at <tc@ffmpeg>.
|
||||
</p>
|
||||
<a class="anchor" id="Resolution-Process"></a><a name="Resolution-Process-1"></a>
|
||||
<h3 class="section">4.1 Resolution Process<span class="pull-right"><a class="anchor hidden-xs" href="#Resolution-Process-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resolution-Process-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The Technical Committee (TC) is here to arbitrate and make decisions when technical conflicts occur in the project.
|
||||
</p>
|
||||
<p>The TC main role is to resolve technical conflicts. It is therefore not a technical steering committee, but it is understood that some decisions might impact the future of the project.
|
||||
</p>
|
||||
<a name="Seizing"></a>
|
||||
<h4 class="subsection">4.1.1 Seizing<span class="pull-right"><a class="anchor hidden-xs" href="#Seizing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Seizing" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>The TC can take possession of any technical matter that it sees fit.
|
||||
</p>
|
||||
<p>To involve the TC in a matter, email tc or CC them on an ongoing discussion.
|
||||
</p>
|
||||
<p>As members of TC are developers, they also can email tc to raise an issue.
|
||||
</p><a name="Announcement"></a>
|
||||
<h4 class="subsection">4.1.2 Announcement<span class="pull-right"><a class="anchor hidden-xs" href="#Announcement" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Announcement" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>The TC, once seized, must announce itself on the main mailing list, with a [TC] tag.
|
||||
</p>
|
||||
<p>The TC has 2 modes of operation: a RFC one and an internal one.
|
||||
</p>
|
||||
<p>If the TC thinks it needs the input from the larger community, the TC can call for a RFC. Else, it can decide by itself.
|
||||
</p>
|
||||
<p>The decision to use a RFC process or an internal discussion is a discretionary decision of the TC.
|
||||
</p>
|
||||
<p>The TC can also reject a seizure for a few reasons such as: the matter was not discussed enough previously; it lacks expertise to reach a beneficial decision on the matter; or the matter is too trivial.
|
||||
</p><a name="RFC-call"></a>
|
||||
<h4 class="subsection">4.1.3 RFC call<span class="pull-right"><a class="anchor hidden-xs" href="#RFC-call" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-RFC-call" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>In the RFC mode, one person from the TC posts on the mailing list the technical question and will request input from the community.
|
||||
</p>
|
||||
<p>The mail will have the following specification:
|
||||
</p>
|
||||
<p>a precise title
|
||||
a specific tag [TC RFC]
|
||||
a top-level email
|
||||
contain a precise question that does not exceed 100 words and that is answerable by developers
|
||||
may have an extra description, or a link to a previous discussion, if deemed necessary,
|
||||
contain a precise end date for the answers.
|
||||
</p>
|
||||
<p>The answers from the community must be on the main mailing list and must have the following specification:
|
||||
</p>
|
||||
<p>keep the tag and the title unchanged
|
||||
limited to 400 words
|
||||
a first-level, answering directly to the main email
|
||||
answering to the question.
|
||||
</p>
|
||||
<p>Further replies to answers are permitted, as long as they conform to the community standards of politeness, they are limited to 100 words, and are not nested more than once. (max-depth=2)
|
||||
</p>
|
||||
<p>After the end-date, mails on the thread will be ignored.
|
||||
</p>
|
||||
<p>Violations of those rules will be escalated through the Community Committee.
|
||||
</p>
|
||||
<p>After all the emails are in, the TC has 96 hours to give its final decision. Exceptionally, the TC can request an extra delay, that will be notified on the mailing list.
|
||||
</p><a name="Within-TC"></a>
|
||||
<h4 class="subsection">4.1.4 Within TC<span class="pull-right"><a class="anchor hidden-xs" href="#Within-TC" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Within-TC" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>In the internal case, the TC has 96 hours to give its final decision. Exceptionally, the TC can request an extra delay.
|
||||
</p><a name="Decisions"></a>
|
||||
<h4 class="subsection">4.1.5 Decisions<span class="pull-right"><a class="anchor hidden-xs" href="#Decisions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Decisions" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>The decisions from the TC will be sent on the mailing list, with the [TC] tag.
|
||||
</p>
|
||||
<p>Internally, the TC should take decisions with a majority, or using ranked-choice voting.
|
||||
</p>
|
||||
<p>Each TC member must vote on such decision according to what is, in their view, best for the project.
|
||||
</p>
|
||||
<p>If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
|
||||
discussion and vote.
|
||||
</p>
|
||||
<p>A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
|
||||
</p>
|
||||
<p>The decision from the TC should be published with a summary of the reasons that lead to this decision.
|
||||
</p>
|
||||
<p>The decisions from the TC are final, until the matters are reopened after no less than one year.
|
||||
</p>
|
||||
<a class="anchor" id="Community-Committee"></a><a name="Community-Committee-1"></a>
|
||||
<h2 class="chapter">5 Community Committee<span class="pull-right"><a class="anchor hidden-xs" href="#Community-Committee-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Community-Committee-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The Community Committee (CC) is here to arbitrage and make decisions when inter-personal conflicts occur in the project. It will decide quickly and take actions, for the sake of the project.
|
||||
</p>
|
||||
<p>The CC can remove privileges of offending members, including removal of commit access and temporary ban from the community.
|
||||
</p>
|
||||
<p>Decisions made by the CC can be re-opened after 1 year or by a majority vote of the General Assembly. Indefinite bans from the community must be confirmed by the General Assembly, in a majority vote.
|
||||
</p>
|
||||
<p>The CC is elected by the General Assembly for a duration of 1 year, and is composed of 5 members. Members can be re-elected if they wish. A majority vote in the General Assembly can trigger a new election of the CC.
|
||||
</p>
|
||||
<p>The members of the CC can be elected from outside of the GA. Candidates for election can either be suggested or self-nominated.
|
||||
</p>
|
||||
<p>The CC is governed by and responsible for enforcing the Code of Conduct.
|
||||
</p>
|
||||
<p>The CC can be contacted at <cc@ffmpeg>.
|
||||
</p>
|
||||
<a class="anchor" id="Code-of-Conduct"></a><a name="Code-of-Conduct-1"></a>
|
||||
<h2 class="chapter">6 Code of Conduct<span class="pull-right"><a class="anchor hidden-xs" href="#Code-of-Conduct-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Code-of-Conduct-1" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
</p>
|
||||
<p>Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
</p>
|
||||
<p>Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it’s rarely good to start with that as initial assumption.
|
||||
</p>
|
||||
<p>Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
</p>
|
||||
<p>Try to help other team members and cooperate if you can.
|
||||
</p>
|
||||
<p>The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
</p>
|
||||
<p>If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
</p>
|
||||
<p>Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
</p>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+165
@@ -0,0 +1,165 @@
|
||||
a.summary-letter {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2D6198;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #884488;
|
||||
}
|
||||
|
||||
#banner {
|
||||
background-color: white;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#banner img {
|
||||
margin-bottom: 1px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#body {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #313131;
|
||||
margin: 0;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#container {
|
||||
background-color: white;
|
||||
color: #202020;
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
#footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 a, h2 a, h3 a, h4 a {
|
||||
text-decoration: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
padding-left: 0.4em;
|
||||
border-radius: 4px;
|
||||
padding-bottom: 0.25em;
|
||||
padding-top: 0.25em;
|
||||
border: 1px solid #6A996A;
|
||||
}
|
||||
|
||||
h1 {
|
||||
background-color: #7BB37B;
|
||||
color: #151515;
|
||||
font-size: 1.2em;
|
||||
padding-bottom: 0.3em;
|
||||
padding-top: 0.3em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #313131;
|
||||
font-size: 1.0em;
|
||||
background-color: #ABE3AB;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: #313131;
|
||||
font-size: 0.9em;
|
||||
margin-bottom: -6px;
|
||||
background-color: #BBF3BB;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: #313131;
|
||||
font-size: 0.8em;
|
||||
margin-bottom: -8px;
|
||||
background-color: #D1FDD1;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#navbar {
|
||||
background-color: #738073;
|
||||
border-bottom: 1px solid #5C665C;
|
||||
border-top: 1px solid #5C665C;
|
||||
margin-top: 12px;
|
||||
padding: 0.3em;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#navbar a, #navbar_secondary a {
|
||||
color: white;
|
||||
padding: 0.3em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#navbar a:hover, #navbar_secondary a:hover {
|
||||
background-color: #313131;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#navbar_secondary {
|
||||
background-color: #738073;
|
||||
border-bottom: 1px solid #5C665C;
|
||||
border-left: 1px solid #5C665C;
|
||||
border-right: 1px solid #5C665C;
|
||||
padding: 0.3em;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-left: 3em;
|
||||
margin-right: 3em;
|
||||
padding: 0.3em;
|
||||
border: 1px solid #bbb;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
dl dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#proj_desc {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
#repos {
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
border-collapse: collapse;
|
||||
border: solid 1px #6A996A;
|
||||
}
|
||||
|
||||
#repos th {
|
||||
background-color: #7BB37B;
|
||||
border: solid 1px #6A996A;
|
||||
}
|
||||
|
||||
#repos td {
|
||||
padding: 0.2em;
|
||||
border: solid 1px #6A996A;
|
||||
}
|
||||
+1153
File diff suppressed because it is too large
Load Diff
+2967
File diff suppressed because it is too large
Load Diff
Vendored
+821
@@ -0,0 +1,821 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
FFmpeg FAQ
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
FFmpeg FAQ
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-General-Questions" href="#General-Questions">1 General Questions</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.1 Why doesn’t FFmpeg support feature [xyz]?</a></li>
|
||||
<li><a id="toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></li>
|
||||
<li><a id="toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.3 I cannot read this file although this format seems to be supported by ffmpeg.</a></li>
|
||||
<li><a id="toc-Which-codecs-are-supported-by-Windows_003f" href="#Which-codecs-are-supported-by-Windows_003f">1.4 Which codecs are supported by Windows?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Compilation" href="#Compilation">2 Compilation</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code class="code">error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></li>
|
||||
<li><a id="toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" href="#I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f">2.2 I have installed this library with my distro’s package manager. Why does <code class="command">configure</code> not see it?</a></li>
|
||||
<li><a id="toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f" href="#How-do-I-make-pkg_002dconfig-find-my-libraries_003f">2.3 How do I make <code class="command">pkg-config</code> find my libraries?</a></li>
|
||||
<li><a id="toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" href="#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f">2.4 How do I use <code class="command">pkg-config</code> when cross-compiling?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Usage" href="#Usage">3 Usage</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></li>
|
||||
<li><a id="toc-How-do-I-encode-single-pictures-into-movies_003f" href="#How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></li>
|
||||
<li><a id="toc-How-do-I-encode-movie-to-single-pictures_003f" href="#How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></li>
|
||||
<li><a id="toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></li>
|
||||
<li><a id="toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></li>
|
||||
<li><a id="toc-_002df-jpeg-doesn_0027t-work_002e" href="#g_t_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn’t work.</a></li>
|
||||
<li><a id="toc-Why-can-I-not-change-the-frame-rate_003f" href="#Why-can-I-not-change-the-frame-rate_003f">3.7 Why can I not change the frame rate?</a></li>
|
||||
<li><a id="toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></li>
|
||||
<li><a id="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.9 Which are good parameters for encoding high quality MPEG-4?</a></li>
|
||||
<li><a id="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></li>
|
||||
<li><a id="toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></li>
|
||||
<li><a id="toc-How-can-I-read-DirectShow-files_003f" href="#How-can-I-read-DirectShow-files_003f">3.12 How can I read DirectShow files?</a></li>
|
||||
<li><a id="toc-How-can-I-join-video-files_003f" href="#How-can-I-join-video-files_003f">3.13 How can I join video files?</a></li>
|
||||
<li><a id="toc-How-can-I-concatenate-video-files_003f" href="#How-can-I-concatenate-video-files_003f">3.14 How can I concatenate video files?</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Concatenating-using-the-concat-filter" href="#Concatenating-using-the-concat-filter">3.14.1 Concatenating using the concat <em class="emph">filter</em></a></li>
|
||||
<li><a id="toc-Concatenating-using-the-concat-demuxer" href="#Concatenating-using-the-concat-demuxer">3.14.2 Concatenating using the concat <em class="emph">demuxer</em></a></li>
|
||||
<li><a id="toc-Concatenating-using-the-concat-protocol-_0028file-level_0029" href="#Concatenating-using-the-concat-protocol-_0028file-level_0029">3.14.3 Concatenating using the concat <em class="emph">protocol</em> (file level)</a></li>
|
||||
<li><a id="toc-Concatenating-using-raw-audio-and-video" href="#Concatenating-using-raw-audio-and-video">3.14.4 Concatenating using raw audio and video</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" href="#Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e">3.15 Using <samp class="option">-f lavfi</samp>, audio becomes mono for no apparent reason.</a></li>
|
||||
<li><a id="toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" href="#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f">3.16 Why does FFmpeg not see the subtitles in my VOB file?</a></li>
|
||||
<li><a id="toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" href="#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f">3.17 Why was the <code class="command">ffmpeg</code> <samp class="option">-sameq</samp> option removed? What to use instead?</a></li>
|
||||
<li><a id="toc-I-have-a-stretched-video_002c-why-does-scaling-not-fix-it_003f" href="#I-have-a-stretched-video_002c-why-does-scaling-not-fix-it_003f">3.18 I have a stretched video, why does scaling not fix it?</a></li>
|
||||
<li><a id="toc-How-do-I-run-ffmpeg-as-a-background-task_003f" href="#How-do-I-run-ffmpeg-as-a-background-task_003f">3.19 How do I run ffmpeg as a background task?</a></li>
|
||||
<li><a id="toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" href="#How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f">3.20 How do I prevent ffmpeg from suspending with a message like <em class="emph">suspended (tty output)</em>?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Development" href="#Development">4 Development</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></li>
|
||||
<li><a id="toc-Can-you-support-my-C-compiler-XXX_003f" href="#Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></li>
|
||||
<li><a id="toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></li>
|
||||
<li><a id="toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.4 Can you add automake, libtool or autoconf support?</a></li>
|
||||
<li><a id="toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" href="#Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite FFmpeg in object-oriented C++?</a></li>
|
||||
<li><a id="toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.6 Why are the ffmpeg programs devoid of debugging symbols?</a></li>
|
||||
<li><a id="toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.7 I do not like the LGPL, can I contribute code under the GPL instead?</a></li>
|
||||
<li><a id="toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" href="#I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e">4.8 I’m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.</a></li>
|
||||
<li><a id="toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" href="#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.9 I’m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.</a></li>
|
||||
<li><a id="toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" href="#I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope">4.10 I’m using libavutil from within my C++ application but the compiler complains about ’UINT64_C’ was not declared in this scope</a></li>
|
||||
<li><a id="toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></li>
|
||||
<li><a id="toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></li>
|
||||
<li><a id="toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></li>
|
||||
<li><a id="toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.</a></li>
|
||||
<li><a id="toc-Why-is-make-fate-not-running-all-tests_003f" href="#Why-is-make-fate-not-running-all-tests_003f">4.15 Why is <code class="code">make fate</code> not running all tests?</a></li>
|
||||
<li><a id="toc-Why-is-make-fate-not-finding-the-samples_003f" href="#Why-is-make-fate-not-finding-the-samples_003f">4.16 Why is <code class="code">make fate</code> not finding the samples?</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="General-Questions"></a>
|
||||
<h2 class="chapter">1 General Questions<span class="pull-right"><a class="anchor hidden-xs" href="#General-Questions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-General-Questions" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f"></a>
|
||||
<h3 class="section">1.1 Why doesn’t FFmpeg support feature [xyz]?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Because no one has taken on that task yet. FFmpeg development is
|
||||
driven by the tasks that are important to the individual developers.
|
||||
If there is a feature that is important to you, the best way to get
|
||||
it implemented is to undertake the task yourself or sponsor a developer.
|
||||
</p>
|
||||
<a name="FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f"></a>
|
||||
<h3 class="section">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?<span class="pull-right"><a class="anchor hidden-xs" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>No. Windows DLLs are not portable, bloated and often slow.
|
||||
Moreover FFmpeg strives to support all codecs natively.
|
||||
A DLL loader is not conducive to that goal.
|
||||
</p>
|
||||
<a name="I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e"></a>
|
||||
<h3 class="section">1.3 I cannot read this file although this format seems to be supported by ffmpeg.<span class="pull-right"><a class="anchor hidden-xs" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Even if ffmpeg can read the container format, it may not support all its
|
||||
codecs. Please consult the supported codec list in the ffmpeg
|
||||
documentation.
|
||||
</p>
|
||||
<a name="Which-codecs-are-supported-by-Windows_003f"></a>
|
||||
<h3 class="section">1.4 Which codecs are supported by Windows?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-codecs-are-supported-by-Windows_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-codecs-are-supported-by-Windows_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Windows does not support standard formats like MPEG very well, unless you
|
||||
install some additional codecs.
|
||||
</p>
|
||||
<p>The following list of video codecs should work on most Windows systems:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">msmpeg4v2</samp></dt>
|
||||
<dd><p>.avi/.asf
|
||||
</p></dd>
|
||||
<dt><samp class="option">msmpeg4</samp></dt>
|
||||
<dd><p>.asf only
|
||||
</p></dd>
|
||||
<dt><samp class="option">wmv1</samp></dt>
|
||||
<dd><p>.asf only
|
||||
</p></dd>
|
||||
<dt><samp class="option">wmv2</samp></dt>
|
||||
<dd><p>.asf only
|
||||
</p></dd>
|
||||
<dt><samp class="option">mpeg4</samp></dt>
|
||||
<dd><p>Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
|
||||
</p></dd>
|
||||
<dt><samp class="option">mpeg1video</samp></dt>
|
||||
<dd><p>.mpg only
|
||||
</p></dd>
|
||||
</dl>
|
||||
<p>Note, ASF files often have .wmv or .wma extensions in Windows. It should also
|
||||
be mentioned that Microsoft claims a patent on the ASF format, and may sue
|
||||
or threaten users who create ASF files with non-Microsoft software. It is
|
||||
strongly advised to avoid ASF where possible.
|
||||
</p>
|
||||
<p>The following list of audio codecs should work on most Windows systems:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">adpcm_ima_wav</samp></dt>
|
||||
<dt><samp class="option">adpcm_ms</samp></dt>
|
||||
<dt><samp class="option">pcm_s16le</samp></dt>
|
||||
<dd><p>always
|
||||
</p></dd>
|
||||
<dt><samp class="option">libmp3lame</samp></dt>
|
||||
<dd><p>If some MP3 codec like LAME is installed.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<a name="Compilation"></a>
|
||||
<h2 class="chapter">2 Compilation<span class="pull-right"><a class="anchor hidden-xs" href="#Compilation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Compilation" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027"></a>
|
||||
<h3 class="section">2.1 <code class="code">error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code><span class="pull-right"><a class="anchor hidden-xs" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>This is a bug in gcc. Do not report it to us. Instead, please report it to
|
||||
the gcc developers. Note that we will not add workarounds for gcc bugs.
|
||||
</p>
|
||||
<p>Also note that (some of) the gcc developers believe this is not a bug or
|
||||
not a bug they should fix:
|
||||
<a class="url" href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203</a>.
|
||||
Then again, some of them do not know the difference between an undecidable
|
||||
problem and an NP-hard problem...
|
||||
</p>
|
||||
<a name="I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f"></a>
|
||||
<h3 class="section">2.2 I have installed this library with my distro’s package manager. Why does <code class="command">configure</code> not see it?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Distributions usually split libraries in several packages. The main package
|
||||
contains the files necessary to run programs using the library. The
|
||||
development package contains the files necessary to build programs using the
|
||||
library. Sometimes, docs and/or data are in a separate package too.
|
||||
</p>
|
||||
<p>To build FFmpeg, you need to install the development package. It is usually
|
||||
called <samp class="file">libfoo-dev</samp> or <samp class="file">libfoo-devel</samp>. You can remove it after the
|
||||
build is finished, but be sure to keep the main package.
|
||||
</p>
|
||||
<a name="How-do-I-make-pkg_002dconfig-find-my-libraries_003f"></a>
|
||||
<h3 class="section">2.3 How do I make <code class="command">pkg-config</code> find my libraries?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-make-pkg_002dconfig-find-my-libraries_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Somewhere along with your libraries, there is a <samp class="file">.pc</samp> file (or several)
|
||||
in a <samp class="file">pkgconfig</samp> directory. You need to set environment variables to
|
||||
point <code class="command">pkg-config</code> to these files.
|
||||
</p>
|
||||
<p>If you need to <em class="emph">add</em> directories to <code class="command">pkg-config</code>’s search list
|
||||
(typical use case: library installed separately), add it to
|
||||
<code class="code">$PKG_CONFIG_PATH</code>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
|
||||
</pre></div>
|
||||
|
||||
<p>If you need to <em class="emph">replace</em> <code class="command">pkg-config</code>’s search list
|
||||
(typical use case: cross-compiling), set it in
|
||||
<code class="code">$PKG_CONFIG_LIBDIR</code>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
|
||||
</pre></div>
|
||||
|
||||
<p>If you need to know the library’s internal dependencies (typical use: static
|
||||
linking), add the <code class="code">--static</code> option to <code class="command">pkg-config</code>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">./configure --pkg-config-flags=--static
|
||||
</pre></div>
|
||||
|
||||
<a name="How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f"></a>
|
||||
<h3 class="section">2.4 How do I use <code class="command">pkg-config</code> when cross-compiling?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The best way is to install <code class="command">pkg-config</code> in your cross-compilation
|
||||
environment. It will automatically use the cross-compilation libraries.
|
||||
</p>
|
||||
<p>You can also use <code class="command">pkg-config</code> from the host environment by
|
||||
specifying explicitly <code class="code">--pkg-config=pkg-config</code> to <code class="command">configure</code>.
|
||||
In that case, you must point <code class="command">pkg-config</code> to the correct directories
|
||||
using the <code class="code">PKG_CONFIG_LIBDIR</code>, as explained in the previous entry.
|
||||
</p>
|
||||
<p>As an intermediate solution, you can place in your cross-compilation
|
||||
environment a script that calls the host <code class="command">pkg-config</code> with
|
||||
<code class="code">PKG_CONFIG_LIBDIR</code> set. That script can look like that:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">#!/bin/sh
|
||||
PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
|
||||
export PKG_CONFIG_LIBDIR
|
||||
exec /usr/bin/pkg-config "$@"
|
||||
</pre></div>
|
||||
|
||||
<a name="Usage"></a>
|
||||
<h2 class="chapter">3 Usage<span class="pull-right"><a class="anchor hidden-xs" href="#Usage" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Usage" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="ffmpeg-does-not-work_003b-what-is-wrong_003f"></a>
|
||||
<h3 class="section">3.1 ffmpeg does not work; what is wrong?<span class="pull-right"><a class="anchor hidden-xs" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Try a <code class="code">make distclean</code> in the ffmpeg source directory before the build.
|
||||
If this does not help see
|
||||
(<a class="url" href="https://ffmpeg.org/bugreports.html">https://ffmpeg.org/bugreports.html</a>).
|
||||
</p>
|
||||
<a name="How-do-I-encode-single-pictures-into-movies_003f"></a>
|
||||
<h3 class="section">3.2 How do I encode single pictures into movies?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-single-pictures-into-movies_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-single-pictures-into-movies_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>First, rename your pictures to follow a numerical sequence.
|
||||
For example, img1.jpg, img2.jpg, img3.jpg,...
|
||||
Then you may run:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
|
||||
</pre></div>
|
||||
|
||||
<p>Notice that ‘<samp class="samp">%d</samp>’ is replaced by the image number.
|
||||
</p>
|
||||
<p><samp class="file">img%03d.jpg</samp> means the sequence <samp class="file">img001.jpg</samp>, <samp class="file">img002.jpg</samp>, etc.
|
||||
</p>
|
||||
<p>Use the <samp class="option">-start_number</samp> option to declare a starting number for
|
||||
the sequence. This is useful if your sequence does not start with
|
||||
<samp class="file">img001.jpg</samp> but is still in a numerical order. The following
|
||||
example will start with <samp class="file">img100.jpg</samp>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
|
||||
</pre></div>
|
||||
|
||||
<p>If you have large number of pictures to rename, you can use the
|
||||
following command to ease the burden. The command, using the bourne
|
||||
shell syntax, symbolically links all files in the current directory
|
||||
that match <code class="code">*jpg</code> to the <samp class="file">/tmp</samp> directory in the sequence of
|
||||
<samp class="file">img001.jpg</samp>, <samp class="file">img002.jpg</samp> and so on.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
|
||||
</pre></div>
|
||||
|
||||
<p>If you want to sequence them by oldest modified first, substitute
|
||||
<code class="code">$(ls -r -t *jpg)</code> in place of <code class="code">*jpg</code>.
|
||||
</p>
|
||||
<p>Then run:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
|
||||
</pre></div>
|
||||
|
||||
<p>The same logic is used for any image format that ffmpeg reads.
|
||||
</p>
|
||||
<p>You can also use <code class="command">cat</code> to pipe images to ffmpeg:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
|
||||
</pre></div>
|
||||
|
||||
<a name="How-do-I-encode-movie-to-single-pictures_003f"></a>
|
||||
<h3 class="section">3.3 How do I encode movie to single pictures?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-movie-to-single-pictures_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-movie-to-single-pictures_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Use:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i movie.mpg movie%d.jpg
|
||||
</pre></div>
|
||||
|
||||
<p>The <samp class="file">movie.mpg</samp> used as input will be converted to
|
||||
<samp class="file">movie1.jpg</samp>, <samp class="file">movie2.jpg</samp>, etc...
|
||||
</p>
|
||||
<p>Instead of relying on file format self-recognition, you may also use
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">-c:v ppm</samp></dt>
|
||||
<dt><samp class="option">-c:v png</samp></dt>
|
||||
<dt><samp class="option">-c:v mjpeg</samp></dt>
|
||||
</dl>
|
||||
<p>to force the encoding.
|
||||
</p>
|
||||
<p>Applying that to the previous example:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
|
||||
</pre></div>
|
||||
|
||||
<p>Beware that there is no "jpeg" codec. Use "mjpeg" instead.
|
||||
</p>
|
||||
<a name="Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f"></a>
|
||||
<h3 class="section">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>For multithreaded MPEG* encoding, the encoded slices must be independent,
|
||||
otherwise thread n would practically have to wait for n-1 to finish, so it’s
|
||||
quite logical that there is a small reduction of quality. This is not a bug.
|
||||
</p>
|
||||
<a name="How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f"></a>
|
||||
<h3 class="section">3.5 How can I read from the standard input or write to the standard output?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Use <samp class="file">-</samp> as file name.
|
||||
</p>
|
||||
<a name="g_t_002df-jpeg-doesn_0027t-work_002e"></a>
|
||||
<h3 class="section">3.6 -f jpeg doesn’t work.<span class="pull-right"><a class="anchor hidden-xs" href="#_002df-jpeg-doesn_0027t-work_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-_002df-jpeg-doesn_0027t-work_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Try ’-f image2 test%d.jpg’.
|
||||
</p>
|
||||
<a name="Why-can-I-not-change-the-frame-rate_003f"></a>
|
||||
<h3 class="section">3.7 Why can I not change the frame rate?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-can-I-not-change-the-frame-rate_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-can-I-not-change-the-frame-rate_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
|
||||
Choose a different codec with the -c:v command line option.
|
||||
</p>
|
||||
<a name="How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f"></a>
|
||||
<h3 class="section">3.8 How do I encode Xvid or DivX video with ffmpeg?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
|
||||
standard (note that there are many other coding formats that use this
|
||||
same standard). Thus, use ’-c:v mpeg4’ to encode in these formats. The
|
||||
default fourcc stored in an MPEG-4-coded file will be ’FMP4’. If you want
|
||||
a different fourcc, use the ’-vtag’ option. E.g., ’-vtag xvid’ will
|
||||
force the fourcc ’xvid’ to be stored as the video fourcc rather than the
|
||||
default.
|
||||
</p>
|
||||
<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f"></a>
|
||||
<h3 class="section">3.9 Which are good parameters for encoding high quality MPEG-4?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>’-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2’,
|
||||
things to try: ’-bf 2’, ’-mpv_flags qp_rd’, ’-mpv_flags mv0’, ’-mpv_flags skip_rd’.
|
||||
</p>
|
||||
<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f"></a>
|
||||
<h3 class="section">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>’-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2’
|
||||
but beware the ’-g 100’ might cause problems with some decoders.
|
||||
Things to try: ’-bf 2’, ’-mpv_flags qp_rd’, ’-mpv_flags mv0’, ’-mpv_flags skip_rd’.
|
||||
</p>
|
||||
<a name="Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f"></a>
|
||||
<h3 class="section">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?<span class="pull-right"><a class="anchor hidden-xs" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You should use ’-flags +ilme+ildct’ and maybe ’-flags +alt’ for interlaced
|
||||
material, and try ’-top 0/1’ if the result looks really messed-up.
|
||||
</p>
|
||||
<a name="How-can-I-read-DirectShow-files_003f"></a>
|
||||
<h3 class="section">3.12 How can I read DirectShow files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-read-DirectShow-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-read-DirectShow-files_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>If you have built FFmpeg with <code class="code">./configure --enable-avisynth</code>
|
||||
(only possible on MinGW/Cygwin platforms),
|
||||
then you may use any file that DirectShow can read as input.
|
||||
</p>
|
||||
<p>Just create an "input.avs" text file with this single line ...
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">DirectShowSource("C:\path to your file\yourfile.asf")
|
||||
</pre></div>
|
||||
<p>... and then feed that text file to ffmpeg:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i input.avs
|
||||
</pre></div>
|
||||
|
||||
<p>For ANY other help on AviSynth, please visit the
|
||||
<a class="uref" href="http://www.avisynth.org/">AviSynth homepage</a>.
|
||||
</p>
|
||||
<a name="How-can-I-join-video-files_003f"></a>
|
||||
<h3 class="section">3.13 How can I join video files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-join-video-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-join-video-files_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>To "join" video files is quite ambiguous. The following list explains the
|
||||
different kinds of "joining" and points out how those are addressed in
|
||||
FFmpeg. To join video files may mean:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>To put them one after the other: this is called to <em class="emph">concatenate</em> them
|
||||
(in short: concat) and is addressed
|
||||
<a class="ref" href="#How-can-I-concatenate-video-files">in this very faq</a>.
|
||||
|
||||
</li><li>To put them together in the same file, to let the user choose between the
|
||||
different versions (example: different audio languages): this is called to
|
||||
<em class="emph">multiplex</em> them together (in short: mux), and is done by simply
|
||||
invoking ffmpeg with several <samp class="option">-i</samp> options.
|
||||
|
||||
</li><li>For audio, to put all channels together in a single stream (example: two
|
||||
mono streams into one stereo stream): this is sometimes called to
|
||||
<em class="emph">merge</em> them, and can be done using the
|
||||
<a class="url" href="ffmpeg-filters.html#amerge"><code class="code">amerge</code></a> filter.
|
||||
|
||||
</li><li>For audio, to play one on top of the other: this is called to <em class="emph">mix</em>
|
||||
them, and can be done by first merging them into a single stream and then
|
||||
using the <a class="url" href="ffmpeg-filters.html#pan"><code class="code">pan</code></a> filter to mix
|
||||
the channels at will.
|
||||
|
||||
</li><li>For video, to display both together, side by side or one on top of a part of
|
||||
the other; it can be done using the
|
||||
<a class="url" href="ffmpeg-filters.html#overlay"><code class="code">overlay</code></a> video filter.
|
||||
|
||||
</li></ul>
|
||||
|
||||
<a class="anchor" id="How-can-I-concatenate-video-files"></a><a name="How-can-I-concatenate-video-files_003f"></a>
|
||||
<h3 class="section">3.14 How can I concatenate video files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-concatenate-video-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-concatenate-video-files_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>There are several solutions, depending on the exact circumstances.
|
||||
</p>
|
||||
<a name="Concatenating-using-the-concat-filter"></a>
|
||||
<h4 class="subsection">3.14.1 Concatenating using the concat <em class="emph">filter</em><span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-filter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-filter" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>FFmpeg has a <a class="url" href="ffmpeg-filters.html#concat"><code class="code">concat</code></a> filter designed specifically for that, with examples in the
|
||||
documentation. This operation is recommended if you need to re-encode.
|
||||
</p>
|
||||
<a name="Concatenating-using-the-concat-demuxer"></a>
|
||||
<h4 class="subsection">3.14.2 Concatenating using the concat <em class="emph">demuxer</em><span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-demuxer" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>FFmpeg has a <a class="url" href="ffmpeg-formats.html#concat"><code class="code">concat</code></a> demuxer which you can use when you want to avoid a re-encode and
|
||||
your format doesn’t support file level concatenation.
|
||||
</p>
|
||||
<a name="Concatenating-using-the-concat-protocol-_0028file-level_0029"></a>
|
||||
<h4 class="subsection">3.14.3 Concatenating using the concat <em class="emph">protocol</em> (file level)<span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-protocol-_0028file-level_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-protocol-_0028file-level_0029" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>FFmpeg has a <a class="url" href="ffmpeg-protocols.html#concat"><code class="code">concat</code></a> protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
</p>
|
||||
<p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
|
||||
video by merely concatenating the files containing them.
|
||||
</p>
|
||||
<p>Hence you may concatenate your multimedia files by first transcoding them to
|
||||
these privileged formats, then using the humble <code class="code">cat</code> command (or the
|
||||
equally humble <code class="code">copy</code> under Windows), and finally transcoding back to your
|
||||
format of choice.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
|
||||
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
|
||||
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
|
||||
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
|
||||
</pre></div>
|
||||
|
||||
<p>Additionally, you can use the <code class="code">concat</code> protocol instead of <code class="code">cat</code> or
|
||||
<code class="code">copy</code> which will avoid creation of a potentially huge intermediate file.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
|
||||
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
|
||||
ffmpeg -i concat:"intermediate1.mpg|intermediate2.mpg" -c copy intermediate_all.mpg
|
||||
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
|
||||
</pre></div>
|
||||
|
||||
<p>Note that you may need to escape the character "|" which is special for many
|
||||
shells.
|
||||
</p>
|
||||
<p>Another option is usage of named pipes, should your platform support it:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">mkfifo intermediate1.mpg
|
||||
mkfifo intermediate2.mpg
|
||||
ffmpeg -i input1.avi -qscale:v 1 -y intermediate1.mpg < /dev/null &
|
||||
ffmpeg -i input2.avi -qscale:v 1 -y intermediate2.mpg < /dev/null &
|
||||
cat intermediate1.mpg intermediate2.mpg |\
|
||||
ffmpeg -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
|
||||
</pre></div>
|
||||
|
||||
<a name="Concatenating-using-raw-audio-and-video"></a>
|
||||
<h4 class="subsection">3.14.4 Concatenating using raw audio and video<span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-raw-audio-and-video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-raw-audio-and-video" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
|
||||
allow concatenation, and the transcoding step is almost lossless.
|
||||
When using multiple yuv4mpegpipe(s), the first line needs to be discarded
|
||||
from all but the first stream. This can be accomplished by piping through
|
||||
<code class="code">tail</code> as seen below. Note that when piping through <code class="code">tail</code> you
|
||||
must use command grouping, <code class="code">{ ;}</code>, to background properly.
|
||||
</p>
|
||||
<p>For example, let’s say we want to concatenate two FLV files into an
|
||||
output.flv file:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">mkfifo temp1.a
|
||||
mkfifo temp1.v
|
||||
mkfifo temp2.a
|
||||
mkfifo temp2.v
|
||||
mkfifo all.a
|
||||
mkfifo all.v
|
||||
ffmpeg -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
|
||||
ffmpeg -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
|
||||
ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
|
||||
{ ffmpeg -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; } &
|
||||
cat temp1.a temp2.a > all.a &
|
||||
cat temp1.v temp2.v > all.v &
|
||||
ffmpeg -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
|
||||
-f yuv4mpegpipe -i all.v \
|
||||
-y output.flv
|
||||
rm temp[12].[av] all.[av]
|
||||
</pre></div>
|
||||
|
||||
<a name="Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e"></a>
|
||||
<h3 class="section">3.15 Using <samp class="option">-f lavfi</samp>, audio becomes mono for no apparent reason.<span class="pull-right"><a class="anchor hidden-xs" href="#Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Use <samp class="option">-dumpgraph -</samp> to find out exactly where the channel layout is
|
||||
lost.
|
||||
</p>
|
||||
<p>Most likely, it is through <code class="code">auto-inserted aresample</code>. Try to understand
|
||||
why the converting filter was needed at that place.
|
||||
</p>
|
||||
<p>Just before the output is a likely place, as <samp class="option">-f lavfi</samp> currently
|
||||
only support packed S16.
|
||||
</p>
|
||||
<p>Then insert the correct <code class="code">aformat</code> explicitly in the filtergraph,
|
||||
specifying the exact format.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">aformat=sample_fmts=s16:channel_layouts=stereo
|
||||
</pre></div>
|
||||
|
||||
<a name="Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f"></a>
|
||||
<h3 class="section">3.16 Why does FFmpeg not see the subtitles in my VOB file?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>VOB and a few other formats do not have a global header that describes
|
||||
everything present in the file. Instead, applications are supposed to scan
|
||||
the file to see what it contains. Since VOB files are frequently large, only
|
||||
the beginning is scanned. If the subtitles happen only later in the file,
|
||||
they will not be initially detected.
|
||||
</p>
|
||||
<p>Some applications, including the <code class="code">ffmpeg</code> command-line tool, can only
|
||||
work with streams that were detected during the initial scan; streams that
|
||||
are detected later are ignored.
|
||||
</p>
|
||||
<p>The size of the initial scan is controlled by two options: <code class="code">probesize</code>
|
||||
(default ~5 Mo) and <code class="code">analyzeduration</code> (default 5,000,000 µs = 5 s). For
|
||||
the subtitle stream to be detected, both values must be large enough.
|
||||
</p>
|
||||
<a name="Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f"></a>
|
||||
<h3 class="section">3.17 Why was the <code class="command">ffmpeg</code> <samp class="option">-sameq</samp> option removed? What to use instead?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The <samp class="option">-sameq</samp> option meant "same quantizer", and made sense only in a
|
||||
very limited set of cases. Unfortunately, a lot of people mistook it for
|
||||
"same quality" and used it in places where it did not make sense: it had
|
||||
roughly the expected visible effect, but achieved it in a very inefficient
|
||||
way.
|
||||
</p>
|
||||
<p>Each encoder has its own set of options to set the quality-vs-size balance,
|
||||
use the options for the encoder you are using to set the quality level to a
|
||||
point acceptable for your tastes. The most common options to do that are
|
||||
<samp class="option">-qscale</samp> and <samp class="option">-qmax</samp>, but you should peruse the documentation
|
||||
of the encoder you chose.
|
||||
</p>
|
||||
<a name="I-have-a-stretched-video_002c-why-does-scaling-not-fix-it_003f"></a>
|
||||
<h3 class="section">3.18 I have a stretched video, why does scaling not fix it?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-a-stretched-video_002c-why-does-scaling-not-fix-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-a-stretched-video_002c-why-does-scaling-not-fix-it_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>A lot of video codecs and formats can store the <em class="emph">aspect ratio</em> of the
|
||||
video: this is the ratio between the width and the height of either the full
|
||||
image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect
|
||||
ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48
|
||||
SAR.
|
||||
</p>
|
||||
<p>Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot
|
||||
of video standards, especially from the analogic-numeric transition era, use
|
||||
non-square pixels.
|
||||
</p>
|
||||
<p>Most processing filters in FFmpeg handle the aspect ratio to avoid
|
||||
stretching the image: cropping adjusts the DAR to keep the SAR constant,
|
||||
scaling adjusts the SAR to keep the DAR constant.
|
||||
</p>
|
||||
<p>If you want to stretch, or “unstretch”, the image, you need to override the
|
||||
information with the
|
||||
<a class="url" href="ffmpeg-filters.html#setdar_002c-setsar"><code class="code">setdar or setsar filters</code></a>.
|
||||
</p>
|
||||
<p>Do not forget to examine carefully the original video to check whether the
|
||||
stretching comes from the image or from the aspect ratio information.
|
||||
</p>
|
||||
<p>For example, to fix a badly encoded EGA capture, use the following commands,
|
||||
either the first one to upscale to square pixels or the second one to set
|
||||
the correct aspect ratio or the third one to avoid transcoding (may not work
|
||||
depending on the format / codec / player / phase of the moon):
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
|
||||
ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
|
||||
ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
|
||||
</pre></div>
|
||||
|
||||
<a class="anchor" id="background-task"></a><a name="How-do-I-run-ffmpeg-as-a-background-task_003f"></a>
|
||||
<h3 class="section">3.19 How do I run ffmpeg as a background task?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-run-ffmpeg-as-a-background-task_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-run-ffmpeg-as-a-background-task_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>ffmpeg normally checks the console input, for entries like "q" to stop
|
||||
and "?" to give help, while performing operations. ffmpeg does not have a way of
|
||||
detecting when it is running as a background task.
|
||||
When it checks the console input, that can cause the process running ffmpeg
|
||||
in the background to suspend.
|
||||
</p>
|
||||
<p>To prevent those input checks, allowing ffmpeg to run as a background task,
|
||||
use the <a class="url" href="ffmpeg.html#stdin-option"><code class="code">-nostdin</code> option</a>
|
||||
in the ffmpeg invocation. This is effective whether you run ffmpeg in a shell
|
||||
or invoke ffmpeg in its own process via an operating system API.
|
||||
</p>
|
||||
<p>As an alternative, when you are running ffmpeg in a shell, you can redirect
|
||||
standard input to <code class="code">/dev/null</code> (on Linux and macOS)
|
||||
or <code class="code">NUL</code> (on Windows). You can do this redirect either
|
||||
on the ffmpeg invocation, or from a shell script which calls ffmpeg.
|
||||
</p>
|
||||
<p>For example:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -nostdin -i INPUT OUTPUT
|
||||
</pre></div>
|
||||
|
||||
<p>or (on Linux, macOS, and other UNIX-like shells):
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i INPUT OUTPUT </dev/null
|
||||
</pre></div>
|
||||
|
||||
<p>or (on Windows):
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i INPUT OUTPUT <NUL
|
||||
</pre></div>
|
||||
|
||||
<a name="How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f"></a>
|
||||
<h3 class="section">3.20 How do I prevent ffmpeg from suspending with a message like <em class="emph">suspended (tty output)</em>?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>If you run ffmpeg in the background, you may find that its process suspends.
|
||||
There may be a message like <em class="emph">suspended (tty output)</em>. The question is how
|
||||
to prevent the process from being suspended.
|
||||
</p>
|
||||
<p>For example:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">% ffmpeg -i INPUT OUTPUT &> ~/tmp/log.txt &
|
||||
[1] 93352
|
||||
%
|
||||
[1] + suspended (tty output) ffmpeg -i INPUT OUTPUT &>
|
||||
</pre></div>
|
||||
|
||||
<p>The message "tty output" notwithstanding, the problem here is that
|
||||
ffmpeg normally checks the console input when it runs. The operating system
|
||||
detects this, and suspends the process until you can bring it to the
|
||||
foreground and attend to it.
|
||||
</p>
|
||||
<p>The solution is to use the right techniques to tell ffmpeg not to consult
|
||||
console input. You can use the
|
||||
<a class="url" href="ffmpeg.html#stdin-option"><code class="code">-nostdin</code> option</a>,
|
||||
or redirect standard input with <code class="code">< /dev/null</code>.
|
||||
See FAQ
|
||||
<a class="ref" href="#background-task"><em class="emph">How do I run ffmpeg as a background task?</em></a>
|
||||
for details.
|
||||
</p>
|
||||
<a name="Development"></a>
|
||||
<h2 class="chapter">4 Development<span class="pull-right"><a class="anchor hidden-xs" href="#Development" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Development" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f"></a>
|
||||
<h3 class="section">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?<span class="pull-right"><a class="anchor hidden-xs" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Yes. Check the <samp class="file">doc/examples</samp> directory in the source
|
||||
repository, also available online at:
|
||||
<a class="url" href="https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples">https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples</a>.
|
||||
</p>
|
||||
<p>Examples are also installed by default, usually in
|
||||
<code class="code">$PREFIX/share/ffmpeg/examples</code>.
|
||||
</p>
|
||||
<p>Also you may read the Developers Guide of the FFmpeg documentation. Alternatively,
|
||||
examine the source code for one of the many open source projects that
|
||||
already incorporate FFmpeg at (<a class="url" href="projects.html">projects.html</a>).
|
||||
</p>
|
||||
<a name="Can-you-support-my-C-compiler-XXX_003f"></a>
|
||||
<h3 class="section">4.2 Can you support my C compiler XXX?<span class="pull-right"><a class="anchor hidden-xs" href="#Can-you-support-my-C-compiler-XXX_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Can-you-support-my-C-compiler-XXX_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>It depends. If your compiler is C99-compliant, then patches to support
|
||||
it are likely to be welcome if they do not pollute the source code
|
||||
with <code class="code">#ifdef</code>s related to the compiler.
|
||||
</p>
|
||||
<a name="Is-Microsoft-Visual-C_002b_002b-supported_003f"></a>
|
||||
<h3 class="section">4.3 Is Microsoft Visual C++ supported?<span class="pull-right"><a class="anchor hidden-xs" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Yes. Please see the <a class="uref" href="platform.html">Microsoft Visual C++</a>
|
||||
section in the FFmpeg documentation.
|
||||
</p>
|
||||
<a name="Can-you-add-automake_002c-libtool-or-autoconf-support_003f"></a>
|
||||
<h3 class="section">4.4 Can you add automake, libtool or autoconf support?<span class="pull-right"><a class="anchor hidden-xs" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>No. These tools are too bloated and they complicate the build.
|
||||
</p>
|
||||
<a name="Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f"></a>
|
||||
<h3 class="section">4.5 Why not rewrite FFmpeg in object-oriented C++?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg is already organized in a highly modular manner and does not need to
|
||||
be rewritten in a formal object language. Further, many of the developers
|
||||
favor straight C; it works for them. For more arguments on this matter,
|
||||
read <a class="uref" href="https://web.archive.org/web/20111004021423/http://kernel.org/pub/linux/docs/lkml/#s15">"Programming Religion"</a>.
|
||||
</p>
|
||||
<a name="Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f"></a>
|
||||
<h3 class="section">4.6 Why are the ffmpeg programs devoid of debugging symbols?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The build process creates <code class="command">ffmpeg_g</code>, <code class="command">ffplay_g</code>, etc. which
|
||||
contain full debug information. Those binaries are stripped to create
|
||||
<code class="command">ffmpeg</code>, <code class="command">ffplay</code>, etc. If you need the debug information, use
|
||||
the *_g versions.
|
||||
</p>
|
||||
<a name="I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f"></a>
|
||||
<h3 class="section">4.7 I do not like the LGPL, can I contribute code under the GPL instead?<span class="pull-right"><a class="anchor hidden-xs" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Yes, as long as the code is optional and can easily and cleanly be placed
|
||||
under #if CONFIG_GPL without breaking anything. So, for example, a new codec
|
||||
or filter would be OK under GPL while a bug fix to LGPL code would not.
|
||||
</p>
|
||||
<a name="I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e"></a>
|
||||
<h3 class="section">4.8 I’m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg builds static libraries by default. In static libraries, dependencies
|
||||
are not handled. That has two consequences. First, you must specify the
|
||||
libraries in dependency order: <code class="code">-lavdevice</code> must come before
|
||||
<code class="code">-lavformat</code>, <code class="code">-lavutil</code> must come after everything else, etc.
|
||||
Second, external libraries that are used in FFmpeg have to be specified too.
|
||||
</p>
|
||||
<p>An easy way to get the full list of required libraries in dependency order
|
||||
is to use <code class="code">pkg-config</code>.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
|
||||
</pre></div>
|
||||
|
||||
<p>See <samp class="file">doc/example/Makefile</samp> and <samp class="file">doc/example/pc-uninstalled</samp> for
|
||||
more details.
|
||||
</p>
|
||||
<a name="I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e"></a>
|
||||
<h3 class="section">4.9 I’m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg is a pure C project, so to use the libraries within your C++ application
|
||||
you need to explicitly state that you are using a C library. You can do this by
|
||||
encompassing your FFmpeg includes using <code class="code">extern "C"</code>.
|
||||
</p>
|
||||
<p>See <a class="url" href="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3">http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3</a>
|
||||
</p>
|
||||
<a name="I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope"></a>
|
||||
<h3 class="section">4.10 I’m using libavutil from within my C++ application but the compiler complains about ’UINT64_C’ was not declared in this scope<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg is a pure C project using C99 math features, in order to enable C++
|
||||
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
|
||||
</p>
|
||||
<a name="I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f"></a>
|
||||
<h3 class="section">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You have to create a custom AVIOContext using <code class="code">avio_alloc_context</code>,
|
||||
see <samp class="file">libavformat/aviobuf.c</samp> in FFmpeg and <samp class="file">libmpdemux/demux_lavf.c</samp> in MPlayer or MPlayer2 sources.
|
||||
</p>
|
||||
<a name="Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f"></a>
|
||||
<h3 class="section">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?<span class="pull-right"><a class="anchor hidden-xs" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>see <a class="url" href="https://www.ffmpeg.org/~michael/">https://www.ffmpeg.org/~michael/</a>
|
||||
</p>
|
||||
<a name="How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f"></a>
|
||||
<h3 class="section">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Even if peculiar since it is network oriented, RTP is a container like any
|
||||
other. You have to <em class="emph">demux</em> RTP before feeding the payload to libavcodec.
|
||||
In this specific case please look at RFC 4629 to see how it should be done.
|
||||
</p>
|
||||
<a name="AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e"></a>
|
||||
<h3 class="section">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.<span class="pull-right"><a class="anchor hidden-xs" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p><code class="code">r_frame_rate</code> is NOT the average frame rate, it is the smallest frame rate
|
||||
that can accurately represent all timestamps. So no, it is not
|
||||
wrong if it is larger than the average!
|
||||
For example, if you have mixed 25 and 30 fps content, then <code class="code">r_frame_rate</code>
|
||||
will be 150 (it is the least common multiple).
|
||||
If you are looking for the average frame rate, see <code class="code">AVStream.avg_frame_rate</code>.
|
||||
</p>
|
||||
<a name="Why-is-make-fate-not-running-all-tests_003f"></a>
|
||||
<h3 class="section">4.15 Why is <code class="code">make fate</code> not running all tests?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-make-fate-not-running-all-tests_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-make-fate-not-running-all-tests_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Make sure you have the fate-suite samples and the <code class="code">SAMPLES</code> Make variable
|
||||
or <code class="code">FATE_SAMPLES</code> environment variable or the <code class="code">--samples</code>
|
||||
<code class="command">configure</code> option is set to the right path.
|
||||
</p>
|
||||
<a name="Why-is-make-fate-not-finding-the-samples_003f"></a>
|
||||
<h3 class="section">4.16 Why is <code class="code">make fate</code> not finding the samples?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-make-fate-not-finding-the-samples_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-make-fate-not-finding-the-samples_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Do you happen to have a <code class="code">~</code> character in the samples path to indicate a
|
||||
home directory? The value is used in ways where the shell cannot expand it,
|
||||
causing FATE to not find files. Just replace <code class="code">~</code> by the full path.
|
||||
</p>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+416
@@ -0,0 +1,416 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
FFmpeg Automated Testing Environment
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
FFmpeg Automated Testing Environment
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="Top"></a>
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Introduction" href="#Introduction">1 Introduction</a></li>
|
||||
<li><a id="toc-Using-FATE-from-your-FFmpeg-source-directory" href="#Using-FATE-from-your-FFmpeg-source-directory">2 Using FATE from your FFmpeg source directory</a></li>
|
||||
<li><a id="toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server" href="#Submitting-the-results-to-the-FFmpeg-result-aggregation-server">3 Submitting the results to the FFmpeg result aggregation server</a></li>
|
||||
<li><a id="toc-Uploading-new-samples-to-the-fate-suite" href="#Uploading-new-samples-to-the-fate-suite">4 Uploading new samples to the fate suite</a></li>
|
||||
<li><a id="toc-FATE-makefile-targets-and-variables" href="#FATE-makefile-targets-and-variables">5 FATE makefile targets and variables</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Makefile-targets" href="#Makefile-targets">5.1 Makefile targets</a></li>
|
||||
<li><a id="toc-Makefile-variables" href="#Makefile-variables">5.2 Makefile variables</a></li>
|
||||
<li><a id="toc-Examples" href="#Examples">5.3 Examples</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Introduction"></a>
|
||||
<h2 class="chapter">1 Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Introduction" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>FATE is an extended regression suite on the client-side and a means
|
||||
for results aggregation and presentation on the server-side.
|
||||
</p>
|
||||
<p>The first part of this document explains how you can use FATE from
|
||||
your FFmpeg source directory to test your ffmpeg binary. The second
|
||||
part describes how you can run FATE to submit the results to FFmpeg’s
|
||||
FATE server.
|
||||
</p>
|
||||
<p>In any way you can have a look at the publicly viewable FATE results
|
||||
by visiting this website:
|
||||
</p>
|
||||
<p><a class="url" href="http://fate.ffmpeg.org/">http://fate.ffmpeg.org/</a>
|
||||
</p>
|
||||
<p>This is especially recommended for all people contributing source
|
||||
code to FFmpeg, as it can be seen if some test on some platform broke
|
||||
with their recent contribution. This usually happens on the platforms
|
||||
the developers could not test on.
|
||||
</p>
|
||||
<p>The second part of this document describes how you can run FATE to
|
||||
submit your results to FFmpeg’s FATE server. If you want to submit your
|
||||
results be sure to check that your combination of CPU, OS and compiler
|
||||
is not already listed on the above mentioned website.
|
||||
</p>
|
||||
<p>In the third part you can find a comprehensive listing of FATE makefile
|
||||
targets and variables.
|
||||
</p>
|
||||
|
||||
<a name="Using-FATE-from-your-FFmpeg-source-directory"></a>
|
||||
<h2 class="chapter">2 Using FATE from your FFmpeg source directory<span class="pull-right"><a class="anchor hidden-xs" href="#Using-FATE-from-your-FFmpeg-source-directory" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Using-FATE-from-your-FFmpeg-source-directory" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>If you want to run FATE on your machine, FFmpeg needs to be configured first.
|
||||
You may specify the location of samples during configuration by adding the
|
||||
argument <code class="code">--samples=/path/to/fate-suite</code>.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">./configure --enable-somelib --samples=/path/to/fate-suite
|
||||
</pre></div>
|
||||
|
||||
<p>After successful configuration, you need to add and/or update the samples in place:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">make fate-rsync
|
||||
</pre></div>
|
||||
|
||||
<p>Now you are ready to run FATE:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">make fate
|
||||
</pre></div>
|
||||
|
||||
<p>See <a class="ref" href="#makefile-variables">makefile variables</a> for a list of arguments that can be added.
|
||||
</p>
|
||||
<p>If you did not set the samples path during configuration, or if you wish to
|
||||
override it just before starting FATE, you can do so in one of three ways.
|
||||
</p>
|
||||
<p>Either by setting a make variable:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">make fate-rsync SAMPLES=/path/to/fate-suite
|
||||
make fate SAMPLES=/path/to/fate-suite
|
||||
</pre></div>
|
||||
|
||||
<p>or by setting an environment variable for the current session:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">export FATE_SAMPLES=/path/to/fate-suite
|
||||
make fate-rsync
|
||||
make fate
|
||||
</pre></div>
|
||||
|
||||
<p>or in isolation for a single command by prepending it:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">FATE_SAMPLES=/path/to/fate-suite make fate-rsync
|
||||
FATE_SAMPLES=/path/to/fate-suite make fate
|
||||
</pre></div>
|
||||
|
||||
<p>This variable can also be set in your shell profile to make it permanent.
|
||||
</p>
|
||||
<div class="info">
|
||||
<p>Do not put a ’~’ character in the samples path to indicate a home
|
||||
directory. Because of shell nuances, this will cause FATE to fail.
|
||||
Also, on Windows the path has to be relative to the build path
|
||||
which in this case is the FFmpeg source directory.
|
||||
</p></div>
|
||||
<p>Beware that some assertions are disabled by default, so mind setting
|
||||
<samp class="option">--assert-level=<level></samp> at configuration time, e.g. when seeking
|
||||
the highest possible test coverage:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">./configure --assert-level=2
|
||||
</pre></div>
|
||||
<p>Note that raising the assert level could have a performance impact.
|
||||
</p>
|
||||
<p>To get the complete list of tests, run the command:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">make fate-list
|
||||
</pre></div>
|
||||
|
||||
<p>You can specify a subset of tests to run by specifying the
|
||||
corresponding elements from the list with the <code class="code">fate-</code> prefix,
|
||||
e.g. as in:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">make fate-ffprobe_compact fate-ffprobe_xml
|
||||
</pre></div>
|
||||
|
||||
<p>This makes it easier to run a few tests in case of failure without
|
||||
running the complete test suite.
|
||||
</p>
|
||||
<p>To use a custom wrapper to run the test, pass <samp class="option">--target-exec</samp> to
|
||||
<code class="command">configure</code> or set the <var class="var">TARGET_EXEC</var> Make variable.
|
||||
</p>
|
||||
|
||||
<a name="Submitting-the-results-to-the-FFmpeg-result-aggregation-server"></a>
|
||||
<h2 class="chapter">3 Submitting the results to the FFmpeg result aggregation server<span class="pull-right"><a class="anchor hidden-xs" href="#Submitting-the-results-to-the-FFmpeg-result-aggregation-server" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Submitting-the-results-to-the-FFmpeg-result-aggregation-server" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>To submit your results to the server you should run fate through the
|
||||
shell script <samp class="file">tests/fate.sh</samp> from the FFmpeg sources. This script needs
|
||||
to be invoked with a configuration file as its first argument.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">tests/fate.sh /path/to/fate_config
|
||||
</pre></div>
|
||||
|
||||
<p>A configuration file template with comments describing the individual
|
||||
configuration variables can be found at <samp class="file">doc/fate_config.sh.template</samp>.
|
||||
</p>
|
||||
<p>The mentioned configuration template is also available here:
|
||||
</p><pre class="verbatim">slot= # some unique identifier
|
||||
repo=https://git.ffmpeg.org/ffmpeg.git # the source repository
|
||||
#branch=release/2.6 # the branch to test
|
||||
samples= # path to samples directory
|
||||
workdir= # directory in which to do all the work
|
||||
#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report
|
||||
comment= # optional description
|
||||
build_only= # set to "yes" for a compile-only instance that skips tests
|
||||
skip_clean= # set to "yes" to preserve build/install directories
|
||||
ignore_tests=
|
||||
|
||||
# the following are optional and map to configure options
|
||||
arch=
|
||||
cpu=
|
||||
toolchain=
|
||||
cross_prefix=
|
||||
ar=
|
||||
as=
|
||||
cc=
|
||||
cxx=
|
||||
ld=
|
||||
nm=
|
||||
target_os=
|
||||
sysroot=
|
||||
target_exec=
|
||||
target_path=
|
||||
target_samples=
|
||||
extra_cflags=
|
||||
extra_cxxflags=
|
||||
extra_objcflags=
|
||||
extra_ldflags=
|
||||
extra_libs=
|
||||
extra_conf= # extra configure options not covered above
|
||||
|
||||
#make= # name of GNU make if not 'make'
|
||||
makeopts= # extra options passed to 'make'
|
||||
#makeopts_fate= # extra options passed to 'make' when running tests,
|
||||
# defaulting to makeopts above if this is not set
|
||||
#tar= # command to create a tar archive from its arguments on stdout,
|
||||
# defaults to 'tar c'
|
||||
#fate_targets= # targets to make when running fate; defaults to "fate",
|
||||
# can be set to run a subset of tests, e.g. "fate-checkasm".
|
||||
|
||||
#fate_environments= # a list of names of configurations to run tests for;
|
||||
# each round is run with variables from ${${name}_env} set.
|
||||
|
||||
# One example of using fate_environments:
|
||||
|
||||
# target_exec="qemu-aarch64-static"
|
||||
# fate_targets="fate-checkasm fate-cpu"
|
||||
# fate_environments="sve128 sve256"
|
||||
# sve128_env="QEMU_CPU=max,sve128=on"
|
||||
# sve256_env="QEMU_CPU=max,sve256=on"
|
||||
|
||||
# The variables set by fate_environments can also be used explicitly
|
||||
# by target_exec, e.g. like this:
|
||||
|
||||
# target_exec="qemu-aarch64-static -cpu \$(MY_CPU)"
|
||||
# fate_targets="fate-checkasm fate-cpu"
|
||||
# fate_environments="sve128 sve256"
|
||||
# sve128_env="MY_CPU=max,sve128=on"
|
||||
# sve256_env="MY_CPU=max,sve256=on"
|
||||
</pre>
|
||||
<p>Create a configuration that suits your needs, based on the configuration
|
||||
template. The <code class="env">slot</code> configuration variable can be any string that is not
|
||||
yet used, but it is suggested that you name it adhering to the following
|
||||
pattern ‘<samp class="samp"><var class="var">arch</var>-<var class="var">os</var>-<var class="var">compiler</var>-<var class="var">compiler version</var></samp>’. The
|
||||
configuration file itself will be sourced in a shell script, therefore all
|
||||
shell features may be used. This enables you to setup the environment as you
|
||||
need it for your build.
|
||||
</p>
|
||||
<p>For your first test runs the <code class="env">fate_recv</code> variable should be empty or
|
||||
commented out. This will run everything as normal except that it will omit
|
||||
the submission of the results to the server. The following files should be
|
||||
present in $workdir as specified in the configuration file:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>configure.log
|
||||
</li><li>compile.log
|
||||
</li><li>test.log
|
||||
</li><li>report
|
||||
</li><li>version
|
||||
</li></ul>
|
||||
|
||||
<p>When you have everything working properly you can create an SSH key pair
|
||||
and send the public key to the FATE server administrator who can be contacted
|
||||
at the email address <a class="email" href="mailto:fate-admin@ffmpeg.org">fate-admin@ffmpeg.org</a>.
|
||||
</p>
|
||||
<p>Configure your SSH client to use public key authentication with that key
|
||||
when connecting to the FATE server. Also do not forget to check the identity
|
||||
of the server and to accept its host key. This can usually be achieved by
|
||||
running your SSH client manually and killing it after you accepted the key.
|
||||
The FATE server’s fingerprint is:
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt>‘<samp class="samp">RSA</samp>’</dt>
|
||||
<dd><p>d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">ECDSA</samp>’</dt>
|
||||
<dd><p>76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>If you have problems connecting to the FATE server, it may help to try out
|
||||
the <code class="command">ssh</code> command with one or more <samp class="option">-v</samp> options. You should
|
||||
get detailed output concerning your SSH configuration and the authentication
|
||||
process.
|
||||
</p>
|
||||
<p>The only thing left is to automate the execution of the fate.sh script and
|
||||
the synchronisation of the samples directory.
|
||||
</p>
|
||||
<a name="Uploading-new-samples-to-the-fate-suite"></a>
|
||||
<h2 class="chapter">4 Uploading new samples to the fate suite<span class="pull-right"><a class="anchor hidden-xs" href="#Uploading-new-samples-to-the-fate-suite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Uploading-new-samples-to-the-fate-suite" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>If you need a sample uploaded send a mail to samples-request.
|
||||
</p>
|
||||
<p>This is for developers who have an account on the fate suite server.
|
||||
If you upload new samples, please make sure they are as small as possible,
|
||||
space on each client, network bandwidth and so on benefit from smaller test cases.
|
||||
Also keep in mind older checkouts use existing sample files, that means in
|
||||
practice generally do not replace, remove or overwrite files as it likely would
|
||||
break older checkouts or releases.
|
||||
Also all needed samples for a commit should be uploaded, ideally 24
|
||||
hours, before the push.
|
||||
If you need an account for frequently uploading samples or you wish to help
|
||||
others by doing that send a mail to ffmpeg-devel.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">#First update your local samples copy:
|
||||
rsync -vauL --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X fate-suite.ffmpeg.org:/home/samples/fate-suite/ ~/fate-suite
|
||||
|
||||
#Then do a dry run checking what would be uploaded:
|
||||
rsync -vanL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
|
||||
|
||||
#Upload the files:
|
||||
rsync -vaL --no-g --chmod=Dg+s,Duo+x,ug+rw,o+r,o-w,+X ~/fate-suite/ fate-suite.ffmpeg.org:/home/samples/fate-suite
|
||||
</pre></div>
|
||||
|
||||
|
||||
<a name="FATE-makefile-targets-and-variables"></a>
|
||||
<h2 class="chapter">5 FATE makefile targets and variables<span class="pull-right"><a class="anchor hidden-xs" href="#FATE-makefile-targets-and-variables" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FATE-makefile-targets-and-variables" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Makefile-targets"></a>
|
||||
<h3 class="section">5.1 Makefile targets<span class="pull-right"><a class="anchor hidden-xs" href="#Makefile-targets" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Makefile-targets" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<dl class="table">
|
||||
<dt><samp class="option">fate-rsync</samp></dt>
|
||||
<dd><p>Download/synchronize sample files to the configured samples directory.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">fate-list</samp></dt>
|
||||
<dd><p>Will list all fate/regression test targets.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">fate-list-failing</samp></dt>
|
||||
<dd><p>List the fate tests that failed the last time they were executed.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">fate-clear-reports</samp></dt>
|
||||
<dd><p>Remove the test reports from previous test executions (getting rid of
|
||||
potentially stale results from fate-list-failing).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">fate</samp></dt>
|
||||
<dd><p>Run the FATE test suite (requires the fate-suite dataset).
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<a name="Makefile-variables"></a>
|
||||
<h3 class="section">5.2 Makefile variables<span class="pull-right"><a class="anchor hidden-xs" href="#Makefile-variables" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Makefile-variables" aria-hidden="true">TOC</a></span></h3>
|
||||
<a class="anchor" id="makefile-variables"></a>
|
||||
<dl class="table">
|
||||
<dt><code class="env">V</code></dt>
|
||||
<dd><p>Verbosity level, can be set to 0, 1 or 2.
|
||||
</p><ul class="itemize mark-bullet">
|
||||
<li>0: show just the test arguments
|
||||
</li><li>1: show just the command used in the test
|
||||
</li><li>2: show everything
|
||||
</li></ul>
|
||||
|
||||
</dd>
|
||||
<dt><code class="env">SAMPLES</code></dt>
|
||||
<dd><p>Specify or override the path to the FATE samples at make time, it has a
|
||||
meaning only while running the regression tests.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">THREADS</code></dt>
|
||||
<dd><p>Specify how many threads to use while running regression tests, it is
|
||||
quite useful to detect thread-related regressions.
|
||||
</p>
|
||||
<p>This variable may be set to the string "random", optionally followed by a
|
||||
number, like "random99", This will cause each test to use a random number of
|
||||
threads. If a number is specified, it is used as a maximum number of threads,
|
||||
otherwise 16 is the maximum.
|
||||
</p>
|
||||
<p>In case a test fails, the thread count used for it will be written into the
|
||||
errfile.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">THREAD_TYPE</code></dt>
|
||||
<dd><p>Specify which threading strategy test, either ‘<samp class="samp">slice</samp>’ or ‘<samp class="samp">frame</samp>’,
|
||||
by default ‘<samp class="samp">slice+frame</samp>’
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">CPUFLAGS</code></dt>
|
||||
<dd><p>Specify CPU flags.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">TARGET_EXEC</code></dt>
|
||||
<dd><p>Specify or override the wrapper used to run the tests.
|
||||
The <code class="env">TARGET_EXEC</code> option provides a way to run FATE wrapped in
|
||||
<code class="command">valgrind</code>, <code class="command">qemu-user</code> or <code class="command">wine</code> or on remote targets
|
||||
through <code class="command">ssh</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">GEN</code></dt>
|
||||
<dd><p>Set to ‘<samp class="samp">1</samp>’ to generate the missing or mismatched references.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">HWACCEL</code></dt>
|
||||
<dd><p>Specify which hardware acceleration to use while running regression tests,
|
||||
by default ‘<samp class="samp">none</samp>’ is used.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code class="env">KEEP</code></dt>
|
||||
<dd><p>Set to ‘<samp class="samp">1</samp>’ to keep temp files generated by fate test(s) when test is successful.
|
||||
Default is ‘<samp class="samp">0</samp>’, which removes these files. Files are always kept when a test
|
||||
fails.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<a name="Examples"></a>
|
||||
<h3 class="section">5.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">make V=1 SAMPLES=/var/fate/samples THREADS=2 CPUFLAGS=mmx fate
|
||||
</pre></div>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+69179
File diff suppressed because it is too large
Load Diff
+1363
File diff suppressed because it is too large
Load Diff
+8116
File diff suppressed because it is too large
Load Diff
+2438
File diff suppressed because it is too large
Load Diff
+40823
File diff suppressed because it is too large
Load Diff
+6577
File diff suppressed because it is too large
Load Diff
+2765
File diff suppressed because it is too large
Load Diff
+350
@@ -0,0 +1,350 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
FFmpeg Resampler Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
FFmpeg Resampler Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-Resampler-Options" href="#Resampler-Options">2 Resampler Options</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg resampler provides a high-level interface to the
|
||||
libswresample library audio resampling utilities. In particular it
|
||||
allows one to perform audio resampling, audio channel layout rematrixing,
|
||||
and convert audio format and packing layout.
|
||||
</p>
|
||||
|
||||
<a name="Resampler-Options"></a>
|
||||
<h2 class="chapter">2 Resampler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Resampler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resampler-Options" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The audio resampler supports the following named options.
|
||||
</p>
|
||||
<p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
|
||||
FFmpeg tools, <var class="var">option</var>=<var class="var">value</var> for the aresample filter,
|
||||
by setting the value explicitly in the
|
||||
<code class="code">SwrContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API for
|
||||
programmatic use.
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt><samp class="option">uchl, used_chlayout</samp></dt>
|
||||
<dd><p>Set used input channel layout. Default is unset. This option is
|
||||
only used for special remapping.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">isr, in_sample_rate</samp></dt>
|
||||
<dd><p>Set the input sample rate. Default value is 0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">osr, out_sample_rate</samp></dt>
|
||||
<dd><p>Set the output sample rate. Default value is 0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">isf, in_sample_fmt</samp></dt>
|
||||
<dd><p>Specify the input sample format. It is set by default to <code class="code">none</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">osf, out_sample_fmt</samp></dt>
|
||||
<dd><p>Specify the output sample format. It is set by default to <code class="code">none</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">tsf, internal_sample_fmt</samp></dt>
|
||||
<dd><p>Set the internal sample format. Default value is <code class="code">none</code>.
|
||||
This will automatically be chosen when it is not explicitly set.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">ichl, in_chlayout</samp></dt>
|
||||
<dt><samp class="option">ochl, out_chlayout</samp></dt>
|
||||
<dd><p>Set the input/output channel layout.
|
||||
</p>
|
||||
<p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
|
||||
for the required syntax.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">clev, center_mix_level</samp></dt>
|
||||
<dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
|
||||
in the interval [-32,32].
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">slev, surround_mix_level</samp></dt>
|
||||
<dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">lfe_mix_level</samp></dt>
|
||||
<dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
|
||||
LFE output. It is a value expressed in deciBel, and must
|
||||
be in the interval [-32,32].
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">rmvol, rematrix_volume</samp></dt>
|
||||
<dd><p>Set rematrix volume. Default value is 1.0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">rematrix_maxval</samp></dt>
|
||||
<dd><p>Set maximum output value for rematrixing.
|
||||
This can be used to prevent clipping vs. preventing volume reduction.
|
||||
A value of 1.0 prevents clipping.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">flags, swr_flags</samp></dt>
|
||||
<dd><p>Set flags used by the converter. Default value is 0.
|
||||
</p>
|
||||
<p>It supports the following individual flags:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">res</samp></dt>
|
||||
<dd><p>force resampling, this flag forces resampling to be used even when the
|
||||
input and output sample rates match.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">dither_scale</samp></dt>
|
||||
<dd><p>Set the dither scale. Default value is 1.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">dither_method</samp></dt>
|
||||
<dd><p>Set dither method. Default value is 0.
|
||||
</p>
|
||||
<p>Supported values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">rectangular</samp>’</dt>
|
||||
<dd><p>select rectangular dither
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">triangular</samp>’</dt>
|
||||
<dd><p>select triangular dither
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">triangular_hp</samp>’</dt>
|
||||
<dd><p>select triangular dither with high pass
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">lipshitz</samp>’</dt>
|
||||
<dd><p>select Lipshitz noise shaping dither.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">shibata</samp>’</dt>
|
||||
<dd><p>select Shibata noise shaping dither.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">low_shibata</samp>’</dt>
|
||||
<dd><p>select low Shibata noise shaping dither.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">high_shibata</samp>’</dt>
|
||||
<dd><p>select high Shibata noise shaping dither.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">f_weighted</samp>’</dt>
|
||||
<dd><p>select f-weighted noise shaping dither
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">modified_e_weighted</samp>’</dt>
|
||||
<dd><p>select modified-e-weighted noise shaping dither
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">improved_e_weighted</samp>’</dt>
|
||||
<dd><p>select improved-e-weighted noise shaping dither
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">resampler</samp></dt>
|
||||
<dd><p>Set resampling engine. Default value is swr.
|
||||
</p>
|
||||
<p>Supported values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">swr</samp>’</dt>
|
||||
<dd><p>select the native SW Resampler; filter options precision and cheby are not
|
||||
applicable in this case.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">soxr</samp>’</dt>
|
||||
<dd><p>select the SoX Resampler (where available); compensation, and filter options
|
||||
filter_size, phase_shift, exact_rational, filter_type & kaiser_beta, are not
|
||||
applicable in this case.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">filter_size</samp></dt>
|
||||
<dd><p>For swr only, set resampling filter size, default value is 32.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">phase_shift</samp></dt>
|
||||
<dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
|
||||
the interval [0,30].
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">linear_interp</samp></dt>
|
||||
<dd><p>Use linear interpolation when enabled (the default). Disable it if you want
|
||||
to preserve speed instead of quality when exact_rational fails.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">exact_rational</samp></dt>
|
||||
<dd><p>For swr only, when enabled, try to use exact phase_count based on input and
|
||||
output sample rate. However, if it is larger than <code class="code">1 << phase_shift</code>,
|
||||
the phase_count will be <code class="code">1 << phase_shift</code> as fallback. Default is enabled.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">cutoff</samp></dt>
|
||||
<dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
|
||||
value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
|
||||
(which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">precision</samp></dt>
|
||||
<dd><p>For soxr only, the precision in bits to which the resampled signal will be
|
||||
calculated. The default value of 20 (which, with suitable dithering, is
|
||||
appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a
|
||||
value of 28 gives SoX’s ’Very High Quality’.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">cheby</samp></dt>
|
||||
<dd><p>For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
|
||||
approximation for ’irrational’ ratios. Default value is 0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">async</samp></dt>
|
||||
<dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
|
||||
squeezing, filling and trimming. Setting this to 1 will enable filling and
|
||||
trimming, larger values represent the maximum amount in samples that the data
|
||||
may be stretched or squeezed for each second.
|
||||
Default value is 0, thus no compensation is applied to make the samples match
|
||||
the audio timestamps.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">first_pts</samp></dt>
|
||||
<dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
|
||||
This allows for padding/trimming at the start of stream. By default, no
|
||||
assumption is made about the first frame’s expected pts, so no padding or
|
||||
trimming is done. For example, this could be set to 0 to pad the beginning with
|
||||
silence if an audio stream starts after the video stream or to trim any samples
|
||||
with a negative pts due to encoder delay.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">min_comp</samp></dt>
|
||||
<dd><p>For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger stretching/squeezing/filling or trimming of the
|
||||
data to make it match the timestamps. The default is that
|
||||
stretching/squeezing/filling and trimming is disabled
|
||||
(<samp class="option">min_comp</samp> = <code class="code">FLT_MAX</code>).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">min_hard_comp</samp></dt>
|
||||
<dd><p>For swr only, set the minimum difference between timestamps and audio data (in
|
||||
seconds) to trigger adding/dropping samples to make it match the
|
||||
timestamps. This option effectively is a threshold to select between
|
||||
hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
|
||||
all compensation is by default disabled through <samp class="option">min_comp</samp>.
|
||||
The default is 0.1.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">comp_duration</samp></dt>
|
||||
<dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
|
||||
to make it match the timestamps. Must be a non-negative double float value,
|
||||
default value is 1.0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">max_soft_comp</samp></dt>
|
||||
<dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
|
||||
match the timestamps. Must be a non-negative double float value, default value
|
||||
is 0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">matrix_encoding</samp></dt>
|
||||
<dd><p>Select matrixed stereo encoding.
|
||||
</p>
|
||||
<p>It accepts the following values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">none</samp>’</dt>
|
||||
<dd><p>select none
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">dolby</samp>’</dt>
|
||||
<dd><p>select Dolby
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">dplii</samp>’</dt>
|
||||
<dd><p>select Dolby Pro Logic II
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>Default value is <code class="code">none</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">filter_type</samp></dt>
|
||||
<dd><p>For swr only, select resampling filter type. This only affects resampling
|
||||
operations.
|
||||
</p>
|
||||
<p>It accepts the following values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">cubic</samp>’</dt>
|
||||
<dd><p>select cubic
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">blackman_nuttall</samp>’</dt>
|
||||
<dd><p>select Blackman Nuttall windowed sinc
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">kaiser</samp>’</dt>
|
||||
<dd><p>select Kaiser windowed sinc
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">kaiser_beta</samp></dt>
|
||||
<dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
|
||||
interval [2,16], default value is 9.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">output_sample_bits</samp></dt>
|
||||
<dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
|
||||
interval [0,64], default value is 0, which means it’s not used.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">3 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="libswresample.html">libswresample</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">4 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
FFmpeg Scaler Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
FFmpeg Scaler Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-Scaler-Options" href="#Scaler-Options">2 Scaler Options</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">3 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">4 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg rescaler provides a high-level interface to the libswscale
|
||||
library image conversion utilities. In particular it allows one to perform
|
||||
image rescaling and pixel format conversion.
|
||||
</p>
|
||||
|
||||
<a class="anchor" id="scaler_005foptions"></a><a name="Scaler-Options"></a>
|
||||
<h2 class="chapter">2 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The video scaler supports the following named options.
|
||||
</p>
|
||||
<p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
|
||||
FFmpeg tools, with a few API-only exceptions noted below.
|
||||
For programmatic use, they can be set explicitly in the
|
||||
<code class="code">SwsContext</code> options or through the <samp class="file">libavutil/opt.h</samp> API.
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dd>
|
||||
<a class="anchor" id="scaler"></a></dd>
|
||||
<dt><samp class="option">scaler, scaler_sub</samp></dt>
|
||||
<dd><p>Choose the scaling algorithm to use. Default value is ‘<samp class="samp">auto</samp>’ for both.
|
||||
It accepts the following values:
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt>‘<samp class="samp">auto</samp>’</dt>
|
||||
<dd><p>Aumotic choice. For ‘<samp class="samp">scaler_sub</samp>’, this means the same algorithm as
|
||||
‘<samp class="samp">scaler</samp>’. For ‘<samp class="samp">scaler</samp>’, this defaults to the scaler flag selected
|
||||
by ‘<samp class="samp">sws_flags</samp>’.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bilinear</samp>’</dt>
|
||||
<dd><p>Bilinear filter. (AKA triangle filter)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bicubic</samp>’</dt>
|
||||
<dd><p>2-tap cubic BC-spline (AKA Mitchell-Netravali spline). The B and C parameters
|
||||
can be configured by setting <code class="code">param0</code> and <code class="code">param1</code>, defaulting to
|
||||
0.0 and 0.6 respectively.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">point, neighbor</samp>’</dt>
|
||||
<dd><p>Point sampling (AKA nearest neighbor).
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">area</samp>’</dt>
|
||||
<dd><p>Area averaging. Equivalent to ‘<samp class="samp">bilinear</samp>’ for upscaling.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">gaussian</samp>’</dt>
|
||||
<dd><p>2-tap Gaussian filter approximation. The sharpness parameter can be configured
|
||||
by setting <code class="code">param0</code>, defaulting to 3.0.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">sinc</samp>’</dt>
|
||||
<dd><p>Unwindowed sinc filter.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">lanczos</samp>’</dt>
|
||||
<dd><p>Lanczos resampling (sinc windowed sinc). The number of filter taps can
|
||||
be configured by setting <code class="code">param0</code>, defaulting to 3.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">spline</samp>’</dt>
|
||||
<dd><p>Unwindowed natural bicubic spline.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<a class="anchor" id="sws_005fflags"></a></dd>
|
||||
<dt><samp class="option">sws_flags</samp></dt>
|
||||
<dd><p>Set the scaler flags. This is also used to set the scaling
|
||||
algorithm, though this usage is deprecated in favor of setting ‘<samp class="samp">scaler</samp>’.
|
||||
Only a single algorithm may be selected. Default value is ‘<samp class="samp">bicubic</samp>’.
|
||||
</p>
|
||||
<p>It accepts the following values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">fast_bilinear</samp>’</dt>
|
||||
<dd><p>Select fast bilinear scaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bilinear</samp>’</dt>
|
||||
<dd><p>Select bilinear scaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bicubic</samp>’</dt>
|
||||
<dd><p>Select bicubic scaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">experimental</samp>’</dt>
|
||||
<dd><p>Select experimental scaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">neighbor</samp>’</dt>
|
||||
<dd><p>Select nearest neighbor rescaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">area</samp>’</dt>
|
||||
<dd><p>Select averaging area rescaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bicublin</samp>’</dt>
|
||||
<dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
|
||||
chroma components. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">gauss</samp>’</dt>
|
||||
<dd><p>Select Gaussian rescaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">sinc</samp>’</dt>
|
||||
<dd><p>Select sinc rescaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">lanczos</samp>’</dt>
|
||||
<dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
|
||||
changed by setting <code class="code">param0</code>. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">spline</samp>’</dt>
|
||||
<dd><p>Select natural bicubic spline rescaling algorithm. (Deprecated)
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">print_info</samp>’</dt>
|
||||
<dd><p>Enable printing/debug logging.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">accurate_rnd</samp>’</dt>
|
||||
<dd><p>Enable accurate rounding.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">full_chroma_int</samp>’</dt>
|
||||
<dd><p>Enable full chroma interpolation.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">full_chroma_inp</samp>’</dt>
|
||||
<dd><p>Select full chroma input.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bitexact</samp>’</dt>
|
||||
<dd><p>Enable bitexact output.
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">unstable</samp>’</dt>
|
||||
<dd><p>Allow the use of experimental new code. May subtly affect the output or even
|
||||
produce wrong results. For testing only.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">srcw <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set source width.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">srch <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set source height.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">dstw <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set destination width.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">dsth <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set destination height.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">src_format <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set source pixel format (must be expressed as an integer).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">dst_format <var class="var">(API only)</var></samp></dt>
|
||||
<dd><p>Set destination pixel format (must be expressed as an integer).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">src_range <var class="var">(boolean)</var></samp></dt>
|
||||
<dd><p>If value is set to <code class="code">1</code>, indicates source is full range. Default value is
|
||||
<code class="code">0</code>, which indicates source is limited range.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">dst_range <var class="var">(boolean)</var></samp></dt>
|
||||
<dd><p>If value is set to <code class="code">1</code>, enable full range for destination. Default value
|
||||
is <code class="code">0</code>, which enables limited range.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">gamma <var class="var">(boolean)</var></samp></dt>
|
||||
<dd><p>If value is set to <code class="code">1</code>, enable gamma correct scaling. Default value is <code class="code">0</code>.
|
||||
</p>
|
||||
<a class="anchor" id="sws_005fparams"></a></dd>
|
||||
<dt><samp class="option">param0, param1</samp></dt>
|
||||
<dd><p>Set scaling algorithm parameters. The specified values are specific of
|
||||
some scaling algorithms and ignored by others. The specified values
|
||||
are floating point number values.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">sws_dither</samp></dt>
|
||||
<dd><p>Set the dithering algorithm. Accepts one of the following
|
||||
values. Default value is ‘<samp class="samp">auto</samp>’.
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt>‘<samp class="samp">auto</samp>’</dt>
|
||||
<dd><p>automatic choice
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">none</samp>’</dt>
|
||||
<dd><p>no dithering
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">bayer</samp>’</dt>
|
||||
<dd><p>bayer dither
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">ed</samp>’</dt>
|
||||
<dd><p>error diffusion dither
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">a_dither</samp>’</dt>
|
||||
<dd><p>arithmetic dither, based using addition
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">x_dither</samp>’</dt>
|
||||
<dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
|
||||
a_dither).
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">alphablend</samp></dt>
|
||||
<dd><p>Set the alpha blending to use when the input has alpha but the output does not.
|
||||
Default value is ‘<samp class="samp">none</samp>’.
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt>‘<samp class="samp">uniform_color</samp>’</dt>
|
||||
<dd><p>Blend onto a uniform background color
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">checkerboard</samp>’</dt>
|
||||
<dd><p>Blend onto a checkerboard
|
||||
</p>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">none</samp>’</dt>
|
||||
<dd><p>No blending
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">3 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="libswscale.html">libswscale</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">4 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+1547
File diff suppressed because it is too large
Load Diff
Vendored
+4132
File diff suppressed because it is too large
Load Diff
+54853
File diff suppressed because it is too large
Load Diff
Vendored
+921
@@ -0,0 +1,921 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
ffplay Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
ffplay Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
|
||||
<li><a id="toc-Description" href="#Description">2 Description</a></li>
|
||||
<li><a id="toc-Options" href="#Options">3 Options</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
|
||||
<li><a id="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
|
||||
<li><a id="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
|
||||
<li><a id="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
|
||||
<li><a id="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
|
||||
<li><a id="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">4 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">5 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Synopsis"></a>
|
||||
<h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>ffplay [<var class="var">options</var>] [<samp class="file">input_url</samp>]
|
||||
</p>
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>FFplay is a very simple and portable media player using the FFmpeg
|
||||
libraries and the SDL library. It is mostly used as a testbed for the
|
||||
various FFmpeg APIs.
|
||||
</p>
|
||||
<a name="Options"></a>
|
||||
<h2 class="chapter">3 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>All the numerical options, if not specified otherwise, accept a string
|
||||
representing a number as input, which may be followed by one of the SI
|
||||
unit prefixes, for example: ’K’, ’M’, or ’G’.
|
||||
</p>
|
||||
<p>If ’i’ is appended to the SI unit prefix, the complete prefix will be
|
||||
interpreted as a unit prefix for binary multiples, which are based on
|
||||
powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit
|
||||
prefix multiplies the value by 8. This allows using, for example:
|
||||
’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.
|
||||
</p>
|
||||
<p>Options which do not take arguments are boolean options, and set the
|
||||
corresponding value to true. They can be set to false by prefixing
|
||||
the option name with "no". For example using "-nofoo"
|
||||
will set the boolean option with name "foo" to false.
|
||||
</p>
|
||||
<p>Options that take arguments support a special syntax where the argument given on
|
||||
the command line is interpreted as a path to the file from which the actual
|
||||
argument value is loaded. To use this feature, add a forward slash ’/’
|
||||
immediately before the option name (after the leading dash). E.g.
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
|
||||
</pre></div>
|
||||
<p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
|
||||
</p>
|
||||
<a class="anchor" id="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
|
||||
<h3 class="section">3.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
|
||||
<p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
|
||||
are used to precisely specify which stream(s) a given option belongs to.
|
||||
</p>
|
||||
<p>A stream specifier is a string generally appended to the option name and
|
||||
separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
|
||||
<code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
|
||||
would select the ac3 codec for the second audio stream.
|
||||
</p>
|
||||
<p>A stream specifier can match several streams, so that the option is applied to all
|
||||
of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
|
||||
streams.
|
||||
</p>
|
||||
<p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
|
||||
or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
|
||||
</p>
|
||||
<p>Possible forms of stream specifiers are:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option"><var class="var">stream_index</var></samp></dt>
|
||||
<dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
|
||||
thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
|
||||
additional stream specifier (see below), then it selects stream number
|
||||
<var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
|
||||
order of the streams as detected by libavformat except when a stream group
|
||||
specifier or program ID is also specified. In this case it is based on the
|
||||
ordering of the streams in the group or program.
|
||||
</p></dd>
|
||||
<dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
|
||||
<dd><p><var class="var">stream_type</var> is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’
|
||||
for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video
|
||||
streams, ’V’ only matches video streams which are not attached pictures, video
|
||||
thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
|
||||
it matches streams which both have this type and match the
|
||||
<var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
|
||||
specified type.
|
||||
</p></dd>
|
||||
<dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
|
||||
<dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
|
||||
if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
|
||||
are part of the group and match the <var class="var">additional_stream_specifier</var>.
|
||||
<var class="var">group_specifier</var> may be one of the following:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option"><var class="var">group_index</var></samp></dt>
|
||||
<dd><p>Match the stream with this group index.
|
||||
</p></dd>
|
||||
<dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
|
||||
<dd><p>Match the stream with this group id.
|
||||
</p></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
|
||||
<dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
|
||||
<var class="var">additional_stream_specifier</var> is used, then it matches streams which both
|
||||
are part of the program and match the <var class="var">additional_stream_specifier</var>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
|
||||
<dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
|
||||
</p></dd>
|
||||
<dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
|
||||
<dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
|
||||
<var class="var">value</var> is not given, matches streams that contain the given tag with any
|
||||
value. The colon character ’:’ in <var class="var">key</var> or <var class="var">value</var> needs to be
|
||||
backslash-escaped.
|
||||
</p></dd>
|
||||
<dt><samp class="option">disp:<var class="var">dispositions</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
|
||||
<dd><p>Matches streams with the given disposition(s). <var class="var">dispositions</var> is a list of
|
||||
one or more dispositions (as printed by the <samp class="option">-dispositions</samp> option)
|
||||
joined with ’+’.
|
||||
</p></dd>
|
||||
<dt><samp class="option">u</samp></dt>
|
||||
<dd><p>Matches streams with usable configuration, the codec must be defined and the
|
||||
essential information such as video dimension or audio sample rate must be present.
|
||||
</p>
|
||||
<p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
|
||||
input files.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<a name="Generic-options"></a>
|
||||
<h3 class="section">3.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>These options are shared amongst the ff* tools.
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt><samp class="option">-L, -license</samp></dt>
|
||||
<dd><p>Show license.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
|
||||
<dd><p>Show help. An optional parameter may be specified to print help about a specific
|
||||
item. If no argument is specified, only basic (non advanced) tool
|
||||
options are shown.
|
||||
</p>
|
||||
<p>Possible values of <var class="var">arg</var> are:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">long</samp></dt>
|
||||
<dd><p>Print advanced tool options in addition to the basic tool options.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">full</samp></dt>
|
||||
<dd><p>Print complete list of options, including shared and private options
|
||||
for encoders, decoders, demuxers, muxers, filters, etc.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
|
||||
<samp class="option">-decoders</samp> option to get a list of all decoders.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
|
||||
<samp class="option">-encoders</samp> option to get a list of all encoders.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
|
||||
<samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
|
||||
<samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
|
||||
<samp class="option">-filters</samp> option to get a list of all filters.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
|
||||
Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
|
||||
<dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
|
||||
Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">-version</samp></dt>
|
||||
<dd><p>Show version.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-buildconf</samp></dt>
|
||||
<dd><p>Show the build configuration, one option per line.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-formats</samp></dt>
|
||||
<dd><p>Show available formats (including devices).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-demuxers</samp></dt>
|
||||
<dd><p>Show available demuxers.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-muxers</samp></dt>
|
||||
<dd><p>Show available muxers.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-devices</samp></dt>
|
||||
<dd><p>Show available devices.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-codecs</samp></dt>
|
||||
<dd><p>Show all codecs known to libavcodec.
|
||||
</p>
|
||||
<p>Note that the term ’codec’ is used throughout this documentation as a shortcut
|
||||
for what is more correctly called a media bitstream format.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-decoders</samp></dt>
|
||||
<dd><p>Show available decoders.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-encoders</samp></dt>
|
||||
<dd><p>Show all available encoders.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-bsfs</samp></dt>
|
||||
<dd><p>Show available bitstream filters.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-protocols</samp></dt>
|
||||
<dd><p>Show available protocols.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-filters</samp></dt>
|
||||
<dd><p>Show available libavfilter filters.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-pix_fmts</samp></dt>
|
||||
<dd><p>Show available pixel formats.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-sample_fmts</samp></dt>
|
||||
<dd><p>Show available sample formats.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-layouts</samp></dt>
|
||||
<dd><p>Show channel names and standard channel layouts.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-dispositions</samp></dt>
|
||||
<dd><p>Show stream dispositions.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-colors</samp></dt>
|
||||
<dd><p>Show recognized color names.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-sources <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
|
||||
<dd><p>Show autodetected sources of the input device.
|
||||
Some devices may provide system-dependent source names that cannot be autodetected.
|
||||
The returned list cannot be assumed to be always complete.
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
|
||||
</pre></div>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">-sinks <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
|
||||
<dd><p>Show autodetected sinks of the output device.
|
||||
Some devices may provide system-dependent sink names that cannot be autodetected.
|
||||
The returned list cannot be assumed to be always complete.
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
|
||||
</pre></div>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">-loglevel [<var class="var">flags</var>+]<var class="var">loglevel</var> | -v [<var class="var">flags</var>+]<var class="var">loglevel</var></samp></dt>
|
||||
<dd><p>Set logging level and flags used by the library.
|
||||
</p>
|
||||
<p>The optional <var class="var">flags</var> prefix can consist of the following values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">repeat</samp>’</dt>
|
||||
<dd><p>Indicates that repeated log output should not be compressed to the first line
|
||||
and the "Last message repeated n times" line will be omitted.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">level</samp>’</dt>
|
||||
<dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
|
||||
line. This can be used as an alternative to log coloring, e.g. when dumping the
|
||||
log to file.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">time</samp>’</dt>
|
||||
<dd><p>Indicates that log lines should be prefixed with time information.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">datetime</samp>’</dt>
|
||||
<dd><p>Indicates that log lines should be prefixed with date and time information.
|
||||
</p></dd>
|
||||
</dl>
|
||||
<p>Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single
|
||||
flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
|
||||
setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a ’+’ separator is expected
|
||||
between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
|
||||
</p>
|
||||
<p><var class="var">loglevel</var> is a string or a number containing one of the following values:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">quiet, -8</samp>’</dt>
|
||||
<dd><p>Show nothing at all; be silent.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">panic, 0</samp>’</dt>
|
||||
<dd><p>Only show fatal errors which could lead the process to crash, such as
|
||||
an assertion failure. This is not currently used for anything.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">fatal, 8</samp>’</dt>
|
||||
<dd><p>Only show fatal errors. These are errors after which the process absolutely
|
||||
cannot continue.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">error, 16</samp>’</dt>
|
||||
<dd><p>Show all errors, including ones which can be recovered from.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">warning, 24</samp>’</dt>
|
||||
<dd><p>Show all warnings and errors. Any message related to possibly
|
||||
incorrect or unexpected events will be shown.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">info, 32</samp>’</dt>
|
||||
<dd><p>Show informative messages during processing. This is in addition to
|
||||
warnings and errors. This is the default value.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">verbose, 40</samp>’</dt>
|
||||
<dd><p>Same as <code class="code">info</code>, except more verbose.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">debug, 48</samp>’</dt>
|
||||
<dd><p>Show everything, including debugging information.
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">trace, 56</samp>’</dt>
|
||||
</dl>
|
||||
|
||||
<p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
|
||||
<var class="var">loglevel</var> to <code class="code">verbose</code>:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
|
||||
</pre></div>
|
||||
<p>Another example that enables repeated log output without affecting current
|
||||
state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
|
||||
</pre></div>
|
||||
|
||||
<p>By default the program logs to stderr. If coloring is supported by the
|
||||
terminal, colors are used to mark errors and warnings. Log coloring
|
||||
can be disabled setting the environment variable
|
||||
<code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
|
||||
the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-report</samp></dt>
|
||||
<dd><p>Dump full command line and log output to a file named
|
||||
<code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
|
||||
directory.
|
||||
This file can be useful for bug reports.
|
||||
It also implies <code class="code">-loglevel debug</code>.
|
||||
</p>
|
||||
<p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
|
||||
same effect. If the value is a ’:’-separated key=value sequence, these
|
||||
options will affect the report; option values must be escaped if they
|
||||
contain special characters or the options delimiter ’:’ (see the
|
||||
“Quoting and escaping” section in the ffmpeg-utils manual).
|
||||
</p>
|
||||
<p>The following options are recognized:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">file</samp></dt>
|
||||
<dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
|
||||
of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
|
||||
to a plain <code class="code">%</code>
|
||||
</p></dd>
|
||||
<dt><samp class="option">level</samp></dt>
|
||||
<dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
|
||||
using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
|
||||
</pre></div>
|
||||
|
||||
<p>Errors in parsing the environment variable are not fatal, and will not
|
||||
appear in the report.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-hide_banner</samp></dt>
|
||||
<dd><p>Suppress printing banner.
|
||||
</p>
|
||||
<p>All FFmpeg tools will normally show a copyright notice, build options
|
||||
and library versions. This option can be used to suppress printing
|
||||
this information.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
|
||||
<dd><p>Allows setting and clearing cpu flags. This option is intended
|
||||
for testing. Do not use it unless you know what you’re doing.
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
|
||||
ffmpeg -cpuflags mmx ...
|
||||
ffmpeg -cpuflags 0 ...
|
||||
</pre></div>
|
||||
<p>Possible flags for this option are:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">x86</samp>’</dt>
|
||||
<dd><dl class="table">
|
||||
<dt>‘<samp class="samp">mmx</samp>’</dt>
|
||||
<dt>‘<samp class="samp">mmxext</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse2slow</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse3</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse3slow</samp>’</dt>
|
||||
<dt>‘<samp class="samp">ssse3</samp>’</dt>
|
||||
<dt>‘<samp class="samp">atom</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse4.1</samp>’</dt>
|
||||
<dt>‘<samp class="samp">sse4.2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">avx</samp>’</dt>
|
||||
<dt>‘<samp class="samp">avx2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">xop</samp>’</dt>
|
||||
<dt>‘<samp class="samp">fma3</samp>’</dt>
|
||||
<dt>‘<samp class="samp">fma4</samp>’</dt>
|
||||
<dt>‘<samp class="samp">3dnow</samp>’</dt>
|
||||
<dt>‘<samp class="samp">3dnowext</samp>’</dt>
|
||||
<dt>‘<samp class="samp">bmi1</samp>’</dt>
|
||||
<dt>‘<samp class="samp">bmi2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">cmov</samp>’</dt>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">ARM</samp>’</dt>
|
||||
<dd><dl class="table">
|
||||
<dt>‘<samp class="samp">armv5te</samp>’</dt>
|
||||
<dt>‘<samp class="samp">armv6</samp>’</dt>
|
||||
<dt>‘<samp class="samp">armv6t2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">vfp</samp>’</dt>
|
||||
<dt>‘<samp class="samp">vfpv3</samp>’</dt>
|
||||
<dt>‘<samp class="samp">neon</samp>’</dt>
|
||||
<dt>‘<samp class="samp">setend</samp>’</dt>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">AArch64</samp>’</dt>
|
||||
<dd><dl class="table">
|
||||
<dt>‘<samp class="samp">armv8</samp>’</dt>
|
||||
<dt>‘<samp class="samp">vfp</samp>’</dt>
|
||||
<dt>‘<samp class="samp">neon</samp>’</dt>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">PowerPC</samp>’</dt>
|
||||
<dd><dl class="table">
|
||||
<dt>‘<samp class="samp">altivec</samp>’</dt>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>‘<samp class="samp">Specific Processors</samp>’</dt>
|
||||
<dd><dl class="table">
|
||||
<dt>‘<samp class="samp">pentium2</samp>’</dt>
|
||||
<dt>‘<samp class="samp">pentium3</samp>’</dt>
|
||||
<dt>‘<samp class="samp">pentium4</samp>’</dt>
|
||||
<dt>‘<samp class="samp">k6</samp>’</dt>
|
||||
<dt>‘<samp class="samp">k62</samp>’</dt>
|
||||
<dt>‘<samp class="samp">athlon</samp>’</dt>
|
||||
<dt>‘<samp class="samp">athlonxp</samp>’</dt>
|
||||
<dt>‘<samp class="samp">k8</samp>’</dt>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
|
||||
<dd><p>Override detection of CPU count. This option is intended
|
||||
for testing. Do not use it unless you know what you’re doing.
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -cpucount 2
|
||||
</pre></div>
|
||||
|
||||
</dd>
|
||||
<dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
|
||||
<dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg’s
|
||||
family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
|
||||
this option. Don’t use if you do not understand the full consequence of doing so.
|
||||
Default is INT_MAX.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<a name="AVOptions"></a>
|
||||
<h3 class="section">3.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>These options are provided directly by the libavformat, libavdevice and
|
||||
libavcodec libraries. To see the list of available AVOptions, use the
|
||||
<samp class="option">-help</samp> option. They are separated into two categories:
|
||||
</p><dl class="table">
|
||||
<dt><samp class="option">generic</samp></dt>
|
||||
<dd><p>These options can be set for any container, codec or device. Generic options
|
||||
are listed under AVFormatContext options for containers/devices and under
|
||||
AVCodecContext options for codecs.
|
||||
</p></dd>
|
||||
<dt><samp class="option">private</samp></dt>
|
||||
<dd><p>These options are specific to the given container, device or codec. Private
|
||||
options are listed under their corresponding containers/devices/codecs.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
|
||||
an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
|
||||
muxer:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
|
||||
</pre></div>
|
||||
|
||||
<p>All codec AVOptions are per-stream, and thus a stream specifier
|
||||
should be attached to them:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
|
||||
</pre></div>
|
||||
|
||||
<p>In the above example, a multichannel audio stream is mapped twice for output.
|
||||
The first instance is encoded with codec ac3 and bitrate 640k.
|
||||
The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
|
||||
absolute index of the output stream.
|
||||
</p>
|
||||
<p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
|
||||
AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
|
||||
</p>
|
||||
<p>Note: the old undocumented way of specifying per-stream AVOptions by
|
||||
prepending v/a/s to the options name is now obsolete and will be
|
||||
removed soon.
|
||||
</p>
|
||||
<a name="Main-options"></a>
|
||||
<h3 class="section">3.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<dl class="table">
|
||||
<dt><samp class="option">-x <var class="var">width</var></samp></dt>
|
||||
<dd><p>Force displayed width.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-y <var class="var">height</var></samp></dt>
|
||||
<dd><p>Force displayed height.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-fs</samp></dt>
|
||||
<dd><p>Start in fullscreen mode.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-an</samp></dt>
|
||||
<dd><p>Disable audio.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-vn</samp></dt>
|
||||
<dd><p>Disable video.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-sn</samp></dt>
|
||||
<dd><p>Disable subtitles.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-ss <var class="var">pos</var></samp></dt>
|
||||
<dd><p>Seek to <var class="var">pos</var>. Note that in most formats it is not possible to seek
|
||||
exactly, so <code class="command">ffplay</code> will seek to the nearest seek point to
|
||||
<var class="var">pos</var>.
|
||||
</p>
|
||||
<p><var class="var">pos</var> must be a time duration specification,
|
||||
see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-t <var class="var">duration</var></samp></dt>
|
||||
<dd><p>Play <var class="var">duration</var> seconds of audio/video.
|
||||
</p>
|
||||
<p><var class="var">duration</var> must be a time duration specification,
|
||||
see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-bytes</samp></dt>
|
||||
<dd><p>Seek by bytes.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-seek_interval</samp></dt>
|
||||
<dd><p>Set custom interval, in seconds, for seeking using left/right keys. Default is 10 seconds.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-nodisp</samp></dt>
|
||||
<dd><p>Disable graphical display.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-noborder</samp></dt>
|
||||
<dd><p>Borderless window.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-alwaysontop</samp></dt>
|
||||
<dd><p>Window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-volume</samp></dt>
|
||||
<dd><p>Set the startup volume. 0 means silence, 100 means no volume reduction or
|
||||
amplification. Negative values are treated as 0, values above 100 are treated
|
||||
as 100.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-f <var class="var">fmt</var></samp></dt>
|
||||
<dd><p>Force format.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-window_title <var class="var">title</var></samp></dt>
|
||||
<dd><p>Set window title (default is the input filename).
|
||||
</p></dd>
|
||||
<dt><samp class="option">-left <var class="var">title</var></samp></dt>
|
||||
<dd><p>Set the x position for the left of the window (default is a centered window).
|
||||
</p></dd>
|
||||
<dt><samp class="option">-top <var class="var">title</var></samp></dt>
|
||||
<dd><p>Set the y position for the top of the window (default is a centered window).
|
||||
</p></dd>
|
||||
<dt><samp class="option">-loop <var class="var">number</var></samp></dt>
|
||||
<dd><p>Loops movie playback <number> times. 0 means forever.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-showmode <var class="var">mode</var></samp></dt>
|
||||
<dd><p>Set the show mode to use.
|
||||
Available values for <var class="var">mode</var> are:
|
||||
</p><dl class="table">
|
||||
<dt>‘<samp class="samp">0, video</samp>’</dt>
|
||||
<dd><p>show video
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">1, waves</samp>’</dt>
|
||||
<dd><p>show audio waves
|
||||
</p></dd>
|
||||
<dt>‘<samp class="samp">2, rdft</samp>’</dt>
|
||||
<dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>Default value is "video", if video is not present or cannot be played
|
||||
"rdft" is automatically selected.
|
||||
</p>
|
||||
<p>You can interactively cycle through the available show modes by
|
||||
pressing the key <kbd class="key">w</kbd>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-vf <var class="var">filtergraph</var></samp></dt>
|
||||
<dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
|
||||
filter the video stream.
|
||||
</p>
|
||||
<p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
|
||||
the stream, and must have a single video input and a single video
|
||||
output. In the filtergraph, the input is associated to the label
|
||||
<code class="code">in</code>, and the output to the label <code class="code">out</code>. See the
|
||||
ffmpeg-filters manual for more information about the filtergraph
|
||||
syntax.
|
||||
</p>
|
||||
<p>You can specify this parameter multiple times and cycle through the specified
|
||||
filtergraphs along with the show modes by pressing the key <kbd class="key">w</kbd>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-af <var class="var">filtergraph</var></samp></dt>
|
||||
<dd><p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
|
||||
the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
sources and sinks).
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-i <var class="var">input_url</var></samp></dt>
|
||||
<dd><p>Read <var class="var">input_url</var>.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<a name="Advanced-options"></a>
|
||||
<h3 class="section">3.5 Advanced options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-options" aria-hidden="true">TOC</a></span></h3>
|
||||
<dl class="table">
|
||||
<dt><samp class="option">-stats</samp></dt>
|
||||
<dd><p>Print several playback statistics, in particular show the stream
|
||||
duration, the codec parameters, the current position in the stream and
|
||||
the audio/video synchronisation drift. It is shown by default, unless the
|
||||
log level is lower than <code class="code">info</code>. Its display can be forced by manually
|
||||
specifying this option. To disable it, you need to specify <code class="code">-nostats</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-fast</samp></dt>
|
||||
<dd><p>Non-spec-compliant optimizations.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-genpts</samp></dt>
|
||||
<dd><p>Generate pts.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-sync <var class="var">type</var></samp></dt>
|
||||
<dd><p>Set the master clock to audio (<code class="code">type=audio</code>), video
|
||||
(<code class="code">type=video</code>) or external (<code class="code">type=ext</code>). Default is audio. The
|
||||
master clock is used to control audio-video synchronization. Most media
|
||||
players use audio as master clock, but in some cases (streaming or high
|
||||
quality broadcast) it is necessary to change that. This option is mainly
|
||||
used for debugging purposes.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-ast <var class="var">audio_stream_specifier</var></samp></dt>
|
||||
<dd><p>Select the desired audio stream using the given stream specifier. The stream
|
||||
specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
|
||||
is not specified, the "best" audio stream is selected in the program of the
|
||||
already selected video stream.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-vst <var class="var">video_stream_specifier</var></samp></dt>
|
||||
<dd><p>Select the desired video stream using the given stream specifier. The stream
|
||||
specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
|
||||
is not specified, the "best" video stream is selected.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-sst <var class="var">subtitle_stream_specifier</var></samp></dt>
|
||||
<dd><p>Select the desired subtitle stream using the given stream specifier. The stream
|
||||
specifiers are described in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
|
||||
is not specified, the "best" subtitle stream is selected in the program of the
|
||||
already selected video or audio stream.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-autoexit</samp></dt>
|
||||
<dd><p>Exit when video is done playing.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-exitonkeydown</samp></dt>
|
||||
<dd><p>Exit if any key is pressed.
|
||||
</p></dd>
|
||||
<dt><samp class="option">-exitonmousedown</samp></dt>
|
||||
<dd><p>Exit if any mouse button is pressed.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-codec:<var class="var">media_specifier</var> <var class="var">codec_name</var></samp></dt>
|
||||
<dd><p>Force a specific decoder implementation for the stream identified by
|
||||
<var class="var">media_specifier</var>, which can assume the values <code class="code">a</code> (audio),
|
||||
<code class="code">v</code> (video), and <code class="code">s</code> subtitle.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-acodec <var class="var">codec_name</var></samp></dt>
|
||||
<dd><p>Force a specific audio decoder.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-vcodec <var class="var">codec_name</var></samp></dt>
|
||||
<dd><p>Force a specific video decoder.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-scodec <var class="var">codec_name</var></samp></dt>
|
||||
<dd><p>Force a specific subtitle decoder.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-autorotate</samp></dt>
|
||||
<dd><p>Automatically rotate the video according to file metadata. Enabled by
|
||||
default, use <samp class="option">-noautorotate</samp> to disable it.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-framedrop</samp></dt>
|
||||
<dd><p>Drop video frames if video is out of sync. Enabled by default if the master
|
||||
clock is not set to video. Use this option to enable frame dropping for all
|
||||
master clock sources, use <samp class="option">-noframedrop</samp> to disable it.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-infbuf</samp></dt>
|
||||
<dd><p>Do not limit the input buffer size, read as much data as possible from the
|
||||
input as soon as possible. Enabled by default for realtime streams, where data
|
||||
may be dropped if not read in time. Use this option to enable infinite buffers
|
||||
for all inputs, use <samp class="option">-noinfbuf</samp> to disable it.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-filter_threads <var class="var">nb_threads</var></samp></dt>
|
||||
<dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
|
||||
will produce a thread pool with this many threads available for parallel
|
||||
processing. The default is 0 which means that the thread count will be
|
||||
determined by the number of available CPUs.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-enable_vulkan</samp></dt>
|
||||
<dd><p>Use vulkan renderer rather than SDL builtin renderer. Depends on libplacebo.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-vulkan_params</samp></dt>
|
||||
<dd>
|
||||
<p>Vulkan configuration using a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by
|
||||
":".
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-hwaccel</samp></dt>
|
||||
<dd><p>Use HW accelerated decoding. Enable this option will enable vulkan renderer
|
||||
automatically.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><samp class="option">-video_bg <var class="var">pattern</var></samp></dt>
|
||||
<dd><p>Set the video background pattern used for transparent videos. For solid color
|
||||
patterns you can use the color name or color code as specified in the
|
||||
<a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">Color section in the ffmpeg-utils(1) manual</a>.
|
||||
You can also use the special <code class="code">tiles</code> keyword for a checker board style
|
||||
pattern. This is also the default. The <code class="code">none</code> pattern does rendering
|
||||
without alpha blending effectively ignoring alpha channel.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<a name="While-playing"></a>
|
||||
<h3 class="section">3.6 While playing<span class="pull-right"><a class="anchor hidden-xs" href="#While-playing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-While-playing" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<dl class="table">
|
||||
<dt><kbd class="key">q, ESC</kbd></dt>
|
||||
<dd><p>Quit.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">f</kbd></dt>
|
||||
<dd><p>Toggle full screen.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">p, SPC</kbd></dt>
|
||||
<dd><p>Pause.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">m</kbd></dt>
|
||||
<dd><p>Toggle mute.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">9, 0</kbd></dt>
|
||||
<dt><kbd class="key">/, *</kbd></dt>
|
||||
<dd><p>Decrease and increase volume respectively.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">a</kbd></dt>
|
||||
<dd><p>Cycle audio channel in the current program.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">v</kbd></dt>
|
||||
<dd><p>Cycle video channel.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">t</kbd></dt>
|
||||
<dd><p>Cycle subtitle channel in the current program.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">c</kbd></dt>
|
||||
<dd><p>Cycle program.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">w</kbd></dt>
|
||||
<dd><p>Cycle video filters or show modes.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">s</kbd></dt>
|
||||
<dd><p>Step to the next frame.
|
||||
</p>
|
||||
<p>Pause if the stream is not already paused, step to the next video
|
||||
frame, and pause.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">left/right</kbd></dt>
|
||||
<dd><p>Seek backward/forward by 10 seconds or a custom interval if -seek_interval is set.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">down/up</kbd></dt>
|
||||
<dd><p>Seek backward/forward 1 minute.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">page down/page up</kbd></dt>
|
||||
<dd><p>Seek to previous/next chapter or backward/forward 10 minutes if no chapters.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">right mouse click</kbd></dt>
|
||||
<dd><p>Seek to percentage in file corresponding to fraction of width.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><kbd class="key">left mouse double-click</kbd></dt>
|
||||
<dd><p>Toggle full screen.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">4 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffplay-all.html">ffmpeg-all</a>,
|
||||
<a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
|
||||
<a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
|
||||
<a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
|
||||
<a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
|
||||
<a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
|
||||
<a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
|
||||
<a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
|
||||
<a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
|
||||
<a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">5 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+55213
File diff suppressed because it is too large
Load Diff
Vendored
+1281
File diff suppressed because it is too large
Load Diff
Vendored
+1421
File diff suppressed because it is too large
Load Diff
+562
@@ -0,0 +1,562 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Using Git to develop FFmpeg
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Using Git to develop FFmpeg
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Introduction" href="#Introduction">1 Introduction</a></li>
|
||||
<li><a id="toc-Basics-Usage" href="#Basics-Usage">2 Basics Usage</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Get-Git" href="#Get-Git">2.1 Get Git</a></li>
|
||||
<li><a id="toc-Cloning-the-source-tree" href="#Cloning-the-source-tree">2.2 Cloning the source tree</a></li>
|
||||
<li><a id="toc-Updating-the-source-tree-to-the-latest-revision-1" href="#Updating-the-source-tree-to-the-latest-revision-1">2.3 Updating the source tree to the latest revision</a></li>
|
||||
<li><a id="toc-Rebasing-your-local-branches" href="#Rebasing-your-local-branches">2.4 Rebasing your local branches</a></li>
|
||||
<li><a id="toc-Adding_002fremoving-files_002fdirectories" href="#Adding_002fremoving-files_002fdirectories">2.5 Adding/removing files/directories</a></li>
|
||||
<li><a id="toc-Showing-modifications" href="#Showing-modifications">2.6 Showing modifications</a></li>
|
||||
<li><a id="toc-Inspecting-the-changelog" href="#Inspecting-the-changelog">2.7 Inspecting the changelog</a></li>
|
||||
<li><a id="toc-Checking-source-tree-status" href="#Checking-source-tree-status">2.8 Checking source tree status</a></li>
|
||||
<li><a id="toc-Committing" href="#Committing">2.9 Committing</a></li>
|
||||
<li><a id="toc-Writing-a-commit-message" href="#Writing-a-commit-message">2.10 Writing a commit message</a></li>
|
||||
<li><a id="toc-Preparing-a-patchset" href="#Preparing-a-patchset">2.11 Preparing a patchset</a></li>
|
||||
<li><a id="toc-Sending-patches-for-review" href="#Sending-patches-for-review">2.12 Sending patches for review</a></li>
|
||||
<li><a id="toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files" href="#Renaming_002fmoving_002fcopying-files-or-contents-of-files">2.13 Renaming/moving/copying files or contents of files</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Git-configuration" href="#Git-configuration">3 Git configuration</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Personal-Git-installation" href="#Personal-Git-installation">3.1 Personal Git installation</a></li>
|
||||
<li><a id="toc-Repository-configuration" href="#Repository-configuration">3.2 Repository configuration</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-FFmpeg-specific" href="#FFmpeg-specific">4 FFmpeg specific</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Reverting-broken-commits" href="#Reverting-broken-commits">4.1 Reverting broken commits</a></li>
|
||||
<li><a id="toc-Pushing-changes-to-remote-trees" href="#Pushing-changes-to-remote-trees">4.2 Pushing changes to remote trees</a></li>
|
||||
<li><a id="toc-Finding-a-specific-svn-revision" href="#Finding-a-specific-svn-revision">4.3 Finding a specific svn revision</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-gpg-key-generation" href="#gpg-key-generation">5 gpg key generation</a></li>
|
||||
<li><a id="toc-Pre_002dpush-checklist" href="#Pre_002dpush-checklist">6 Pre-push checklist</a></li>
|
||||
<li><a id="toc-Server-Issues" href="#Server-Issues">7 Server Issues</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Introduction"></a>
|
||||
<h2 class="chapter">1 Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Introduction" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>This document aims in giving some quick references on a set of useful Git
|
||||
commands. You should always use the extensive and detailed documentation
|
||||
provided directly by Git:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git --help
|
||||
man git
|
||||
</pre></div>
|
||||
|
||||
<p>shows you the available subcommands,
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git <command> --help
|
||||
man git-<command>
|
||||
</pre></div>
|
||||
|
||||
<p>shows information about the subcommand <command>.
|
||||
</p>
|
||||
<p>Additional information could be found on the
|
||||
<a class="url" href="http://gitref.org">Git Reference</a> website.
|
||||
</p>
|
||||
<p>For more information about the Git project, visit the
|
||||
<a class="url" href="http://git-scm.com/">Git website</a>.
|
||||
</p>
|
||||
<p>Consult these resources whenever you have problems, they are quite exhaustive.
|
||||
</p>
|
||||
<p>What follows now is a basic introduction to Git and some FFmpeg-specific
|
||||
guidelines to ease the contribution to the project.
|
||||
</p>
|
||||
<a name="Basics-Usage"></a>
|
||||
<h2 class="chapter">2 Basics Usage<span class="pull-right"><a class="anchor hidden-xs" href="#Basics-Usage" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Basics-Usage" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Get-Git"></a>
|
||||
<h3 class="section">2.1 Get Git<span class="pull-right"><a class="anchor hidden-xs" href="#Get-Git" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Get-Git" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You can get Git from <a class="url" href="http://git-scm.com/">http://git-scm.com/</a>
|
||||
Most distribution and operating system provide a package for it.
|
||||
</p>
|
||||
|
||||
<a name="Cloning-the-source-tree"></a>
|
||||
<h3 class="section">2.2 Cloning the source tree<span class="pull-right"><a class="anchor hidden-xs" href="#Cloning-the-source-tree" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Cloning-the-source-tree" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git clone https://git.ffmpeg.org/ffmpeg.git <target>
|
||||
</pre></div>
|
||||
|
||||
<p>This will put the FFmpeg sources into the directory <var class="var"><target></var>.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git clone git@source.ffmpeg.org:ffmpeg <target>
|
||||
</pre></div>
|
||||
|
||||
<p>This will put the FFmpeg sources into the directory <var class="var"><target></var> and let
|
||||
you push back your changes to the remote repository.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git clone git@ffmpeg.org:ffmpeg-web <target>
|
||||
</pre></div>
|
||||
|
||||
<p>This will put the source of the FFmpeg website into the directory
|
||||
<var class="var"><target></var> and let you push back your changes to the remote repository.
|
||||
</p>
|
||||
<p>If you don’t have write-access to the ffmpeg-web repository, you can
|
||||
create patches after making a read-only ffmpeg-web clone:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git clone git://ffmpeg.org/ffmpeg-web <target>
|
||||
</pre></div>
|
||||
|
||||
<p>Make sure that you do not have Windows line endings in your checkouts,
|
||||
otherwise you may experience spurious compilation failures. One way to
|
||||
achieve this is to run
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git config --global core.autocrlf false
|
||||
</pre></div>
|
||||
|
||||
|
||||
<a class="anchor" id="Updating-the-source-tree-to-the-latest-revision"></a><a name="Updating-the-source-tree-to-the-latest-revision-1"></a>
|
||||
<h3 class="section">2.3 Updating the source tree to the latest revision<span class="pull-right"><a class="anchor hidden-xs" href="#Updating-the-source-tree-to-the-latest-revision-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Updating-the-source-tree-to-the-latest-revision-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git pull (--rebase)
|
||||
</pre></div>
|
||||
|
||||
<p>pulls in the latest changes from the tracked branch. The tracked branch
|
||||
can be remote. By default the master branch tracks the branch master in
|
||||
the remote origin.
|
||||
</p>
|
||||
<div class="warning">
|
||||
<p><code class="command">--rebase</code> (see below) is recommended.
|
||||
</p></div>
|
||||
<a name="Rebasing-your-local-branches"></a>
|
||||
<h3 class="section">2.4 Rebasing your local branches<span class="pull-right"><a class="anchor hidden-xs" href="#Rebasing-your-local-branches" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Rebasing-your-local-branches" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git pull --rebase
|
||||
</pre></div>
|
||||
|
||||
<p>fetches the changes from the main repository and replays your local commits
|
||||
over it. This is required to keep all your local changes at the top of
|
||||
FFmpeg’s master tree. The master tree will reject pushes with merge commits.
|
||||
</p>
|
||||
|
||||
<a name="Adding_002fremoving-files_002fdirectories"></a>
|
||||
<h3 class="section">2.5 Adding/removing files/directories<span class="pull-right"><a class="anchor hidden-xs" href="#Adding_002fremoving-files_002fdirectories" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Adding_002fremoving-files_002fdirectories" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git add [-A] <filename/dirname>
|
||||
git rm [-r] <filename/dirname>
|
||||
</pre></div>
|
||||
|
||||
<p>Git needs to get notified of all changes you make to your working
|
||||
directory that makes files appear or disappear.
|
||||
Line moves across files are automatically tracked.
|
||||
</p>
|
||||
|
||||
<a name="Showing-modifications"></a>
|
||||
<h3 class="section">2.6 Showing modifications<span class="pull-right"><a class="anchor hidden-xs" href="#Showing-modifications" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Showing-modifications" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git diff <filename(s)>
|
||||
</pre></div>
|
||||
|
||||
<p>will show all local modifications in your working directory as unified diff.
|
||||
</p>
|
||||
|
||||
<a name="Inspecting-the-changelog"></a>
|
||||
<h3 class="section">2.7 Inspecting the changelog<span class="pull-right"><a class="anchor hidden-xs" href="#Inspecting-the-changelog" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Inspecting-the-changelog" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git log <filename(s)>
|
||||
</pre></div>
|
||||
|
||||
<p>You may also use the graphical tools like <code class="command">gitview</code> or <code class="command">gitk</code>
|
||||
or the web interface available at <a class="url" href="https://git.ffmpeg.org/ffmpeg.git">https://git.ffmpeg.org/ffmpeg.git</a>.
|
||||
</p>
|
||||
<a name="Checking-source-tree-status"></a>
|
||||
<h3 class="section">2.8 Checking source tree status<span class="pull-right"><a class="anchor hidden-xs" href="#Checking-source-tree-status" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Checking-source-tree-status" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git status
|
||||
</pre></div>
|
||||
|
||||
<p>detects all the changes you made and lists what actions will be taken in case
|
||||
of a commit (additions, modifications, deletions, etc.).
|
||||
</p>
|
||||
|
||||
<a name="Committing"></a>
|
||||
<h3 class="section">2.9 Committing<span class="pull-right"><a class="anchor hidden-xs" href="#Committing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Committing" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git diff --check
|
||||
</pre></div>
|
||||
|
||||
<p>to double check your changes before committing them to avoid trouble later
|
||||
on. All experienced developers do this on each and every commit, no matter
|
||||
how small.
|
||||
</p>
|
||||
<p>Every one of them has been saved from looking like a fool by this many times.
|
||||
It’s very easy for stray debug output or cosmetic modifications to slip in,
|
||||
please avoid problems through this extra level of scrutiny.
|
||||
</p>
|
||||
<p>For cosmetics-only commits you should get (almost) empty output from
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git diff -w -b <filename(s)>
|
||||
</pre></div>
|
||||
|
||||
<p>Also check the output of
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git status
|
||||
</pre></div>
|
||||
|
||||
<p>to make sure you don’t have untracked files or deletions.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git add [-i|-p|-A] <filenames/dirnames>
|
||||
</pre></div>
|
||||
|
||||
<p>Make sure you have told Git your name, email address and GPG key
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git config --global user.name "My Name"
|
||||
git config --global user.email my@email.invalid
|
||||
git config --global user.signingkey ABCDEF0123245
|
||||
</pre></div>
|
||||
|
||||
<p>Enable signing all commits or use -S
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git config --global commit.gpgsign true
|
||||
</pre></div>
|
||||
|
||||
<p>Use <samp class="option">--global</samp> to set the global configuration for all your Git checkouts.
|
||||
</p>
|
||||
<p>Git will select the changes to the files for commit. Optionally you can use
|
||||
the interactive or the patch mode to select hunk by hunk what should be
|
||||
added to the commit.
|
||||
</p>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git commit
|
||||
</pre></div>
|
||||
|
||||
<p>Git will commit the selected changes to your current local branch.
|
||||
</p>
|
||||
<p>You will be prompted for a log message in an editor, which is either
|
||||
set in your personal configuration file through
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git config --global core.editor
|
||||
</pre></div>
|
||||
|
||||
<p>or set by one of the following environment variables:
|
||||
<var class="var">GIT_EDITOR</var>, <var class="var">VISUAL</var> or <var class="var">EDITOR</var>.
|
||||
</p>
|
||||
<a name="Writing-a-commit-message"></a>
|
||||
<h3 class="section">2.10 Writing a commit message<span class="pull-right"><a class="anchor hidden-xs" href="#Writing-a-commit-message" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Writing-a-commit-message" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Log messages should be concise but descriptive.
|
||||
</p>
|
||||
<p>The first line must contain the context, a colon and a very short
|
||||
summary of what the commit does. Details can be added, if necessary,
|
||||
separated by an empty line. These details should not exceed 60-72 characters
|
||||
per line, except when containing code.
|
||||
</p>
|
||||
<p>Example of a good commit message:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">avcodec/cbs: add a helper to read extradata within packet side data
|
||||
|
||||
Using ff_cbs_read() on the raw buffer will not parse it as extradata,
|
||||
resulting in parsing errors for example when handling ISOBMFF avcC.
|
||||
This helper works around that.
|
||||
</pre></div>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">ptr might be NULL
|
||||
</pre></div>
|
||||
|
||||
<p>If the summary on the first line is not enough, in the body of the message,
|
||||
explain why you made a change, what you did will be obvious from the changes
|
||||
themselves most of the time. Saying just "bug fix" or "10l" is bad. Remember
|
||||
that people of varying skill levels look at and educate themselves while
|
||||
reading through your code. Don’t include filenames in log messages except in
|
||||
the context, Git provides that information.
|
||||
</p>
|
||||
<p>If the commit fixes a registered issue, state it in a separate line of the
|
||||
body: <code class="code">Fix Trac ticket #42.</code>
|
||||
</p>
|
||||
<p>The first line will be used to name
|
||||
the patch by <code class="command">git format-patch</code>.
|
||||
</p>
|
||||
<p>Common mistakes for the first line, as seen in <code class="command">git log --oneline</code>
|
||||
include: missing context at the beginning; description of what the code did
|
||||
before the patch; line too long or wrapped to the second line.
|
||||
</p>
|
||||
<a name="Preparing-a-patchset"></a>
|
||||
<h3 class="section">2.11 Preparing a patchset<span class="pull-right"><a class="anchor hidden-xs" href="#Preparing-a-patchset" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Preparing-a-patchset" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git format-patch <commit> [-o directory]
|
||||
</pre></div>
|
||||
|
||||
<p>will generate a set of patches for each commit between <var class="var"><commit></var> and
|
||||
current <var class="var">HEAD</var>. E.g.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git format-patch origin/master
|
||||
</pre></div>
|
||||
|
||||
<p>will generate patches for all commits on current branch which are not
|
||||
present in upstream.
|
||||
A useful shortcut is also
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git format-patch -n
|
||||
</pre></div>
|
||||
|
||||
<p>which will generate patches from last <var class="var">n</var> commits.
|
||||
By default the patches are created in the current directory.
|
||||
</p>
|
||||
<a name="Sending-patches-for-review"></a>
|
||||
<h3 class="section">2.12 Sending patches for review<span class="pull-right"><a class="anchor hidden-xs" href="#Sending-patches-for-review" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Sending-patches-for-review" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git send-email <commit list|directory>
|
||||
</pre></div>
|
||||
|
||||
<p>will send the patches created by <code class="command">git format-patch</code> or directly
|
||||
generates them. All the email fields can be configured in the global/local
|
||||
configuration or overridden by command line.
|
||||
Note that this tool must often be installed separately (e.g. <var class="var">git-email</var>
|
||||
package on Debian-based distros).
|
||||
</p>
|
||||
|
||||
<a name="Renaming_002fmoving_002fcopying-files-or-contents-of-files"></a>
|
||||
<h3 class="section">2.13 Renaming/moving/copying files or contents of files<span class="pull-right"><a class="anchor hidden-xs" href="#Renaming_002fmoving_002fcopying-files-or-contents-of-files" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Renaming_002fmoving_002fcopying-files-or-contents-of-files" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Git automatically tracks such changes, making those normal commits.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">mv/cp path/file otherpath/otherfile
|
||||
git add [-A] .
|
||||
git commit
|
||||
</pre></div>
|
||||
|
||||
|
||||
<a name="Git-configuration"></a>
|
||||
<h2 class="chapter">3 Git configuration<span class="pull-right"><a class="anchor hidden-xs" href="#Git-configuration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Git-configuration" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>In order to simplify a few workflows, it is advisable to configure both
|
||||
your personal Git installation and your local FFmpeg repository.
|
||||
</p>
|
||||
<a name="Personal-Git-installation"></a>
|
||||
<h3 class="section">3.1 Personal Git installation<span class="pull-right"><a class="anchor hidden-xs" href="#Personal-Git-installation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Personal-Git-installation" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Add the following to your <samp class="file">~/.gitconfig</samp> to help <code class="command">git send-email</code>
|
||||
and <code class="command">git format-patch</code> detect renames:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">[diff]
|
||||
renames = copy
|
||||
</pre></div>
|
||||
|
||||
<a name="Repository-configuration"></a>
|
||||
<h3 class="section">3.2 Repository configuration<span class="pull-right"><a class="anchor hidden-xs" href="#Repository-configuration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Repository-configuration" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>In order to have <code class="command">git send-email</code> automatically send patches
|
||||
to the ffmpeg-devel mailing list, add the following stanza
|
||||
to <samp class="file">/path/to/ffmpeg/repository/.git/config</samp>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">[sendemail]
|
||||
to = ffmpeg-devel@ffmpeg.org
|
||||
</pre></div>
|
||||
|
||||
<a name="FFmpeg-specific"></a>
|
||||
<h2 class="chapter">4 FFmpeg specific<span class="pull-right"><a class="anchor hidden-xs" href="#FFmpeg-specific" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FFmpeg-specific" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Reverting-broken-commits"></a>
|
||||
<h3 class="section">4.1 Reverting broken commits<span class="pull-right"><a class="anchor hidden-xs" href="#Reverting-broken-commits" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Reverting-broken-commits" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git reset <commit>
|
||||
</pre></div>
|
||||
|
||||
<p><code class="command">git reset</code> will uncommit the changes till <var class="var"><commit></var> rewriting
|
||||
the current branch history.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git commit --amend
|
||||
</pre></div>
|
||||
|
||||
<p>allows one to amend the last commit details quickly.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git rebase -i origin/master
|
||||
</pre></div>
|
||||
|
||||
<p>will replay local commits over the main repository allowing to edit, merge
|
||||
or remove some of them in the process.
|
||||
</p>
|
||||
<div class="info">
|
||||
<p><code class="command">git reset</code>, <code class="command">git commit --amend</code> and <code class="command">git rebase</code>
|
||||
rewrite history, so you should use them ONLY on your local or topic branches.
|
||||
The main repository will reject those changes.
|
||||
</p></div>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git revert <commit>
|
||||
</pre></div>
|
||||
|
||||
<p><code class="command">git revert</code> will generate a revert commit. This will not make the
|
||||
faulty commit disappear from the history.
|
||||
</p>
|
||||
<a name="Pushing-changes-to-remote-trees"></a>
|
||||
<h3 class="section">4.2 Pushing changes to remote trees<span class="pull-right"><a class="anchor hidden-xs" href="#Pushing-changes-to-remote-trees" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pushing-changes-to-remote-trees" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git push origin master --dry-run
|
||||
</pre></div>
|
||||
|
||||
<p>Will simulate a push of the local master branch to the default remote
|
||||
(<var class="var">origin</var>). And list which branches and ranges or commits would have been
|
||||
pushed.
|
||||
Git will prevent you from pushing changes if the local and remote trees are
|
||||
out of sync. Refer to <a class="ref" href="#Updating-the-source-tree-to-the-latest-revision">Updating the source tree to the latest revision</a>.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git remote add <name> <url>
|
||||
</pre></div>
|
||||
|
||||
<p>Will add additional remote with a name reference, it is useful if you want
|
||||
to push your local branch for review on a remote host.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git push <remote> <refspec>
|
||||
</pre></div>
|
||||
|
||||
<p>Will push the changes to the <var class="var"><remote></var> repository.
|
||||
Omitting <var class="var"><refspec></var> makes <code class="command">git push</code> update all the remote
|
||||
branches matching the local ones.
|
||||
</p>
|
||||
<a name="Finding-a-specific-svn-revision"></a>
|
||||
<h3 class="section">4.3 Finding a specific svn revision<span class="pull-right"><a class="anchor hidden-xs" href="#Finding-a-specific-svn-revision" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Finding-a-specific-svn-revision" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Since version 1.7.1 Git supports ‘<samp class="samp">:/foo</samp>’ syntax for specifying commits
|
||||
based on a regular expression. see man gitrevisions
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git show :/'as revision 23456'
|
||||
</pre></div>
|
||||
|
||||
<p>will show the svn changeset ‘<samp class="samp">r23456</samp>’. With older Git versions searching in
|
||||
the <code class="command">git log</code> output is the easiest option (especially if a pager with
|
||||
search capabilities is used).
|
||||
</p>
|
||||
<p>This commit can be checked out with
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git checkout -b svn_23456 :/'as revision 23456'
|
||||
</pre></div>
|
||||
|
||||
<p>or for Git < 1.7.1 with
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">git checkout -b svn_23456 $SHA1
|
||||
</pre></div>
|
||||
|
||||
<p>where <var class="var">$SHA1</var> is the commit hash from the <code class="command">git log</code> output.
|
||||
</p>
|
||||
|
||||
<a name="gpg-key-generation"></a>
|
||||
<h2 class="chapter">5 gpg key generation<span class="pull-right"><a class="anchor hidden-xs" href="#gpg-key-generation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gpg-key-generation" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>If you have no gpg key yet, we recommend that you create a ed25519 based key as it
|
||||
is small, fast and secure. Especially it results in small signatures in git.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">gpg --default-new-key-algo "ed25519/cert,sign+cv25519/encr" --quick-generate-key "human@server.com"
|
||||
</pre></div>
|
||||
|
||||
<p>When generating a key, make sure the email specified matches the email used in git as some sites like
|
||||
github consider mismatches a reason to declare such commits unverified. After generating a key you
|
||||
can add it to the MAINTAINER file and upload it to a keyserver.
|
||||
</p>
|
||||
<a name="Pre_002dpush-checklist"></a>
|
||||
<h2 class="chapter">6 Pre-push checklist<span class="pull-right"><a class="anchor hidden-xs" href="#Pre_002dpush-checklist" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pre_002dpush-checklist" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Once you have a set of commits that you feel are ready for pushing,
|
||||
work through the following checklist to doublecheck everything is in
|
||||
proper order. This list tries to be exhaustive. In case you are just
|
||||
pushing a typo in a comment, some of the steps may be unnecessary.
|
||||
Apply your common sense, but if in doubt, err on the side of caution.
|
||||
</p>
|
||||
<p>First, make sure that the commits and branches you are going to push
|
||||
match what you want pushed and that nothing is missing, extraneous or
|
||||
wrong. You can see what will be pushed by running the git push command
|
||||
with <samp class="option">--dry-run</samp> first. And then inspecting the commits listed with
|
||||
<code class="command">git log -p 1234567..987654</code>. The <code class="command">git status</code> command
|
||||
may help in finding local changes that have been forgotten to be added.
|
||||
</p>
|
||||
<p>Next let the code pass through a full run of our test suite.
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li><code class="command">make distclean</code>
|
||||
</li><li><code class="command">/path/to/ffmpeg/configure</code>
|
||||
</li><li><code class="command">make fate</code>
|
||||
</li><li>if fate fails due to missing samples run <code class="command">make fate-rsync</code> and retry
|
||||
</li></ul>
|
||||
|
||||
<p>Make sure all your changes have been checked before pushing them, the
|
||||
test suite only checks against regressions and that only to some extend. It does
|
||||
obviously not check newly added features/code to be working unless you have
|
||||
added a test for that (which is recommended).
|
||||
</p>
|
||||
<p>Also note that every single commit should pass the test suite, not just
|
||||
the result of a series of patches.
|
||||
</p>
|
||||
<p>Once everything passed, push the changes to your public ffmpeg clone and post a
|
||||
merge request to ffmpeg-devel. You can also push them directly but this is not
|
||||
recommended.
|
||||
</p>
|
||||
<a name="Server-Issues"></a>
|
||||
<h2 class="chapter">7 Server Issues<span class="pull-right"><a class="anchor hidden-xs" href="#Server-Issues" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Server-Issues" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Contact the project admins at <a class="email" href="mailto:root@ffmpeg.org">root@ffmpeg.org</a> if you have technical
|
||||
problems with the Git server.
|
||||
</p> <p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libavcodec Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libavcodec Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libavcodec library provides a generic encoding/decoding framework
|
||||
and contains multiple decoders and encoders for audio, video and
|
||||
subtitle streams, and several bitstream filters.
|
||||
</p>
|
||||
<p>The shared architecture provides various services ranging from bit
|
||||
stream I/O to DSP optimizations, and makes it suitable for
|
||||
implementing robust and fast codecs as well as for experimentation.
|
||||
</p>
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>, <a class="url" href="ffmpeg-bitstream-filters.html">bitstream-filters</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libavdevice Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libavdevice Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libavdevice library provides a generic framework for grabbing from
|
||||
and rendering to many common multimedia input/output devices, and
|
||||
supports several input and output devices, including Video4Linux2,
|
||||
VfW, DShow, and ALSA.
|
||||
</p>
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>, <a class="url" href="libavcodec.html">libavcodec</a>, <a class="url" href="libavformat.html">libavformat</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libavfilter Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libavfilter Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libavfilter library provides a generic audio/video filtering
|
||||
framework containing several filters, sources and sinks.
|
||||
</p>
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>, <a class="url" href="libswscale.html">libswscale</a>, <a class="url" href="libswresample.html">libswresample</a>,
|
||||
<a class="url" href="libavcodec.html">libavcodec</a>, <a class="url" href="libavformat.html">libavformat</a>, <a class="url" href="libavdevice.html">libavdevice</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libavformat Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libavformat Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libavformat library provides a generic framework for multiplexing
|
||||
and demultiplexing (muxing and demuxing) audio, video and subtitle
|
||||
streams. It encompasses multiple muxers and demuxers for multimedia
|
||||
container formats.
|
||||
</p>
|
||||
<p>It also supports several input and output protocols to access a media
|
||||
resource.
|
||||
</p>
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>, <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>, <a class="url" href="libavcodec.html">libavcodec</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libavutil Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libavutil Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libavutil library is a utility library to aid portable
|
||||
multimedia programming. It contains safe portable string functions,
|
||||
random number generators, data structures, additional mathematics
|
||||
functions, cryptography and multimedia related functionality (like
|
||||
enumerations for pixel and sample formats). It is not a library for
|
||||
code needed by both libavcodec and libavformat.
|
||||
</p>
|
||||
<p>The goals for this library is to be:
|
||||
</p>
|
||||
<dl class="table">
|
||||
<dt><strong class="strong">Modular</strong></dt>
|
||||
<dd><p>It should have few interdependencies and the possibility of disabling individual
|
||||
parts during <code class="command">./configure</code>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><strong class="strong">Small</strong></dt>
|
||||
<dd><p>Both sources and objects should be small.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><strong class="strong">Efficient</strong></dt>
|
||||
<dd><p>It should have low CPU and memory usage.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><strong class="strong">Useful</strong></dt>
|
||||
<dd><p>It should avoid useless features that almost no one needs.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libswresample Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libswresample Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libswresample library performs highly optimized audio resampling,
|
||||
rematrixing and sample format conversion operations.
|
||||
</p>
|
||||
<p>Specifically, this library performs the following conversions:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li><em class="emph">Resampling</em>: is the process of changing the audio rate, for
|
||||
example from a high sample rate of 44100Hz to 8000Hz. Audio
|
||||
conversion from high to low sample rate is a lossy process. Several
|
||||
resampling options and algorithms are available.
|
||||
|
||||
</li><li><em class="emph">Format conversion</em>: is the process of converting the type of
|
||||
samples, for example from 16-bit signed samples to unsigned 8-bit or
|
||||
float samples. It also handles packing conversion, when passing from
|
||||
packed layout (all samples belonging to distinct channels interleaved
|
||||
in the same buffer), to planar layout (all samples belonging to the
|
||||
same channel stored in a dedicated buffer or "plane").
|
||||
|
||||
</li><li><em class="emph">Rematrixing</em>: is the process of changing the channel layout, for
|
||||
example from stereo to mono. When the input channels cannot be mapped
|
||||
to the output streams, the process is lossy, since it involves
|
||||
different gain factors and mixing.
|
||||
</li></ul>
|
||||
|
||||
<p>Various other audio conversions (e.g. stretching and padding) are
|
||||
enabled through dedicated options.
|
||||
</p>
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Libswscale Documentation
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Libswscale Documentation
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-See-Also" href="#See-Also">2 See Also</a></li>
|
||||
<li><a id="toc-Authors" href="#Authors">3 Authors</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The libswscale library performs highly optimized image scaling and
|
||||
colorspace and pixel format conversion operations.
|
||||
</p>
|
||||
<p>Specifically, this library performs the following conversions:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li><em class="emph">Rescaling</em>: is the process of changing the video size. Several
|
||||
rescaling options and algorithms are available. This is usually a
|
||||
lossy process.
|
||||
|
||||
</li><li><em class="emph">Pixel format conversion</em>: is the process of converting the image
|
||||
format and colorspace of the image, for example from planar YUV420P to
|
||||
RGB24 packed. It also handles packing conversion, that is converts
|
||||
from packed layout (all pixels belonging to distinct planes
|
||||
interleaved in the same buffer), to planar layout (all samples
|
||||
belonging to the same plane stored in a dedicated buffer or "plane").
|
||||
|
||||
<p>This is usually a lossy process in case the source and destination
|
||||
colorspaces differ.
|
||||
</p></li></ul>
|
||||
|
||||
|
||||
<a name="See-Also"></a>
|
||||
<h2 class="chapter">2 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
|
||||
<a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
|
||||
<a class="url" href="libavutil.html">libavutil</a>
|
||||
</p>
|
||||
|
||||
<a name="Authors"></a>
|
||||
<h2 class="chapter">3 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>The FFmpeg developers.
|
||||
</p>
|
||||
<p>For details about the authorship, see the Git history of the project
|
||||
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
|
||||
<code class="command">git log</code> in the FFmpeg source directory, or browsing the
|
||||
online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
|
||||
</p>
|
||||
<p>Maintainers for the specific components are listed in the file
|
||||
<samp class="file">MAINTAINERS</samp> in the source code tree.
|
||||
</p>
|
||||
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+443
@@ -0,0 +1,443 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
FFmpeg Mailing List FAQ
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
FFmpeg Mailing List FAQ
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-General-Questions" href="#General-Questions">1 General Questions</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-What-is-a-mailing-list_003f" href="#What-is-a-mailing-list_003f">1.1 What is a mailing list?</a></li>
|
||||
<li><a id="toc-What-type-of-questions-can-I-ask_003f" href="#What-type-of-questions-can-I-ask_003f">1.2 What type of questions can I ask?</a></li>
|
||||
<li><a id="toc-How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1" href="#How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1">1.3 How do I ask a question or send a message to a mailing list?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Subscribing-_002f-Unsubscribing" href="#Subscribing-_002f-Unsubscribing">2 Subscribing / Unsubscribing</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-How-do-I-subscribe_003f-1" href="#How-do-I-subscribe_003f-1">2.1 How do I subscribe?</a></li>
|
||||
<li><a id="toc-How-do-I-unsubscribe_003f" href="#How-do-I-unsubscribe_003f">2.2 How do I unsubscribe?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Moderation-Queue" href="#Moderation-Queue">3 Moderation Queue</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Why-is-my-message-awaiting-moderator-approval_003f-1" href="#Why-is-my-message-awaiting-moderator-approval_003f-1">3.1 Why is my message awaiting moderator approval?</a></li>
|
||||
<li><a id="toc-How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f" href="#How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f">3.2 How long does it take for my message in the moderation queue to be approved?</a></li>
|
||||
<li><a id="toc-How-do-I-delete-my-message-in-the-moderation-queue_003f-1" href="#How-do-I-delete-my-message-in-the-moderation-queue_003f-1">3.3 How do I delete my message in the moderation queue?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Archives" href="#Archives">4 Archives</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Where-are-the-archives_003f-1" href="#Where-are-the-archives_003f-1">4.1 Where are the archives?</a></li>
|
||||
<li><a id="toc-How-do-I-reply-to-a-message-in-the-archives_003f" href="#How-do-I-reply-to-a-message-in-the-archives_003f">4.2 How do I reply to a message in the archives?</a></li>
|
||||
<li><a id="toc-How-do-I-search-the-archives_003f" href="#How-do-I-search-the-archives_003f">4.3 How do I search the archives?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Other" href="#Other">5 Other</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Is-there-an-alternative-to-the-mailing-list_003f" href="#Is-there-an-alternative-to-the-mailing-list_003f">5.1 Is there an alternative to the mailing list?</a></li>
|
||||
<li><a id="toc-What-is-top_002dposting_003f-1" href="#What-is-top_002dposting_003f-1">5.2 What is top-posting?</a></li>
|
||||
<li><a id="toc-What-is-the-message-size-limit_003f-1" href="#What-is-the-message-size-limit_003f-1">5.3 What is the message size limit?</a></li>
|
||||
<li><a id="toc-Where-can-I-upload-sample-files_003f" href="#Where-can-I-upload-sample-files_003f">5.4 Where can I upload sample files?</a></li>
|
||||
<li><a id="toc-Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f" href="#Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f">5.5 Will I receive spam if I send and/or subscribe to a mailing list?</a></li>
|
||||
<li><a id="toc-How-do-I-filter-mailing-list-messages_003f" href="#How-do-I-filter-mailing-list-messages_003f">5.6 How do I filter mailing list messages?</a></li>
|
||||
<li><a id="toc-How-do-I-disable-mail-delivery-without-unsubscribing_003f-1" href="#How-do-I-disable-mail-delivery-without-unsubscribing_003f-1">5.7 How do I disable mail delivery without unsubscribing?</a></li>
|
||||
<li><a id="toc-Why-is-the-mailing-list-munging-my-address_003f-1" href="#Why-is-the-mailing-list-munging-my-address_003f-1">5.8 Why is the mailing list munging my address?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Rules-and-Etiquette" href="#Rules-and-Etiquette">6 Rules and Etiquette</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-What-are-the-rules-and-the-proper-etiquette_003f" href="#What-are-the-rules-and-the-proper-etiquette_003f">6.1 What are the rules and the proper etiquette?</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Help" href="#Help">7 Help</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Why-am-I-not-receiving-any-messages_003f" href="#Why-am-I-not-receiving-any-messages_003f">7.1 Why am I not receiving any messages?</a></li>
|
||||
<li><a id="toc-Why-are-my-sent-messages-not-showing-up_003f" href="#Why-are-my-sent-messages-not-showing-up_003f">7.2 Why are my sent messages not showing up?</a></li>
|
||||
<li><a id="toc-Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1" href="#Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1">7.3 Why do I keep getting unsubscribed from ffmpeg-devel?</a></li>
|
||||
<li><a id="toc-Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1" href="#Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1">7.4 Who do I contact if I have a problem with the mailing list?</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="General-Questions"></a>
|
||||
<h2 class="chapter">1 General Questions<span class="pull-right"><a class="anchor hidden-xs" href="#General-Questions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-General-Questions" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="What-is-a-mailing-list_003f"></a>
|
||||
<h3 class="section">1.1 What is a mailing list?<span class="pull-right"><a class="anchor hidden-xs" href="#What-is-a-mailing-list_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-is-a-mailing-list_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>A mailing list is not much different than emailing someone, but the
|
||||
main difference is that your message is received by everyone who
|
||||
subscribes to the list. It is somewhat like a forum but in email form.
|
||||
</p>
|
||||
<p>See the <a class="url" href="https://lists.ffmpeg.org/pipermail/ffmpeg-user/">ffmpeg-user archives</a>
|
||||
for examples.
|
||||
</p>
|
||||
<a name="What-type-of-questions-can-I-ask_003f"></a>
|
||||
<h3 class="section">1.2 What type of questions can I ask?<span class="pull-right"><a class="anchor hidden-xs" href="#What-type-of-questions-can-I-ask_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-type-of-questions-can-I-ask_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<ul class="itemize mark-bullet">
|
||||
<li><a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user</a>:
|
||||
For questions involving unscripted usage or compilation of the FFmpeg
|
||||
command-line tools (<code class="command">ffmpeg</code>, <code class="command">ffprobe</code>, <code class="command">ffplay</code>).
|
||||
|
||||
</li><li><a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/libav-user/">libav-user</a>:
|
||||
For questions involving the FFmpeg libav* libraries (libavcodec,
|
||||
libavformat, libavfilter, etc).
|
||||
|
||||
</li><li><a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel/">ffmpeg-devel</a>:
|
||||
For discussions involving the development of FFmpeg and for submitting
|
||||
patches. User questions should be asked at ffmpeg-user or libav-user.
|
||||
</li></ul>
|
||||
|
||||
<p>To report a bug see <a class="url" href="https://ffmpeg.org/bugreports.html">https://ffmpeg.org/bugreports.html</a>.
|
||||
</p>
|
||||
<p>We cannot provide help for scripts and/or third-party tools.
|
||||
</p>
|
||||
<a class="anchor" id="How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f"></a><a name="How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1"></a>
|
||||
<h3 class="section">1.3 How do I ask a question or send a message to a mailing list?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-ask-a-question-or-send-a-message-to-a-mailing-list_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>First you must <a class="ref" href="#How-do-I-subscribe_003f">subscribe</a>. Then all you have to do is
|
||||
send an email:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Email <a class="email" href="mailto:ffmpeg-user@ffmpeg.org">ffmpeg-user@ffmpeg.org</a> to send a message to the
|
||||
ffmpeg-user mailing list.
|
||||
|
||||
</li><li>Email <a class="email" href="mailto:libav-user@ffmpeg.org">libav-user@ffmpeg.org</a> to send a message to the
|
||||
libav-user mailing list.
|
||||
|
||||
</li><li>Email <a class="email" href="mailto:ffmpeg-devel@ffmpeg.org">ffmpeg-devel@ffmpeg.org</a> to send a message to the
|
||||
ffmpeg-devel mailing list.
|
||||
</li></ul>
|
||||
|
||||
<a name="Subscribing-_002f-Unsubscribing"></a>
|
||||
<h2 class="chapter">2 Subscribing / Unsubscribing<span class="pull-right"><a class="anchor hidden-xs" href="#Subscribing-_002f-Unsubscribing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subscribing-_002f-Unsubscribing" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a class="anchor" id="How-do-I-subscribe_003f"></a><a name="How-do-I-subscribe_003f-1"></a>
|
||||
<h3 class="section">2.1 How do I subscribe?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-subscribe_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-subscribe_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Email <a class="email" href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with the subject
|
||||
<em class="emph">subscribe</em>.
|
||||
</p>
|
||||
<p>Or visit the <a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>
|
||||
and refer to the <em class="emph">Subscribing to ffmpeg-user</em> section.
|
||||
</p>
|
||||
<p>The process is the same for the other mailing lists.
|
||||
</p>
|
||||
<a name="How-do-I-unsubscribe_003f"></a>
|
||||
<h3 class="section">2.2 How do I unsubscribe?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-unsubscribe_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-unsubscribe_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Email <a class="email" href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with subject <em class="emph">unsubscribe</em>.
|
||||
</p>
|
||||
<p>Or visit the <a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>,
|
||||
scroll to bottom of page, enter your email address in the box, and click
|
||||
the <em class="emph">Unsubscribe or edit options</em> button.
|
||||
</p>
|
||||
<p>The process is the same for the other mailing lists.
|
||||
</p>
|
||||
<p>Please avoid asking a mailing list admin to unsubscribe you unless you
|
||||
are absolutely unable to do so by yourself. See <a class="ref" href="#Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f">Who do I contact if I have a problem with the mailing list?</a>
|
||||
</p>
|
||||
<p>Note that it is possible to temporarily halt message delivery (vacation mode).
|
||||
See <a class="ref" href="#How-do-I-disable-mail-delivery-without-unsubscribing_003f">How do I disable mail delivery without unsubscribing?</a>
|
||||
</p>
|
||||
<a name="Moderation-Queue"></a>
|
||||
<h2 class="chapter">3 Moderation Queue<span class="pull-right"><a class="anchor hidden-xs" href="#Moderation-Queue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Moderation-Queue" aria-hidden="true">TOC</a></span></h2>
|
||||
<a class="anchor" id="Why-is-my-message-awaiting-moderator-approval_003f"></a><a name="Why-is-my-message-awaiting-moderator-approval_003f-1"></a>
|
||||
<h3 class="section">3.1 Why is my message awaiting moderator approval?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-my-message-awaiting-moderator-approval_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-my-message-awaiting-moderator-approval_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Some messages are automatically held in the <em class="emph">moderation queue</em> and
|
||||
must be manually approved by a mailing list admin:
|
||||
</p>
|
||||
<p>These are:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Messages that exceed the <a class="ref" href="#What-is-the-message-size-limit_003f">message size limit</a>.
|
||||
|
||||
</li><li>Messages from users whose accounts have been set with the <em class="emph">moderation flag</em>
|
||||
(very rarely occurs, but may if a user repeatedly ignores the rules
|
||||
or is abusive towards others).
|
||||
</li></ul>
|
||||
|
||||
<a name="How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f"></a>
|
||||
<h3 class="section">3.2 How long does it take for my message in the moderation queue to be approved?<span class="pull-right"><a class="anchor hidden-xs" href="#How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-long-does-it-take-for-my-message-in-the-moderation-queue-to-be-approved_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The queue is not checked on a regular basis. You can ask on the
|
||||
<code class="t">#ffmpeg-devel</code> IRC channel on Libera Chat for someone to approve your message.
|
||||
</p>
|
||||
<a class="anchor" id="How-do-I-delete-my-message-in-the-moderation-queue_003f"></a><a name="How-do-I-delete-my-message-in-the-moderation-queue_003f-1"></a>
|
||||
<h3 class="section">3.3 How do I delete my message in the moderation queue?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-delete-my-message-in-the-moderation-queue_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-delete-my-message-in-the-moderation-queue_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You should have received an email with the subject <em class="emph">Your message to <mailing list name> awaits moderator approval</em>.
|
||||
A link is in the message that will allow you to delete your message
|
||||
unless a mailing list admin already approved or rejected it.
|
||||
</p>
|
||||
<a name="Archives"></a>
|
||||
<h2 class="chapter">4 Archives<span class="pull-right"><a class="anchor hidden-xs" href="#Archives" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Archives" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a class="anchor" id="Where-are-the-archives_003f"></a><a name="Where-are-the-archives_003f-1"></a>
|
||||
<h3 class="section">4.1 Where are the archives?<span class="pull-right"><a class="anchor hidden-xs" href="#Where-are-the-archives_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Where-are-the-archives_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>See the <em class="emph">Archives</em> section on the <a class="url" href="https://ffmpeg.org/contact.html">FFmpeg Contact</a>
|
||||
page for links to all FFmpeg mailing list archives.
|
||||
</p>
|
||||
<p>Note that the archives are split by month. Discussions that span
|
||||
several months will be split into separate months in the archives.
|
||||
</p>
|
||||
<a name="How-do-I-reply-to-a-message-in-the-archives_003f"></a>
|
||||
<h3 class="section">4.2 How do I reply to a message in the archives?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-reply-to-a-message-in-the-archives_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-reply-to-a-message-in-the-archives_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Click the email link at the top of the message just under the subject
|
||||
title. The link will provide the proper headers to keep the message
|
||||
within the thread.
|
||||
</p>
|
||||
<p>Note that you must be subscribed to send a message to the ffmpeg-user or
|
||||
libav-user mailing lists.
|
||||
</p>
|
||||
<a name="How-do-I-search-the-archives_003f"></a>
|
||||
<h3 class="section">4.3 How do I search the archives?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-search-the-archives_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-search-the-archives_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Perform a site search using your favorite search engine. Example:
|
||||
</p>
|
||||
<p><code class="t">site:lists.ffmpeg.org/pipermail/ffmpeg-user/ "search term"</code>
|
||||
</p>
|
||||
<a name="Other"></a>
|
||||
<h2 class="chapter">5 Other<span class="pull-right"><a class="anchor hidden-xs" href="#Other" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Other" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Is-there-an-alternative-to-the-mailing-list_003f"></a>
|
||||
<h3 class="section">5.1 Is there an alternative to the mailing list?<span class="pull-right"><a class="anchor hidden-xs" href="#Is-there-an-alternative-to-the-mailing-list_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Is-there-an-alternative-to-the-mailing-list_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You can ask for help in the official <code class="t">#ffmpeg</code> IRC channel on Libera Chat.
|
||||
</p>
|
||||
<p>There are also numerous third-party help sites such as
|
||||
<a class="url" href="https://superuser.com/tags/ffmpeg">Super User</a> and
|
||||
<a class="url" href="https://www.reddit.com/r/ffmpeg/">r/ffmpeg on reddit</a>.
|
||||
</p>
|
||||
<a class="anchor" id="What-is-top_002dposting_003f"></a><a name="What-is-top_002dposting_003f-1"></a>
|
||||
<h3 class="section">5.2 What is top-posting?<span class="pull-right"><a class="anchor hidden-xs" href="#What-is-top_002dposting_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-is-top_002dposting_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>See <a class="url" href="https://en.wikipedia.org/wiki/Posting_style#Top-posting">https://en.wikipedia.org/wiki/Posting_style#Top-posting</a>.
|
||||
</p>
|
||||
<p>Instead, use trimmed interleaved/inline replies (<a class="url" href="https://lists.ffmpeg.org/pipermail/ffmpeg-user/2017-April/035849.html">example</a>).
|
||||
</p>
|
||||
<a class="anchor" id="What-is-the-message-size-limit_003f"></a><a name="What-is-the-message-size-limit_003f-1"></a>
|
||||
<h3 class="section">5.3 What is the message size limit?<span class="pull-right"><a class="anchor hidden-xs" href="#What-is-the-message-size-limit_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-is-the-message-size-limit_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The message size limit is 1000 kilobytes. Please provide links to larger files
|
||||
instead of attaching them.
|
||||
</p>
|
||||
<a name="Where-can-I-upload-sample-files_003f"></a>
|
||||
<h3 class="section">5.4 Where can I upload sample files?<span class="pull-right"><a class="anchor hidden-xs" href="#Where-can-I-upload-sample-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Where-can-I-upload-sample-files_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Anywhere that is not too annoying for us to use.
|
||||
</p>
|
||||
<p>Google Drive and Dropbox are acceptable if you need a file host, and
|
||||
<a class="url" href="https://0x0.st/">0x0.st</a> is good for files under 256 MiB.
|
||||
</p>
|
||||
<p>Small, short samples are preferred if possible.
|
||||
</p>
|
||||
<a name="Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f"></a>
|
||||
<h3 class="section">5.5 Will I receive spam if I send and/or subscribe to a mailing list?<span class="pull-right"><a class="anchor hidden-xs" href="#Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Will-I-receive-spam-if-I-send-and_002for-subscribe-to-a-mailing-list_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Highly unlikely.
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>The list of subscribed users is not public.
|
||||
|
||||
</li><li>Email addresses in the archives are obfuscated.
|
||||
|
||||
</li><li>Several unique test email accounts were utilized and none have yet
|
||||
received any spam.
|
||||
</li></ul>
|
||||
|
||||
<p>However, you may see a spam in the mailing lists on rare occasions:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Spam in the moderation queue may be accidentally approved due to human
|
||||
error.
|
||||
|
||||
</li><li>There have been a few messages from subscribed users who had their own
|
||||
email addresses hacked and spam messages from (or appearing to be from)
|
||||
the hacked account were sent to their contacts (a mailing list being a
|
||||
contact in these cases).
|
||||
|
||||
</li><li>If you are subscribed to the bug tracker mailing list (ffmpeg-trac) you
|
||||
may see the occasional spam as a false bug report, but we take measures
|
||||
to try to prevent this.
|
||||
</li></ul>
|
||||
|
||||
<a name="How-do-I-filter-mailing-list-messages_003f"></a>
|
||||
<h3 class="section">5.6 How do I filter mailing list messages?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-filter-mailing-list-messages_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-filter-mailing-list-messages_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Use the <em class="emph">List-Id</em>. For example, the ffmpeg-user mailing list is
|
||||
<code class="t">ffmpeg-user.ffmpeg.org</code>. You can view the List-Id in the raw message
|
||||
or headers.
|
||||
</p>
|
||||
<p>You can then filter the mailing list messages to their own folder.
|
||||
</p>
|
||||
<a class="anchor" id="How-do-I-disable-mail-delivery-without-unsubscribing_003f"></a><a name="How-do-I-disable-mail-delivery-without-unsubscribing_003f-1"></a>
|
||||
<h3 class="section">5.7 How do I disable mail delivery without unsubscribing?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-disable-mail-delivery-without-unsubscribing_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-disable-mail-delivery-without-unsubscribing_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Sometimes you may want to temporarily stop receiving all mailing list
|
||||
messages. This "vacation mode" is simple to do:
|
||||
</p>
|
||||
<ol class="enumerate">
|
||||
<li> Go to the <a class="url" href="https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-user/">ffmpeg-user mailing list info page</a>
|
||||
|
||||
</li><li> Enter your email address in the box at very bottom of the page and click the
|
||||
<em class="emph">Unsubscribe or edit options</em> box.
|
||||
|
||||
</li><li> Enter your password and click the <em class="emph">Log in</em> button.
|
||||
|
||||
</li><li> Look for the <em class="emph">Mail delivery</em> option. Here you can disable/enable mail
|
||||
delivery. If you check <em class="emph">Set globally</em> it will apply your choice to all
|
||||
other FFmpeg mailing lists you are subscribed to.
|
||||
</li></ol>
|
||||
|
||||
<p>Alternatively, from your subscribed address, send a message to <a class="email" href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a>
|
||||
with the subject <em class="emph">set delivery off</em>. To re-enable mail delivery send a
|
||||
message to <a class="email" href="mailto:ffmpeg-user-request@ffmpeg.org">ffmpeg-user-request@ffmpeg.org</a> with the subject
|
||||
<em class="emph">set delivery on</em>.
|
||||
</p>
|
||||
<a class="anchor" id="Why-is-the-mailing-list-munging-my-address_003f"></a><a name="Why-is-the-mailing-list-munging-my-address_003f-1"></a>
|
||||
<h3 class="section">5.8 Why is the mailing list munging my address?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-the-mailing-list-munging-my-address_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-the-mailing-list-munging-my-address_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>This is due to subscribers that use an email service with a DMARC reject policy
|
||||
which adds difficulties to mailing list operators.
|
||||
</p>
|
||||
<p>The mailing list must re-write (munge) the <em class="emph">From:</em> header for such users;
|
||||
otherwise their email service will reject and bounce the message resulting in
|
||||
automatic unsubscribing from the mailing list.
|
||||
</p>
|
||||
<p>When sending a message these users will see <em class="emph">via <mailing list name></em>
|
||||
added to their name and the <em class="emph">From:</em> address munged to the address of
|
||||
the particular mailing list.
|
||||
</p>
|
||||
<p>If you want to avoid this then please use a different email service.
|
||||
</p>
|
||||
<p>Note that ffmpeg-devel does not apply any munging as it causes issues with
|
||||
patch authorship. As a result users with an email service with a DMARC reject
|
||||
policy may be automatically unsubscribed due to rejected and bounced messages.
|
||||
</p>
|
||||
<a name="Rules-and-Etiquette"></a>
|
||||
<h2 class="chapter">6 Rules and Etiquette<span class="pull-right"><a class="anchor hidden-xs" href="#Rules-and-Etiquette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Rules-and-Etiquette" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="What-are-the-rules-and-the-proper-etiquette_003f"></a>
|
||||
<h3 class="section">6.1 What are the rules and the proper etiquette?<span class="pull-right"><a class="anchor hidden-xs" href="#What-are-the-rules-and-the-proper-etiquette_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-What-are-the-rules-and-the-proper-etiquette_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>There may seem to be many things to remember, but we want to help and
|
||||
following these guidelines will allow you to get answers more quickly
|
||||
and help avoid getting ignored.
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Always show your actual, unscripted <code class="command">ffmpeg</code> command and the
|
||||
complete, uncut console output from your command.
|
||||
|
||||
</li><li>Use the most simple and minimal command that still shows the issue you
|
||||
are encountering.
|
||||
|
||||
</li><li>Provide all necessary information so others can attempt to duplicate
|
||||
your issue. This includes the actual command, complete uncut console
|
||||
output, and any inputs that are required to duplicate the issue.
|
||||
|
||||
</li><li>Use the latest <code class="command">ffmpeg</code> build you can get. See the <a class="url" href="https://ffmpeg.org/download.html">FFmpeg Download</a>
|
||||
page for links to recent builds for Linux, macOS, and Windows. Or
|
||||
compile from the current git master branch.
|
||||
|
||||
</li><li>Avoid <a class="url" href="https://en.wikipedia.org/wiki/Posting_style#Top-posting">top-posting</a>.
|
||||
Also see <a class="ref" href="#What-is-top_002dposting_003f">What is top-posting?</a>
|
||||
|
||||
</li><li>Avoid hijacking threads. Thread hijacking is replying to a message and
|
||||
changing the subject line to something unrelated to the original thread.
|
||||
Most email clients will still show the renamed message under the
|
||||
original thread. This can be confusing and these types of messages are
|
||||
often ignored.
|
||||
|
||||
</li><li>Do not send screenshots. Copy and paste console text instead of making
|
||||
screenshots of the text.
|
||||
|
||||
</li><li>Avoid sending email disclaimers and legalese if possible as this is a
|
||||
public list.
|
||||
|
||||
</li><li>Avoid using the <code class="code">-loglevel debug</code>, <code class="code">-loglevel quiet</code>, and
|
||||
<code class="command">-hide_banner</code> options unless requested to do so.
|
||||
|
||||
</li><li>If you attach files avoid compressing small files. Uncompressed is
|
||||
preferred.
|
||||
|
||||
</li><li>Please do not send HTML-only messages. The mailing list will ignore the
|
||||
HTML component of your message. Most mail clients will automatically
|
||||
include a text component: this is what the mailing list will use.
|
||||
|
||||
</li><li>Configuring your mail client to break lines after 70 or so characters is
|
||||
recommended.
|
||||
|
||||
</li><li>Avoid sending the same message to multiple mailing lists.
|
||||
|
||||
</li><li>Please follow our <a class="url" href="https://ffmpeg.org/community.html#Code-of-Conduct">Code of Conduct</a>.
|
||||
</li></ul>
|
||||
|
||||
<a name="Help"></a>
|
||||
<h2 class="chapter">7 Help<span class="pull-right"><a class="anchor hidden-xs" href="#Help" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Help" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Why-am-I-not-receiving-any-messages_003f"></a>
|
||||
<h3 class="section">7.1 Why am I not receiving any messages?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-am-I-not-receiving-any-messages_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-am-I-not-receiving-any-messages_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Some email providers have blacklists or spam filters that block or mark
|
||||
the mailing list messages as false positives. Unfortunately, the user is
|
||||
often not aware of this and is often out of their control.
|
||||
</p>
|
||||
<p>When possible we attempt to notify the provider to be removed from the
|
||||
blacklists or filters.
|
||||
</p>
|
||||
<a name="Why-are-my-sent-messages-not-showing-up_003f"></a>
|
||||
<h3 class="section">7.2 Why are my sent messages not showing up?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-are-my-sent-messages-not-showing-up_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-are-my-sent-messages-not-showing-up_003f" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Excluding <a class="ref" href="#Why-is-my-message-awaiting-moderator-approval_003f">messages that are held in the moderation queue</a>
|
||||
there are a few other reasons why your messages may fail to appear:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>HTML-only messages are ignored by the mailing lists. Most mail clients
|
||||
automatically include a text component alongside HTML email: this is what
|
||||
the mailing list will use. If it does not then consider your client to be
|
||||
broken, because sending a text component along with the HTML component to
|
||||
form a multi-part message is recommended by email standards.
|
||||
|
||||
</li><li>Check your spam folder.
|
||||
</li></ul>
|
||||
|
||||
<a class="anchor" id="Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f"></a><a name="Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1"></a>
|
||||
<h3 class="section">7.3 Why do I keep getting unsubscribed from ffmpeg-devel?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-do-I-keep-getting-unsubscribed-from-ffmpeg_002ddevel_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Users with an email service that has a DMARC reject or quarantine policy may be
|
||||
automatically unsubscribed from the ffmpeg-devel mailing list due to the mailing
|
||||
list messages being continuously rejected and bounced back.
|
||||
</p>
|
||||
<p>Consider using a different email service.
|
||||
</p>
|
||||
<a class="anchor" id="Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f"></a><a name="Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1"></a>
|
||||
<h3 class="section">7.4 Who do I contact if I have a problem with the mailing list?<span class="pull-right"><a class="anchor hidden-xs" href="#Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Who-do-I-contact-if-I-have-a-problem-with-the-mailing-list_003f-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Send a message to <a class="email" href="mailto:ffmpeg-user-owner@ffmpeg.org">ffmpeg-user-owner@ffmpeg.org</a>.
|
||||
</p>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+213
@@ -0,0 +1,213 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
NUT
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
NUT
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Description" href="#Description">1 Description</a></li>
|
||||
<li><a id="toc-Modes" href="#Modes">2 Modes</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-BROADCAST" href="#BROADCAST">2.1 BROADCAST</a></li>
|
||||
<li><a id="toc-PIPE" href="#PIPE">2.2 PIPE</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Container_002dspecific-codec-tags" href="#Container_002dspecific-codec-tags">3 Container-specific codec tags</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Generic-raw-YUVA-formats" href="#Generic-raw-YUVA-formats">3.1 Generic raw YUVA formats</a></li>
|
||||
<li><a id="toc-Raw-Audio" href="#Raw-Audio">3.2 Raw Audio</a></li>
|
||||
<li><a id="toc-Subtitles" href="#Subtitles">3.3 Subtitles</a></li>
|
||||
<li><a id="toc-Raw-Data" href="#Raw-Data">3.4 Raw Data</a></li>
|
||||
<li><a id="toc-Codecs" href="#Codecs">3.5 Codecs</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Description"></a>
|
||||
<h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
|
||||
<p>NUT is a low overhead generic container format. It stores audio, video,
|
||||
subtitle and user-defined streams in a simple, yet efficient, way.
|
||||
</p>
|
||||
<p>It was created by a group of FFmpeg and MPlayer developers in 2003
|
||||
and was finalized in 2008.
|
||||
</p>
|
||||
<p>The official nut specification is at svn://svn.mplayerhq.hu/nut
|
||||
In case of any differences between this text and the official specification,
|
||||
the official specification shall prevail.
|
||||
</p>
|
||||
<a name="Modes"></a>
|
||||
<h2 class="chapter">2 Modes<span class="pull-right"><a class="anchor hidden-xs" href="#Modes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Modes" aria-hidden="true">TOC</a></span></h2>
|
||||
<p>NUT has some variants signaled by using the flags field in its main header.
|
||||
</p>
|
||||
<table class="multitable">
|
||||
<tbody><tr><td width="40%">BROADCAST</td><td width="40%">Extend the syncpoint to report the sender wallclock</td></tr>
|
||||
<tr><td width="40%">PIPE</td><td width="40%">Omit completely the syncpoint</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a name="BROADCAST"></a>
|
||||
<h3 class="section">2.1 BROADCAST<span class="pull-right"><a class="anchor hidden-xs" href="#BROADCAST" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-BROADCAST" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The BROADCAST variant provides a secondary time reference to facilitate
|
||||
detecting endpoint latency and network delays.
|
||||
It assumes all the endpoint clocks are synchronized.
|
||||
To be used in real-time scenarios.
|
||||
</p>
|
||||
<a name="PIPE"></a>
|
||||
<h3 class="section">2.2 PIPE<span class="pull-right"><a class="anchor hidden-xs" href="#PIPE" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-PIPE" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The PIPE variant assumes NUT is used as non-seekable intermediate container,
|
||||
by not using syncpoint removes unneeded overhead and reduces the overall
|
||||
memory usage.
|
||||
</p>
|
||||
<a name="Container_002dspecific-codec-tags"></a>
|
||||
<h2 class="chapter">3 Container-specific codec tags<span class="pull-right"><a class="anchor hidden-xs" href="#Container_002dspecific-codec-tags" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Container_002dspecific-codec-tags" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Generic-raw-YUVA-formats"></a>
|
||||
<h3 class="section">3.1 Generic raw YUVA formats<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-raw-YUVA-formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-raw-YUVA-formats" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Since many exotic planar YUVA pixel formats are not considered by
|
||||
the AVI/QuickTime FourCC lists, the following scheme is adopted for
|
||||
representing them.
|
||||
</p>
|
||||
<p>The first two bytes can contain the values:
|
||||
Y1 = only Y
|
||||
Y2 = Y+A
|
||||
Y3 = YUV
|
||||
Y4 = YUVA
|
||||
</p>
|
||||
<p>The third byte represents the width and height chroma subsampling
|
||||
values for the UV planes, that is the amount to shift the luma
|
||||
width/height right to find the chroma width/height.
|
||||
</p>
|
||||
<p>The fourth byte is the number of bits used (8, 16, ...).
|
||||
</p>
|
||||
<p>If the order of bytes is inverted, that means that each component has
|
||||
to be read big-endian.
|
||||
</p>
|
||||
<a name="Raw-Audio"></a>
|
||||
<h3 class="section">3.2 Raw Audio<span class="pull-right"><a class="anchor hidden-xs" href="#Raw-Audio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Raw-Audio" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<table class="multitable">
|
||||
<tbody><tr><td width="40%">ALAW</td><td width="40%">A-LAW</td></tr>
|
||||
<tr><td width="40%">ULAW</td><td width="40%">MU-LAW</td></tr>
|
||||
<tr><td width="40%">P<type><interleaving><bits></td><td width="40%">little-endian PCM</td></tr>
|
||||
<tr><td width="40%"><bits><interleaving><type>P</td><td width="40%">big-endian PCM</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><type> is S for signed integer, U for unsigned integer, F for IEEE float
|
||||
<interleaving> is D for default, P is for planar.
|
||||
<bits> is 8/16/24/32
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">PFD[32] would for example be signed 32 bit little-endian IEEE float
|
||||
</pre></div>
|
||||
|
||||
<a name="Subtitles"></a>
|
||||
<h3 class="section">3.3 Subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<table class="multitable">
|
||||
<tbody><tr><td width="40%">UTF8</td><td width="40%">Raw UTF-8</td></tr>
|
||||
<tr><td width="40%">SSA[0]</td><td width="40%">SubStation Alpha</td></tr>
|
||||
<tr><td width="40%">DVDS</td><td width="40%">DVD subtitles</td></tr>
|
||||
<tr><td width="40%">DVBS</td><td width="40%">DVB subtitles</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a name="Raw-Data"></a>
|
||||
<h3 class="section">3.4 Raw Data<span class="pull-right"><a class="anchor hidden-xs" href="#Raw-Data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Raw-Data" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<table class="multitable">
|
||||
<tbody><tr><td width="40%">UTF8</td><td width="40%">Raw UTF-8</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a name="Codecs"></a>
|
||||
<h3 class="section">3.5 Codecs<span class="pull-right"><a class="anchor hidden-xs" href="#Codecs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Codecs" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<table class="multitable">
|
||||
<tbody><tr><td width="40%">3IV1</td><td width="40%">non-compliant MPEG-4 generated by old 3ivx</td></tr>
|
||||
<tr><td width="40%">ASV1</td><td width="40%">Asus Video</td></tr>
|
||||
<tr><td width="40%">ASV2</td><td width="40%">Asus Video 2</td></tr>
|
||||
<tr><td width="40%">CVID</td><td width="40%">Cinepak</td></tr>
|
||||
<tr><td width="40%">CYUV</td><td width="40%">Creative YUV</td></tr>
|
||||
<tr><td width="40%">DIVX</td><td width="40%">non-compliant MPEG-4 generated by old DivX</td></tr>
|
||||
<tr><td width="40%">DUCK</td><td width="40%">Truemotion 1</td></tr>
|
||||
<tr><td width="40%">FFV1</td><td width="40%">FFmpeg video 1</td></tr>
|
||||
<tr><td width="40%">FFVH</td><td width="40%">FFmpeg Huffyuv</td></tr>
|
||||
<tr><td width="40%">H261</td><td width="40%">ITU H.261</td></tr>
|
||||
<tr><td width="40%">H262</td><td width="40%">ITU H.262</td></tr>
|
||||
<tr><td width="40%">H263</td><td width="40%">ITU H.263</td></tr>
|
||||
<tr><td width="40%">H264</td><td width="40%">ITU H.264</td></tr>
|
||||
<tr><td width="40%">HFYU</td><td width="40%">Huffyuv</td></tr>
|
||||
<tr><td width="40%">I263</td><td width="40%">Intel H.263</td></tr>
|
||||
<tr><td width="40%">IV31</td><td width="40%">Indeo 3.1</td></tr>
|
||||
<tr><td width="40%">IV32</td><td width="40%">Indeo 3.2</td></tr>
|
||||
<tr><td width="40%">IV50</td><td width="40%">Indeo 5.0</td></tr>
|
||||
<tr><td width="40%">LJPG</td><td width="40%">ITU JPEG (lossless)</td></tr>
|
||||
<tr><td width="40%">MJLS</td><td width="40%">ITU JPEG-LS</td></tr>
|
||||
<tr><td width="40%">MJPG</td><td width="40%">ITU JPEG</td></tr>
|
||||
<tr><td width="40%">MPG4</td><td width="40%">MS MPEG-4v1 (not ISO MPEG-4)</td></tr>
|
||||
<tr><td width="40%">MP42</td><td width="40%">MS MPEG-4v2</td></tr>
|
||||
<tr><td width="40%">MP43</td><td width="40%">MS MPEG-4v3</td></tr>
|
||||
<tr><td width="40%">MP4V</td><td width="40%">ISO MPEG-4 Part 2 Video (from old encoders)</td></tr>
|
||||
<tr><td width="40%">mpg1</td><td width="40%">ISO MPEG-1 Video</td></tr>
|
||||
<tr><td width="40%">mpg2</td><td width="40%">ISO MPEG-2 Video</td></tr>
|
||||
<tr><td width="40%">MRLE</td><td width="40%">MS RLE</td></tr>
|
||||
<tr><td width="40%">MSVC</td><td width="40%">MS Video 1</td></tr>
|
||||
<tr><td width="40%">RT21</td><td width="40%">Indeo 2.1</td></tr>
|
||||
<tr><td width="40%">RV10</td><td width="40%">RealVideo 1.0</td></tr>
|
||||
<tr><td width="40%">RV20</td><td width="40%">RealVideo 2.0</td></tr>
|
||||
<tr><td width="40%">RV30</td><td width="40%">RealVideo 3.0</td></tr>
|
||||
<tr><td width="40%">RV40</td><td width="40%">RealVideo 4.0</td></tr>
|
||||
<tr><td width="40%">SNOW</td><td width="40%">FFmpeg Snow</td></tr>
|
||||
<tr><td width="40%">SVQ1</td><td width="40%">Sorenson Video 1</td></tr>
|
||||
<tr><td width="40%">SVQ3</td><td width="40%">Sorenson Video 3</td></tr>
|
||||
<tr><td width="40%">theo</td><td width="40%">Xiph Theora</td></tr>
|
||||
<tr><td width="40%">TM20</td><td width="40%">Truemotion 2.0</td></tr>
|
||||
<tr><td width="40%">UMP4</td><td width="40%">non-compliant MPEG-4 generated by UB Video MPEG-4</td></tr>
|
||||
<tr><td width="40%">VCR1</td><td width="40%">ATI VCR1</td></tr>
|
||||
<tr><td width="40%">VP30</td><td width="40%">VP 3.0</td></tr>
|
||||
<tr><td width="40%">VP31</td><td width="40%">VP 3.1</td></tr>
|
||||
<tr><td width="40%">VP50</td><td width="40%">VP 5.0</td></tr>
|
||||
<tr><td width="40%">VP60</td><td width="40%">VP 6.0</td></tr>
|
||||
<tr><td width="40%">VP61</td><td width="40%">VP 6.1</td></tr>
|
||||
<tr><td width="40%">VP62</td><td width="40%">VP 6.2</td></tr>
|
||||
<tr><td width="40%">VP70</td><td width="40%">VP 7.0</td></tr>
|
||||
<tr><td width="40%">WMV1</td><td width="40%">MS WMV7</td></tr>
|
||||
<tr><td width="40%">WMV2</td><td width="40%">MS WMV8</td></tr>
|
||||
<tr><td width="40%">WMV3</td><td width="40%">MS WMV9</td></tr>
|
||||
<tr><td width="40%">WV1F</td><td width="40%">non-compliant MPEG-4 generated by ?</td></tr>
|
||||
<tr><td width="40%">WVC1</td><td width="40%">VC-1</td></tr>
|
||||
<tr><td width="40%">XVID</td><td width="40%">non-compliant MPEG-4 generated by old Xvid</td></tr>
|
||||
<tr><td width="40%">XVIX</td><td width="40%">non-compliant MPEG-4 generated by old Xvid with interlacing bug</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+408
@@ -0,0 +1,408 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by , GNU Texinfo 7.1.1 -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
Platform Specific Information
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>
|
||||
Platform Specific Information
|
||||
</h1>
|
||||
|
||||
|
||||
<a name="SEC_Top"></a>
|
||||
|
||||
<div class="element-contents" id="SEC_Contents">
|
||||
<h2 class="contents-heading">Table of Contents</h2>
|
||||
|
||||
<div class="contents">
|
||||
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Unix_002dlike" href="#Unix_002dlike">1 Unix-like</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Advanced-linking-configuration" href="#Advanced-linking-configuration">1.1 Advanced linking configuration</a></li>
|
||||
<li><a id="toc-BSD" href="#BSD">1.2 BSD</a></li>
|
||||
<li><a id="toc-_0028Open_0029Solaris" href="#g_t_0028Open_0029Solaris">1.3 (Open)Solaris</a></li>
|
||||
<li><a id="toc-Darwin-_0028Mac-OS-X_002c-iPhone_0029" href="#Darwin-_0028Mac-OS-X_002c-iPhone_0029">1.4 Darwin (Mac OS X, iPhone)</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-DOS" href="#DOS">2 DOS</a></li>
|
||||
<li><a id="toc-OS_002f2" href="#OS_002f2">3 OS/2</a></li>
|
||||
<li><a id="toc-Windows" href="#Windows">4 Windows</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Native-Windows-compilation-using-MinGW-or-MinGW_002dw64" href="#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64">4.1 Native Windows compilation using MinGW or MinGW-w64</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Native-Windows-compilation-using-MSYS2" href="#Native-Windows-compilation-using-MSYS2">4.1.1 Native Windows compilation using MSYS2</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows" href="#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows">4.2 Microsoft Visual C++ or Intel C++ Compiler for Windows</a>
|
||||
<ul class="toc-numbered-mark">
|
||||
<li><a id="toc-Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b" href="#Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b">4.2.1 Linking to FFmpeg with Microsoft Visual C++</a></li>
|
||||
</ul></li>
|
||||
<li><a id="toc-Cross-compilation-for-Windows-with-Linux-1" href="#Cross-compilation-for-Windows-with-Linux-1">4.3 Cross compilation for Windows with Linux</a></li>
|
||||
<li><a id="toc-Compilation-under-Cygwin" href="#Compilation-under-Cygwin">4.4 Compilation under Cygwin</a></li>
|
||||
<li><a id="toc-Crosscompilation-for-Windows-under-Cygwin" href="#Crosscompilation-for-Windows-under-Cygwin">4.5 Crosscompilation for Windows under Cygwin</a></li>
|
||||
<li><a id="toc-ARM64EC" href="#ARM64EC">4.6 ARM64EC</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a name="Unix_002dlike"></a>
|
||||
<h2 class="chapter">1 Unix-like<span class="pull-right"><a class="anchor hidden-xs" href="#Unix_002dlike" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Unix_002dlike" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Some parts of FFmpeg cannot be built with version 2.15 of the GNU
|
||||
assembler which is still provided by a few AMD64 distributions. To
|
||||
make sure your compiler really uses the required version of gas
|
||||
after a binutils upgrade, run:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">$(gcc -print-prog-name=as) --version
|
||||
</pre></div>
|
||||
|
||||
<p>If not, then you should install a different compiler that has no
|
||||
hard-coded path to gas. In the worst case pass <code class="code">--disable-asm</code>
|
||||
to configure.
|
||||
</p>
|
||||
<a name="Advanced-linking-configuration"></a>
|
||||
<h3 class="section">1.1 Advanced linking configuration<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-linking-configuration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-linking-configuration" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>If you compiled FFmpeg libraries statically and you want to use them to
|
||||
build your own shared library, you may need to force PIC support (with
|
||||
<code class="code">--enable-pic</code> during FFmpeg configure) and add the following option
|
||||
to your project LDFLAGS:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">-Wl,-Bsymbolic
|
||||
</pre></div>
|
||||
|
||||
<p>If your target platform requires position independent binaries, you should
|
||||
pass the correct linking flag (e.g. <code class="code">-pie</code>) to <code class="code">--extra-ldexeflags</code>.
|
||||
</p>
|
||||
<a name="BSD"></a>
|
||||
<h3 class="section">1.2 BSD<span class="pull-right"><a class="anchor hidden-xs" href="#BSD" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-BSD" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>BSD make will not build FFmpeg, you need to install and use GNU Make
|
||||
(<code class="command">gmake</code>).
|
||||
</p>
|
||||
<a name="g_t_0028Open_0029Solaris"></a>
|
||||
<h3 class="section">1.3 (Open)Solaris<span class="pull-right"><a class="anchor hidden-xs" href="#_0028Open_0029Solaris" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-_0028Open_0029Solaris" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>GNU Make is required to build FFmpeg, so you have to invoke (<code class="command">gmake</code>),
|
||||
standard Solaris Make will not work. When building with a non-c99 front-end
|
||||
(gcc, generic suncc) add either <code class="code">--extra-libs=/usr/lib/values-xpg6.o</code>
|
||||
or <code class="code">--extra-libs=/usr/lib/64/values-xpg6.o</code> to the configure options
|
||||
since the libc is not c99-compliant by default. The probes performed by
|
||||
configure may raise an exception leading to the death of configure itself
|
||||
due to a bug in the system shell. Simply invoke a different shell such as
|
||||
bash directly to work around this:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">bash ./configure
|
||||
</pre></div>
|
||||
|
||||
<a class="anchor" id="Darwin"></a><a name="Darwin-_0028Mac-OS-X_002c-iPhone_0029"></a>
|
||||
<h3 class="section">1.4 Darwin (Mac OS X, iPhone)<span class="pull-right"><a class="anchor hidden-xs" href="#Darwin-_0028Mac-OS-X_002c-iPhone_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Darwin-_0028Mac-OS-X_002c-iPhone_0029" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>The toolchain provided with Xcode is sufficient to build the basic
|
||||
unaccelerated code.
|
||||
</p>
|
||||
<p>Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
|
||||
<a class="url" href="https://github.com/FFmpeg/gas-preprocessor">https://github.com/FFmpeg/gas-preprocessor</a> or
|
||||
<a class="url" href="https://github.com/yuvi/gas-preprocessor">https://github.com/yuvi/gas-preprocessor</a>(currently outdated) to build the optimized
|
||||
assembly functions. Put the Perl script somewhere
|
||||
in your PATH, FFmpeg’s configure will pick it up automatically.
|
||||
</p>
|
||||
<p>Mac OS X on amd64 and x86 requires <code class="command">nasm</code> to build most of the
|
||||
optimized assembly functions. <a class="uref" href="http://www.finkproject.org/">Fink</a>,
|
||||
<a class="uref" href="https://wiki.gentoo.org/wiki/Project:Prefix">Gentoo Prefix</a>,
|
||||
<a class="uref" href="https://mxcl.github.com/homebrew/">Homebrew</a>
|
||||
or <a class="uref" href="http://www.macports.org">MacPorts</a> can easily provide it.
|
||||
</p>
|
||||
|
||||
<a name="DOS"></a>
|
||||
<h2 class="chapter">2 DOS<span class="pull-right"><a class="anchor hidden-xs" href="#DOS" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-DOS" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>Using a cross-compiler is preferred for various reasons.
|
||||
<a class="url" href="http://www.delorie.com/howto/djgpp/linux-x-djgpp.html">http://www.delorie.com/howto/djgpp/linux-x-djgpp.html</a>
|
||||
</p>
|
||||
|
||||
<a name="OS_002f2"></a>
|
||||
<h2 class="chapter">3 OS/2<span class="pull-right"><a class="anchor hidden-xs" href="#OS_002f2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OS_002f2" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<p>For information about compiling FFmpeg on OS/2 see
|
||||
<a class="url" href="http://www.edm2.com/index.php/FFmpeg">http://www.edm2.com/index.php/FFmpeg</a>.
|
||||
</p>
|
||||
|
||||
<a name="Windows"></a>
|
||||
<h2 class="chapter">4 Windows<span class="pull-right"><a class="anchor hidden-xs" href="#Windows" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Windows" aria-hidden="true">TOC</a></span></h2>
|
||||
|
||||
<a name="Native-Windows-compilation-using-MinGW-or-MinGW_002dw64"></a>
|
||||
<h3 class="section">4.1 Native Windows compilation using MinGW or MinGW-w64<span class="pull-right"><a class="anchor hidden-xs" href="#Native-Windows-compilation-using-MinGW-or-MinGW_002dw64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Native-Windows-compilation-using-MinGW-or-MinGW_002dw64" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg can be built to run natively on Windows using the MinGW-w64
|
||||
toolchain. Install the latest versions of MSYS2 and MinGW-w64 from
|
||||
<a class="url" href="http://msys2.github.io/">http://msys2.github.io/</a> and/or <a class="url" href="http://mingw-w64.sourceforge.net/">http://mingw-w64.sourceforge.net/</a>.
|
||||
You can find detailed installation instructions in the download section and
|
||||
the FAQ.
|
||||
</p>
|
||||
<p>Notes:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Building for the MSYS environment is discouraged, MSYS2 provides a full
|
||||
MinGW-w64 environment through <samp class="file">mingw64_shell.bat</samp> or
|
||||
<samp class="file">mingw32_shell.bat</samp> that should be used instead of the environment
|
||||
provided by <samp class="file">msys2_shell.bat</samp>.
|
||||
|
||||
</li><li>Building using MSYS2 can be sped up by disabling implicit rules in the
|
||||
Makefile by calling <code class="code">make -r</code> instead of plain <code class="code">make</code>. This
|
||||
speed up is close to non-existent for normal one-off builds and is only
|
||||
noticeable when running make for a second time (for example during
|
||||
<code class="code">make install</code>).
|
||||
|
||||
</li><li>In order to compile FFplay, you must have the MinGW development library
|
||||
of <a class="uref" href="http://www.libsdl.org/">SDL</a> and <code class="code">pkg-config</code> installed.
|
||||
|
||||
</li><li>By using <code class="code">./configure --enable-shared</code> when configuring FFmpeg,
|
||||
you can build the FFmpeg libraries (e.g. libavutil, libavcodec,
|
||||
libavformat) as DLLs.
|
||||
|
||||
</li></ul>
|
||||
|
||||
<a name="Native-Windows-compilation-using-MSYS2"></a>
|
||||
<h4 class="subsection">4.1.1 Native Windows compilation using MSYS2<span class="pull-right"><a class="anchor hidden-xs" href="#Native-Windows-compilation-using-MSYS2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Native-Windows-compilation-using-MSYS2" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies
|
||||
through <code class="command">pacman</code>.
|
||||
</p>
|
||||
<p>Make sure to use <samp class="file">mingw64_shell.bat</samp> or <samp class="file">mingw32_shell.bat</samp> to have
|
||||
the correct MinGW-w64 environment. The default install provides shortcuts to
|
||||
them under <code class="command">MinGW-w64 Win64 Shell</code> and <code class="command">MinGW-w64 Win32 Shell</code>.
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted"># normal msys2 packages
|
||||
pacman -S make pkgconf diffutils
|
||||
|
||||
# mingw-w64 packages and toolchains
|
||||
pacman -S mingw-w64-x86_64-nasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
|
||||
</pre></div>
|
||||
|
||||
<p>To target 32 bits replace <code class="code">x86_64</code> with <code class="code">i686</code> in the command above.
|
||||
</p>
|
||||
<a name="Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows"></a>
|
||||
<h3 class="section">4.2 Microsoft Visual C++ or Intel C++ Compiler for Windows<span class="pull-right"><a class="anchor hidden-xs" href="#Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Microsoft-Visual-C_002b_002b-or-Intel-C_002b_002b-Compiler-for-Windows" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg can be built with MSVC 2013 or later.
|
||||
</p>
|
||||
<p>You will need the following prerequisites:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li><a class="uref" href="http://msys2.github.io/">MSYS2</a>
|
||||
</li><li><a class="uref" href="http://www.nasm.us/">NASM</a>
|
||||
(Also available via MSYS2’s package manager.)
|
||||
</li></ul>
|
||||
|
||||
<p>To set up a proper environment in MSYS2, you need to run <code class="code">msys_shell.bat</code> from
|
||||
the Visual Studio or Intel Compiler command prompt.
|
||||
</p>
|
||||
<p>Place <code class="code">nasm.exe</code> somewhere in your <code class="code">PATH</code>.
|
||||
</p>
|
||||
<p>Next, make sure any other headers and libs you want to use, such as zlib, are
|
||||
located in a spot that the compiler can see. Do so by modifying the <code class="code">LIB</code>
|
||||
and <code class="code">INCLUDE</code> environment variables to include the <strong class="strong">Windows-style</strong>
|
||||
paths to these directories. Alternatively, you can try to use the
|
||||
<code class="code">--extra-cflags</code>/<code class="code">--extra-ldflags</code> configure options.
|
||||
</p>
|
||||
<p>Finally, run:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">For MSVC:
|
||||
./configure --toolchain=msvc
|
||||
|
||||
For ICL:
|
||||
./configure --toolchain=icl
|
||||
|
||||
make
|
||||
make install
|
||||
</pre></div>
|
||||
|
||||
<p>If you wish to compile shared libraries, add <code class="code">--enable-shared</code> to your
|
||||
configure options. Note that due to the way MSVC and ICL handle DLL imports and
|
||||
exports, you cannot compile static and shared libraries at the same time, and
|
||||
enabling shared libraries will automatically disable the static ones.
|
||||
</p>
|
||||
<p>Notes:
|
||||
</p>
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>If you wish to build with zlib support, you will have to grab a compatible
|
||||
zlib binary from somewhere, with an MSVC import lib, or if you wish to link
|
||||
statically, you can follow the instructions below to build a compatible
|
||||
<code class="code">zlib.lib</code> with MSVC. Regardless of which method you use, you must still
|
||||
follow step 3, or compilation will fail.
|
||||
<ol class="enumerate">
|
||||
<li> Grab the <a class="uref" href="http://zlib.net/">zlib sources</a>.
|
||||
</li><li> Edit <code class="code">win32/Makefile.msc</code> so that it uses -MT instead of -MD, since
|
||||
this is how FFmpeg is built as well.
|
||||
</li><li> Edit <code class="code">zconf.h</code> and remove its inclusion of <code class="code">unistd.h</code>. This gets
|
||||
erroneously included when building FFmpeg.
|
||||
</li><li> Run <code class="code">nmake -f win32/Makefile.msc</code>.
|
||||
</li><li> Move <code class="code">zlib.lib</code>, <code class="code">zconf.h</code>, and <code class="code">zlib.h</code> to somewhere MSVC
|
||||
can see.
|
||||
</li></ol>
|
||||
|
||||
</li><li>FFmpeg has been tested with the following on i686 and x86_64:
|
||||
<ul class="itemize mark-bullet">
|
||||
<li>Visual Studio 2013 Pro and Express
|
||||
</li><li>Intel Composer XE 2013
|
||||
</li><li>Intel Composer XE 2013 SP1
|
||||
</li></ul>
|
||||
<p>Anything else is not officially supported.
|
||||
</p>
|
||||
</li></ul>
|
||||
|
||||
<a name="Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b"></a>
|
||||
<h4 class="subsection">4.2.1 Linking to FFmpeg with Microsoft Visual C++<span class="pull-right"><a class="anchor hidden-xs" href="#Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Linking-to-FFmpeg-with-Microsoft-Visual-C_002b_002b" aria-hidden="true">TOC</a></span></h4>
|
||||
|
||||
<p>If you plan to link with MSVC-built static libraries, you will need
|
||||
to make sure you have <code class="code">Runtime Library</code> set to
|
||||
<code class="code">Multi-threaded (/MT)</code> in your project’s settings.
|
||||
</p>
|
||||
<p>You will need to define <code class="code">inline</code> to something MSVC understands:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">#define inline __inline
|
||||
</pre></div>
|
||||
|
||||
<p>Also note, that as stated in <strong class="strong">Microsoft Visual C++</strong>, you will need
|
||||
an MSVC-compatible <a class="uref" href="http://code.google.com/p/msinttypes/">inttypes.h</a>.
|
||||
</p>
|
||||
<p>If you plan on using import libraries created by dlltool, you must
|
||||
set <code class="code">References</code> to <code class="code">No (/OPT:NOREF)</code> under the linker optimization
|
||||
settings, otherwise the resulting binaries will fail during runtime.
|
||||
This is not required when using import libraries generated by <code class="code">lib.exe</code>.
|
||||
This issue is reported upstream at
|
||||
<a class="url" href="http://sourceware.org/bugzilla/show_bug.cgi?id=12633">http://sourceware.org/bugzilla/show_bug.cgi?id=12633</a>.
|
||||
</p>
|
||||
<p>To create import libraries that work with the <code class="code">/OPT:REF</code> option
|
||||
(which is enabled by default in Release mode), follow these steps:
|
||||
</p>
|
||||
<ol class="enumerate">
|
||||
<li> Open the <em class="emph">Visual Studio Command Prompt</em>.
|
||||
|
||||
<p>Alternatively, in a normal command line prompt, call <samp class="file">vcvars32.bat</samp>
|
||||
which sets up the environment variables for the Visual C++ tools
|
||||
(the standard location for this file is something like
|
||||
<samp class="file">C:\Program Files (x86_\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat</samp>).
|
||||
</p>
|
||||
</li><li> Enter the <samp class="file">bin</samp> directory where the created LIB and DLL files
|
||||
are stored.
|
||||
|
||||
</li><li> Generate new import libraries with <code class="command">lib.exe</code>:
|
||||
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">lib /machine:i386 /def:..\lib\foo-version.def /out:foo.lib
|
||||
</pre></div>
|
||||
|
||||
<p>Replace <code class="code">foo-version</code> and <code class="code">foo</code> with the respective library names.
|
||||
</p>
|
||||
</li></ol>
|
||||
|
||||
<a class="anchor" id="Cross-compilation-for-Windows-with-Linux"></a><a name="Cross-compilation-for-Windows-with-Linux-1"></a>
|
||||
<h3 class="section">4.3 Cross compilation for Windows with Linux<span class="pull-right"><a class="anchor hidden-xs" href="#Cross-compilation-for-Windows-with-Linux-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Cross-compilation-for-Windows-with-Linux-1" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>You must use the MinGW cross compilation tools available at
|
||||
<a class="url" href="http://www.mingw.org/">http://www.mingw.org/</a>.
|
||||
</p>
|
||||
<p>Then configure FFmpeg with the following options:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
|
||||
</pre></div>
|
||||
<p>(you can change the cross-prefix according to the prefix chosen for the
|
||||
MinGW tools).
|
||||
</p>
|
||||
<p>Then you can easily test FFmpeg with <a class="uref" href="http://www.winehq.com/">Wine</a>.
|
||||
</p>
|
||||
<a name="Compilation-under-Cygwin"></a>
|
||||
<h3 class="section">4.4 Compilation under Cygwin<span class="pull-right"><a class="anchor hidden-xs" href="#Compilation-under-Cygwin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Compilation-under-Cygwin" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack
|
||||
llrint() in its C library.
|
||||
</p>
|
||||
<p>Install your Cygwin with all the "Base" packages, plus the
|
||||
following "Devel" ones:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">binutils, gcc4-core, make, git, mingw-runtime, texinfo
|
||||
</pre></div>
|
||||
|
||||
<p>In order to run FATE you will also need the following "Utils" packages:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">diffutils
|
||||
</pre></div>
|
||||
|
||||
<p>If you want to build FFmpeg with additional libraries, download Cygwin
|
||||
"Devel" packages for Ogg and Vorbis from any Cygwin packages repository:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">libogg-devel, libvorbis-devel
|
||||
</pre></div>
|
||||
|
||||
<p>These library packages are only available from
|
||||
<a class="uref" href="http://sourceware.org/cygwinports/">Cygwin Ports</a>:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example-preformatted">libSDL-devel, libgsm-devel, libmp3lame-devel,
|
||||
speex-devel, libtheora-devel, libxvidcore-devel
|
||||
</pre></div>
|
||||
|
||||
<p>The recommendation for x264 is to build it from source, as it evolves too
|
||||
quickly for Cygwin Ports to be up to date.
|
||||
</p>
|
||||
<a name="Crosscompilation-for-Windows-under-Cygwin"></a>
|
||||
<h3 class="section">4.5 Crosscompilation for Windows under Cygwin<span class="pull-right"><a class="anchor hidden-xs" href="#Crosscompilation-for-Windows-under-Cygwin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Crosscompilation-for-Windows-under-Cygwin" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>With Cygwin you can create Windows binaries that do not need the cygwin1.dll.
|
||||
</p>
|
||||
<p>Just install your Cygwin as explained before, plus these additional
|
||||
"Devel" packages:
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">gcc-mingw-core, mingw-runtime, mingw-zlib
|
||||
</pre></div>
|
||||
|
||||
<p>and add some special flags to your configure invocation.
|
||||
</p>
|
||||
<p>For a static build run
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
</pre></div>
|
||||
|
||||
<p>and for a build with shared libraries
|
||||
</p><div class="example">
|
||||
<pre class="example-preformatted">./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
|
||||
</pre></div>
|
||||
|
||||
<a name="ARM64EC"></a>
|
||||
<h3 class="section">4.6 ARM64EC<span class="pull-right"><a class="anchor hidden-xs" href="#ARM64EC" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ARM64EC" aria-hidden="true">TOC</a></span></h3>
|
||||
|
||||
<p>FFmpeg does not intend to support the Windows ARM64EC build configuration;
|
||||
patches for changing the individual libraries for the purposes of ARM64EC will
|
||||
not be accepted.
|
||||
</p>
|
||||
<p>It may still be possible to build FFmpeg in this build configuration;
|
||||
such a build may seem to work to some extent. Such a build may have some
|
||||
amounts of ABI inconsistencies though - which we are not willing to fix.
|
||||
</p>
|
||||
<p>(Changing aarch64 assembly code to strictly support ARM64EC would require
|
||||
ifdeffing/changing essentially all such assembly code, and would be a
|
||||
huge maintenance burden. Additionally, changing the library ABI
|
||||
surfaces to fix ABI inconsistencies could require extensive and intrusive
|
||||
changes.)
|
||||
</p>
|
||||
<p style="font-size: small;">
|
||||
This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+23
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* AC-3 parser prototypes
|
||||
* Copyright (c) 2003 Fabrice Bellard
|
||||
* Copyright (c) 2003 Michael Niedermayer
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AC3_PARSER_H
|
||||
#define AVCODEC_AC3_PARSER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Extract the bitstream ID and the frame size from AC-3 data.
|
||||
*/
|
||||
int av_ac3_parse_header(const uint8_t *buf, size_t size,
|
||||
uint8_t *bitstream_id, uint16_t *frame_size);
|
||||
|
||||
|
||||
#endif /* AVCODEC_AC3_PARSER_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_ADTS_PARSER_H
|
||||
#define AVCODEC_ADTS_PARSER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define AV_AAC_ADTS_HEADER_SIZE 7
|
||||
|
||||
/**
|
||||
* Extract the number of samples and frames from AAC data.
|
||||
* @param[in] buf pointer to AAC data buffer
|
||||
* @param[out] samples Pointer to where number of samples is written
|
||||
* @param[out] frames Pointer to where number of frames is written
|
||||
* @return Returns 0 on success, error code on failure.
|
||||
*/
|
||||
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
|
||||
uint8_t *frames);
|
||||
|
||||
#endif /* AVCODEC_ADTS_PARSER_H */
|
||||
+2995
File diff suppressed because it is too large
Load Diff
+88
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AVDCT_H
|
||||
#define AVCODEC_AVDCT_H
|
||||
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
/**
|
||||
* AVDCT context.
|
||||
* @note function pointers can be NULL if the specific features have been
|
||||
* disabled at build time.
|
||||
*/
|
||||
typedef struct AVDCT {
|
||||
const AVClass *av_class;
|
||||
|
||||
void (*idct)(int16_t *block /* align 16 */);
|
||||
|
||||
/**
|
||||
* IDCT input permutation.
|
||||
* Several optimized IDCTs need a permutated input (relative to the
|
||||
* normal order of the reference IDCT).
|
||||
* This permutation must be performed before the idct_put/add.
|
||||
* Note, normally this can be merged with the zigzag/alternate scan<br>
|
||||
* An example to avoid confusion:
|
||||
* - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
|
||||
* - (x -> reference DCT -> reference IDCT -> x)
|
||||
* - (x -> reference DCT -> simple_mmx_perm = idct_permutation
|
||||
* -> simple_idct_mmx -> x)
|
||||
* - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
|
||||
* -> simple_idct_mmx -> ...)
|
||||
*/
|
||||
uint8_t idct_permutation[64];
|
||||
|
||||
void (*fdct)(int16_t *block /* align 16 */);
|
||||
|
||||
|
||||
/**
|
||||
* DCT algorithm.
|
||||
* must use AVOptions to set this field.
|
||||
*/
|
||||
int dct_algo;
|
||||
|
||||
/**
|
||||
* IDCT algorithm.
|
||||
* must use AVOptions to set this field.
|
||||
*/
|
||||
int idct_algo;
|
||||
|
||||
void (*get_pixels)(int16_t *block /* align 16 */,
|
||||
const uint8_t *pixels /* align 8 */,
|
||||
ptrdiff_t line_size);
|
||||
|
||||
int bits_per_sample;
|
||||
|
||||
void (*get_pixels_unaligned)(int16_t *block /* align 16 */,
|
||||
const uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
} AVDCT;
|
||||
|
||||
/**
|
||||
* Allocates a AVDCT context.
|
||||
* This needs to be initialized with avcodec_dct_init() after optionally
|
||||
* configuring it with AVOptions.
|
||||
*
|
||||
* To free it use av_free()
|
||||
*/
|
||||
AVDCT *avcodec_dct_alloc(void);
|
||||
int avcodec_dct_init(AVDCT *);
|
||||
|
||||
const AVClass *avcodec_dct_get_class(void);
|
||||
|
||||
#endif /* AVCODEC_AVDCT_H */
|
||||
+332
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
* Bitstream filters public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_BSF_H
|
||||
#define AVCODEC_BSF_H
|
||||
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/rational.h"
|
||||
|
||||
#include "codec_id.h"
|
||||
#include "codec_par.h"
|
||||
#include "packet.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavc_bsf Bitstream filters
|
||||
* @ingroup libavc
|
||||
*
|
||||
* Bitstream filters transform encoded media data without decoding it. This
|
||||
* allows e.g. manipulating various header values. Bitstream filters operate on
|
||||
* @ref AVPacket "AVPackets".
|
||||
*
|
||||
* The bitstream filtering API is centered around two structures:
|
||||
* AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter
|
||||
* in abstract, the latter a specific filtering process. Obtain an
|
||||
* AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass
|
||||
* it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable
|
||||
* AVBSFContext fields, as described in its documentation, then call
|
||||
* av_bsf_init() to prepare the filter context for use.
|
||||
*
|
||||
* Submit packets for filtering using av_bsf_send_packet(), obtain filtered
|
||||
* results with av_bsf_receive_packet(). When no more input packets will be
|
||||
* sent, submit a NULL AVPacket to signal the end of the stream to the filter.
|
||||
* av_bsf_receive_packet() will then return trailing packets, if any are
|
||||
* produced by the filter.
|
||||
*
|
||||
* Finally, free the filter context with av_bsf_free().
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The bitstream filter state.
|
||||
*
|
||||
* This struct must be allocated with av_bsf_alloc() and freed with
|
||||
* av_bsf_free().
|
||||
*
|
||||
* The fields in the struct will only be changed (by the caller or by the
|
||||
* filter) as described in their documentation, and are to be considered
|
||||
* immutable otherwise.
|
||||
*/
|
||||
typedef struct AVBSFContext {
|
||||
/**
|
||||
* A class for logging and AVOptions
|
||||
*/
|
||||
const AVClass *av_class;
|
||||
|
||||
/**
|
||||
* The bitstream filter this context is an instance of.
|
||||
*/
|
||||
const struct AVBitStreamFilter *filter;
|
||||
|
||||
/**
|
||||
* Opaque filter-specific private data. If filter->priv_class is non-NULL,
|
||||
* this is an AVOptions-enabled struct.
|
||||
*/
|
||||
void *priv_data;
|
||||
|
||||
/**
|
||||
* Parameters of the input stream. This field is allocated in
|
||||
* av_bsf_alloc(), it needs to be filled by the caller before
|
||||
* av_bsf_init().
|
||||
*/
|
||||
AVCodecParameters *par_in;
|
||||
|
||||
/**
|
||||
* Parameters of the output stream. This field is allocated in
|
||||
* av_bsf_alloc(), it is set by the filter in av_bsf_init().
|
||||
*/
|
||||
AVCodecParameters *par_out;
|
||||
|
||||
/**
|
||||
* The timebase used for the timestamps of the input packets. Set by the
|
||||
* caller before av_bsf_init().
|
||||
*/
|
||||
AVRational time_base_in;
|
||||
|
||||
/**
|
||||
* The timebase used for the timestamps of the output packets. Set by the
|
||||
* filter in av_bsf_init().
|
||||
*/
|
||||
AVRational time_base_out;
|
||||
} AVBSFContext;
|
||||
|
||||
typedef struct AVBitStreamFilter {
|
||||
const char *name;
|
||||
|
||||
/**
|
||||
* A list of codec ids supported by the filter, terminated by
|
||||
* AV_CODEC_ID_NONE.
|
||||
* May be NULL, in that case the bitstream filter works with any codec id.
|
||||
*/
|
||||
const enum AVCodecID *codec_ids;
|
||||
|
||||
/**
|
||||
* A class for the private data, used to declare bitstream filter private
|
||||
* AVOptions. This field is NULL for bitstream filters that do not declare
|
||||
* any options.
|
||||
*
|
||||
* If this field is non-NULL, the first member of the filter private data
|
||||
* must be a pointer to AVClass, which will be set by libavcodec generic
|
||||
* code to this class.
|
||||
*/
|
||||
const AVClass *priv_class;
|
||||
} AVBitStreamFilter;
|
||||
|
||||
/**
|
||||
* @return a bitstream filter with the specified name or NULL if no such
|
||||
* bitstream filter exists.
|
||||
*/
|
||||
const AVBitStreamFilter *av_bsf_get_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* Iterate over all registered bitstream filters.
|
||||
*
|
||||
* @param opaque a pointer where libavcodec will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered bitstream filter or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVBitStreamFilter *av_bsf_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Allocate a context for a given bitstream filter. The caller must fill in the
|
||||
* context parameters as described in the documentation and then call
|
||||
* av_bsf_init() before sending any data to the filter.
|
||||
*
|
||||
* @param filter the filter for which to allocate an instance.
|
||||
* @param[out] ctx a pointer into which the pointer to the newly-allocated context
|
||||
* will be written. It must be freed with av_bsf_free() after the
|
||||
* filtering is done.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR code on failure
|
||||
*/
|
||||
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx);
|
||||
|
||||
/**
|
||||
* Prepare the filter for use, after all the parameters and options have been
|
||||
* set.
|
||||
*
|
||||
* @param ctx a AVBSFContext previously allocated with av_bsf_alloc()
|
||||
*/
|
||||
int av_bsf_init(AVBSFContext *ctx);
|
||||
|
||||
/**
|
||||
* Submit a packet for filtering.
|
||||
*
|
||||
* After sending each packet, the filter must be completely drained by calling
|
||||
* av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or
|
||||
* AVERROR_EOF.
|
||||
*
|
||||
* @param ctx an initialized AVBSFContext
|
||||
* @param pkt the packet to filter. The bitstream filter will take ownership of
|
||||
* the packet and reset the contents of pkt. pkt is not touched if an error occurs.
|
||||
* If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero),
|
||||
* it signals the end of the stream (i.e. no more non-empty packets will be sent;
|
||||
* sending more empty packets does nothing) and will cause the filter to output
|
||||
* any packets it may have buffered internally.
|
||||
*
|
||||
* @return
|
||||
* - 0 on success.
|
||||
* - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using
|
||||
* av_bsf_receive_packet()) before new input can be consumed.
|
||||
* - Another negative AVERROR value if an error occurs.
|
||||
*/
|
||||
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Retrieve a filtered packet.
|
||||
*
|
||||
* @param ctx an initialized AVBSFContext
|
||||
* @param[out] pkt this struct will be filled with the contents of the filtered
|
||||
* packet. It is owned by the caller and must be freed using
|
||||
* av_packet_unref() when it is no longer needed.
|
||||
* This parameter should be "clean" (i.e. freshly allocated
|
||||
* with av_packet_alloc() or unreffed with av_packet_unref())
|
||||
* when this function is called. If this function returns
|
||||
* successfully, the contents of pkt will be completely
|
||||
* overwritten by the returned data. On failure, pkt is not
|
||||
* touched.
|
||||
*
|
||||
* @return
|
||||
* - 0 on success.
|
||||
* - AVERROR(EAGAIN) if more packets need to be sent to the filter (using
|
||||
* av_bsf_send_packet()) to get more output.
|
||||
* - AVERROR_EOF if there will be no further output from the filter.
|
||||
* - Another negative AVERROR value if an error occurs.
|
||||
*
|
||||
* @note one input packet may result in several output packets, so after sending
|
||||
* a packet with av_bsf_send_packet(), this function needs to be called
|
||||
* repeatedly until it stops returning 0. It is also possible for a filter to
|
||||
* output fewer packets than were sent to it, so this function may return
|
||||
* AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call.
|
||||
*/
|
||||
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Reset the internal bitstream filter state. Should be called e.g. when seeking.
|
||||
*/
|
||||
void av_bsf_flush(AVBSFContext *ctx);
|
||||
|
||||
/**
|
||||
* Free a bitstream filter context and everything associated with it; write NULL
|
||||
* into the supplied pointer.
|
||||
*/
|
||||
void av_bsf_free(AVBSFContext **ctx);
|
||||
|
||||
/**
|
||||
* Get the AVClass for AVBSFContext. It can be used in combination with
|
||||
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
|
||||
*
|
||||
* @see av_opt_find().
|
||||
*/
|
||||
const AVClass *av_bsf_get_class(void);
|
||||
|
||||
/**
|
||||
* Structure for chain/list of bitstream filters.
|
||||
* Empty list can be allocated by av_bsf_list_alloc().
|
||||
*/
|
||||
typedef struct AVBSFList AVBSFList;
|
||||
|
||||
/**
|
||||
* Allocate empty list of bitstream filters.
|
||||
* The list must be later freed by av_bsf_list_free()
|
||||
* or finalized by av_bsf_list_finalize().
|
||||
*
|
||||
* @return Pointer to @ref AVBSFList on success, NULL in case of failure
|
||||
*/
|
||||
AVBSFList *av_bsf_list_alloc(void);
|
||||
|
||||
/**
|
||||
* Free list of bitstream filters.
|
||||
*
|
||||
* @param lst Pointer to pointer returned by av_bsf_list_alloc()
|
||||
*/
|
||||
void av_bsf_list_free(AVBSFList **lst);
|
||||
|
||||
/**
|
||||
* Append bitstream filter to the list of bitstream filters.
|
||||
*
|
||||
* @param lst List to append to
|
||||
* @param bsf Filter context to be appended
|
||||
*
|
||||
* @return >=0 on success, negative AVERROR in case of failure
|
||||
*/
|
||||
int av_bsf_list_append(AVBSFList *lst, AVBSFContext *bsf);
|
||||
|
||||
/**
|
||||
* Construct new bitstream filter context given it's name and options
|
||||
* and append it to the list of bitstream filters.
|
||||
*
|
||||
* @param lst List to append to
|
||||
* @param bsf_name Name of the bitstream filter
|
||||
* @param options Options for the bitstream filter, can be set to NULL
|
||||
*
|
||||
* @return >=0 on success, negative AVERROR in case of failure
|
||||
*/
|
||||
int av_bsf_list_append2(AVBSFList *lst, const char * bsf_name, AVDictionary **options);
|
||||
/**
|
||||
* Finalize list of bitstream filters.
|
||||
*
|
||||
* This function will transform @ref AVBSFList to single @ref AVBSFContext,
|
||||
* so the whole chain of bitstream filters can be treated as single filter
|
||||
* freshly allocated by av_bsf_alloc().
|
||||
* If the call is successful, @ref AVBSFList structure is freed and lst
|
||||
* will be set to NULL. In case of failure, caller is responsible for
|
||||
* freeing the structure by av_bsf_list_free()
|
||||
*
|
||||
* @param lst Filter list structure to be transformed
|
||||
* @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure
|
||||
* representing the chain of bitstream filters
|
||||
*
|
||||
* @return >=0 on success, negative AVERROR in case of failure
|
||||
*/
|
||||
int av_bsf_list_finalize(AVBSFList **lst, AVBSFContext **bsf);
|
||||
|
||||
/**
|
||||
* Parse string describing list of bitstream filters and create single
|
||||
* @ref AVBSFContext describing the whole chain of bitstream filters.
|
||||
* Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext freshly
|
||||
* allocated by av_bsf_alloc().
|
||||
*
|
||||
* @param str String describing chain of bitstream filters in format
|
||||
* `bsf1[=opt1=val1:opt2=val2][,bsf2]`
|
||||
* @param[out] bsf Pointer to be set to newly created @ref AVBSFContext structure
|
||||
* representing the chain of bitstream filters
|
||||
*
|
||||
* @return >=0 on success, negative AVERROR in case of failure
|
||||
*/
|
||||
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf);
|
||||
|
||||
/**
|
||||
* Get null/pass-through bitstream filter.
|
||||
*
|
||||
* @param[out] bsf Pointer to be set to new instance of pass-through bitstream filter
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int av_bsf_get_null_filter(AVBSFContext **bsf);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVCODEC_BSF_H
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
/*
|
||||
* AVCodec public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_CODEC_H
|
||||
#define AVCODEC_CODEC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/hwcontext.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#include "libavcodec/codec_id.h"
|
||||
#include "libavcodec/version_major.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Decoder can use draw_horiz_band callback.
|
||||
*/
|
||||
#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
|
||||
/**
|
||||
* Codec uses get_buffer() or get_encode_buffer() for allocating buffers and
|
||||
* supports custom allocators.
|
||||
* If not set, it might not use get_buffer() or get_encode_buffer() at all, or
|
||||
* use operations that assume the buffer was allocated by
|
||||
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
|
||||
*/
|
||||
#define AV_CODEC_CAP_DR1 (1 << 1)
|
||||
/**
|
||||
* Encoder or decoder requires flushing with NULL input at the end in order to
|
||||
* give the complete and correct output.
|
||||
*
|
||||
* NOTE: If this flag is not set, the codec is guaranteed to never be fed with
|
||||
* with NULL data. The user can still send NULL data to the public encode
|
||||
* or decode function, but libavcodec will not pass it along to the codec
|
||||
* unless this flag is set.
|
||||
*
|
||||
* Decoders:
|
||||
* The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
|
||||
* avpkt->size=0 at the end to get the delayed data until the decoder no longer
|
||||
* returns frames.
|
||||
*
|
||||
* Encoders:
|
||||
* The encoder needs to be fed with NULL data at the end of encoding until the
|
||||
* encoder no longer returns data.
|
||||
*
|
||||
* NOTE: For encoders implementing the AVCodec.encode2() function, setting this
|
||||
* flag also means that the encoder must set the pts and duration for
|
||||
* each output packet. If this flag is not set, the pts and duration will
|
||||
* be determined by libavcodec from the input frame.
|
||||
*/
|
||||
#define AV_CODEC_CAP_DELAY (1 << 5)
|
||||
/**
|
||||
* Codec can be fed a final frame with a smaller size.
|
||||
* This can be used to prevent truncation of the last audio samples.
|
||||
*/
|
||||
#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
|
||||
|
||||
/**
|
||||
* Codec is experimental and is thus avoided in favor of non experimental
|
||||
* encoders
|
||||
*/
|
||||
#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
|
||||
/**
|
||||
* Codec should fill in channel configuration and samplerate instead of container
|
||||
*/
|
||||
#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
|
||||
/**
|
||||
* Codec supports frame-level multithreading.
|
||||
*/
|
||||
#define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
|
||||
/**
|
||||
* Codec supports slice-based (or partition-based) multithreading.
|
||||
*/
|
||||
#define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
|
||||
/**
|
||||
* Codec supports changed parameters at any point.
|
||||
*/
|
||||
#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
|
||||
/**
|
||||
* Codec supports multithreading through a method other than slice- or
|
||||
* frame-level multithreading. Typically this marks wrappers around
|
||||
* multithreading-capable external libraries.
|
||||
*/
|
||||
#define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
|
||||
/**
|
||||
* Audio encoder supports receiving a different number of samples in each call.
|
||||
*/
|
||||
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
|
||||
/**
|
||||
* Decoder is not a preferred choice for probing.
|
||||
* This indicates that the decoder is not a good choice for probing.
|
||||
* It could for example be an expensive to spin up hardware decoder,
|
||||
* or it could simply not provide a lot of useful information about
|
||||
* the stream.
|
||||
* A decoder marked with this flag should only be used as last resort
|
||||
* choice for probing.
|
||||
*/
|
||||
#define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
|
||||
|
||||
/**
|
||||
* Codec is backed by a hardware implementation. Typically used to
|
||||
* identify a non-hwaccel hardware decoder. For information about hwaccels, use
|
||||
* avcodec_get_hw_config() instead.
|
||||
*/
|
||||
#define AV_CODEC_CAP_HARDWARE (1 << 18)
|
||||
|
||||
/**
|
||||
* Codec is potentially backed by a hardware implementation, but not
|
||||
* necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the
|
||||
* implementation provides some sort of internal fallback.
|
||||
*/
|
||||
#define AV_CODEC_CAP_HYBRID (1 << 19)
|
||||
|
||||
/**
|
||||
* This encoder can reorder user opaque values from input AVFrames and return
|
||||
* them with corresponding output packets.
|
||||
* @see AV_CODEC_FLAG_COPY_OPAQUE
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
|
||||
|
||||
/**
|
||||
* This encoder can be flushed using avcodec_flush_buffers(). If this flag is
|
||||
* not set, the encoder must be closed and reopened to ensure that no frames
|
||||
* remain pending.
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
|
||||
|
||||
/**
|
||||
* The encoder is able to output reconstructed frame data, i.e. raw frames that
|
||||
* would be produced by decoding the encoded bitstream.
|
||||
*
|
||||
* Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag.
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22)
|
||||
|
||||
/**
|
||||
* AVProfile.
|
||||
*/
|
||||
typedef struct AVProfile {
|
||||
int profile;
|
||||
const char *name; ///< short name for the profile
|
||||
} AVProfile;
|
||||
|
||||
/**
|
||||
* AVCodec.
|
||||
*/
|
||||
typedef struct AVCodec {
|
||||
/**
|
||||
* Name of the codec implementation.
|
||||
* The name is globally unique among encoders and among decoders (but an
|
||||
* encoder and a decoder can share the same name).
|
||||
* This is the primary way to find a codec from the user perspective.
|
||||
*/
|
||||
const char *name;
|
||||
/**
|
||||
* Descriptive name for the codec, meant to be more human readable than name.
|
||||
* You should use the NULL_IF_CONFIG_SMALL() macro to define it.
|
||||
*/
|
||||
const char *long_name;
|
||||
enum AVMediaType type;
|
||||
enum AVCodecID id;
|
||||
/**
|
||||
* Codec capabilities.
|
||||
* see AV_CODEC_CAP_*
|
||||
*/
|
||||
int capabilities;
|
||||
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
|
||||
|
||||
/**
|
||||
* Deprecated codec capabilities.
|
||||
*/
|
||||
attribute_deprecated
|
||||
const AVRational *supported_framerates; ///< @deprecated use avcodec_get_supported_config()
|
||||
attribute_deprecated
|
||||
const enum AVPixelFormat *pix_fmts; ///< @deprecated use avcodec_get_supported_config()
|
||||
attribute_deprecated
|
||||
const int *supported_samplerates; ///< @deprecated use avcodec_get_supported_config()
|
||||
attribute_deprecated
|
||||
const enum AVSampleFormat *sample_fmts; ///< @deprecated use avcodec_get_supported_config()
|
||||
|
||||
const AVClass *priv_class; ///< AVClass for the private context
|
||||
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}
|
||||
|
||||
/**
|
||||
* Group name of the codec implementation.
|
||||
* This is a short symbolic name of the wrapper backing this codec. A
|
||||
* wrapper uses some kind of external implementation for the codec, such
|
||||
* as an external library, or a codec implementation provided by the OS or
|
||||
* the hardware.
|
||||
* If this field is NULL, this is a builtin, libavcodec native codec.
|
||||
* If non-NULL, this will be the suffix in AVCodec.name in most cases
|
||||
* (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").
|
||||
*/
|
||||
const char *wrapper_name;
|
||||
|
||||
/**
|
||||
* Array of supported channel layouts, terminated with a zeroed layout.
|
||||
* @deprecated use avcodec_get_supported_config()
|
||||
*/
|
||||
attribute_deprecated
|
||||
const AVChannelLayout *ch_layouts;
|
||||
} AVCodec;
|
||||
|
||||
/**
|
||||
* Iterate over all registered codecs.
|
||||
*
|
||||
* @param opaque a pointer where libavcodec will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the next registered codec or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVCodec *av_codec_iterate(void **opaque);
|
||||
|
||||
/**
|
||||
* Find a registered decoder with a matching codec ID.
|
||||
*
|
||||
* @param id AVCodecID of the requested decoder
|
||||
* @return A decoder if one was found, NULL otherwise.
|
||||
*/
|
||||
const AVCodec *avcodec_find_decoder(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Find a registered decoder with the specified name.
|
||||
*
|
||||
* @param name name of the requested decoder
|
||||
* @return A decoder if one was found, NULL otherwise.
|
||||
*/
|
||||
const AVCodec *avcodec_find_decoder_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* Find a registered encoder with a matching codec ID.
|
||||
*
|
||||
* @param id AVCodecID of the requested encoder
|
||||
* @return An encoder if one was found, NULL otherwise.
|
||||
*/
|
||||
const AVCodec *avcodec_find_encoder(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Find a registered encoder with the specified name.
|
||||
*
|
||||
* @param name name of the requested encoder
|
||||
* @return An encoder if one was found, NULL otherwise.
|
||||
*/
|
||||
const AVCodec *avcodec_find_encoder_by_name(const char *name);
|
||||
/**
|
||||
* @return a non-zero number if codec is an encoder, zero otherwise
|
||||
*/
|
||||
int av_codec_is_encoder(const AVCodec *codec);
|
||||
|
||||
/**
|
||||
* @return a non-zero number if codec is a decoder, zero otherwise
|
||||
*/
|
||||
int av_codec_is_decoder(const AVCodec *codec);
|
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available.
|
||||
*
|
||||
* @param codec the codec that is searched for the given profile
|
||||
* @param profile the profile value for which a name is requested
|
||||
* @return A name for the profile if found, NULL otherwise.
|
||||
*/
|
||||
const char *av_get_profile_name(const AVCodec *codec, int profile);
|
||||
|
||||
enum {
|
||||
/**
|
||||
* The codec supports this format via the hw_device_ctx interface.
|
||||
*
|
||||
* When selecting this format, AVCodecContext.hw_device_ctx should
|
||||
* have been set to a device of the specified type before calling
|
||||
* avcodec_open2().
|
||||
*/
|
||||
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01,
|
||||
/**
|
||||
* The codec supports this format via the hw_frames_ctx interface.
|
||||
*
|
||||
* When selecting this format for a decoder,
|
||||
* AVCodecContext.hw_frames_ctx should be set to a suitable frames
|
||||
* context inside the get_format() callback. The frames context
|
||||
* must have been created on a device of the specified type.
|
||||
*
|
||||
* When selecting this format for an encoder,
|
||||
* AVCodecContext.hw_frames_ctx should be set to the context which
|
||||
* will be used for the input frames before calling avcodec_open2().
|
||||
*/
|
||||
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02,
|
||||
/**
|
||||
* The codec supports this format by some internal method.
|
||||
*
|
||||
* This format can be selected without any additional configuration -
|
||||
* no device or frames context is required.
|
||||
*/
|
||||
AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04,
|
||||
/**
|
||||
* The codec supports this format by some ad-hoc method.
|
||||
*
|
||||
* Additional settings and/or function calls are required. See the
|
||||
* codec-specific documentation for details. (Methods requiring
|
||||
* this sort of configuration are deprecated and others should be
|
||||
* used in preference.)
|
||||
*/
|
||||
AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08,
|
||||
};
|
||||
|
||||
typedef struct AVCodecHWConfig {
|
||||
/**
|
||||
* For decoders, a hardware pixel format which that decoder may be
|
||||
* able to decode to if suitable hardware is available.
|
||||
*
|
||||
* For encoders, a pixel format which the encoder may be able to
|
||||
* accept. If set to AV_PIX_FMT_NONE, this applies to all pixel
|
||||
* formats supported by the codec.
|
||||
*/
|
||||
enum AVPixelFormat pix_fmt;
|
||||
/**
|
||||
* Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible
|
||||
* setup methods which can be used with this configuration.
|
||||
*/
|
||||
int methods;
|
||||
/**
|
||||
* The device type associated with the configuration.
|
||||
*
|
||||
* Must be set for AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX and
|
||||
* AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX, otherwise unused.
|
||||
*/
|
||||
enum AVHWDeviceType device_type;
|
||||
} AVCodecHWConfig;
|
||||
|
||||
/**
|
||||
* Retrieve supported hardware configurations for a codec.
|
||||
*
|
||||
* Values of index from zero to some maximum return the indexed configuration
|
||||
* descriptor; all other values return NULL. If the codec does not support
|
||||
* any hardware configurations then it will always return NULL.
|
||||
*/
|
||||
const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVCODEC_CODEC_H */
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Codec descriptors public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_CODEC_DESC_H
|
||||
#define AVCODEC_CODEC_DESC_H
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
|
||||
#include "codec_id.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This struct describes the properties of a single codec described by an
|
||||
* AVCodecID.
|
||||
* @see avcodec_descriptor_get()
|
||||
*/
|
||||
typedef struct AVCodecDescriptor {
|
||||
enum AVCodecID id;
|
||||
enum AVMediaType type;
|
||||
/**
|
||||
* Name of the codec described by this descriptor. It is non-empty and
|
||||
* unique for each codec descriptor. It should contain alphanumeric
|
||||
* characters and '_' only.
|
||||
*/
|
||||
const char *name;
|
||||
/**
|
||||
* A more descriptive name for this codec. May be NULL.
|
||||
*/
|
||||
const char *long_name;
|
||||
/**
|
||||
* Codec properties, a combination of AV_CODEC_PROP_* flags.
|
||||
*/
|
||||
int props;
|
||||
/**
|
||||
* MIME type(s) associated with the codec.
|
||||
* May be NULL; if not, a NULL-terminated array of MIME types.
|
||||
* The first item is always non-NULL and is the preferred MIME type.
|
||||
*/
|
||||
const char *const *mime_types;
|
||||
/**
|
||||
* If non-NULL, an array of profiles recognized for this codec.
|
||||
* Terminated with AV_PROFILE_UNKNOWN.
|
||||
*/
|
||||
const struct AVProfile *profiles;
|
||||
} AVCodecDescriptor;
|
||||
|
||||
/**
|
||||
* Codec uses only intra compression.
|
||||
* Video and audio codecs only.
|
||||
*/
|
||||
#define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
|
||||
/**
|
||||
* Codec supports lossy compression. Audio and video codecs only.
|
||||
* @note a codec may support both lossy and lossless
|
||||
* compression modes
|
||||
*/
|
||||
#define AV_CODEC_PROP_LOSSY (1 << 1)
|
||||
/**
|
||||
* Codec supports lossless compression. Audio and video codecs only.
|
||||
*/
|
||||
#define AV_CODEC_PROP_LOSSLESS (1 << 2)
|
||||
/**
|
||||
* Codec supports frame reordering. That is, the coded order (the order in which
|
||||
* the encoded packets are output by the encoders / stored / input to the
|
||||
* decoders) may be different from the presentation order of the corresponding
|
||||
* frames.
|
||||
*
|
||||
* For codecs that do not have this property set, PTS and DTS should always be
|
||||
* equal.
|
||||
*/
|
||||
#define AV_CODEC_PROP_REORDER (1 << 3)
|
||||
|
||||
/**
|
||||
* Video codec supports separate coding of fields in interlaced frames.
|
||||
*/
|
||||
#define AV_CODEC_PROP_FIELDS (1 << 4)
|
||||
|
||||
/**
|
||||
* Video codec contains enhancement information meant to be applied to other
|
||||
* existing frames, and can't generate usable image data on its own.
|
||||
* A standalone decoder is unlikely to be available for it and should not
|
||||
* be expected.
|
||||
*/
|
||||
#define AV_CODEC_PROP_ENHANCEMENT (1 << 5)
|
||||
|
||||
/**
|
||||
* Subtitle codec is bitmap based
|
||||
* Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
|
||||
*/
|
||||
#define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
|
||||
/**
|
||||
* Subtitle codec is text based.
|
||||
* Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field.
|
||||
*/
|
||||
#define AV_CODEC_PROP_TEXT_SUB (1 << 17)
|
||||
|
||||
/**
|
||||
* @return descriptor for given codec ID or NULL if no descriptor exists.
|
||||
*/
|
||||
const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Iterate over all codec descriptors known to libavcodec.
|
||||
*
|
||||
* @param prev previous descriptor. NULL to get the first descriptor.
|
||||
*
|
||||
* @return next descriptor or NULL after the last descriptor
|
||||
*/
|
||||
const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
|
||||
|
||||
/**
|
||||
* @return codec descriptor with the given name or NULL if no such descriptor
|
||||
* exists.
|
||||
*/
|
||||
const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVCODEC_CODEC_DESC_H
|
||||
+693
@@ -0,0 +1,693 @@
|
||||
/*
|
||||
* Codec IDs
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_CODEC_ID_H
|
||||
#define AVCODEC_CODEC_ID_H
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Identify the syntax and semantics of the bitstream.
|
||||
* The principle is roughly:
|
||||
* Two decoders with the same ID can decode the same streams.
|
||||
* Two encoders with the same ID can encode compatible streams.
|
||||
* There may be slight deviations from the principle due to implementation
|
||||
* details.
|
||||
*
|
||||
* If you add a codec ID to this list, add it so that
|
||||
* 1. no value of an existing codec ID changes (that would break ABI),
|
||||
* 2. it is as close as possible to similar codecs
|
||||
*
|
||||
* After adding new codec IDs, do not forget to add an entry to the codec
|
||||
* descriptor list and bump libavcodec minor version.
|
||||
*/
|
||||
enum AVCodecID {
|
||||
AV_CODEC_ID_NONE,
|
||||
|
||||
/* video codecs */
|
||||
AV_CODEC_ID_MPEG1VIDEO,
|
||||
AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
|
||||
AV_CODEC_ID_H261,
|
||||
AV_CODEC_ID_H263,
|
||||
AV_CODEC_ID_RV10,
|
||||
AV_CODEC_ID_RV20,
|
||||
AV_CODEC_ID_MJPEG,
|
||||
AV_CODEC_ID_MJPEGB,
|
||||
AV_CODEC_ID_LJPEG,
|
||||
AV_CODEC_ID_SP5X,
|
||||
AV_CODEC_ID_JPEGLS,
|
||||
AV_CODEC_ID_MPEG4,
|
||||
AV_CODEC_ID_RAWVIDEO,
|
||||
AV_CODEC_ID_MSMPEG4V1,
|
||||
AV_CODEC_ID_MSMPEG4V2,
|
||||
AV_CODEC_ID_MSMPEG4V3,
|
||||
AV_CODEC_ID_WMV1,
|
||||
AV_CODEC_ID_WMV2,
|
||||
AV_CODEC_ID_H263P,
|
||||
AV_CODEC_ID_H263I,
|
||||
AV_CODEC_ID_FLV1,
|
||||
AV_CODEC_ID_SVQ1,
|
||||
AV_CODEC_ID_SVQ3,
|
||||
AV_CODEC_ID_DVVIDEO,
|
||||
AV_CODEC_ID_HUFFYUV,
|
||||
AV_CODEC_ID_CYUV,
|
||||
AV_CODEC_ID_H264,
|
||||
AV_CODEC_ID_INDEO3,
|
||||
AV_CODEC_ID_VP3,
|
||||
AV_CODEC_ID_THEORA,
|
||||
AV_CODEC_ID_ASV1,
|
||||
AV_CODEC_ID_ASV2,
|
||||
AV_CODEC_ID_FFV1,
|
||||
AV_CODEC_ID_4XM,
|
||||
AV_CODEC_ID_VCR1,
|
||||
AV_CODEC_ID_CLJR,
|
||||
AV_CODEC_ID_MDEC,
|
||||
AV_CODEC_ID_ROQ,
|
||||
AV_CODEC_ID_INTERPLAY_VIDEO,
|
||||
AV_CODEC_ID_XAN_WC3,
|
||||
AV_CODEC_ID_XAN_WC4,
|
||||
AV_CODEC_ID_RPZA,
|
||||
AV_CODEC_ID_CINEPAK,
|
||||
AV_CODEC_ID_WS_VQA,
|
||||
AV_CODEC_ID_MSRLE,
|
||||
AV_CODEC_ID_MSVIDEO1,
|
||||
AV_CODEC_ID_IDCIN,
|
||||
AV_CODEC_ID_8BPS,
|
||||
AV_CODEC_ID_SMC,
|
||||
AV_CODEC_ID_FLIC,
|
||||
AV_CODEC_ID_TRUEMOTION1,
|
||||
AV_CODEC_ID_VMDVIDEO,
|
||||
AV_CODEC_ID_MSZH,
|
||||
AV_CODEC_ID_ZLIB,
|
||||
AV_CODEC_ID_QTRLE,
|
||||
AV_CODEC_ID_TSCC,
|
||||
AV_CODEC_ID_ULTI,
|
||||
AV_CODEC_ID_QDRAW,
|
||||
AV_CODEC_ID_VIXL,
|
||||
AV_CODEC_ID_QPEG,
|
||||
AV_CODEC_ID_PNG,
|
||||
AV_CODEC_ID_PPM,
|
||||
AV_CODEC_ID_PBM,
|
||||
AV_CODEC_ID_PGM,
|
||||
AV_CODEC_ID_PGMYUV,
|
||||
AV_CODEC_ID_PAM,
|
||||
AV_CODEC_ID_FFVHUFF,
|
||||
AV_CODEC_ID_RV30,
|
||||
AV_CODEC_ID_RV40,
|
||||
AV_CODEC_ID_VC1,
|
||||
AV_CODEC_ID_WMV3,
|
||||
AV_CODEC_ID_LOCO,
|
||||
AV_CODEC_ID_WNV1,
|
||||
AV_CODEC_ID_AASC,
|
||||
AV_CODEC_ID_INDEO2,
|
||||
AV_CODEC_ID_FRAPS,
|
||||
AV_CODEC_ID_TRUEMOTION2,
|
||||
AV_CODEC_ID_BMP,
|
||||
AV_CODEC_ID_CSCD,
|
||||
AV_CODEC_ID_MMVIDEO,
|
||||
AV_CODEC_ID_ZMBV,
|
||||
AV_CODEC_ID_AVS,
|
||||
AV_CODEC_ID_SMACKVIDEO,
|
||||
AV_CODEC_ID_NUV,
|
||||
AV_CODEC_ID_KMVC,
|
||||
AV_CODEC_ID_FLASHSV,
|
||||
AV_CODEC_ID_CAVS,
|
||||
AV_CODEC_ID_JPEG2000,
|
||||
AV_CODEC_ID_VMNC,
|
||||
AV_CODEC_ID_VP5,
|
||||
AV_CODEC_ID_VP6,
|
||||
AV_CODEC_ID_VP6F,
|
||||
AV_CODEC_ID_TARGA,
|
||||
AV_CODEC_ID_DSICINVIDEO,
|
||||
AV_CODEC_ID_TIERTEXSEQVIDEO,
|
||||
AV_CODEC_ID_TIFF,
|
||||
AV_CODEC_ID_GIF,
|
||||
AV_CODEC_ID_DXA,
|
||||
AV_CODEC_ID_DNXHD,
|
||||
AV_CODEC_ID_THP,
|
||||
AV_CODEC_ID_SGI,
|
||||
AV_CODEC_ID_C93,
|
||||
AV_CODEC_ID_BETHSOFTVID,
|
||||
AV_CODEC_ID_PTX,
|
||||
AV_CODEC_ID_TXD,
|
||||
AV_CODEC_ID_VP6A,
|
||||
AV_CODEC_ID_AMV,
|
||||
AV_CODEC_ID_VB,
|
||||
AV_CODEC_ID_PCX,
|
||||
AV_CODEC_ID_SUNRAST,
|
||||
AV_CODEC_ID_INDEO4,
|
||||
AV_CODEC_ID_INDEO5,
|
||||
AV_CODEC_ID_MIMIC,
|
||||
AV_CODEC_ID_RL2,
|
||||
AV_CODEC_ID_ESCAPE124,
|
||||
AV_CODEC_ID_DIRAC,
|
||||
AV_CODEC_ID_BFI,
|
||||
AV_CODEC_ID_CMV,
|
||||
AV_CODEC_ID_MOTIONPIXELS,
|
||||
AV_CODEC_ID_TGV,
|
||||
AV_CODEC_ID_TGQ,
|
||||
AV_CODEC_ID_TQI,
|
||||
AV_CODEC_ID_AURA,
|
||||
AV_CODEC_ID_AURA2,
|
||||
AV_CODEC_ID_V210X,
|
||||
AV_CODEC_ID_TMV,
|
||||
AV_CODEC_ID_V210,
|
||||
AV_CODEC_ID_DPX,
|
||||
AV_CODEC_ID_MAD,
|
||||
AV_CODEC_ID_FRWU,
|
||||
AV_CODEC_ID_FLASHSV2,
|
||||
AV_CODEC_ID_CDGRAPHICS,
|
||||
AV_CODEC_ID_R210,
|
||||
AV_CODEC_ID_ANM,
|
||||
AV_CODEC_ID_BINKVIDEO,
|
||||
AV_CODEC_ID_IFF_ILBM,
|
||||
#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM
|
||||
AV_CODEC_ID_KGV1,
|
||||
AV_CODEC_ID_YOP,
|
||||
AV_CODEC_ID_VP8,
|
||||
AV_CODEC_ID_PICTOR,
|
||||
AV_CODEC_ID_ANSI,
|
||||
AV_CODEC_ID_A64_MULTI,
|
||||
AV_CODEC_ID_A64_MULTI5,
|
||||
AV_CODEC_ID_R10K,
|
||||
AV_CODEC_ID_MXPEG,
|
||||
AV_CODEC_ID_LAGARITH,
|
||||
AV_CODEC_ID_PRORES,
|
||||
AV_CODEC_ID_JV,
|
||||
AV_CODEC_ID_DFA,
|
||||
AV_CODEC_ID_WMV3IMAGE,
|
||||
AV_CODEC_ID_VC1IMAGE,
|
||||
AV_CODEC_ID_UTVIDEO,
|
||||
AV_CODEC_ID_BMV_VIDEO,
|
||||
AV_CODEC_ID_VBLE,
|
||||
AV_CODEC_ID_DXTORY,
|
||||
#if FF_API_V408_CODECID
|
||||
AV_CODEC_ID_V410,
|
||||
#endif
|
||||
AV_CODEC_ID_XWD,
|
||||
AV_CODEC_ID_CDXL,
|
||||
AV_CODEC_ID_XBM,
|
||||
AV_CODEC_ID_ZEROCODEC,
|
||||
AV_CODEC_ID_MSS1,
|
||||
AV_CODEC_ID_MSA1,
|
||||
AV_CODEC_ID_TSCC2,
|
||||
AV_CODEC_ID_MTS2,
|
||||
AV_CODEC_ID_CLLC,
|
||||
AV_CODEC_ID_MSS2,
|
||||
AV_CODEC_ID_VP9,
|
||||
AV_CODEC_ID_AIC,
|
||||
AV_CODEC_ID_ESCAPE130,
|
||||
AV_CODEC_ID_G2M,
|
||||
AV_CODEC_ID_WEBP,
|
||||
AV_CODEC_ID_HNM4_VIDEO,
|
||||
AV_CODEC_ID_HEVC,
|
||||
#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC
|
||||
AV_CODEC_ID_FIC,
|
||||
AV_CODEC_ID_ALIAS_PIX,
|
||||
AV_CODEC_ID_BRENDER_PIX,
|
||||
AV_CODEC_ID_PAF_VIDEO,
|
||||
AV_CODEC_ID_EXR,
|
||||
AV_CODEC_ID_VP7,
|
||||
AV_CODEC_ID_SANM,
|
||||
AV_CODEC_ID_SGIRLE,
|
||||
AV_CODEC_ID_MVC1,
|
||||
AV_CODEC_ID_MVC2,
|
||||
AV_CODEC_ID_HQX,
|
||||
AV_CODEC_ID_TDSC,
|
||||
AV_CODEC_ID_HQ_HQA,
|
||||
AV_CODEC_ID_HAP,
|
||||
AV_CODEC_ID_DDS,
|
||||
AV_CODEC_ID_DXV,
|
||||
AV_CODEC_ID_SCREENPRESSO,
|
||||
AV_CODEC_ID_RSCC,
|
||||
AV_CODEC_ID_AVS2,
|
||||
AV_CODEC_ID_PGX,
|
||||
AV_CODEC_ID_AVS3,
|
||||
AV_CODEC_ID_MSP2,
|
||||
AV_CODEC_ID_VVC,
|
||||
#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
|
||||
AV_CODEC_ID_Y41P,
|
||||
AV_CODEC_ID_AVRP,
|
||||
AV_CODEC_ID_012V,
|
||||
AV_CODEC_ID_AVUI,
|
||||
AV_CODEC_ID_TARGA_Y216,
|
||||
#if FF_API_V408_CODECID
|
||||
AV_CODEC_ID_V308,
|
||||
AV_CODEC_ID_V408,
|
||||
#endif
|
||||
AV_CODEC_ID_YUV4,
|
||||
AV_CODEC_ID_AVRN,
|
||||
AV_CODEC_ID_CPIA,
|
||||
AV_CODEC_ID_XFACE,
|
||||
AV_CODEC_ID_SNOW,
|
||||
AV_CODEC_ID_SMVJPEG,
|
||||
AV_CODEC_ID_APNG,
|
||||
AV_CODEC_ID_DAALA,
|
||||
AV_CODEC_ID_CFHD,
|
||||
AV_CODEC_ID_TRUEMOTION2RT,
|
||||
AV_CODEC_ID_M101,
|
||||
AV_CODEC_ID_MAGICYUV,
|
||||
AV_CODEC_ID_SHEERVIDEO,
|
||||
AV_CODEC_ID_YLC,
|
||||
AV_CODEC_ID_PSD,
|
||||
AV_CODEC_ID_PIXLET,
|
||||
AV_CODEC_ID_SPEEDHQ,
|
||||
AV_CODEC_ID_FMVC,
|
||||
AV_CODEC_ID_SCPR,
|
||||
AV_CODEC_ID_CLEARVIDEO,
|
||||
AV_CODEC_ID_XPM,
|
||||
AV_CODEC_ID_AV1,
|
||||
AV_CODEC_ID_BITPACKED,
|
||||
AV_CODEC_ID_MSCC,
|
||||
AV_CODEC_ID_SRGC,
|
||||
AV_CODEC_ID_SVG,
|
||||
AV_CODEC_ID_GDV,
|
||||
AV_CODEC_ID_FITS,
|
||||
AV_CODEC_ID_IMM4,
|
||||
AV_CODEC_ID_PROSUMER,
|
||||
AV_CODEC_ID_MWSC,
|
||||
AV_CODEC_ID_WCMV,
|
||||
AV_CODEC_ID_RASC,
|
||||
AV_CODEC_ID_HYMT,
|
||||
AV_CODEC_ID_ARBC,
|
||||
AV_CODEC_ID_AGM,
|
||||
AV_CODEC_ID_LSCR,
|
||||
AV_CODEC_ID_VP4,
|
||||
AV_CODEC_ID_IMM5,
|
||||
AV_CODEC_ID_MVDV,
|
||||
AV_CODEC_ID_MVHA,
|
||||
AV_CODEC_ID_CDTOONS,
|
||||
AV_CODEC_ID_MV30,
|
||||
AV_CODEC_ID_NOTCHLC,
|
||||
AV_CODEC_ID_PFM,
|
||||
AV_CODEC_ID_MOBICLIP,
|
||||
AV_CODEC_ID_PHOTOCD,
|
||||
AV_CODEC_ID_IPU,
|
||||
AV_CODEC_ID_ARGO,
|
||||
AV_CODEC_ID_CRI,
|
||||
AV_CODEC_ID_SIMBIOSIS_IMX,
|
||||
AV_CODEC_ID_SGA_VIDEO,
|
||||
AV_CODEC_ID_GEM,
|
||||
AV_CODEC_ID_VBN,
|
||||
AV_CODEC_ID_JPEGXL,
|
||||
AV_CODEC_ID_QOI,
|
||||
AV_CODEC_ID_PHM,
|
||||
AV_CODEC_ID_RADIANCE_HDR,
|
||||
AV_CODEC_ID_WBMP,
|
||||
AV_CODEC_ID_MEDIA100,
|
||||
AV_CODEC_ID_VQC,
|
||||
AV_CODEC_ID_PDV,
|
||||
AV_CODEC_ID_EVC,
|
||||
AV_CODEC_ID_RTV1,
|
||||
AV_CODEC_ID_VMIX,
|
||||
AV_CODEC_ID_LEAD,
|
||||
AV_CODEC_ID_DNXUC,
|
||||
AV_CODEC_ID_RV60,
|
||||
AV_CODEC_ID_JPEGXL_ANIM,
|
||||
AV_CODEC_ID_APV,
|
||||
AV_CODEC_ID_PRORES_RAW,
|
||||
AV_CODEC_ID_JPEGXS,
|
||||
|
||||
/* various PCM "codecs" */
|
||||
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
|
||||
AV_CODEC_ID_PCM_S16LE = 0x10000,
|
||||
AV_CODEC_ID_PCM_S16BE,
|
||||
AV_CODEC_ID_PCM_U16LE,
|
||||
AV_CODEC_ID_PCM_U16BE,
|
||||
AV_CODEC_ID_PCM_S8,
|
||||
AV_CODEC_ID_PCM_U8,
|
||||
AV_CODEC_ID_PCM_MULAW,
|
||||
AV_CODEC_ID_PCM_ALAW,
|
||||
AV_CODEC_ID_PCM_S32LE,
|
||||
AV_CODEC_ID_PCM_S32BE,
|
||||
AV_CODEC_ID_PCM_U32LE,
|
||||
AV_CODEC_ID_PCM_U32BE,
|
||||
AV_CODEC_ID_PCM_S24LE,
|
||||
AV_CODEC_ID_PCM_S24BE,
|
||||
AV_CODEC_ID_PCM_U24LE,
|
||||
AV_CODEC_ID_PCM_U24BE,
|
||||
AV_CODEC_ID_PCM_S24DAUD,
|
||||
AV_CODEC_ID_PCM_ZORK,
|
||||
AV_CODEC_ID_PCM_S16LE_PLANAR,
|
||||
AV_CODEC_ID_PCM_DVD,
|
||||
AV_CODEC_ID_PCM_F32BE,
|
||||
AV_CODEC_ID_PCM_F32LE,
|
||||
AV_CODEC_ID_PCM_F64BE,
|
||||
AV_CODEC_ID_PCM_F64LE,
|
||||
AV_CODEC_ID_PCM_BLURAY,
|
||||
AV_CODEC_ID_PCM_LXF,
|
||||
AV_CODEC_ID_S302M,
|
||||
AV_CODEC_ID_PCM_S8_PLANAR,
|
||||
AV_CODEC_ID_PCM_S24LE_PLANAR,
|
||||
AV_CODEC_ID_PCM_S32LE_PLANAR,
|
||||
AV_CODEC_ID_PCM_S16BE_PLANAR,
|
||||
AV_CODEC_ID_PCM_S64LE,
|
||||
AV_CODEC_ID_PCM_S64BE,
|
||||
AV_CODEC_ID_PCM_F16LE,
|
||||
AV_CODEC_ID_PCM_F24LE,
|
||||
AV_CODEC_ID_PCM_VIDC,
|
||||
AV_CODEC_ID_PCM_SGA,
|
||||
|
||||
/* various ADPCM codecs */
|
||||
AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
|
||||
AV_CODEC_ID_ADPCM_IMA_WAV,
|
||||
AV_CODEC_ID_ADPCM_IMA_DK3,
|
||||
AV_CODEC_ID_ADPCM_IMA_DK4,
|
||||
AV_CODEC_ID_ADPCM_IMA_WS,
|
||||
AV_CODEC_ID_ADPCM_IMA_SMJPEG,
|
||||
AV_CODEC_ID_ADPCM_MS,
|
||||
AV_CODEC_ID_ADPCM_4XM,
|
||||
AV_CODEC_ID_ADPCM_XA,
|
||||
AV_CODEC_ID_ADPCM_ADX,
|
||||
AV_CODEC_ID_ADPCM_EA,
|
||||
AV_CODEC_ID_ADPCM_G726,
|
||||
AV_CODEC_ID_ADPCM_CT,
|
||||
AV_CODEC_ID_ADPCM_SWF,
|
||||
AV_CODEC_ID_ADPCM_YAMAHA,
|
||||
AV_CODEC_ID_ADPCM_SBPRO_4,
|
||||
AV_CODEC_ID_ADPCM_SBPRO_3,
|
||||
AV_CODEC_ID_ADPCM_SBPRO_2,
|
||||
AV_CODEC_ID_ADPCM_THP,
|
||||
AV_CODEC_ID_ADPCM_IMA_AMV,
|
||||
AV_CODEC_ID_ADPCM_EA_R1,
|
||||
AV_CODEC_ID_ADPCM_EA_R3,
|
||||
AV_CODEC_ID_ADPCM_EA_R2,
|
||||
AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
|
||||
AV_CODEC_ID_ADPCM_IMA_EA_EACS,
|
||||
AV_CODEC_ID_ADPCM_EA_XAS,
|
||||
AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
|
||||
AV_CODEC_ID_ADPCM_IMA_ISS,
|
||||
AV_CODEC_ID_ADPCM_G722,
|
||||
AV_CODEC_ID_ADPCM_IMA_APC,
|
||||
AV_CODEC_ID_ADPCM_VIMA,
|
||||
AV_CODEC_ID_ADPCM_AFC,
|
||||
AV_CODEC_ID_ADPCM_IMA_OKI,
|
||||
AV_CODEC_ID_ADPCM_DTK,
|
||||
AV_CODEC_ID_ADPCM_IMA_RAD,
|
||||
AV_CODEC_ID_ADPCM_G726LE,
|
||||
AV_CODEC_ID_ADPCM_THP_LE,
|
||||
AV_CODEC_ID_ADPCM_PSX,
|
||||
AV_CODEC_ID_ADPCM_AICA,
|
||||
AV_CODEC_ID_ADPCM_IMA_DAT4,
|
||||
AV_CODEC_ID_ADPCM_MTAF,
|
||||
AV_CODEC_ID_ADPCM_AGM,
|
||||
AV_CODEC_ID_ADPCM_ARGO,
|
||||
AV_CODEC_ID_ADPCM_IMA_SSI,
|
||||
AV_CODEC_ID_ADPCM_ZORK,
|
||||
AV_CODEC_ID_ADPCM_IMA_APM,
|
||||
AV_CODEC_ID_ADPCM_IMA_ALP,
|
||||
AV_CODEC_ID_ADPCM_IMA_MTF,
|
||||
AV_CODEC_ID_ADPCM_IMA_CUNNING,
|
||||
AV_CODEC_ID_ADPCM_IMA_MOFLEX,
|
||||
AV_CODEC_ID_ADPCM_IMA_ACORN,
|
||||
AV_CODEC_ID_ADPCM_XMD,
|
||||
AV_CODEC_ID_ADPCM_IMA_XBOX,
|
||||
AV_CODEC_ID_ADPCM_SANYO,
|
||||
AV_CODEC_ID_ADPCM_IMA_HVQM4,
|
||||
AV_CODEC_ID_ADPCM_IMA_PDA,
|
||||
AV_CODEC_ID_ADPCM_N64,
|
||||
AV_CODEC_ID_ADPCM_IMA_HVQM2,
|
||||
AV_CODEC_ID_ADPCM_IMA_MAGIX,
|
||||
AV_CODEC_ID_ADPCM_PSXC,
|
||||
AV_CODEC_ID_ADPCM_CIRCUS,
|
||||
AV_CODEC_ID_ADPCM_IMA_ESCAPE,
|
||||
|
||||
/* AMR */
|
||||
AV_CODEC_ID_AMR_NB = 0x12000,
|
||||
AV_CODEC_ID_AMR_WB,
|
||||
|
||||
/* RealAudio codecs*/
|
||||
AV_CODEC_ID_RA_144 = 0x13000,
|
||||
AV_CODEC_ID_RA_288,
|
||||
|
||||
/* various DPCM codecs */
|
||||
AV_CODEC_ID_ROQ_DPCM = 0x14000,
|
||||
AV_CODEC_ID_INTERPLAY_DPCM,
|
||||
AV_CODEC_ID_XAN_DPCM,
|
||||
AV_CODEC_ID_SOL_DPCM,
|
||||
AV_CODEC_ID_SDX2_DPCM,
|
||||
AV_CODEC_ID_GREMLIN_DPCM,
|
||||
AV_CODEC_ID_DERF_DPCM,
|
||||
AV_CODEC_ID_WADY_DPCM,
|
||||
AV_CODEC_ID_CBD2_DPCM,
|
||||
|
||||
/* audio codecs */
|
||||
AV_CODEC_ID_MP2 = 0x15000,
|
||||
AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
|
||||
AV_CODEC_ID_AAC,
|
||||
AV_CODEC_ID_AC3,
|
||||
AV_CODEC_ID_DTS,
|
||||
AV_CODEC_ID_VORBIS,
|
||||
AV_CODEC_ID_DVAUDIO,
|
||||
AV_CODEC_ID_WMAV1,
|
||||
AV_CODEC_ID_WMAV2,
|
||||
AV_CODEC_ID_MACE3,
|
||||
AV_CODEC_ID_MACE6,
|
||||
AV_CODEC_ID_VMDAUDIO,
|
||||
AV_CODEC_ID_FLAC,
|
||||
AV_CODEC_ID_MP3ADU,
|
||||
AV_CODEC_ID_MP3ON4,
|
||||
AV_CODEC_ID_SHORTEN,
|
||||
AV_CODEC_ID_ALAC,
|
||||
AV_CODEC_ID_WESTWOOD_SND1,
|
||||
AV_CODEC_ID_GSM, ///< as in Berlin toast format
|
||||
AV_CODEC_ID_QDM2,
|
||||
AV_CODEC_ID_COOK,
|
||||
AV_CODEC_ID_TRUESPEECH,
|
||||
AV_CODEC_ID_TTA,
|
||||
AV_CODEC_ID_SMACKAUDIO,
|
||||
AV_CODEC_ID_QCELP,
|
||||
AV_CODEC_ID_WAVPACK,
|
||||
AV_CODEC_ID_DSICINAUDIO,
|
||||
AV_CODEC_ID_IMC,
|
||||
AV_CODEC_ID_MUSEPACK7,
|
||||
AV_CODEC_ID_MLP,
|
||||
AV_CODEC_ID_GSM_MS, /* as found in WAV */
|
||||
AV_CODEC_ID_ATRAC3,
|
||||
AV_CODEC_ID_APE,
|
||||
AV_CODEC_ID_NELLYMOSER,
|
||||
AV_CODEC_ID_MUSEPACK8,
|
||||
AV_CODEC_ID_SPEEX,
|
||||
AV_CODEC_ID_WMAVOICE,
|
||||
AV_CODEC_ID_WMAPRO,
|
||||
AV_CODEC_ID_WMALOSSLESS,
|
||||
AV_CODEC_ID_ATRAC3P,
|
||||
AV_CODEC_ID_EAC3,
|
||||
AV_CODEC_ID_SIPR,
|
||||
AV_CODEC_ID_MP1,
|
||||
AV_CODEC_ID_TWINVQ,
|
||||
AV_CODEC_ID_TRUEHD,
|
||||
AV_CODEC_ID_MP4ALS,
|
||||
AV_CODEC_ID_ATRAC1,
|
||||
AV_CODEC_ID_BINKAUDIO_RDFT,
|
||||
AV_CODEC_ID_BINKAUDIO_DCT,
|
||||
AV_CODEC_ID_AAC_LATM,
|
||||
AV_CODEC_ID_QDMC,
|
||||
AV_CODEC_ID_CELT,
|
||||
AV_CODEC_ID_G723_1,
|
||||
AV_CODEC_ID_G729,
|
||||
AV_CODEC_ID_8SVX_EXP,
|
||||
AV_CODEC_ID_8SVX_FIB,
|
||||
AV_CODEC_ID_BMV_AUDIO,
|
||||
AV_CODEC_ID_RALF,
|
||||
AV_CODEC_ID_IAC,
|
||||
AV_CODEC_ID_ILBC,
|
||||
AV_CODEC_ID_OPUS,
|
||||
AV_CODEC_ID_COMFORT_NOISE,
|
||||
AV_CODEC_ID_TAK,
|
||||
AV_CODEC_ID_METASOUND,
|
||||
AV_CODEC_ID_PAF_AUDIO,
|
||||
AV_CODEC_ID_ON2AVC,
|
||||
AV_CODEC_ID_DSS_SP,
|
||||
AV_CODEC_ID_CODEC2,
|
||||
AV_CODEC_ID_FFWAVESYNTH,
|
||||
AV_CODEC_ID_SONIC,
|
||||
AV_CODEC_ID_SONIC_LS,
|
||||
AV_CODEC_ID_EVRC,
|
||||
AV_CODEC_ID_SMV,
|
||||
AV_CODEC_ID_DSD_LSBF,
|
||||
AV_CODEC_ID_DSD_MSBF,
|
||||
AV_CODEC_ID_DSD_LSBF_PLANAR,
|
||||
AV_CODEC_ID_DSD_MSBF_PLANAR,
|
||||
AV_CODEC_ID_4GV,
|
||||
AV_CODEC_ID_INTERPLAY_ACM,
|
||||
AV_CODEC_ID_XMA1,
|
||||
AV_CODEC_ID_XMA2,
|
||||
AV_CODEC_ID_DST,
|
||||
AV_CODEC_ID_ATRAC3AL,
|
||||
AV_CODEC_ID_ATRAC3PAL,
|
||||
AV_CODEC_ID_DOLBY_E,
|
||||
AV_CODEC_ID_APTX,
|
||||
AV_CODEC_ID_APTX_HD,
|
||||
AV_CODEC_ID_SBC,
|
||||
AV_CODEC_ID_ATRAC9,
|
||||
AV_CODEC_ID_HCOM,
|
||||
AV_CODEC_ID_ACELP_KELVIN,
|
||||
AV_CODEC_ID_MPEGH_3D_AUDIO,
|
||||
AV_CODEC_ID_SIREN,
|
||||
AV_CODEC_ID_HCA,
|
||||
AV_CODEC_ID_FASTAUDIO,
|
||||
AV_CODEC_ID_MSNSIREN,
|
||||
AV_CODEC_ID_DFPWM,
|
||||
AV_CODEC_ID_BONK,
|
||||
AV_CODEC_ID_MISC4,
|
||||
AV_CODEC_ID_APAC,
|
||||
AV_CODEC_ID_FTR,
|
||||
AV_CODEC_ID_WAVARC,
|
||||
AV_CODEC_ID_RKA,
|
||||
AV_CODEC_ID_AC4,
|
||||
AV_CODEC_ID_OSQ,
|
||||
AV_CODEC_ID_QOA,
|
||||
AV_CODEC_ID_LC3,
|
||||
AV_CODEC_ID_G728,
|
||||
AV_CODEC_ID_AHX,
|
||||
|
||||
/* subtitle codecs */
|
||||
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
|
||||
AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
|
||||
AV_CODEC_ID_DVB_SUBTITLE,
|
||||
AV_CODEC_ID_TEXT, ///< raw UTF-8 text
|
||||
AV_CODEC_ID_XSUB,
|
||||
AV_CODEC_ID_SSA,
|
||||
AV_CODEC_ID_MOV_TEXT,
|
||||
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
|
||||
AV_CODEC_ID_DVB_TELETEXT,
|
||||
AV_CODEC_ID_SRT,
|
||||
AV_CODEC_ID_MICRODVD,
|
||||
AV_CODEC_ID_EIA_608,
|
||||
AV_CODEC_ID_JACOSUB,
|
||||
AV_CODEC_ID_SAMI,
|
||||
AV_CODEC_ID_REALTEXT,
|
||||
AV_CODEC_ID_STL,
|
||||
AV_CODEC_ID_SUBVIEWER1,
|
||||
AV_CODEC_ID_SUBVIEWER,
|
||||
AV_CODEC_ID_SUBRIP,
|
||||
AV_CODEC_ID_WEBVTT,
|
||||
AV_CODEC_ID_MPL2,
|
||||
AV_CODEC_ID_VPLAYER,
|
||||
AV_CODEC_ID_PJS,
|
||||
AV_CODEC_ID_ASS,
|
||||
AV_CODEC_ID_HDMV_TEXT_SUBTITLE,
|
||||
AV_CODEC_ID_TTML,
|
||||
AV_CODEC_ID_ARIB_CAPTION,
|
||||
AV_CODEC_ID_IVTV_VBI,
|
||||
|
||||
/* other specific kind of codecs (generally used for attachments) */
|
||||
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
|
||||
AV_CODEC_ID_TTF = 0x18000,
|
||||
|
||||
AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
|
||||
AV_CODEC_ID_EPG,
|
||||
AV_CODEC_ID_BINTEXT,
|
||||
AV_CODEC_ID_XBIN,
|
||||
AV_CODEC_ID_IDF,
|
||||
AV_CODEC_ID_OTF,
|
||||
AV_CODEC_ID_SMPTE_KLV,
|
||||
AV_CODEC_ID_DVD_NAV,
|
||||
AV_CODEC_ID_TIMED_ID3,
|
||||
AV_CODEC_ID_BIN_DATA,
|
||||
AV_CODEC_ID_SMPTE_2038,
|
||||
AV_CODEC_ID_LCEVC,
|
||||
AV_CODEC_ID_SMPTE_436M_ANC,
|
||||
|
||||
|
||||
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
|
||||
|
||||
AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
|
||||
* stream (only used by libavformat) */
|
||||
AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
|
||||
* stream (only used by libavformat) */
|
||||
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
|
||||
AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket
|
||||
/**
|
||||
* Dummy null video codec, useful mainly for development and debugging.
|
||||
* Null encoder/decoder discard all input and never return any output.
|
||||
*/
|
||||
AV_CODEC_ID_VNULL,
|
||||
/**
|
||||
* Dummy null audio codec, useful mainly for development and debugging.
|
||||
* Null encoder/decoder discard all input and never return any output.
|
||||
*/
|
||||
AV_CODEC_ID_ANULL,
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the type of the given codec.
|
||||
*/
|
||||
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
|
||||
|
||||
/**
|
||||
* Get the name of a codec.
|
||||
* @return a static string identifying the codec; never NULL
|
||||
*/
|
||||
const char *avcodec_get_name(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Return codec bits per sample.
|
||||
*
|
||||
* @param[in] codec_id the codec
|
||||
* @return Number of bits per sample or zero if unknown for the given codec.
|
||||
*/
|
||||
int av_get_bits_per_sample(enum AVCodecID codec_id);
|
||||
|
||||
/**
|
||||
* Return codec bits per sample.
|
||||
* Only return non-zero if the bits per sample is exactly correct, not an
|
||||
* approximation.
|
||||
*
|
||||
* @param[in] codec_id the codec
|
||||
* @return Number of bits per sample or zero if unknown for the given codec.
|
||||
*/
|
||||
int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
|
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available.
|
||||
*
|
||||
* @param codec_id the ID of the codec to which the requested profile belongs
|
||||
* @param profile the profile value for which a name is requested
|
||||
* @return A name for the profile if found, NULL otherwise.
|
||||
*
|
||||
* @note unlike av_get_profile_name(), which searches a list of profiles
|
||||
* supported by a specific decoder or encoder implementation, this
|
||||
* function searches the list of profiles from the AVCodecDescriptor
|
||||
*/
|
||||
const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
|
||||
|
||||
/**
|
||||
* Return the PCM codec associated with a sample format.
|
||||
* @param be endianness, 0 for little, 1 for big,
|
||||
* -1 (or anything else) for native
|
||||
* @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
|
||||
*/
|
||||
enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVCODEC_CODEC_ID_H
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Codec parameters public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_CODEC_PAR_H
|
||||
#define AVCODEC_CODEC_PAR_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
||||
#include "codec_id.h"
|
||||
#include "defs.h"
|
||||
#include "packet.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This struct describes the properties of an encoded stream.
|
||||
*
|
||||
* sizeof(AVCodecParameters) is not a part of the public ABI, this struct must
|
||||
* be allocated with avcodec_parameters_alloc() and freed with
|
||||
* avcodec_parameters_free().
|
||||
*/
|
||||
typedef struct AVCodecParameters {
|
||||
/**
|
||||
* General type of the encoded data.
|
||||
*/
|
||||
enum AVMediaType codec_type;
|
||||
/**
|
||||
* Specific type of the encoded data (the codec used).
|
||||
*/
|
||||
enum AVCodecID codec_id;
|
||||
/**
|
||||
* Additional information about the codec (corresponds to the AVI FOURCC).
|
||||
*/
|
||||
uint32_t codec_tag;
|
||||
|
||||
/**
|
||||
* Extra binary data needed for initializing the decoder, codec-dependent.
|
||||
*
|
||||
* Must be allocated with av_malloc() and will be freed by
|
||||
* avcodec_parameters_free(). The allocated size of extradata must be at
|
||||
* least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding
|
||||
* bytes zeroed.
|
||||
*/
|
||||
uint8_t *extradata;
|
||||
/**
|
||||
* Size of the extradata content in bytes.
|
||||
*/
|
||||
int extradata_size;
|
||||
|
||||
/**
|
||||
* Additional data associated with the entire stream.
|
||||
*
|
||||
* Should be allocated with av_packet_side_data_new() or
|
||||
* av_packet_side_data_add(), and will be freed by avcodec_parameters_free().
|
||||
*/
|
||||
AVPacketSideData *coded_side_data;
|
||||
|
||||
/**
|
||||
* Amount of entries in @ref coded_side_data.
|
||||
*/
|
||||
int nb_coded_side_data;
|
||||
|
||||
/**
|
||||
* - video: the pixel format, the value corresponds to enum AVPixelFormat.
|
||||
* - audio: the sample format, the value corresponds to enum AVSampleFormat.
|
||||
*/
|
||||
int format;
|
||||
|
||||
/**
|
||||
* The average bitrate of the encoded data (in bits per second).
|
||||
*/
|
||||
int64_t bit_rate;
|
||||
|
||||
/**
|
||||
* The number of bits per sample in the codedwords.
|
||||
*
|
||||
* This is basically the bitrate per sample. It is mandatory for a bunch of
|
||||
* formats to actually decode them. It's the number of bits for one sample in
|
||||
* the actual coded bitstream.
|
||||
*
|
||||
* This could be for example 4 for ADPCM
|
||||
* For PCM formats this matches bits_per_raw_sample
|
||||
* Can be 0
|
||||
*/
|
||||
int bits_per_coded_sample;
|
||||
|
||||
/**
|
||||
* This is the number of valid bits in each output sample. If the
|
||||
* sample format has more bits, the least significant bits are additional
|
||||
* padding bits, which are always 0. Use right shifts to reduce the sample
|
||||
* to its actual size. For example, audio formats with 24 bit samples will
|
||||
* have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32.
|
||||
* To get the original sample use "(int32_t)sample >> 8"."
|
||||
*
|
||||
* For ADPCM this might be 12 or 16 or similar
|
||||
* Can be 0
|
||||
*/
|
||||
int bits_per_raw_sample;
|
||||
|
||||
/**
|
||||
* Codec-specific bitstream restrictions that the stream conforms to.
|
||||
*/
|
||||
int profile;
|
||||
int level;
|
||||
|
||||
/**
|
||||
* Video only. The dimensions of the video frame in pixels.
|
||||
*/
|
||||
int width;
|
||||
int height;
|
||||
|
||||
/**
|
||||
* Video only. The aspect ratio (width / height) which a single pixel
|
||||
* should have when displayed.
|
||||
*
|
||||
* When the aspect ratio is unknown / undefined, the numerator should be
|
||||
* set to 0 (the denominator may have any value).
|
||||
*/
|
||||
AVRational sample_aspect_ratio;
|
||||
|
||||
/**
|
||||
* Video only. Number of frames per second, for streams with constant frame
|
||||
* durations. Should be set to { 0, 1 } when some frames have differing
|
||||
* durations or if the value is not known.
|
||||
*
|
||||
* @note This field corresponds to values that are stored in codec-level
|
||||
* headers and is typically overridden by container/transport-layer
|
||||
* timestamps, when available. It should thus be used only as a last resort,
|
||||
* when no higher-level timing information is available.
|
||||
*/
|
||||
AVRational framerate;
|
||||
|
||||
/**
|
||||
* Video only. The order of the fields in interlaced video.
|
||||
*/
|
||||
enum AVFieldOrder field_order;
|
||||
|
||||
/**
|
||||
* Video only. Additional colorspace characteristics.
|
||||
*/
|
||||
enum AVColorRange color_range;
|
||||
enum AVColorPrimaries color_primaries;
|
||||
enum AVColorTransferCharacteristic color_trc;
|
||||
enum AVColorSpace color_space;
|
||||
enum AVChromaLocation chroma_location;
|
||||
|
||||
/**
|
||||
* Video only. Number of delayed frames.
|
||||
*/
|
||||
int video_delay;
|
||||
|
||||
/**
|
||||
* Audio only. The channel layout and number of channels.
|
||||
*/
|
||||
AVChannelLayout ch_layout;
|
||||
/**
|
||||
* Audio only. The number of audio samples per second.
|
||||
*/
|
||||
int sample_rate;
|
||||
/**
|
||||
* Audio only. The number of bytes per coded audio frame, required by some
|
||||
* formats.
|
||||
*
|
||||
* Corresponds to nBlockAlign in WAVEFORMATEX.
|
||||
*/
|
||||
int block_align;
|
||||
/**
|
||||
* Audio only. Audio frame size, if known. Required by some formats to be static.
|
||||
*/
|
||||
int frame_size;
|
||||
|
||||
/**
|
||||
* Audio only. The amount of padding (in samples) inserted by the encoder at
|
||||
* the beginning of the audio. I.e. this number of leading decoded samples
|
||||
* must be discarded by the caller to get the original audio without leading
|
||||
* padding.
|
||||
*/
|
||||
int initial_padding;
|
||||
/**
|
||||
* Audio only. The amount of padding (in samples) appended by the encoder to
|
||||
* the end of the audio. I.e. this number of decoded samples must be
|
||||
* discarded by the caller from the end of the stream to get the original
|
||||
* audio without any trailing padding.
|
||||
*/
|
||||
int trailing_padding;
|
||||
/**
|
||||
* Audio only. Number of samples to skip after a discontinuity.
|
||||
*/
|
||||
int seek_preroll;
|
||||
|
||||
/**
|
||||
* Video with alpha channel only. Alpha channel handling
|
||||
*/
|
||||
enum AVAlphaMode alpha_mode;
|
||||
} AVCodecParameters;
|
||||
|
||||
/**
|
||||
* Allocate a new AVCodecParameters and set its fields to default values
|
||||
* (unknown/invalid/0). The returned struct must be freed with
|
||||
* avcodec_parameters_free().
|
||||
*/
|
||||
AVCodecParameters *avcodec_parameters_alloc(void);
|
||||
|
||||
/**
|
||||
* Free an AVCodecParameters instance and everything associated with it and
|
||||
* write NULL to the supplied pointer.
|
||||
*/
|
||||
void avcodec_parameters_free(AVCodecParameters **par);
|
||||
|
||||
/**
|
||||
* Copy the contents of src to dst. Any allocated fields in dst are freed and
|
||||
* replaced with newly allocated duplicates of the corresponding fields in src.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR code on failure.
|
||||
*/
|
||||
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src);
|
||||
|
||||
/**
|
||||
* This function is the same as av_get_audio_frame_duration(), except it works
|
||||
* with AVCodecParameters instead of an AVCodecContext.
|
||||
*/
|
||||
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVCODEC_CODEC_PAR_H
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Direct3D11 HW acceleration
|
||||
*
|
||||
* copyright (c) 2009 Laurent Aimar
|
||||
* copyright (c) 2015 Steve Lhomme
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_D3D11VA_H
|
||||
#define AVCODEC_D3D11VA_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_d3d11va
|
||||
* Public libavcodec D3D11VA header.
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0602
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <d3d11.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This structure is used to provides the necessary configurations and data
|
||||
* to the Direct3D11 FFmpeg HWAccel implementation.
|
||||
*
|
||||
* The application must make it available as AVCodecContext.hwaccel_context.
|
||||
*
|
||||
* Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext.
|
||||
*/
|
||||
typedef struct AVD3D11VAContext {
|
||||
/**
|
||||
* D3D11 decoder object
|
||||
*/
|
||||
ID3D11VideoDecoder *decoder;
|
||||
|
||||
/**
|
||||
* D3D11 VideoContext
|
||||
*/
|
||||
ID3D11VideoContext *video_context;
|
||||
|
||||
/**
|
||||
* D3D11 configuration used to create the decoder
|
||||
*/
|
||||
D3D11_VIDEO_DECODER_CONFIG *cfg;
|
||||
|
||||
/**
|
||||
* The number of surface in the surface array
|
||||
*/
|
||||
unsigned surface_count;
|
||||
|
||||
/**
|
||||
* The array of Direct3D surfaces used to create the decoder
|
||||
*/
|
||||
ID3D11VideoDecoderOutputView **surface;
|
||||
|
||||
/**
|
||||
* A bit field configuring the workarounds needed for using the decoder
|
||||
*/
|
||||
uint64_t workaround;
|
||||
|
||||
/**
|
||||
* Private to the FFmpeg AVHWAccel implementation
|
||||
*/
|
||||
unsigned report_id;
|
||||
|
||||
/**
|
||||
* Mutex to access video_context
|
||||
*/
|
||||
HANDLE context_mutex;
|
||||
} AVD3D11VAContext;
|
||||
|
||||
/**
|
||||
* Allocate an AVD3D11VAContext.
|
||||
*
|
||||
* @return Newly-allocated AVD3D11VAContext or NULL on failure.
|
||||
*/
|
||||
AVD3D11VAContext *av_d3d11va_alloc_context(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVCODEC_D3D11VA_H */
|
||||
+362
@@ -0,0 +1,362 @@
|
||||
/*
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_DEFS_H
|
||||
#define AVCODEC_DEFS_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavc
|
||||
* Misc types and constants that do not belong anywhere else.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding
|
||||
* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
|
||||
* This is mainly needed because some optimized bitstream readers read
|
||||
* 32 or 64 bit at once and could read over the end.<br>
|
||||
* Note: If the first 23 bits of the additional bytes are not 0, then damaged
|
||||
* MPEG bitstreams could cause overread and segfault.
|
||||
*/
|
||||
#define AV_INPUT_BUFFER_PADDING_SIZE 64
|
||||
|
||||
/**
|
||||
* Verify checksums embedded in the bitstream (could be of either encoded or
|
||||
* decoded data, depending on the format) and print an error message on mismatch.
|
||||
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
|
||||
* decoder/demuxer returning an error.
|
||||
*/
|
||||
#define AV_EF_CRCCHECK (1<<0)
|
||||
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
|
||||
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
|
||||
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
|
||||
|
||||
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
|
||||
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
|
||||
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
|
||||
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error
|
||||
|
||||
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
|
||||
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
|
||||
#define FF_COMPLIANCE_NORMAL 0
|
||||
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
|
||||
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
|
||||
|
||||
|
||||
#define AV_PROFILE_UNKNOWN -99
|
||||
#define AV_PROFILE_RESERVED -100
|
||||
|
||||
#define AV_PROFILE_AAC_MAIN 0
|
||||
#define AV_PROFILE_AAC_LOW 1
|
||||
#define AV_PROFILE_AAC_SSR 2
|
||||
#define AV_PROFILE_AAC_LTP 3
|
||||
#define AV_PROFILE_AAC_HE 4
|
||||
#define AV_PROFILE_AAC_HE_V2 28
|
||||
#define AV_PROFILE_AAC_LD 22
|
||||
#define AV_PROFILE_AAC_ELD 38
|
||||
#define AV_PROFILE_AAC_USAC 41
|
||||
#define AV_PROFILE_MPEG2_AAC_LOW 128
|
||||
#define AV_PROFILE_MPEG2_AAC_HE 131
|
||||
|
||||
#define AV_PROFILE_DNXHD 0
|
||||
#define AV_PROFILE_DNXHR_LB 1
|
||||
#define AV_PROFILE_DNXHR_SQ 2
|
||||
#define AV_PROFILE_DNXHR_HQ 3
|
||||
#define AV_PROFILE_DNXHR_HQX 4
|
||||
#define AV_PROFILE_DNXHR_444 5
|
||||
|
||||
#define AV_PROFILE_DTS 20
|
||||
#define AV_PROFILE_DTS_ES 30
|
||||
#define AV_PROFILE_DTS_96_24 40
|
||||
#define AV_PROFILE_DTS_HD_HRA 50
|
||||
#define AV_PROFILE_DTS_HD_MA 60
|
||||
#define AV_PROFILE_DTS_EXPRESS 70
|
||||
#define AV_PROFILE_DTS_HD_MA_X 61
|
||||
#define AV_PROFILE_DTS_HD_MA_X_IMAX 62
|
||||
|
||||
#define AV_PROFILE_EAC3_DDP_ATMOS 30
|
||||
|
||||
#define AV_PROFILE_TRUEHD_ATMOS 30
|
||||
|
||||
#define AV_PROFILE_MPEG2_422 0
|
||||
#define AV_PROFILE_MPEG2_HIGH 1
|
||||
#define AV_PROFILE_MPEG2_SS 2
|
||||
#define AV_PROFILE_MPEG2_SNR_SCALABLE 3
|
||||
#define AV_PROFILE_MPEG2_MAIN 4
|
||||
#define AV_PROFILE_MPEG2_SIMPLE 5
|
||||
|
||||
#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
|
||||
#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
|
||||
|
||||
#define AV_PROFILE_H264_BASELINE 66
|
||||
#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED)
|
||||
#define AV_PROFILE_H264_MAIN 77
|
||||
#define AV_PROFILE_H264_EXTENDED 88
|
||||
#define AV_PROFILE_H264_HIGH 100
|
||||
#define AV_PROFILE_H264_HIGH_10 110
|
||||
#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA)
|
||||
#define AV_PROFILE_H264_MULTIVIEW_HIGH 118
|
||||
#define AV_PROFILE_H264_HIGH_422 122
|
||||
#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA)
|
||||
#define AV_PROFILE_H264_STEREO_HIGH 128
|
||||
#define AV_PROFILE_H264_HIGH_444 144
|
||||
#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244
|
||||
#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA)
|
||||
#define AV_PROFILE_H264_CAVLC_444 44
|
||||
|
||||
#define AV_PROFILE_VC1_SIMPLE 0
|
||||
#define AV_PROFILE_VC1_MAIN 1
|
||||
#define AV_PROFILE_VC1_COMPLEX 2
|
||||
#define AV_PROFILE_VC1_ADVANCED 3
|
||||
|
||||
#define AV_PROFILE_MPEG4_SIMPLE 0
|
||||
#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1
|
||||
#define AV_PROFILE_MPEG4_CORE 2
|
||||
#define AV_PROFILE_MPEG4_MAIN 3
|
||||
#define AV_PROFILE_MPEG4_N_BIT 4
|
||||
#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5
|
||||
#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
|
||||
#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
|
||||
#define AV_PROFILE_MPEG4_HYBRID 8
|
||||
#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
|
||||
#define AV_PROFILE_MPEG4_CORE_SCALABLE 10
|
||||
#define AV_PROFILE_MPEG4_ADVANCED_CODING 11
|
||||
#define AV_PROFILE_MPEG4_ADVANCED_CORE 12
|
||||
#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
|
||||
#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14
|
||||
#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15
|
||||
|
||||
#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
|
||||
#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
|
||||
#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
|
||||
#define AV_PROFILE_JPEG2000_DCINEMA_2K 3
|
||||
#define AV_PROFILE_JPEG2000_DCINEMA_4K 4
|
||||
|
||||
#define AV_PROFILE_VP9_0 0
|
||||
#define AV_PROFILE_VP9_1 1
|
||||
#define AV_PROFILE_VP9_2 2
|
||||
#define AV_PROFILE_VP9_3 3
|
||||
|
||||
#define AV_PROFILE_HEVC_MAIN 1
|
||||
#define AV_PROFILE_HEVC_MAIN_10 2
|
||||
#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3
|
||||
#define AV_PROFILE_HEVC_REXT 4
|
||||
#define AV_PROFILE_HEVC_MULTIVIEW_MAIN 6
|
||||
#define AV_PROFILE_HEVC_SCC 9
|
||||
|
||||
#define AV_PROFILE_VVC_MAIN_10 1
|
||||
#define AV_PROFILE_VVC_MAIN_10_444 33
|
||||
|
||||
#define AV_PROFILE_AV1_MAIN 0
|
||||
#define AV_PROFILE_AV1_HIGH 1
|
||||
#define AV_PROFILE_AV1_PROFESSIONAL 2
|
||||
|
||||
#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
|
||||
#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
|
||||
#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
|
||||
#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
|
||||
#define AV_PROFILE_MJPEG_JPEG_LS 0xf7
|
||||
|
||||
#define AV_PROFILE_SBC_MSBC 1
|
||||
|
||||
#define AV_PROFILE_PRORES_PROXY 0
|
||||
#define AV_PROFILE_PRORES_LT 1
|
||||
#define AV_PROFILE_PRORES_STANDARD 2
|
||||
#define AV_PROFILE_PRORES_HQ 3
|
||||
#define AV_PROFILE_PRORES_4444 4
|
||||
#define AV_PROFILE_PRORES_XQ 5
|
||||
|
||||
#define AV_PROFILE_PRORES_RAW 0
|
||||
#define AV_PROFILE_PRORES_RAW_HQ 1
|
||||
|
||||
#define AV_PROFILE_ARIB_PROFILE_A 0
|
||||
#define AV_PROFILE_ARIB_PROFILE_C 1
|
||||
|
||||
#define AV_PROFILE_KLVA_SYNC 0
|
||||
#define AV_PROFILE_KLVA_ASYNC 1
|
||||
|
||||
#define AV_PROFILE_EVC_BASELINE 0
|
||||
#define AV_PROFILE_EVC_MAIN 1
|
||||
|
||||
#define AV_PROFILE_APV_422_10 33
|
||||
#define AV_PROFILE_APV_422_12 44
|
||||
#define AV_PROFILE_APV_444_10 55
|
||||
#define AV_PROFILE_APV_444_12 66
|
||||
#define AV_PROFILE_APV_4444_10 77
|
||||
#define AV_PROFILE_APV_4444_12 88
|
||||
#define AV_PROFILE_APV_400_10 99
|
||||
|
||||
|
||||
#define AV_LEVEL_UNKNOWN -99
|
||||
|
||||
enum AVFieldOrder {
|
||||
AV_FIELD_UNKNOWN,
|
||||
AV_FIELD_PROGRESSIVE,
|
||||
AV_FIELD_TT, ///< Top coded_first, top displayed first
|
||||
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
|
||||
AV_FIELD_TB, ///< Top coded first, bottom displayed first
|
||||
AV_FIELD_BT, ///< Bottom coded first, top displayed first
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding
|
||||
*/
|
||||
enum AVDiscard{
|
||||
/* We leave some space between them for extensions (drop some
|
||||
* keyframes for intra-only or drop just some bidir frames). */
|
||||
AVDISCARD_NONE =-16, ///< discard nothing
|
||||
AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
|
||||
AVDISCARD_NONREF = 8, ///< discard all non reference
|
||||
AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
|
||||
AVDISCARD_NONINTRA= 24, ///< discard all non intra frames
|
||||
AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
|
||||
AVDISCARD_ALL = 48, ///< discard all
|
||||
};
|
||||
|
||||
enum AVAudioServiceType {
|
||||
AV_AUDIO_SERVICE_TYPE_MAIN = 0,
|
||||
AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
|
||||
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
|
||||
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
|
||||
AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
|
||||
AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
|
||||
AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
|
||||
AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
|
||||
AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
|
||||
AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
|
||||
};
|
||||
|
||||
/**
|
||||
* Pan Scan area.
|
||||
* This specifies the area which should be displayed.
|
||||
* Note there may be multiple such areas for one frame.
|
||||
*/
|
||||
typedef struct AVPanScan {
|
||||
/**
|
||||
* id
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int id;
|
||||
|
||||
/**
|
||||
* width and height in 1/16 pel
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int width;
|
||||
int height;
|
||||
|
||||
/**
|
||||
* position of the top left corner in 1/16 pel for up to 3 fields/frames
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int16_t position[3][2];
|
||||
} AVPanScan;
|
||||
|
||||
/**
|
||||
* This structure describes the bitrate properties of an encoded bitstream. It
|
||||
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
|
||||
* parameters for H.264/HEVC.
|
||||
*/
|
||||
typedef struct AVCPBProperties {
|
||||
/**
|
||||
* Maximum bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t max_bitrate;
|
||||
/**
|
||||
* Minimum bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t min_bitrate;
|
||||
/**
|
||||
* Average bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t avg_bitrate;
|
||||
|
||||
/**
|
||||
* The size of the buffer to which the ratecontrol is applied, in bits.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t buffer_size;
|
||||
|
||||
/**
|
||||
* The delay between the time the packet this structure is associated with
|
||||
* is received and the time when it should be decoded, in periods of a 27MHz
|
||||
* clock.
|
||||
*
|
||||
* UINT64_MAX when unknown or unspecified.
|
||||
*/
|
||||
uint64_t vbv_delay;
|
||||
} AVCPBProperties;
|
||||
|
||||
/**
|
||||
* Allocate a CPB properties structure and initialize its fields to default
|
||||
* values.
|
||||
*
|
||||
* @param size if non-NULL, the size of the allocated struct will be written
|
||||
* here. This is useful for embedding it in side data.
|
||||
*
|
||||
* @return the newly allocated struct or NULL on failure
|
||||
*/
|
||||
AVCPBProperties *av_cpb_properties_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* This structure supplies correlation between a packet timestamp and a wall clock
|
||||
* production time. The definition follows the Producer Reference Time ('prft')
|
||||
* as defined in ISO/IEC 14496-12
|
||||
*/
|
||||
typedef struct AVProducerReferenceTime {
|
||||
/**
|
||||
* A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
|
||||
*/
|
||||
int64_t wallclock;
|
||||
int flags;
|
||||
} AVProducerReferenceTime;
|
||||
|
||||
/**
|
||||
* RTCP SR (Sender Report) information
|
||||
*
|
||||
* The received sender report information for an RTSP
|
||||
* stream, exposed as AV_PKT_DATA_RTCP_SR side data.
|
||||
*/
|
||||
typedef struct AVRTCPSenderReport {
|
||||
uint32_t ssrc; ///< Synchronization source identifier
|
||||
uint64_t ntp_timestamp; ///< NTP time when the report was sent
|
||||
uint32_t rtp_timestamp; ///< RTP time when the report was sent
|
||||
uint32_t sender_nb_packets; ///< Total number of packets sent
|
||||
uint32_t sender_nb_bytes; ///< Total number of bytes sent (excluding headers or padding)
|
||||
} AVRTCPSenderReport;
|
||||
|
||||
/**
|
||||
* Encode extradata length to a buffer. Used by xiph codecs.
|
||||
*
|
||||
* @param s buffer to write to; must be at least (v/255+1) bytes long
|
||||
* @param v size of extradata in bytes
|
||||
* @return number of bytes written to the buffer.
|
||||
*/
|
||||
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
||||
|
||||
#endif // AVCODEC_DEFS_H
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright (C) 2007 Marco Gerards <marco@gnu.org>
|
||||
* Copyright (C) 2009 David Conrad
|
||||
* Copyright (C) 2011 Jordi Ortiz
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_DIRAC_H
|
||||
#define AVCODEC_DIRAC_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Interface to Dirac Decoder/Encoder
|
||||
* @author Marco Gerards <marco@gnu.org>
|
||||
* @author David Conrad
|
||||
* @author Jordi Ortiz
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
|
||||
/**
|
||||
* The spec limits the number of wavelet decompositions to 4 for both
|
||||
* level 1 (VC-2) and 128 (long-gop default).
|
||||
* 5 decompositions is the maximum before >16-bit buffers are needed.
|
||||
* Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting
|
||||
* the others to 4 decompositions (or 3 for the fidelity filter).
|
||||
*
|
||||
* We use this instead of MAX_DECOMPOSITIONS to save some memory.
|
||||
*/
|
||||
#define MAX_DWT_LEVELS 5
|
||||
|
||||
/**
|
||||
* Parse code values:
|
||||
*
|
||||
* Dirac Specification ->
|
||||
* 9.6.1 Table 9.1
|
||||
*
|
||||
* VC-2 Specification ->
|
||||
* 10.4.1 Table 10.1
|
||||
*/
|
||||
|
||||
enum DiracParseCodes {
|
||||
DIRAC_PCODE_SEQ_HEADER = 0x00,
|
||||
DIRAC_PCODE_END_SEQ = 0x10,
|
||||
DIRAC_PCODE_AUX = 0x20,
|
||||
DIRAC_PCODE_PAD = 0x30,
|
||||
DIRAC_PCODE_PICTURE_CODED = 0x08,
|
||||
DIRAC_PCODE_PICTURE_RAW = 0x48,
|
||||
DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8,
|
||||
DIRAC_PCODE_PICTURE_HQ = 0xE8,
|
||||
DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A,
|
||||
DIRAC_PCODE_INTER_NOREF_CO2 = 0x09,
|
||||
DIRAC_PCODE_INTER_REF_CO1 = 0x0D,
|
||||
DIRAC_PCODE_INTER_REF_CO2 = 0x0E,
|
||||
DIRAC_PCODE_INTRA_REF_CO = 0x0C,
|
||||
DIRAC_PCODE_INTRA_REF_RAW = 0x4C,
|
||||
DIRAC_PCODE_INTRA_REF_PICT = 0xCC,
|
||||
DIRAC_PCODE_MAGIC = 0x42424344,
|
||||
};
|
||||
|
||||
typedef struct DiracVersionInfo {
|
||||
int major;
|
||||
int minor;
|
||||
} DiracVersionInfo;
|
||||
|
||||
typedef struct AVDiracSeqHeader {
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
uint8_t chroma_format; ///< 0: 444 1: 422 2: 420
|
||||
|
||||
uint8_t interlaced;
|
||||
uint8_t top_field_first;
|
||||
|
||||
uint8_t frame_rate_index; ///< index into dirac_frame_rate[]
|
||||
uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[]
|
||||
|
||||
uint16_t clean_width;
|
||||
uint16_t clean_height;
|
||||
uint16_t clean_left_offset;
|
||||
uint16_t clean_right_offset;
|
||||
|
||||
uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[]
|
||||
uint8_t color_spec_index; ///< index into dirac_color_spec_presets[]
|
||||
|
||||
int profile;
|
||||
int level;
|
||||
|
||||
AVRational framerate;
|
||||
AVRational sample_aspect_ratio;
|
||||
|
||||
enum AVPixelFormat pix_fmt;
|
||||
enum AVColorRange color_range;
|
||||
enum AVColorPrimaries color_primaries;
|
||||
enum AVColorTransferCharacteristic color_trc;
|
||||
enum AVColorSpace colorspace;
|
||||
|
||||
DiracVersionInfo version;
|
||||
int bit_depth;
|
||||
} AVDiracSeqHeader;
|
||||
|
||||
/**
|
||||
* Parse a Dirac sequence header.
|
||||
*
|
||||
* @param dsh this function will allocate and fill an AVDiracSeqHeader struct
|
||||
* and write it into this pointer. The caller must free it with
|
||||
* av_free().
|
||||
* @param buf the data buffer
|
||||
* @param buf_size the size of the data buffer in bytes
|
||||
* @param log_ctx if non-NULL, this function will log errors here
|
||||
* @return 0 on success, a negative AVERROR code on failure
|
||||
*/
|
||||
int av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh,
|
||||
const uint8_t *buf, size_t buf_size,
|
||||
void *log_ctx);
|
||||
|
||||
#endif /* AVCODEC_DIRAC_H */
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_DV_PROFILE_H
|
||||
#define AVCODEC_DV_PROFILE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
|
||||
/* minimum number of bytes to read from a DV stream in order to
|
||||
* determine the profile */
|
||||
#define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */
|
||||
|
||||
|
||||
/*
|
||||
* AVDVProfile is used to express the differences between various
|
||||
* DV flavors. For now it's primarily used for differentiating
|
||||
* 525/60 and 625/50, but the plans are to use it for various
|
||||
* DV specs as well (e.g. SMPTE314M vs. IEC 61834).
|
||||
*/
|
||||
typedef struct AVDVProfile {
|
||||
int dsf; /* value of the dsf in the DV header */
|
||||
int video_stype; /* stype for VAUX source pack */
|
||||
int frame_size; /* total size of one frame in bytes */
|
||||
int difseg_size; /* number of DIF segments per DIF channel */
|
||||
int n_difchan; /* number of DIF channels per frame */
|
||||
AVRational time_base; /* 1/framerate */
|
||||
int ltc_divisor; /* FPS from the LTS standpoint */
|
||||
int height; /* picture height in pixels */
|
||||
int width; /* picture width in pixels */
|
||||
AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
|
||||
enum AVPixelFormat pix_fmt; /* picture pixel format */
|
||||
int bpm; /* blocks per macroblock */
|
||||
const uint8_t *block_sizes; /* AC block sizes, in bits */
|
||||
int audio_stride; /* size of audio_shuffle table */
|
||||
int audio_min_samples[3]; /* min amount of audio samples */
|
||||
/* for 48kHz, 44.1kHz and 32kHz */
|
||||
int audio_samples_dist[5]; /* how many samples are supposed to be */
|
||||
/* in each frame in a 5 frames window */
|
||||
const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
|
||||
} AVDVProfile;
|
||||
|
||||
/**
|
||||
* Get a DV profile for the provided compressed frame.
|
||||
*
|
||||
* @param sys the profile used for the previous frame, may be NULL
|
||||
* @param frame the compressed data buffer
|
||||
* @param buf_size size of the buffer in bytes
|
||||
* @return the DV profile for the supplied data or NULL on failure
|
||||
*/
|
||||
const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
|
||||
const uint8_t *frame, unsigned buf_size);
|
||||
|
||||
/**
|
||||
* Get a DV profile for the provided stream parameters.
|
||||
*/
|
||||
const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Get a DV profile for the provided stream parameters.
|
||||
* The frame rate is used as a best-effort parameter.
|
||||
*/
|
||||
const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate);
|
||||
|
||||
#endif /* AVCODEC_DV_PROFILE_H */
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* DXVA2 HW acceleration
|
||||
*
|
||||
* copyright (c) 2009 Laurent Aimar
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_DXVA2_H
|
||||
#define AVCODEC_DXVA2_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_dxva2
|
||||
* Public libavcodec DXVA2 header.
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0602
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <d3d9.h>
|
||||
#include <dxva2api.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_dxva2 DXVA2
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This structure is used to provides the necessary configurations and data
|
||||
* to the DXVA2 FFmpeg HWAccel implementation.
|
||||
*
|
||||
* The application must make it available as AVCodecContext.hwaccel_context.
|
||||
*/
|
||||
struct dxva_context {
|
||||
/**
|
||||
* DXVA2 decoder object
|
||||
*/
|
||||
IDirectXVideoDecoder *decoder;
|
||||
|
||||
/**
|
||||
* DXVA2 configuration used to create the decoder
|
||||
*/
|
||||
const DXVA2_ConfigPictureDecode *cfg;
|
||||
|
||||
/**
|
||||
* The number of surface in the surface array
|
||||
*/
|
||||
unsigned surface_count;
|
||||
|
||||
/**
|
||||
* The array of Direct3D surfaces used to create the decoder
|
||||
*/
|
||||
LPDIRECT3DSURFACE9 *surface;
|
||||
|
||||
/**
|
||||
* A bit field configuring the workarounds needed for using the decoder
|
||||
*/
|
||||
uint64_t workaround;
|
||||
|
||||
/**
|
||||
* Private to the FFmpeg AVHWAccel implementation
|
||||
*/
|
||||
unsigned report_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVCODEC_DXVA2_H */
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
/*
|
||||
* EXIF metadata parser
|
||||
* Copyright (c) 2013 Thilo Borgmann <thilo.borgmann _at_ mail.de>
|
||||
* Copyright (c) 2024-2025 Leo Izen <leo.izen@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* EXIF metadata parser
|
||||
* @author Thilo Borgmann <thilo.borgmann _at_ mail.de>
|
||||
* @author Leo Izen <leo.izen@gmail.com>
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_EXIF_H
|
||||
#define AVCODEC_EXIF_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/buffer.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "version_major.h"
|
||||
|
||||
/** Data type identifiers for TIFF tags */
|
||||
enum AVTiffDataType {
|
||||
AV_TIFF_BYTE = 1,
|
||||
AV_TIFF_STRING,
|
||||
AV_TIFF_SHORT,
|
||||
AV_TIFF_LONG,
|
||||
AV_TIFF_RATIONAL,
|
||||
AV_TIFF_SBYTE,
|
||||
AV_TIFF_UNDEFINED,
|
||||
AV_TIFF_SSHORT,
|
||||
AV_TIFF_SLONG,
|
||||
AV_TIFF_SRATIONAL,
|
||||
AV_TIFF_FLOAT,
|
||||
AV_TIFF_DOUBLE,
|
||||
AV_TIFF_IFD,
|
||||
};
|
||||
|
||||
enum AVExifHeaderMode {
|
||||
/**
|
||||
* The TIFF header starts with 0x49492a00, or 0x4d4d002a.
|
||||
* This one is used internally by FFmpeg.
|
||||
*/
|
||||
AV_EXIF_TIFF_HEADER,
|
||||
/** skip the TIFF header, assume little endian */
|
||||
AV_EXIF_ASSUME_LE,
|
||||
/** skip the TIFF header, assume big endian */
|
||||
AV_EXIF_ASSUME_BE,
|
||||
/** The first four bytes point to the actual start, then it's AV_EXIF_TIFF_HEADER */
|
||||
AV_EXIF_T_OFF,
|
||||
/** The first six bytes contain "Exif\0\0", then it's AV_EXIF_TIFF_HEADER */
|
||||
AV_EXIF_EXIF00,
|
||||
};
|
||||
|
||||
typedef struct AVExifEntry AVExifEntry;
|
||||
|
||||
typedef struct AVExifMetadata {
|
||||
/* array of EXIF metadata entries */
|
||||
AVExifEntry *entries;
|
||||
/* number of entries in this array */
|
||||
unsigned int count;
|
||||
/* size of the buffer, used for av_fast_realloc */
|
||||
unsigned int size;
|
||||
} AVExifMetadata;
|
||||
|
||||
struct AVExifEntry {
|
||||
uint16_t id;
|
||||
enum AVTiffDataType type;
|
||||
uint32_t count;
|
||||
|
||||
/*
|
||||
* These are for IFD-style MakerNote
|
||||
* entries which occur after a fixed
|
||||
* offset rather than at the start of
|
||||
* the entry. The ifd_lead field contains
|
||||
* the leading bytes which typically
|
||||
* identify the type of MakerNote.
|
||||
*/
|
||||
uint32_t ifd_offset;
|
||||
uint8_t *ifd_lead;
|
||||
|
||||
/*
|
||||
* An array of entries of size count
|
||||
* Unless it's an IFD, in which case
|
||||
* it's not an array and count = 1
|
||||
*/
|
||||
union {
|
||||
void *ptr;
|
||||
int64_t *sint;
|
||||
uint64_t *uint;
|
||||
double *dbl;
|
||||
char *str;
|
||||
uint8_t *ubytes;
|
||||
int8_t *sbytes;
|
||||
AVRational *rat;
|
||||
AVExifMetadata ifd;
|
||||
} value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the tag name associated with the provided tag ID.
|
||||
* If the tag ID is unknown, NULL is returned.
|
||||
*
|
||||
* For example, av_exif_get_tag_name(0x112) returns "Orientation".
|
||||
*/
|
||||
const char *av_exif_get_tag_name(uint16_t id);
|
||||
|
||||
/**
|
||||
* Retrieves the tag ID associated with the provided tag string name.
|
||||
* If the tag name is unknown, a negative number is returned. Otherwise
|
||||
* it always fits inside a uint16_t integer.
|
||||
*
|
||||
* For example, av_exif_get_tag_id("Orientation") returns 274 (0x0112).
|
||||
*/
|
||||
int32_t av_exif_get_tag_id(const char *name);
|
||||
|
||||
/**
|
||||
* Add an entry to the provided EXIF metadata struct. If one already exists with the provided
|
||||
* ID, it will set the existing one to have the other information provided. Otherwise, it
|
||||
* will allocate a new entry.
|
||||
*
|
||||
* This function reallocates ifd->entries using av_realloc and allocates (using av_malloc)
|
||||
* a new value member of the entry, then copies the contents of value into that buffer.
|
||||
*/
|
||||
int av_exif_set_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, enum AVTiffDataType type,
|
||||
uint32_t count, const uint8_t *ifd_lead, uint32_t ifd_offset, const void *value);
|
||||
|
||||
/**
|
||||
* Also check subdirectories.
|
||||
*/
|
||||
#define AV_EXIF_FLAG_RECURSIVE (1 << 0)
|
||||
|
||||
/**
|
||||
* Get an entry with the tagged ID from the EXIF metadata struct. A pointer to the entry
|
||||
* will be written into *value.
|
||||
*
|
||||
* If the entry was present and returned successfully, a positive number is returned.
|
||||
* If the entry was not found, *value is left untouched and zero is returned.
|
||||
* If an error occurred, a negative number is returned.
|
||||
*/
|
||||
int av_exif_get_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags, AVExifEntry **value);
|
||||
|
||||
/**
|
||||
* Remove an entry from the provided EXIF metadata struct.
|
||||
*
|
||||
* If the entry was present and removed successfully, a positive number is returned.
|
||||
* If the entry was not found, zero is returned.
|
||||
* If an error occurred, a negative number is returned.
|
||||
*/
|
||||
int av_exif_remove_entry(void *logctx, AVExifMetadata *ifd, uint16_t id, int flags);
|
||||
|
||||
/**
|
||||
* Decodes the EXIF data provided in the buffer and writes it into the
|
||||
* struct *ifd. If this function succeeds, the IFD is owned by the caller
|
||||
* and must be cleared after use by calling av_exif_free(); If this function
|
||||
* fails and returns a negative value, it will call av_exif_free(ifd) before
|
||||
* returning.
|
||||
*/
|
||||
int av_exif_parse_buffer(void *logctx, const uint8_t *data, size_t size,
|
||||
AVExifMetadata *ifd, enum AVExifHeaderMode header_mode);
|
||||
|
||||
/**
|
||||
* Allocates a buffer using av_malloc of an appropriate size and writes the
|
||||
* EXIF data represented by ifd into that buffer.
|
||||
*
|
||||
* Upon error, *buffer will be NULL. The buffer becomes owned by the caller upon
|
||||
* success. The *buffer argument must be NULL before calling.
|
||||
*/
|
||||
int av_exif_write(void *logctx, const AVExifMetadata *ifd, AVBufferRef **buffer, enum AVExifHeaderMode header_mode);
|
||||
|
||||
/**
|
||||
* Frees all resources associated with the given EXIF metadata struct.
|
||||
* Does not free the pointer passed itself, in case it is stack-allocated.
|
||||
* The pointer passed to this function must be freed by the caller,
|
||||
* if it is heap-allocated. Passing NULL is permitted.
|
||||
*/
|
||||
void av_exif_free(AVExifMetadata *ifd);
|
||||
|
||||
/**
|
||||
* Recursively reads all tags from the IFD and stores them in the
|
||||
* provided metadata dictionary.
|
||||
*/
|
||||
int av_exif_ifd_to_dict(void *logctx, const AVExifMetadata *ifd, AVDictionary **metadata);
|
||||
|
||||
/**
|
||||
* Allocates a duplicate of the provided EXIF metadata struct. The caller owns
|
||||
* the duplicate and must free it with av_exif_free. Returns NULL if the duplication
|
||||
* process failed.
|
||||
*/
|
||||
AVExifMetadata *av_exif_clone_ifd(const AVExifMetadata *ifd);
|
||||
|
||||
/**
|
||||
* Convert a display matrix used by AV_FRAME_DATA_DISPLAYMATRIX
|
||||
* into an orientation constant used by EXIF's orientation tag.
|
||||
*
|
||||
* Returns an EXIF orientation between 1 and 8 (inclusive) depending
|
||||
* on the rotation and flip factors. Returns 0 if the matrix is singular.
|
||||
*/
|
||||
int av_exif_matrix_to_orientation(const int32_t *matrix);
|
||||
|
||||
/**
|
||||
* Convert an orientation constant used by EXIF's orientation tag
|
||||
* into a display matrix used by AV_FRAME_DATA_DISPLAYMATRIX.
|
||||
*
|
||||
* Returns 0 on success and negative if the orientation is invalid,
|
||||
* i.e. not between 1 and 8 (inclusive).
|
||||
*/
|
||||
int av_exif_orientation_to_matrix(int32_t *matrix, int orientation);
|
||||
|
||||
#endif /* AVCODEC_EXIF_H */
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* JNI public API functions
|
||||
*
|
||||
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_JNI_H
|
||||
#define AVCODEC_JNI_H
|
||||
|
||||
/*
|
||||
* Manually set a Java virtual machine which will be used to retrieve the JNI
|
||||
* environment. Once a Java VM is set it cannot be changed afterwards, meaning
|
||||
* you can call multiple times av_jni_set_java_vm with the same Java VM pointer
|
||||
* however it will error out if you try to set a different Java VM.
|
||||
*
|
||||
* @param vm Java virtual machine
|
||||
* @param log_ctx context used for logging, can be NULL
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*/
|
||||
int av_jni_set_java_vm(void *vm, void *log_ctx);
|
||||
|
||||
/*
|
||||
* Get the Java virtual machine which has been set with av_jni_set_java_vm.
|
||||
*
|
||||
* @param vm Java virtual machine
|
||||
* @return a pointer to the Java virtual machine
|
||||
*/
|
||||
void *av_jni_get_java_vm(void *log_ctx);
|
||||
|
||||
/*
|
||||
* Set the Android application context which will be used to retrieve the Android
|
||||
* content resolver to handle content uris.
|
||||
*
|
||||
* This function is only available on Android.
|
||||
*
|
||||
* @param app_ctx global JNI reference to the Android application context
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*/
|
||||
int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx);
|
||||
|
||||
/*
|
||||
* Get the Android application context that has been set with
|
||||
* av_jni_set_android_app_ctx.
|
||||
*
|
||||
* This function is only available on Android.
|
||||
*
|
||||
* @return a pointer the the Android application context
|
||||
*/
|
||||
void *av_jni_get_android_app_ctx(void);
|
||||
|
||||
#endif /* AVCODEC_JNI_H */
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Android MediaCodec public API
|
||||
*
|
||||
* Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_MEDIACODEC_H
|
||||
#define AVCODEC_MEDIACODEC_H
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
/**
|
||||
* This structure holds a reference to a android/view/Surface object that will
|
||||
* be used as output by the decoder.
|
||||
*
|
||||
*/
|
||||
typedef struct AVMediaCodecContext {
|
||||
|
||||
/**
|
||||
* android/view/Surface object reference.
|
||||
*/
|
||||
void *surface;
|
||||
|
||||
} AVMediaCodecContext;
|
||||
|
||||
/**
|
||||
* Allocate and initialize a MediaCodec context.
|
||||
*
|
||||
* When decoding with MediaCodec is finished, the caller must free the
|
||||
* MediaCodec context with av_mediacodec_default_free.
|
||||
*
|
||||
* @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise
|
||||
*/
|
||||
AVMediaCodecContext *av_mediacodec_alloc_context(void);
|
||||
|
||||
/**
|
||||
* Convenience function that sets up the MediaCodec context.
|
||||
*
|
||||
* @param avctx codec context
|
||||
* @param ctx MediaCodec context to initialize
|
||||
* @param surface reference to an android/view/Surface
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*/
|
||||
int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface);
|
||||
|
||||
/**
|
||||
* This function must be called to free the MediaCodec context initialized with
|
||||
* av_mediacodec_default_init().
|
||||
*
|
||||
* @param avctx codec context
|
||||
*/
|
||||
void av_mediacodec_default_free(AVCodecContext *avctx);
|
||||
|
||||
/**
|
||||
* Opaque structure representing a MediaCodec buffer to render.
|
||||
*/
|
||||
typedef struct MediaCodecBuffer AVMediaCodecBuffer;
|
||||
|
||||
/**
|
||||
* Release a MediaCodec buffer and render it to the surface that is associated
|
||||
* with the decoder. This function should only be called once on a given
|
||||
* buffer, once released the underlying buffer returns to the codec, thus
|
||||
* subsequent calls to this function will have no effect.
|
||||
*
|
||||
* @param buffer the buffer to render
|
||||
* @param render 1 to release and render the buffer to the surface or 0 to
|
||||
* discard the buffer
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*/
|
||||
int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
|
||||
|
||||
/**
|
||||
* Release a MediaCodec buffer and render it at the given time to the surface
|
||||
* that is associated with the decoder. The timestamp must be within one second
|
||||
* of the current `java/lang/System#nanoTime()` (which is implemented using
|
||||
* `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
|
||||
* of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
|
||||
*
|
||||
* @param buffer the buffer to render
|
||||
* @param time timestamp in nanoseconds of when to render the buffer
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*
|
||||
* [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
|
||||
*/
|
||||
int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);
|
||||
|
||||
#endif /* AVCODEC_MEDIACODEC_H */
|
||||
+943
@@ -0,0 +1,943 @@
|
||||
/*
|
||||
* AVPacket public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_PACKET_H
|
||||
#define AVCODEC_PACKET_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/buffer.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "libavcodec/version_major.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavc_packet_side_data AVPacketSideData
|
||||
*
|
||||
* Types and functions for working with AVPacketSideData.
|
||||
* @{
|
||||
*/
|
||||
enum AVPacketSideDataType {
|
||||
/**
|
||||
* An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE
|
||||
* bytes worth of palette. This side data signals that a new palette is
|
||||
* present.
|
||||
*/
|
||||
AV_PKT_DATA_PALETTE,
|
||||
|
||||
/**
|
||||
* The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format
|
||||
* that the extradata buffer was changed and the receiving side should
|
||||
* act upon it appropriately. The new extradata is embedded in the side
|
||||
* data buffer and should be immediately used for processing the current
|
||||
* frame or packet.
|
||||
*/
|
||||
AV_PKT_DATA_NEW_EXTRADATA,
|
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
|
||||
* @code
|
||||
* u32le param_flags
|
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
|
||||
* s32le sample_rate
|
||||
* if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
|
||||
* s32le width
|
||||
* s32le height
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_PARAM_CHANGE,
|
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
|
||||
* structures with info about macroblocks relevant to splitting the
|
||||
* packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
|
||||
* That is, it does not necessarily contain info about all macroblocks,
|
||||
* as long as the distance between macroblocks in the info is smaller
|
||||
* than the target payload size.
|
||||
* Each MB info structure is 12 bytes, and is laid out as follows:
|
||||
* @code
|
||||
* u32le bit offset from the start of the packet
|
||||
* u8 current quantizer at the start of the macroblock
|
||||
* u8 GOB number
|
||||
* u16le macroblock address within the GOB
|
||||
* u8 horizontal MV predictor
|
||||
* u8 vertical MV predictor
|
||||
* u8 horizontal MV predictor for block number 3
|
||||
* u8 vertical MV predictor for block number 3
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_H263_MB_INFO,
|
||||
|
||||
/**
|
||||
* This side data should be associated with an audio stream and contains
|
||||
* ReplayGain information in form of the AVReplayGain struct.
|
||||
*/
|
||||
AV_PKT_DATA_REPLAYGAIN,
|
||||
|
||||
/**
|
||||
* This side data contains a 3x3 transformation matrix describing an affine
|
||||
* transformation that needs to be applied to the decoded video frames for
|
||||
* correct presentation.
|
||||
*
|
||||
* See libavutil/display.h for a detailed description of the data.
|
||||
*/
|
||||
AV_PKT_DATA_DISPLAYMATRIX,
|
||||
|
||||
/**
|
||||
* This side data should be associated with a video stream and contains
|
||||
* Stereoscopic 3D information in form of the AVStereo3D struct.
|
||||
*/
|
||||
AV_PKT_DATA_STEREO3D,
|
||||
|
||||
/**
|
||||
* This side data should be associated with an audio stream and corresponds
|
||||
* to enum AVAudioServiceType.
|
||||
*/
|
||||
AV_PKT_DATA_AUDIO_SERVICE_TYPE,
|
||||
|
||||
/**
|
||||
* This side data contains quality related information from the encoder.
|
||||
* @code
|
||||
* u32le quality factor of the compressed frame. Allowed range is between 1 (good) and FF_LAMBDA_MAX (bad).
|
||||
* u8 picture type
|
||||
* u8 error count
|
||||
* u16 reserved
|
||||
* u64le[error count] sum of squared differences between encoder in and output
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_QUALITY_STATS,
|
||||
|
||||
/**
|
||||
* This side data contains an integer value representing the stream index
|
||||
* of a "fallback" track. A fallback track indicates an alternate
|
||||
* track to use when the current track can not be decoded for some reason.
|
||||
* e.g. no decoder available for codec.
|
||||
*/
|
||||
AV_PKT_DATA_FALLBACK_TRACK,
|
||||
|
||||
/**
|
||||
* This side data corresponds to the AVCPBProperties struct.
|
||||
*/
|
||||
AV_PKT_DATA_CPB_PROPERTIES,
|
||||
|
||||
/**
|
||||
* Recommends skipping the specified number of samples
|
||||
* @code
|
||||
* u32le number of samples to skip from start of this packet
|
||||
* u32le number of samples to skip from end of this packet
|
||||
* u8 reason for start skip
|
||||
* u8 reason for end skip (0=padding silence, 1=convergence)
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_SKIP_SAMPLES,
|
||||
|
||||
/**
|
||||
* An AV_PKT_DATA_JP_DUALMONO side data packet indicates that
|
||||
* the packet may contain "dual mono" audio specific to Japanese DTV
|
||||
* and if it is true, recommends only the selected channel to be used.
|
||||
* @code
|
||||
* u8 selected channels (0=main/left, 1=sub/right, 2=both)
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_JP_DUALMONO,
|
||||
|
||||
/**
|
||||
* A list of zero terminated key/value strings. There is no end marker for
|
||||
* the list, so it is required to rely on the side data size to stop.
|
||||
*/
|
||||
AV_PKT_DATA_STRINGS_METADATA,
|
||||
|
||||
/**
|
||||
* Subtitle event position
|
||||
* @code
|
||||
* u32le x1
|
||||
* u32le y1
|
||||
* u32le x2
|
||||
* u32le y2
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_SUBTITLE_POSITION,
|
||||
|
||||
/**
|
||||
* Data found in BlockAdditional element of matroska container. There is
|
||||
* no end marker for the data, so it is required to rely on the side data
|
||||
* size to recognize the end. 8 byte id (as found in BlockAddId) followed
|
||||
* by data.
|
||||
*/
|
||||
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
|
||||
|
||||
/**
|
||||
* The optional first identifier line of a WebVTT cue.
|
||||
*/
|
||||
AV_PKT_DATA_WEBVTT_IDENTIFIER,
|
||||
|
||||
/**
|
||||
* The optional settings (rendering instructions) that immediately
|
||||
* follow the timestamp specifier of a WebVTT cue.
|
||||
*/
|
||||
AV_PKT_DATA_WEBVTT_SETTINGS,
|
||||
|
||||
/**
|
||||
* A list of zero terminated key/value strings. There is no end marker for
|
||||
* the list, so it is required to rely on the side data size to stop. This
|
||||
* side data includes updated metadata which appeared in the stream.
|
||||
*/
|
||||
AV_PKT_DATA_METADATA_UPDATE,
|
||||
|
||||
/**
|
||||
* MPEGTS stream ID as uint8_t, this is required to pass the stream ID
|
||||
* information from the demuxer to the corresponding muxer.
|
||||
*/
|
||||
AV_PKT_DATA_MPEGTS_STREAM_ID,
|
||||
|
||||
/**
|
||||
* Mastering display metadata (based on SMPTE-2086:2014). This metadata
|
||||
* should be associated with a video stream and contains data in the form
|
||||
* of the AVMasteringDisplayMetadata struct.
|
||||
*/
|
||||
AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
|
||||
|
||||
/**
|
||||
* This side data should be associated with a video stream and corresponds
|
||||
* to the AVSphericalMapping structure.
|
||||
*/
|
||||
AV_PKT_DATA_SPHERICAL,
|
||||
|
||||
/**
|
||||
* Content light level (based on CTA-861.3). This metadata should be
|
||||
* associated with a video stream and contains data in the form of the
|
||||
* AVContentLightMetadata struct.
|
||||
*/
|
||||
AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
|
||||
|
||||
/**
|
||||
* ATSC A53 Part 4 Closed Captions. This metadata should be associated with
|
||||
* a video stream. A53 CC bitstream is stored as uint8_t in AVPacketSideData.data.
|
||||
* The number of bytes of CC data is AVPacketSideData.size.
|
||||
*/
|
||||
AV_PKT_DATA_A53_CC,
|
||||
|
||||
/**
|
||||
* This side data is encryption initialization data.
|
||||
* The format is not part of ABI, use av_encryption_init_info_* methods to
|
||||
* access.
|
||||
*/
|
||||
AV_PKT_DATA_ENCRYPTION_INIT_INFO,
|
||||
|
||||
/**
|
||||
* This side data contains encryption info for how to decrypt the packet.
|
||||
* The format is not part of ABI, use av_encryption_info_* methods to access.
|
||||
*/
|
||||
AV_PKT_DATA_ENCRYPTION_INFO,
|
||||
|
||||
/**
|
||||
* Active Format Description data consisting of a single byte as specified
|
||||
* in ETSI TS 101 154 using AVActiveFormatDescription enum.
|
||||
*/
|
||||
AV_PKT_DATA_AFD,
|
||||
|
||||
/**
|
||||
* Producer Reference Time data corresponding to the AVProducerReferenceTime struct,
|
||||
* usually exported by some encoders (on demand through the prft flag set in the
|
||||
* AVCodecContext export_side_data field).
|
||||
*/
|
||||
AV_PKT_DATA_PRFT,
|
||||
|
||||
/**
|
||||
* ICC profile data consisting of an opaque octet buffer following the
|
||||
* format described by ISO 15076-1.
|
||||
*/
|
||||
AV_PKT_DATA_ICC_PROFILE,
|
||||
|
||||
/**
|
||||
* DOVI configuration
|
||||
* ref:
|
||||
* dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, section 2.2
|
||||
* dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, section 3.3
|
||||
* Tags are stored in struct AVDOVIDecoderConfigurationRecord.
|
||||
*/
|
||||
AV_PKT_DATA_DOVI_CONF,
|
||||
|
||||
/**
|
||||
* Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 4 uint32_t
|
||||
* where the first uint32_t describes how many (1-3) of the other timecodes are used.
|
||||
* The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum()
|
||||
* function in libavutil/timecode.h.
|
||||
*/
|
||||
AV_PKT_DATA_S12M_TIMECODE,
|
||||
|
||||
/**
|
||||
* HDR10+ dynamic metadata associated with a video frame. The metadata is in
|
||||
* the form of the AVDynamicHDRPlus struct and contains
|
||||
* information for color volume transform - application 4 of
|
||||
* SMPTE 2094-40:2016 standard.
|
||||
*/
|
||||
AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
|
||||
|
||||
/**
|
||||
* IAMF Mix Gain Parameter Data associated with the audio frame. This metadata
|
||||
* is in the form of the AVIAMFParamDefinition struct and contains information
|
||||
* defined in sections 3.6.1 and 3.8.1 of the Immersive Audio Model and
|
||||
* Formats standard.
|
||||
*/
|
||||
AV_PKT_DATA_IAMF_MIX_GAIN_PARAM,
|
||||
|
||||
/**
|
||||
* IAMF Demixing Info Parameter Data associated with the audio frame. This
|
||||
* metadata is in the form of the AVIAMFParamDefinition struct and contains
|
||||
* information defined in sections 3.6.1 and 3.8.2 of the Immersive Audio Model
|
||||
* and Formats standard.
|
||||
*/
|
||||
AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM,
|
||||
|
||||
/**
|
||||
* IAMF Recon Gain Info Parameter Data associated with the audio frame. This
|
||||
* metadata is in the form of the AVIAMFParamDefinition struct and contains
|
||||
* information defined in sections 3.6.1 and 3.8.3 of the Immersive Audio Model
|
||||
* and Formats standard.
|
||||
*/
|
||||
AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM,
|
||||
|
||||
/**
|
||||
* Ambient viewing environment metadata, as defined by H.274. This metadata
|
||||
* should be associated with a video stream and contains data in the form
|
||||
* of the AVAmbientViewingEnvironment struct.
|
||||
*/
|
||||
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
|
||||
|
||||
/**
|
||||
* The number of pixels to discard from the top/bottom/left/right border of the
|
||||
* decoded frame to obtain the sub-rectangle intended for presentation.
|
||||
*
|
||||
* @code
|
||||
* u32le crop_top
|
||||
* u32le crop_bottom
|
||||
* u32le crop_left
|
||||
* u32le crop_right
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_FRAME_CROPPING,
|
||||
|
||||
/**
|
||||
* Raw LCEVC payload data, as a uint8_t array, with NAL emulation
|
||||
* bytes intact.
|
||||
*/
|
||||
AV_PKT_DATA_LCEVC,
|
||||
|
||||
/**
|
||||
* This side data contains information about the reference display width(s)
|
||||
* and reference viewing distance(s) as well as information about the
|
||||
* corresponding reference stereo pair(s), i.e., the pair(s) of views to be
|
||||
* displayed for the viewer's left and right eyes on the reference display
|
||||
* at the reference viewing distance.
|
||||
* The payload is the AV3DReferenceDisplaysInfo struct defined in
|
||||
* libavutil/tdrdi.h.
|
||||
*/
|
||||
AV_PKT_DATA_3D_REFERENCE_DISPLAYS,
|
||||
|
||||
/**
|
||||
* Contains the last received RTCP SR (Sender Report) information
|
||||
* in the form of the AVRTCPSenderReport struct.
|
||||
*/
|
||||
AV_PKT_DATA_RTCP_SR,
|
||||
|
||||
/**
|
||||
* Extensible image file format metadata. The payload is a buffer containing
|
||||
* EXIF metadata, starting with either 49 49 2a 00, or 4d 4d 00 2a.
|
||||
*/
|
||||
AV_PKT_DATA_EXIF,
|
||||
|
||||
/**
|
||||
* The number of side data types.
|
||||
* This is not part of the public API/ABI in the sense that it may
|
||||
* change when new side data types are added.
|
||||
* This must stay the last enum value.
|
||||
* If its value becomes huge, some code using it
|
||||
* needs to be updated as it assumes it to be smaller than other limits.
|
||||
*/
|
||||
AV_PKT_DATA_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* This structure stores auxiliary information for decoding, presenting, or
|
||||
* otherwise processing the coded stream. It is typically exported by demuxers
|
||||
* and encoders and can be fed to decoders and muxers either in a per packet
|
||||
* basis, or as global side data (applying to the entire coded stream).
|
||||
*
|
||||
* Global side data is handled as follows:
|
||||
* - During demuxing, it may be exported through
|
||||
* @ref AVCodecParameters.coded_side_data "AVStream's codec parameters", which can
|
||||
* then be passed as input to decoders through the
|
||||
* @ref AVCodecContext.coded_side_data "decoder context's side data", for
|
||||
* initialization.
|
||||
* - For muxing, it can be fed through @ref AVCodecParameters.coded_side_data
|
||||
* "AVStream's codec parameters", typically the output of encoders through
|
||||
* the @ref AVCodecContext.coded_side_data "encoder context's side data", for
|
||||
* initialization.
|
||||
*
|
||||
* Packet specific side data is handled as follows:
|
||||
* - During demuxing, it may be exported through @ref AVPacket.side_data
|
||||
* "AVPacket's side data", which can then be passed as input to decoders.
|
||||
* - For muxing, it can be fed through @ref AVPacket.side_data "AVPacket's
|
||||
* side data", typically the output of encoders.
|
||||
*
|
||||
* Different modules may accept or export different types of side data
|
||||
* depending on media type and codec. Refer to @ref AVPacketSideDataType for a
|
||||
* list of defined types and where they may be found or used.
|
||||
*/
|
||||
typedef struct AVPacketSideData {
|
||||
uint8_t *data;
|
||||
size_t size;
|
||||
enum AVPacketSideDataType type;
|
||||
} AVPacketSideData;
|
||||
|
||||
/**
|
||||
* Allocate a new packet side data.
|
||||
*
|
||||
* @param sd pointer to an array of side data to which the side data should
|
||||
* be added. *sd may be NULL, in which case the array will be
|
||||
* initialized.
|
||||
* @param nb_sd pointer to an integer containing the number of entries in
|
||||
* the array. The integer value will be increased by 1 on success.
|
||||
* @param type side data type
|
||||
* @param size desired side data size
|
||||
* @param flags currently unused. Must be zero
|
||||
*
|
||||
* @return pointer to freshly allocated side data on success, or NULL otherwise.
|
||||
*/
|
||||
AVPacketSideData *av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd,
|
||||
enum AVPacketSideDataType type,
|
||||
size_t size, int flags);
|
||||
|
||||
/**
|
||||
* Wrap existing data as packet side data.
|
||||
*
|
||||
* @param sd pointer to an array of side data to which the side data should
|
||||
* be added. *sd may be NULL, in which case the array will be
|
||||
* initialized
|
||||
* @param nb_sd pointer to an integer containing the number of entries in
|
||||
* the array. The integer value will be increased by 1 on success.
|
||||
* @param type side data type
|
||||
* @param data a data array. It must be allocated with the av_malloc() family
|
||||
* of functions. The ownership of the data is transferred to the
|
||||
* side data array on success
|
||||
* @param size size of the data array
|
||||
* @param flags currently unused. Must be zero
|
||||
*
|
||||
* @return pointer to freshly allocated side data on success, or NULL otherwise
|
||||
* On failure, the side data array is unchanged and the data remains
|
||||
* owned by the caller.
|
||||
*/
|
||||
AVPacketSideData *av_packet_side_data_add(AVPacketSideData **sd, int *nb_sd,
|
||||
enum AVPacketSideDataType type,
|
||||
void *data, size_t size, int flags);
|
||||
|
||||
/**
|
||||
* Get side information from a side data array.
|
||||
*
|
||||
* @param sd the array from which the side data should be fetched
|
||||
* @param nb_sd value containing the number of entries in the array.
|
||||
* @param type desired side information type
|
||||
*
|
||||
* @return pointer to side data if present or NULL otherwise
|
||||
*/
|
||||
const AVPacketSideData *av_packet_side_data_get(const AVPacketSideData *sd,
|
||||
int nb_sd,
|
||||
enum AVPacketSideDataType type);
|
||||
|
||||
/**
|
||||
* Remove side data of the given type from a side data array.
|
||||
*
|
||||
* @param sd the array from which the side data should be removed
|
||||
* @param nb_sd pointer to an integer containing the number of entries in
|
||||
* the array. Will be reduced by the amount of entries removed
|
||||
* upon return
|
||||
* @param type side information type
|
||||
*/
|
||||
void av_packet_side_data_remove(AVPacketSideData *sd, int *nb_sd,
|
||||
enum AVPacketSideDataType type);
|
||||
|
||||
/**
|
||||
* Convenience function to free all the side data stored in an array, and
|
||||
* the array itself.
|
||||
*
|
||||
* @param sd pointer to array of side data to free. Will be set to NULL
|
||||
* upon return.
|
||||
* @param nb_sd pointer to an integer containing the number of entries in
|
||||
* the array. Will be set to 0 upon return.
|
||||
*/
|
||||
void av_packet_side_data_free(AVPacketSideData **sd, int *nb_sd);
|
||||
|
||||
struct AVFrameSideData;
|
||||
|
||||
/**
|
||||
* Add a new packet side data entry to an array based on existing frame
|
||||
* side data, if a matching type exists for packet side data.
|
||||
*
|
||||
* @param flags Currently unused. Must be 0.
|
||||
* @retval >= 0 Success
|
||||
* @retval AVERROR(EINVAL) The frame side data type does not have a matching
|
||||
* packet side data type.
|
||||
* @retval AVERROR(ENOMEM) Failed to add a side data entry to the array, or
|
||||
* similar.
|
||||
*/
|
||||
int av_packet_side_data_from_frame(AVPacketSideData **sd, int *nb_sd,
|
||||
const struct AVFrameSideData *src, unsigned int flags);
|
||||
/**
|
||||
* Add a new frame side data entry to an array based on existing packet
|
||||
* side data, if a matching type exists for frame side data.
|
||||
*
|
||||
* @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags,
|
||||
* or 0.
|
||||
* @retval >= 0 Success
|
||||
* @retval AVERROR(EINVAL) The packet side data type does not have a matching
|
||||
* frame side data type.
|
||||
* @retval AVERROR(ENOMEM) Failed to add a side data entry to the array, or
|
||||
* similar.
|
||||
*/
|
||||
int av_packet_side_data_to_frame(struct AVFrameSideData ***sd, int *nb_sd,
|
||||
const AVPacketSideData *src, unsigned int flags);
|
||||
|
||||
const char *av_packet_side_data_name(enum AVPacketSideDataType type);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavc_packet AVPacket
|
||||
*
|
||||
* Types and functions for working with AVPacket.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This structure stores compressed data. It is typically exported by demuxers
|
||||
* and then passed as input to decoders, or received as output from encoders and
|
||||
* then passed to muxers.
|
||||
*
|
||||
* For video, it should typically contain one compressed frame. For audio it may
|
||||
* contain several compressed frames. Encoders are allowed to output empty
|
||||
* packets, with no compressed data, containing only side data
|
||||
* (e.g. to update some stream parameters at the end of encoding).
|
||||
*
|
||||
* The semantics of data ownership depends on the buf field.
|
||||
* If it is set, the packet data is dynamically allocated and is
|
||||
* valid indefinitely until a call to av_packet_unref() reduces the
|
||||
* reference count to 0.
|
||||
*
|
||||
* If the buf field is not set av_packet_ref() would make a copy instead
|
||||
* of increasing the reference count.
|
||||
*
|
||||
* The side data is always allocated with av_malloc(), copied by
|
||||
* av_packet_ref() and freed by av_packet_unref().
|
||||
*
|
||||
* sizeof(AVPacket) being a part of the public ABI is deprecated. once
|
||||
* av_init_packet() is removed, new packets will only be able to be allocated
|
||||
* with av_packet_alloc(), and new fields may be added to the end of the struct
|
||||
* with a minor bump.
|
||||
*
|
||||
* @see av_packet_alloc
|
||||
* @see av_packet_ref
|
||||
* @see av_packet_unref
|
||||
*/
|
||||
typedef struct AVPacket {
|
||||
/**
|
||||
* A reference to the reference-counted buffer where the packet data is
|
||||
* stored.
|
||||
* May be NULL, then the packet data is not reference-counted.
|
||||
*/
|
||||
AVBufferRef *buf;
|
||||
/**
|
||||
* Presentation timestamp in AVStream->time_base units; the time at which
|
||||
* the decompressed packet will be presented to the user.
|
||||
* Can be AV_NOPTS_VALUE if it is not stored in the file.
|
||||
* pts MUST be larger or equal to dts as presentation cannot happen before
|
||||
* decompression, unless one wants to view hex dumps. Some formats misuse
|
||||
* the terms dts and pts/cts to mean something different. Such timestamps
|
||||
* must be converted to true pts/dts before they are stored in AVPacket.
|
||||
*/
|
||||
int64_t pts;
|
||||
/**
|
||||
* Decompression timestamp in AVStream->time_base units; the time at which
|
||||
* the packet is decompressed.
|
||||
* Can be AV_NOPTS_VALUE if it is not stored in the file.
|
||||
*/
|
||||
int64_t dts;
|
||||
uint8_t *data;
|
||||
int size;
|
||||
int stream_index;
|
||||
/**
|
||||
* A combination of AV_PKT_FLAG values
|
||||
*/
|
||||
int flags;
|
||||
/**
|
||||
* Additional packet data that can be provided by the container.
|
||||
* Packet can contain several types of side information.
|
||||
*/
|
||||
AVPacketSideData *side_data;
|
||||
int side_data_elems;
|
||||
|
||||
/**
|
||||
* Duration of this packet in AVStream->time_base units, 0 if unknown.
|
||||
* Equals next_pts - this_pts in presentation order.
|
||||
*/
|
||||
int64_t duration;
|
||||
|
||||
int64_t pos; ///< byte position in stream, -1 if unknown
|
||||
|
||||
/**
|
||||
* for some private data of the user
|
||||
*/
|
||||
void *opaque;
|
||||
|
||||
/**
|
||||
* AVBufferRef for free use by the API user. FFmpeg will never check the
|
||||
* contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when
|
||||
* the packet is unreferenced. av_packet_copy_props() calls create a new
|
||||
* reference with av_buffer_ref() for the target packet's opaque_ref field.
|
||||
*
|
||||
* This is unrelated to the opaque field, although it serves a similar
|
||||
* purpose.
|
||||
*/
|
||||
AVBufferRef *opaque_ref;
|
||||
|
||||
/**
|
||||
* Time base of the packet's timestamps.
|
||||
* In the future, this field may be set on packets output by encoders or
|
||||
* demuxers, but its value will be by default ignored on input to decoders
|
||||
* or muxers.
|
||||
*/
|
||||
AVRational time_base;
|
||||
} AVPacket;
|
||||
|
||||
#if FF_API_INIT_PACKET
|
||||
attribute_deprecated
|
||||
typedef struct AVPacketList {
|
||||
AVPacket pkt;
|
||||
struct AVPacketList *next;
|
||||
} AVPacketList;
|
||||
#endif
|
||||
|
||||
#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
|
||||
#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
|
||||
/**
|
||||
* Flag is used to discard packets which are required to maintain valid
|
||||
* decoder state but are not required for output and should be dropped
|
||||
* after decoding.
|
||||
**/
|
||||
#define AV_PKT_FLAG_DISCARD 0x0004
|
||||
/**
|
||||
* The packet comes from a trusted source.
|
||||
*
|
||||
* Otherwise-unsafe constructs such as arbitrary pointers to data
|
||||
* outside the packet may be followed.
|
||||
*/
|
||||
#define AV_PKT_FLAG_TRUSTED 0x0008
|
||||
/**
|
||||
* Flag is used to indicate packets that contain frames that can
|
||||
* be discarded by the decoder. I.e. Non-reference frames.
|
||||
*/
|
||||
#define AV_PKT_FLAG_DISPOSABLE 0x0010
|
||||
|
||||
enum AVSideDataParamChangeFlags {
|
||||
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
|
||||
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
|
||||
};
|
||||
|
||||
/**
|
||||
* Allocate an AVPacket and set its fields to default values. The resulting
|
||||
* struct must be freed using av_packet_free().
|
||||
*
|
||||
* @return An AVPacket filled with default values or NULL on failure.
|
||||
*
|
||||
* @note this only allocates the AVPacket itself, not the data buffers. Those
|
||||
* must be allocated through other means such as av_new_packet.
|
||||
*
|
||||
* @see av_new_packet
|
||||
*/
|
||||
AVPacket *av_packet_alloc(void);
|
||||
|
||||
/**
|
||||
* Create a new packet that references the same data as src.
|
||||
*
|
||||
* This is a shortcut for av_packet_alloc()+av_packet_ref().
|
||||
*
|
||||
* @return newly created AVPacket on success, NULL on error.
|
||||
*
|
||||
* @see av_packet_alloc
|
||||
* @see av_packet_ref
|
||||
*/
|
||||
AVPacket *av_packet_clone(const AVPacket *src);
|
||||
|
||||
/**
|
||||
* Free the packet, if the packet is reference counted, it will be
|
||||
* unreferenced first.
|
||||
*
|
||||
* @param pkt packet to be freed. The pointer will be set to NULL.
|
||||
* @note passing NULL is a no-op.
|
||||
*/
|
||||
void av_packet_free(AVPacket **pkt);
|
||||
|
||||
#if FF_API_INIT_PACKET
|
||||
/**
|
||||
* Initialize optional fields of a packet with default values.
|
||||
*
|
||||
* Note, this does not touch the data and size members, which have to be
|
||||
* initialized separately.
|
||||
*
|
||||
* @param pkt packet
|
||||
*
|
||||
* @see av_packet_alloc
|
||||
* @see av_packet_unref
|
||||
*
|
||||
* @deprecated This function is deprecated. Once it's removed,
|
||||
sizeof(AVPacket) will not be a part of the ABI anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_init_packet(AVPacket *pkt);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocate the payload of a packet and initialize its fields with
|
||||
* default values.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param size wanted payload size
|
||||
* @return 0 if OK, AVERROR_xxx otherwise
|
||||
*/
|
||||
int av_new_packet(AVPacket *pkt, int size);
|
||||
|
||||
/**
|
||||
* Reduce packet size, correctly zeroing padding
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param size new size
|
||||
*/
|
||||
void av_shrink_packet(AVPacket *pkt, int size);
|
||||
|
||||
/**
|
||||
* Increase packet size, correctly zeroing padding
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param grow_by number of bytes by which to increase the size of the packet
|
||||
*/
|
||||
int av_grow_packet(AVPacket *pkt, int grow_by);
|
||||
|
||||
/**
|
||||
* Initialize a reference-counted packet from av_malloc()ed data.
|
||||
*
|
||||
* @param pkt packet to be initialized. This function will set the data, size,
|
||||
* and buf fields, all others are left untouched.
|
||||
* @param data Data allocated by av_malloc() to be used as packet data. If this
|
||||
* function returns successfully, the data is owned by the underlying AVBuffer.
|
||||
* The caller may not access the data through other means.
|
||||
* @param size size of data in bytes, without the padding. I.e. the full buffer
|
||||
* size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error
|
||||
*/
|
||||
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
|
||||
|
||||
/**
|
||||
* Allocate new information of a packet.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type side information type
|
||||
* @param size side information size
|
||||
* @return pointer to fresh allocated data or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
size_t size);
|
||||
|
||||
/**
|
||||
* Wrap an existing array as a packet side data.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type side information type
|
||||
* @param data the side data array. It must be allocated with the av_malloc()
|
||||
* family of functions. The ownership of the data is transferred to
|
||||
* pkt.
|
||||
* @param size side information size
|
||||
* @return a non-negative number on success, a negative AVERROR code on
|
||||
* failure. On failure, the packet is unchanged and the data remains
|
||||
* owned by the caller.
|
||||
*/
|
||||
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
uint8_t *data, size_t size);
|
||||
|
||||
/**
|
||||
* Shrink the already allocated side data buffer
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type side information type
|
||||
* @param size new side information size
|
||||
* @return 0 on success, < 0 on failure
|
||||
*/
|
||||
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
size_t size);
|
||||
|
||||
/**
|
||||
* Get side information from packet.
|
||||
*
|
||||
* @param pkt packet
|
||||
* @param type desired side information type
|
||||
* @param size If supplied, *size will be set to the size of the side data
|
||||
* or to zero if the desired side data is not present.
|
||||
* @return pointer to data if present or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
size_t *size);
|
||||
|
||||
/**
|
||||
* Pack a dictionary for use in side_data.
|
||||
*
|
||||
* @param dict The dictionary to pack.
|
||||
* @param size pointer to store the size of the returned data
|
||||
* @return pointer to data if successful, NULL otherwise
|
||||
*/
|
||||
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size);
|
||||
/**
|
||||
* Unpack a dictionary from side_data.
|
||||
*
|
||||
* @param data data from side_data
|
||||
* @param size size of the data
|
||||
* @param dict the metadata storage dictionary
|
||||
* @return 0 on success, < 0 on failure
|
||||
*/
|
||||
int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
|
||||
AVDictionary **dict);
|
||||
|
||||
/**
|
||||
* Convenience function to free all the side data stored.
|
||||
* All the other fields stay untouched.
|
||||
*
|
||||
* @param pkt packet
|
||||
*/
|
||||
void av_packet_free_side_data(AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Setup a new reference to the data described by a given packet
|
||||
*
|
||||
* If src is reference-counted, setup dst as a new reference to the
|
||||
* buffer in src. Otherwise allocate a new buffer in dst and copy the
|
||||
* data from src into it.
|
||||
*
|
||||
* All the other fields are copied from src.
|
||||
*
|
||||
* @see av_packet_unref
|
||||
*
|
||||
* @param dst Destination packet. Will be completely overwritten.
|
||||
* @param src Source packet
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error. On error, dst
|
||||
* will be blank (as if returned by av_packet_alloc()).
|
||||
*/
|
||||
int av_packet_ref(AVPacket *dst, const AVPacket *src);
|
||||
|
||||
/**
|
||||
* Wipe the packet.
|
||||
*
|
||||
* Unreference the buffer referenced by the packet and reset the
|
||||
* remaining packet fields to their default values.
|
||||
*
|
||||
* @param pkt The packet to be unreferenced.
|
||||
*/
|
||||
void av_packet_unref(AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Move every field in src to dst and reset src.
|
||||
*
|
||||
* @see av_packet_unref
|
||||
*
|
||||
* @param src Source packet, will be reset
|
||||
* @param dst Destination packet
|
||||
*/
|
||||
void av_packet_move_ref(AVPacket *dst, AVPacket *src);
|
||||
|
||||
/**
|
||||
* Copy only "properties" fields from src to dst.
|
||||
*
|
||||
* Properties for the purpose of this function are all the fields
|
||||
* beside those related to the packet data (buf, data, size)
|
||||
*
|
||||
* @param dst Destination packet
|
||||
* @param src Source packet
|
||||
*
|
||||
* @return 0 on success AVERROR on failure.
|
||||
*/
|
||||
int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
|
||||
|
||||
/**
|
||||
* Ensure the data described by a given packet is reference counted.
|
||||
*
|
||||
* @note This function does not ensure that the reference will be writable.
|
||||
* Use av_packet_make_writable instead for that purpose.
|
||||
*
|
||||
* @see av_packet_ref
|
||||
* @see av_packet_make_writable
|
||||
*
|
||||
* @param pkt packet whose data should be made reference counted.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error. On failure, the
|
||||
* packet is unchanged.
|
||||
*/
|
||||
int av_packet_make_refcounted(AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Create a writable reference for the data described by a given packet,
|
||||
* avoiding data copy if possible.
|
||||
*
|
||||
* @param pkt Packet whose data should be made writable.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on failure. On failure, the
|
||||
* packet is unchanged.
|
||||
*/
|
||||
int av_packet_make_writable(AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Convert valid timing fields (timestamps / durations) in a packet from one
|
||||
* timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be
|
||||
* ignored.
|
||||
*
|
||||
* @param pkt packet on which the conversion will be performed
|
||||
* @param tb_src source timebase, in which the timing fields in pkt are
|
||||
* expressed
|
||||
* @param tb_dst destination timebase, to which the timing fields will be
|
||||
* converted
|
||||
*/
|
||||
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
|
||||
|
||||
/**
|
||||
* Allocate an AVContainerFifo instance for AVPacket.
|
||||
*
|
||||
* @param flags currently unused
|
||||
*/
|
||||
struct AVContainerFifo *av_container_fifo_alloc_avpacket(unsigned flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVCODEC_PACKET_H
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Intel MediaSDK QSV public API
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_QSV_H
|
||||
#define AVCODEC_QSV_H
|
||||
|
||||
#include <mfxvideo.h>
|
||||
|
||||
#include "libavutil/buffer.h"
|
||||
|
||||
/**
|
||||
* This struct is used for communicating QSV parameters between libavcodec and
|
||||
* the caller. It is managed by the caller and must be assigned to
|
||||
* AVCodecContext.hwaccel_context.
|
||||
* - decoding: hwaccel_context must be set on return from the get_format()
|
||||
* callback
|
||||
* - encoding: hwaccel_context must be set before avcodec_open2()
|
||||
*/
|
||||
typedef struct AVQSVContext {
|
||||
/**
|
||||
* If non-NULL, the session to use for encoding or decoding.
|
||||
* Otherwise, libavcodec will try to create an internal session.
|
||||
*/
|
||||
mfxSession session;
|
||||
|
||||
/**
|
||||
* The IO pattern to use.
|
||||
*/
|
||||
int iopattern;
|
||||
|
||||
/**
|
||||
* Extra buffers to pass to encoder or decoder initialization.
|
||||
*/
|
||||
mfxExtBuffer **ext_buffers;
|
||||
int nb_ext_buffers;
|
||||
|
||||
/**
|
||||
* Encoding only. If this field is set to non-zero by the caller, libavcodec
|
||||
* will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to
|
||||
* the encoder initialization. This only makes sense if iopattern is also
|
||||
* set to MFX_IOPATTERN_IN_OPAQUE_MEMORY.
|
||||
*
|
||||
* The number of allocated opaque surfaces will be the sum of the number
|
||||
* required by the encoder and the user-provided value nb_opaque_surfaces.
|
||||
* The array of the opaque surfaces will be exported to the caller through
|
||||
* the opaque_surfaces field.
|
||||
*
|
||||
* The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)
|
||||
*/
|
||||
int opaque_alloc;
|
||||
|
||||
/**
|
||||
* Encoding only, and only if opaque_alloc is set to non-zero. Before
|
||||
* calling avcodec_open2(), the caller should set this field to the number
|
||||
* of extra opaque surfaces to allocate beyond what is required by the
|
||||
* encoder.
|
||||
*
|
||||
* On return from avcodec_open2(), this field will be set by libavcodec to
|
||||
* the total number of allocated opaque surfaces.
|
||||
*/
|
||||
int nb_opaque_surfaces;
|
||||
|
||||
/**
|
||||
* Encoding only, and only if opaque_alloc is set to non-zero. On return
|
||||
* from avcodec_open2(), this field will be used by libavcodec to export the
|
||||
* array of the allocated opaque surfaces to the caller, so they can be
|
||||
* passed to other parts of the pipeline.
|
||||
*
|
||||
* The buffer reference exported here is owned and managed by libavcodec,
|
||||
* the callers should make their own reference with av_buffer_ref() and free
|
||||
* it with av_buffer_unref() when it is no longer needed.
|
||||
*
|
||||
* The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1.
|
||||
*/
|
||||
AVBufferRef *opaque_surfaces;
|
||||
|
||||
/**
|
||||
* Encoding only, and only if opaque_alloc is set to non-zero. On return
|
||||
* from avcodec_open2(), this field will be set to the surface type used in
|
||||
* the opaque allocation request.
|
||||
*/
|
||||
int opaque_alloc_type;
|
||||
} AVQSVContext;
|
||||
|
||||
/**
|
||||
* Allocate a new context.
|
||||
*
|
||||
* It must be freed by the caller with av_free().
|
||||
*/
|
||||
AVQSVContext *av_qsv_alloc_context(void);
|
||||
|
||||
#endif /* AVCODEC_QSV_H */
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
* MXF SMPTE-436M VBI/ANC parsing functions
|
||||
* Copyright (c) 2025 Jacob Lifshay
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_SMPTE_436M_H
|
||||
#define AVCODEC_SMPTE_436M_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Iterator over the ANC packets in a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data
|
||||
*/
|
||||
typedef struct AVSmpte436mAncIterator {
|
||||
uint16_t anc_packets_left;
|
||||
int size_left;
|
||||
const uint8_t *data_left;
|
||||
} AVSmpte436mAncIterator;
|
||||
|
||||
/**
|
||||
* Wrapping Type from Table 7 (page 13) of:
|
||||
* https://pub.smpte.org/latest/st436/s436m-2006.pdf
|
||||
*/
|
||||
typedef enum AVSmpte436mWrappingType
|
||||
{
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_VANC_FRAME = 1,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_VANC_FIELD_1 = 2,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_VANC_FIELD_2 = 3,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_VANC_PROGRESSIVE_FRAME = 4,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_HANC_FRAME = 0x11,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_HANC_FIELD_1 = 0x12,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_HANC_FIELD_2 = 0x13,
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_HANC_PROGRESSIVE_FRAME = 0x14,
|
||||
/** not a real wrapping type, just here to guarantee the enum is big enough */
|
||||
AV_SMPTE_436M_WRAPPING_TYPE_MAX = 0xFF,
|
||||
} AVSmpte436mWrappingType;
|
||||
|
||||
/**
|
||||
* Payload Sample Coding from Table 4 (page 10) and Table 7 (page 13) of:
|
||||
* https://pub.smpte.org/latest/st436/s436m-2006.pdf
|
||||
*/
|
||||
typedef enum AVSmpte436mPayloadSampleCoding
|
||||
{
|
||||
/** only used for VBI */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_1BIT_LUMA = 1,
|
||||
/** only used for VBI */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_1BIT_COLOR_DIFF = 2,
|
||||
/** only used for VBI */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_1BIT_LUMA_AND_COLOR_DIFF = 3,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_LUMA = 4,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_COLOR_DIFF = 5,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_LUMA_AND_COLOR_DIFF = 6,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_10BIT_LUMA = 7,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_10BIT_COLOR_DIFF = 8,
|
||||
/** used for VBI and ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_10BIT_LUMA_AND_COLOR_DIFF = 9,
|
||||
/** only used for ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_LUMA_WITH_PARITY_ERROR = 10,
|
||||
/** only used for ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_COLOR_DIFF_WITH_PARITY_ERROR = 11,
|
||||
/** only used for ANC */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_8BIT_LUMA_AND_COLOR_DIFF_WITH_PARITY_ERROR = 12,
|
||||
/** not a real sample coding, just here to guarantee the enum is big enough */
|
||||
AV_SMPTE_436M_PAYLOAD_SAMPLE_CODING_MAX = 0xFF,
|
||||
} AVSmpte436mPayloadSampleCoding;
|
||||
|
||||
/** the payload capacity of AVSmpte291mAnc8bit (and of AVSmpte291mAnc10bit when that gets added) */
|
||||
#define AV_SMPTE_291M_ANC_PAYLOAD_CAPACITY 0xFF
|
||||
|
||||
/**
|
||||
* An ANC packet with an 8-bit payload.
|
||||
* This can be decoded from AVSmpte436mCodedAnc::payload.
|
||||
*
|
||||
* Note: Some ANC packets need a 10-bit payload, if stored in this struct,
|
||||
* the most-significant 2 bits of each sample are discarded.
|
||||
*/
|
||||
typedef struct AVSmpte291mAnc8bit {
|
||||
uint8_t did;
|
||||
uint8_t sdid_or_dbn;
|
||||
uint8_t data_count;
|
||||
uint8_t payload[AV_SMPTE_291M_ANC_PAYLOAD_CAPACITY];
|
||||
uint8_t checksum;
|
||||
} AVSmpte291mAnc8bit;
|
||||
|
||||
/** max number of samples that can be stored in the payload of AVSmpte436mCodedAnc */
|
||||
#define AV_SMPTE_436M_CODED_ANC_SAMPLE_CAPACITY \
|
||||
(AV_SMPTE_291M_ANC_PAYLOAD_CAPACITY + 4) /* 4 for did, sdid_or_dbn, data_count, and checksum */
|
||||
/** max number of bytes that can be stored in the payload of AVSmpte436mCodedAnc */
|
||||
#define AV_SMPTE_436M_CODED_ANC_PAYLOAD_CAPACITY (((AV_SMPTE_436M_CODED_ANC_SAMPLE_CAPACITY + 2) / 3) * 4)
|
||||
|
||||
/**
|
||||
* An encoded ANC packet within a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
|
||||
* The repeated section of Table 7 (page 13) of:
|
||||
* https://pub.smpte.org/latest/st436/s436m-2006.pdf
|
||||
*/
|
||||
typedef struct AVSmpte436mCodedAnc {
|
||||
uint16_t line_number;
|
||||
AVSmpte436mWrappingType wrapping_type;
|
||||
AVSmpte436mPayloadSampleCoding payload_sample_coding;
|
||||
uint16_t payload_sample_count;
|
||||
uint32_t payload_array_length;
|
||||
/** the payload, has size payload_array_length.
|
||||
* can be decoded into AVSmpte291mAnc8bit
|
||||
*/
|
||||
uint8_t payload[AV_SMPTE_436M_CODED_ANC_PAYLOAD_CAPACITY];
|
||||
} AVSmpte436mCodedAnc;
|
||||
|
||||
/**
|
||||
* Validate a AVSmpte436mCodedAnc structure. Doesn't check if the payload is valid.
|
||||
* @param[in] anc ANC packet to validate
|
||||
* @return 0 on success, AVERROR codes otherwise.
|
||||
*/
|
||||
int av_smpte_436m_coded_anc_validate(const AVSmpte436mCodedAnc *anc);
|
||||
|
||||
/**
|
||||
* Encode ANC packets into a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
|
||||
* @param[in] anc_packet_count number of ANC packets to encode
|
||||
* @param[in] anc_packets the ANC packets to encode
|
||||
* @param[in] size the size of out. ignored if out is NULL.
|
||||
* @param[out] out Output bytes. Doesn't write anything if out is NULL.
|
||||
* @return the number of bytes written on success, AVERROR codes otherwise.
|
||||
* If out is NULL, returns the number of bytes it would have written.
|
||||
*/
|
||||
int av_smpte_436m_anc_encode(uint8_t *out, int size, int anc_packet_count, const AVSmpte436mCodedAnc *anc_packets);
|
||||
|
||||
struct AVPacket;
|
||||
|
||||
/**
|
||||
* Append more ANC packets to a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
|
||||
* @param[in] anc_packet_count number of ANC packets to encode
|
||||
* @param[in] anc_packets the ANC packets to encode
|
||||
* @param pkt the AVPacket to append to.
|
||||
* it must either be size 0 or contain valid SMPTE_436M_ANC data.
|
||||
* @return 0 on success, AVERROR codes otherwise.
|
||||
*/
|
||||
int av_smpte_436m_anc_append(struct AVPacket *pkt, int anc_packet_count, const AVSmpte436mCodedAnc *anc_packets);
|
||||
|
||||
/**
|
||||
* Set up iteration over the ANC packets in a single AV_CODEC_ID_SMPTE_436M_ANC AVPacket's data.
|
||||
* @param[in] buf Pointer to the data from a AV_CODEC_ID_SMPTE_436M_ANC AVPacket.
|
||||
* @param[in] buf_size Size of the data from a AV_CODEC_ID_SMPTE_436M_ANC AVPacket.
|
||||
* @param[out] iter Pointer to the iterator.
|
||||
* @return 0 on success, AVERROR codes otherwise.
|
||||
*/
|
||||
int av_smpte_436m_anc_iter_init(AVSmpte436mAncIterator *iter, const uint8_t *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Get the next ANC packet from the iterator, advancing the iterator.
|
||||
* @param[in,out] iter Pointer to the iterator.
|
||||
* @param[out] anc The returned ANC packet.
|
||||
* @return 0 on success, AVERROR_EOF when the iterator has reached the end, AVERROR codes otherwise.
|
||||
*/
|
||||
int av_smpte_436m_anc_iter_next(AVSmpte436mAncIterator *iter, AVSmpte436mCodedAnc *anc);
|
||||
|
||||
/**
|
||||
* Get the minimum number of bytes needed to store a AVSmpte436mCodedAnc payload.
|
||||
* @param sample_coding the payload sample coding
|
||||
* @param sample_count the number of samples stored in the payload
|
||||
* @return returns the minimum number of bytes needed, on error returns < 0.
|
||||
* always <= SMPTE_436M_CODED_ANC_PAYLOAD_CAPACITY
|
||||
*/
|
||||
int av_smpte_436m_coded_anc_payload_size(AVSmpte436mPayloadSampleCoding sample_coding, uint16_t sample_count);
|
||||
|
||||
/**
|
||||
* Decode a AVSmpte436mCodedAnc payload into AVSmpte291mAnc8bit
|
||||
* @param[in] sample_coding the payload sample coding
|
||||
* @param[in] sample_count the number of samples stored in the payload
|
||||
* @param[in] payload the bytes storing the payload,
|
||||
* the needed size can be obtained from
|
||||
avpriv_smpte_436m_coded_anc_payload_size
|
||||
* @param[in] log_ctx context pointer for av_log
|
||||
* @param[out] out The decoded ANC packet.
|
||||
* @return returns 0 on success, otherwise < 0.
|
||||
*/
|
||||
int av_smpte_291m_anc_8bit_decode(AVSmpte291mAnc8bit *out,
|
||||
AVSmpte436mPayloadSampleCoding sample_coding,
|
||||
uint16_t sample_count,
|
||||
const uint8_t *payload,
|
||||
void *log_ctx);
|
||||
|
||||
/**
|
||||
* Fill in the correct checksum for a AVSmpte291mAnc8bit
|
||||
* @param[in,out] anc The ANC packet.
|
||||
*/
|
||||
void av_smpte_291m_anc_8bit_fill_checksum(AVSmpte291mAnc8bit *anc);
|
||||
|
||||
/**
|
||||
* Compute the sample count needed to encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc payload
|
||||
* @param[in] anc The ANC packet.
|
||||
* @param[in] sample_coding The sample coding.
|
||||
* @param[in] log_ctx context pointer for av_log
|
||||
* @return returns the sample count on success, otherwise < 0.
|
||||
*/
|
||||
int av_smpte_291m_anc_8bit_get_sample_count(const AVSmpte291mAnc8bit *anc,
|
||||
AVSmpte436mPayloadSampleCoding sample_coding,
|
||||
void *log_ctx);
|
||||
|
||||
/**
|
||||
* Encode a AVSmpte291mAnc8bit into a AVSmpte436mCodedAnc
|
||||
* @param[in] line_number the line number the ANC packet is on
|
||||
* @param[in] wrapping_type the wrapping type
|
||||
* @param[in] sample_coding the payload sample coding
|
||||
* @param[in] payload the ANC packet to encode.
|
||||
* @param[in] log_ctx context pointer for av_log
|
||||
* @param[out] out The encoded ANC packet.
|
||||
* @return returns 0 on success, otherwise < 0.
|
||||
*/
|
||||
int av_smpte_291m_anc_8bit_encode(AVSmpte436mCodedAnc *out,
|
||||
uint16_t line_number,
|
||||
AVSmpte436mWrappingType wrapping_type,
|
||||
AVSmpte436mPayloadSampleCoding sample_coding,
|
||||
const AVSmpte291mAnc8bit *payload,
|
||||
void *log_ctx);
|
||||
|
||||
/** AVSmpte291mAnc8bit::did when carrying CTA-708 data (for AV_CODEC_ID_EIA_608) */
|
||||
#define AV_SMPTE_291M_ANC_DID_CTA_708 0x61
|
||||
|
||||
/** AVSmpte291mAnc8bit::sdid_or_dbn when carrying CTA-708 data (for AV_CODEC_ID_EIA_608) */
|
||||
#define AV_SMPTE_291M_ANC_SDID_CTA_708 0x1
|
||||
|
||||
/**
|
||||
* Try to decode an ANC packet into EIA-608/CTA-708 data (AV_CODEC_ID_EIA_608). This
|
||||
* @param[in] anc The ANC packet.
|
||||
* @param[in] log_ctx Context pointer for av_log
|
||||
* @param[out] cc_data the buffer to store the extracted EIA-608/CTA-708 data,
|
||||
* you can pass NULL to not store the data.
|
||||
* the required size is 3 * cc_count bytes.
|
||||
* SMPTE_291M_ANC_PAYLOAD_CAPACITY is always enough size.
|
||||
* @return returns cc_count (>= 0) on success, AVERROR(EAGAIN) if it wasn't a CTA-708 ANC packet, < 0 on error.
|
||||
*/
|
||||
int av_smpte_291m_anc_8bit_extract_cta_708(const AVSmpte291mAnc8bit *anc, uint8_t *cc_data, void *log_ctx);
|
||||
|
||||
#endif /* AVCODEC_SMPTE_436M_H */
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* The Video Decode and Presentation API for UNIX (VDPAU) is used for
|
||||
* hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
|
||||
*
|
||||
* Copyright (C) 2008 NVIDIA
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VDPAU_H
|
||||
#define AVCODEC_VDPAU_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_vdpau
|
||||
* Public libavcodec VDPAU header.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* VDPAU hardware acceleration has two modules
|
||||
* - VDPAU decoding
|
||||
* - VDPAU presentation
|
||||
*
|
||||
* The VDPAU decoding module parses all headers using FFmpeg
|
||||
* parsing mechanisms and uses VDPAU for the actual decoding.
|
||||
*
|
||||
* As per the current implementation, the actual decoding
|
||||
* and rendering (API calls) are done as part of the VDPAU
|
||||
* presentation (vo_vdpau.c) module.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <vdpau/vdpau.h>
|
||||
|
||||
#include "libavutil/avconfig.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#include "avcodec.h"
|
||||
|
||||
struct AVCodecContext;
|
||||
struct AVFrame;
|
||||
|
||||
typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
|
||||
const VdpPictureInfo *, uint32_t,
|
||||
const VdpBitstreamBuffer *);
|
||||
|
||||
/**
|
||||
* This structure is used to share data between the libavcodec library and
|
||||
* the client video application.
|
||||
* This structure will be allocated and stored in AVCodecContext.hwaccel_context
|
||||
* by av_vdpau_bind_context(). Members can be set by the user once
|
||||
* during initialization or through each AVCodecContext.get_buffer()
|
||||
* function call. In any case, they must be valid prior to calling
|
||||
* decoding functions.
|
||||
*
|
||||
* The size of this structure is not a part of the public ABI and must not
|
||||
* be used outside of libavcodec.
|
||||
*/
|
||||
typedef struct AVVDPAUContext {
|
||||
/**
|
||||
* VDPAU decoder handle
|
||||
*
|
||||
* Set by user.
|
||||
*/
|
||||
VdpDecoder decoder;
|
||||
|
||||
/**
|
||||
* VDPAU decoder render callback
|
||||
*
|
||||
* Set by the user.
|
||||
*/
|
||||
VdpDecoderRender *render;
|
||||
|
||||
AVVDPAU_Render2 render2;
|
||||
} AVVDPAUContext;
|
||||
|
||||
/**
|
||||
* Associate a VDPAU device with a codec context for hardware acceleration.
|
||||
* This function is meant to be called from the get_format() codec callback,
|
||||
* or earlier. It can also be called after avcodec_flush_buffers() to change
|
||||
* the underlying VDPAU device mid-stream (e.g. to recover from non-transparent
|
||||
* display preemption).
|
||||
*
|
||||
* @note get_format() must return AV_PIX_FMT_VDPAU if this function completes
|
||||
* successfully.
|
||||
*
|
||||
* @param avctx decoding context whose get_format() callback is invoked
|
||||
* @param device VDPAU device handle to use for hardware acceleration
|
||||
* @param get_proc_address VDPAU device driver
|
||||
* @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags
|
||||
*
|
||||
* @return 0 on success, an AVERROR code on failure.
|
||||
*/
|
||||
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
|
||||
VdpGetProcAddress *get_proc_address, unsigned flags);
|
||||
|
||||
/**
|
||||
* Gets the parameters to create an adequate VDPAU video surface for the codec
|
||||
* context using VDPAU hardware decoding acceleration.
|
||||
*
|
||||
* @note Behavior is undefined if the context was not successfully bound to a
|
||||
* VDPAU device using av_vdpau_bind_context().
|
||||
*
|
||||
* @param avctx the codec context being used for decoding the stream
|
||||
* @param type storage space for the VDPAU video surface chroma type
|
||||
* (or NULL to ignore)
|
||||
* @param width storage space for the VDPAU video surface pixel width
|
||||
* (or NULL to ignore)
|
||||
* @param height storage space for the VDPAU video surface pixel height
|
||||
* (or NULL to ignore)
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR code on failure.
|
||||
*/
|
||||
int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
|
||||
uint32_t *width, uint32_t *height);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* AVCODEC_VDPAU_H */
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VERSION_H
|
||||
#define AVCODEC_VERSION_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavc
|
||||
* Libavcodec version macros.
|
||||
*/
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MINOR 29
|
||||
#define LIBAVCODEC_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
LIBAVCODEC_VERSION_MICRO)
|
||||
#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
LIBAVCODEC_VERSION_MICRO)
|
||||
#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
|
||||
|
||||
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
|
||||
|
||||
#endif /* AVCODEC_VERSION_H */
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VERSION_MAJOR_H
|
||||
#define AVCODEC_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavc
|
||||
* Libavcodec version macros.
|
||||
*/
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 62
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*/
|
||||
|
||||
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_V408_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
#define FF_API_CODEC_PROPS (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
#define FF_API_EXR_GAMMA (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
#define FF_API_INTRA_DC_PRECISION (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_NVDEC_OLD_PIX_FMTS (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_PARSER_PRIVATE (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
#define FF_API_PARSER_CODECID (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_MJPEG_EXTERN_HUFF (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
// reminder to remove the OMX encoder on next major bump
|
||||
#define FF_CODEC_OMX (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
// reminder to remove Sonic Lossy/Lossless encoders on next major bump
|
||||
#define FF_CODEC_SONIC_ENC (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
// reminder to remove Sonic decoder on next-next major bump
|
||||
#define FF_CODEC_SONIC_DEC (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_NVENC_H264_MAIN (LIBAVCODEC_VERSION_MAJOR < 63)
|
||||
|
||||
#endif /* AVCODEC_VERSION_MAJOR_H */
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Videotoolbox hardware acceleration
|
||||
*
|
||||
* copyright (c) 2012 Sebastien Zwickert
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VIDEOTOOLBOX_H
|
||||
#define AVCODEC_VIDEOTOOLBOX_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_videotoolbox
|
||||
* Public libavcodec Videotoolbox header.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* Hardware accelerated decoding using VideoToolbox on Apple Platforms
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define Picture QuickdrawPicture
|
||||
#include <VideoToolbox/VideoToolbox.h>
|
||||
#undef Picture
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
/**
|
||||
* This struct holds all the information that needs to be passed
|
||||
* between the caller and libavcodec for initializing Videotoolbox decoding.
|
||||
* Its size is not a part of the public ABI, it must be allocated with
|
||||
* av_videotoolbox_alloc_context() and freed with av_free().
|
||||
*/
|
||||
typedef struct AVVideotoolboxContext {
|
||||
/**
|
||||
* Videotoolbox decompression session object.
|
||||
*/
|
||||
VTDecompressionSessionRef session;
|
||||
|
||||
/**
|
||||
* CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
|
||||
* set by the caller. If this is set to 0, then no specific format is
|
||||
* requested from the decoder, and its native format is output.
|
||||
*/
|
||||
OSType cv_pix_fmt_type;
|
||||
|
||||
/**
|
||||
* CoreMedia Format Description that Videotoolbox will use to create the decompression session.
|
||||
*/
|
||||
CMVideoFormatDescriptionRef cm_fmt_desc;
|
||||
|
||||
/**
|
||||
* CoreMedia codec type that Videotoolbox will use to create the decompression session.
|
||||
*/
|
||||
int cm_codec_type;
|
||||
} AVVideotoolboxContext;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVCODEC_VIDEOTOOLBOX_H */
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* A public API for Vorbis parsing
|
||||
*
|
||||
* Determines the duration for each packet.
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VORBIS_PARSER_H
|
||||
#define AVCODEC_VORBIS_PARSER_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct AVVorbisParseContext AVVorbisParseContext;
|
||||
|
||||
/**
|
||||
* Allocate and initialize the Vorbis parser using headers in the extradata.
|
||||
*/
|
||||
AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
|
||||
int extradata_size);
|
||||
|
||||
/**
|
||||
* Free the parser and everything associated with it.
|
||||
*/
|
||||
void av_vorbis_parse_free(AVVorbisParseContext **s);
|
||||
|
||||
#define VORBIS_FLAG_HEADER 0x00000001
|
||||
#define VORBIS_FLAG_COMMENT 0x00000002
|
||||
#define VORBIS_FLAG_SETUP 0x00000004
|
||||
|
||||
/**
|
||||
* Get the duration for a Vorbis packet.
|
||||
*
|
||||
* If @p flags is @c NULL,
|
||||
* special frames are considered invalid.
|
||||
*
|
||||
* @param s Vorbis parser context
|
||||
* @param buf buffer containing a Vorbis frame
|
||||
* @param buf_size size of the buffer
|
||||
* @param flags flags for special frames
|
||||
*/
|
||||
int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
|
||||
int buf_size, int *flags);
|
||||
|
||||
/**
|
||||
* Get the duration for a Vorbis packet.
|
||||
*
|
||||
* @param s Vorbis parser context
|
||||
* @param buf buffer containing a Vorbis frame
|
||||
* @param buf_size size of the buffer
|
||||
*/
|
||||
int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
|
||||
int buf_size);
|
||||
|
||||
void av_vorbis_parse_reset(AVVorbisParseContext *s);
|
||||
|
||||
#endif /* AVCODEC_VORBIS_PARSER_H */
|
||||
+397
@@ -0,0 +1,397 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVDEVICE_AVDEVICE_H
|
||||
#define AVDEVICE_AVDEVICE_H
|
||||
|
||||
#include "version_major.h"
|
||||
#ifndef HAVE_AV_CONFIG_H
|
||||
/* When included as part of the ffmpeg build, only include the major version
|
||||
* to avoid unnecessary rebuilds. When included externally, keep including
|
||||
* the full version information. */
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavd
|
||||
* Main libavdevice API header
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavd libavdevice
|
||||
* Special devices muxing/demuxing library.
|
||||
*
|
||||
* Libavdevice is a complementary library to @ref libavf "libavformat". It
|
||||
* provides various "special" platform-specific muxers and demuxers, e.g. for
|
||||
* grabbing devices, audio capture and playback etc. As a consequence, the
|
||||
* (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
|
||||
* I/O functions). The filename passed to avformat_open_input() often does not
|
||||
* refer to an actually existing file, but has some special device-specific
|
||||
* meaning - e.g. for xcbgrab it is the display name.
|
||||
*
|
||||
* To use libavdevice, simply call avdevice_register_all() to register all
|
||||
* compiled muxers and demuxers. They all use standard libavformat API.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavformat/avformat.h"
|
||||
|
||||
/**
|
||||
* Return the LIBAVDEVICE_VERSION_INT constant.
|
||||
*/
|
||||
unsigned avdevice_version(void);
|
||||
|
||||
/**
|
||||
* Return the libavdevice build-time configuration.
|
||||
*/
|
||||
const char *avdevice_configuration(void);
|
||||
|
||||
/**
|
||||
* Return the libavdevice license.
|
||||
*/
|
||||
const char *avdevice_license(void);
|
||||
|
||||
/**
|
||||
* Initialize libavdevice and register all the input and output devices.
|
||||
*/
|
||||
void avdevice_register_all(void);
|
||||
|
||||
/**
|
||||
* Audio input devices iterator.
|
||||
*
|
||||
* If d is NULL, returns the first registered input audio/video device,
|
||||
* if d is non-NULL, returns the next registered input audio/video device after d
|
||||
* or NULL if d is the last one.
|
||||
*/
|
||||
const AVInputFormat *av_input_audio_device_next(const AVInputFormat *d);
|
||||
|
||||
/**
|
||||
* Video input devices iterator.
|
||||
*
|
||||
* If d is NULL, returns the first registered input audio/video device,
|
||||
* if d is non-NULL, returns the next registered input audio/video device after d
|
||||
* or NULL if d is the last one.
|
||||
*/
|
||||
const AVInputFormat *av_input_video_device_next(const AVInputFormat *d);
|
||||
|
||||
/**
|
||||
* Audio output devices iterator.
|
||||
*
|
||||
* If d is NULL, returns the first registered output audio/video device,
|
||||
* if d is non-NULL, returns the next registered output audio/video device after d
|
||||
* or NULL if d is the last one.
|
||||
*/
|
||||
const AVOutputFormat *av_output_audio_device_next(const AVOutputFormat *d);
|
||||
|
||||
/**
|
||||
* Video output devices iterator.
|
||||
*
|
||||
* If d is NULL, returns the first registered output audio/video device,
|
||||
* if d is non-NULL, returns the next registered output audio/video device after d
|
||||
* or NULL if d is the last one.
|
||||
*/
|
||||
const AVOutputFormat *av_output_video_device_next(const AVOutputFormat *d);
|
||||
|
||||
typedef struct AVDeviceRect {
|
||||
int x; /**< x coordinate of top left corner */
|
||||
int y; /**< y coordinate of top left corner */
|
||||
int width; /**< width */
|
||||
int height; /**< height */
|
||||
} AVDeviceRect;
|
||||
|
||||
/**
|
||||
* Message types used by avdevice_app_to_dev_control_message().
|
||||
*/
|
||||
enum AVAppToDevMessageType {
|
||||
/**
|
||||
* Dummy message.
|
||||
*/
|
||||
AV_APP_TO_DEV_NONE = MKBETAG('N','O','N','E'),
|
||||
|
||||
/**
|
||||
* Window size change message.
|
||||
*
|
||||
* Message is sent to the device every time the application changes the size
|
||||
* of the window device renders to.
|
||||
* Message should also be sent right after window is created.
|
||||
*
|
||||
* data: AVDeviceRect: new window size.
|
||||
*/
|
||||
AV_APP_TO_DEV_WINDOW_SIZE = MKBETAG('G','E','O','M'),
|
||||
|
||||
/**
|
||||
* Repaint request message.
|
||||
*
|
||||
* Message is sent to the device when window has to be repainted.
|
||||
*
|
||||
* data: AVDeviceRect: area required to be repainted.
|
||||
* NULL: whole area is required to be repainted.
|
||||
*/
|
||||
AV_APP_TO_DEV_WINDOW_REPAINT = MKBETAG('R','E','P','A'),
|
||||
|
||||
/**
|
||||
* Request pause/play.
|
||||
*
|
||||
* Application requests pause/unpause playback.
|
||||
* Mostly usable with devices that have internal buffer.
|
||||
* By default devices are not paused.
|
||||
*
|
||||
* data: NULL
|
||||
*/
|
||||
AV_APP_TO_DEV_PAUSE = MKBETAG('P', 'A', 'U', ' '),
|
||||
AV_APP_TO_DEV_PLAY = MKBETAG('P', 'L', 'A', 'Y'),
|
||||
AV_APP_TO_DEV_TOGGLE_PAUSE = MKBETAG('P', 'A', 'U', 'T'),
|
||||
|
||||
/**
|
||||
* Volume control message.
|
||||
*
|
||||
* Set volume level. It may be device-dependent if volume
|
||||
* is changed per stream or system wide. Per stream volume
|
||||
* change is expected when possible.
|
||||
*
|
||||
* data: double: new volume with range of 0.0 - 1.0.
|
||||
*/
|
||||
AV_APP_TO_DEV_SET_VOLUME = MKBETAG('S', 'V', 'O', 'L'),
|
||||
|
||||
/**
|
||||
* Mute control messages.
|
||||
*
|
||||
* Change mute state. It may be device-dependent if mute status
|
||||
* is changed per stream or system wide. Per stream mute status
|
||||
* change is expected when possible.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_APP_TO_DEV_MUTE = MKBETAG(' ', 'M', 'U', 'T'),
|
||||
AV_APP_TO_DEV_UNMUTE = MKBETAG('U', 'M', 'U', 'T'),
|
||||
AV_APP_TO_DEV_TOGGLE_MUTE = MKBETAG('T', 'M', 'U', 'T'),
|
||||
|
||||
/**
|
||||
* Get volume/mute messages.
|
||||
*
|
||||
* Force the device to send AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED or
|
||||
* AV_DEV_TO_APP_MUTE_STATE_CHANGED command respectively.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_APP_TO_DEV_GET_VOLUME = MKBETAG('G', 'V', 'O', 'L'),
|
||||
AV_APP_TO_DEV_GET_MUTE = MKBETAG('G', 'M', 'U', 'T'),
|
||||
};
|
||||
|
||||
/**
|
||||
* Message types used by avdevice_dev_to_app_control_message().
|
||||
*/
|
||||
enum AVDevToAppMessageType {
|
||||
/**
|
||||
* Dummy message.
|
||||
*/
|
||||
AV_DEV_TO_APP_NONE = MKBETAG('N','O','N','E'),
|
||||
|
||||
/**
|
||||
* Create window buffer message.
|
||||
*
|
||||
* Device requests to create a window buffer. Exact meaning is device-
|
||||
* and application-dependent. Message is sent before rendering first
|
||||
* frame and all one-shot initializations should be done here.
|
||||
* Application is allowed to ignore preferred window buffer size.
|
||||
*
|
||||
* @note: Application is obligated to inform about window buffer size
|
||||
* with AV_APP_TO_DEV_WINDOW_SIZE message.
|
||||
*
|
||||
* data: AVDeviceRect: preferred size of the window buffer.
|
||||
* NULL: no preferred size of the window buffer.
|
||||
*/
|
||||
AV_DEV_TO_APP_CREATE_WINDOW_BUFFER = MKBETAG('B','C','R','E'),
|
||||
|
||||
/**
|
||||
* Prepare window buffer message.
|
||||
*
|
||||
* Device requests to prepare a window buffer for rendering.
|
||||
* Exact meaning is device- and application-dependent.
|
||||
* Message is sent before rendering of each frame.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER = MKBETAG('B','P','R','E'),
|
||||
|
||||
/**
|
||||
* Display window buffer message.
|
||||
*
|
||||
* Device requests to display a window buffer.
|
||||
* Message is sent when new frame is ready to be displayed.
|
||||
* Usually buffers need to be swapped in handler of this message.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER = MKBETAG('B','D','I','S'),
|
||||
|
||||
/**
|
||||
* Destroy window buffer message.
|
||||
*
|
||||
* Device requests to destroy a window buffer.
|
||||
* Message is sent when device is about to be destroyed and window
|
||||
* buffer is not required anymore.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER = MKBETAG('B','D','E','S'),
|
||||
|
||||
/**
|
||||
* Buffer fullness status messages.
|
||||
*
|
||||
* Device signals buffer overflow/underflow.
|
||||
*
|
||||
* data: NULL.
|
||||
*/
|
||||
AV_DEV_TO_APP_BUFFER_OVERFLOW = MKBETAG('B','O','F','L'),
|
||||
AV_DEV_TO_APP_BUFFER_UNDERFLOW = MKBETAG('B','U','F','L'),
|
||||
|
||||
/**
|
||||
* Buffer readable/writable.
|
||||
*
|
||||
* Device informs that buffer is readable/writable.
|
||||
* When possible, device informs how many bytes can be read/write.
|
||||
*
|
||||
* @warning Device may not inform when number of bytes than can be read/write changes.
|
||||
*
|
||||
* data: int64_t: amount of bytes available to read/write.
|
||||
* NULL: amount of bytes available to read/write is not known.
|
||||
*/
|
||||
AV_DEV_TO_APP_BUFFER_READABLE = MKBETAG('B','R','D',' '),
|
||||
AV_DEV_TO_APP_BUFFER_WRITABLE = MKBETAG('B','W','R',' '),
|
||||
|
||||
/**
|
||||
* Mute state change message.
|
||||
*
|
||||
* Device informs that mute state has changed.
|
||||
*
|
||||
* data: int: 0 for not muted state, non-zero for muted state.
|
||||
*/
|
||||
AV_DEV_TO_APP_MUTE_STATE_CHANGED = MKBETAG('C','M','U','T'),
|
||||
|
||||
/**
|
||||
* Volume level change message.
|
||||
*
|
||||
* Device informs that volume level has changed.
|
||||
*
|
||||
* data: double: new volume with range of 0.0 - 1.0.
|
||||
*/
|
||||
AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED = MKBETAG('C','V','O','L'),
|
||||
};
|
||||
|
||||
/**
|
||||
* Send control message from application to device.
|
||||
*
|
||||
* @param s device context.
|
||||
* @param type message type.
|
||||
* @param data message data. Exact type depends on message type.
|
||||
* @param data_size size of message data.
|
||||
* @return >= 0 on success, negative on error.
|
||||
* AVERROR(ENOSYS) when device doesn't implement handler of the message.
|
||||
*/
|
||||
int avdevice_app_to_dev_control_message(struct AVFormatContext *s,
|
||||
enum AVAppToDevMessageType type,
|
||||
void *data, size_t data_size);
|
||||
|
||||
/**
|
||||
* Send control message from device to application.
|
||||
*
|
||||
* @param s device context.
|
||||
* @param type message type.
|
||||
* @param data message data. Can be NULL.
|
||||
* @param data_size size of message data.
|
||||
* @return >= 0 on success, negative on error.
|
||||
* AVERROR(ENOSYS) when application doesn't implement handler of the message.
|
||||
*/
|
||||
int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
|
||||
enum AVDevToAppMessageType type,
|
||||
void *data, size_t data_size);
|
||||
|
||||
/**
|
||||
* Structure describes basic parameters of the device.
|
||||
*/
|
||||
typedef struct AVDeviceInfo {
|
||||
char *device_name; /**< device name, format depends on device */
|
||||
char *device_description; /**< human friendly name */
|
||||
enum AVMediaType *media_types; /**< array indicating what media types(s), if any, a device can provide. If null, cannot provide any */
|
||||
int nb_media_types; /**< length of media_types array, 0 if device cannot provide any media types */
|
||||
} AVDeviceInfo;
|
||||
|
||||
/**
|
||||
* List of devices.
|
||||
*/
|
||||
typedef struct AVDeviceInfoList {
|
||||
AVDeviceInfo **devices; /**< list of autodetected devices */
|
||||
int nb_devices; /**< number of autodetected devices */
|
||||
int default_device; /**< index of default device or -1 if no default */
|
||||
} AVDeviceInfoList;
|
||||
|
||||
/**
|
||||
* List devices.
|
||||
*
|
||||
* Returns available device names and their parameters.
|
||||
*
|
||||
* @note: Some devices may accept system-dependent device names that cannot be
|
||||
* autodetected. The list returned by this function cannot be assumed to
|
||||
* be always completed.
|
||||
*
|
||||
* @param s device context.
|
||||
* @param[out] device_list list of autodetected devices.
|
||||
* @return count of autodetected devices, negative on error.
|
||||
*/
|
||||
int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_list);
|
||||
|
||||
/**
|
||||
* Convenient function to free result of avdevice_list_devices().
|
||||
*
|
||||
* @param device_list device list to be freed.
|
||||
*/
|
||||
void avdevice_free_list_devices(AVDeviceInfoList **device_list);
|
||||
|
||||
/**
|
||||
* List devices.
|
||||
*
|
||||
* Returns available device names and their parameters.
|
||||
* These are convenient wrappers for avdevice_list_devices().
|
||||
* Device context is allocated and deallocated internally.
|
||||
*
|
||||
* @param device device format. May be NULL if device name is set.
|
||||
* @param device_name device name. May be NULL if device format is set.
|
||||
* @param device_options An AVDictionary filled with device-private options. May be NULL.
|
||||
* The same options must be passed later to avformat_write_header() for output
|
||||
* devices or avformat_open_input() for input devices, or at any other place
|
||||
* that affects device-private options.
|
||||
* @param[out] device_list list of autodetected devices
|
||||
* @return count of autodetected devices, negative on error.
|
||||
* @note device argument takes precedence over device_name when both are set.
|
||||
*/
|
||||
int avdevice_list_input_sources(const AVInputFormat *device, const char *device_name,
|
||||
AVDictionary *device_options, AVDeviceInfoList **device_list);
|
||||
int avdevice_list_output_sinks(const AVOutputFormat *device, const char *device_name,
|
||||
AVDictionary *device_options, AVDeviceInfoList **device_list);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVDEVICE_AVDEVICE_H */
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVDEVICE_VERSION_H
|
||||
#define AVDEVICE_VERSION_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavd
|
||||
* Libavdevice version macros
|
||||
*/
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MINOR 4
|
||||
#define LIBAVDEVICE_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
|
||||
|
||||
#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION)
|
||||
|
||||
#endif /* AVDEVICE_VERSION_H */
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVDEVICE_VERSION_MAJOR_H
|
||||
#define AVDEVICE_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavd
|
||||
* Libavdevice version macros
|
||||
*/
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 62
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*/
|
||||
|
||||
#define FF_API_ALSA_CHANNELS (LIBAVDEVICE_VERSION_MAJOR < 63)
|
||||
|
||||
#endif /* AVDEVICE_VERSION_MAJOR_H */
|
||||
+1222
File diff suppressed because it is too large
Load Diff
+172
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFILTER_BUFFERSINK_H
|
||||
#define AVFILTER_BUFFERSINK_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavfi_buffersink
|
||||
* memory buffer sink API for audio and video
|
||||
*/
|
||||
|
||||
#include "avfilter.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavfi_buffersink Buffer sink API
|
||||
* @ingroup lavfi
|
||||
* @{
|
||||
*
|
||||
* The buffersink and abuffersink filters are there to connect filter graphs
|
||||
* to applications. They have a single input, connected to the graph, and no
|
||||
* output. Frames must be extracted using av_buffersink_get_frame() or
|
||||
* av_buffersink_get_samples().
|
||||
*
|
||||
* The format negotiated by the graph during configuration can be obtained
|
||||
* using the accessor functions:
|
||||
* - av_buffersink_get_time_base(),
|
||||
* - av_buffersink_get_format(),
|
||||
* - av_buffersink_get_frame_rate(),
|
||||
* - av_buffersink_get_w(),
|
||||
* - av_buffersink_get_h(),
|
||||
* - av_buffersink_get_sample_aspect_ratio(),
|
||||
* - av_buffersink_get_channels(),
|
||||
* - av_buffersink_get_ch_layout(),
|
||||
* - av_buffersink_get_sample_rate().
|
||||
* - av_buffersink_get_side_data().
|
||||
*
|
||||
* The layout returned by av_buffersink_get_ch_layout() must de uninitialized
|
||||
* by the caller.
|
||||
*
|
||||
* The format can be constrained by setting options, using av_opt_set() and
|
||||
* related functions with the AV_OPT_SEARCH_CHILDREN flag.
|
||||
* - pixel_formats (array of pixel formats),
|
||||
* - colorspaces (array of int),
|
||||
* - colorranges (array of int),
|
||||
* - alphamodes (array of int),
|
||||
* - sample_formats (array of sample formats),
|
||||
* - samplerates (array of int),
|
||||
* - channel_layouts (array of channel layouts)
|
||||
* If an option is not set, all corresponding formats are accepted.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get a frame with filtered data from sink and put it in frame.
|
||||
*
|
||||
* @param ctx pointer to a buffersink or abuffersink filter context.
|
||||
* @param frame pointer to an allocated frame that will be filled with data.
|
||||
* The data must be freed using av_frame_unref() / av_frame_free()
|
||||
* @param flags a combination of AV_BUFFERSINK_FLAG_* flags
|
||||
*
|
||||
* @return >= 0 in for success, a negative AVERROR code for failure.
|
||||
*/
|
||||
int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags);
|
||||
|
||||
/**
|
||||
* Tell av_buffersink_get_buffer_ref() to read video/samples buffer
|
||||
* reference, but not remove it from the buffer. This is useful if you
|
||||
* need only to read a video/samples buffer, without to fetch it.
|
||||
*/
|
||||
#define AV_BUFFERSINK_FLAG_PEEK 1
|
||||
|
||||
/**
|
||||
* Tell av_buffersink_get_buffer_ref() not to request a frame from its input.
|
||||
* If a frame is already buffered, it is read (and removed from the buffer),
|
||||
* but if no frame is present, return AVERROR(EAGAIN).
|
||||
*/
|
||||
#define AV_BUFFERSINK_FLAG_NO_REQUEST 2
|
||||
|
||||
/**
|
||||
* Set the frame size for an audio buffer sink.
|
||||
*
|
||||
* All calls to av_buffersink_get_buffer_ref will return a buffer with
|
||||
* exactly the specified number of samples, or AVERROR(EAGAIN) if there is
|
||||
* not enough. The last buffer at EOF will be padded with 0.
|
||||
*/
|
||||
void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size);
|
||||
|
||||
/**
|
||||
* @defgroup lavfi_buffersink_accessors Buffer sink accessors
|
||||
* Get the properties of the stream
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVMediaType av_buffersink_get_type (const AVFilterContext *ctx);
|
||||
AVRational av_buffersink_get_time_base (const AVFilterContext *ctx);
|
||||
int av_buffersink_get_format (const AVFilterContext *ctx);
|
||||
|
||||
AVRational av_buffersink_get_frame_rate (const AVFilterContext *ctx);
|
||||
int av_buffersink_get_w (const AVFilterContext *ctx);
|
||||
int av_buffersink_get_h (const AVFilterContext *ctx);
|
||||
AVRational av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx);
|
||||
enum AVColorSpace av_buffersink_get_colorspace (const AVFilterContext *ctx);
|
||||
enum AVColorRange av_buffersink_get_color_range (const AVFilterContext *ctx);
|
||||
enum AVAlphaMode av_buffersink_get_alpha_mode (const AVFilterContext *ctx);
|
||||
|
||||
int av_buffersink_get_channels (const AVFilterContext *ctx);
|
||||
int av_buffersink_get_ch_layout (const AVFilterContext *ctx,
|
||||
AVChannelLayout *ch_layout);
|
||||
int av_buffersink_get_sample_rate (const AVFilterContext *ctx);
|
||||
|
||||
AVBufferRef * av_buffersink_get_hw_frames_ctx (const AVFilterContext *ctx);
|
||||
|
||||
const AVFrameSideData *const *av_buffersink_get_side_data(const AVFilterContext *ctx,
|
||||
int *nb_side_data);
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Get a frame with filtered data from sink and put it in frame.
|
||||
*
|
||||
* @param ctx pointer to a context of a buffersink or abuffersink AVFilter.
|
||||
* @param frame pointer to an allocated frame that will be filled with data.
|
||||
* The data must be freed using av_frame_unref() / av_frame_free()
|
||||
*
|
||||
* @return
|
||||
* - >= 0 if a frame was successfully returned.
|
||||
* - AVERROR(EAGAIN) if no frames are available at this point; more
|
||||
* input frames must be added to the filtergraph to get more output.
|
||||
* - AVERROR_EOF if there will be no more output frames on this sink.
|
||||
* - A different negative AVERROR code in other failure cases.
|
||||
*/
|
||||
int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame);
|
||||
|
||||
/**
|
||||
* Same as av_buffersink_get_frame(), but with the ability to specify the number
|
||||
* of samples read. This function is less efficient than
|
||||
* av_buffersink_get_frame(), because it copies the data around.
|
||||
*
|
||||
* @param ctx pointer to a context of the abuffersink AVFilter.
|
||||
* @param frame pointer to an allocated frame that will be filled with data.
|
||||
* The data must be freed using av_frame_unref() / av_frame_free()
|
||||
* frame will contain exactly nb_samples audio samples, except at
|
||||
* the end of stream, when it can contain less than nb_samples.
|
||||
*
|
||||
* @return The return codes have the same meaning as for
|
||||
* av_buffersink_get_frame().
|
||||
*
|
||||
* @warning do not mix this function with av_buffersink_get_frame(). Use only one or
|
||||
* the other with a single sink, not both.
|
||||
*/
|
||||
int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVFILTER_BUFFERSINK_H */
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFILTER_BUFFERSRC_H
|
||||
#define AVFILTER_BUFFERSRC_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavfi_buffersrc
|
||||
* Memory buffer source API.
|
||||
*/
|
||||
|
||||
#include "avfilter.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavfi_buffersrc Buffer source API
|
||||
* @ingroup lavfi
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum {
|
||||
|
||||
/**
|
||||
* Do not check for format changes.
|
||||
*/
|
||||
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1,
|
||||
|
||||
/**
|
||||
* Immediately push the frame to the output.
|
||||
*/
|
||||
AV_BUFFERSRC_FLAG_PUSH = 4,
|
||||
|
||||
/**
|
||||
* Keep a reference to the frame.
|
||||
* If the frame if reference-counted, create a new reference; otherwise
|
||||
* copy the frame data.
|
||||
*/
|
||||
AV_BUFFERSRC_FLAG_KEEP_REF = 8,
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the number of failed requests.
|
||||
*
|
||||
* A failed request is when the request_frame method is called while no
|
||||
* frame is present in the buffer.
|
||||
* The number is reset when a frame is added.
|
||||
*/
|
||||
unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src);
|
||||
|
||||
/**
|
||||
* This structure contains the parameters describing the frames that will be
|
||||
* passed to this filter.
|
||||
*
|
||||
* It should be allocated with av_buffersrc_parameters_alloc() and freed with
|
||||
* av_free(). All the allocated fields in it remain owned by the caller.
|
||||
*/
|
||||
typedef struct AVBufferSrcParameters {
|
||||
/**
|
||||
* video: the pixel format, value corresponds to enum AVPixelFormat
|
||||
* audio: the sample format, value corresponds to enum AVSampleFormat
|
||||
*/
|
||||
int format;
|
||||
/**
|
||||
* The timebase to be used for the timestamps on the input frames.
|
||||
*/
|
||||
AVRational time_base;
|
||||
|
||||
/**
|
||||
* Video only, the display dimensions of the input frames.
|
||||
*/
|
||||
int width, height;
|
||||
|
||||
/**
|
||||
* Video only, the sample (pixel) aspect ratio.
|
||||
*/
|
||||
AVRational sample_aspect_ratio;
|
||||
|
||||
/**
|
||||
* Video only, the frame rate of the input video. This field must only be
|
||||
* set to a non-zero value if input stream has a known constant framerate
|
||||
* and should be left at its initial value if the framerate is variable or
|
||||
* unknown.
|
||||
*/
|
||||
AVRational frame_rate;
|
||||
|
||||
/**
|
||||
* Video with a hwaccel pixel format only. This should be a reference to an
|
||||
* AVHWFramesContext instance describing the input frames.
|
||||
*/
|
||||
AVBufferRef *hw_frames_ctx;
|
||||
|
||||
/**
|
||||
* Audio only, the audio sampling rate in samples per second.
|
||||
*/
|
||||
int sample_rate;
|
||||
|
||||
/**
|
||||
* Audio only, the audio channel layout
|
||||
*/
|
||||
AVChannelLayout ch_layout;
|
||||
|
||||
/**
|
||||
* Video only, the YUV colorspace and range.
|
||||
*/
|
||||
enum AVColorSpace color_space;
|
||||
enum AVColorRange color_range;
|
||||
|
||||
AVFrameSideData **side_data;
|
||||
int nb_side_data;
|
||||
|
||||
/**
|
||||
* Video only, the alpha mode.
|
||||
*/
|
||||
enum AVAlphaMode alpha_mode;
|
||||
} AVBufferSrcParameters;
|
||||
|
||||
/**
|
||||
* Allocate a new AVBufferSrcParameters instance. It should be freed by the
|
||||
* caller with av_free().
|
||||
*/
|
||||
AVBufferSrcParameters *av_buffersrc_parameters_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize the buffersrc or abuffersrc filter with the provided parameters.
|
||||
* This function may be called multiple times, the later calls override the
|
||||
* previous ones. Some of the parameters may also be set through AVOptions, then
|
||||
* whatever method is used last takes precedence.
|
||||
*
|
||||
* @param ctx an instance of the buffersrc or abuffersrc filter
|
||||
* @param param the stream parameters. The frames later passed to this filter
|
||||
* must conform to those parameters. All the allocated fields in
|
||||
* param remain owned by the caller, libavfilter will make internal
|
||||
* copies or references when necessary.
|
||||
* @return 0 on success, a negative AVERROR code on failure.
|
||||
*/
|
||||
int av_buffersrc_parameters_set(AVFilterContext *ctx, AVBufferSrcParameters *param);
|
||||
|
||||
/**
|
||||
* Add a frame to the buffer source.
|
||||
*
|
||||
* @param ctx an instance of the buffersrc filter
|
||||
* @param frame frame to be added. If the frame is reference counted, this
|
||||
* function will make a new reference to it. Otherwise the frame data will be
|
||||
* copied.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error
|
||||
*
|
||||
* This function is equivalent to av_buffersrc_add_frame_flags() with the
|
||||
* AV_BUFFERSRC_FLAG_KEEP_REF flag.
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame);
|
||||
|
||||
/**
|
||||
* Add a frame to the buffer source.
|
||||
*
|
||||
* @param ctx an instance of the buffersrc filter
|
||||
* @param frame frame to be added. If the frame is reference counted, this
|
||||
* function will take ownership of the reference(s) and reset the frame.
|
||||
* Otherwise the frame data will be copied. If this function returns an error,
|
||||
* the input frame is not touched.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error.
|
||||
*
|
||||
* @note the difference between this function and av_buffersrc_write_frame() is
|
||||
* that av_buffersrc_write_frame() creates a new reference to the input frame,
|
||||
* while this function takes ownership of the reference passed to it.
|
||||
*
|
||||
* This function is equivalent to av_buffersrc_add_frame_flags() without the
|
||||
* AV_BUFFERSRC_FLAG_KEEP_REF flag.
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame);
|
||||
|
||||
/**
|
||||
* Add a frame to the buffer source.
|
||||
*
|
||||
* By default, if the frame is reference-counted, this function will take
|
||||
* ownership of the reference(s) and reset the frame. This can be controlled
|
||||
* using the flags.
|
||||
*
|
||||
* If this function returns an error, the input frame is not touched.
|
||||
*
|
||||
* @param buffer_src pointer to a buffer source context
|
||||
* @param frame a frame, or NULL to mark EOF
|
||||
* @param flags a combination of AV_BUFFERSRC_FLAG_*
|
||||
* @return >= 0 in case of success, a negative AVERROR code
|
||||
* in case of failure
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
|
||||
AVFrame *frame, int flags);
|
||||
|
||||
/**
|
||||
* Close the buffer source after EOF.
|
||||
*
|
||||
* This is similar to passing NULL to av_buffersrc_add_frame_flags()
|
||||
* except it takes the timestamp of the EOF, i.e. the timestamp of the end
|
||||
* of the last frame.
|
||||
*/
|
||||
int av_buffersrc_close(AVFilterContext *ctx, int64_t pts, unsigned flags);
|
||||
|
||||
/**
|
||||
* Returns 0 or a negative AVERROR code. Currently, this will only ever
|
||||
* return AVERROR(EOF), to indicate that the buffer source has been closed,
|
||||
* either as a result of av_buffersrc_close(), or because the downstream
|
||||
* filter is no longer accepting new data.
|
||||
*/
|
||||
int av_buffersrc_get_status(AVFilterContext *ctx);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVFILTER_BUFFERSRC_H */
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Version macros.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFILTER_VERSION_H
|
||||
#define AVFILTER_VERSION_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavfi
|
||||
* Libavfilter version macros
|
||||
*/
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVFILTER_VERSION_MINOR 15
|
||||
#define LIBAVFILTER_VERSION_MICRO 101
|
||||
|
||||
|
||||
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
||||
LIBAVFILTER_VERSION_MINOR, \
|
||||
LIBAVFILTER_VERSION_MICRO)
|
||||
#define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \
|
||||
LIBAVFILTER_VERSION_MINOR, \
|
||||
LIBAVFILTER_VERSION_MICRO)
|
||||
#define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
|
||||
|
||||
#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION)
|
||||
|
||||
#endif /* AVFILTER_VERSION_H */
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Version macros.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFILTER_VERSION_MAJOR_H
|
||||
#define AVFILTER_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavfi
|
||||
* Libavfilter version macros
|
||||
*/
|
||||
|
||||
#define LIBAVFILTER_VERSION_MAJOR 11
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*/
|
||||
|
||||
#define FF_API_BUFFERSINK_OPTS (LIBAVFILTER_VERSION_MAJOR < 12)
|
||||
#define FF_API_CONTEXT_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 12)
|
||||
#define FF_API_LIBNPP_SUPPORT (LIBAVFILTER_VERSION_MAJOR < 12)
|
||||
|
||||
#endif /* AVFILTER_VERSION_MAJOR_H */
|
||||
+3118
File diff suppressed because it is too large
Load Diff
+831
@@ -0,0 +1,831 @@
|
||||
/*
|
||||
* copyright (c) 2001 Fabrice Bellard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef AVFORMAT_AVIO_H
|
||||
#define AVFORMAT_AVIO_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavf_io
|
||||
* Buffered I/O operations
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
|
||||
#include "libavformat/version_major.h"
|
||||
|
||||
/**
|
||||
* Seeking works like for a local file.
|
||||
*/
|
||||
#define AVIO_SEEKABLE_NORMAL (1 << 0)
|
||||
|
||||
/**
|
||||
* Seeking by timestamp with avio_seek_time() is possible.
|
||||
*/
|
||||
#define AVIO_SEEKABLE_TIME (1 << 1)
|
||||
|
||||
/**
|
||||
* Callback for checking whether to abort blocking functions.
|
||||
* AVERROR_EXIT is returned in this case by the interrupted
|
||||
* function. During blocking operations, callback is called with
|
||||
* opaque as parameter. If the callback returns 1, the
|
||||
* blocking operation will be aborted.
|
||||
*
|
||||
* No members can be added to this struct without a major bump, if
|
||||
* new elements have been added after this struct in AVFormatContext
|
||||
* or AVIOContext.
|
||||
*/
|
||||
typedef struct AVIOInterruptCB {
|
||||
int (*callback)(void*);
|
||||
void *opaque;
|
||||
} AVIOInterruptCB;
|
||||
|
||||
/**
|
||||
* Directory entry types.
|
||||
*/
|
||||
enum AVIODirEntryType {
|
||||
AVIO_ENTRY_UNKNOWN,
|
||||
AVIO_ENTRY_BLOCK_DEVICE,
|
||||
AVIO_ENTRY_CHARACTER_DEVICE,
|
||||
AVIO_ENTRY_DIRECTORY,
|
||||
AVIO_ENTRY_NAMED_PIPE,
|
||||
AVIO_ENTRY_SYMBOLIC_LINK,
|
||||
AVIO_ENTRY_SOCKET,
|
||||
AVIO_ENTRY_FILE,
|
||||
AVIO_ENTRY_SERVER,
|
||||
AVIO_ENTRY_SHARE,
|
||||
AVIO_ENTRY_WORKGROUP,
|
||||
};
|
||||
|
||||
/**
|
||||
* Describes single entry of the directory.
|
||||
*
|
||||
* Only name and type fields are guaranteed be set.
|
||||
* Rest of fields are protocol or/and platform dependent and might be unknown.
|
||||
*/
|
||||
typedef struct AVIODirEntry {
|
||||
char *name; /**< Filename */
|
||||
int type; /**< Type of the entry */
|
||||
int utf8; /**< Set to 1 when name is encoded with UTF-8, 0 otherwise.
|
||||
Name can be encoded with UTF-8 even though 0 is set. */
|
||||
int64_t size; /**< File size in bytes, -1 if unknown. */
|
||||
int64_t modification_timestamp; /**< Time of last modification in microseconds since unix
|
||||
epoch, -1 if unknown. */
|
||||
int64_t access_timestamp; /**< Time of last access in microseconds since unix epoch,
|
||||
-1 if unknown. */
|
||||
int64_t status_change_timestamp; /**< Time of last status change in microseconds since unix
|
||||
epoch, -1 if unknown. */
|
||||
int64_t user_id; /**< User ID of owner, -1 if unknown. */
|
||||
int64_t group_id; /**< Group ID of owner, -1 if unknown. */
|
||||
int64_t filemode; /**< Unix file mode, -1 if unknown. */
|
||||
} AVIODirEntry;
|
||||
|
||||
typedef struct AVIODirContext AVIODirContext;
|
||||
|
||||
/**
|
||||
* Different data types that can be returned via the AVIO
|
||||
* write_data_type callback.
|
||||
*/
|
||||
enum AVIODataMarkerType {
|
||||
/**
|
||||
* Header data; this needs to be present for the stream to be decodeable.
|
||||
*/
|
||||
AVIO_DATA_MARKER_HEADER,
|
||||
/**
|
||||
* A point in the output bytestream where a decoder can start decoding
|
||||
* (i.e. a keyframe). A demuxer/decoder given the data flagged with
|
||||
* AVIO_DATA_MARKER_HEADER, followed by any AVIO_DATA_MARKER_SYNC_POINT,
|
||||
* should give decodeable results.
|
||||
*/
|
||||
AVIO_DATA_MARKER_SYNC_POINT,
|
||||
/**
|
||||
* A point in the output bytestream where a demuxer can start parsing
|
||||
* (for non self synchronizing bytestream formats). That is, any
|
||||
* non-keyframe packet start point.
|
||||
*/
|
||||
AVIO_DATA_MARKER_BOUNDARY_POINT,
|
||||
/**
|
||||
* This is any, unlabelled data. It can either be a muxer not marking
|
||||
* any positions at all, it can be an actual boundary/sync point
|
||||
* that the muxer chooses not to mark, or a later part of a packet/fragment
|
||||
* that is cut into multiple write callbacks due to limited IO buffer size.
|
||||
*/
|
||||
AVIO_DATA_MARKER_UNKNOWN,
|
||||
/**
|
||||
* Trailer data, which doesn't contain actual content, but only for
|
||||
* finalizing the output file.
|
||||
*/
|
||||
AVIO_DATA_MARKER_TRAILER,
|
||||
/**
|
||||
* A point in the output bytestream where the underlying AVIOContext might
|
||||
* flush the buffer depending on latency or buffering requirements. Typically
|
||||
* means the end of a packet.
|
||||
*/
|
||||
AVIO_DATA_MARKER_FLUSH_POINT,
|
||||
};
|
||||
|
||||
/**
|
||||
* Bytestream IO Context.
|
||||
* New public fields can be added with minor version bumps.
|
||||
* Removal, reordering and changes to existing public fields require
|
||||
* a major version bump.
|
||||
* sizeof(AVIOContext) must not be used outside libav*.
|
||||
*
|
||||
* @note None of the function pointers in AVIOContext should be called
|
||||
* directly, they should only be set by the client application
|
||||
* when implementing custom I/O. Normally these are set to the
|
||||
* function pointers specified in avio_alloc_context()
|
||||
*/
|
||||
typedef struct AVIOContext {
|
||||
/**
|
||||
* A class for private options.
|
||||
*
|
||||
* If this AVIOContext is created by avio_open2(), av_class is set and
|
||||
* passes the options down to protocols.
|
||||
*
|
||||
* If this AVIOContext is manually allocated, then av_class may be set by
|
||||
* the caller.
|
||||
*
|
||||
* warning -- this field can be NULL, be sure to not pass this AVIOContext
|
||||
* to any av_opt_* functions in that case.
|
||||
*/
|
||||
const AVClass *av_class;
|
||||
|
||||
/*
|
||||
* The following shows the relationship between buffer, buf_ptr,
|
||||
* buf_ptr_max, buf_end, buf_size, and pos, when reading and when writing
|
||||
* (since AVIOContext is used for both):
|
||||
*
|
||||
**********************************************************************************
|
||||
* READING
|
||||
**********************************************************************************
|
||||
*
|
||||
* | buffer_size |
|
||||
* |---------------------------------------|
|
||||
* | |
|
||||
*
|
||||
* buffer buf_ptr buf_end
|
||||
* +---------------+-----------------------+
|
||||
* |/ / / / / / / /|/ / / / / / /| |
|
||||
* read buffer: |/ / consumed / | to be read /| |
|
||||
* |/ / / / / / / /|/ / / / / / /| |
|
||||
* +---------------+-----------------------+
|
||||
*
|
||||
* pos
|
||||
* +-------------------------------------------+-----------------+
|
||||
* input file: | | |
|
||||
* +-------------------------------------------+-----------------+
|
||||
*
|
||||
*
|
||||
**********************************************************************************
|
||||
* WRITING
|
||||
**********************************************************************************
|
||||
*
|
||||
* | buffer_size |
|
||||
* |--------------------------------------|
|
||||
* | |
|
||||
*
|
||||
* buf_ptr_max
|
||||
* buffer (buf_ptr) buf_end
|
||||
* +-----------------------+--------------+
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* write buffer: | / / to be flushed / / | |
|
||||
* |/ / / / / / / / / / / /| |
|
||||
* +-----------------------+--------------+
|
||||
* buf_ptr can be in this
|
||||
* due to a backward seek
|
||||
*
|
||||
* pos
|
||||
* +-------------+----------------------------------------------+
|
||||
* output file: | | |
|
||||
* +-------------+----------------------------------------------+
|
||||
*
|
||||
*/
|
||||
unsigned char *buffer; /**< Start of the buffer. */
|
||||
int buffer_size; /**< Maximum buffer size */
|
||||
unsigned char *buf_ptr; /**< Current position in the buffer */
|
||||
unsigned char *buf_end; /**< End of the data, may be less than
|
||||
buffer+buffer_size if the read function returned
|
||||
less data than requested, e.g. for streams where
|
||||
no more data has been received yet. */
|
||||
void *opaque; /**< A private pointer, passed to the read/write/seek/...
|
||||
functions. */
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
|
||||
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size);
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
int eof_reached; /**< true if was unable to read due to error or eof */
|
||||
int error; /**< contains the error code or 0 if no error happened */
|
||||
int write_flag; /**< true if open for writing */
|
||||
int max_packet_size;
|
||||
int min_packet_size; /**< Try to buffer at least this amount of data
|
||||
before flushing it. */
|
||||
unsigned long checksum;
|
||||
unsigned char *checksum_ptr;
|
||||
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
|
||||
/**
|
||||
* Pause or resume playback for network streaming protocols - e.g. MMS.
|
||||
*/
|
||||
int (*read_pause)(void *opaque, int pause);
|
||||
/**
|
||||
* Seek to a given timestamp in stream with the specified stream_index.
|
||||
* Needed for some network streaming protocols which don't support seeking
|
||||
* to byte position.
|
||||
*/
|
||||
int64_t (*read_seek)(void *opaque, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
/**
|
||||
* A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
|
||||
*/
|
||||
int seekable;
|
||||
|
||||
/**
|
||||
* avio_read and avio_write should if possible be satisfied directly
|
||||
* instead of going through a buffer, and avio_seek will always
|
||||
* call the underlying seek function directly.
|
||||
*/
|
||||
int direct;
|
||||
|
||||
/**
|
||||
* ',' separated list of allowed protocols.
|
||||
*/
|
||||
const char *protocol_whitelist;
|
||||
|
||||
/**
|
||||
* ',' separated list of disallowed protocols.
|
||||
*/
|
||||
const char *protocol_blacklist;
|
||||
|
||||
/**
|
||||
* A callback that is used instead of write_packet.
|
||||
*/
|
||||
int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size,
|
||||
enum AVIODataMarkerType type, int64_t time);
|
||||
/**
|
||||
* If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT,
|
||||
* but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly
|
||||
* small chunks of data returned from the callback).
|
||||
*/
|
||||
int ignore_boundary_point;
|
||||
|
||||
/**
|
||||
* Maximum reached position before a backward seek in the write buffer,
|
||||
* used keeping track of already written data for a later flush.
|
||||
*/
|
||||
unsigned char *buf_ptr_max;
|
||||
|
||||
/**
|
||||
* Read-only statistic of bytes read for this AVIOContext.
|
||||
*/
|
||||
int64_t bytes_read;
|
||||
|
||||
/**
|
||||
* Read-only statistic of bytes written for this AVIOContext.
|
||||
*/
|
||||
int64_t bytes_written;
|
||||
} AVIOContext;
|
||||
|
||||
/**
|
||||
* Return the name of the protocol that will handle the passed URL.
|
||||
*
|
||||
* NULL is returned if no protocol could be found for the given URL.
|
||||
*
|
||||
* @return Name of the protocol or NULL.
|
||||
*/
|
||||
const char *avio_find_protocol_name(const char *url);
|
||||
|
||||
/**
|
||||
* Return AVIO_FLAG_* access flags corresponding to the access permissions
|
||||
* of the resource in url, or a negative value corresponding to an
|
||||
* AVERROR code in case of failure. The returned access flags are
|
||||
* masked by the value in flags.
|
||||
*
|
||||
* @note This function is intrinsically unsafe, in the sense that the
|
||||
* checked resource may change its existence or permission status from
|
||||
* one call to another. Thus you should not trust the returned value,
|
||||
* unless you are sure that no other processes are accessing the
|
||||
* checked resource.
|
||||
*/
|
||||
int avio_check(const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Open directory for reading.
|
||||
*
|
||||
* @param s directory read context. Pointer to a NULL pointer must be passed.
|
||||
* @param url directory to be listed.
|
||||
* @param options A dictionary filled with protocol-private options. On return
|
||||
* this parameter will be destroyed and replaced with a dictionary
|
||||
* containing options that were not found. May be NULL.
|
||||
* @return >=0 on success or negative on error.
|
||||
*/
|
||||
int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Get next directory entry.
|
||||
*
|
||||
* Returned entry must be freed with avio_free_directory_entry(). In particular
|
||||
* it may outlive AVIODirContext.
|
||||
*
|
||||
* @param s directory read context.
|
||||
* @param[out] next next entry or NULL when no more entries.
|
||||
* @return >=0 on success or negative on error. End of list is not considered an
|
||||
* error.
|
||||
*/
|
||||
int avio_read_dir(AVIODirContext *s, AVIODirEntry **next);
|
||||
|
||||
/**
|
||||
* Close directory.
|
||||
*
|
||||
* @note Entries created using avio_read_dir() are not deleted and must be
|
||||
* freeded with avio_free_directory_entry().
|
||||
*
|
||||
* @param s directory read context.
|
||||
* @return >=0 on success or negative on error.
|
||||
*/
|
||||
int avio_close_dir(AVIODirContext **s);
|
||||
|
||||
/**
|
||||
* Free entry allocated by avio_read_dir().
|
||||
*
|
||||
* @param entry entry to be freed.
|
||||
*/
|
||||
void avio_free_directory_entry(AVIODirEntry **entry);
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
|
||||
* freed with avio_context_free().
|
||||
*
|
||||
* @param buffer Memory block for input/output operations via AVIOContext.
|
||||
* The buffer must be allocated with av_malloc() and friends.
|
||||
* It may be freed and replaced with a new buffer by libavformat.
|
||||
* AVIOContext.buffer holds the buffer currently in use,
|
||||
* which must be later freed with av_free().
|
||||
* @param buffer_size The buffer size is very important for performance.
|
||||
* For protocols with fixed blocksize it should be set to this blocksize.
|
||||
* For others a typical size is a cache page, e.g. 4kb.
|
||||
* @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
|
||||
* @param opaque An opaque pointer to user-specific data.
|
||||
* @param read_packet A function for refilling the buffer, may be NULL.
|
||||
* For stream protocols, must never return 0 but rather
|
||||
* a proper AVERROR code.
|
||||
* @param write_packet A function for writing the buffer contents, may be NULL.
|
||||
* The function may not change the input buffers content.
|
||||
* @param seek A function for seeking to specified byte position, may be NULL.
|
||||
*
|
||||
* @return Allocated AVIOContext or NULL on failure.
|
||||
*/
|
||||
AVIOContext *avio_alloc_context(
|
||||
unsigned char *buffer,
|
||||
int buffer_size,
|
||||
int write_flag,
|
||||
void *opaque,
|
||||
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
|
||||
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence));
|
||||
|
||||
/**
|
||||
* Free the supplied IO context and everything associated with it.
|
||||
*
|
||||
* @param s Double pointer to the IO context. This function will write NULL
|
||||
* into s.
|
||||
*/
|
||||
void avio_context_free(AVIOContext **s);
|
||||
|
||||
void avio_w8(AVIOContext *s, int b);
|
||||
void avio_write(AVIOContext *s, const unsigned char *buf, int size);
|
||||
void avio_wl64(AVIOContext *s, uint64_t val);
|
||||
void avio_wb64(AVIOContext *s, uint64_t val);
|
||||
void avio_wl32(AVIOContext *s, unsigned int val);
|
||||
void avio_wb32(AVIOContext *s, unsigned int val);
|
||||
void avio_wl24(AVIOContext *s, unsigned int val);
|
||||
void avio_wb24(AVIOContext *s, unsigned int val);
|
||||
void avio_wl16(AVIOContext *s, unsigned int val);
|
||||
void avio_wb16(AVIOContext *s, unsigned int val);
|
||||
|
||||
/**
|
||||
* Write a NULL-terminated string.
|
||||
* @return number of bytes written.
|
||||
*/
|
||||
int avio_put_str(AVIOContext *s, const char *str);
|
||||
|
||||
/**
|
||||
* Convert an UTF-8 string to UTF-16LE and write it.
|
||||
* @param s the AVIOContext
|
||||
* @param str NULL-terminated UTF-8 string
|
||||
*
|
||||
* @return number of bytes written.
|
||||
*/
|
||||
int avio_put_str16le(AVIOContext *s, const char *str);
|
||||
|
||||
/**
|
||||
* Convert an UTF-8 string to UTF-16BE and write it.
|
||||
* @param s the AVIOContext
|
||||
* @param str NULL-terminated UTF-8 string
|
||||
*
|
||||
* @return number of bytes written.
|
||||
*/
|
||||
int avio_put_str16be(AVIOContext *s, const char *str);
|
||||
|
||||
/**
|
||||
* Mark the written bytestream as a specific type.
|
||||
*
|
||||
* Zero-length ranges are omitted from the output.
|
||||
*
|
||||
* @param s the AVIOContext
|
||||
* @param time the stream time the current bytestream pos corresponds to
|
||||
* (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not
|
||||
* applicable
|
||||
* @param type the kind of data written starting at the current pos
|
||||
*/
|
||||
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type);
|
||||
|
||||
/**
|
||||
* Passing this as the "whence" parameter to a seek function causes it to
|
||||
* return the filesize without seeking anywhere. Supporting this is optional.
|
||||
* If it is not supported then the seek function will return <0.
|
||||
*/
|
||||
#define AVSEEK_SIZE 0x10000
|
||||
|
||||
/**
|
||||
* OR'ing this flag into the "whence" parameter to a seek function causes it to
|
||||
* seek by any means (like reopening and linear reading) or other normally unreasonable
|
||||
* means that can be extremely slow.
|
||||
* This is the default and therefore ignored by the seek code since 2010.
|
||||
*/
|
||||
#define AVSEEK_FORCE 0x20000
|
||||
|
||||
/**
|
||||
* fseek() equivalent for AVIOContext.
|
||||
* @return new position or AVERROR.
|
||||
*/
|
||||
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
|
||||
|
||||
/**
|
||||
* Skip given number of bytes forward
|
||||
* @return new position or AVERROR.
|
||||
*/
|
||||
int64_t avio_skip(AVIOContext *s, int64_t offset);
|
||||
|
||||
/**
|
||||
* ftell() equivalent for AVIOContext.
|
||||
* @return position or AVERROR.
|
||||
*/
|
||||
static av_always_inline int64_t avio_tell(AVIOContext *s)
|
||||
{
|
||||
return avio_seek(s, 0, SEEK_CUR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filesize.
|
||||
* @return filesize or AVERROR
|
||||
*/
|
||||
int64_t avio_size(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Similar to feof() but also returns nonzero on read errors.
|
||||
* @return non zero if and only if at end of file or a read error happened when reading.
|
||||
*/
|
||||
int avio_feof(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to the context taking a va_list.
|
||||
* @return number of bytes written, < 0 on error.
|
||||
*/
|
||||
int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to the context.
|
||||
* @return number of bytes written, < 0 on error.
|
||||
*/
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
|
||||
|
||||
/**
|
||||
* Write a NULL terminated array of strings to the context.
|
||||
* Usually you don't need to use this function directly but its macro wrapper,
|
||||
* avio_print.
|
||||
*/
|
||||
void avio_print_string_array(AVIOContext *s, const char * const strings[]);
|
||||
|
||||
/**
|
||||
* Write strings (const char *) to the context.
|
||||
* This is a convenience macro around avio_print_string_array and it
|
||||
* automatically creates the string array from the variable argument list.
|
||||
* For simple string concatenations this function is more performant than using
|
||||
* avio_printf since it does not need a temporary buffer.
|
||||
*/
|
||||
#define avio_print(s, ...) \
|
||||
avio_print_string_array(s, (const char*[]){__VA_ARGS__, NULL})
|
||||
|
||||
/**
|
||||
* Force flushing of buffered data.
|
||||
*
|
||||
* For write streams, force the buffered data to be immediately written to the output,
|
||||
* without to wait to fill the internal buffer.
|
||||
*
|
||||
* For read streams, discard all currently buffered data, and advance the
|
||||
* reported file position to that of the underlying stream. This does not
|
||||
* read new data, and does not perform any seeks.
|
||||
*/
|
||||
void avio_flush(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Read size bytes from AVIOContext into buf.
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int avio_read(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Read size bytes from AVIOContext into buf. Unlike avio_read(), this is allowed
|
||||
* to read fewer bytes than requested. The missing bytes can be read in the next
|
||||
* call. This always tries to read at least 1 byte.
|
||||
* Useful to reduce latency in certain cases.
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int avio_read_partial(AVIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* @name Functions for reading from AVIOContext
|
||||
* @{
|
||||
*
|
||||
* @note return 0 if EOF, so you cannot use it if EOF handling is
|
||||
* necessary
|
||||
*/
|
||||
int avio_r8 (AVIOContext *s);
|
||||
unsigned int avio_rl16(AVIOContext *s);
|
||||
unsigned int avio_rl24(AVIOContext *s);
|
||||
unsigned int avio_rl32(AVIOContext *s);
|
||||
uint64_t avio_rl64(AVIOContext *s);
|
||||
unsigned int avio_rb16(AVIOContext *s);
|
||||
unsigned int avio_rb24(AVIOContext *s);
|
||||
unsigned int avio_rb32(AVIOContext *s);
|
||||
uint64_t avio_rb64(AVIOContext *s);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Read a string from pb into buf. The reading will terminate when either
|
||||
* a NULL character was encountered, maxlen bytes have been read, or nothing
|
||||
* more can be read from pb. The result is guaranteed to be NULL-terminated, it
|
||||
* will be truncated if buf is too small.
|
||||
* Note that the string is not interpreted or validated in any way, it
|
||||
* might get truncated in the middle of a sequence for multi-byte encodings.
|
||||
*
|
||||
* @return number of bytes read (is always <= maxlen).
|
||||
* If reading ends on EOF or error, the return value will be one more than
|
||||
* bytes actually read.
|
||||
*/
|
||||
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
|
||||
/**
|
||||
* Read a UTF-16 string from pb and convert it to UTF-8.
|
||||
* The reading will terminate when either a null or invalid character was
|
||||
* encountered or maxlen bytes have been read.
|
||||
* @return number of bytes read (is always <= maxlen)
|
||||
*/
|
||||
int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
|
||||
|
||||
/**
|
||||
* @name URL open modes
|
||||
* The flags argument to avio_open must be one of the following
|
||||
* constants, optionally ORed with other flags.
|
||||
* @{
|
||||
*/
|
||||
#define AVIO_FLAG_READ 1 /**< read-only */
|
||||
#define AVIO_FLAG_WRITE 2 /**< write-only */
|
||||
#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Use non-blocking mode.
|
||||
* If this flag is set, operations on the context will return
|
||||
* AVERROR(EAGAIN) if they can not be performed immediately.
|
||||
* If this flag is not set, operations on the context will never return
|
||||
* AVERROR(EAGAIN).
|
||||
* Note that this flag does not affect the opening/connecting of the
|
||||
* context. Connecting a protocol will always block if necessary (e.g. on
|
||||
* network protocols) but never hang (e.g. on busy devices).
|
||||
* Warning: non-blocking protocols is work-in-progress; this flag may be
|
||||
* silently ignored.
|
||||
*/
|
||||
#define AVIO_FLAG_NONBLOCK 8
|
||||
|
||||
/**
|
||||
* Use direct mode.
|
||||
* avio_read and avio_write should if possible be satisfied directly
|
||||
* instead of going through a buffer, and avio_seek will always
|
||||
* call the underlying seek function directly.
|
||||
*/
|
||||
#define AVIO_FLAG_DIRECT 0x8000
|
||||
|
||||
/**
|
||||
* Create and initialize a AVIOContext for accessing the
|
||||
* resource indicated by url.
|
||||
* @note When the resource indicated by url has been opened in
|
||||
* read+write mode, the AVIOContext can be used only for writing.
|
||||
*
|
||||
* @param s Used to return the pointer to the created AVIOContext.
|
||||
* In case of failure the pointed to value is set to NULL.
|
||||
* @param url resource to access
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @return >= 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int avio_open(AVIOContext **s, const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Create and initialize a AVIOContext for accessing the
|
||||
* resource indicated by url.
|
||||
* @note When the resource indicated by url has been opened in
|
||||
* read+write mode, the AVIOContext can be used only for writing.
|
||||
*
|
||||
* @param s Used to return the pointer to the created AVIOContext.
|
||||
* In case of failure the pointed to value is set to NULL.
|
||||
* @param url resource to access
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @param int_cb an interrupt callback to be used at the protocols level
|
||||
* @param options A dictionary filled with protocol-private options. On return
|
||||
* this parameter will be destroyed and replaced with a dict containing options
|
||||
* that were not found. May be NULL.
|
||||
* @return >= 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int avio_open2(AVIOContext **s, const char *url, int flags,
|
||||
const AVIOInterruptCB *int_cb, AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Close the resource accessed by the AVIOContext s and free it.
|
||||
* This function can only be used if s was opened by avio_open().
|
||||
*
|
||||
* The internal buffer is automatically flushed before closing the
|
||||
* resource.
|
||||
*
|
||||
* @return 0 on success, an AVERROR < 0 on error.
|
||||
* @see avio_closep
|
||||
*/
|
||||
int avio_close(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Close the resource accessed by the AVIOContext *s, free it
|
||||
* and set the pointer pointing to it to NULL.
|
||||
* This function can only be used if s was opened by avio_open().
|
||||
*
|
||||
* The internal buffer is automatically flushed before closing the
|
||||
* resource.
|
||||
*
|
||||
* @return 0 on success, an AVERROR < 0 on error.
|
||||
* @see avio_close
|
||||
*/
|
||||
int avio_closep(AVIOContext **s);
|
||||
|
||||
|
||||
/**
|
||||
* Open a write only memory stream.
|
||||
*
|
||||
* @param s new IO context
|
||||
* @return zero if no error.
|
||||
*/
|
||||
int avio_open_dyn_buf(AVIOContext **s);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer.
|
||||
* The AVIOContext stream is left intact.
|
||||
* The buffer must NOT be freed.
|
||||
* No padding is added to the buffer.
|
||||
*
|
||||
* @param s IO context
|
||||
* @param pbuffer pointer to a byte buffer
|
||||
* @return the length of the byte buffer
|
||||
*/
|
||||
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
/**
|
||||
* Return the written size and a pointer to the buffer. The buffer
|
||||
* must be freed with av_free().
|
||||
* Padding of AV_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
|
||||
*
|
||||
* @param s IO context
|
||||
* @param pbuffer pointer to a byte buffer
|
||||
* @return the length of the byte buffer
|
||||
*/
|
||||
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
|
||||
|
||||
/**
|
||||
* Iterate through names of available protocols.
|
||||
*
|
||||
* @param opaque A private pointer representing current protocol.
|
||||
* It must be a pointer to NULL on first iteration and will
|
||||
* be updated by successive calls to avio_enum_protocols.
|
||||
* @param output If set to 1, iterate over output protocols,
|
||||
* otherwise over input protocols.
|
||||
*
|
||||
* @return A static string containing the name of current protocol or NULL
|
||||
*/
|
||||
const char *avio_enum_protocols(void **opaque, int output);
|
||||
|
||||
/**
|
||||
* Get AVClass by names of available protocols.
|
||||
*
|
||||
* @return A AVClass of input protocol name or NULL
|
||||
*/
|
||||
const AVClass *avio_protocol_get_class(const char *name);
|
||||
|
||||
/**
|
||||
* Pause and resume playing - only meaningful if using a network streaming
|
||||
* protocol (e.g. MMS).
|
||||
*
|
||||
* @param h IO context from which to call the read_pause function pointer
|
||||
* @param pause 1 for pause, 0 for resume
|
||||
*/
|
||||
int avio_pause(AVIOContext *h, int pause);
|
||||
|
||||
/**
|
||||
* Seek to a given timestamp relative to some component stream.
|
||||
* Only meaningful if using a network streaming protocol (e.g. MMS.).
|
||||
*
|
||||
* @param h IO context from which to call the seek function pointers
|
||||
* @param stream_index The stream index that the timestamp is relative to.
|
||||
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
|
||||
* units from the beginning of the presentation.
|
||||
* If a stream_index >= 0 is used and the protocol does not support
|
||||
* seeking based on component streams, the call will fail.
|
||||
* @param timestamp timestamp in AVStream.time_base units
|
||||
* or if there is no stream specified then in AV_TIME_BASE units.
|
||||
* @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
|
||||
* and AVSEEK_FLAG_ANY. The protocol may silently ignore
|
||||
* AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
|
||||
* fail if used and not supported.
|
||||
* @return >= 0 on success
|
||||
* @see AVInputFormat::read_seek
|
||||
*/
|
||||
int64_t avio_seek_time(AVIOContext *h, int stream_index,
|
||||
int64_t timestamp, int flags);
|
||||
|
||||
/* Avoid a warning. The header can not be included because it breaks c++. */
|
||||
struct AVBPrint;
|
||||
|
||||
/**
|
||||
* Read contents of h into print buffer, up to max_size bytes, or up to EOF.
|
||||
*
|
||||
* @return 0 for success (max_size bytes read or EOF reached), negative error
|
||||
* code otherwise
|
||||
*/
|
||||
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size);
|
||||
|
||||
/**
|
||||
* Accept and allocate a client context on a server context.
|
||||
* @param s the server context
|
||||
* @param c the client context, must be unallocated
|
||||
* @return >= 0 on success or a negative value corresponding
|
||||
* to an AVERROR on failure
|
||||
*/
|
||||
int avio_accept(AVIOContext *s, AVIOContext **c);
|
||||
|
||||
/**
|
||||
* Perform one step of the protocol handshake to accept a new client.
|
||||
* This function must be called on a client returned by avio_accept() before
|
||||
* using it as a read/write context.
|
||||
* It is separate from avio_accept() because it may block.
|
||||
* A step of the handshake is defined by places where the application may
|
||||
* decide to change the proceedings.
|
||||
* For example, on a protocol with a request header and a reply header, each
|
||||
* one can constitute a step because the application may use the parameters
|
||||
* from the request to change parameters in the reply; or each individual
|
||||
* chunk of the request can constitute a step.
|
||||
* If the handshake is already finished, avio_handshake() does nothing and
|
||||
* returns 0 immediately.
|
||||
*
|
||||
* @param c the client context to perform the handshake on
|
||||
* @return 0 on a complete and successful handshake
|
||||
* > 0 if the handshake progressed, but is not complete
|
||||
* < 0 for an AVERROR code
|
||||
*/
|
||||
int avio_handshake(AVIOContext *c);
|
||||
#endif /* AVFORMAT_AVIO_H */
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Version macros.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFORMAT_VERSION_H
|
||||
#define AVFORMAT_VERSION_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavf
|
||||
* Libavformat version macros
|
||||
*/
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MINOR 13
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
LIBAVFORMAT_VERSION_MICRO)
|
||||
#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
LIBAVFORMAT_VERSION_MICRO)
|
||||
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
|
||||
|
||||
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
|
||||
|
||||
#endif /* AVFORMAT_VERSION_H */
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Version macros.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVFORMAT_VERSION_MAJOR_H
|
||||
#define AVFORMAT_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavf
|
||||
* Libavformat version macros
|
||||
*/
|
||||
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 62
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*
|
||||
*/
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_INTERNAL_TIMING (LIBAVFORMAT_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_NO_DEFAULT_TLS_VERIFY (LIBAVFORMAT_VERSION_MAJOR < 63)
|
||||
|
||||
#define FF_API_R_FRAME_RATE 1
|
||||
|
||||
#endif /* AVFORMAT_VERSION_MAJOR_H */
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* copyright (c) 2006 Mans Rullgard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_adler32
|
||||
* Public header for Adler-32 hash function implementation.
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ADLER32_H
|
||||
#define AVUTIL_ADLER32_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_adler32 Adler-32
|
||||
* @ingroup lavu_hash
|
||||
* Adler-32 hash function implementation.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef uint32_t AVAdler;
|
||||
|
||||
/**
|
||||
* Calculate the Adler32 checksum of a buffer.
|
||||
*
|
||||
* Passing the return value to a subsequent av_adler32_update() call
|
||||
* allows the checksum of multiple buffers to be calculated as though
|
||||
* they were concatenated.
|
||||
*
|
||||
* @param adler initial checksum value
|
||||
* @param buf pointer to input buffer
|
||||
* @param len size of input buffer
|
||||
* @return updated checksum
|
||||
*/
|
||||
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
|
||||
size_t len) av_pure;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_ADLER32_H */
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* copyright (c) 2007 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AES_H
|
||||
#define AVUTIL_AES_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes AES
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_aes_size;
|
||||
|
||||
struct AVAES;
|
||||
|
||||
/**
|
||||
* Allocate an AVAES context.
|
||||
*/
|
||||
struct AVAES *av_aes_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVAES context.
|
||||
*
|
||||
* @param a The AVAES context
|
||||
* @param key Pointer to the key
|
||||
* @param key_bits 128, 192 or 256
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context.
|
||||
*
|
||||
* @param a The AVAES context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 16 byte blocks
|
||||
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AES_H */
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* AES-CTR cipher
|
||||
* Copyright (c) 2015 Eran Kornblau <erankor at gmail dot com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AES_CTR_H
|
||||
#define AVUTIL_AES_CTR_H
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes_ctr AES-CTR
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
|
||||
#define AES_CTR_KEY_SIZE (16)
|
||||
#define AES_CTR_IV_SIZE (8)
|
||||
|
||||
struct AVAESCTR;
|
||||
|
||||
/**
|
||||
* Allocate an AVAESCTR context.
|
||||
*/
|
||||
struct AVAESCTR *av_aes_ctr_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVAESCTR context.
|
||||
*
|
||||
* @param a The AVAESCTR context to initialize
|
||||
* @param key encryption key, must have a length of AES_CTR_KEY_SIZE
|
||||
*/
|
||||
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
|
||||
|
||||
/**
|
||||
* Release an AVAESCTR context.
|
||||
*
|
||||
* @param a The AVAESCTR context
|
||||
*/
|
||||
void av_aes_ctr_free(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* Process a buffer using a previously initialized context.
|
||||
*
|
||||
* @param a The AVAESCTR context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param size the size of src and dst
|
||||
*/
|
||||
void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
|
||||
|
||||
/**
|
||||
* Get the current iv
|
||||
*/
|
||||
const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* Generate a random iv
|
||||
*/
|
||||
void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* Forcefully change the 8-byte iv
|
||||
*/
|
||||
void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
|
||||
|
||||
/**
|
||||
* Forcefully change the "full" 16-byte iv, including the counter
|
||||
*/
|
||||
void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv);
|
||||
|
||||
/**
|
||||
* Increment the top 64 bit of the iv (performed after each frame)
|
||||
*/
|
||||
void av_aes_ctr_increment_iv(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AES_CTR_H */
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Jan Ekström <jeebjp@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
|
||||
#define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "frame.h"
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
* Ambient viewing environment metadata as defined by H.274. The values are
|
||||
* saved in AVRationals so that they keep their exactness, while allowing for
|
||||
* easy access to a double value with f.ex. av_q2d.
|
||||
*
|
||||
* @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and
|
||||
* it must be allocated using av_ambient_viewing_environment_alloc.
|
||||
*/
|
||||
typedef struct AVAmbientViewingEnvironment {
|
||||
/**
|
||||
* Environmental illuminance of the ambient viewing environment in lux.
|
||||
*/
|
||||
AVRational ambient_illuminance;
|
||||
|
||||
/**
|
||||
* Normalized x chromaticity coordinate of the environmental ambient light
|
||||
* in the nominal viewing environment according to the CIE 1931 definition
|
||||
* of x and y as specified in ISO/CIE 11664-1.
|
||||
*/
|
||||
AVRational ambient_light_x;
|
||||
|
||||
/**
|
||||
* Normalized y chromaticity coordinate of the environmental ambient light
|
||||
* in the nominal viewing environment according to the CIE 1931 definition
|
||||
* of x and y as specified in ISO/CIE 11664-1.
|
||||
*/
|
||||
AVRational ambient_light_y;
|
||||
} AVAmbientViewingEnvironment;
|
||||
|
||||
/**
|
||||
* Allocate an AVAmbientViewingEnvironment structure.
|
||||
*
|
||||
* @return the newly allocated struct or NULL on failure
|
||||
*/
|
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* Allocate and add an AVAmbientViewingEnvironment structure to an existing
|
||||
* AVFrame as side data.
|
||||
*
|
||||
* @return the newly allocated struct, or NULL on failure
|
||||
*/
|
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame);
|
||||
|
||||
#endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Macro definitions for various function/variable attributes
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ATTRIBUTES_H
|
||||
#define AVUTIL_ATTRIBUTES_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
|
||||
# define AV_GCC_VERSION_AT_MOST(x,y) (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y))
|
||||
#else
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) 0
|
||||
# define AV_GCC_VERSION_AT_MOST(x,y) 0
|
||||
#endif
|
||||
|
||||
#ifdef __has_builtin
|
||||
# define AV_HAS_BUILTIN(x) __has_builtin(x)
|
||||
#else
|
||||
# define AV_HAS_BUILTIN(x) 0
|
||||
#endif
|
||||
|
||||
#ifdef __has_attribute
|
||||
# define AV_HAS_ATTRIBUTE(x) __has_attribute(x)
|
||||
#else
|
||||
# define AV_HAS_ATTRIBUTE(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && \
|
||||
defined(__has_cpp_attribute) && \
|
||||
__cplusplus >= 201103L
|
||||
# define AV_HAS_STD_ATTRIBUTE(x) __has_cpp_attribute(x)
|
||||
#elif !defined(__cplusplus) && \
|
||||
defined(__has_c_attribute) && \
|
||||
defined(__STDC_VERSION__) && \
|
||||
__STDC_VERSION__ >= 202311L
|
||||
# define AV_HAS_STD_ATTRIBUTE(x) __has_c_attribute(x)
|
||||
#else
|
||||
# define AV_HAS_STD_ATTRIBUTE(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef av_always_inline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define av_always_inline __attribute__((always_inline)) inline
|
||||
#elif defined(_MSC_VER)
|
||||
# define av_always_inline __forceinline
|
||||
#else
|
||||
# define av_always_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_extern_inline
|
||||
#if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
|
||||
# define av_extern_inline extern inline
|
||||
#else
|
||||
# define av_extern_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if AV_HAS_STD_ATTRIBUTE(nodiscard)
|
||||
# define av_warn_unused_result [[nodiscard]]
|
||||
#elif AV_GCC_VERSION_AT_LEAST(3,4) || defined(__clang__)
|
||||
# define av_warn_unused_result __attribute__((warn_unused_result))
|
||||
#else
|
||||
# define av_warn_unused_result
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
#elif defined(_MSC_VER)
|
||||
# define av_noinline __declspec(noinline)
|
||||
#else
|
||||
# define av_noinline
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6) || defined(__clang__)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,3) || defined(__clang__)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
|
||||
# define av_flatten __attribute__((flatten))
|
||||
#else
|
||||
# define av_flatten
|
||||
#endif
|
||||
|
||||
#if AV_HAS_STD_ATTRIBUTE(deprecated)
|
||||
# define attribute_deprecated [[deprecated]]
|
||||
#elif AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define attribute_deprecated __attribute__((deprecated))
|
||||
#elif defined(_MSC_VER)
|
||||
# define attribute_deprecated __declspec(deprecated)
|
||||
#else
|
||||
# define attribute_deprecated
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Disable warnings about deprecated features
|
||||
* This is useful for sections of code kept for backward compatibility and
|
||||
* scheduled for removal.
|
||||
*/
|
||||
#ifndef AV_NOWARN_DEPRECATED
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,6) || defined(__clang__)
|
||||
# define AV_NOWARN_DEPRECATED(code) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||
code \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
#elif defined(_MSC_VER)
|
||||
# define AV_NOWARN_DEPRECATED(code) \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable : 4996)) \
|
||||
code; \
|
||||
__pragma(warning(pop))
|
||||
#else
|
||||
# define AV_NOWARN_DEPRECATED(code) code
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if AV_HAS_STD_ATTRIBUTE(maybe_unused)
|
||||
# define av_unused [[maybe_unused]]
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define av_unused __attribute__((unused))
|
||||
#else
|
||||
# define av_unused
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Mark a variable as used and prevent the compiler from optimizing it
|
||||
* away. This is useful for variables accessed only from inline
|
||||
* assembler without the compiler being aware.
|
||||
*/
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
|
||||
# define av_used __attribute__((used))
|
||||
#else
|
||||
# define av_used
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,3) || defined(__clang__)
|
||||
# define av_alias __attribute__((may_alias))
|
||||
#else
|
||||
# define av_alias
|
||||
#endif
|
||||
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
# define av_builtin_constant_p __builtin_constant_p
|
||||
#else
|
||||
# define av_builtin_constant_p(x) 0
|
||||
#endif
|
||||
|
||||
// for __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT
|
||||
#ifdef __MINGW32__
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_PRINTF_FORMAT
|
||||
# define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
|
||||
#elif AV_HAS_ATTRIBUTE(format)
|
||||
# define AV_PRINTF_FMT __printf__
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW_SCANF_FORMAT
|
||||
# define AV_SCANF_FMT __MINGW_SCANF_FORMAT
|
||||
#elif AV_HAS_ATTRIBUTE(format)
|
||||
# define AV_SCANF_FMT __scanf__
|
||||
#endif
|
||||
|
||||
#ifdef AV_PRINTF_FMT
|
||||
# define av_printf_format(fmtpos, attrpos) __attribute__((format(AV_PRINTF_FMT, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_printf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
#ifdef AV_SCANF_FMT
|
||||
# define av_scanf_format(fmtpos, attrpos) __attribute__((format(AV_SCANF_FMT, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_scanf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
#if AV_HAS_STD_ATTRIBUTE(noreturn)
|
||||
# define av_noreturn [[noreturn]]
|
||||
#elif AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)
|
||||
# define av_noreturn __attribute__((noreturn))
|
||||
#else
|
||||
# define av_noreturn
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_ATTRIBUTES_H */
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* Audio FIFO
|
||||
* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Audio FIFO Buffer
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AUDIO_FIFO_H
|
||||
#define AVUTIL_AUDIO_FIFO_H
|
||||
|
||||
#include "attributes.h"
|
||||
#include "samplefmt.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_audiofifo Audio FIFO Buffer
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Context for an Audio FIFO Buffer.
|
||||
*
|
||||
* - Operates at the sample level rather than the byte level.
|
||||
* - Supports multiple channels with either planar or packed sample format.
|
||||
* - Automatic reallocation when writing to a full buffer.
|
||||
*/
|
||||
typedef struct AVAudioFifo AVAudioFifo;
|
||||
|
||||
/**
|
||||
* Free an AVAudioFifo.
|
||||
*
|
||||
* @param af AVAudioFifo to free
|
||||
*/
|
||||
void av_audio_fifo_free(AVAudioFifo *af);
|
||||
|
||||
/**
|
||||
* Allocate an AVAudioFifo.
|
||||
*
|
||||
* @param sample_fmt sample format
|
||||
* @param channels number of channels
|
||||
* @param nb_samples initial allocation size, in samples
|
||||
* @return newly allocated AVAudioFifo, or NULL on error
|
||||
*/
|
||||
AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
|
||||
int nb_samples);
|
||||
|
||||
/**
|
||||
* Reallocate an AVAudioFifo.
|
||||
*
|
||||
* @param af AVAudioFifo to reallocate
|
||||
* @param nb_samples new allocation size, in samples
|
||||
* @return 0 if OK, or negative AVERROR code on failure
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
|
||||
|
||||
/**
|
||||
* Write data to an AVAudioFifo.
|
||||
*
|
||||
* The AVAudioFifo will be reallocated automatically if the available space
|
||||
* is less than nb_samples.
|
||||
*
|
||||
* @see enum AVSampleFormat
|
||||
* The documentation for AVSampleFormat describes the data layout.
|
||||
*
|
||||
* @param af AVAudioFifo to write to
|
||||
* @param data audio data plane pointers
|
||||
* @param nb_samples number of samples to write
|
||||
* @return number of samples actually written, or negative AVERROR
|
||||
* code on failure. If successful, the number of samples
|
||||
* actually written will always be nb_samples.
|
||||
*/
|
||||
int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples);
|
||||
|
||||
/**
|
||||
* Peek data from an AVAudioFifo.
|
||||
*
|
||||
* @see enum AVSampleFormat
|
||||
* The documentation for AVSampleFormat describes the data layout.
|
||||
*
|
||||
* @param af AVAudioFifo to read from
|
||||
* @param data audio data plane pointers
|
||||
* @param nb_samples number of samples to peek
|
||||
* @return number of samples actually peek, or negative AVERROR code
|
||||
* on failure. The number of samples actually peek will not
|
||||
* be greater than nb_samples, and will only be less than
|
||||
* nb_samples if av_audio_fifo_size is less than nb_samples.
|
||||
*/
|
||||
int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples);
|
||||
|
||||
/**
|
||||
* Peek data from an AVAudioFifo.
|
||||
*
|
||||
* @see enum AVSampleFormat
|
||||
* The documentation for AVSampleFormat describes the data layout.
|
||||
*
|
||||
* @param af AVAudioFifo to read from
|
||||
* @param data audio data plane pointers
|
||||
* @param nb_samples number of samples to peek
|
||||
* @param offset offset from current read position
|
||||
* @return number of samples actually peek, or negative AVERROR code
|
||||
* on failure. The number of samples actually peek will not
|
||||
* be greater than nb_samples, and will only be less than
|
||||
* nb_samples if av_audio_fifo_size is less than nb_samples.
|
||||
*/
|
||||
int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data,
|
||||
int nb_samples, int offset);
|
||||
|
||||
/**
|
||||
* Read data from an AVAudioFifo.
|
||||
*
|
||||
* @see enum AVSampleFormat
|
||||
* The documentation for AVSampleFormat describes the data layout.
|
||||
*
|
||||
* @param af AVAudioFifo to read from
|
||||
* @param data audio data plane pointers
|
||||
* @param nb_samples number of samples to read
|
||||
* @return number of samples actually read, or negative AVERROR code
|
||||
* on failure. The number of samples actually read will not
|
||||
* be greater than nb_samples, and will only be less than
|
||||
* nb_samples if av_audio_fifo_size is less than nb_samples.
|
||||
*/
|
||||
int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples);
|
||||
|
||||
/**
|
||||
* Drain data from an AVAudioFifo.
|
||||
*
|
||||
* Removes the data without reading it.
|
||||
*
|
||||
* @param af AVAudioFifo to drain
|
||||
* @param nb_samples number of samples to drain
|
||||
* @return 0 if OK, or negative AVERROR code on failure
|
||||
*/
|
||||
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
|
||||
|
||||
/**
|
||||
* Reset the AVAudioFifo buffer.
|
||||
*
|
||||
* This empties all data in the buffer.
|
||||
*
|
||||
* @param af AVAudioFifo to reset
|
||||
*/
|
||||
void av_audio_fifo_reset(AVAudioFifo *af);
|
||||
|
||||
/**
|
||||
* Get the current number of samples in the AVAudioFifo available for reading.
|
||||
*
|
||||
* @param af the AVAudioFifo to query
|
||||
* @return number of samples available for reading
|
||||
*/
|
||||
int av_audio_fifo_size(AVAudioFifo *af);
|
||||
|
||||
/**
|
||||
* Get the current number of samples in the AVAudioFifo available for writing.
|
||||
*
|
||||
* @param af the AVAudioFifo to query
|
||||
* @return number of samples available for writing
|
||||
*/
|
||||
int av_audio_fifo_space(AVAudioFifo *af);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AUDIO_FIFO_H */
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* copyright (c) 2010 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* simple assert() macros that are a bit more flexible than ISO C assert().
|
||||
* @author Michael Niedermayer <michaelni@gmx.at>
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AVASSERT_H
|
||||
#define AVUTIL_AVASSERT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include "attributes.h"
|
||||
#include "log.h"
|
||||
#include "macros.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* assert() equivalent, that is always enabled.
|
||||
*/
|
||||
#define av_assert0(cond) do { \
|
||||
if (!(cond)) { \
|
||||
av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
|
||||
AV_STRINGIFY(cond), __FILE__, __LINE__); \
|
||||
abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/**
|
||||
* assert() equivalent, that does not lie in speed critical code.
|
||||
* These asserts() thus can be enabled without fearing speed loss.
|
||||
*/
|
||||
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
|
||||
#define av_assert1(cond) av_assert0(cond)
|
||||
#else
|
||||
#define av_assert1(cond) ((void)0)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* assert() equivalent, that does lie in speed critical code.
|
||||
*/
|
||||
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
|
||||
#define av_assert2(cond) av_assert0(cond)
|
||||
#else
|
||||
#define av_assert2(cond) ((void)0)
|
||||
#endif
|
||||
|
||||
#if FF_API_ASSERT_FPU
|
||||
#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
|
||||
#define av_assert2_fpu() av_assert0_fpu()
|
||||
#else
|
||||
#define av_assert2_fpu() ((void)0)
|
||||
#endif
|
||||
/**
|
||||
* Assert that floating point operations can be executed.
|
||||
*
|
||||
* This will av_assert0() that the cpu is not in MMX state on X86
|
||||
* @deprecated without replacement
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_assert0_fpu(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Asserts that are used as compiler optimization hints depending
|
||||
* upon ASSERT_LEVEL and NBDEBUG.
|
||||
*
|
||||
* Undefined behaviour occurs if execution reaches a point marked
|
||||
* with av_unreachable() or if a condition used with av_assume()
|
||||
* is false.
|
||||
*
|
||||
* The condition used with av_assume() should not have side-effects
|
||||
* and should be visible to the compiler.
|
||||
*/
|
||||
#if defined(ASSERT_LEVEL) ? ASSERT_LEVEL > 0 : !defined(HAVE_AV_CONFIG_H) && !defined(NDEBUG)
|
||||
#define av_unreachable(msg) \
|
||||
do { \
|
||||
av_log(NULL, AV_LOG_PANIC, \
|
||||
"Reached supposedly unreachable code at %s:%d: %s\n", \
|
||||
__FILE__, __LINE__, msg); \
|
||||
abort(); \
|
||||
} while (0)
|
||||
#define av_assume(cond) av_assert0(cond)
|
||||
#else
|
||||
#if AV_GCC_VERSION_AT_LEAST(4, 5) || AV_HAS_BUILTIN(__builtin_unreachable)
|
||||
#define av_unreachable(msg) __builtin_unreachable()
|
||||
#elif defined(_MSC_VER)
|
||||
#define av_unreachable(msg) __assume(0)
|
||||
#elif __STDC_VERSION__ >= 202311L
|
||||
#include <stddef.h>
|
||||
#define av_unreachable(msg) unreachable()
|
||||
#else
|
||||
#define av_unreachable(msg) ((void)0)
|
||||
#endif
|
||||
|
||||
#define av_assume(cond) do { \
|
||||
if (!(cond)) \
|
||||
av_unreachable(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_AVASSERT_H */
|
||||
@@ -0,0 +1,6 @@
|
||||
/* Generated by ffmpeg configure */
|
||||
#ifndef AVUTIL_AVCONFIG_H
|
||||
#define AVUTIL_AVCONFIG_H
|
||||
#define AV_HAVE_BIGENDIAN 0
|
||||
#define AV_HAVE_FAST_UNALIGNED 1
|
||||
#endif /* AVUTIL_AVCONFIG_H */
|
||||
+428
@@ -0,0 +1,428 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Mans Rullgard
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AVSTRING_H
|
||||
#define AVUTIL_AVSTRING_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_string
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
|
||||
* the address of the first character in str after the prefix.
|
||||
*
|
||||
* @param str input string
|
||||
* @param pfx prefix to test
|
||||
* @param ptr updated if the prefix is matched inside str
|
||||
* @return non-zero if the prefix matches, zero otherwise
|
||||
*/
|
||||
int av_strstart(const char *str, const char *pfx, const char **ptr);
|
||||
|
||||
/**
|
||||
* Return non-zero if pfx is a prefix of str independent of case. If
|
||||
* it is, *ptr is set to the address of the first character in str
|
||||
* after the prefix.
|
||||
*
|
||||
* @param str input string
|
||||
* @param pfx prefix to test
|
||||
* @param ptr updated if the prefix is matched inside str
|
||||
* @return non-zero if the prefix matches, zero otherwise
|
||||
*/
|
||||
int av_stristart(const char *str, const char *pfx, const char **ptr);
|
||||
|
||||
/**
|
||||
* Locate the first case-independent occurrence in the string haystack
|
||||
* of the string needle. A zero-length string needle is considered to
|
||||
* match at the start of haystack.
|
||||
*
|
||||
* This function is a case-insensitive version of the standard strstr().
|
||||
*
|
||||
* @param haystack string to search in
|
||||
* @param needle string to search for
|
||||
* @return pointer to the located match within haystack
|
||||
* or a null pointer if no match
|
||||
*/
|
||||
char *av_stristr(const char *haystack, const char *needle);
|
||||
|
||||
/**
|
||||
* Locate the first occurrence of the string needle in the string haystack
|
||||
* where not more than hay_length characters are searched. A zero-length
|
||||
* string needle is considered to match at the start of haystack.
|
||||
*
|
||||
* This function is a length-limited version of the standard strstr().
|
||||
*
|
||||
* @param haystack string to search in
|
||||
* @param needle string to search for
|
||||
* @param hay_length length of string to search in
|
||||
* @return pointer to the located match within haystack
|
||||
* or a null pointer if no match
|
||||
*/
|
||||
char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
|
||||
|
||||
/**
|
||||
* Copy the string src to dst, but no more than size - 1 bytes, and
|
||||
* null-terminate dst.
|
||||
*
|
||||
* This function is the same as BSD strlcpy().
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param src source string
|
||||
* @param size size of destination buffer
|
||||
* @return the length of src
|
||||
*
|
||||
* @warning since the return value is the length of src, src absolutely
|
||||
* _must_ be a properly 0-terminated string, otherwise this will read beyond
|
||||
* the end of the buffer and possibly crash.
|
||||
*/
|
||||
size_t av_strlcpy(char *dst, const char *src, size_t size);
|
||||
|
||||
/**
|
||||
* Append the string src to the string dst, but to a total length of
|
||||
* no more than size - 1 bytes, and null-terminate dst.
|
||||
*
|
||||
* This function is similar to BSD strlcat(), but differs when
|
||||
* size <= strlen(dst).
|
||||
*
|
||||
* @param dst destination buffer
|
||||
* @param src source string
|
||||
* @param size size of destination buffer
|
||||
* @return the total length of src and dst
|
||||
*
|
||||
* @warning since the return value use the length of src and dst, these
|
||||
* absolutely _must_ be a properly 0-terminated strings, otherwise this
|
||||
* will read beyond the end of the buffer and possibly crash.
|
||||
*/
|
||||
size_t av_strlcat(char *dst, const char *src, size_t size);
|
||||
|
||||
/**
|
||||
* Append output to a string, according to a format. Never write out of
|
||||
* the destination buffer, and always put a terminating 0 within
|
||||
* the buffer.
|
||||
* @param dst destination buffer (string to which the output is
|
||||
* appended)
|
||||
* @param size total size of the destination buffer
|
||||
* @param fmt printf-compatible format string, specifying how the
|
||||
* following parameters are used
|
||||
* @return the length of the string that would have been generated
|
||||
* if enough space had been available
|
||||
*/
|
||||
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
|
||||
|
||||
/**
|
||||
* Get the count of continuous non zero chars starting from the beginning.
|
||||
*
|
||||
* @param s the string whose length to count
|
||||
* @param len maximum number of characters to check in the string, that
|
||||
* is the maximum value which is returned by the function
|
||||
*/
|
||||
static inline size_t av_strnlen(const char *s, size_t len)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < len && s[i]; i++)
|
||||
;
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print arguments following specified format into a large enough auto
|
||||
* allocated buffer. It is similar to GNU asprintf().
|
||||
* @param fmt printf-compatible format string, specifying how the
|
||||
* following parameters are used.
|
||||
* @return the allocated string
|
||||
* @note You have to free the string yourself with av_free().
|
||||
*/
|
||||
char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
|
||||
|
||||
/**
|
||||
* Unescape the given string until a non escaped terminating char,
|
||||
* and return the token corresponding to the unescaped string.
|
||||
*
|
||||
* The normal \ and ' escaping is supported. Leading and trailing
|
||||
* whitespaces are removed, unless they are escaped with '\' or are
|
||||
* enclosed between ''.
|
||||
*
|
||||
* @param buf the buffer to parse, buf will be updated to point to the
|
||||
* terminating char
|
||||
* @param term a 0-terminated list of terminating chars
|
||||
* @return the malloced unescaped string, which must be av_freed by
|
||||
* the user, NULL in case of allocation failure
|
||||
*/
|
||||
char *av_get_token(const char **buf, const char *term);
|
||||
|
||||
/**
|
||||
* Split the string into several tokens which can be accessed by
|
||||
* successive calls to av_strtok().
|
||||
*
|
||||
* A token is defined as a sequence of characters not belonging to the
|
||||
* set specified in delim.
|
||||
*
|
||||
* On the first call to av_strtok(), s should point to the string to
|
||||
* parse, and the value of saveptr is ignored. In subsequent calls, s
|
||||
* should be NULL, and saveptr should be unchanged since the previous
|
||||
* call.
|
||||
*
|
||||
* This function is similar to strtok_r() defined in POSIX.1.
|
||||
*
|
||||
* @param s the string to parse, may be NULL
|
||||
* @param delim 0-terminated list of token delimiters, must be non-NULL
|
||||
* @param saveptr user-provided pointer which points to stored
|
||||
* information necessary for av_strtok() to continue scanning the same
|
||||
* string. saveptr is updated to point to the next character after the
|
||||
* first delimiter found, or to NULL if the string was terminated
|
||||
* @return the found token, or NULL when no token is found
|
||||
*/
|
||||
char *av_strtok(char *s, const char *delim, char **saveptr);
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isdigit.
|
||||
*/
|
||||
static inline av_const int av_isdigit(int c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isgraph.
|
||||
*/
|
||||
static inline av_const int av_isgraph(int c)
|
||||
{
|
||||
return c > 32 && c < 127;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isspace.
|
||||
*/
|
||||
static inline av_const int av_isspace(int c)
|
||||
{
|
||||
return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
|
||||
c == '\v';
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII characters to uppercase.
|
||||
*/
|
||||
static inline av_const int av_toupper(int c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
c ^= 0x20;
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII characters to lowercase.
|
||||
*/
|
||||
static inline av_const int av_tolower(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
c ^= 0x20;
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isxdigit.
|
||||
*/
|
||||
static inline av_const int av_isxdigit(int c)
|
||||
{
|
||||
c = av_tolower(c);
|
||||
return av_isdigit(c) || (c >= 'a' && c <= 'f');
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent case-insensitive compare.
|
||||
* @note This means only ASCII-range characters are case-insensitive
|
||||
*/
|
||||
int av_strcasecmp(const char *a, const char *b);
|
||||
|
||||
/**
|
||||
* Locale-independent case-insensitive compare.
|
||||
* @note This means only ASCII-range characters are case-insensitive
|
||||
*/
|
||||
int av_strncasecmp(const char *a, const char *b, size_t n);
|
||||
|
||||
/**
|
||||
* Locale-independent strings replace.
|
||||
* @note This means only ASCII-range characters are replaced.
|
||||
*/
|
||||
char *av_strireplace(const char *str, const char *from, const char *to);
|
||||
|
||||
/**
|
||||
* Thread safe basename.
|
||||
* @param path the string to parse, on DOS both \ and / are considered separators.
|
||||
* @return pointer to the basename substring.
|
||||
* If path does not contain a slash, the function returns a copy of path.
|
||||
* If path is a NULL pointer or points to an empty string, a pointer
|
||||
* to a string "." is returned.
|
||||
*/
|
||||
const char *av_basename(const char *path);
|
||||
|
||||
/**
|
||||
* Thread safe dirname.
|
||||
* @param path the string to parse, on DOS both \ and / are considered separators.
|
||||
* @return A pointer to a string that's the parent directory of path.
|
||||
* If path is a NULL pointer or points to an empty string, a pointer
|
||||
* to a string "." is returned.
|
||||
* @note the function may modify the contents of the path, so copies should be passed.
|
||||
*/
|
||||
const char *av_dirname(char *path);
|
||||
|
||||
/**
|
||||
* Match instances of a name in a comma-separated list of names.
|
||||
* List entries are checked from the start to the end of the names list,
|
||||
* the first match ends further processing. If an entry prefixed with '-'
|
||||
* matches, then 0 is returned. The "ALL" list entry is considered to
|
||||
* match all names.
|
||||
*
|
||||
* @param name Name to look for.
|
||||
* @param names List of names.
|
||||
* @return 1 on match, 0 otherwise.
|
||||
*/
|
||||
int av_match_name(const char *name, const char *names);
|
||||
|
||||
/**
|
||||
* Append path component to the existing path.
|
||||
* Path separator '/' is placed between when needed.
|
||||
* Resulting string have to be freed with av_free().
|
||||
* @param path base path
|
||||
* @param component component to be appended
|
||||
* @return new path or NULL on error.
|
||||
*/
|
||||
char *av_append_path_component(const char *path, const char *component);
|
||||
|
||||
enum AVEscapeMode {
|
||||
AV_ESCAPE_MODE_AUTO, ///< Use auto-selected escaping mode.
|
||||
AV_ESCAPE_MODE_BACKSLASH, ///< Use backslash escaping.
|
||||
AV_ESCAPE_MODE_QUOTE, ///< Use single-quote escaping.
|
||||
AV_ESCAPE_MODE_XML, ///< Use XML non-markup character data escaping.
|
||||
};
|
||||
|
||||
/**
|
||||
* Consider spaces special and escape them even in the middle of the
|
||||
* string.
|
||||
*
|
||||
* This is equivalent to adding the whitespace characters to the special
|
||||
* characters lists, except it is guaranteed to use the exact same list
|
||||
* of whitespace characters as the rest of libavutil.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_WHITESPACE (1 << 0)
|
||||
|
||||
/**
|
||||
* Escape only specified special characters.
|
||||
* Without this flag, escape also any characters that may be considered
|
||||
* special by av_get_token(), such as the single quote.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_STRICT (1 << 1)
|
||||
|
||||
/**
|
||||
* Within AV_ESCAPE_MODE_XML, additionally escape single quotes for single
|
||||
* quoted attributes.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_XML_SINGLE_QUOTES (1 << 2)
|
||||
|
||||
/**
|
||||
* Within AV_ESCAPE_MODE_XML, additionally escape double quotes for double
|
||||
* quoted attributes.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES (1 << 3)
|
||||
|
||||
|
||||
/**
|
||||
* Escape string in src, and put the escaped string in an allocated
|
||||
* string in *dst, which must be freed with av_free().
|
||||
*
|
||||
* @param dst pointer where an allocated string is put
|
||||
* @param src string to escape, must be non-NULL
|
||||
* @param special_chars string containing the special characters which
|
||||
* need to be escaped, can be NULL
|
||||
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros.
|
||||
* Any unknown value for mode will be considered equivalent to
|
||||
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without
|
||||
* notice.
|
||||
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_ macros
|
||||
* @return the length of the allocated string, or a negative error code in case of error
|
||||
* @see av_bprint_escape()
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_escape(char **dst, const char *src, const char *special_chars,
|
||||
enum AVEscapeMode mode, int flags);
|
||||
|
||||
#define AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES 1 ///< accept codepoints over 0x10FFFF
|
||||
#define AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS 2 ///< accept non-characters - 0xFFFE and 0xFFFF
|
||||
#define AV_UTF8_FLAG_ACCEPT_SURROGATES 4 ///< accept UTF-16 surrogates codes
|
||||
#define AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES 8 ///< exclude control codes not accepted by XML
|
||||
|
||||
#define AV_UTF8_FLAG_ACCEPT_ALL \
|
||||
AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES|AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS|AV_UTF8_FLAG_ACCEPT_SURROGATES
|
||||
|
||||
/**
|
||||
* Read and decode a single UTF-8 code point (character) from the
|
||||
* buffer in *buf, and update *buf to point to the next byte to
|
||||
* decode.
|
||||
*
|
||||
* In case of an invalid byte sequence, the pointer will be updated to
|
||||
* the next byte after the invalid sequence and the function will
|
||||
* return an error code.
|
||||
*
|
||||
* Depending on the specified flags, the function will also fail in
|
||||
* case the decoded code point does not belong to a valid range.
|
||||
*
|
||||
* @note For speed-relevant code a carefully implemented use of
|
||||
* GET_UTF8() may be preferred.
|
||||
*
|
||||
* @param codep pointer used to return the parsed code in case of success.
|
||||
* The value in *codep is set even in case the range check fails.
|
||||
* @param bufp pointer to the address the first byte of the sequence
|
||||
* to decode, updated by the function to point to the
|
||||
* byte next after the decoded sequence
|
||||
* @param buf_end pointer to the end of the buffer, points to the next
|
||||
* byte past the last in the buffer. This is used to
|
||||
* avoid buffer overreads (in case of an unfinished
|
||||
* UTF-8 sequence towards the end of the buffer).
|
||||
* @param flags a collection of AV_UTF8_FLAG_* flags
|
||||
* @return >= 0 in case a sequence was successfully read, a negative
|
||||
* value in case of invalid sequence
|
||||
*/
|
||||
av_warn_unused_result
|
||||
int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
|
||||
unsigned int flags);
|
||||
|
||||
/**
|
||||
* Check if a name is in a list.
|
||||
* @returns 0 if not found, or the 1 based index where it has been found in the
|
||||
* list.
|
||||
*/
|
||||
int av_match_list(const char *name, const char *list, char separator);
|
||||
|
||||
/**
|
||||
* See libc sscanf manual for more information.
|
||||
* Locale-independent sscanf implementation.
|
||||
*/
|
||||
int av_sscanf(const char *string, const char *format, ...) av_scanf_format(2, 3);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AVSTRING_H */
|
||||
+364
@@ -0,0 +1,364 @@
|
||||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AVUTIL_H
|
||||
#define AVUTIL_AVUTIL_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu
|
||||
* Convenience header that includes @ref lavu "libavutil"'s core.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @mainpage
|
||||
*
|
||||
* @section ffmpeg_intro Introduction
|
||||
*
|
||||
* This document describes the usage of the different libraries
|
||||
* provided by FFmpeg.
|
||||
*
|
||||
* @li @ref libavc "libavcodec" encoding/decoding library
|
||||
* @li @ref lavfi "libavfilter" graph-based frame editing library
|
||||
* @li @ref libavf "libavformat" I/O and muxing/demuxing library
|
||||
* @li @ref lavd "libavdevice" special devices muxing/demuxing library
|
||||
* @li @ref lavu "libavutil" common utility library
|
||||
* @li @ref lswr "libswresample" audio resampling, format conversion and mixing
|
||||
* @li @ref libsws "libswscale" color conversion and scaling library
|
||||
*
|
||||
* @section ffmpeg_versioning Versioning and compatibility
|
||||
*
|
||||
* Each of the FFmpeg libraries contains a version.h header, which defines a
|
||||
* major, minor and micro version number with the
|
||||
* <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
|
||||
* number is incremented with backward incompatible changes - e.g. removing
|
||||
* parts of the public API, reordering public struct members, etc. The minor
|
||||
* version number is incremented for backward compatible API changes or major
|
||||
* new features - e.g. adding a new public function or a new decoder. The micro
|
||||
* version number is incremented for smaller changes that a calling program
|
||||
* might still want to check for - e.g. changing behavior in a previously
|
||||
* unspecified situation.
|
||||
*
|
||||
* FFmpeg guarantees backward API and ABI compatibility for each library as long
|
||||
* as its major version number is unchanged. This means that no public symbols
|
||||
* will be removed or renamed. Types and names of the public struct members and
|
||||
* values of public macros and enums will remain the same (unless they were
|
||||
* explicitly declared as not part of the public API). Documented behavior will
|
||||
* not change.
|
||||
*
|
||||
* In other words, any correct program that works with a given FFmpeg snapshot
|
||||
* should work just as well without any changes with any later snapshot with the
|
||||
* same major versions. This applies to both rebuilding the program against new
|
||||
* FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program
|
||||
* links against.
|
||||
*
|
||||
* However, new public symbols may be added and new members may be appended to
|
||||
* public structs whose size is not part of public ABI (most public structs in
|
||||
* FFmpeg). New macros and enum values may be added. Behavior in undocumented
|
||||
* situations may change slightly (and be documented). All those are accompanied
|
||||
* by an entry in doc/APIchanges and incrementing either the minor or micro
|
||||
* version number.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavu libavutil
|
||||
* Common code shared across all FFmpeg libraries.
|
||||
*
|
||||
* @note
|
||||
* libavutil is designed to be modular. In most cases, in order to use the
|
||||
* functions provided by one component of libavutil you must explicitly include
|
||||
* the specific header containing that feature. If you are only using
|
||||
* media-related components, you could simply include libavutil/avutil.h, which
|
||||
* brings in most of the "core" components.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_crypto Crypto and Hashing
|
||||
*
|
||||
* @{
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_math Mathematics
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_string String Manipulation
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_mem Memory Management
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_data Data Structures
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_video Video related
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_audio Audio related
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_error Error Codes
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_log Logging Facility
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_misc Other
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup preproc_misc Preprocessor String Macros
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup version_utils Library Version Macros
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_ver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return the LIBAVUTIL_VERSION_INT constant.
|
||||
*/
|
||||
unsigned avutil_version(void);
|
||||
|
||||
/**
|
||||
* Return an informative version string. This usually is the actual release
|
||||
* version number or a git commit description. This string has no fixed format
|
||||
* and can change any time. It should never be parsed by code.
|
||||
*/
|
||||
const char *av_version_info(void);
|
||||
|
||||
/**
|
||||
* Return the libavutil build-time configuration.
|
||||
*/
|
||||
const char *avutil_configuration(void);
|
||||
|
||||
/**
|
||||
* Return the libavutil license.
|
||||
*/
|
||||
const char *avutil_license(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_media Media Type
|
||||
* @brief Media Type
|
||||
*/
|
||||
|
||||
enum AVMediaType {
|
||||
AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous
|
||||
AVMEDIA_TYPE_SUBTITLE,
|
||||
AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse
|
||||
AVMEDIA_TYPE_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a string describing the media_type enum, NULL if media_type
|
||||
* is unknown.
|
||||
*/
|
||||
const char *av_get_media_type_string(enum AVMediaType media_type);
|
||||
|
||||
/**
|
||||
* @defgroup lavu_const Constants
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_enc Encoding specific
|
||||
*
|
||||
* @note those definition should move to avcodec
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define FF_LAMBDA_SHIFT 7
|
||||
#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
|
||||
#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
|
||||
#define FF_LAMBDA_MAX (256*128-1)
|
||||
|
||||
#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup lavu_time Timestamp specific
|
||||
*
|
||||
* FFmpeg internal timebase and timestamp definitions
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Undefined timestamp value
|
||||
*
|
||||
* Usually reported by demuxer that work on containers that do not provide
|
||||
* either pts or dts.
|
||||
*/
|
||||
|
||||
#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000))
|
||||
|
||||
/**
|
||||
* Internal time base represented as integer
|
||||
*/
|
||||
|
||||
#define AV_TIME_BASE 1000000
|
||||
|
||||
/**
|
||||
* Internal time base represented as fractional value
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* ISO C++ forbids compound-literals. */
|
||||
#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE)
|
||||
#else
|
||||
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* @defgroup lavu_picture Image related
|
||||
*
|
||||
* AVPicture types, pixel formats and basic image planes manipulation.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVPictureType {
|
||||
AV_PICTURE_TYPE_NONE = 0, ///< Undefined
|
||||
AV_PICTURE_TYPE_I, ///< Intra
|
||||
AV_PICTURE_TYPE_P, ///< Predicted
|
||||
AV_PICTURE_TYPE_B, ///< Bi-dir predicted
|
||||
AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4
|
||||
AV_PICTURE_TYPE_SI, ///< Switching Intra
|
||||
AV_PICTURE_TYPE_SP, ///< Switching Predicted
|
||||
AV_PICTURE_TYPE_BI, ///< BI type
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a single letter to describe the given picture type
|
||||
* pict_type.
|
||||
*
|
||||
* @param[in] pict_type the picture type @return a single character
|
||||
* representing the picture type, '?' if pict_type is unknown
|
||||
*/
|
||||
char av_get_picture_type_char(enum AVPictureType pict_type);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "rational.h"
|
||||
#include "version.h"
|
||||
#include "macros.h"
|
||||
#include "mathematics.h"
|
||||
#include "log.h"
|
||||
#include "pixfmt.h"
|
||||
|
||||
/**
|
||||
* Return x default pointer in case p is NULL.
|
||||
*/
|
||||
static inline void *av_x_if_null(const void *p, const void *x)
|
||||
{
|
||||
return (void *)(intptr_t)(p ? p : x);
|
||||
}
|
||||
|
||||
#if FF_API_OPT_INT_LIST
|
||||
/**
|
||||
* Compute the length of an integer list.
|
||||
*
|
||||
* @param elsize size in bytes of each list element (only 1, 2, 4 or 8)
|
||||
* @param term list terminator (usually 0 or -1)
|
||||
* @param list pointer to the list
|
||||
* @return length of the list, in elements, not counting the terminator
|
||||
*/
|
||||
attribute_deprecated
|
||||
unsigned av_int_list_length_for_size(unsigned elsize,
|
||||
const void *list, uint64_t term) av_pure;
|
||||
|
||||
/**
|
||||
* Compute the length of an integer list.
|
||||
*
|
||||
* @param term list terminator (usually 0 or -1)
|
||||
* @param list pointer to the list
|
||||
* @return length of the list, in elements, not counting the terminator
|
||||
*/
|
||||
#define av_int_list_length(list, term) \
|
||||
av_int_list_length_for_size(sizeof(*(list)), list, term)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the fractional representation of the internal time base.
|
||||
*/
|
||||
AVRational av_get_time_base_q(void);
|
||||
|
||||
#define AV_FOURCC_MAX_STRING_SIZE 32
|
||||
|
||||
#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
|
||||
|
||||
/**
|
||||
* Fill the provided buffer with a string containing a FourCC (four-character
|
||||
* code) representation.
|
||||
*
|
||||
* @param buf a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE
|
||||
* @param fourcc the fourcc to represent
|
||||
* @return the buffer in input
|
||||
*/
|
||||
char *av_fourcc_make_string(char *buf, uint32_t fourcc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AVUTIL_H */
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BASE64_H
|
||||
#define AVUTIL_BASE64_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_base64 Base64
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Decode a base64-encoded string.
|
||||
*
|
||||
* @param out buffer for decoded data
|
||||
* @param in null-terminated input string
|
||||
* @param out_size size in bytes of the out buffer, must be at
|
||||
* least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in))
|
||||
* @return number of bytes written, or a negative value in case of
|
||||
* invalid input
|
||||
*/
|
||||
int av_base64_decode(uint8_t *out, const char *in, int out_size);
|
||||
|
||||
/**
|
||||
* Calculate the output size in bytes needed to decode a base64 string
|
||||
* with length x to a data buffer.
|
||||
*/
|
||||
#define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4)
|
||||
|
||||
/**
|
||||
* Encode data to base64 and null-terminate.
|
||||
*
|
||||
* @param out buffer for encoded data
|
||||
* @param out_size size in bytes of the out buffer (including the
|
||||
* null terminator), must be at least AV_BASE64_SIZE(in_size)
|
||||
* @param in input buffer containing the data to encode
|
||||
* @param in_size size in bytes of the in buffer
|
||||
* @return out or NULL in case of error
|
||||
*/
|
||||
char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
|
||||
|
||||
/**
|
||||
* Calculate the output size needed to base64-encode x bytes to a
|
||||
* null-terminated string.
|
||||
*/
|
||||
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_BASE64_H */
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Blowfish algorithm
|
||||
* Copyright (c) 2012 Samuel Pitoiset
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BLOWFISH_H
|
||||
#define AVUTIL_BLOWFISH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_blowfish Blowfish
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define AV_BF_ROUNDS 16
|
||||
|
||||
typedef struct AVBlowfish {
|
||||
uint32_t p[AV_BF_ROUNDS + 2];
|
||||
uint32_t s[4][256];
|
||||
} AVBlowfish;
|
||||
|
||||
/**
|
||||
* Allocate an AVBlowfish context.
|
||||
*/
|
||||
AVBlowfish *av_blowfish_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVBlowfish context.
|
||||
*
|
||||
* @param ctx an AVBlowfish context
|
||||
* @param key a key
|
||||
* @param key_len length of the key
|
||||
*/
|
||||
void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context.
|
||||
*
|
||||
* @param ctx an AVBlowfish context
|
||||
* @param xl left four bytes halves of input to be encrypted
|
||||
* @param xr right four bytes halves of input to be encrypted
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
|
||||
int decrypt);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context.
|
||||
*
|
||||
* @param ctx an AVBlowfish context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 8 byte blocks
|
||||
* @param iv initialization vector for CBC mode, if NULL ECB will be used
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
|
||||
int count, uint8_t *iv, int decrypt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_BLOWFISH_H */
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Nicolas George
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_avbprint
|
||||
* AVBPrint public header
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BPRINT_H
|
||||
#define AVUTIL_BPRINT_H
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "avstring.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_avbprint AVBPrint
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* A buffer to print data progressively
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define a structure with extra padding to a fixed size
|
||||
* This helps ensuring binary compatibility with future versions.
|
||||
*/
|
||||
|
||||
#define FF_PAD_STRUCTURE(name, size, ...) \
|
||||
struct ff_pad_helper_##name { __VA_ARGS__ }; \
|
||||
typedef struct name { \
|
||||
__VA_ARGS__ \
|
||||
char reserved_padding[size - sizeof(struct ff_pad_helper_##name)]; \
|
||||
} name;
|
||||
|
||||
/**
|
||||
* Buffer to print data progressively
|
||||
*
|
||||
* The string buffer grows as necessary and is always 0-terminated.
|
||||
* The content of the string is never accessed, and thus is
|
||||
* encoding-agnostic and can even hold binary data.
|
||||
*
|
||||
* Small buffers are kept in the structure itself, and thus require no
|
||||
* memory allocation at all (unless the contents of the buffer is needed
|
||||
* after the structure goes out of scope). This is almost as lightweight as
|
||||
* declaring a local `char buf[512]`.
|
||||
*
|
||||
* The length of the string can go beyond the allocated size: the buffer is
|
||||
* then truncated, but the functions still keep account of the actual total
|
||||
* length.
|
||||
*
|
||||
* In other words, AVBPrint.len can be greater than AVBPrint.size and records
|
||||
* the total length of what would have been to the buffer if there had been
|
||||
* enough memory.
|
||||
*
|
||||
* Append operations do not need to be tested for failure: if a memory
|
||||
* allocation fails, data stop being appended to the buffer, but the length
|
||||
* is still updated. This situation can be tested with
|
||||
* av_bprint_is_complete().
|
||||
*
|
||||
* The AVBPrint.size_max field determines several possible behaviours:
|
||||
* - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be
|
||||
* reallocated as necessary, with an amortized linear cost.
|
||||
* - `size_max = 0` prevents writing anything to the buffer: only the total
|
||||
* length is computed. The write operations can then possibly be repeated in
|
||||
* a buffer with exactly the necessary size
|
||||
* (using `size_init = size_max = len + 1`).
|
||||
* - `size_max = 1` is automatically replaced by the exact size available in the
|
||||
* structure itself, thus ensuring no dynamic memory allocation. The
|
||||
* internal buffer is large enough to hold a reasonable paragraph of text,
|
||||
* such as the current paragraph.
|
||||
*/
|
||||
|
||||
FF_PAD_STRUCTURE(AVBPrint, 1024,
|
||||
char *str; /**< string so far */
|
||||
unsigned len; /**< length so far */
|
||||
unsigned size; /**< allocated memory */
|
||||
unsigned size_max; /**< maximum allocated memory */
|
||||
char reserved_internal_buffer[1];
|
||||
)
|
||||
|
||||
/**
|
||||
* @name Max size special values
|
||||
* Convenience macros for special values for av_bprint_init() size_max
|
||||
* parameter.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Buffer will be reallocated as necessary, with an amortized linear cost.
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1)
|
||||
/**
|
||||
* Use the exact size available in the AVBPrint structure itself.
|
||||
*
|
||||
* Thus ensuring no dynamic memory allocation. The internal buffer is large
|
||||
* enough to hold a reasonable paragraph of text, such as the current paragraph.
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_AUTOMATIC 1
|
||||
/**
|
||||
* Do not write anything to the buffer, only calculate the total length.
|
||||
*
|
||||
* The write operations can then possibly be repeated in a buffer with
|
||||
* exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`).
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_COUNT_ONLY 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Init a print buffer.
|
||||
*
|
||||
* @param buf buffer to init
|
||||
* @param size_init initial size (including the final 0)
|
||||
* @param size_max maximum size;
|
||||
* - `0` means do not write anything, just count the length
|
||||
* - `1` is replaced by the maximum value for automatic storage
|
||||
* any large value means that the internal buffer will be
|
||||
* reallocated as needed up to that limit
|
||||
* - `-1` is converted to `UINT_MAX`, the largest limit possible.
|
||||
* Check also `AV_BPRINT_SIZE_*` macros.
|
||||
*/
|
||||
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max);
|
||||
|
||||
/**
|
||||
* Init a print buffer using a pre-existing buffer.
|
||||
*
|
||||
* The buffer will not be reallocated.
|
||||
* In case size equals zero, the AVBPrint will be initialized to use
|
||||
* the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with
|
||||
* av_bprint_init().
|
||||
*
|
||||
* @param buf buffer structure to init
|
||||
* @param buffer byte buffer to use for the string data
|
||||
* @param size size of buffer
|
||||
*/
|
||||
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size);
|
||||
|
||||
/**
|
||||
* Append a formatted string to a print buffer.
|
||||
*/
|
||||
void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3);
|
||||
|
||||
/**
|
||||
* Append a formatted string to a print buffer.
|
||||
*/
|
||||
void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg);
|
||||
|
||||
/**
|
||||
* Append char c n times to a print buffer.
|
||||
*/
|
||||
void av_bprint_chars(AVBPrint *buf, char c, unsigned n);
|
||||
|
||||
/**
|
||||
* Append data to a print buffer.
|
||||
*
|
||||
* @param buf bprint buffer to use
|
||||
* @param data pointer to data
|
||||
* @param size size of data
|
||||
*/
|
||||
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size);
|
||||
|
||||
struct tm;
|
||||
/**
|
||||
* Append a formatted date and time to a print buffer.
|
||||
*
|
||||
* @param buf bprint buffer to use
|
||||
* @param fmt date and time format string, see strftime()
|
||||
* @param tm broken-down time structure to translate
|
||||
*
|
||||
* @note due to poor design of the standard strftime function, it may
|
||||
* produce poor results if the format string expands to a very long text and
|
||||
* the bprint buffer is near the limit stated by the size_max option.
|
||||
*/
|
||||
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm);
|
||||
|
||||
/**
|
||||
* Allocate bytes in the buffer for external use.
|
||||
*
|
||||
* @param[in] buf buffer structure
|
||||
* @param[in] size required size
|
||||
* @param[out] mem pointer to the memory area
|
||||
* @param[out] actual_size size of the memory area after allocation;
|
||||
* can be larger or smaller than size
|
||||
*/
|
||||
void av_bprint_get_buffer(AVBPrint *buf, unsigned size,
|
||||
unsigned char **mem, unsigned *actual_size);
|
||||
|
||||
/**
|
||||
* Reset the string to "" but keep internal allocated data.
|
||||
*/
|
||||
void av_bprint_clear(AVBPrint *buf);
|
||||
|
||||
/**
|
||||
* Test if the print buffer is complete (not truncated).
|
||||
*
|
||||
* It may have been truncated due to a memory allocation failure
|
||||
* or the size_max limit (compare size and size_max if necessary).
|
||||
*/
|
||||
static inline int av_bprint_is_complete(const AVBPrint *buf)
|
||||
{
|
||||
return buf->len < buf->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalize a print buffer.
|
||||
*
|
||||
* The print buffer can no longer be used afterwards,
|
||||
* but the len and size fields are still valid.
|
||||
*
|
||||
* @arg[out] ret_str if not NULL, used to return a permanent copy of the
|
||||
* buffer contents, or NULL if memory allocation fails;
|
||||
* if NULL, the buffer is discarded and freed
|
||||
* @return 0 for success or error code (probably AVERROR(ENOMEM))
|
||||
*/
|
||||
int av_bprint_finalize(AVBPrint *buf, char **ret_str);
|
||||
|
||||
/**
|
||||
* Escape the content in src and append it to dstbuf.
|
||||
*
|
||||
* @param dstbuf already inited destination bprint buffer
|
||||
* @param src string containing the text to escape
|
||||
* @param special_chars string containing the special characters which
|
||||
* need to be escaped, can be NULL
|
||||
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros.
|
||||
* Any unknown value for mode will be considered equivalent to
|
||||
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without
|
||||
* notice.
|
||||
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_* macros
|
||||
*/
|
||||
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars,
|
||||
enum AVEscapeMode mode, int flags);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* AVUTIL_BPRINT_H */
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* byte swapping routines
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BSWAP_H
|
||||
#define AVUTIL_BSWAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/avconfig.h"
|
||||
#include "attributes.h"
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if ARCH_ARM
|
||||
# include "arm/bswap.h"
|
||||
#elif ARCH_RISCV
|
||||
# include "riscv/bswap.h"
|
||||
#elif ARCH_X86
|
||||
# include "x86/bswap.h"
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
|
||||
#define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
|
||||
#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
|
||||
#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
|
||||
|
||||
#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
|
||||
|
||||
#ifndef av_bswap16
|
||||
static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
|
||||
{
|
||||
x= (x>>8) | (x<<8);
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef av_bswap32
|
||||
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
|
||||
{
|
||||
return AV_BSWAP32C(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef av_bswap64
|
||||
static inline uint64_t av_const av_bswap64(uint64_t x)
|
||||
{
|
||||
return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
// be2ne ... big-endian to native-endian
|
||||
// le2ne ... little-endian to native-endian
|
||||
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
#define av_be2ne16(x) (x)
|
||||
#define av_be2ne32(x) (x)
|
||||
#define av_be2ne64(x) (x)
|
||||
#define av_le2ne16(x) av_bswap16(x)
|
||||
#define av_le2ne32(x) av_bswap32(x)
|
||||
#define av_le2ne64(x) av_bswap64(x)
|
||||
#define AV_BE2NEC(s, x) (x)
|
||||
#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
|
||||
#else
|
||||
#define av_be2ne16(x) av_bswap16(x)
|
||||
#define av_be2ne32(x) av_bswap32(x)
|
||||
#define av_be2ne64(x) av_bswap64(x)
|
||||
#define av_le2ne16(x) (x)
|
||||
#define av_le2ne32(x) (x)
|
||||
#define av_le2ne64(x) (x)
|
||||
#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
|
||||
#define AV_LE2NEC(s, x) (x)
|
||||
#endif
|
||||
|
||||
#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
|
||||
#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
|
||||
#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
|
||||
#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
|
||||
#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
|
||||
#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
|
||||
|
||||
#endif /* AVUTIL_BSWAP_H */
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_buffer
|
||||
* refcounted data buffer API
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BUFFER_H
|
||||
#define AVUTIL_BUFFER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_buffer AVBuffer
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* @{
|
||||
* AVBuffer is an API for reference-counted data buffers.
|
||||
*
|
||||
* There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer
|
||||
* represents the data buffer itself; it is opaque and not meant to be accessed
|
||||
* by the caller directly, but only through AVBufferRef. However, the caller may
|
||||
* e.g. compare two AVBuffer pointers to check whether two different references
|
||||
* are describing the same data buffer. AVBufferRef represents a single
|
||||
* reference to an AVBuffer and it is the object that may be manipulated by the
|
||||
* caller directly.
|
||||
*
|
||||
* There are two functions provided for creating a new AVBuffer with a single
|
||||
* reference -- av_buffer_alloc() to just allocate a new buffer, and
|
||||
* av_buffer_create() to wrap an existing array in an AVBuffer. From an existing
|
||||
* reference, additional references may be created with av_buffer_ref().
|
||||
* Use av_buffer_unref() to free a reference (this will automatically free the
|
||||
* data once all the references are freed).
|
||||
*
|
||||
* The convention throughout this API and the rest of FFmpeg is such that the
|
||||
* buffer is considered writable if there exists only one reference to it (and
|
||||
* it has not been marked as read-only). The av_buffer_is_writable() function is
|
||||
* provided to check whether this is true and av_buffer_make_writable() will
|
||||
* automatically create a new writable buffer when necessary.
|
||||
* Of course nothing prevents the calling code from violating this convention,
|
||||
* however that is safe only when all the existing references are under its
|
||||
* control.
|
||||
*
|
||||
* @note Referencing and unreferencing the buffers is thread-safe and thus
|
||||
* may be done from multiple threads simultaneously without any need for
|
||||
* additional locking.
|
||||
*
|
||||
* @note Two different references to the same buffer can point to different
|
||||
* parts of the buffer (i.e. their AVBufferRef.data will not be equal).
|
||||
*/
|
||||
|
||||
/**
|
||||
* A reference counted buffer type. It is opaque and is meant to be used through
|
||||
* references (AVBufferRef).
|
||||
*/
|
||||
typedef struct AVBuffer AVBuffer;
|
||||
|
||||
/**
|
||||
* A reference to a data buffer.
|
||||
*
|
||||
* The size of this struct is not a part of the public ABI and it is not meant
|
||||
* to be allocated directly.
|
||||
*/
|
||||
typedef struct AVBufferRef {
|
||||
AVBuffer *buffer;
|
||||
|
||||
/**
|
||||
* The data buffer. It is considered writable if and only if
|
||||
* this is the only reference to the buffer, in which case
|
||||
* av_buffer_is_writable() returns 1.
|
||||
*/
|
||||
uint8_t *data;
|
||||
/**
|
||||
* Size of data in bytes.
|
||||
*/
|
||||
size_t size;
|
||||
} AVBufferRef;
|
||||
|
||||
/**
|
||||
* Allocate an AVBuffer of the given size using av_malloc().
|
||||
*
|
||||
* @return an AVBufferRef of given size or NULL when out of memory
|
||||
*/
|
||||
AVBufferRef *av_buffer_alloc(size_t size);
|
||||
|
||||
/**
|
||||
* Same as av_buffer_alloc(), except the returned buffer will be initialized
|
||||
* to zero.
|
||||
*/
|
||||
AVBufferRef *av_buffer_allocz(size_t size);
|
||||
|
||||
/**
|
||||
* Always treat the buffer as read-only, even when it has only one
|
||||
* reference.
|
||||
*/
|
||||
#define AV_BUFFER_FLAG_READONLY (1 << 0)
|
||||
|
||||
/**
|
||||
* Create an AVBuffer from an existing array.
|
||||
*
|
||||
* If this function is successful, data is owned by the AVBuffer. The caller may
|
||||
* only access data through the returned AVBufferRef and references derived from
|
||||
* it.
|
||||
* If this function fails, data is left untouched.
|
||||
* @param data data array
|
||||
* @param size size of data in bytes
|
||||
* @param free a callback for freeing this buffer's data
|
||||
* @param opaque parameter to be got for processing or passed to free
|
||||
* @param flags a combination of AV_BUFFER_FLAG_*
|
||||
*
|
||||
* @return an AVBufferRef referring to data on success, NULL on failure.
|
||||
*/
|
||||
AVBufferRef *av_buffer_create(uint8_t *data, size_t size,
|
||||
void (*free)(void *opaque, uint8_t *data),
|
||||
void *opaque, int flags);
|
||||
|
||||
/**
|
||||
* Default free callback, which calls av_free() on the buffer data.
|
||||
* This function is meant to be passed to av_buffer_create(), not called
|
||||
* directly.
|
||||
*/
|
||||
void av_buffer_default_free(void *opaque, uint8_t *data);
|
||||
|
||||
/**
|
||||
* Create a new reference to an AVBuffer.
|
||||
*
|
||||
* @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
|
||||
* failure.
|
||||
*/
|
||||
AVBufferRef *av_buffer_ref(const AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* Free a given reference and automatically free the buffer if there are no more
|
||||
* references to it.
|
||||
*
|
||||
* @param buf the reference to be freed. The pointer is set to NULL on return.
|
||||
*/
|
||||
void av_buffer_unref(AVBufferRef **buf);
|
||||
|
||||
/**
|
||||
* @return 1 if the caller may write to the data referred to by buf (which is
|
||||
* true if and only if buf is the only reference to the underlying AVBuffer).
|
||||
* Return 0 otherwise.
|
||||
* A positive answer is valid until av_buffer_ref() is called on buf.
|
||||
*/
|
||||
int av_buffer_is_writable(const AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* @return the opaque parameter set by av_buffer_create.
|
||||
*/
|
||||
void *av_buffer_get_opaque(const AVBufferRef *buf);
|
||||
|
||||
int av_buffer_get_ref_count(const AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* Create a writable reference from a given buffer reference, avoiding data copy
|
||||
* if possible.
|
||||
*
|
||||
* @param buf buffer reference to make writable. On success, buf is either left
|
||||
* untouched, or it is unreferenced and a new writable AVBufferRef is
|
||||
* written in its place. On failure, buf is left untouched.
|
||||
* @return 0 on success, a negative AVERROR on failure.
|
||||
*/
|
||||
int av_buffer_make_writable(AVBufferRef **buf);
|
||||
|
||||
/**
|
||||
* Reallocate a given buffer.
|
||||
*
|
||||
* @param buf a buffer reference to reallocate. On success, buf will be
|
||||
* unreferenced and a new reference with the required size will be
|
||||
* written in its place. On failure buf will be left untouched. *buf
|
||||
* may be NULL, then a new buffer is allocated.
|
||||
* @param size required new buffer size.
|
||||
* @return 0 on success, a negative AVERROR on failure.
|
||||
*
|
||||
* @note the buffer is actually reallocated with av_realloc() only if it was
|
||||
* initially allocated through av_buffer_realloc(NULL) and there is only one
|
||||
* reference to it (i.e. the one passed to this function). In all other cases
|
||||
* a new buffer is allocated and the data is copied.
|
||||
*/
|
||||
int av_buffer_realloc(AVBufferRef **buf, size_t size);
|
||||
|
||||
/**
|
||||
* Ensure dst refers to the same data as src.
|
||||
*
|
||||
* When *dst is already equivalent to src, do nothing. Otherwise unreference dst
|
||||
* and replace it with a new reference to src.
|
||||
*
|
||||
* @param dst Pointer to either a valid buffer reference or NULL. On success,
|
||||
* this will point to a buffer reference equivalent to src. On
|
||||
* failure, dst will be left untouched.
|
||||
* @param src A buffer reference to replace dst with. May be NULL, then this
|
||||
* function is equivalent to av_buffer_unref(dst).
|
||||
* @return 0 on success
|
||||
* AVERROR(ENOMEM) on memory allocation failure.
|
||||
*/
|
||||
int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavu_bufferpool AVBufferPool
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* @{
|
||||
* AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers.
|
||||
*
|
||||
* Frequently allocating and freeing large buffers may be slow. AVBufferPool is
|
||||
* meant to solve this in cases when the caller needs a set of buffers of the
|
||||
* same size (the most obvious use case being buffers for raw video or audio
|
||||
* frames).
|
||||
*
|
||||
* At the beginning, the user must call av_buffer_pool_init() to create the
|
||||
* buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to
|
||||
* get a reference to a new buffer, similar to av_buffer_alloc(). This new
|
||||
* reference works in all aspects the same way as the one created by
|
||||
* av_buffer_alloc(). However, when the last reference to this buffer is
|
||||
* unreferenced, it is returned to the pool instead of being freed and will be
|
||||
* reused for subsequent av_buffer_pool_get() calls.
|
||||
*
|
||||
* When the caller is done with the pool and no longer needs to allocate any new
|
||||
* buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable.
|
||||
* Once all the buffers are released, it will automatically be freed.
|
||||
*
|
||||
* Allocating and releasing buffers with this API is thread-safe as long as
|
||||
* either the default alloc callback is used, or the user-supplied one is
|
||||
* thread-safe.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The buffer pool. This structure is opaque and not meant to be accessed
|
||||
* directly. It is allocated with av_buffer_pool_init() and freed with
|
||||
* av_buffer_pool_uninit().
|
||||
*/
|
||||
typedef struct AVBufferPool AVBufferPool;
|
||||
|
||||
/**
|
||||
* Allocate and initialize a buffer pool.
|
||||
*
|
||||
* @param size size of each buffer in this pool
|
||||
* @param alloc a function that will be used to allocate new buffers when the
|
||||
* pool is empty. May be NULL, then the default allocator will be used
|
||||
* (av_buffer_alloc()).
|
||||
* @return newly created buffer pool on success, NULL on error.
|
||||
*/
|
||||
AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size));
|
||||
|
||||
/**
|
||||
* Allocate and initialize a buffer pool with a more complex allocator.
|
||||
*
|
||||
* @param size size of each buffer in this pool
|
||||
* @param opaque arbitrary user data used by the allocator
|
||||
* @param alloc a function that will be used to allocate new buffers when the
|
||||
* pool is empty. May be NULL, then the default allocator will be
|
||||
* used (av_buffer_alloc()).
|
||||
* @param pool_free a function that will be called immediately before the pool
|
||||
* is freed. I.e. after av_buffer_pool_uninit() is called
|
||||
* by the caller and all the frames are returned to the pool
|
||||
* and freed. It is intended to uninitialize the user opaque
|
||||
* data. May be NULL.
|
||||
* @return newly created buffer pool on success, NULL on error.
|
||||
*/
|
||||
AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
|
||||
AVBufferRef* (*alloc)(void *opaque, size_t size),
|
||||
void (*pool_free)(void *opaque));
|
||||
|
||||
/**
|
||||
* Mark the pool as being available for freeing. It will actually be freed only
|
||||
* once all the allocated buffers associated with the pool are released. Thus it
|
||||
* is safe to call this function while some of the allocated buffers are still
|
||||
* in use.
|
||||
*
|
||||
* @param pool pointer to the pool to be freed. It will be set to NULL.
|
||||
*/
|
||||
void av_buffer_pool_uninit(AVBufferPool **pool);
|
||||
|
||||
/**
|
||||
* Allocate a new AVBuffer, reusing an old buffer from the pool when available.
|
||||
* This function may be called simultaneously from multiple threads.
|
||||
*
|
||||
* @return a reference to the new buffer on success, NULL on error.
|
||||
*/
|
||||
AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
|
||||
|
||||
/**
|
||||
* Query the original opaque parameter of an allocated buffer in the pool.
|
||||
*
|
||||
* @param ref a buffer reference to a buffer returned by av_buffer_pool_get.
|
||||
* @return the opaque parameter set by the buffer allocator function of the
|
||||
* buffer pool.
|
||||
*
|
||||
* @note the opaque parameter of ref is used by the buffer pool implementation,
|
||||
* therefore you have to use this function to access the original opaque
|
||||
* parameter of an allocated buffer.
|
||||
*/
|
||||
void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_BUFFER_H */
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* An implementation of the CAMELLIA algorithm as mentioned in RFC3713
|
||||
* Copyright (c) 2014 Supraja Meedinti
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_CAMELLIA_H
|
||||
#define AVUTIL_CAMELLIA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Public header for libavutil CAMELLIA algorithm
|
||||
* @defgroup lavu_camellia CAMELLIA
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_camellia_size;
|
||||
|
||||
struct AVCAMELLIA;
|
||||
|
||||
/**
|
||||
* Allocate an AVCAMELLIA context
|
||||
* To free the struct: av_free(ptr)
|
||||
*/
|
||||
struct AVCAMELLIA *av_camellia_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVCAMELLIA context.
|
||||
*
|
||||
* @param ctx an AVCAMELLIA context
|
||||
* @param key a key of 16, 24, 32 bytes used for encryption/decryption
|
||||
* @param key_bits number of keybits: possible are 128, 192, 256
|
||||
*/
|
||||
int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context
|
||||
*
|
||||
* @param ctx an AVCAMELLIA context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 16 byte blocks
|
||||
* @param iv initialization vector for CBC mode, NULL for ECB mode
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* AVUTIL_CAMELLIA_H */
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* An implementation of the CAST128 algorithm as mentioned in RFC2144
|
||||
* Copyright (c) 2014 Supraja Meedinti
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_CAST5_H
|
||||
#define AVUTIL_CAST5_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief Public header for libavutil CAST5 algorithm
|
||||
* @defgroup lavu_cast5 CAST5
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_cast5_size;
|
||||
|
||||
struct AVCAST5;
|
||||
|
||||
/**
|
||||
* Allocate an AVCAST5 context
|
||||
* To free the struct: av_free(ptr)
|
||||
*/
|
||||
struct AVCAST5 *av_cast5_alloc(void);
|
||||
/**
|
||||
* Initialize an AVCAST5 context.
|
||||
*
|
||||
* @param ctx an AVCAST5 context
|
||||
* @param key a key of 5,6,...16 bytes used for encryption/decryption
|
||||
* @param key_bits number of keybits: possible are 40,48,...,128
|
||||
* @return 0 on success, less than 0 on failure
|
||||
*/
|
||||
int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context, ECB mode only
|
||||
*
|
||||
* @param ctx an AVCAST5 context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 8 byte blocks
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context
|
||||
*
|
||||
* @param ctx an AVCAST5 context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 8 byte blocks
|
||||
* @param iv initialization vector for CBC mode, NULL for ECB mode
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif /* AVUTIL_CAST5_H */
|
||||
@@ -0,0 +1,762 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
* Copyright (c) 2008 Peter Ross
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_CHANNEL_LAYOUT_H
|
||||
#define AVUTIL_CHANNEL_LAYOUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "version.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_audio_channels
|
||||
* Public libavutil channel layout APIs header.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup lavu_audio_channels Audio channels
|
||||
* @ingroup lavu_audio
|
||||
*
|
||||
* Audio channel layout utility functions
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVChannel {
|
||||
/// Invalid channel index
|
||||
AV_CHAN_NONE = -1,
|
||||
AV_CHAN_FRONT_LEFT,
|
||||
AV_CHAN_FRONT_RIGHT,
|
||||
AV_CHAN_FRONT_CENTER,
|
||||
AV_CHAN_LOW_FREQUENCY,
|
||||
AV_CHAN_BACK_LEFT,
|
||||
AV_CHAN_BACK_RIGHT,
|
||||
AV_CHAN_FRONT_LEFT_OF_CENTER,
|
||||
AV_CHAN_FRONT_RIGHT_OF_CENTER,
|
||||
AV_CHAN_BACK_CENTER,
|
||||
AV_CHAN_SIDE_LEFT,
|
||||
AV_CHAN_SIDE_RIGHT,
|
||||
AV_CHAN_TOP_CENTER,
|
||||
AV_CHAN_TOP_FRONT_LEFT,
|
||||
AV_CHAN_TOP_FRONT_CENTER,
|
||||
AV_CHAN_TOP_FRONT_RIGHT,
|
||||
AV_CHAN_TOP_BACK_LEFT,
|
||||
AV_CHAN_TOP_BACK_CENTER,
|
||||
AV_CHAN_TOP_BACK_RIGHT,
|
||||
/** Stereo downmix. */
|
||||
AV_CHAN_STEREO_LEFT = 29,
|
||||
/** See above. */
|
||||
AV_CHAN_STEREO_RIGHT,
|
||||
AV_CHAN_WIDE_LEFT,
|
||||
AV_CHAN_WIDE_RIGHT,
|
||||
AV_CHAN_SURROUND_DIRECT_LEFT,
|
||||
AV_CHAN_SURROUND_DIRECT_RIGHT,
|
||||
AV_CHAN_LOW_FREQUENCY_2,
|
||||
AV_CHAN_TOP_SIDE_LEFT,
|
||||
AV_CHAN_TOP_SIDE_RIGHT,
|
||||
AV_CHAN_BOTTOM_FRONT_CENTER,
|
||||
AV_CHAN_BOTTOM_FRONT_LEFT,
|
||||
AV_CHAN_BOTTOM_FRONT_RIGHT,
|
||||
AV_CHAN_SIDE_SURROUND_LEFT, ///< +90 degrees, Lss, SiL
|
||||
AV_CHAN_SIDE_SURROUND_RIGHT, ///< -90 degrees, Rss, SiR
|
||||
AV_CHAN_TOP_SURROUND_LEFT, ///< +110 degrees, Lvs, TpLS
|
||||
AV_CHAN_TOP_SURROUND_RIGHT, ///< -110 degrees, Rvs, TpRS
|
||||
|
||||
AV_CHAN_BINAURAL_LEFT = 61,
|
||||
AV_CHAN_BINAURAL_RIGHT,
|
||||
|
||||
/** Channel is empty can be safely skipped. */
|
||||
AV_CHAN_UNUSED = 0x200,
|
||||
|
||||
/** Channel contains data, but its position is unknown. */
|
||||
AV_CHAN_UNKNOWN = 0x300,
|
||||
|
||||
/**
|
||||
* Range of channels between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system.
|
||||
*
|
||||
* Given a channel id `<i>` between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `<n>` is
|
||||
* `<n> = <i> - AV_CHAN_AMBISONIC_BASE`.
|
||||
*
|
||||
* @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel
|
||||
* orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels
|
||||
* implicitly by their position in the stream.
|
||||
*/
|
||||
AV_CHAN_AMBISONIC_BASE = 0x400,
|
||||
// leave space for 1024 ids, which correspond to maximum order-32 harmonics,
|
||||
// which should be enough for the foreseeable use cases
|
||||
AV_CHAN_AMBISONIC_END = 0x7ff,
|
||||
};
|
||||
|
||||
enum AVChannelOrder {
|
||||
/**
|
||||
* Only the channel count is specified, without any further information
|
||||
* about the channel order.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_UNSPEC,
|
||||
/**
|
||||
* The native channel order, i.e. the channels are in the same order in
|
||||
* which they are defined in the AVChannel enum. This supports up to 63
|
||||
* different channels.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_NATIVE,
|
||||
/**
|
||||
* The channel order does not correspond to any other predefined order and
|
||||
* is stored as an explicit map. For example, this could be used to support
|
||||
* layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED)
|
||||
* channels at arbitrary positions.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_CUSTOM,
|
||||
/**
|
||||
* The audio is represented as the decomposition of the sound field into
|
||||
* spherical harmonics. Each channel corresponds to a single expansion
|
||||
* component. Channels are ordered according to ACN (Ambisonic Channel
|
||||
* Number).
|
||||
*
|
||||
* The channel with the index n in the stream contains the spherical
|
||||
* harmonic of degree l and order m given by
|
||||
* @code{.unparsed}
|
||||
* l = floor(sqrt(n)),
|
||||
* m = n - l * (l + 1).
|
||||
* @endcode
|
||||
*
|
||||
* Conversely given a spherical harmonic of degree l and order m, the
|
||||
* corresponding channel index n is given by
|
||||
* @code{.unparsed}
|
||||
* n = l * (l + 1) + m.
|
||||
* @endcode
|
||||
*
|
||||
* Normalization is assumed to be SN3D (Schmidt Semi-Normalization)
|
||||
* as defined in AmbiX format $ 2.1.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_AMBISONIC,
|
||||
/**
|
||||
* Number of channel orders, not part of ABI/API
|
||||
*/
|
||||
FF_CHANNEL_ORDER_NB
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks
|
||||
*
|
||||
* A channel layout is a 64-bits integer with a bit set for every channel.
|
||||
* The number of bits set must be equal to the number of channels.
|
||||
* The value 0 means that the channel layout is not known.
|
||||
* @note this data structure is not powerful enough to handle channels
|
||||
* combinations that have the same channel multiple times, such as
|
||||
* dual-mono.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define AV_CH_FRONT_LEFT (1ULL << AV_CHAN_FRONT_LEFT )
|
||||
#define AV_CH_FRONT_RIGHT (1ULL << AV_CHAN_FRONT_RIGHT )
|
||||
#define AV_CH_FRONT_CENTER (1ULL << AV_CHAN_FRONT_CENTER )
|
||||
#define AV_CH_LOW_FREQUENCY (1ULL << AV_CHAN_LOW_FREQUENCY )
|
||||
#define AV_CH_BACK_LEFT (1ULL << AV_CHAN_BACK_LEFT )
|
||||
#define AV_CH_BACK_RIGHT (1ULL << AV_CHAN_BACK_RIGHT )
|
||||
#define AV_CH_FRONT_LEFT_OF_CENTER (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER )
|
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_BACK_CENTER (1ULL << AV_CHAN_BACK_CENTER )
|
||||
#define AV_CH_SIDE_LEFT (1ULL << AV_CHAN_SIDE_LEFT )
|
||||
#define AV_CH_SIDE_RIGHT (1ULL << AV_CHAN_SIDE_RIGHT )
|
||||
#define AV_CH_TOP_CENTER (1ULL << AV_CHAN_TOP_CENTER )
|
||||
#define AV_CH_TOP_FRONT_LEFT (1ULL << AV_CHAN_TOP_FRONT_LEFT )
|
||||
#define AV_CH_TOP_FRONT_CENTER (1ULL << AV_CHAN_TOP_FRONT_CENTER )
|
||||
#define AV_CH_TOP_FRONT_RIGHT (1ULL << AV_CHAN_TOP_FRONT_RIGHT )
|
||||
#define AV_CH_TOP_BACK_LEFT (1ULL << AV_CHAN_TOP_BACK_LEFT )
|
||||
#define AV_CH_TOP_BACK_CENTER (1ULL << AV_CHAN_TOP_BACK_CENTER )
|
||||
#define AV_CH_TOP_BACK_RIGHT (1ULL << AV_CHAN_TOP_BACK_RIGHT )
|
||||
#define AV_CH_STEREO_LEFT (1ULL << AV_CHAN_STEREO_LEFT )
|
||||
#define AV_CH_STEREO_RIGHT (1ULL << AV_CHAN_STEREO_RIGHT )
|
||||
#define AV_CH_WIDE_LEFT (1ULL << AV_CHAN_WIDE_LEFT )
|
||||
#define AV_CH_WIDE_RIGHT (1ULL << AV_CHAN_WIDE_RIGHT )
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT )
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT)
|
||||
#define AV_CH_LOW_FREQUENCY_2 (1ULL << AV_CHAN_LOW_FREQUENCY_2 )
|
||||
#define AV_CH_TOP_SIDE_LEFT (1ULL << AV_CHAN_TOP_SIDE_LEFT )
|
||||
#define AV_CH_TOP_SIDE_RIGHT (1ULL << AV_CHAN_TOP_SIDE_RIGHT )
|
||||
#define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER )
|
||||
#define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT )
|
||||
#define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT )
|
||||
#define AV_CH_SIDE_SURROUND_LEFT (1ULL << AV_CHAN_SIDE_SURROUND_LEFT )
|
||||
#define AV_CH_SIDE_SURROUND_RIGHT (1ULL << AV_CHAN_SIDE_SURROUND_RIGHT )
|
||||
#define AV_CH_TOP_SURROUND_LEFT (1ULL << AV_CHAN_TOP_SURROUND_LEFT )
|
||||
#define AV_CH_TOP_SURROUND_RIGHT (1ULL << AV_CHAN_TOP_SURROUND_RIGHT )
|
||||
#define AV_CH_BINAURAL_LEFT (1ULL << AV_CHAN_BINAURAL_LEFT )
|
||||
#define AV_CH_BINAURAL_RIGHT (1ULL << AV_CHAN_BINAURAL_RIGHT )
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup channel_mask_c Audio channel layouts
|
||||
* @{
|
||||
* */
|
||||
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_3POINT1POINT2 (AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_5POINT1POINT2 (AV_CH_LAYOUT_5POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1POINT2_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1POINT4_BACK (AV_CH_LAYOUT_5POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1POINT2 (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT2POINT3 (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2)
|
||||
#define AV_CH_LAYOUT_9POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_9POINT1POINT6 (AV_CH_LAYOUT_9POINT1POINT4_BACK|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_BINAURAL (AV_CH_BINAURAL_LEFT|AV_CH_BINAURAL_RIGHT)
|
||||
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
|
||||
#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_9POINT1POINT6|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
|
||||
|
||||
#define AV_CH_LAYOUT_7POINT1_TOP_BACK AV_CH_LAYOUT_5POINT1POINT2_BACK
|
||||
|
||||
enum AVMatrixEncoding {
|
||||
AV_MATRIX_ENCODING_NONE,
|
||||
AV_MATRIX_ENCODING_DOLBY,
|
||||
AV_MATRIX_ENCODING_DPLII,
|
||||
AV_MATRIX_ENCODING_DPLIIX,
|
||||
AV_MATRIX_ENCODING_DPLIIZ,
|
||||
AV_MATRIX_ENCODING_DOLBYEX,
|
||||
AV_MATRIX_ENCODING_DOLBYHEADPHONE,
|
||||
AV_MATRIX_ENCODING_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* An AVChannelCustom defines a single channel within a custom order layout
|
||||
*
|
||||
* Unlike most structures in FFmpeg, sizeof(AVChannelCustom) is a part of the
|
||||
* public ABI.
|
||||
*
|
||||
* No new fields may be added to it without a major version bump.
|
||||
*/
|
||||
typedef struct AVChannelCustom {
|
||||
enum AVChannel id;
|
||||
char name[16];
|
||||
void *opaque;
|
||||
} AVChannelCustom;
|
||||
|
||||
/**
|
||||
* An AVChannelLayout holds information about the channel layout of audio data.
|
||||
*
|
||||
* A channel layout here is defined as a set of channels ordered in a specific
|
||||
* way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
|
||||
* AVChannelLayout carries only the channel count).
|
||||
* All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
|
||||
* ignoring everything but the channel count, as long as av_channel_layout_check()
|
||||
* considers they are valid.
|
||||
*
|
||||
* Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the
|
||||
* public ABI and may be used by the caller. E.g. it may be allocated on stack
|
||||
* or embedded in caller-defined structs.
|
||||
*
|
||||
* AVChannelLayout can be initialized as follows:
|
||||
* - default initialization with {0}, followed by setting all used fields
|
||||
* correctly;
|
||||
* - by assigning one of the predefined AV_CHANNEL_LAYOUT_* initializers;
|
||||
* - with a constructor function, such as av_channel_layout_default(),
|
||||
* av_channel_layout_from_mask() or av_channel_layout_from_string().
|
||||
*
|
||||
* The channel layout must be uninitialized with av_channel_layout_uninit()
|
||||
*
|
||||
* Copying an AVChannelLayout via assigning is forbidden,
|
||||
* av_channel_layout_copy() must be used instead (and its return value should
|
||||
* be checked)
|
||||
*
|
||||
* No new fields may be added to it without a major version bump, except for
|
||||
* new elements of the union fitting in sizeof(uint64_t).
|
||||
*/
|
||||
typedef struct AVChannelLayout {
|
||||
/**
|
||||
* Channel order used in this layout.
|
||||
* This is a mandatory field.
|
||||
*/
|
||||
enum AVChannelOrder order;
|
||||
|
||||
/**
|
||||
* Number of channels in this layout. Mandatory field.
|
||||
*/
|
||||
int nb_channels;
|
||||
|
||||
/**
|
||||
* Details about which channels are present in this layout.
|
||||
* For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be
|
||||
* used.
|
||||
*/
|
||||
union {
|
||||
/**
|
||||
* This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used
|
||||
* for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
|
||||
* It is a bitmask, where the position of each set bit means that the
|
||||
* AVChannel with the corresponding value is present.
|
||||
*
|
||||
* I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO
|
||||
* is present in the layout. Otherwise it is not present.
|
||||
*
|
||||
* @note when a channel layout using a bitmask is constructed or
|
||||
* modified manually (i.e. not using any of the av_channel_layout_*
|
||||
* functions), the code doing it must ensure that the number of set bits
|
||||
* is equal to nb_channels.
|
||||
*/
|
||||
uint64_t mask;
|
||||
/**
|
||||
* This member must be used when the channel order is
|
||||
* AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each
|
||||
* element signalling the presence of the AVChannel with the
|
||||
* corresponding value in map[i].id.
|
||||
*
|
||||
* I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the
|
||||
* i-th channel in the audio data.
|
||||
*
|
||||
* When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic
|
||||
* component with ACN index (as defined above)
|
||||
* n = map[i].id - AV_CHAN_AMBISONIC_BASE.
|
||||
*
|
||||
* map[i].name may be filled with a 0-terminated string, in which case
|
||||
* it will be used for the purpose of identifying the channel with the
|
||||
* convenience functions below. Otherwise it must be zeroed.
|
||||
*/
|
||||
AVChannelCustom *map;
|
||||
} u;
|
||||
|
||||
/**
|
||||
* For some private data of the user.
|
||||
*/
|
||||
void *opaque;
|
||||
} AVChannelLayout;
|
||||
|
||||
/**
|
||||
* Macro to define native channel layouts
|
||||
*
|
||||
* @note This doesn't use designated initializers for compatibility with C++ 17 and older.
|
||||
*/
|
||||
#define AV_CHANNEL_LAYOUT_MASK(nb, m) \
|
||||
{ /* .order */ AV_CHANNEL_ORDER_NATIVE, \
|
||||
/* .nb_channels */ (nb), \
|
||||
/* .u.mask */ { m }, \
|
||||
/* .opaque */ NULL }
|
||||
|
||||
/**
|
||||
* @name Common pre-defined channel layouts
|
||||
* @{
|
||||
*/
|
||||
#define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO)
|
||||
#define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO)
|
||||
#define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_2_1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2_1)
|
||||
#define AV_CHANNEL_LAYOUT_SURROUND AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_SURROUND)
|
||||
#define AV_CHANNEL_LAYOUT_3POINT1 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_3POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_4POINT0 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_4POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_4POINT1 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_4POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_2_2 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_2_2)
|
||||
#define AV_CHANNEL_LAYOUT_QUAD AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_QUAD)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT0 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT0_BACK AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_3POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_3POINT1POINT2)
|
||||
#define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT0 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_5POINT1POINT2)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_5POINT1POINT2_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_5POINT1POINT4_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_7POINT1POINT2)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT1POINT4_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT2POINT3 AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT2POINT3)
|
||||
#define AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(14, AV_CH_LAYOUT_9POINT1POINT4_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_9POINT1POINT6 AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_9POINT1POINT6)
|
||||
#define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_BINAURAL AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_BINAURAL)
|
||||
#define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX)
|
||||
#define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
|
||||
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK
|
||||
|
||||
#define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
|
||||
{ /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \
|
||||
/* .nb_channels */ 4, \
|
||||
/* .u.mask */ { 0 }, \
|
||||
/* .opaque */ NULL }
|
||||
/** @} */
|
||||
|
||||
struct AVBPrint;
|
||||
|
||||
/**
|
||||
* Get a human readable string in an abbreviated form describing a given channel.
|
||||
* This is the inverse function of @ref av_channel_from_string().
|
||||
*
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @param channel the AVChannel whose name to get
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_name().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
*/
|
||||
void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
|
||||
|
||||
/**
|
||||
* Get a human readable string describing a given channel.
|
||||
*
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @param channel the AVChannel whose description to get
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_description().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
*/
|
||||
void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
|
||||
|
||||
/**
|
||||
* This is the inverse function of @ref av_channel_name().
|
||||
*
|
||||
* @return the channel with the given name
|
||||
* AV_CHAN_NONE when name does not identify a known channel
|
||||
*/
|
||||
enum AVChannel av_channel_from_string(const char *name);
|
||||
|
||||
/**
|
||||
* Initialize a custom channel layout with the specified number of channels.
|
||||
* The channel map will be allocated and the designation of all channels will
|
||||
* be set to AV_CHAN_UNKNOWN.
|
||||
*
|
||||
* This is only a convenience helper function, a custom channel layout can also
|
||||
* be constructed without using this.
|
||||
*
|
||||
* @param channel_layout the layout structure to be initialized
|
||||
* @param nb_channels the number of channels
|
||||
*
|
||||
* @return 0 on success
|
||||
* AVERROR(EINVAL) if the number of channels <= 0
|
||||
* AVERROR(ENOMEM) if the channel map could not be allocated
|
||||
*/
|
||||
int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int nb_channels);
|
||||
|
||||
/**
|
||||
* Initialize a native channel layout from a bitmask indicating which channels
|
||||
* are present.
|
||||
*
|
||||
* @param channel_layout the layout structure to be initialized
|
||||
* @param mask bitmask describing the channel layout
|
||||
*
|
||||
* @return 0 on success
|
||||
* AVERROR(EINVAL) for invalid mask values
|
||||
*/
|
||||
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask);
|
||||
|
||||
/**
|
||||
* Initialize a channel layout from a given string description.
|
||||
* The input string can be represented by:
|
||||
* - the formal channel layout name (returned by av_channel_layout_describe())
|
||||
* - single or multiple channel names (returned by av_channel_name(), eg. "FL",
|
||||
* or concatenated with "+", each optionally containing a custom name after
|
||||
* a "@", eg. "FL@Left+FR@Right+LFE")
|
||||
* - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4")
|
||||
* - the number of channels with default layout (eg. "4c")
|
||||
* - the number of unordered channels (eg. "4C" or "4 channels")
|
||||
* - the ambisonic order followed by optional non-diegetic channels (eg.
|
||||
* "ambisonic 2+stereo")
|
||||
* On error, the channel layout will remain uninitialized, but not necessarily
|
||||
* untouched.
|
||||
*
|
||||
* @param channel_layout uninitialized channel layout for the result
|
||||
* @param str string describing the channel layout
|
||||
* @return 0 on success parsing the channel layout
|
||||
* AVERROR(EINVAL) if an invalid channel layout string was provided
|
||||
* AVERROR(ENOMEM) if there was not enough memory
|
||||
*/
|
||||
int av_channel_layout_from_string(AVChannelLayout *channel_layout,
|
||||
const char *str);
|
||||
|
||||
/**
|
||||
* Get the default channel layout for a given number of channels.
|
||||
*
|
||||
* @param ch_layout the layout structure to be initialized
|
||||
* @param nb_channels number of channels
|
||||
*/
|
||||
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels);
|
||||
|
||||
/**
|
||||
* Iterate over all standard channel layouts.
|
||||
*
|
||||
* @param opaque a pointer where libavutil will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the standard channel layout or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVChannelLayout *av_channel_layout_standard(void **opaque);
|
||||
|
||||
/**
|
||||
* Free any allocated data in the channel layout and reset the channel
|
||||
* count to 0.
|
||||
*
|
||||
* @param channel_layout the layout structure to be uninitialized
|
||||
*/
|
||||
void av_channel_layout_uninit(AVChannelLayout *channel_layout);
|
||||
|
||||
/**
|
||||
* Make a copy of a channel layout. This differs from just assigning src to dst
|
||||
* in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM.
|
||||
*
|
||||
* @note the destination channel_layout will be always uninitialized before copy.
|
||||
*
|
||||
* @param dst destination channel layout
|
||||
* @param src source channel layout
|
||||
* @return 0 on success, a negative AVERROR on error.
|
||||
*/
|
||||
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src);
|
||||
|
||||
/**
|
||||
* Get a human-readable string describing the channel layout properties.
|
||||
* The string will be in the same format that is accepted by
|
||||
* @ref av_channel_layout_from_string(), allowing to rebuild the same
|
||||
* channel layout, except for opaque pointers.
|
||||
*
|
||||
* @param channel_layout channel layout to be described
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_layout_describe(const AVChannelLayout *channel_layout,
|
||||
char *buf, size_t buf_size);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_layout_describe().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
* @return 0 on success, or a negative AVERROR value on failure.
|
||||
*/
|
||||
int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout,
|
||||
struct AVBPrint *bp);
|
||||
|
||||
/**
|
||||
* Get the channel with the given index in a channel layout.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param idx index of the channel
|
||||
* @return channel with the index idx in channel_layout on success or
|
||||
* AV_CHAN_NONE on failure (if idx is not valid or the channel order is
|
||||
* unspecified)
|
||||
*/
|
||||
enum AVChannel
|
||||
av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx);
|
||||
|
||||
/**
|
||||
* Get the index of a given channel in a channel layout. In case multiple
|
||||
* channels are found, only the first match will be returned.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param channel the channel whose index to obtain
|
||||
* @return index of channel in channel_layout on success or a negative number if
|
||||
* channel is not present in channel_layout.
|
||||
*/
|
||||
int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout,
|
||||
enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* Get the index in a channel layout of a channel described by the given string.
|
||||
* In case multiple channels are found, only the first match will be returned.
|
||||
*
|
||||
* This function accepts channel names in the same format as
|
||||
* @ref av_channel_from_string().
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param name string describing the channel whose index to obtain
|
||||
* @return a channel index described by the given string, or a negative AVERROR
|
||||
* value.
|
||||
*/
|
||||
int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Get a channel described by the given string.
|
||||
*
|
||||
* This function accepts channel names in the same format as
|
||||
* @ref av_channel_from_string().
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param name string describing the channel to obtain
|
||||
* @return a channel described by the given string in channel_layout on success
|
||||
* or AV_CHAN_NONE on failure (if the string is not valid or the channel
|
||||
* order is unspecified)
|
||||
*/
|
||||
enum AVChannel
|
||||
av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Find out what channels from a given set are present in a channel layout,
|
||||
* without regard for their positions.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param mask a combination of AV_CH_* representing a set of channels
|
||||
* @return a bitfield representing all the channels from mask that are present
|
||||
* in channel_layout
|
||||
*/
|
||||
uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout,
|
||||
uint64_t mask);
|
||||
|
||||
/**
|
||||
* Check whether a channel layout is valid, i.e. can possibly describe audio
|
||||
* data.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @return 1 if channel_layout is valid, 0 otherwise.
|
||||
*/
|
||||
int av_channel_layout_check(const AVChannelLayout *channel_layout);
|
||||
|
||||
/**
|
||||
* Check whether two channel layouts are semantically the same, i.e. the same
|
||||
* channels are present on the same positions in both.
|
||||
*
|
||||
* If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the other is
|
||||
* not, they are considered to be unequal. If both are AV_CHANNEL_ORDER_UNSPEC,
|
||||
* they are considered equal iff the channel counts are the same in both.
|
||||
*
|
||||
* @param chl input channel layout
|
||||
* @param chl1 input channel layout
|
||||
* @return 0 if chl and chl1 are equal, 1 if they are not equal. A negative
|
||||
* AVERROR code if one or both are invalid.
|
||||
*/
|
||||
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1);
|
||||
|
||||
/**
|
||||
* Return the order if the layout is n-th order standard-order ambisonic.
|
||||
* The presence of optional extra non-diegetic channels at the end is not taken
|
||||
* into account.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @return the order of the layout, a negative error code otherwise.
|
||||
*/
|
||||
int av_channel_layout_ambisonic_order(const AVChannelLayout *channel_layout);
|
||||
|
||||
/**
|
||||
* The conversion must be lossless.
|
||||
*/
|
||||
#define AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS (1 << 0)
|
||||
|
||||
/**
|
||||
* The specified retype target order is ignored and the simplest possible
|
||||
* (canonical) order is used for which the input layout can be losslessy
|
||||
* represented.
|
||||
*/
|
||||
#define AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL (1 << 1)
|
||||
|
||||
/**
|
||||
* Change the AVChannelOrder of a channel layout.
|
||||
*
|
||||
* Change of AVChannelOrder can be either lossless or lossy. In case of a
|
||||
* lossless conversion all the channel designations and the associated channel
|
||||
* names (if any) are kept. On a lossy conversion the channel names and channel
|
||||
* designations might be lost depending on the capabilities of the desired
|
||||
* AVChannelOrder. Note that some conversions are simply not possible in which
|
||||
* case this function returns AVERROR(ENOSYS).
|
||||
*
|
||||
* The following conversions are supported:
|
||||
*
|
||||
* Any -> Custom : Always possible, always lossless.
|
||||
* Any -> Unspecified: Always possible, lossless if channel designations
|
||||
* are all unknown and channel names are not used, lossy otherwise.
|
||||
* Custom -> Ambisonic : Possible if it contains ambisonic channels with
|
||||
* optional non-diegetic channels in the end. Lossy if the channels have
|
||||
* custom names, lossless otherwise.
|
||||
* Custom -> Native : Possible if it contains native channels in native
|
||||
* order. Lossy if the channels have custom names, lossless otherwise.
|
||||
*
|
||||
* On error this function keeps the original channel layout untouched.
|
||||
*
|
||||
* @param channel_layout channel layout which will be changed
|
||||
* @param order the desired channel layout order
|
||||
* @param flags a combination of AV_CHANNEL_LAYOUT_RETYPE_FLAG_* constants
|
||||
* @return 0 if the conversion was successful and lossless or if the channel
|
||||
* layout was already in the desired order
|
||||
* >0 if the conversion was successful but lossy
|
||||
* AVERROR(ENOSYS) if the conversion was not possible (or would be
|
||||
* lossy and AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS was specified)
|
||||
* AVERROR(EINVAL), AVERROR(ENOMEM) on error
|
||||
*/
|
||||
int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrder order, int flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_CHANNEL_LAYOUT_H */
|
||||
+589
@@ -0,0 +1,589 @@
|
||||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* common internal and external API header
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_COMMON_H
|
||||
#define AVUTIL_COMMON_H
|
||||
|
||||
#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && !defined(UINT64_C)
|
||||
#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "error.h"
|
||||
#include "macros.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
# include "intmath.h"
|
||||
# include "internal.h"
|
||||
#else
|
||||
# include "mem.h"
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
|
||||
//rounded division & shift
|
||||
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
|
||||
/* assume b>0 */
|
||||
#define ROUNDED_DIV(a,b) (((a)>=0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
|
||||
/* Fast a/(1<<b) rounded toward +inf. Assume a>=0 and b>=0 */
|
||||
#define AV_CEIL_RSHIFT(a,b) (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) \
|
||||
: ((a) + (1<<(b)) - 1) >> (b))
|
||||
/* Backwards compat. */
|
||||
#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT
|
||||
|
||||
#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b))
|
||||
#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b))
|
||||
|
||||
/**
|
||||
* Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they
|
||||
* are not representable as absolute values of their type. This is the same
|
||||
* as with *abs()
|
||||
* @see FFNABS()
|
||||
*/
|
||||
#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
|
||||
#define FFSIGN(a) ((a) > 0 ? 1 : -1)
|
||||
|
||||
/**
|
||||
* Negative Absolute value.
|
||||
* this works for all integers of all types.
|
||||
* As with many macros, this evaluates its argument twice, it thus must not have
|
||||
* a sideeffect, that is FFNABS(x++) has undefined behavior.
|
||||
*/
|
||||
#define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
|
||||
|
||||
/**
|
||||
* Unsigned Absolute value.
|
||||
* This takes the absolute value of a signed int and returns it as a unsigned.
|
||||
* This also works with INT_MIN which would otherwise not be representable
|
||||
* As with many macros, this evaluates its argument twice.
|
||||
*/
|
||||
#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
|
||||
#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))
|
||||
|
||||
/* misc math functions */
|
||||
|
||||
#ifndef av_ceil_log2
|
||||
# define av_ceil_log2 av_ceil_log2_c
|
||||
#endif
|
||||
#ifndef av_clip
|
||||
# define av_clip av_clip_c
|
||||
#endif
|
||||
#ifndef av_clip64
|
||||
# define av_clip64 av_clip64_c
|
||||
#endif
|
||||
#ifndef av_clip_uint8
|
||||
# define av_clip_uint8 av_clip_uint8_c
|
||||
#endif
|
||||
#ifndef av_clip_int8
|
||||
# define av_clip_int8 av_clip_int8_c
|
||||
#endif
|
||||
#ifndef av_clip_uint16
|
||||
# define av_clip_uint16 av_clip_uint16_c
|
||||
#endif
|
||||
#ifndef av_clip_int16
|
||||
# define av_clip_int16 av_clip_int16_c
|
||||
#endif
|
||||
#ifndef av_clipl_int32
|
||||
# define av_clipl_int32 av_clipl_int32_c
|
||||
#endif
|
||||
#ifndef av_clip_intp2
|
||||
# define av_clip_intp2 av_clip_intp2_c
|
||||
#endif
|
||||
#ifndef av_clip_uintp2
|
||||
# define av_clip_uintp2 av_clip_uintp2_c
|
||||
#endif
|
||||
#ifndef av_sat_add32
|
||||
# define av_sat_add32 av_sat_add32_c
|
||||
#endif
|
||||
#ifndef av_sat_dadd32
|
||||
# define av_sat_dadd32 av_sat_dadd32_c
|
||||
#endif
|
||||
#ifndef av_sat_sub32
|
||||
# define av_sat_sub32 av_sat_sub32_c
|
||||
#endif
|
||||
#ifndef av_sat_dsub32
|
||||
# define av_sat_dsub32 av_sat_dsub32_c
|
||||
#endif
|
||||
#ifndef av_sat_add64
|
||||
# define av_sat_add64 av_sat_add64_c
|
||||
#endif
|
||||
#ifndef av_sat_sub64
|
||||
# define av_sat_sub64 av_sat_sub64_c
|
||||
#endif
|
||||
#ifndef av_clipf
|
||||
# define av_clipf av_clipf_c
|
||||
#endif
|
||||
#ifndef av_clipd
|
||||
# define av_clipd av_clipd_c
|
||||
#endif
|
||||
#ifndef av_zero_extend
|
||||
# define av_zero_extend av_zero_extend_c
|
||||
#endif
|
||||
#ifndef av_popcount
|
||||
# define av_popcount av_popcount_c
|
||||
#endif
|
||||
#ifndef av_popcount64
|
||||
# define av_popcount64 av_popcount64_c
|
||||
#endif
|
||||
#ifndef av_parity
|
||||
# define av_parity av_parity_c
|
||||
#endif
|
||||
|
||||
#ifndef av_log2
|
||||
av_const int av_log2(unsigned v);
|
||||
#endif
|
||||
|
||||
#ifndef av_log2_16bit
|
||||
av_const int av_log2_16bit(unsigned v);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed 64bit integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the 0-255 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
|
||||
{
|
||||
if (a&(~0xFF)) return (~a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the -128,127 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int8_t av_clip_int8_c(int a)
|
||||
{
|
||||
if ((a+0x80U) & ~0xFF) return (a>>31) ^ 0x7F;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the 0-65535 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
|
||||
{
|
||||
if (a&(~0xFFFF)) return (~a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the -32768,32767 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int16_t av_clip_int16_c(int a)
|
||||
{
|
||||
if ((a+0x8000U) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
|
||||
{
|
||||
if ((a+UINT64_C(0x80000000)) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
|
||||
else return (int32_t)a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer into the -(2^p),(2^p-1) range.
|
||||
* @param a value to clip
|
||||
* @param p bit position to clip at
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int av_clip_intp2_c(int a, int p)
|
||||
{
|
||||
if (((unsigned)a + (1U << p)) & ~((2U << p) - 1))
|
||||
return (a >> 31) ^ ((1 << p) - 1);
|
||||
else
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed integer to an unsigned power of two range.
|
||||
* @param a value to clip
|
||||
* @param p bit position to clip at
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
|
||||
{
|
||||
if (a & ~((1U<<p) - 1)) return (~a) >> 31 & ((1U<<p) - 1);
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear high bits from an unsigned integer starting with specific bit position
|
||||
* @param a value to clip
|
||||
* @param p bit position to clip at. Must be between 0 and 31.
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const unsigned av_zero_extend_c(unsigned a, unsigned p)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (p > 31) abort();
|
||||
#endif
|
||||
return a & ((1U << p) - 1);
|
||||
}
|
||||
|
||||
#if FF_API_MOD_UINTP2
|
||||
#ifndef av_mod_uintp2
|
||||
# define av_mod_uintp2 av_mod_uintp2_c
|
||||
#endif
|
||||
attribute_deprecated
|
||||
static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p)
|
||||
{
|
||||
return av_zero_extend_c(a, p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add two signed 32-bit values with saturation.
|
||||
*
|
||||
* @param a one value
|
||||
* @param b another value
|
||||
* @return sum with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_add32_c(int a, int b)
|
||||
{
|
||||
return av_clipl_int32((int64_t)a + b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a doubled value to another value with saturation at both stages.
|
||||
*
|
||||
* @param a first value
|
||||
* @param b value doubled and added to a
|
||||
* @return sum sat(a + sat(2*b)) with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_dadd32_c(int a, int b)
|
||||
{
|
||||
return av_sat_add32(a, av_sat_add32(b, b));
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract two signed 32-bit values with saturation.
|
||||
*
|
||||
* @param a one value
|
||||
* @param b another value
|
||||
* @return difference with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_sub32_c(int a, int b)
|
||||
{
|
||||
return av_clipl_int32((int64_t)a - b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract a doubled value from another value with saturation at both stages.
|
||||
*
|
||||
* @param a first value
|
||||
* @param b value doubled and subtracted from a
|
||||
* @return difference sat(a - sat(2*b)) with signed saturation
|
||||
*/
|
||||
static av_always_inline int av_sat_dsub32_c(int a, int b)
|
||||
{
|
||||
return av_sat_sub32(a, av_sat_add32(b, b));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add two signed 64-bit values with saturation.
|
||||
*
|
||||
* @param a one value
|
||||
* @param b another value
|
||||
* @return sum with signed saturation
|
||||
*/
|
||||
static av_always_inline int64_t av_sat_add64_c(int64_t a, int64_t b) {
|
||||
#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5,1)) || AV_HAS_BUILTIN(__builtin_add_overflow)
|
||||
int64_t tmp;
|
||||
return !__builtin_add_overflow(a, b, &tmp) ? tmp : (tmp < 0 ? INT64_MAX : INT64_MIN);
|
||||
#else
|
||||
int64_t s = a+(uint64_t)b;
|
||||
if ((int64_t)(a^b | ~s^b) >= 0)
|
||||
return INT64_MAX ^ (b >> 63);
|
||||
return s;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Subtract two signed 64-bit values with saturation.
|
||||
*
|
||||
* @param a one value
|
||||
* @param b another value
|
||||
* @return difference with signed saturation
|
||||
*/
|
||||
static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) {
|
||||
#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5,1)) || AV_HAS_BUILTIN(__builtin_sub_overflow)
|
||||
int64_t tmp;
|
||||
return !__builtin_sub_overflow(a, b, &tmp) ? tmp : (tmp < 0 ? INT64_MAX : INT64_MIN);
|
||||
#else
|
||||
if (b <= 0 && a >= INT64_MAX + b)
|
||||
return INT64_MAX;
|
||||
if (b >= 0 && a <= INT64_MIN + b)
|
||||
return INT64_MIN;
|
||||
return a - b;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a float value into the amin-amax range.
|
||||
* If a is nan or -inf amin will be returned.
|
||||
* If a is +inf amax will be returned.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
return FFMIN(FFMAX(a, amin), amax);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a double value into the amin-amax range.
|
||||
* If a is nan or -inf amin will be returned.
|
||||
* If a is +inf amax will be returned.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const double av_clipd_c(double a, double amin, double amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
return FFMIN(FFMAX(a, amin), amax);
|
||||
}
|
||||
|
||||
/** Compute ceil(log2(x)).
|
||||
* @param x value used to compute ceil(log2(x))
|
||||
* @return computed ceiling of log2(x)
|
||||
*/
|
||||
static av_always_inline av_const int av_ceil_log2_c(int x)
|
||||
{
|
||||
return av_log2((x - 1U) << 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Count number of bits set to one in x
|
||||
* @param x value to count bits of
|
||||
* @return the number of bits set to one in x
|
||||
*/
|
||||
static av_always_inline av_const int av_popcount_c(uint32_t x)
|
||||
{
|
||||
x -= (x >> 1) & 0x55555555;
|
||||
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
|
||||
x = (x + (x >> 4)) & 0x0F0F0F0F;
|
||||
x += x >> 8;
|
||||
return (x + (x >> 16)) & 0x3F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count number of bits set to one in x
|
||||
* @param x value to count bits of
|
||||
* @return the number of bits set to one in x
|
||||
*/
|
||||
static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
||||
{
|
||||
return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
|
||||
}
|
||||
|
||||
static av_always_inline av_const int av_parity_c(uint32_t v)
|
||||
{
|
||||
return av_popcount(v) & 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
|
||||
*
|
||||
* @param val Output value, must be an lvalue of type uint32_t.
|
||||
* @param GET_BYTE Expression reading one byte from the input.
|
||||
* Evaluated up to 7 times (4 for the currently
|
||||
* assigned Unicode range). With a memory buffer
|
||||
* input, this could be *ptr++, or if you want to make sure
|
||||
* that *ptr stops at the end of a NULL terminated string then
|
||||
* *ptr ? *ptr++ : 0
|
||||
* @param ERROR Expression to be evaluated on invalid input,
|
||||
* typically a goto statement.
|
||||
*
|
||||
* @warning ERROR should not contain a loop control statement which
|
||||
* could interact with the internal while loop, and should force an
|
||||
* exit from the macro code (e.g. through a goto or a return) in order
|
||||
* to prevent undefined results.
|
||||
*/
|
||||
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
||||
val= (uint8_t)(GET_BYTE);\
|
||||
{\
|
||||
uint32_t top = (val & 128) >> 1;\
|
||||
if ((val & 0xc0) == 0x80 || val >= 0xFE)\
|
||||
{ERROR}\
|
||||
while (val & top) {\
|
||||
unsigned int tmp = (uint8_t)(GET_BYTE) - 128;\
|
||||
if(tmp>>6)\
|
||||
{ERROR}\
|
||||
val= (val<<6) + tmp;\
|
||||
top <<= 5;\
|
||||
}\
|
||||
val &= (top << 1) - 1;\
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
|
||||
*
|
||||
* @param val Output value, must be an lvalue of type uint32_t.
|
||||
* @param GET_16BIT Expression returning two bytes of UTF-16 data converted
|
||||
* to native byte order. Evaluated one or two times.
|
||||
* @param ERROR Expression to be evaluated on invalid input,
|
||||
* typically a goto statement.
|
||||
*/
|
||||
#define GET_UTF16(val, GET_16BIT, ERROR)\
|
||||
val = (uint16_t)(GET_16BIT);\
|
||||
{\
|
||||
unsigned int hi = val - 0xD800;\
|
||||
if (hi < 0x800) {\
|
||||
val = (uint16_t)(GET_16BIT) - 0xDC00;\
|
||||
if (val > 0x3FFU || hi > 0x3FFU)\
|
||||
{ERROR}\
|
||||
val += (hi<<10) + 0x10000;\
|
||||
}\
|
||||
}\
|
||||
|
||||
/**
|
||||
* @def PUT_UTF8(val, tmp, PUT_BYTE)
|
||||
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
|
||||
* @param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
|
||||
* val is given as a function it is executed only once.
|
||||
* @param tmp is a temporary variable and should be of type uint8_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_BYTE.
|
||||
* @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
|
||||
* It could be a function or a statement, and uses tmp as the input byte.
|
||||
* For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
|
||||
* executed up to 4 times for values in the valid UTF-8 range and up to
|
||||
* 7 times in the general case, depending on the length of the converted
|
||||
* Unicode character.
|
||||
*/
|
||||
#define PUT_UTF8(val, tmp, PUT_BYTE)\
|
||||
{\
|
||||
int bytes, shift;\
|
||||
uint32_t in = val;\
|
||||
if (in < 0x80) {\
|
||||
tmp = in;\
|
||||
PUT_BYTE\
|
||||
} else {\
|
||||
bytes = (av_log2(in) + 4) / 5;\
|
||||
shift = (bytes - 1) * 6;\
|
||||
tmp = (256 - (256 >> bytes)) | (in >> shift);\
|
||||
PUT_BYTE\
|
||||
while (shift >= 6) {\
|
||||
shift -= 6;\
|
||||
tmp = 0x80 | ((in >> shift) & 0x3f);\
|
||||
PUT_BYTE\
|
||||
}\
|
||||
}\
|
||||
}
|
||||
|
||||
/**
|
||||
* @def PUT_UTF16(val, tmp, PUT_16BIT)
|
||||
* Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
|
||||
* @param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
|
||||
* val is given as a function it is executed only once.
|
||||
* @param tmp is a temporary variable and should be of type uint16_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_16BIT.
|
||||
* @param PUT_16BIT writes the converted UTF-16 data to any proper destination
|
||||
* in desired endianness. It could be a function or a statement, and uses tmp
|
||||
* as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
|
||||
* PUT_BYTE will be executed 1 or 2 times depending on input character.
|
||||
*/
|
||||
#define PUT_UTF16(val, tmp, PUT_16BIT)\
|
||||
{\
|
||||
uint32_t in = val;\
|
||||
if (in < 0x10000) {\
|
||||
tmp = in;\
|
||||
PUT_16BIT\
|
||||
} else {\
|
||||
tmp = 0xD800 | ((in - 0x10000) >> 10);\
|
||||
PUT_16BIT\
|
||||
tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
|
||||
PUT_16BIT\
|
||||
}\
|
||||
}\
|
||||
|
||||
#endif /* AVUTIL_COMMON_H */
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_CONTAINER_FIFO_H
|
||||
#define AVUTIL_CONTAINER_FIFO_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/**
|
||||
* AVContainerFifo is a FIFO for "containers" - dynamically allocated reusable
|
||||
* structs (e.g. AVFrame or AVPacket). AVContainerFifo uses an internal pool of
|
||||
* such containers to avoid allocating and freeing them repeatedly.
|
||||
*/
|
||||
typedef struct AVContainerFifo AVContainerFifo;
|
||||
|
||||
enum AVContainerFifoFlags {
|
||||
/**
|
||||
* Signal to av_container_fifo_write() that it should make a new reference
|
||||
* to data in src rather than consume its contents.
|
||||
*
|
||||
* @note you must handle this flag manually in your own fifo_transfer()
|
||||
* callback
|
||||
*/
|
||||
AV_CONTAINER_FIFO_FLAG_REF = (1 << 0),
|
||||
|
||||
/**
|
||||
* This and all higher bits in flags may be set to any value by the caller
|
||||
* and are guaranteed to be passed through to the fifo_transfer() callback
|
||||
* and not be interpreted by AVContainerFifo code.
|
||||
*/
|
||||
AV_CONTAINER_FIFO_FLAG_USER = (1 << 16),
|
||||
};
|
||||
|
||||
/**
|
||||
* Allocate a new AVContainerFifo for the container type defined by provided
|
||||
* callbacks.
|
||||
*
|
||||
* @param opaque user data that will be passed to the callbacks provided to this
|
||||
* function
|
||||
* @param container_alloc allocate a new container instance and return a pointer
|
||||
* to it, or NULL on failure
|
||||
* @param container_reset reset the provided container instance to a clean state
|
||||
* @param container_free free the provided container instance
|
||||
* @param fifo_transfer Transfer the contents of container src to dst.
|
||||
* @param flags currently unused
|
||||
*
|
||||
* @return newly allocated AVContainerFifo, or NULL on failure
|
||||
*/
|
||||
AVContainerFifo*
|
||||
av_container_fifo_alloc(void *opaque,
|
||||
void* (*container_alloc)(void *opaque),
|
||||
void (*container_reset)(void *opaque, void *obj),
|
||||
void (*container_free) (void *opaque, void *obj),
|
||||
int (*fifo_transfer) (void *opaque, void *dst, void *src, unsigned flags),
|
||||
unsigned flags);
|
||||
|
||||
/**
|
||||
* Allocate an AVContainerFifo instance for AVFrames.
|
||||
*
|
||||
* @param flags currently unused
|
||||
*/
|
||||
AVContainerFifo *av_container_fifo_alloc_avframe(unsigned flags);
|
||||
|
||||
/**
|
||||
* Free a AVContainerFifo and everything in it.
|
||||
*/
|
||||
void av_container_fifo_free(AVContainerFifo **cf);
|
||||
|
||||
/**
|
||||
* Write the contents of obj to the FIFO.
|
||||
*
|
||||
* The fifo_transfer() callback previously provided to av_container_fifo_alloc()
|
||||
* will be called with obj as src in order to perform the actual transfer.
|
||||
*/
|
||||
int av_container_fifo_write(AVContainerFifo *cf, void *obj, unsigned flags);
|
||||
|
||||
/**
|
||||
* Read the next available object from the FIFO into obj.
|
||||
*
|
||||
* The fifo_read() callback previously provided to av_container_fifo_alloc()
|
||||
* will be called with obj as dst in order to perform the actual transfer.
|
||||
*/
|
||||
int av_container_fifo_read(AVContainerFifo *cf, void *obj, unsigned flags);
|
||||
|
||||
/**
|
||||
* Access objects stored in the FIFO without retrieving them. The
|
||||
* fifo_transfer() callback will NOT be invoked and the FIFO state will not be
|
||||
* modified.
|
||||
*
|
||||
* @param pobj Pointer to the object stored in the FIFO will be written here on
|
||||
* success. The object remains owned by the FIFO and the caller may
|
||||
* only access it as long as the FIFO is not modified.
|
||||
* @param offset Position of the object to retrieve - 0 is the next item that
|
||||
* would be read, 1 the one after, etc. Must be smaller than
|
||||
* av_container_fifo_can_read().
|
||||
*
|
||||
* @retval 0 success, a pointer was written into pobj
|
||||
* @retval AVERROR(EINVAL) invalid offset value
|
||||
*/
|
||||
int av_container_fifo_peek(AVContainerFifo *cf, void **pobj, size_t offset);
|
||||
|
||||
/**
|
||||
* Discard the specified number of elements from the FIFO.
|
||||
*
|
||||
* @param nb_elems number of elements to discard, MUST NOT be larger than
|
||||
* av_fifo_can_read(f)
|
||||
*/
|
||||
void av_container_fifo_drain(AVContainerFifo *cf, size_t nb_elems);
|
||||
|
||||
/**
|
||||
* @return number of objects available for reading
|
||||
*/
|
||||
size_t av_container_fifo_can_read(const AVContainerFifo *cf);
|
||||
|
||||
#endif // AVCODEC_CONTAINER_FIFO_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user