Commit 0146fa95 authored by Johann's avatar Johann

Parse codec options in order of occurrence.

Each time a codec is enabled or disabled with the umbrella
--enable-vpN flag, set the encoder and decoder configurations as well.
This was done as a post-processing step but doing that lost the order of
the arguments.

BUG=webm:1205

Change-Id: Ic629bfdd06acc04bc5a7227309f36bba54dad8b1
parent 181988d3
...@@ -185,6 +185,25 @@ add_extralibs() { ...@@ -185,6 +185,25 @@ add_extralibs() {
# #
# Boolean Manipulation Functions # Boolean Manipulation Functions
# #
enable_codec(){
enabled $1 || echo " enabling $1"
set_all yes $1
is_in $1 vp8 vp9 vp10 && \
set_all yes $1_encoder && \
set_all yes $1_decoder
}
disable_codec(){
disabled $1 || echo " disabling $1"
set_all no $1
is_in $1 vp8 vp9 vp10 && \
set_all no $1_encoder && \
set_all no $1_decoder
}
enable_feature(){ enable_feature(){
set_all yes $* set_all yes $*
} }
......
...@@ -195,12 +195,12 @@ if [ ${doxy_major:-0} -ge 1 ]; then ...@@ -195,12 +195,12 @@ if [ ${doxy_major:-0} -ge 1 ]; then
fi fi
# disable codecs when their source directory does not exist # disable codecs when their source directory does not exist
[ -d "${source_path}/vp8" ] || disable_feature vp8 [ -d "${source_path}/vp8" ] || disable_codec vp8
[ -d "${source_path}/vp9" ] || disable_feature vp9 [ -d "${source_path}/vp9" ] || disable_codec vp9
[ -d "${source_path}/vp10" ] || disable_feature vp10 [ -d "${source_path}/vp10" ] || disable_codec vp10
# disable vp10 codec by default # disable vp10 codec by default
disable_feature vp10 disable_codec vp10
# install everything except the sources, by default. sources will have # install everything except the sources, by default. sources will have
# to be enabled when doing dist builds, since that's no longer a common # to be enabled when doing dist builds, since that's no longer a common
...@@ -391,7 +391,9 @@ process_cmdline() { ...@@ -391,7 +391,9 @@ process_cmdline() {
for opt do for opt do
optval="${opt#*=}" optval="${opt#*=}"
case "$opt" in case "$opt" in
--disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;; --disable-codecs)
for c in ${CODEC_FAMILIES}; do disable_codec $c; done
;;
--enable-?*|--disable-?*) --enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then
...@@ -400,6 +402,8 @@ process_cmdline() { ...@@ -400,6 +402,8 @@ process_cmdline() {
else else
log_echo "Ignoring $opt -- not in experimental mode." log_echo "Ignoring $opt -- not in experimental mode."
fi fi
elif is_in ${option} "${CODECS} ${CODEC_FAMILIES}"; then
${action}_codec ${option}
else else
process_common_cmdline $opt process_common_cmdline $opt
fi fi
...@@ -413,14 +417,6 @@ process_cmdline() { ...@@ -413,14 +417,6 @@ process_cmdline() {
post_process_cmdline() { post_process_cmdline() {
c="" c=""
# If the codec family is disabled, disable all components of that family.
# If the codec family is enabled, enable all components of that family.
log_echo "Configuring selected codecs"
for c in ${CODECS}; do
disabled ${c%%_*} && disable_feature ${c}
enabled ${c%%_*} && enable_feature ${c}
done
# Enable all detected codecs, if they haven't been disabled # Enable all detected codecs, if they haven't been disabled
for c in ${CODECS}; do soft_enable $c; done for c in ${CODECS}; do soft_enable $c; done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment