| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # This script file generates necessary defines for ffmpeg compilation |
| 4 | # As it has got a little bit tricky it must be carefully checked |
| 5 | # which codecs are checked by ffmpeg.m4 file |
| 6 | |
| 7 | source_path=ffmpeg |
| 8 | result_file="include/configff.h" |
| 9 | |
| 10 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine().() { |
| 11 | prune="$1" |
| 12 | shift |
| 13 | for i in "$@" |
| 14 | do |
| 15 | #test $prune -eq 1 && |
| 16 | echoscip-shell system . . echo. "#define CONFIG_"`echoscip-shell system . . echo. $i | trscip-shell system . . tr. a-z A-Z`" $prune" |
| 17 | #echo "#define ENABLE_"`echo $i | tr a-z A-Z`" $prune" |
| 18 | done |
| 19 | } |
| 20 | |
| 21 | prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune().() { |
| 22 | pattern="$1" |
| 23 | shift |
| 24 | echoscip-shell system . . echo. "$@" | sedscip-shell system . . sed. "s%\\<$pattern\\>%%g" |
| 25 | } |
| 26 | |
| 27 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern().() { |
| 28 | pattern="$1" |
| 29 | shift |
| 30 | echoscip-shell system . . echo. "$@" | grepscip-shell system . . grep. $pattern >/dev/nullscip-shell filesystem . . `/dev/null`. |
| 31 | } |
| 32 | |
| 33 | createlistscip-shell shell avifile 1:0.7.48~20090503.ds-32 createlist().() { |
| 34 | |
| 35 | ENCODER_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' "$source_path/libavcodec/allcodecs.c"` |
| 36 | DECODER_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' "$source_path/libavcodec/allcodecs.c"` |
| 37 | HWACCEL_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' "$source_path/libavcodec/allcodecs.c"` |
| 38 | PARSER_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' "$source_path/libavcodec/allcodecs.c"` |
| 39 | BSF_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' "$source_path/libavcodec/allcodecs.c"` |
| 40 | MUXER_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavformat/allformats.c"` |
| 41 | DEMUXER_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavformat/allformats.c"` |
| 42 | OUTDEV_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' "$source_path/libavdevice/alldevices.c"` |
| 43 | INDEV_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' "$source_path/libavdevice/alldevices.c"` |
| 44 | PROTOCOL_LIST=`sedscip-shell system . . sed. -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' "$source_path/libavformat/allformats.c"` |
| 45 | |
| 46 | #echo $BSF_LIST |
| 47 | DETECT_ENCODER="png flashsv zmbv" |
| 48 | PRUNE_ENCODER="\ |
| 49 | libamr_nb\ |
| 50 | libamr_wb\ |
| 51 | libdirac\ |
| 52 | libfaac\ |
| 53 | libgsm\ |
| 54 | libgsm_ms\ |
| 55 | libmp3lame\ |
| 56 | libschroedinger\ |
| 57 | libtheora\ |
| 58 | libvorbis\ |
| 59 | libx264\ |
| 60 | libxvid\ |
| 61 | oggvorbis\ |
| 62 | snow\ |
| 63 | " |
| 64 | DETECT_DECODER="\ |
| 65 | libfaad\ |
| 66 | libopenjpeg\ |
| 67 | mpeg4aac\ |
| 68 | dxa\ |
| 69 | flashsv\ |
| 70 | png\ |
| 71 | tscc\ |
| 72 | zmbv\ |
| 73 | " |
| 74 | PRUNE_DECODER="\ |
| 75 | libamr_nb\ |
| 76 | libamr_wb\ |
| 77 | libdirac\ |
| 78 | libgsm\ |
| 79 | libgsm_ms\ |
| 80 | libschroedinger\ |
| 81 | libspeex\ |
| 82 | libvorbis\ |
| 83 | libxvid\ |
| 84 | mpeg_xvmc\ |
| 85 | oggvorbis\ |
| 86 | snow\ |
| 87 | xvmc\ |
| 88 | h264_vdpau\ |
| 89 | mpeg_vdpau\ |
| 90 | mpeg1_vdpau\ |
| 91 | vc1_vdpau\ |
| 92 | wmv3_vdpau\ |
| 93 | " |
| 94 | DETECT_HWACCEL= |
| 95 | PRUNE_HWACCEL="h263_vaapi mpeg2_vaapi mpeg4_vaapi vc1_vaapi wmv3_vaapi" |
| 96 | DETECT_PARSER= |
| 97 | PRUNE_PARSER= |
| 98 | DETECT_BSF= |
| 99 | PRUNE_BSF= |
| 100 | DETECT_MUXER="oss" |
| 101 | PRUNE_MUXER="libnut ogg" |
| 102 | DETECT_DEMUXER="oss" |
| 103 | PRUNE_DEMUXER="libnut ogg avisynth vc1t" |
| 104 | DETECT_PROTOCOL= |
| 105 | PRUNE_PROTOCOL= |
| 106 | DETECT_OUTDEV="oss dv1394 libdc1394" |
| 107 | PRUNE_OUTDEV="alsa bktr audio_beos" |
| 108 | DETECT_INDEV="oss dv1394 libdc1394" |
| 109 | PRUNE_INDEV="alsa bktr audio_beos jack vfwcap x11_grab_device" |
| 110 | |
| 111 | for i in $DETECT_ENCODER $PRUNE_ENCODER; do |
| 112 | ENCODER_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_encoder $ENCODER_LIST` |
| 113 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_ENCODER || ENCODER_PRUNE="$ENCODER_PRUNE ${i}_encoder" |
| 114 | done |
| 115 | |
| 116 | for i in $DETECT_DECODER $PRUNE_DECODER; do |
| 117 | DECODER_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_decoder $DECODER_LIST` |
| 118 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_DECODER || DECODER_PRUNE="$DECODER_PRUNE ${i}_decoder" |
| 119 | done |
| 120 | |
| 121 | for i in $DETECT_HWACCEL $PRUNE_HWACCEL; do |
| 122 | HWACCEL_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_hwaccel $HWACCEL_LIST` |
| 123 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_HWACCEL || HWACCEL_PRUNE="$HWACCEL_PRUNE ${i}_hwaccel" |
| 124 | done |
| 125 | |
| 126 | for i in $DETECT_PARSER $PRUNE_PARSER; do |
| 127 | PARSER_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_parser $PARSER_LIST` |
| 128 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_PARSER || PARSER_PRUNE="$PARSER_PRUNE ${i}_parser" |
| 129 | done |
| 130 | |
| 131 | for i in $DETECT_BSF $PRUNE_BSF; do |
| 132 | BSF_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_bsf $BSF_LIST` |
| 133 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_BSF || BSF_PRUNE="$BSF_PRUNE ${i}_bsf" |
| 134 | done |
| 135 | |
| 136 | for i in $DETECT_MUXER $PRUNE_MUXER; do |
| 137 | MUXER_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_muxer $MUXER_LIST` |
| 138 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_MUXER || MUXER_PRUNE="$MUXER_PRUNE ${i}_muxer" |
| 139 | done |
| 140 | |
| 141 | for i in $DETECT_DEMUXER $PRUNE_DEMUXER; do |
| 142 | DEMUXER_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_demuxer $DEMUXER_LIST` |
| 143 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_DEMUXER || DEMUXER_PRUNE="$DEMUXER_PRUNE ${i}_demuxer" |
| 144 | done |
| 145 | |
| 146 | for i in $DETECT_PROTOCOL $PRUNE_PROTOCOL; do |
| 147 | PROTOCOL_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_protocol $PROTOCOL_LIST` |
| 148 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_PROTOCOL || PROTOCOL_PRUNE="$PROTOCOL_PRUNE ${i}_protocol" |
| 149 | done |
| 150 | |
| 151 | for i in $DETECT_OUTDEV $PRUNE_OUTDEV; do |
| 152 | OUTDEV_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_muxer $OUTDEV_LIST` |
| 153 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_OUTDEV || OUTDEV_PRUNE="$OUTDEV_PRUNE ${i}_muxer" |
| 154 | done |
| 155 | |
| 156 | for i in $DETECT_INDEV $PRUNE_INDEV; do |
| 157 | INDEV_LIST=`prunescip-shell shell avifile 1:0.7.48~20090503.ds-32 prune(). ${i}_demuxer $INDEV_LIST` |
| 158 | haspatternscip-shell shell avifile 1:0.7.48~20090503.ds-32 haspattern(). $i $DETECT_INDEV || INDEV_PRUNE="$INDEV_PRUNE ${i}_demuxer" |
| 159 | done |
| 160 | |
| 161 | catscip-shell system . . cat. <<_ACEOF |
| 162 | /* |
| 163 | * This file is generated by the script: admin/gendefs.sh |
| 164 | * Do not modify it by hand! |
| 165 | */ |
| 166 | |
| 167 | #define ENABLE_VHOOK 0 |
| 168 | _ACEOF |
| 169 | |
| 170 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $DECODER_LIST |
| 171 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $DECODER_PRUNE |
| 172 | |
| 173 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $DEMUXER_LIST |
| 174 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $DEMUXER_PRUNE |
| 175 | |
| 176 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $HWACCEL_LIST |
| 177 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $HWACCEL_PRUNE |
| 178 | |
| 179 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $PARSER_LIST |
| 180 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $PARSER_PRUNE |
| 181 | |
| 182 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $BSF_LIST |
| 183 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $BSF_PRUNE |
| 184 | |
| 185 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $ENCODER_LIST |
| 186 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $ENCODER_PRUNE |
| 187 | |
| 188 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $MUXER_LIST |
| 189 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $MUXER_PRUNE |
| 190 | |
| 191 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $PROTOCOL_LIST |
| 192 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $PROTOCOL_PRUNE |
| 193 | |
| 194 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $OUTDEV_LIST |
| 195 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $OUTDEV_PRUNE |
| 196 | |
| 197 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 1 $INDEV_LIST |
| 198 | gendefinescip-shell shell avifile 1:0.7.48~20090503.ds-32 gendefine(). 0 $INDEV_PRUNE |
| 199 | |
| 200 | echoscip-shell system . . echo. |
| 201 | |
| 202 | } |
| 203 | |
| 204 | echoscip-shell system . . echo. -n "Creating list of $result_file, wait..." |
| 205 | createlistscip-shell shell avifile 1:0.7.48~20090503.ds-32 createlist(). >$result_file |
| 206 | echoscip-shell system . . echo. "done" |