3 # Copyright (c) 2011 Nicolas George
5 # This file is part of FFmpeg.
7 # FFmpeg is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # FFmpeg is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with FFmpeg; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 while read define var value; do
36 case "$define $var $value" in
37 "#define CONFIG_"*_*" 1") eval "$var=1";;
45 add_line "case ${id}:"
46 eval "c=\${CONFIG_${n}_DECODER}:\${CONFIG_${n}_ENCODER}"
53 "") add_line " return \"$n\";" ;;
55 add_line " { extern AVCodec ff_${n}_${s};"
56 add_line " return ff_${n}_${s}.name; }"
61 parse_enum_codecid () {
65 *CODEC_ID_FIRST*=*) ;;
66 CODEC_ID_*) define_codecid ${line%%[=,]*};;
74 "enum CodecID {") parse_enum_codecid; break;;
79 parse_config_h < "$config"
80 parse_avcodec_h # use stdin
81 sed -e '/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
82 -e 's/extern avcodec /extern AVCodec /' > "$out" <<EOF