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
36 while read define var value; do
37 case "$define $var $value" in
38 "#define CONFIG_"*_*" 1") eval "$var=1";;
46 add_line "case ${id}:"
47 eval "c=\${CONFIG_${n}_DECODER}:\${CONFIG_${n}_ENCODER}"
54 "") add_line " return \"$n\";" ;;
56 add_line " { extern AVCodec ff_${n}_${s};"
57 add_line " return ff_${n}_${s}.name; }"
62 parse_enum_codecid () {
66 *CODEC_ID_FIRST*///*dummy*) ;;
67 CODEC_ID_*) define_codecid ${line%%[=,]*};;
75 "enum CodecID {") parse_enum_codecid; break;;
80 parse_config_h < "$config"
81 parse_avcodec_h < "$codecs"
82 sed -e '/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
83 -e 's/extern avcodec /extern AVCodec /' > "$out" <<EOF