aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorGuo Xiao2015-04-20 00:17:47 +0800
committerBrett Koonce2015-04-19 20:06:14 -0700
commit3488f53c281156eff4cea8620bd2f6c5d10ddee3 (patch)
tree8bba9c72110da9fe683735641be9c9364c5980e5 /Library
parent6efcce80ac73fc2c6fad1ae97f8af2c1dfa223c9 (diff)
downloadhomebrew-3488f53c281156eff4cea8620bd2f6c5d10ddee3.tar.bz2
gpac 0.5.2
Closes #38828. Signed-off-by: Brett Koonce <koonce@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gpac.rb163
1 files changed, 22 insertions, 141 deletions
diff --git a/Library/Formula/gpac.rb b/Library/Formula/gpac.rb
index 8314ac8b9..7b30ec7c8 100644
--- a/Library/Formula/gpac.rb
+++ b/Library/Formula/gpac.rb
@@ -1,5 +1,3 @@
-require 'formula'
-
# Installs a relatively minimalist version of the GPAC tools. The
# most commonly used tool in this package is the MP4Box metadata
# interleaver, which has relatively few dependencies.
@@ -9,164 +7,47 @@ require 'formula'
# that Brew installs
class Gpac < Formula
- homepage 'http://gpac.wp.mines-telecom.fr/'
+ homepage "http://gpac.wp.mines-telecom.fr/"
stable do
- url 'https://downloads.sourceforge.net/gpac/gpac-0.5.0.tar.gz'
- sha1 '48ba16272bfa153abb281ff8ed31b5dddf60cf20'
-
- # Fixes build against ffmpeg 2.x; backported from upstream SVN
- patch :DATA
+ url "https://github.com/gpac/gpac/archive/v0.5.2.tar.gz"
+ sha256 "14de020482fc0452240f368564baa95a71b729980e4f36d94dd75c43ac4d9d5c"
end
- head 'https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac'
+ head "https://github.com/gpac/gpac"
+ depends_on "openssl"
depends_on :x11 => :recommended
-
- depends_on 'pkg-config' => :build
- depends_on 'a52dec' => :optional
- depends_on 'jpeg' => :optional
- depends_on 'faad2' => :optional
- depends_on 'libogg' => :optional
- depends_on 'libvorbis' => :optional
- depends_on 'mad' => :optional
- depends_on 'sdl' => :optional
- depends_on 'theora' => :optional
- depends_on 'ffmpeg' => :optional
- depends_on 'openjpeg' => :optional
+ depends_on "pkg-config" => :build
+ depends_on "a52dec" => :optional
+ depends_on "jpeg" => :optional
+ depends_on "faad2" => :optional
+ depends_on "libogg" => :optional
+ depends_on "libvorbis" => :optional
+ depends_on "mad" => :optional
+ depends_on "sdl" => :optional
+ depends_on "theora" => :optional
+ depends_on "ffmpeg" => :optional
+ depends_on "openjpeg" => :optional
def install
- ENV.deparallelize
-
args = ["--disable-wx",
"--prefix=#{prefix}",
"--mandir=#{man}"]
- if build.with? 'x11'
+ if build.with? "x11"
# gpac build system is barely functional
args << "--extra-cflags=-I#{MacOS::X11.include}"
# Force detection of X libs on 64-bit kernel
args << "--extra-ldflags=-L#{MacOS::X11.lib}"
end
- chmod 0700, "configure"
system "./configure", *args
system "make"
- system "make install"
+ system "make", "install"
end
-end
-__END__
-diff --git a/modules/ffmpeg_in/ffmpeg_decode.c b/modules/ffmpeg_in/ffmpeg_decode.c
-index db7d65e..387966b 100644
---- a/modules/ffmpeg_in/ffmpeg_decode.c
-+++ b/modules/ffmpeg_in/ffmpeg_decode.c
-@@ -37,7 +37,11 @@
- #undef USE_AVCODEC2
- #endif
-
--
-+#if (LIBAVCODEC_VERSION_MAJOR >= 55)
-+#define USE_AVCTX3
-+#elif (LIBAVCODEC_VERSION_MAJOR >= 54) && (LIBAVCODEC_VERSION_MINOR >= 35)
-+#define USE_AVCTX3
-+#endif
-
- /**
- * Allocates data for FFMPEG decoding
-@@ -169,8 +173,12 @@ static GF_Err FFDEC_AttachStream(GF_BaseDecoder *plug, GF_ESD *esd)
- frame = &ffd->base_frame;
- }
- if (!(*ctx)){
-- *ctx = avcodec_alloc_context();
-- }
-+#ifdef USE_AVCTX3
-+ *ctx = avcodec_alloc_context3(NULL);
-+#else
-+ *ctx = avcodec_alloc_context();
-+#endif
-+ }
-
- /*private FFMPEG DSI*/
- if (ffd->oti == GPAC_OTI_MEDIA_FFMPEG) {
-@@ -317,7 +325,12 @@ static GF_Err FFDEC_AttachStream(GF_BaseDecoder *plug, GF_ESD *esd)
- (*ctx)->pix_fmt = ffd->raw_pix_fmt;
- if ((*ctx)->extradata && strstr((*ctx)->extradata, "BottomUp")) ffd->flipped = 1;
- } else {
-- if (avcodec_open((*ctx), (*codec) )<0) return GF_NON_COMPLIANT_BITSTREAM;
-+#ifdef USE_AVCTX3
-+ if (! (*codec) || (avcodec_open2(ctx, *codec, NULL)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-+#else
-+ if (! (*codec) || (avcodec_open(ctx, *codec)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-+#endif
-+
- }
-
- /*setup audio streams*/
-@@ -611,10 +624,11 @@ static GF_Err FFDEC_ProcessData(GF_MediaDecoder *plug,
- if (ffd->frame_start>inBufferLength) ffd->frame_start = 0;
-
- redecode:
-- gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- #ifdef USE_AVCODEC2
-+ gotpic = 0;
- len = avcodec_decode_audio3(ctx, (short *)ffd->audio_buf, &gotpic, &pkt);
- #else
-+ gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- len = avcodec_decode_audio2(ctx, (short *)ffd->audio_buf, &gotpic, inBuffer + ffd->frame_start, inBufferLength - ffd->frame_start);
- #endif
- if (len<0) { ffd->frame_start = 0; return GF_NON_COMPLIANT_BITSTREAM; }
-@@ -749,7 +763,12 @@ redecode:
- here this means the DSI was broken, so no big deal*/
- avcodec_close(ctx);
- *codec = avcodec_find_decoder(CODEC_ID_H263);
-+#ifdef USE_AVCTX3
-+ if (! (*codec) || (avcodec_open2(ctx, *codec, NULL)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-+#else
- if (! (*codec) || (avcodec_open(ctx, *codec)<0)) return GF_NON_COMPLIANT_BITSTREAM;
-+#endif
-+
- #if USE_AVCODEC2
- if (avcodec_decode_video2(ctx, frame, &gotpic, &pkt) < 0) {
- #else
-@@ -759,7 +778,11 @@ redecode:
- avcodec_close(ctx);
- *codec = avcodec_find_decoder(old_codec);
- assert(*codec);
-+#ifdef USE_AVCTX3
-+ avcodec_open2(ctx, *codec, NULL);
-+#else
- avcodec_open(ctx, *codec);
-+#endif
- return GF_NON_COMPLIANT_BITSTREAM;
- }
- }
-diff --git a/modules/ffmpeg_in/ffmpeg_demux.c b/modules/ffmpeg_in/ffmpeg_demux.c
-index 0f8ee50..8bb7948 100644
---- a/modules/ffmpeg_in/ffmpeg_demux.c
-+++ b/modules/ffmpeg_in/ffmpeg_demux.c
-@@ -52,6 +52,11 @@
- #define AVERROR_NOFMT AVERROR(EINVAL)
- #endif /* AVERROR_NOFMT */
-
-+#if (LIBAVFORMAT_VERSION_MAJOR >= 54) && (LIBAVFORMAT_VERSION_MINOR >= 20)
-+#define av_find_stream_info(__c) avformat_find_stream_info(__c, NULL)
-+#define FF_API_FORMAT_PARAMETERS 1
-+#endif
-+
- static u32 FFDemux_Run(void *par)
- {
- AVPacket pkt;
-diff --git a/modules/ffmpeg_in/ffmpeg_in.h b/modules/ffmpeg_in/ffmpeg_in.h
-index 4b2bdf5..2cf8304 100644
---- a/modules/ffmpeg_in/ffmpeg_in.h
-+++ b/modules/ffmpeg_in/ffmpeg_in.h
-@@ -117,7 +117,7 @@ typedef struct
-
- /*for audio packed frames*/
- u32 frame_start;
-- char audio_buf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
-+ char audio_buf[19200];
- Bool check_h264_isma;
-
- u32 base_ES_ID;
+ test do
+ system "MP4Box", "-h"
+ end
+end