From 70379349f15325a15aa2937731c93793651a397b Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Sun, 16 Dec 2018 17:32:37 +0000 Subject: [PATCH] Add ffmpeg n3.4.4 dependency Signed-off-by: Yong Tang --- WORKSPACE | 11 +++++++ third_party/ffmpeg.BUILD | 67 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 third_party/ffmpeg.BUILD diff --git a/WORKSPACE b/WORKSPACE index 3b2e32cb2c..bfc19b13d1 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -61,3 +61,14 @@ http_archive( strip_prefix = "aws-sdk-cpp-1.3.15", build_file = "//third_party:aws.BUILD", ) + +http_archive( + name = "ffmpeg", + urls = [ + "https://mirror.bazel.build/github.com/FFmpeg/FFmpeg/archive/n3.4.4.tar.gz", + "https://github.com/FFmpeg/FFmpeg/archive/n3.4.4.tar.gz", + ], + sha256 = "bbccc87cd031498728bcc2dba5596a47e6fd92b2cec060a71feef65617a261fe", + strip_prefix = "FFmpeg-n3.4.4", + build_file = "//third_party:ffmpeg.BUILD", +) diff --git a/third_party/ffmpeg.BUILD b/third_party/ffmpeg.BUILD new file mode 100644 index 0000000000..d9b94f1e18 --- /dev/null +++ b/third_party/ffmpeg.BUILD @@ -0,0 +1,67 @@ +# Description: +# FFmpeg + +licenses(["notice"]) # LGPL v2.1+ license + +exports_files(["LICENSE.md"]) + +cc_library( + name = "ffmpeg", + srcs = [ + ], + hdrs = [ + "libavformat/avformat.h", + "libavformat/avio.h", + "libavformat/version.h", + "libavcodec/version.h", + "libavcodec/avcodec.h", + "libavutil/avconfig.h", + "libavutil/samplefmt.h", + "libavutil/avutil.h", + "libavutil/common.h", + "libavutil/attributes.h", + "libavutil/macros.h", + "libavutil/version.h", + "libavutil/mem.h", + "libavutil/error.h", + "libavutil/rational.h", + "libavutil/mathematics.h", + "libavutil/intfloat.h", + "libavutil/log.h", + "libavutil/pixfmt.h", + "libavutil/buffer.h", + "libavutil/cpu.h", + "libavutil/channel_layout.h", + "libavutil/dict.h", + "libavutil/frame.h", + "libavutil/imgutils.h", + "libavutil/pixdesc.h", + "libswscale/swscale.h", + "libswscale/version.h", + ], + copts = [], + defines = [], + includes = [], + linkopts = [ + "-l:libavformat.so.57", + "-l:libavcodec.so.57", + "-l:libavutil.so.55", + "-l:libswscale.so.4", + ], + visibility = ["//visibility:public"], + deps = [], +) + +genrule( + name = "libavutil_avconfig_h", + outs = ["libavutil/avconfig.h"], + cmd = "\n".join([ + "cat <<'EOF' >$@", + "#ifndef AVUTIL_AVCONFIG_H", + "#define AVUTIL_AVCONFIG_H", + "#define AV_HAVE_BIGENDIAN 0", + "#define AV_HAVE_FAST_UNALIGNED 1", + "#endif /* AVUTIL_AVCONFIG_H */", + "EOF", + ]), +)