diff options
author | Alexis Ballier <aballier@gentoo.org> | 2012-01-09 14:53:06 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2012-01-09 14:53:06 +0000 |
commit | b106e67827763862053e6e4edd727dc09412b1d7 (patch) | |
tree | e7e4c5238e2693f077713350121aa4ba3b32015b /dev-php/ffmpeg-php | |
parent | bump a new snapshot that should fix bug #397789 (diff) | |
download | historical-b106e67827763862053e6e4edd727dc09412b1d7.tar.gz historical-b106e67827763862053e6e4edd727dc09412b1d7.tar.bz2 historical-b106e67827763862053e6e4edd727dc09412b1d7.zip |
attempt to fix build and compatibility with latest ffmpeg releases, bug #395563
Package-Manager: portage-2.2.0_alpha84/cvs/Linux x86_64
Diffstat (limited to 'dev-php/ffmpeg-php')
-rw-r--r-- | dev-php/ffmpeg-php/ChangeLog | 11 | ||||
-rw-r--r-- | dev-php/ffmpeg-php/Manifest | 15 | ||||
-rw-r--r-- | dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild | 5 | ||||
-rw-r--r-- | dev-php/ffmpeg-php/files/ffmpeg-php-0.6.0-ffmpeg.patch | 350 |
4 files changed, 374 insertions, 7 deletions
diff --git a/dev-php/ffmpeg-php/ChangeLog b/dev-php/ffmpeg-php/ChangeLog index 1daaedcbe3c2..915899ce0177 100644 --- a/dev-php/ffmpeg-php/ChangeLog +++ b/dev-php/ffmpeg-php/ChangeLog @@ -1,6 +1,11 @@ -# ChangeLog for dev-php5/ffmpeg-php -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-php/ffmpeg-php/ChangeLog,v 1.1 2011/12/14 22:29:48 mabi Exp $ +# ChangeLog for dev-php/ffmpeg-php +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-php/ffmpeg-php/ChangeLog,v 1.2 2012/01/09 14:53:06 aballier Exp $ + + 09 Jan 2012; Alexis Ballier <aballier@gentoo.org> ffmpeg-php-0.6.0-r1.ebuild, + +files/ffmpeg-php-0.6.0-ffmpeg.patch: + attempt to fix build and compatibility with latest ffmpeg releases, bug + #395563 31 Mar 2011; Tomáš Chvátal <scarabeus@gentoo.org> -ffmpeg-php-0.6.0.ebuild, ffmpeg-php-0.6.0-r1.ebuild: diff --git a/dev-php/ffmpeg-php/Manifest b/dev-php/ffmpeg-php/Manifest index b52731a8720b..f05c8f5a691e 100644 --- a/dev-php/ffmpeg-php/Manifest +++ b/dev-php/ffmpeg-php/Manifest @@ -1,5 +1,16 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX ffmpeg-php-0.6.0-avutil50.patch 1347 RMD160 a0dc5c175ebfd5b5f4992c53746b6bd97f1dd092 SHA1 c5e0126265a2d86bac6c341d56fa89eb082d24b4 SHA256 a08ad6582c7e57a43eddc7419fe37b89b1194d85d752a7a2a8837c1192784eec +AUX ffmpeg-php-0.6.0-ffmpeg.patch 11687 RMD160 4070885c43dec098ffc3a279571126a09ebde15c SHA1 a4f33379710ec614aa1b5b10b9008b9cc66e6dc6 SHA256 22e9bdd364d81955b771fda0322232466257f4fdad581c78c407cb614f150abd DIST ffmpeg-php-0.6.0.tbz2 275557 RMD160 a779b06f09fce3ff3c8326bb10db4ab8aadf425e SHA1 2978b5af51af3eda0639840634297eb584b394c1 SHA256 ec8a9847e0f4d5101a5afedb7dac318e9a13f099865215ae99d08d56add9b141 -EBUILD ffmpeg-php-0.6.0-r1.ebuild 968 RMD160 a8b3d212c4c5b263e030cc8bcf7e0db93b763606 SHA1 6fa7d19850d97081960427138845a25aea19ec3f SHA256 a972004c6681bcc24e6a2d8050c3c223dbd55dad7fba96146e59c33078617b44 -MISC ChangeLog 1990 RMD160 c3daa8a0a5ed165dfc8541cd4fdd67f488df4f36 SHA1 b22c03ebb77a8e46587fc3928069dc4becc2f377 SHA256 586c6df5a5cc3d4f18bb00c7e5ed46b13234624be76fb00403c5b4cb93c9929d +EBUILD ffmpeg-php-0.6.0-r1.ebuild 1013 RMD160 49c7e95d5ce954077110704f50b5360749faa250 SHA1 1fcd87641efe79cbf2912df6dd4da60b02885c1a SHA256 a15a463c3a98f3d4c1b319cfdeedb817c298c938842941ad197a1042b7786bc4 +MISC ChangeLog 2198 RMD160 ade19ce1db3583539d5c42666068f2511e4d9a4f SHA1 9365886b13419908dbba487755befd385fa8688f SHA256 a740c2e0a73c86528155eea5913597af7f94eba99a0ff1c6db9cba24020d39ff MISC metadata.xml 157 RMD160 a98db3a086fae3c09a903dadbc05f60443ec4b1a SHA1 ddaa23cc35eb917bf8962b652442bebb1ce0f440 SHA256 54f8878ca0228e380abbaa4b529806b5533a6b9b51b3b16c0909e906586a91a1 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.18 (GNU/Linux) + +iEYEARECAAYFAk8K/1gACgkQvFcC4BYPU0qfDwCbBqCrRW72HT6QkBsxmxtG4t8T +N30An0cOlsjPEQQWO3j+F/2zGmjboLx9 +=FkCa +-----END PGP SIGNATURE----- diff --git a/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild b/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild index 3f6738a5a9e3..0c107bab2567 100644 --- a/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild +++ b/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild,v 1.1 2011/12/14 22:29:48 mabi Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-php/ffmpeg-php/ffmpeg-php-0.6.0-r1.ebuild,v 1.2 2012/01/09 14:53:06 aballier Exp $ EAPI="3" @@ -34,6 +34,7 @@ src_prepare() { for slot in $(php_get_slots) ; do cd "${WORKDIR}/${slot}" epatch "${FILESDIR}/${P}-avutil50.patch" + epatch "${FILESDIR}/${P}-ffmpeg.patch" done php-ext-source-r2_src_prepare } 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..5de51efa8727 --- /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, "ALBUMTITLE"); ++ 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, "YEAR"); ++ 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; + } |