[MPlayer-cvslog] r35917 - trunk/configure

diego subversion at mplayerhq.hu
Mon Feb 18 03:58:33 CET 2013


Author: diego
Date: Mon Feb 18 03:58:32 2013
New Revision: 35917

Log:
configure: Refactor listing libav* subparts into a function

Modified:
   trunk/configure

Modified: trunk/configure
==============================================================================
--- trunk/configure	Sun Feb 17 14:17:51 2013	(r35916)
+++ trunk/configure	Mon Feb 18 03:58:32 2013	(r35917)
@@ -688,25 +688,32 @@ _libavcodec_mpegaudio_hp=yes
 _libopencore_amrnb=auto
 _libopencore_amrwb=auto
 libopenjpeg=auto
-libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' ffmpeg/libavcodec/allcodecs.c | toupper)
+
+list_subparts() {
+  pattern="s/^[^#]*${1}.*([^ ,]*, *\([^ ,)]*\).*/\1_${2}/p"
+  sed -n "$pattern" ffmpeg/libav${3} | toupper
+}
+
+libavdecoders_all=$(list_subparts  DEC      decoder  codec/allcodecs.c)
+libavencoders_all=$(list_subparts  ENC      encoder  codec/allcodecs.c)
+libavparsers_all=$(list_subparts   PARSER   parser   codec/allcodecs.c)
+libavbsfs_all=$(list_subparts      BSF      bsf      codec/allcodecs.c)
+libavhwaccels_all=$(list_subparts  HWACCEL  hwaccel  codec/allcodecs.c)
+libavdemuxers_all=$(list_subparts  DEMUX    demuxer  format/allformats.c)
+libavmuxers_all=$(list_subparts    _MUX     muxer    format/allformats.c)
+libavprotocols_all=$(list_subparts PROTOCOL protocol format/allformats.c)
+libavfilters_all=$(list_subparts   FILTER   filter   filter/allfilters.c)
+
 libavdecoders=$(echo $libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g')
-libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' ffmpeg/libavcodec/allcodecs.c | toupper)
 libavencoders=$(echo $libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g')
-libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' ffmpeg/libavcodec/allcodecs.c | toupper)
 libavparsers=$libavparsers_all
-libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' ffmpeg/libavcodec/allcodecs.c | toupper)
 libavbsfs=$libavbsfs_all
-libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' ffmpeg/libavcodec/allcodecs.c | toupper)
 # Disable all hardware accelerators for now.
 libavhwaccels=
-libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' ffmpeg/libavformat/allformats.c | toupper)
 libavdemuxers=$(echo $libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/AVISYNTH_DEMUXER//)
-libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' ffmpeg/libavformat/allformats.c | toupper)
 libavmuxers=$(echo $libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// -e s/RTSP_MUXER// -e s/SAP_MUXER//)
-libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' ffmpeg/libavformat/allformats.c | toupper)
 libavprotocols=$libavprotocols_all
 libavprotocols=$(echo $libavprotocols | sed -e s/HTTPS_PROTOCOL// -e s/TLS_PROTOCOL// -e s/BLURAY_PROTOCOL// -e s/FFRTMPCRYPT_PROTOCOL//)
-libavfilters_all=$(sed -n 's/^[^#]*FILTER.*(.*, *\(.*\),.*).*/\1_filter/p' ffmpeg/libavfilter/allfilters.c | toupper)
 libavfilters=$(echo $libavfilters_all | sed -e 's/ LIB[A-Z0-9_]*_FILTER//g' -e 's/ FREI0R[A-Z0-9_]*_FILTER//g' -e 's/ OCV_FILTER//g' -e 's/ MP_FILTER//g')
 _mencoder=yes
 _mplayer=yes


More information about the MPlayer-cvslog mailing list