summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-php/ffmpeg-php/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-php/ffmpeg-php/files')
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch74
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-avutil50.patch31
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffincludes.patch115
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg.patch350
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg1.patch30
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-libav10.patch44
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-log.patch12
-rw-r--r--dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-php5-4.patch29
8 files changed, 685 insertions, 0 deletions
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch
new file mode 100644
index 000000000000..b5f753d2e966
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-api.patch
@@ -0,0 +1,74 @@
+diff --git a/ffmpeg_movie.c b/ffmpeg_movie.c
+index 0ce2c0f..6b77eb5 100644
+--- a/ffmpeg_movie.c
++++ b/ffmpeg_movie.c
+@@ -39,6 +39,7 @@
+ #include "ext/standard/info.h"
+
+ #include <libavcodec/avcodec.h>
++#include <libavcodec/version.h>
+ #include <libavformat/avformat.h>
+ #include <libavutil/pixfmt.h>
+ #include <libavutil/pixdesc.h>
+@@ -252,17 +257,17 @@ static int _php_open_movie_file(ff_movie_context *ffmovie_ctx,
+ char* filename)
+ {
+ if (ffmovie_ctx->fmt_ctx) {
+- av_close_input_file(ffmovie_ctx->fmt_ctx);
++ avformat_close_input(&ffmovie_ctx->fmt_ctx);
+ ffmovie_ctx->fmt_ctx = NULL;
+ }
+
+ /* open the file with generic libav function */
+ if (avformat_open_input(&ffmovie_ctx->fmt_ctx, filename, NULL, NULL) < 0) {
+ return 1;
+ }
+
+ /* decode the first frames to get the stream parameters. */
+- av_find_stream_info(ffmovie_ctx->fmt_ctx);
++ avformat_find_stream_info(ffmovie_ctx->fmt_ctx, NULL);
+
+ return 0;
+ }
+@@ -416,7 +421,7 @@ static void _php_free_ffmpeg_movie(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+ }
+ }
+
+- av_close_input_file(ffmovie_ctx->fmt_ctx);
++ avformat_close_input(&ffmovie_ctx->fmt_ctx);
+
+ efree(ffmovie_ctx);
+ }
+@@ -440,7 +445,7 @@ static void _php_free_ffmpeg_pmovie(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+ }
+ }
+
+- av_close_input_file(ffmovie_ctx->fmt_ctx);
++ avformat_close_input(&ffmovie_ctx->fmt_ctx);
+
+ free(ffmovie_ctx);
+ }
+@@ -512,7 +517,7 @@ static AVCodecContext* _php_get_decoder_context(ff_movie_context *ffmovie_ctx,
+ GET_CODEC_PTR(ffmovie_ctx->fmt_ctx->streams[stream_index]->codec);
+
+ /* open the decoder */
+- if (avcodec_open(ffmovie_ctx->codec_ctx[stream_index], decoder) < 0) {
++ if (avcodec_open2(ffmovie_ctx->codec_ctx[stream_index], decoder, NULL) < 0) {
+ zend_error(E_WARNING, "Could not open codec for %s", _php_get_filename(ffmovie_ctx));
+ return NULL;
+ }
+@@ -966,12 +967,14 @@ static const char* _php_get_codec_name(ff_movie_context *ffmovie_ctx, int type)
+ /* Copied from libavcodec/utils.c::avcodec_string */
+ if (p) {
+ codec_name = p->name;
++#ifdef FF_API_SUB_ID
+ if (decoder_ctx->codec_id == CODEC_ID_MP3) {
+ if (decoder_ctx->sub_id == 2)
+ codec_name = "mp2";
+ else if (decoder_ctx->sub_id == 1)
+ codec_name = "mp1";
+ }
++#endif
+ } else if (decoder_ctx->codec_id == CODEC_ID_MPEG2TS) {
+ /* fake mpeg2 transport stream codec (currently not registered) */
+ codec_name = "mpeg2ts";
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-avutil50.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-avutil50.patch
new file mode 100644
index 000000000000..070b5275d4d9
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-avutil50.patch
@@ -0,0 +1,31 @@
+Index: ffmpeg-php-0.6.0/ffmpeg_frame.c
+===================================================================
+--- ffmpeg-php-0.6.0.orig/ffmpeg_frame.c
++++ ffmpeg-php-0.6.0/ffmpeg_frame.c
+@@ -333,7 +333,7 @@ FFMPEG_PHP_METHOD(ffmpeg_frame, toGDImag
+
+ GET_FRAME_RESOURCE(getThis(), ff_frame);
+
+- _php_convert_frame(ff_frame, PIX_FMT_RGBA32);
++ _php_convert_frame(ff_frame, PIX_FMT_RGB32);
+
+ return_value->value.lval = _php_get_gd_image(ff_frame->width,
+ ff_frame->height);
+@@ -418,7 +418,7 @@ FFMPEG_PHP_METHOD(ffmpeg_frame, ffmpeg_f
+
+ /* create a an av_frame and allocate space for it */
+ frame = avcodec_alloc_frame();
+- avpicture_alloc((AVPicture*)frame, PIX_FMT_RGBA32, width, height);
++ avpicture_alloc((AVPicture*)frame, PIX_FMT_RGB32, width, height);
+
+ /* copy the gd image to the av_frame */
+ _php_gd_image_to_avframe(gd_img, frame, width, height);
+@@ -429,7 +429,7 @@ FFMPEG_PHP_METHOD(ffmpeg_frame, ffmpeg_f
+ /* set the ffpmeg_frame's properties */
+ ff_frame->width = width;
+ ff_frame->height = height;
+- ff_frame->pixel_format = PIX_FMT_RGBA32;
++ ff_frame->pixel_format = PIX_FMT_RGB32;
+ break;
+ default:
+ zend_error(E_ERROR, "Invalid argument\n");
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffincludes.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffincludes.patch
new file mode 100644
index 000000000000..5b7873ece51b
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffincludes.patch
@@ -0,0 +1,115 @@
+Incldue properly FFmpeg headers.
+https://bugs.gentoo.org/show_bug.cgi?id=461438
+
+Index: php5.3/config.m4
+===================================================================
+--- php5.3.orig/config.m4
++++ php5.3/config.m4
+@@ -31,15 +31,8 @@ if test "$PHP_FFMPEG" != "no"; then
+ FFMPEG_INC_FOUND=$i/include
+ break
+ elif test -f $i/include/libavcodec/avcodec.h; then
+- dnl ffmpeg svn revision 12194 and newer put each header in its own dir
+- dnl so we have to include them all.
+- PHP_ADD_INCLUDE($i/include/libavcodec/)
+- PHP_ADD_INCLUDE($i/include/libavformat/)
+- PHP_ADD_INCLUDE($i/include/libavutil/)
+- PHP_ADD_INCLUDE($i/include/libswscale/)
+- PHP_ADD_INCLUDE($i/include/libavfilter/)
+- PHP_ADD_INCLUDE($i/include/libavdevice/)
+- FFMPEG_INC_FOUND=$i/include/libavcodec
++ PHP_ADD_INCLUDE($i/include)
++ FFMPEG_INC_FOUND=$i/include
+ break
+ fi
+ done
+Index: php5.3/ffmpeg-php.c
+===================================================================
+--- php5.3.orig/ffmpeg-php.c
++++ php5.3/ffmpeg-php.c
+@@ -39,11 +39,11 @@
+
+ #include "php.h"
+
+-#include <avcodec.h>
+-#include <avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavformat/avformat.h>
+
+ #if HAVE_SWSCALER
+-#include <swscale.h>
++#include <libswscale/swscale.h>
+ #endif
+
+ #include "php_ini.h"
+Index: php5.3/ffmpeg_errorhandler.c
+===================================================================
+--- php5.3.orig/ffmpeg_errorhandler.c
++++ php5.3/ffmpeg_errorhandler.c
+@@ -34,7 +34,7 @@
+ */
+
+ #include "php.h"
+-#include <avcodec.h>
++#include <libavcodec/avcodec.h>
+
+ /* {{{ ffmpeg_errorhandler()
+ */
+Index: php5.3/ffmpeg_frame.h
+===================================================================
+--- php5.3.orig/ffmpeg_frame.h
++++ php5.3/ffmpeg_frame.h
+@@ -38,8 +38,8 @@
+
+ #include "php_version.h"
+
+-#include <avcodec.h>
+-#include <avformat.h>
++#include <libavcodec/avcodec.h>
++#include <libavformat/avformat.h>
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+Index: php5.3/ffmpeg_movie.c
+===================================================================
+--- php5.3.orig/ffmpeg_movie.c
++++ php5.3/ffmpeg_movie.c
+@@ -34,9 +34,9 @@
+ #include "php_globals.h"
+ #include "ext/standard/info.h"
+
+-#include <avcodec.h>
+-#include <avformat.h>
+-#include <pixdesc.h>
++#include <libavcodec/avcodec.h>
++#include <libavformat/avformat.h>
++#include <libavutil/pixdesc.h>
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+Index: php5.3/ffmpeg_tools.c
+===================================================================
+--- php5.3.orig/ffmpeg_tools.c
++++ php5.3/ffmpeg_tools.c
+@@ -42,7 +42,7 @@
+ #include "ffmpeg_tools.h"
+
+ #ifdef HAVE_SWSCALER
+-#include <swscale.h>
++#include <libswscale/swscale.h>
+ #endif
+
+ /* {{{ ffmpeg_img_convert()
+Index: php5.3/ffmpeg_tools.h
+===================================================================
+--- php5.3.orig/ffmpeg_tools.h
++++ php5.3/ffmpeg_tools.h
+@@ -36,7 +36,7 @@
+ #ifndef FFMPEG_TOOLS_H
+ #define FFMPEG_TOOLS_H
+
+-#include <avcodec.h>
++#include <libavcodec/avcodec.h>
+
+ int ffmpeg_img_convert(
+ AVPicture *dst, int dst_pix_fmt,
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg.patch
new file mode 100644
index 000000000000..9e8c864afcf5
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg.patch
@@ -0,0 +1,350 @@
+Index: work/php5.3/ffmpeg_movie.c
+===================================================================
+--- work.orig/php5.3/ffmpeg_movie.c
++++ work/php5.3/ffmpeg_movie.c
+@@ -36,6 +36,7 @@
+
+ #include <avcodec.h>
+ #include <avformat.h>
++#include <pixdesc.h>
+
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+@@ -67,6 +68,9 @@
+ #define GET_CODEC_FIELD(codec, field) codec.field
+ #define GET_CODEC_PTR(codec) &codec
+ #endif
++#ifndef MAX_STREAMS
++#define MAX_STREAMS 20
++#endif
+
+ typedef struct {
+ AVFormatContext *fmt_ctx;
+@@ -149,7 +153,7 @@ static int _php_get_stream_index(AVForma
+ */
+ static AVStream *_php_get_video_stream(AVFormatContext *fmt_ctx)
+ {
+- int i = _php_get_stream_index(fmt_ctx, CODEC_TYPE_VIDEO);
++ int i = _php_get_stream_index(fmt_ctx, AVMEDIA_TYPE_VIDEO);
+
+ return i < 0 ? NULL : fmt_ctx->streams[i];
+ }
+@@ -162,7 +166,7 @@ static AVStream *_php_get_video_stream(A
+ */
+ static AVStream *_php_get_audio_stream(AVFormatContext *fmt_ctx)
+ {
+- int i = _php_get_stream_index(fmt_ctx, CODEC_TYPE_AUDIO);
++ int i = _php_get_stream_index(fmt_ctx, AVMEDIA_TYPE_AUDIO);
+
+ return i < 0 ? NULL : fmt_ctx->streams[i];
+ }
+@@ -481,7 +485,7 @@ static AVCodecContext* _php_get_decoder_
+ stream_index = _php_get_stream_index(ffmovie_ctx->fmt_ctx, stream_type);
+ if (stream_index < 0) {
+ // FIXME: factor out the conditional.
+- if (stream_type == CODEC_TYPE_VIDEO) {
++ if (stream_type == AVMEDIA_TYPE_VIDEO) {
+ zend_error(E_WARNING, "Can't find video stream in %s",
+ _php_get_filename(ffmovie_ctx));
+ return NULL;
+@@ -519,17 +523,26 @@ static AVCodecContext* _php_get_decoder_
+ }
+ /* }}} */
+
++static const char* get_metadata(AVDictionary *metadata, const char* val){
++ AVDictionaryEntry *ade;
++ ade = av_dict_get(metadata, val, NULL, 0 );
++ if(ade == NULL) return "";
++ return ade->value;
++}
++
+
+ /* {{{ proto string getComment()
+ */
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getComment)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
++
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "COMMENT");
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->comment,
+- strlen(ffmovie_ctx->fmt_ctx->comment), 1);
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -540,11 +553,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getComme
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getTitle)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->title,
+- strlen(ffmovie_ctx->fmt_ctx->title), 1);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "TITLE");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -555,11 +569,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getTitle
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getAuthor)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->author,
+- strlen(ffmovie_ctx->fmt_ctx->author), 1);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "ARTIST");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -569,11 +584,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAutho
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getCopyright)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->copyright,
+- strlen(ffmovie_ctx->fmt_ctx->copyright), 1);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "COPYRIGHT");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -584,11 +600,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getCopyr
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getAlbum)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->album,
+- strlen(ffmovie_ctx->fmt_ctx->album), 1);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "ALBUM");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -598,11 +615,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAlbum
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getGenre)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_STRINGL(ffmovie_ctx->fmt_ctx->genre,
+- strlen(ffmovie_ctx->fmt_ctx->genre), 1);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "GENRE");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -613,10 +631,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getGenre
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getTrackNumber)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_LONG(ffmovie_ctx->fmt_ctx->track);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "TRACK");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -626,10 +646,12 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getTrack
+ FFMPEG_PHP_METHOD(ffmpeg_movie, getYear)
+ {
+ ff_movie_context *ffmovie_ctx;
++ const char* val;
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- RETURN_LONG(ffmovie_ctx->fmt_ctx->year);
++ val = get_metadata(ffmovie_ctx->fmt_ctx->metadata, "DATE");
++ RETURN_STRINGL(val, strlen(val), 1);
+ }
+ /* }}} */
+
+@@ -675,7 +697,7 @@ static float _php_get_framerate(ff_movie
+ }
+
+ #if LIBAVCODEC_BUILD > 4753
+- if (GET_CODEC_FIELD(st->codec, codec_type) == CODEC_TYPE_VIDEO){
++ if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
+ if (st->r_frame_rate.den && st->r_frame_rate.num) {
+ rate = av_q2d(st->r_frame_rate);
+ } else {
+@@ -807,7 +829,7 @@ static long _php_get_framenumber(ff_movi
+ {
+ AVCodecContext *decoder_ctx = NULL;
+
+- decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+ if (!decoder_ctx) {
+ return 0;
+ }
+@@ -847,7 +869,7 @@ static int _php_get_pixelformat(ff_movie
+ {
+ AVCodecContext *decoder_ctx;
+
+- decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+
+ return decoder_ctx ? decoder_ctx->pix_fmt : 0;
+ }
+@@ -865,7 +887,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getPixel
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+ pix_fmt = _php_get_pixelformat(ffmovie_ctx);
+- fmt = avcodec_get_pix_fmt_name(pix_fmt);
++ fmt = av_get_pix_fmt_name(pix_fmt);
+
+ if (fmt) {
+ /* cast const to non-const to keep compiler from complaining,
+@@ -960,7 +982,7 @@ static const char* _php_get_codec_name(f
+ codec_name = decoder_ctx->codec_name;
+ } else {
+ /* output avi tags */
+- if (decoder_ctx->codec_type == CODEC_TYPE_VIDEO) {
++ if (decoder_ctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ snprintf(buf1, sizeof(buf1), "%c%c%c%c",
+ decoder_ctx->codec_tag & 0xff,
+ (decoder_ctx->codec_tag >> 8) & 0xff,
+@@ -986,7 +1008,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getVideo
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- codec_name = (char*)_php_get_codec_name(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ codec_name = (char*)_php_get_codec_name(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+
+ if (codec_name) {
+ RETURN_STRINGL(codec_name, strlen(codec_name), 1);
+@@ -1006,7 +1028,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAudio
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- codec_name = (char*)_php_get_codec_name(ffmovie_ctx, CODEC_TYPE_AUDIO);
++ codec_name = (char*)_php_get_codec_name(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+
+ if (codec_name) {
+ RETURN_STRINGL(codec_name, strlen(codec_name), 1);
+@@ -1026,7 +1048,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getVideo
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, CODEC_TYPE_VIDEO);
++ stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, AVMEDIA_TYPE_VIDEO);
+
+ if( stream_id == -1 )
+ {
+@@ -1048,7 +1070,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAudio
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, CODEC_TYPE_AUDIO);
++ stream_id= _php_get_stream_index(ffmovie_ctx->fmt_ctx, AVMEDIA_TYPE_AUDIO);
+
+ if( stream_id == -1 )
+ {
+@@ -1086,7 +1108,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAudio
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- channels = _php_get_codec_channels(ffmovie_ctx, CODEC_TYPE_AUDIO);
++ channels = _php_get_codec_channels(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+
+ if (channels) {
+ RETURN_LONG(channels);
+@@ -1122,7 +1144,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAudio
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- sample_rate = _php_get_codec_sample_rate(ffmovie_ctx, CODEC_TYPE_AUDIO);
++ sample_rate = _php_get_codec_sample_rate(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+
+ if (sample_rate) {
+ RETURN_LONG(sample_rate);
+@@ -1158,7 +1180,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getAudio
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, CODEC_TYPE_AUDIO);
++ bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, AVMEDIA_TYPE_AUDIO);
+
+ if (bit_rate) {
+ RETURN_LONG(bit_rate);
+@@ -1178,7 +1200,7 @@ FFMPEG_PHP_METHOD(ffmpeg_movie, getVideo
+
+ GET_MOVIE_RESOURCE(ffmovie_ctx);
+
+- bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ bit_rate = _php_get_codec_bit_rate(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+
+ if (bit_rate) {
+ RETURN_LONG(bit_rate);
+@@ -1201,7 +1223,7 @@ static AVFrame* _php_read_av_frame(ff_mo
+ int got_frame;
+
+ video_stream = _php_get_stream_index(ffmovie_ctx->fmt_ctx,
+- CODEC_TYPE_VIDEO);
++ AVMEDIA_TYPE_VIDEO);
+ if (video_stream < 0) {
+ return NULL;
+ }
+@@ -1212,11 +1234,10 @@ static AVFrame* _php_read_av_frame(ff_mo
+ while (av_read_frame(ffmovie_ctx->fmt_ctx, &packet) >= 0) {
+ if (packet.stream_index == video_stream) {
+
+- avcodec_decode_video(decoder_ctx, frame, &got_frame,
+- packet.data, packet.size);
++ avcodec_decode_video2(decoder_ctx, frame, &got_frame, &packet);
+
+ if (got_frame) {
+- *is_keyframe = (packet.flags & PKT_FLAG_KEY);
++ *is_keyframe = (packet.flags & AV_PKT_FLAG_KEY);
+ *pts = packet.pts;
+ av_free_packet(&packet);
+ return frame;
+@@ -1243,7 +1264,7 @@ static AVFrame* _php_get_av_frame(ff_mov
+ AVCodecContext *decoder_ctx = NULL;
+ AVFrame *frame = NULL;
+
+- decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+ if (decoder_ctx == NULL) {
+ return NULL;
+ }
+@@ -1279,9 +1300,7 @@ static AVFrame* _php_get_av_frame(ff_mov
+ wanted_frame != GETFRAME_NEXTFRAME &&
+ wanted_frame - ffmovie_ctx->frame_number >
+ decoder_ctx->gop_size + 1) {
+- decoder_ctx->hurry_up = 1;
+- } else {
+- decoder_ctx->hurry_up = 0;
++ decoder_ctx->skip_frame = AVDISCARD_BIDIR;
+ }
+ ffmovie_ctx->frame_number++;
+
+@@ -1440,7 +1459,7 @@ static double _php_get_sample_aspect_rat
+ AVCodecContext *decoder_ctx;
+
+
+- decoder_ctx = _php_get_decoder_context(ffmovie_ctx, CODEC_TYPE_VIDEO);
++ decoder_ctx = _php_get_decoder_context(ffmovie_ctx, AVMEDIA_TYPE_VIDEO);
+ if (!decoder_ctx) {
+ return -1;
+ }
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg1.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg1.patch
new file mode 100644
index 000000000000..a66d92b04f51
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg1.patch
@@ -0,0 +1,30 @@
+Fix runtime with ffmpeg-1.
+https://bugs.gentoo.org/show_bug.cgi?id=461438
+
+Index: php5.3/ffmpeg-php.c
+===================================================================
+--- php5.3.orig/ffmpeg-php.c
++++ php5.3/ffmpeg-php.c
+@@ -90,9 +90,6 @@ PHP_INI_END()
+ */
+ PHP_MINIT_FUNCTION(ffmpeg)
+ {
+- /* must be called before using avcodec libraries. */
+- avcodec_init();
+-
+ /* register all codecs */
+ av_register_all();
+
+Index: php5.3/ffmpeg_movie.c
+===================================================================
+--- php5.3.orig/ffmpeg_movie.c
++++ php5.3/ffmpeg_movie.c
+@@ -259,7 +259,7 @@ static int _php_open_movie_file(ff_movie
+ }
+
+ /* open the file with generic libav function */
+- if (av_open_input_file(&ffmovie_ctx->fmt_ctx, filename, NULL, 0, NULL) < 0) {
++ if (avformat_open_input(&ffmovie_ctx->fmt_ctx, filename, NULL, NULL) < 0) {
+ return 1;
+ }
+
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-libav10.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-libav10.patch
new file mode 100644
index 000000000000..e62ec93d9146
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-libav10.patch
@@ -0,0 +1,44 @@
+diff -aurN a/ffmpeg_movie.c b/ffmpeg_movie.c
+--- a/ffmpeg_movie.c 2015-06-22 19:46:01.220498329 -0400
++++ b/ffmpeg_movie.c 2015-06-22 20:44:26.802671398 -0400
+@@ -697,7 +697,16 @@
+ return rate;
+ }
+
+-#if LIBAVCODEC_BUILD > 4753
++#if LIBAVCODEC_BUILD > 3604480 /* libav-10 */
++ if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
++ if (st->avg_frame_rate.den && st->avg_frame_rate.num) {
++ rate = av_q2d(st->avg_frame_rate);
++ } else {
++ rate = 1 / av_q2d(GET_CODEC_FIELD(st->codec, time_base));
++ }
++ }
++ return (float)rate;
++#elif LIBAVCODEC_BUILD > 4753
+ if (GET_CODEC_FIELD(st->codec, codec_type) == AVMEDIA_TYPE_VIDEO){
+ if (st->r_frame_rate.den && st->r_frame_rate.num) {
+ rate = av_q2d(st->r_frame_rate);
+@@ -980,14 +980,22 @@
+ if (p) {
+ codec_name = p->name;
+ #ifdef FF_API_SUB_ID
++#if LIBAVCODEC_BUILD > 3604480 /* libav-10 */
++ if (decoder_ctx->codec_id == AV_CODEC_ID_MP3) {
++#else
+ if (decoder_ctx->codec_id == CODEC_ID_MP3) {
++#endif
+ if (decoder_ctx->sub_id == 2)
+ codec_name = "mp2";
+ else if (decoder_ctx->sub_id == 1)
+ codec_name = "mp1";
+ }
+ #endif
++#if LIBAVCODEC_BUILD > 3604480 /* libav-10 */
++ } else if (decoder_ctx->codec_id == AV_CODEC_ID_MPEG2TS) {
++#else
+ } else if (decoder_ctx->codec_id == CODEC_ID_MPEG2TS) {
++#endif
+ /* fake mpeg2 transport stream codec (currently not registered) */
+ codec_name = "mpeg2ts";
+ } else if (decoder_ctx->codec_name[0] != '\0') {
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-log.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-log.patch
new file mode 100644
index 000000000000..3b5bb88322e9
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-log.patch
@@ -0,0 +1,12 @@
+Index: work/php5.3/ffmpeg-php.c
+===================================================================
+--- work.orig/php5.3/ffmpeg-php.c
++++ work/php5.3/ffmpeg-php.c
+@@ -101,6 +101,7 @@ PHP_MINIT_FUNCTION(ffmpeg)
+ if (INI_BOOL("ffmpeg.show_warnings")) {
+ av_log_set_callback(ffmpeg_errorhandler);
+ }
++ else av_log_set_level(AV_LOG_QUIET);
+
+ register_ffmpeg_movie_class(module_number);
+ register_ffmpeg_frame_class(module_number);
diff --git a/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-php5-4.patch b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-php5-4.patch
new file mode 100644
index 000000000000..cc33682cac1e
--- /dev/null
+++ b/dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-php5-4.patch
@@ -0,0 +1,29 @@
+--- ffmpeg-php-0.6.0.orig/ffmpeg_movie.c.bak 2013-02-24 16:44:31.162791000 +0200
++++ ffmpeg-php-0.6.0/ffmpeg_movie.c 2013-02-24 16:45:20.632791000 +0200
+@@ -308,7 +308,7 @@
+ }
+
+ if (persistent) {
+- list_entry *le;
++ zend_rsrc_list_entry *le;
+ /* resolve the fully-qualified path name to use as the hash key */
+ fullpath = expand_filepath(filename, NULL TSRMLS_CC);
+
+@@ -343,7 +343,7 @@
+ }
+
+ } else { /* no existing persistant movie, create one */
+- list_entry new_le;
++ zend_rsrc_list_entry new_le;
+ ffmovie_ctx = _php_alloc_ffmovie_ctx(1);
+
+ if (_php_open_movie_file(ffmovie_ctx, filename)) {
+@@ -357,7 +357,7 @@
+ new_le.ptr = ffmovie_ctx;
+
+ if (FAILURE == zend_hash_update(&EG(persistent_list), hashkey,
+- hashkey_length+1, (void *)&new_le, sizeof(list_entry),
++ hashkey_length+1, (void *)&new_le, sizeof(zend_rsrc_list_entry),
+ NULL)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "Failed to register persistent resource");