Skip to content

Commit

Permalink
ffmpeg: vendor openh264 1.5.0
Browse files Browse the repository at this point in the history
This can be reversed when upstream ffmpeg supports openh264 1.6.0.

Closes #2946.

Closes #3070.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
  • Loading branch information
ilovezfs committed Jul 18, 2016
1 parent f186f10 commit 809fc88
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Formula/ffmpeg.rb
Expand Up @@ -77,10 +77,18 @@ class Ffmpeg < Formula
depends_on "libbs2b" => :optional
depends_on "rubberband" => :optional
depends_on "zimg" => :optional
depends_on "openh264" => :optional
depends_on "xz" => :optional
depends_on "libebur128" => :optional

depends_on "nasm" => :build if build.with? "openh264"

# Remove when ffmpeg has support for openh264 1.6.0
# See https://github.com/cisco/openh264/issues/2505
resource "openh264-1.5.0" do
url "https://github.com/cisco/openh264/archive/v1.5.0.tar.gz"
sha256 "98077bd5d113c183ce02b678733b0cada2cf36750370579534c4d70f0b6c27b5"
end

def install
args = %W[
--prefix=#{prefix}
Expand All @@ -95,6 +103,15 @@ def install
--host-ldflags=#{ENV.ldflags}
]

if build.with? "openh264"
resource("openh264-1.5.0").stage do
system "make", "install-shared", "PREFIX=#{libexec}/openh264-1.5.0"
chmod 0444, libexec/"openh264-1.5.0/lib/libopenh264.dylib"
end
ENV.prepend_path "PKG_CONFIG_PATH", libexec/"openh264-1.5.0/lib/pkgconfig"
args << "--enable-libopenh264"
end

args << "--enable-opencl" if MacOS.version > :lion

args << "--enable-libx264" if build.with? "x264"
Expand Down Expand Up @@ -129,7 +146,6 @@ def install
args << "--enable-librubberband" if build.with? "rubberband"
args << "--enable-libzimg" if build.with? "zimg"
args << "--disable-indev=qtkit" if build.without? "qtkit"
args << "--enable-libopenh264" if build.with? "openh264"
args << "--enable-libebur128" if build.with? "libebur128"

if build.with? "xz"
Expand Down

0 comments on commit 809fc88

Please sign in to comment.