Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
0d0b81f9
Commit
0d0b81f9
authored
Mar 14, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate manpages for AV{Format,Codec}Context AVOptions.
parent
4fea8959
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
5 deletions
+140
-5
Makefile
Makefile
+1
-1
Makefile
doc/Makefile
+13
-4
avtools-common-opts.texi
doc/avtools-common-opts.texi
+3
-0
print_options.c
doc/print_options.c
+123
-0
No files found.
Makefile
View file @
0d0b81f9
...
...
@@ -60,7 +60,7 @@ PROGS-$(CONFIG_AVSERVER) += avserver
PROGS
:=
$
(
PROGS-yes:%
=
%
$(EXESUF)
)
OBJS
=
$
(
PROGS-yes:%
=
%.o
)
cmdutils.o
TESTTOOLS
=
audiogen videogen rotozoom tiny_psnr
base64
HOSTPROGS
:=
$
(
TESTTOOLS:%
=
tests/%
)
HOSTPROGS
:=
$
(
TESTTOOLS:%
=
tests/%
)
doc/print_options
TOOLS
=
qt-faststart trasher
TOOLS-$(CONFIG_ZLIB)
+=
cws2fws
...
...
doc/Makefile
View file @
0d0b81f9
...
...
@@ -17,18 +17,27 @@ documentation: $(DOCS)
TEXIDEP
=
awk
'/^@include/ { printf "$@: $(@D)/%s\n", $$2 }'
<
$<
>
$
(
@:%
=
%.d
)
doc/print_options.o
:
libavformat/options_table.h libavcodec/options_table.h
GENTEXI
=
format codec
GENTEXI
:=
$
(
GENTEXI:%
=
doc/avoptions_%.texi
)
$(GENTEXI)
:
TAG = GENTEXI
$(GENTEXI)
:
doc/avoptions_%.texi: doc/print_options
$(M)
doc/print_options
$*
>
$@
doc/%.html
:
TAG = HTML
doc/%.html
:
doc/%.texi $(SRC_PATH)/doc/t2h.init
doc/%.html
:
doc/%.texi $(SRC_PATH)/doc/t2h.init
$(GENTEXI)
$(Q)$(TEXIDEP)
$(M)
texi2html
-monolithic
--init-file
$(SRC_PATH)
/doc/t2h.init
--output
$@
$<
doc/%.pod
:
TAG = POD
doc/%.pod
:
doc/%.texi
doc/%.pod
:
doc/%.texi
$(GENTEXI)
$(Q)$(TEXIDEP)
$(M)$(SRC_PATH)
/doc/texi2pod.pl
$<
$@
doc/%.1
:
TAG = MAN
doc/%.1
:
doc/%.pod
doc/%.1
:
doc/%.pod
$(GENTEXI)
$(M)
pod2man
--section
=
1
--center
=
" "
--release
=
" "
$<
>
$@
$(DOCS)
:
| doc
...
...
@@ -46,7 +55,7 @@ uninstall-man:
$(RM)
$
(
addprefix
"
$(MANDIR)
/man1/"
,
$(ALLMANPAGES)
)
clean
::
$(RM)
doc/
*
.html doc/
*
.pod doc/
*
.1
$
(
CLEANSUFFIXES:%
=
doc/%
)
$(RM)
doc/
*
.html doc/
*
.pod doc/
*
.1
$
(
CLEANSUFFIXES:%
=
doc/%
)
doc/avoptions_
*
.texi
-include $(wildcard $(DOCS
:
%=%.d))
...
...
doc/avtools-common-opts.texi
View file @
0d0b81f9
...
...
@@ -156,3 +156,6 @@ use @option{-option 0}/@option{-option 1}.
Note2 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.
@include avoptions_codec.texi
@include avoptions_format.texi
doc/print_options.c
0 → 100644
View file @
0d0b81f9
/*
* Copyright (c) 2012 Anton Khirnov
*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* generate texinfo manpages for avoptions
*/
#include <stddef.h>
#include <string.h>
#include <float.h>
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/opt.h"
static
void
print_usage
(
void
)
{
fprintf
(
stderr
,
"Usage: enum_options type
\n
"
"type: format codec
\n
"
);
exit
(
1
);
}
static
void
print_option
(
const
AVOption
*
opts
,
const
AVOption
*
o
,
int
per_stream
)
{
printf
(
"@item -%s%s @var{"
,
o
->
name
,
per_stream
?
"[:stream_specifier]"
:
""
);
switch
(
o
->
type
)
{
case
AV_OPT_TYPE_BINARY
:
printf
(
"hexadecimal string"
);
break
;
case
AV_OPT_TYPE_STRING
:
printf
(
"string"
);
break
;
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_INT64
:
printf
(
"integer"
);
break
;
case
AV_OPT_TYPE_FLOAT
:
case
AV_OPT_TYPE_DOUBLE
:
printf
(
"float"
);
break
;
case
AV_OPT_TYPE_RATIONAL
:
printf
(
"rational number"
);
break
;
case
AV_OPT_TYPE_FLAGS
:
printf
(
"flags"
);
break
;
default:
printf
(
"value"
);
break
;
}
printf
(
"} (@emph{"
);
if
(
o
->
flags
&
AV_OPT_FLAG_DECODING_PARAM
)
{
printf
(
"input"
);
if
(
o
->
flags
&
AV_OPT_FLAG_ENCODING_PARAM
)
printf
(
"/"
);
}
if
(
o
->
flags
&
AV_OPT_FLAG_ENCODING_PARAM
)
printf
(
"output"
);
if
(
o
->
flags
&
AV_OPT_FLAG_AUDIO_PARAM
)
printf
(
",audio"
);
if
(
o
->
flags
&
AV_OPT_FLAG_VIDEO_PARAM
)
printf
(
",video"
);
if
(
o
->
flags
&
AV_OPT_FLAG_SUBTITLE_PARAM
)
printf
(
",subtitles"
);
printf
(
"})
\n
"
);
if
(
o
->
help
)
printf
(
"%s
\n
"
,
o
->
help
);
if
(
o
->
unit
)
{
const
AVOption
*
u
;
printf
(
"
\n
Possible values:
\n
@table @samp
\n
"
);
for
(
u
=
opts
;
u
->
name
;
u
++
)
{
if
(
u
->
type
==
AV_OPT_TYPE_CONST
&&
u
->
unit
&&
!
strcmp
(
u
->
unit
,
o
->
unit
))
printf
(
"@item %s
\n
%s
\n
"
,
u
->
name
,
u
->
help
?
u
->
help
:
""
);
}
printf
(
"@end table
\n
"
);
}
}
static
void
show_opts
(
const
AVOption
*
opts
,
int
per_stream
)
{
const
AVOption
*
o
;
printf
(
"@table @option
\n
"
);
for
(
o
=
opts
;
o
->
name
;
o
++
)
{
if
(
o
->
type
!=
AV_OPT_TYPE_CONST
)
print_option
(
opts
,
o
,
per_stream
);
}
printf
(
"@end table
\n
"
);
}
static
void
show_format_opts
(
void
)
{
#include "libavformat/options_table.h"
printf
(
"@section Format AVOptions
\n
"
);
show_opts
(
options
,
0
);
}
static
void
show_codec_opts
(
void
)
{
#include "libavcodec/options_table.h"
printf
(
"@section Codec AVOptions
\n
"
);
show_opts
(
options
,
1
);
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
2
)
print_usage
();
if
(
!
strcmp
(
argv
[
1
],
"format"
))
show_format_opts
();
else
if
(
!
strcmp
(
argv
[
1
],
"codec"
))
show_codec_opts
();
else
print_usage
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment