2016-07-19 18:10:57 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright 2013-2015 Tomas Popela <tpopela@redhat.com>
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included
|
|
|
|
# in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
# $1 files
|
|
|
|
# $2 verbose
|
|
|
|
function copy_files() {
|
|
|
|
for file in $1
|
|
|
|
do
|
2017-09-11 15:16:31 +00:00
|
|
|
dir_name=$(echo "$file" | sed 's%/[^/]*$%/%')
|
2016-07-19 18:10:57 +00:00
|
|
|
if [[ $dir_name == */* ]]; then
|
|
|
|
tmp_dir_name="tmp_"$dir_name
|
2017-09-11 15:16:31 +00:00
|
|
|
mkdir -p "../tmp_ffmpeg/$tmp_dir_name"
|
2016-07-19 18:10:57 +00:00
|
|
|
else
|
|
|
|
tmp_dir_name=$file
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$2" -eq 1 ]; then
|
2017-09-11 15:16:31 +00:00
|
|
|
cp "$file" "../tmp_ffmpeg/$tmp_dir_name"
|
2016-07-19 18:10:57 +00:00
|
|
|
else
|
2017-09-11 15:16:31 +00:00
|
|
|
cp "$file" "../tmp_ffmpeg/$tmp_dir_name" > /dev/null 2>&1
|
2016-07-19 18:10:57 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
where=$(pwd)
|
2016-07-19 18:10:57 +00:00
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
if ! generated_files=$(./get_free_ffmpeg_source_files.py "$1" "$2"); then
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-07-19 18:10:57 +00:00
|
|
|
# As the build system files does not contain the header files, cheat here
|
|
|
|
# and generate the header files names from source files. These that does not
|
|
|
|
# exist will be later skipped while copying.
|
|
|
|
generated_files_headers="${generated_files//.c/.h}"
|
|
|
|
generated_files_headers="$generated_files_headers ${generated_files//.c/_internal.h}"
|
|
|
|
if [ "$2" -ne "1" ]; then
|
|
|
|
generated_files_headers="$generated_files_headers ${generated_files//.S/.h}"
|
|
|
|
fi
|
|
|
|
generated_files_headers="$generated_files_headers ${generated_files//.asm/.h}"
|
|
|
|
|
|
|
|
header_files=" libavcodec/x86/inline_asm.h \
|
|
|
|
libavcodec/x86/mathops.h \
|
|
|
|
libavcodec/x86/vp56_arith.h \
|
2017-03-08 22:20:38 +00:00
|
|
|
libavcodec/aac.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/aacps.h \
|
|
|
|
libavcodec/aacpsdsp.h \
|
|
|
|
libavcodec/aacsbrdata.h \
|
|
|
|
libavcodec/aac_defines.h \
|
|
|
|
libavcodec/ac3.h \
|
|
|
|
libavcodec/ac3tab.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/avcodec.h \
|
|
|
|
libavcodec/blockdsp.h \
|
|
|
|
libavcodec/bytestream.h \
|
2017-03-08 19:05:53 +00:00
|
|
|
libavcodec/cbrt_data.h \
|
2017-03-08 22:20:38 +00:00
|
|
|
libavcodec/cbrt_tablegen.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/dct.h \
|
2017-03-08 19:05:53 +00:00
|
|
|
libavcodec/dct32.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/error_resilience.h \
|
|
|
|
libavcodec/fdctdsp.h \
|
|
|
|
libavcodec/fft.h \
|
|
|
|
libavcodec/fft-internal.h \
|
|
|
|
libavcodec/fft_table.h \
|
|
|
|
libavcodec/flac.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/flacdsp.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/frame_thread_encoder.h \
|
|
|
|
libavcodec/get_bits.h \
|
|
|
|
libavcodec/h263dsp.h \
|
|
|
|
libavcodec/h264chroma.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/hpeldsp.h \
|
2017-09-11 15:16:31 +00:00
|
|
|
libavcodec/hwaccel.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/idctdsp.h \
|
|
|
|
libavcodec/internal.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/kbdwin.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/mathops.h \
|
2017-06-12 19:12:01 +00:00
|
|
|
libavcodec/mdct15.c \
|
|
|
|
libavcodec/mdct15.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/me_cmp.h \
|
|
|
|
libavcodec/motion_est.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/mpeg12data.h \
|
|
|
|
libavcodec/mpegaudio.h \
|
|
|
|
libavcodec/mpegaudiodecheader.h \
|
|
|
|
libavcodec/mpegaudiodectab.h \
|
2017-03-08 19:05:53 +00:00
|
|
|
libavcodec/mpegaudiodsp.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/mpegaudio_tablegen.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/mpegpicture.h \
|
|
|
|
libavcodec/mpegutils.h \
|
|
|
|
libavcodec/mpegvideo.h \
|
|
|
|
libavcodec/mpegvideodsp.h \
|
|
|
|
libavcodec/mpegvideoencdsp.h \
|
|
|
|
libavcodec/options_table.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/opus_rc.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/pcm_tablegen.h \
|
|
|
|
libavcodec/pixblockdsp.h \
|
|
|
|
libavcodec/pixels.h \
|
|
|
|
libavcodec/put_bits.h \
|
|
|
|
libavcodec/qpeldsp.h \
|
|
|
|
libavcodec/ratecontrol.h \
|
|
|
|
libavcodec/rectangle.h \
|
|
|
|
libavcodec/rl.h \
|
|
|
|
libavcodec/rnd_avg.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/sbr.h \
|
|
|
|
libavcodec/sbrdsp.h \
|
|
|
|
libavcodec/sinewin.h \
|
|
|
|
libavcodec/sinewin_tablegen.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/thread.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/unary.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/version.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/videodsp.h \
|
|
|
|
libavcodec/vlc.h \
|
|
|
|
libavcodec/vorbisdsp.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/vp3data.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/vp3dsp.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/vp56.h \
|
|
|
|
libavcodec/vp56dsp.h \
|
|
|
|
libavcodec/vp8data.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/vp8dsp.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavformat/apetag.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavformat/audiointerleave.h \
|
|
|
|
libavformat/avformat.h \
|
|
|
|
libavformat/dv.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavformat/img2.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavformat/internal.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavformat/mov_chan.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavformat/pcm.h \
|
|
|
|
libavformat/rdt.h \
|
|
|
|
libavformat/rtp.h \
|
|
|
|
libavformat/rtpdec.h \
|
|
|
|
libavformat/spdif.h \
|
|
|
|
libavformat/srtp.h \
|
|
|
|
libavformat/options_table.h \
|
|
|
|
libavformat/version.h \
|
|
|
|
libavformat/w64.h \
|
|
|
|
libavutil/x86/asm.h \
|
|
|
|
libavutil/x86/bswap.h \
|
|
|
|
libavutil/x86/cpu.h \
|
|
|
|
libavutil/x86/emms.h
|
|
|
|
libavutil/x86/intreadwrite.h \
|
|
|
|
libavutil/x86/intmath.h
|
|
|
|
libavutil/x86/timer.h \
|
|
|
|
libavutil/atomic.h \
|
|
|
|
libavutil/atomic_gcc.h \
|
|
|
|
libavutil/attributes.h \
|
|
|
|
libavutil/audio_fifo.h \
|
|
|
|
libavutil/avassert.h \
|
|
|
|
libavutil/avutil.h \
|
|
|
|
libavutil/bswap.h \
|
|
|
|
libavutil/common.h \
|
|
|
|
libavutil/colorspace.h \
|
|
|
|
libavutil/cpu.h \
|
|
|
|
libavutil/cpu_internal.h \
|
|
|
|
libavutil/dynarray.h \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavutil/ffmath.h \
|
|
|
|
libavutil/fixed_dsp.h \
|
|
|
|
libavutil/float_dsp.h \
|
2017-09-11 15:16:31 +00:00
|
|
|
libavutil/imgutils.h \
|
|
|
|
libavutil/imgutils_internal.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavutil/internal.h \
|
|
|
|
libavutil/intfloat.h \
|
|
|
|
libavutil/intreadwrite.h \
|
|
|
|
libavutil/libm.h \
|
|
|
|
libavutil/lls.h \
|
|
|
|
libavutil/macros.h \
|
|
|
|
libavutil/pixfmt.h \
|
|
|
|
libavutil/qsort.h \
|
|
|
|
libavutil/replaygain.h \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavutil/softfloat.h \
|
|
|
|
libavutil/softfloat_tables.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavutil/thread.h \
|
|
|
|
libavutil/timer.h \
|
|
|
|
libavutil/timestamp.h \
|
|
|
|
libavutil/version.h \
|
|
|
|
libswresample/swresample.h \
|
|
|
|
libswresample/version.h \
|
2017-05-15 20:04:38 +00:00
|
|
|
compat/va_copy.h \
|
|
|
|
compat/atomics/gcc/stdatomic.h "
|
2016-07-19 18:10:57 +00:00
|
|
|
|
2017-08-25 20:59:08 +00:00
|
|
|
manual_files=" libavcodec/aarch64/fft_neon.S \
|
|
|
|
libavcodec/aarch64/h264pred_neon.S \
|
|
|
|
libavcodec/aarch64/hpeldsp_neon.S \
|
|
|
|
libavcodec/aarch64/mdct_neon.S \
|
|
|
|
libavcodec/aarch64/vorbisdsp_neon.S \
|
|
|
|
libavcodec/x86/hpeldsp_rnd_template.c \
|
2017-12-12 14:18:37 +00:00
|
|
|
libavcodec/x86/mdct15.asm \
|
|
|
|
libavcodec/x86/mdct15_init.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/x86/rnd_template.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/x86/videodsp.asm \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/x86/videodsp_init.c \
|
|
|
|
libavcodec/x86/vorbisdsp_init.c \
|
2017-12-12 14:18:37 +00:00
|
|
|
libavcodec/autorename_libavcodec_mdct15.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/bit_depth_template.c \
|
|
|
|
libavcodec/fft_template.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/flacdec.c \
|
|
|
|
libavcodec/flacdsp.c \
|
|
|
|
libavcodec/flacdsp_template.c \
|
|
|
|
libavcodec/flacdsp_lpc_template.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/h264pred_template.c \
|
|
|
|
libavcodec/hpel_template.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/hpeldsp.c \
|
2017-12-12 14:18:37 +00:00
|
|
|
libavcodec/mdct15.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/mdct_template.c \
|
|
|
|
libavcodec/pel_template.c \
|
|
|
|
libavcodec/utils.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/videodsp.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavcodec/videodsp_template.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavcodec/vorbisdsp.c \
|
|
|
|
libavcodec/vp3dsp.c \
|
|
|
|
libavcodec/vp8dsp.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavformat/options.c \
|
|
|
|
libavformat/pcm.c \
|
|
|
|
libavformat/utils.c \
|
2017-08-25 17:45:36 +00:00
|
|
|
libavutil/aarch64/asm.S \
|
|
|
|
libavutil/aarch64/bswap.h \
|
2017-08-25 20:59:08 +00:00
|
|
|
libavutil/aarch64/float_dsp_neon.S \
|
2017-08-25 17:45:36 +00:00
|
|
|
libavutil/aarch64/timer.h \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavutil/cpu.c \
|
2017-02-03 08:52:09 +00:00
|
|
|
libavutil/fixed_dsp.c \
|
|
|
|
libavutil/float_dsp.c \
|
2017-09-11 15:16:31 +00:00
|
|
|
libavutil/imgutils.c \
|
2016-07-19 18:10:57 +00:00
|
|
|
libavutil/x86/cpu.c \
|
|
|
|
libavutil/x86/float_dsp_init.c \
|
|
|
|
libavutil/x86/x86inc.asm \
|
|
|
|
libavutil/x86/x86util.asm "
|
|
|
|
|
2017-12-12 16:44:08 +00:00
|
|
|
mp3_files=" libavcodec/aarch64/aacpsdsp_init_aarch64.c \
|
2017-12-12 20:39:16 +00:00
|
|
|
libavcodec/aarch64/autorename_libavcodec_aarch64_aacpsdsp_neon.S \
|
2017-12-12 21:14:12 +00:00
|
|
|
libavcodec/aarch64/autorename_libavcodec_aarch64_sbrdsp_neon.S \
|
2017-12-12 16:44:08 +00:00
|
|
|
libavcodec/aarch64/mpegaudiodsp_init.c \
|
2017-08-24 21:03:09 +00:00
|
|
|
libavcodec/aarch64/mpegaudiodsp_neon.S \
|
2017-12-12 18:03:57 +00:00
|
|
|
libavcodec/aarch64/sbrdsp_init_aarch64.c \
|
2017-08-24 20:03:00 +00:00
|
|
|
libavcodec/aac_ac3_parser.c \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/aac_parser.c \
|
|
|
|
libavcodec/aacadtsdec.c \
|
|
|
|
libavcodec/aacps_float.c \
|
|
|
|
libavcodec/aacpsdsp_float.c \
|
|
|
|
libavcodec/aacsbr.c \
|
|
|
|
libavcodec/aactab.c \
|
|
|
|
libavcodec/ac3tab.c \
|
|
|
|
libavcodec/autorename_libavcodec_aacdec.c \
|
|
|
|
libavcodec/autorename_libavcodec_mpegaudiodsp.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavcodec/autorename_libavcodec_sbrdsp.c \
|
|
|
|
libavcodec/cbrt_data.c \
|
|
|
|
libavcodec/dct.c \
|
|
|
|
libavcodec/dct32_fixed.c \
|
|
|
|
libavcodec/dct32_float.c \
|
2017-03-08 19:05:53 +00:00
|
|
|
libavcodec/dct32_template.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavcodec/kbdwin.c \
|
|
|
|
libavcodec/mpegaudio.c \
|
|
|
|
libavcodec/mpegaudio_parser.c \
|
|
|
|
libavcodec/mpegaudiodec_fixed.c \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/mpegaudiodec_template.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavcodec/mpegaudiodecheader.c \
|
2017-03-08 17:11:02 +00:00
|
|
|
libavcodec/mpegaudiodsp.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavcodec/mpegaudiodsp_data.c \
|
|
|
|
libavcodec/mpegaudiodsp_fixed.c \
|
|
|
|
libavcodec/mpegaudiodsp_float.c \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/mpegaudiodsp_template.c \
|
2017-03-08 19:05:53 +00:00
|
|
|
libavcodec/sbrdsp.c \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/sbrdsp_template.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavcodec/sinewin.c \
|
|
|
|
libavcodec/sinewin_fixed.c \
|
2017-03-21 15:23:01 +00:00
|
|
|
libavcodec/x86/dct_init.c \
|
|
|
|
libavcodec/x86/dct32.asm \
|
|
|
|
libavcodec/x86/imdct36.asm \
|
|
|
|
libavcodec/x86/mpegaudiodsp.c \
|
|
|
|
libavcodec/x86/sbrdsp_init.c \
|
|
|
|
libavcodec/x86/sbrdsp.asm \
|
|
|
|
libavformat/aacdec.c \
|
2017-03-05 20:12:09 +00:00
|
|
|
libavformat/apetag.c \
|
|
|
|
libavformat/img2.c \
|
|
|
|
libavformat/mov.c \
|
|
|
|
libavformat/mov_chan.c \
|
|
|
|
libavformat/mp3dec.c "
|
|
|
|
|
2016-07-19 18:10:57 +00:00
|
|
|
other_files=" BUILD.gn \
|
|
|
|
Changelog \
|
|
|
|
COPYING.GPLv2 \
|
|
|
|
COPYING.GPLv3 \
|
|
|
|
COPYING.LGPLv2.1 \
|
|
|
|
COPYING.LGPLv3 \
|
|
|
|
CREDITS \
|
|
|
|
CREDITS.chromium \
|
|
|
|
ffmpeg_generated.gni \
|
|
|
|
ffmpeg_options.gni \
|
|
|
|
ffmpegsumo.ver \
|
|
|
|
INSTALL.md \
|
|
|
|
LICENSE.md \
|
|
|
|
MAINTAINERS \
|
|
|
|
OWNERS \
|
|
|
|
README.chromium \
|
|
|
|
README.md \
|
|
|
|
RELEASE \
|
|
|
|
xcode_hack.c "
|
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
cd "$1/third_party/ffmpeg" || exit 1
|
2016-07-19 18:10:57 +00:00
|
|
|
|
|
|
|
copy_files "$generated_files" 0
|
|
|
|
copy_files "$generated_files_headers" 0
|
|
|
|
copy_files "$manual_files" 1
|
|
|
|
copy_files "$other_files" 1
|
|
|
|
copy_files "$header_files" 1
|
2017-03-05 20:12:09 +00:00
|
|
|
copy_files "$mp3_files" 1
|
2016-07-19 18:10:57 +00:00
|
|
|
|
|
|
|
mkdir -p ../tmp_ffmpeg/tmp_chromium/config
|
|
|
|
cp -r chromium/config ../tmp_ffmpeg/tmp_chromium
|
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
cd ../tmp_ffmpeg || exit 1
|
|
|
|
|
|
|
|
while IFS= read -r -d '' tmp_directory
|
|
|
|
do
|
|
|
|
new_name=${tmp_directory//tmp_/}
|
|
|
|
mv "$tmp_directory" "$new_name"
|
|
|
|
done < <(find . -type d -name 'tmp_*' -print0)
|
2016-07-19 18:10:57 +00:00
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
cd "$where" || exit 1
|
2016-07-19 18:10:57 +00:00
|
|
|
|
2017-09-11 15:16:31 +00:00
|
|
|
rm -rf "$1/third_party/ffmpeg"
|
|
|
|
mv "$1/third_party/tmp_ffmpeg" "$1/third_party/ffmpeg"
|