summaryrefslogtreecommitdiff
path: root/media-libs/mediastreamer
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/mediastreamer')
-rw-r--r--media-libs/mediastreamer/Manifest24
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.7.3-ffmpeg-0.11.patch94
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.7.3-sdl-build.patch220
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.7.3-v4l-automagic.patch40
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.7.3-videoenc_282.patch130
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.8.2-autopoint.patch17
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.8.2-ffmpeg-1.0.patch59
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.8.2-libav9.patch115
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.8.2-v4l-automagic.patch54
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch482
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-libav9.patch120
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-tests.patch26
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-underlinking.patch57
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-v4l-automagic.patch55
-rw-r--r--media-libs/mediastreamer/files/mediastreamer-2.9.0-xxd.patch18
-rw-r--r--media-libs/mediastreamer/mediastreamer-2.7.3-r3.ebuild129
-rw-r--r--media-libs/mediastreamer/mediastreamer-2.8.2.ebuild137
-rw-r--r--media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild174
-rw-r--r--media-libs/mediastreamer/mediastreamer-2.9.0.ebuild171
-rw-r--r--media-libs/mediastreamer/metadata.xml22
20 files changed, 2144 insertions, 0 deletions
diff --git a/media-libs/mediastreamer/Manifest b/media-libs/mediastreamer/Manifest
new file mode 100644
index 000000000000..a32b071f56b3
--- /dev/null
+++ b/media-libs/mediastreamer/Manifest
@@ -0,0 +1,24 @@
+AUX mediastreamer-2.7.3-ffmpeg-0.11.patch 3113 SHA256 a9c973a4e769f411a851553f2f87bbe3e36d695f48418aec18628d6e7784b506 SHA512 31413f9f2502558c4d8fad83176727e339169400923406c127705717be0c248cf14269cd3edfc24684fe34ecdad77bfc3acc718bbe5dff17bc32d8b0699e80ba WHIRLPOOL 215ab930cc1bfc9a7cba881318804fdec7e13c587bf6f99afde22733377da696890164b4d0ff76c3ada55bbf022d3434bb2f70bfe1c440575b283045167b483c
+AUX mediastreamer-2.7.3-sdl-build.patch 8006 SHA256 f143cf44b767e07ba7bff5572fe5f11950142ff0a36025a64db585aa048ab263 SHA512 eb828e1cac9c904b5401b1b68402b6fc02225968b4d95827442994a20c00b99c621679c52c08a14b31e6d647b39e479e1077097cea7207203eaf3673f592454c WHIRLPOOL 5549c8b19a438f34a4c10e7f31485c46ee4b94a2b71404027ba038fab08c81de0052107d5bfea25b49891d147abbe6a9d331378e59040fd1894c5c2f12447890
+AUX mediastreamer-2.7.3-v4l-automagic.patch 1083 SHA256 697cc9697504e57bb5810b7844eac34bfbae9c909f299ca5bb056b352c26bcfe SHA512 cb37f468fcf16d2cacc64b309cb58fb2b841f9962a01c6075079dfb55d8022ef245abb9f44e91a47e72081115603ffacd1020023d67a3f1dadc1fe411ebb2e67 WHIRLPOOL 833f1653e57c850583222b2b31de3e78a70b355b05d8b530864804bdeb1b888f3eb959f00dcaeb605047a4a460a5f13b777e2e6e7e8a2a9adda138e1493ca75f
+AUX mediastreamer-2.7.3-videoenc_282.patch 3581 SHA256 15f4f79ec44c8d4256ff146199299c89d24fdaaa4e8c40e9ca7c9ab178ef4306 SHA512 750b9d212dad04729b5607c83b55afcb3fafb0f4b9ce7dd174a996d31421883747d1d1703293b8b3e2b458094470da7eed003a52b8951fff2e81da2326824f26 WHIRLPOOL 381a80008fdadf5e7e075797183bb9f3fb328261ea75963e15238ad89bda039210c2e11e061b82c7acb438c5dd458d1434aaddc41bdf16d46d9f242620cf05e1
+AUX mediastreamer-2.8.2-autopoint.patch 710 SHA256 d19e1398755eccc8714b98d3ab53f671e31335e9d4c5456d8de8f89ddbc1cfb8 SHA512 fed068438d9624d91dbace156933bba2a6d1a785f5f2eca3053d443cf479bf66731cd0b2d32118dba376ac4d96f34de31a82c70170553d0de497fea238bf162a WHIRLPOOL 7cc86d7331dd9eba10c5f51cdd4105ce9246a345336598e3e3528a7d9684887ef995c1ca342275d636516ad71c0137205dc2e7ea5c3696004dbbdf0b10c011c5
+AUX mediastreamer-2.8.2-ffmpeg-1.0.patch 1603 SHA256 c76fea152b1c6d968b753464e2e57ec49dbaba014d17efd304228ddac7495e32 SHA512 19fed47ebb1261e6e3f98021b3b3acb92f112169991fa5dc5960cecf0de5044108e114fb65c7e516aae9412c1c8d6561e87a2d45b50cd772a64d711d08148d0e WHIRLPOOL 9b9e023c7fa9ed93b6459e69252f89e0a1eee9b1962eb4c04c23f8cdf6e61444f5f6fb9c02faec0c5ebfb8600d87a1861390684de2bff25a863a6199b9048ed8
+AUX mediastreamer-2.8.2-libav9.patch 4464 SHA256 5677af43cf8224a7a129dabe7dcf7db331a5e07119d0e28b1e117ec8c4b55685 SHA512 8df2c02bd2066b00bf5ce1e841d3fcf3ac51d8b7401a26e9b1f894b31cfa58026619874ce1e02393e41948bff3e89499f7be022abef5d4f9b6442033632d01bd WHIRLPOOL ad6238c7183df176934f5b7a8d16f6879a12b7e66e25453e42a5728cc56e626c36e2609e560ed26c84bafa8fd9142a993526e486383a404ca69c4d6ebb301acd
+AUX mediastreamer-2.8.2-v4l-automagic.patch 1675 SHA256 c804e26d980648478cf10acb95ecca3e24c1f63acbefc80c6fced623a36a72f0 SHA512 9b091a1edbe82e7b633d64ff1d6a5c702ddacfac289bb47c632aae6063961ea6a9c5260f863b0e902f6f77b004abca47cb3d7088b284fdf5953ac21deddd5b4a WHIRLPOOL 2687b2cda2d97037f0661a654de0d8e16979558a13aee253f54dacb999ce50972334a58a0d669bf0fe73f6290fbdb2b4d96ab8a3448c92ed50d545fc473179b9
+AUX mediastreamer-2.9.0-ffmpeg3.patch 16778 SHA256 3e3d13cc2c89f6257b6cb1d5778fa09f4d2c3324307f445a15ef91d1e3b46fc7 SHA512 15170cf0089fde5ace41b7c9d9b155fc42b621691a7b86b08414139b4a6a896c4fe4a8de6f082039044699761774ac02c75e0e637b7d813a1228bc9fd8ab0b83 WHIRLPOOL 8823fc3ed7fd39dd9f342faab236e95bbe1faaaff6cfce3e9c8d8cc60d3a7933af49a96ade1c5ee7f1a3a904530419627f9d3767baab45e94909f0b018741f5a
+AUX mediastreamer-2.9.0-libav9.patch 4535 SHA256 dc42bcd66c81dec0ab38058c640f575b75a6c0688db2bd7dc4a8e45fafaa196a SHA512 1fe44aeac23c0f97a2cba2e7312ed57833b0d7a2bf382de7727000c833159ae3123cc2c4b22b00a9977c9481a633efaad8c0d4615f0e6118baf3c326ccdb5fde WHIRLPOOL eddab46d033521e95b8dbdc4602a2441fb28a3e086ee2b21cf60113127738cf1ab868e24f65dd0f0ab0e52f2bf8a33a86747f316bc5cf0ee716bcd118c21ef08
+AUX mediastreamer-2.9.0-tests.patch 587 SHA256 80fc8b229e41adde9d00fd38a0ad44ab028db9e4acbf5c7c5e612e581e7541c3 SHA512 9298a6b2979c7f0f7a119a0bf5c943f9e03d860d4ea82de23a224b288e9e953da22bde5c1d01aa6b357dd897d5cda7fd9ca91ff05d6e1d54100f48f82e6b0011 WHIRLPOOL 7e55e8b284c58a3ab36899bc078600da205cacf5e947a954f289d3a898f1940083ff43e35222d4bb566b260055950f314b4c70169bd796b4f8ed205dfbcf65e2
+AUX mediastreamer-2.9.0-underlinking.patch 1969 SHA256 03cdca023eaf4e787a179c1e373b5d6c3728a69ba761c8e89a508cce7e2db27c SHA512 35103d8fc617d8202031cb9157e757d9a4822ad90595b2842a0715420c69b60bc4c99bedf0d4b6aee419c3a663104e8d0f05c743c7a374c3ae3bc5d7630a761e WHIRLPOOL 3201cd07595865a3dd42efd53b2a13f3ec2d2a87c53c2313776e0ee1e0b3e155153bad0a0789b74aab2d57ef8c59ff5a9d44fc79a99effb0ec90f6e3a02a2f53
+AUX mediastreamer-2.9.0-v4l-automagic.patch 1563 SHA256 e5dcb6b61e3536a60d38ed96ac0ff9d9c9044042bb8356bedd3ef2594ff7b64d SHA512 0de2d426e0b9594695fea4c3cfe5fb832d351380c53ed671ede2c4c7d0142205af22c3fc9048812bbcd2e20c6b3f7fb8828baa4704466e2da1906112193d7dcf WHIRLPOOL 9e7864f87e3976963198632c45756a15015f45aa6b11f327026b9c3a1e0e5d8af9e4a9d9bf312b8255fabbbc7b71df9d38990cfbb07e3a41f164296005548e4f
+AUX mediastreamer-2.9.0-xxd.patch 642 SHA256 3beec8ca23aede692902ec02e003e96c485845368a69aacdd928f606aa0f1403 SHA512 763a8d90b278b75574c8a3cd14a780ec069f3bb6267e4ae5425ead390b274662a6c31ca924b418df5454cd7a842929dbadf621acb65e52c5af7835a2bc21bca2 WHIRLPOOL 6e1a835b50f53762a90d77946eb58d0569d423b53de3ae21d5d1f409be96a774b176b490db26682d17e7a7bed9d7879df89a6dc3f943bb70c47f234ebea0f7d8
+DIST mediastreamer-2.7.3.tar.gz 758146 SHA256 c3cbea285f1e85259b2ac06d3f1730b4258e280011598b91f5b90b8432bf1dc0 SHA512 f9ebfa12b1c760b5c24b5496466d92148a170ee2d522d9085db3fb72cc93f8e3e71ba1ae14f57d94a33b752450555c7d3ebf59267447203861247a8685e18259 WHIRLPOOL c1528bcca27c979ac29d6ccb6e32eac53ddd9e69d3f034056ad579d5ff6cd295c9224db6b841d6aa708e2c60251b192e85d6843342c14f8ead75d9f137c8d818
+DIST mediastreamer-2.8.2.tar.gz 882966 SHA256 a62ebb008913db6e03e27bd1ec30bb560ae4219da5255c0e91853b5e894a4f33 SHA512 2041d9fbba0f831aea6bdd3259b21742a37cfdbdf473b0bc4f20bd730371395ddf2866804ae496e9864adf5fcd0d24e03193d5d8feadd54e6ff0b3adda01ff60 WHIRLPOOL cecd47766dff3df76271b3209f7f967a00165861283c34633361a07bf8a416e63d5c5c6dd364a1558f1f865803eaf4a1888bd3bcf42cb0e159b12107045b61ab
+DIST mediastreamer-2.9.0.tar.gz 3578877 SHA256 c245b9444c2abb4c84433606e01f0b3ce29ce78de0afe1e191f4f3c62656acd5 SHA512 8c31ab07c659dce84c410dfb5814b6cdf3defcd4055814922f58e2886bfeecfd5bab294c408858a29e72fcf53f35a1f7748113e1f2863baa329daedae07ef2f0 WHIRLPOOL 9e425ff2e461ceb6dae3890e6bd8035de65f5b3fd0590e01b75259c0d27dd54cfd37cb88d43752c2903c954ac44e353e4ed63588d3f08ec690da77293a31ba68
+EBUILD mediastreamer-2.7.3-r3.ebuild 3898 SHA256 2077b820c16fc457955bafd310db7690540696f3621c810894529f55305bf7fa SHA512 941d6199e23c2e2d42e5e784fb125ab6ca128e839f691a45a3c5faf2ffe1cbc7189e506f8c1a129e92283fc4428573d78d4f9971b3d75f6c25d36e1f77ff176e WHIRLPOOL b282a6606c3570d29b18c77919c56acb960cc8309f7f3c61d1b6d5874d8d8b0c818252a6c25b75a8f2b62577d969590f25c329a8eea99f0623db03e78c5a4d3a
+EBUILD mediastreamer-2.8.2.ebuild 3824 SHA256 5faadb8c8a2d0927b216a6f0bdb35f217f1f47ab8ee6cc20921d5c2ca4a79198 SHA512 9336b58a8b0ef34d58ee9f3d37cb40911e25a5c1979bbf9507370f3d9018de5c13833d8cfbaeb3482810bf1c9d366a0541ea576c345af5837fc4e4ca9d0579c1 WHIRLPOOL aba97ac0447ba5a4e106a07cd49ab76ddd0dab8c5a0e896b72527722b35c8b53e1ead57e534c929eea7785336b60aa33af65ba4972c423df1d1d88677b7872ce
+EBUILD mediastreamer-2.9.0-r1.ebuild 4584 SHA256 6fc9b068e3039063acdeca5b86b46a9c45d0f7f78ba84426947bb237ba7fde56 SHA512 2b05c989175bb8fccf7d5bccce914ddfeec8c5ef28e76d34bbcdf811aa19b0343ead4b41fbcd5aa3fd0aa8cba9921d7d1ecabf253842108b45b01c69b162ade9 WHIRLPOOL c36559129c88429139e7432990310e222cb52c246a819e93e04f1c1fcd560c0ec5a8960c898ea7d39f0eab981c17462a5e011174a60b9a3c64062a077695e827
+EBUILD mediastreamer-2.9.0.ebuild 4469 SHA256 3d17d02ca0eb5000f29ed005535d73ec1be9a3a7ea354ef0882c2576170ee15c SHA512 acf3c4d57f6e34e576ed7793c7b44da186ca48f667f4749e628ed2e3b9da0768ad49802063e782140964e8bd21286d6b470f394574a89c4004308791383dc610 WHIRLPOOL d6d0b17017b8d58e5c820d199c7232daf5de8bd96f69f68e6c11fce198a962ef1be4d9c5cdeecf5903295cad2ce307833709f97d037b99d06352cbce4336e922
+MISC ChangeLog 3214 SHA256 24296e592166c5d92785c54136e8abc8aa8175b8c01255efa4a5869a727f89f8 SHA512 c3bb18a80f85413dc871c98c8e2ea9461df4bee7d96eb817e80f8f5c7c57435060e39cf01476d37bdd720885b3e7a3547a5a3194add94b10463b28937938e0f8 WHIRLPOOL 6d423c370294784e43932463ee592ad9d8b6ee430b65f126f5c9a2fde7a9d578d9e915ee4011316307ff33fe28bf877d4a66db835e58a7d396a44de41bf5d2f6
+MISC ChangeLog-2015 12379 SHA256 3a133d76dba8a19dd4089acc331cfe6934ba43b9257db57d34c5bf2afa4e8420 SHA512 b2ecc5bd583c3cc6fff33c8d80a5854ed9737603d943bdc8aeb26c1723a9c7de60a266fb8551c056c4af843146b21bd973369e0eeec446322b0db00b1c37593d WHIRLPOOL b54f36dce60826fe1efd23c5c897fce921322940ce9eb5e747f849c27ff3f36e59898fb8f03a2569194441772111b0f4ef35ccd8b7129ccb08325e590c059881
+MISC metadata.xml 934 SHA256 017f0adf88f3eb35690cab4fd825a5ae658bd245fec3cd3b048fa4821041e927 SHA512 8cf01a51dd7bafcbd4ca39c49deacd38104d9640ed26ceab65e3f96ebb9e9be6caed8e8e0a3813946365fd6400141fac0481e3d29d59cef1625f132a81b2eddd WHIRLPOOL b63f4a33858f3d61cb057ea7fba462a6e77a95bbde0f63d97989c990d4e36dc57d31a9e6d8ccbdde88fdaf10b1de21c53e89df9bbb6bac9dafc65c6f5bfe7612
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.7.3-ffmpeg-0.11.patch b/media-libs/mediastreamer/files/mediastreamer-2.7.3-ffmpeg-0.11.patch
new file mode 100644
index 000000000000..c242b5fe139c
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.7.3-ffmpeg-0.11.patch
@@ -0,0 +1,94 @@
+Fix build with recent ffmpeg releases.
+https://bugs.gentoo.org/show_bug.cgi?id=419453
+
+Index: mediastreamer-2.7.3/src/videoenc.c
+===================================================================
+--- mediastreamer-2.7.3.orig/src/videoenc.c
++++ mediastreamer-2.7.3/src/videoenc.c
+@@ -53,7 +53,6 @@ void ms_ffmpeg_log_callback(void* ptr, i
+
+ void ms_ffmpeg_check_init(){
+ if(!avcodec_initialized){
+- avcodec_init();
+ avcodec_register_all();
+ avcodec_initialized=TRUE;
+ #ifdef ENABLE_LOG_FFMPEG
+@@ -107,6 +106,7 @@ typedef struct EncState{
+ uint32_t framenum;
+ VideoStarter starter;
+ bool_t req_vfu;
++ AVDictionary * ff_opts;
+ }EncState;
+
+ static int enc_set_fps(MSFilter *f, void *arg){
+@@ -214,6 +214,7 @@ static void enc_init(MSFilter *f, enum C
+ s->req_vfu=FALSE;
+ s->framenum=0;
+ s->av_context.codec=NULL;
++ s->ff_opts = NULL;
+ }
+
+ static void enc_h263_init(MSFilter *f){
+@@ -300,9 +301,9 @@ static void prepare_h263(EncState *s){
+ if (s->profile==0){
+ s->codec=CODEC_ID_H263;
+ }else{
+- c->flags|=CODEC_FLAG_H263P_UMV;
++ av_dict_set(&(s->ff_opts), "umv", "1", 0);
+ c->flags|=CODEC_FLAG_AC_PRED;
+- c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
++ av_dict_set(&(s->ff_opts), "structured_slices", "1", 0);
+ /*
+ c->flags|=CODEC_FLAG_OBMC;
+ c->flags|=CODEC_FLAG_AC_PRED;
+@@ -342,9 +343,9 @@ static void enc_preprocess(MSFilter *f){
+ ms_error("could not find encoder for codec id %i",s->codec);
+ return;
+ }
+- error=avcodec_open(&s->av_context, s->av_codec);
++ error=avcodec_open2(&s->av_context, s->av_codec, &(s->ff_opts));
+ if (error!=0) {
+- ms_error("avcodec_open() failed: %i",error);
++ ms_error("avcodec_open2() failed: %i",error);
+ return;
+ }
+ video_starter_init(&s->starter);
+@@ -372,7 +373,7 @@ static void add_rfc2190_header(mblk_t **
+ // assume video size is CIF or QCIF
+ if (context->width == 352 && context->height == 288) header->b_wptr[1] = 0x60;
+ else header->b_wptr[1] = 0x40;
+- if (context->coded_frame->pict_type != FF_I_TYPE) header->b_wptr[1] |= 0x10;
++ if (context->coded_frame->pict_type != AV_PICTURE_TYPE_I) header->b_wptr[1] |= 0x10;
+ header->b_wptr += 4;
+ header->b_cont = *packet;
+ *packet = header;
+@@ -779,7 +780,7 @@ static void process_frame(MSFilter *f, m
+ s->req_vfu=TRUE;
+ }
+ if (s->req_vfu){
+- pict.pict_type=FF_I_TYPE;
++ pict.pict_type=AV_PICTURE_TYPE_I;
+ s->req_vfu=FALSE;
+ }
+ comp_buf->b_rptr=comp_buf->b_wptr=comp_buf->b_datap->db_base;
+@@ -799,7 +800,7 @@ static void process_frame(MSFilter *f, m
+ if (s->framenum==1){
+ video_starter_first_frame (&s->starter,f->ticker->time);
+ }
+- if (c->coded_frame->pict_type==FF_I_TYPE){
++ if (c->coded_frame->pict_type==AV_PICTURE_TYPE_I){
+ ms_message("Emitting I-frame");
+ }
+ comp_buf->b_wptr+=error;
+Index: mediastreamer-2.7.3/src/h264dec.c
+===================================================================
+--- mediastreamer-2.7.3.orig/src/h264dec.c
++++ mediastreamer-2.7.3/src/h264dec.c
+@@ -46,7 +46,6 @@ typedef struct _DecData{
+ static void ffmpeg_init(){
+ static bool_t done=FALSE;
+ if (!done){
+- avcodec_init();
+ avcodec_register_all();
+ done=TRUE;
+ }
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.7.3-sdl-build.patch b/media-libs/mediastreamer/files/mediastreamer-2.7.3-sdl-build.patch
new file mode 100644
index 000000000000..2f7207e27ab0
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.7.3-sdl-build.patch
@@ -0,0 +1,220 @@
+commit c0ae6c3f9f78ae9e9e4c7030e7054dc5c0267e2c
+Author: Simon Morlat <simon.morlat@linphone.org>
+Date: Mon Apr 11 22:46:37 2011 +0200
+
+ fix SDL output that wasn't compiling anymore and bugfix videodisplay test program
+
+diff --git a/src/msfilter.c b/src/msfilter.c
+index d8d84f3..4b84b8b 100644
+--- a/src/msfilter.c
++++ b/src/msfilter.c
+@@ -169,9 +169,7 @@ int ms_filter_link(MSFilter *f1, int pin1, MSFilter *f2, int pin2){
+
+ int ms_filter_unlink(MSFilter *f1, int pin1, MSFilter *f2, int pin2){
+ MSQueue *q;
+- ms_return_val_if_fail(f1, -1);
+- ms_return_val_if_fail(f2, -1);
+- ms_message("ms_filter_unlink: %s:%p,%i-->%s:%p,%i",f1->desc->name,f1,pin1,f2->desc->name,f2,pin2);
++ ms_message("ms_filter_unlink: %s:%p,%i-->%s:%p,%i",f1 ? f1->desc->name : "!NULL!",f1,pin1,f2 ? f2->desc->name : "!NULL!",f2,pin2);
+ ms_return_val_if_fail(pin1<f1->desc->noutputs, -1);
+ ms_return_val_if_fail(pin2<f2->desc->ninputs, -1);
+ ms_return_val_if_fail(f1->outputs[pin1]!=NULL,-1);
+diff --git a/src/videoout.c b/src/videoout.c
+index ca36b0f..5bdc6dd 100644
+--- a/src/videoout.c
++++ b/src/videoout.c
+@@ -114,8 +114,6 @@ void ms_display_destroy(MSDisplay *d);
+ }
+ #endif
+
+-#include "ffmpeg-priv.h"
+-
+ #define SCALE_FACTOR 4.0f
+ #define SELVIEW_POS_INACTIVE -100.0
+
+@@ -462,7 +460,7 @@ void ms_display_desc_set_default_window_id(MSDisplayDesc *desc, long id){
+
+ typedef struct VideoOut
+ {
+- AVRational ratio;
++ struct Rational {int num; int den;} ratio;
+ MSPicture fbuf;
+ MSPicture fbuf_selfview;
+ MSPicture local_pic;
+@@ -474,8 +472,8 @@ typedef struct VideoOut
+ float sv_posx,sv_posy;
+ int background_color[3];
+
+- struct ms_SwsContext *sws1;
+- struct ms_SwsContext *sws2;
++ MSScalerContext *sws1;
++ MSScalerContext *sws2;
+ MSDisplay *display;
+ bool_t own_display;
+ bool_t ready;
+@@ -552,11 +550,11 @@ static void video_out_uninit(MSFilter *f){
+ if (obj->display!=NULL && obj->own_display)
+ ms_display_destroy(obj->display);
+ if (obj->sws1!=NULL){
+- ms_sws_freeContext(obj->sws1);
++ ms_scaler_context_free(obj->sws1);
+ obj->sws1=NULL;
+ }
+ if (obj->sws2!=NULL){
+- ms_sws_freeContext(obj->sws2);
++ ms_scaler_context_free(obj->sws2);
+ obj->sws2=NULL;
+ }
+ if (obj->local_msg!=NULL) {
+@@ -581,11 +579,11 @@ static void video_out_prepare(MSFilter *f){
+ obj->display=NULL;
+ }
+ if (obj->sws1!=NULL){
+- ms_sws_freeContext(obj->sws1);
++ ms_scaler_context_free(obj->sws1);
+ obj->sws1=NULL;
+ }
+ if (obj->sws2!=NULL){
+- ms_sws_freeContext(obj->sws2);
++ ms_scaler_context_free(obj->sws2);
+ obj->sws2=NULL;
+ }
+ if (obj->local_msg!=NULL) {
+@@ -665,13 +663,12 @@ static void video_out_process(MSFilter *f){
+ if (ms_yuv_buf_init_from_mblk(&src,inm)==0){
+
+ if (obj->sws2==NULL){
+- obj->sws2=ms_sws_getContext(src.w,src.h,PIX_FMT_YUV420P,
+- obj->fbuf_selfview.w,obj->fbuf_selfview.h,PIX_FMT_YUV420P,
+- SWS_FAST_BILINEAR, NULL, NULL, NULL);
++ obj->sws2=ms_scaler_create_context(src.w,src.h,MS_YUV420P,
++ obj->fbuf_selfview.w,obj->fbuf_selfview.h,MS_YUV420P,
++ MS_SCALER_METHOD_BILINEAR);
+ }
+ ms_display_lock(obj->display);
+- if (ms_sws_scale(obj->sws2,src.planes,src.strides, 0,
+- src.h, obj->fbuf_selfview.planes, obj->fbuf_selfview.strides)<0){
++ if (ms_scaler_process(obj->sws2,src.planes,src.strides,obj->fbuf_selfview.planes, obj->fbuf_selfview.strides)<0){
+ ms_error("Error in ms_sws_scale().");
+ }
+ if (!mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->fbuf_selfview);
+@@ -683,9 +680,9 @@ static void video_out_process(MSFilter *f){
+ if (ms_yuv_buf_init_from_mblk(&src,inm)==0){
+
+ if (obj->sws2==NULL){
+- obj->sws2=ms_sws_getContext(src.w,src.h,PIX_FMT_YUV420P,
+- obj->local_pic.w,obj->local_pic.h,PIX_FMT_YUV420P,
+- SWS_FAST_BILINEAR, NULL, NULL, NULL);
++ obj->sws2=ms_scaler_create_context(src.w,src.h,MS_YUV420P,
++ obj->local_pic.w,obj->local_pic.h,MS_YUV420P,
++ MS_SCALER_METHOD_BILINEAR);
+ }
+ if (obj->local_msg==NULL){
+ obj->local_msg=ms_yuv_buf_alloc(&obj->local_pic,
+@@ -693,8 +690,7 @@ static void video_out_process(MSFilter *f){
+ }
+ if (obj->local_pic.planes[0]!=NULL)
+ {
+- if (ms_sws_scale(obj->sws2,src.planes,src.strides, 0,
+- src.h, obj->local_pic.planes, obj->local_pic.strides)<0){
++ if (ms_scaler_process(obj->sws2,src.planes,src.strides,obj->local_pic.planes, obj->local_pic.strides)<0){
+ ms_error("Error in ms_sws_scale().");
+ }
+ if (!mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->local_pic);
+@@ -731,13 +727,12 @@ static void video_out_process(MSFilter *f){
+ }
+ }
+ if (obj->sws1==NULL){
+- obj->sws1=ms_sws_getContext(src.w,src.h,PIX_FMT_YUV420P,
+- obj->fbuf.w,obj->fbuf.h,PIX_FMT_YUV420P,
+- SWS_FAST_BILINEAR, NULL, NULL, NULL);
++ obj->sws1=ms_scaler_create_context(src.w,src.h,MS_YUV420P,
++ obj->fbuf.w,obj->fbuf.h,MS_YUV420P,
++ MS_SCALER_METHOD_BILINEAR);
+ }
+ ms_display_lock(obj->display);
+- if (ms_sws_scale(obj->sws1,src.planes,src.strides, 0,
+- src.h, obj->fbuf.planes, obj->fbuf.strides)<0){
++ if (ms_scaler_process(obj->sws1,src.planes,src.strides,obj->fbuf.planes, obj->fbuf.strides)<0){
+ ms_error("Error in ms_sws_scale().");
+ }
+ if (obj->mirror && !mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->fbuf);
+@@ -943,3 +938,4 @@ MSFilterDesc ms_video_out_desc={
+
+
+ MS_FILTER_DESC_EXPORT(ms_video_out_desc)
++
+diff --git a/tests/videodisplay.c b/tests/videodisplay.c
+index 76f67a5..0828c6a 100644
+--- a/tests/videodisplay.c
++++ b/tests/videodisplay.c
+@@ -52,6 +52,7 @@ int main(int argc, char *argv[]){
+ for(i=0;i<1;++i){
+ int n;
+ vs=video_preview_new();
++ /*video_preview_set_display_filter_name(vs,"MSVideoOut");*/
+ video_preview_set_size(vs,vsize);
+ video_preview_start(vs, cam);
+
+@@ -79,11 +80,11 @@ int main(int argc, char *argv[]){
+
+ vs->tee = ms_filter_new(MS_TEE_ID);
+
+- ms_filter_unlink(vs->pixconv,0, vs->output,0);
++ ms_filter_unlink(vs->pixconv,0, vs->output2,0);
+
+ ms_filter_link(vs->pixconv,0,vs->tee,0);
+- ms_filter_link(vs->tee,0,vs->output,0);
+- ms_filter_link(vs->tee,1,vs->output,1);
++ ms_filter_link(vs->tee,0,vs->output2,0);
++ ms_filter_link(vs->tee,1,vs->output2,1);
+
+ //ms_filter_unlink(vs->tee,0,vs->output,0);
+ ms_ticker_attach (vs->ticker, vs->source);
+@@ -92,34 +93,34 @@ int main(int argc, char *argv[]){
+ if (n==500)
+ {
+ int corner=1;
+- ms_filter_call_method(vs->output,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
++ ms_filter_call_method(vs->output2,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
+ }
+ if (n==600)
+ {
+ int corner=2;
+- ms_filter_call_method(vs->output,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
++ ms_filter_call_method(vs->output2,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
+ }
+ if (n==700)
+ {
+ int corner=3;
+- ms_filter_call_method(vs->output,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
++ ms_filter_call_method(vs->output2,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
+ }
+ if (n==800)
+ {
+ int corner=-1;
+- ms_filter_call_method(vs->output,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
++ ms_filter_call_method(vs->output2,MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE,&corner);
+ }
+ if (n==900)
+ {
+ ms_ticker_detach (vs->ticker, vs->source);
+
+ ms_filter_unlink(vs->pixconv,0,vs->tee,0);
+- ms_filter_unlink(vs->tee,0,vs->output,0);
+- ms_filter_unlink(vs->tee,1,vs->output,1);
++ ms_filter_unlink(vs->tee,0,vs->output2,0);
++ ms_filter_unlink(vs->tee,1,vs->output2,1);
+ ms_filter_destroy(vs->tee);
+ vs->tee=NULL;
+
+- ms_filter_link(vs->pixconv,0, vs->output,0);
++ ms_filter_link(vs->pixconv,0, vs->output2,0);
+
+
+ ms_ticker_attach (vs->ticker, vs->source);
+@@ -129,3 +130,4 @@ int main(int argc, char *argv[]){
+ }
+ return 0;
+ }
++
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.7.3-v4l-automagic.patch b/media-libs/mediastreamer/files/mediastreamer-2.7.3-v4l-automagic.patch
new file mode 100644
index 000000000000..d103a07fd9af
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.7.3-v4l-automagic.patch
@@ -0,0 +1,40 @@
+=== modified file 'configure.ac'
+--- configure.ac 2011-04-09 08:17:33 +0000
++++ configure.ac 2011-04-09 08:31:18 +0000
+@@ -590,6 +590,15 @@
+ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data])
+ AC_SUBST(PACKAGE_DATA_DIR)
+
++AC_ARG_ENABLE(v4l,
++ [ --disable-v4l Disable usage of v4l],
++ [case "${enableval}" in
++ yes) v4l=yes ;;
++ no) v4l=no ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l) ;;
++ esac],[v4l=yes])
++
++if test "$v4l" = "yes" ; then
+ dnl check for video4linux headers
+ AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
+ if test "${ac_cv_header_linux_videodev_h}" = "yes" || \
+@@ -599,8 +608,6 @@
+ found_v4l=no
+ fi
+
+-AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes )
+-
+ AC_ARG_ENABLE(libv4l,
+ [ --disable-libv4l Disable usage of libv4l, really discouraged],
+ [case "${enableval}" in
+@@ -632,6 +639,10 @@
+ ])
+ fi
+ fi
++fi
++
++AM_CONDITIONAL(BUILD_V4L, test x$found_v4l = xyes )
++
+
+ dnl ##################################################
+ dnl # Check for doxygen
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.7.3-videoenc_282.patch b/media-libs/mediastreamer/files/mediastreamer-2.7.3-videoenc_282.patch
new file mode 100644
index 000000000000..66d055ede084
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.7.3-videoenc_282.patch
@@ -0,0 +1,130 @@
+Update videoenc.c to the 2.8.2 version. Fixes some but not all problems with
+ffmpeg.
+
+
+--- mediastreamer-2.7.3/src/videoenc.c 2010-12-17 05:59:50.000000000 -0300
++++ mediastreamer-2.8.2/src/videoenc.c 2012-02-17 06:16:20.000000000 -0300
+@@ -164,6 +164,7 @@
+ }else{
+ ms_warning("unsupported video size %s",tmp);
+ ret=FALSE;
++ goto end;
+ }
+ divider=atoi(equal+1);
+ if (divider!=0){
+@@ -174,6 +175,8 @@
+ ret=FALSE;
+ }
+ }else ret=FALSE;
++
++end:
+ ms_free(tmp);
+ return ret;
+ }
+@@ -231,11 +234,7 @@
+
+ static void prepare(EncState *s){
+ AVCodecContext *c=&s->av_context;
+-#ifdef ANDROID
+ const int max_br_vbv=128000;
+-#else
+- const int max_br_vbv=256000;
+-#endif
+
+ avcodec_get_context_defaults(c);
+ if (s->codec==CODEC_ID_MJPEG)
+@@ -315,13 +314,6 @@
+ static void prepare_mpeg4(EncState *s){
+ AVCodecContext *c=&s->av_context;
+ c->max_b_frames=0; /*don't use b frames*/
+- c->flags|=CODEC_FLAG_AC_PRED;
+- c->flags|=CODEC_FLAG_H263P_UMV;
+- /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
+- c->flags|=CODEC_FLAG_4MV;
+- c->flags|=CODEC_FLAG_GMC;
+- c->flags|=CODEC_FLAG_LOOP_FILTER;
+- c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
+ }
+
+ static void enc_uninit(MSFilter *f){
+@@ -681,7 +673,7 @@
+ uint8_t *pbuf_ptr=full_frame->b_rptr;
+ uint8_t *buf_end=full_frame->b_wptr;
+
+- ms_message("image size: %i)", buf_end-pbuf_ptr);
++ ms_message("image size: %li)", (long)(buf_end-pbuf_ptr));
+
+ *lqt=NULL;
+ *cqt=NULL;
+@@ -689,7 +681,7 @@
+ err = find_marker(&pbuf_ptr, buf_end);
+ while (err!=-1)
+ {
+- ms_message("marker found: %x (offset from beginning%i)", err, pbuf_ptr-full_frame->b_rptr);
++ ms_message("marker found: %x (offset from beginning %li)", err, (long)(pbuf_ptr-full_frame->b_rptr));
+ if (err==0xdb)
+ {
+ /* copy DQT table */
+@@ -772,10 +764,12 @@
+ int error;
+ mblk_t *comp_buf=s->comp_buf;
+ int comp_buf_sz=comp_buf->b_datap->db_lim-comp_buf->b_datap->db_base;
++ YuvBuf yuv;
+
++ ms_yuv_buf_init_from_mblk(&yuv, inm);
+ /* convert image if necessary */
+ avcodec_get_frame_defaults(&pict);
+- avpicture_fill((AVPicture*)&pict,(uint8_t*)inm->b_rptr,c->pix_fmt,c->width,c->height);
++ avpicture_fill((AVPicture*)&pict,yuv.planes[0],c->pix_fmt,c->width,c->height);
+
+ /* timestamp used by ffmpeg, unset here */
+ pict.pts=AV_NOPTS_VALUE;
+@@ -796,7 +790,9 @@
+ comp_buf->b_wptr+=4;
+ comp_buf_sz-=4;
+ }
++
+ error=avcodec_encode_video(c, (uint8_t*)comp_buf->b_wptr,comp_buf_sz, &pict);
++
+ if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error);
+ else{
+ s->framenum++;
+@@ -837,6 +833,14 @@
+ EncState *s=(EncState*)f->data;
+ bool_t snow=s->codec==CODEC_ID_SNOW;
+ s->maxbr=*(int*)arg;
++ if (s->av_context.codec!=NULL){
++ /*when we are processing, apply new settings immediately*/
++ ms_filter_lock(f);
++ enc_postprocess(f);
++ enc_preprocess(f);
++ ms_filter_unlock(f);
++ return 0;
++ }
+ if (s->maxbr>=1024000 && s->codec!=CODEC_ID_H263P){
+ s->vsize.width = MS_VIDEO_SIZE_SVGA_W;
+ s->vsize.height = MS_VIDEO_SIZE_SVGA_H;
+@@ -854,7 +858,7 @@
+ s->vsize.height=MS_VIDEO_SIZE_CIF_H;
+ s->fps=17;
+ s->qmin=3;
+- }else if (s->maxbr>=170000){
++ }else if (s->maxbr>=170000 && s->codec!=CODEC_ID_H263P && s->codec!=CODEC_ID_H263){
+ s->vsize.width=MS_VIDEO_SIZE_QVGA_W;
+ s->vsize.height=MS_VIDEO_SIZE_QVGA_H;
+ s->fps=15;
+@@ -875,14 +879,6 @@
+ s->fps=5;
+ s->qmin=5;
+ }
+-
+- if (s->av_context.codec!=NULL){
+- /*apply new settings dynamically*/
+- ms_filter_lock(f);
+- enc_postprocess(f);
+- enc_preprocess(f);
+- ms_filter_unlock(f);
+- }
+ return 0;
+ }
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.8.2-autopoint.patch b/media-libs/mediastreamer/files/mediastreamer-2.8.2-autopoint.patch
new file mode 100644
index 000000000000..5704234af060
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.8.2-autopoint.patch
@@ -0,0 +1,17 @@
+--- mediastreamer-2.8.2/configure.ac.orig 2012-06-01 16:31:34.000000000 +0400
++++ mediastreamer-2.8.2/configure.ac 2012-06-01 16:36:08.586809086 +0400
+@@ -191,13 +191,13 @@
+ if test "$mingw_found" != "yes" ; then
+ dnl gettext macro does not work properly under mingw. And we want to use the one provided by GTK.
+ AM_GNU_GETTEXT([external])
+- AM_GNU_GETTEXT_VERSION([0.18])
+ LIBS="$LIBS $LIBINTL"
+ else
+ AC_DEFINE(ENABLE_NLS,1,[Tells whether localisation is possible])
+ AC_DEFINE(HAVE_GETTEXT,1,[Tells wheter localisation is possible])
+ LIBS="$LIBS -lintl"
+ fi
++AM_GNU_GETTEXT_VERSION([0.18])
+
+ AM_CONDITIONAL(BUILD_MACOSX, test x$macosx_found = xyes)
+ AM_CONDITIONAL(BUILD_IOS, test x$ios_found = xyes)
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.8.2-ffmpeg-1.0.patch b/media-libs/mediastreamer/files/mediastreamer-2.8.2-ffmpeg-1.0.patch
new file mode 100644
index 000000000000..293e6e78dcab
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.8.2-ffmpeg-1.0.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/show_bug.cgi?id=445168
+
+commit f586917ea4d66f9ba8910f0967a8830e54d50784
+Author: Yann Diorcet <yann.diorcet@belledonne-communications.com>
+Date: Tue Jun 5 11:07:48 2012 +0200
+
+ Fixes for new versions of ffmpeg
+
+diff --git a/src/h264dec.c b/src/h264dec.c
+index c4a84ee..5229b5e 100644
+--- a/src/h264dec.c
++++ b/src/h264dec.c
+@@ -45,7 +45,9 @@ typedef struct _DecData{
+ static void ffmpeg_init(){
+ static bool_t done=FALSE;
+ if (!done){
++#ifdef FF_API_AVCODEC_INIT
+ avcodec_init();
++#endif
+ avcodec_register_all();
+ done=TRUE;
+ }
+diff --git a/src/videoenc.c b/src/videoenc.c
+index 21d016f..fb35760 100644
+--- a/src/videoenc.c
++++ b/src/videoenc.c
+@@ -39,6 +39,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ static bool_t avcodec_initialized=FALSE;
+
++#ifndef FF_I_TYPE
++#define FF_I_TYPE AV_PICTURE_TYPE_I
++#endif
++
+ #ifdef ENABLE_LOG_FFMPEG
+
+ void ms_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl)
+@@ -53,7 +57,9 @@ void ms_ffmpeg_log_callback(void* ptr, int level, const char* fmt, va_list vl)
+
+ void ms_ffmpeg_check_init(){
+ if(!avcodec_initialized){
++#ifdef FF_API_AVCODEC_INIT
+ avcodec_init();
++#endif
+ avcodec_register_all();
+ avcodec_initialized=TRUE;
+ #ifdef ENABLE_LOG_FFMPEG
+@@ -300,10 +306,10 @@ static void prepare_h263(EncState *s){
+ if (s->profile==0){
+ s->codec=CODEC_ID_H263;
+ }else{
++ /*
+ c->flags|=CODEC_FLAG_H263P_UMV;
+ c->flags|=CODEC_FLAG_AC_PRED;
+ c->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
+- /*
+ c->flags|=CODEC_FLAG_OBMC;
+ c->flags|=CODEC_FLAG_AC_PRED;
+ */
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.8.2-libav9.patch b/media-libs/mediastreamer/files/mediastreamer-2.8.2-libav9.patch
new file mode 100644
index 000000000000..0b335e282cfd
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.8.2-libav9.patch
@@ -0,0 +1,115 @@
+diff -urb mediastreamer-2.8.2.old/src/h264dec.c mediastreamer-2.8.2/src/h264dec.c
+--- mediastreamer-2.8.2.old/src/h264dec.c 2013-06-22 19:13:24.649838347 +0200
++++ mediastreamer-2.8.2/src/h264dec.c 2013-06-22 19:20:52.044822431 +0200
+@@ -55,10 +55,10 @@
+ int error;
+ codec=avcodec_find_decoder(CODEC_ID_H264);
+ if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
+- avcodec_get_context_defaults(&d->av_context);
+- error=avcodec_open(&d->av_context,codec);
++ avcodec_get_context_defaults3(&d->av_context, NULL);
++ error=avcodec_open2(&d->av_context,codec, NULL);
+ if (error!=0){
+- ms_fatal("avcodec_open() failed.");
++ ms_fatal("avcodec_open2() failed.");
+ }
+ }
+
+diff -urb mediastreamer-2.8.2.old/src/jpegwriter.c mediastreamer-2.8.2/src/jpegwriter.c
+--- mediastreamer-2.8.2.old/src/jpegwriter.c 2013-06-22 19:13:24.649838347 +0200
++++ mediastreamer-2.8.2/src/jpegwriter.c 2013-06-22 19:17:57.087828655 +0200
+@@ -90,7 +90,7 @@
+ mblk_t *jpegm;
+ struct SwsContext *sws_ctx;
+
+- AVCodecContext *avctx=avcodec_alloc_context();
++ AVCodecContext *avctx=avcodec_alloc_context3(NULL);
+
+ avctx->width=yuvbuf.w;
+ avctx->height=yuvbuf.h;
+@@ -98,9 +98,9 @@
+ avctx->time_base.den =1;
+ avctx->pix_fmt=PIX_FMT_YUVJ420P;
+
+- error=avcodec_open(avctx,s->codec);
++ error=avcodec_open2(avctx,s->codec,NULL);
+ if (error!=0) {
+- ms_error("avcodec_open() failed: %i",error);
++ ms_error("avcodec_open2() failed: %i",error);
+ cleanup(s,NULL);
+ av_free(avctx);
+ return;
+diff -urb mediastreamer-2.8.2.old/src/nowebcam.c mediastreamer-2.8.2/src/nowebcam.c
+--- mediastreamer-2.8.2.old/src/nowebcam.c 2013-06-22 19:13:24.652838347 +0200
++++ mediastreamer-2.8.2/src/nowebcam.c 2013-06-22 19:20:43.198822745 +0200
+@@ -68,9 +68,9 @@
+ return NULL;
+ }
+
+- avcodec_get_context_defaults(&av_context);
+- if (avcodec_open(&av_context,codec)<0){
+- ms_error("jpeg2yuv: avcodec_open failed");
++ avcodec_get_context_defaults3(&av_context, NULL);
++ if (avcodec_open2(&av_context,codec,NULL)<0){
++ ms_error("jpeg2yuv: avcodec_open2 failed");
+ return NULL;
+ }
+ av_init_packet(&pkt);
+diff -urb mediastreamer-2.8.2.old/src/videodec.c mediastreamer-2.8.2/src/videodec.c
+--- mediastreamer-2.8.2.old/src/videodec.c 2013-06-22 19:13:24.654838347 +0200
++++ mediastreamer-2.8.2/src/videodec.c 2013-06-22 19:28:58.436805127 +0200
+@@ -52,7 +52,7 @@
+ DecState *s=(DecState *)ms_new0(DecState,1);
+ ms_ffmpeg_check_init();
+
+- avcodec_get_context_defaults(&s->av_context);
++ avcodec_get_context_defaults3(&s->av_context, NULL);
+ s->av_codec=NULL;
+ s->codec=cid;
+ s->input=NULL;
+@@ -133,8 +133,8 @@
+ if (s->av_context.codec==NULL){
+ /* we must know picture size before initializing snow decoder*/
+ if (s->codec!=CODEC_ID_SNOW){
+- error=avcodec_open(&s->av_context, s->av_codec);
+- if (error!=0) ms_error("avcodec_open() failed: %i",error);
++ error=avcodec_open2(&s->av_context, s->av_codec,NULL);
++ if (error!=0) ms_error("avcodec_open2() failed: %i",error);
+ if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){
+ s->av_context.extradata=s->dci;
+ s->av_context.extradata_size=s->dci_size;
+@@ -223,8 +223,8 @@
+ int error;
+ s->av_context.width=h>>16;
+ s->av_context.height=h&0xffff;
+- error=avcodec_open(&s->av_context, s->av_codec);
+- if (error!=0) ms_error("avcodec_open() failed for snow: %i",error);
++ error=avcodec_open2(&s->av_context, s->av_codec, NULL);
++ if (error!=0) ms_error("avcodec_open2() failed for snow: %i",error);
+ else {
+ s->snow_initialized=TRUE;
+ ms_message("Snow decoder initialized,size=%ix%i",
+diff -urb mediastreamer-2.8.2.old/src/videoenc.c mediastreamer-2.8.2/src/videoenc.c
+--- mediastreamer-2.8.2.old/src/videoenc.c 2013-06-22 19:13:24.654838347 +0200
++++ mediastreamer-2.8.2/src/videoenc.c 2013-06-22 19:20:19.732823580 +0200
+@@ -236,7 +236,7 @@
+ AVCodecContext *c=&s->av_context;
+ const int max_br_vbv=128000;
+
+- avcodec_get_context_defaults(c);
++ avcodec_get_context_defaults3(c, NULL);
+ if (s->codec==CODEC_ID_MJPEG)
+ {
+ ms_message("Codec bitrate set to %i",c->bit_rate);
+@@ -342,9 +342,9 @@
+ ms_error("could not find encoder for codec id %i",s->codec);
+ return;
+ }
+- error=avcodec_open(&s->av_context, s->av_codec);
++ error=avcodec_open2(&s->av_context, s->av_codec, NULL);
+ if (error!=0) {
+- ms_error("avcodec_open() failed: %i",error);
++ ms_error("avcodec_open2() failed: %i",error);
+ return;
+ }
+ video_starter_init(&s->starter);
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.8.2-v4l-automagic.patch b/media-libs/mediastreamer/files/mediastreamer-2.8.2-v4l-automagic.patch
new file mode 100644
index 000000000000..f35660ea8c0c
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.8.2-v4l-automagic.patch
@@ -0,0 +1,54 @@
+From 93362c849d4a3ba1748d033369f76e93557f1c06 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 22 Nov 2012 15:02:21 +0100
+Subject: [PATCH] Support disabling V4L support completely.
+
+---
+ mediastreamer-2.8.2/configure.ac | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/mediastreamer-2.8.2/configure.ac b/mediastreamer-2.8.2/configure.ac
+index d5be955..86703a0 100644
+--- a/mediastreamer-2.8.2/configure.ac
++++ b/mediastreamer-2.8.2/configure.ac
+@@ -624,6 +624,16 @@ PACKAGE_DATA_DIR="$prefix/share"
+ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data])
+ AC_SUBST(PACKAGE_DATA_DIR)
+
++AC_ARG_ENABLE(v4l,
++ [ --disable-v4l Disable usage of v4l],
++ [case "${enableval}" in
++ yes) v4l=yes ;;
++ no) v4l=no ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l) ;;
++ esac],[v4l=yes])
++
++if test "$v4l" = "yes" ; then
++
+ dnl check for video4linux headers
+ AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
+ if test "${ac_cv_header_linux_videodev_h}" = "yes" ; then
+@@ -637,9 +647,6 @@ else
+ found_v4l2=no
+ fi
+
+-AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
+-AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
+-
+ AC_ARG_ENABLE(libv4l1,
+ [ --disable-libv4l1 Disable usage of libv4l1, really discouraged],
+ [case "${enableval}" in
+@@ -680,6 +687,10 @@ this check.
+ fi
+ fi
+
++fi
++
++AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
++AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
+
+ AC_ARG_ENABLE(tests,
+ [ --enable-tests Disable compilation of tests],
+--
+1.8.0
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch
new file mode 100644
index 000000000000..a536270897bb
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch
@@ -0,0 +1,482 @@
+Index: mediastreamer-2.9.0/src/utils/ffmpeg-priv.h
+===================================================================
+--- mediastreamer-2.9.0.orig/src/utils/ffmpeg-priv.h
++++ mediastreamer-2.9.0/src/utils/ffmpeg-priv.h
+@@ -69,9 +69,6 @@ static inline int avcodec_decode_video2(
+ return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
+ }
+ #endif
+-#if (LIBAVCODEC_VERSION_MAJOR >= 56)
+-#include <libavcodec/old_codec_ids.h>
+-#endif
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
+ #define CodecID AVCodecID
+ #endif
+Index: mediastreamer-2.9.0/src/videofilters/h264dec.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/videofilters/h264dec.c
++++ mediastreamer-2.9.0/src/videofilters/h264dec.c
+@@ -56,7 +56,7 @@ static void ffmpeg_init(){
+ static void dec_open(DecData *d){
+ AVCodec *codec;
+ int error;
+- codec=avcodec_find_decoder(CODEC_ID_H264);
++ codec=avcodec_find_decoder(AV_CODEC_ID_H264);
+ if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
+ avcodec_get_context_defaults3(&d->av_context, NULL);
+ error=avcodec_open2(&d->av_context,codec, NULL);
+@@ -119,7 +119,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f
+ s->outbuf.w=ctx->width;
+ s->outbuf.h=ctx->height;
+ s->sws_ctx=sws_getContext(ctx->width,ctx->height,ctx->pix_fmt,
+- ctx->width,ctx->height,PIX_FMT_YUV420P,SWS_FAST_BILINEAR,
++ ctx->width,ctx->height,AV_PIX_FMT_YUV420P,SWS_FAST_BILINEAR,
+ NULL, NULL, NULL);
+ }
+ #if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
+@@ -272,7 +272,7 @@ static void dec_process(MSFilter *f){
+ int len;
+ int got_picture=0;
+ AVPacket pkt;
+- avcodec_get_frame_defaults(&orig);
++ av_frame_unref(&orig);
+ av_init_packet(&pkt);
+ pkt.data = p;
+ pkt.size = end-p;
+Index: mediastreamer-2.9.0/src/videofilters/jpegwriter.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/videofilters/jpegwriter.c
++++ mediastreamer-2.9.0/src/videofilters/jpegwriter.c
+@@ -36,9 +36,9 @@ typedef struct {
+
+ static void jpg_init(MSFilter *f){
+ JpegWriter *s=ms_new0(JpegWriter,1);
+- s->codec=avcodec_find_encoder(CODEC_ID_MJPEG);
++ s->codec=avcodec_find_encoder(AV_CODEC_ID_MJPEG);
+ if (s->codec==NULL){
+- ms_error("Could not find CODEC_ID_MJPEG !");
++ ms_error("Could not find AV_CODEC_ID_MJPEG !");
+ }
+ f->data=s;
+ }
+@@ -96,7 +96,7 @@ static void jpg_process(MSFilter *f){
+ avctx->height=yuvbuf.h;
+ avctx->time_base.num = 1;
+ avctx->time_base.den =1;
+- avctx->pix_fmt=PIX_FMT_YUVJ420P;
++ avctx->pix_fmt=AV_PIX_FMT_YUVJ420P;
+
+ error=avcodec_open2(avctx,s->codec,NULL);
+ if (error!=0) {
+@@ -105,7 +105,7 @@ static void jpg_process(MSFilter *f){
+ av_free(avctx);
+ return;
+ }
+- sws_ctx=sws_getContext(avctx->width,avctx->height,PIX_FMT_YUV420P,
++ sws_ctx=sws_getContext(avctx->width,avctx->height,AV_PIX_FMT_YUV420P,
+ avctx->width,avctx->height,avctx->pix_fmt,SWS_FAST_BILINEAR,NULL, NULL, NULL);
+ if (sws_ctx==NULL) {
+ ms_error(" sws_getContext() failed.");
+@@ -126,13 +126,18 @@ static void jpg_process(MSFilter *f){
+ }
+ sws_freeContext(sws_ctx);
+
+- avcodec_get_frame_defaults(&pict);
++ av_frame_unref(&pict);
+ avpicture_fill((AVPicture*)&pict,(uint8_t*)jpegm->b_rptr,avctx->pix_fmt,avctx->width,avctx->height);
+- error=avcodec_encode_video(avctx, (uint8_t*)comp_buf,comp_buf_sz, &pict);
++ AVPacket pkt;
++ av_init_packet(&pkt);
++ pkt.buf = (uint8_t*)comp_buf;
++ pkt.size = comp_buf_sz;
++ int got_packet;
++ error=avcodec_encode_video2(avctx, &pkt, &pict, &got_packet);
+ if (error<0){
+ ms_error("Could not encode jpeg picture.");
+- }else{
+- if (fwrite(comp_buf,error,1,s->file)>0){
++ }else if(got_packet){
++ if (fwrite(comp_buf,pkt.size,1,s->file)>0){
+ ms_message("Snapshot done");
+ }else{
+ ms_error("Error writing snapshot.");
+Index: mediastreamer-2.9.0/src/videofilters/nowebcam.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/videofilters/nowebcam.c
++++ mediastreamer-2.9.0/src/videofilters/nowebcam.c
+@@ -61,7 +61,7 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf,
+ struct SwsContext *sws_ctx;
+ AVPacket pkt;
+ MSPicture dest;
+- AVCodec *codec=avcodec_find_decoder(CODEC_ID_MJPEG);
++ AVCodec *codec=avcodec_find_decoder(AV_CODEC_ID_MJPEG);
+
+ if (codec==NULL){
+ ms_error("Could not find MJPEG decoder in ffmpeg.");
+@@ -84,9 +84,9 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf,
+ }
+ ret=ms_yuv_buf_alloc(&dest, reqsize->width,reqsize->height);
+ /* not using SWS_FAST_BILINEAR because it doesn't play well with
+- * av_context.pix_fmt set to PIX_FMT_YUVJ420P by jpeg decoder */
++ * av_context.pix_fmt set to AV_PIX_FMT_YUVJ420P by jpeg decoder */
+ sws_ctx=sws_getContext(av_context.width,av_context.height,av_context.pix_fmt,
+- reqsize->width,reqsize->height,PIX_FMT_YUV420P,SWS_BILINEAR,
++ reqsize->width,reqsize->height,AV_PIX_FMT_YUV420P,SWS_BILINEAR,
+ NULL, NULL, NULL);
+ if (sws_ctx==NULL) {
+ ms_error("jpeg2yuv: ms_sws_getContext() failed.");
+Index: mediastreamer-2.9.0/src/videofilters/videodec.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/videofilters/videodec.c
++++ mediastreamer-2.9.0/src/videofilters/videodec.c
+@@ -40,7 +40,7 @@ typedef struct DecState{
+ YuvBuf outbuf;
+ mblk_t *yuv_msg;
+ struct SwsContext *sws_ctx;
+- enum PixelFormat output_pix_fmt;
++ enum AVPixelFormat output_pix_fmt;
+ uint8_t dci[512];
+ int dci_size;
+ uint64_t last_error_reported_time;
+@@ -58,7 +58,7 @@ static void dec_init(MSFilter *f, enum C
+ s->codec=cid;
+ s->input=NULL;
+ s->yuv_msg=NULL;
+- s->output_pix_fmt=PIX_FMT_YUV420P;
++ s->output_pix_fmt=AV_PIX_FMT_YUV420P;
+ s->snow_initialized=FALSE;
+ s->outbuf.w=0;
+ s->outbuf.h=0;
+@@ -77,19 +77,19 @@ static void dec_init(MSFilter *f, enum C
+ }
+
+ static void dec_h263_init(MSFilter *f){
+- dec_init(f,CODEC_ID_H263);
++ dec_init(f,AV_CODEC_ID_H263);
+ }
+
+ static void dec_mpeg4_init(MSFilter *f){
+- dec_init(f,CODEC_ID_MPEG4);
++ dec_init(f,AV_CODEC_ID_MPEG4);
+ }
+
+ static void dec_mjpeg_init(MSFilter *f){
+- dec_init(f,CODEC_ID_MJPEG);
++ dec_init(f,AV_CODEC_ID_MJPEG);
+ }
+
+ static void dec_snow_init(MSFilter *f){
+- dec_init(f,CODEC_ID_SNOW);
++ dec_init(f,AV_CODEC_ID_SNOW);
+ }
+
+ static void dec_uninit(MSFilter *f){
+@@ -134,10 +134,10 @@ static void dec_preprocess(MSFilter *f){
+ s->first_image_decoded = FALSE;
+ if (s->av_context.codec==NULL){
+ /* we must know picture size before initializing snow decoder*/
+- if (s->codec!=CODEC_ID_SNOW){
++ if (s->codec!=AV_CODEC_ID_SNOW){
+ error=avcodec_open2(&s->av_context, s->av_codec,NULL);
+ if (error!=0) ms_error("avcodec_open2() failed: %i",error);
+- if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){
++ if (s->codec==AV_CODEC_ID_MPEG4 && s->dci_size>0){
+ s->av_context.extradata=s->dci;
+ s->av_context.extradata_size=s->dci_size;
+ }
+@@ -643,8 +643,8 @@ static void dec_process_frame(MSFilter *
+
+ if (f->desc->id==MS_H263_DEC_ID) inm=skip_rfc2429_header(inm);
+ else if (f->desc->id==MS_H263_OLD_DEC_ID) inm=skip_rfc2190_header(inm);
+- else if (s->codec==CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm);
+- else if (s->codec==CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm);
++ else if (s->codec==AV_CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm);
++ else if (s->codec==AV_CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm);
+
+ if (inm){
+ /* accumulate the video packet until we have the rtp markbit*/
+Index: mediastreamer-2.9.0/src/videofilters/videoenc.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/videofilters/videoenc.c
++++ mediastreamer-2.9.0/src/videofilters/videoenc.c
+@@ -223,19 +223,19 @@ static void enc_init(MSFilter *f, enum C
+ }
+
+ static void enc_h263_init(MSFilter *f){
+- enc_init(f,CODEC_ID_H263P);
++ enc_init(f,AV_CODEC_ID_H263P);
+ }
+
+ static void enc_mpeg4_init(MSFilter *f){
+- enc_init(f,CODEC_ID_MPEG4);
++ enc_init(f,AV_CODEC_ID_MPEG4);
+ }
+
+ static void enc_snow_init(MSFilter *f){
+- enc_init(f,CODEC_ID_SNOW);
++ enc_init(f,AV_CODEC_ID_SNOW);
+ }
+
+ static void enc_mjpeg_init(MSFilter *f){
+- enc_init(f,CODEC_ID_MJPEG);
++ enc_init(f,AV_CODEC_ID_MJPEG);
+ }
+
+ static void prepare(EncState *s){
+@@ -243,7 +243,7 @@ static void prepare(EncState *s){
+ const int max_br_vbv=128000;
+
+ avcodec_get_context_defaults3(c, NULL);
+- if (s->codec==CODEC_ID_MJPEG)
++ if (s->codec==AV_CODEC_ID_MJPEG)
+ {
+ ms_message("Codec bitrate set to %i",c->bit_rate);
+ c->width = s->vsize.width;
+@@ -251,7 +251,7 @@ static void prepare(EncState *s){
+ c->time_base.num = 1;
+ c->time_base.den = (int)s->fps;
+ c->gop_size=(int)s->fps*5; /*emit I frame every 5 seconds*/
+- c->pix_fmt=PIX_FMT_YUVJ420P;
++ c->pix_fmt=AV_PIX_FMT_YUVJ420P;
+ s->comp_buf=allocb(c->bit_rate*2,0);
+ return;
+ }
+@@ -269,7 +269,7 @@ static void prepare(EncState *s){
+
+ /* ffmpeg vbv rate control consumes too much cpu above a certain target bitrate.
+ We don't use it above max_br_vbv */
+- if (s->codec!=CODEC_ID_SNOW && s->maxbr<max_br_vbv){
++ if (s->codec!=AV_CODEC_ID_SNOW && s->maxbr<max_br_vbv){
+ /*snow does not like 1st pass rate control*/
+ c->rc_max_rate=c->bit_rate;
+ c->rc_min_rate=0;
+@@ -285,9 +285,9 @@ static void prepare(EncState *s){
+ c->time_base.num = 1;
+ c->time_base.den = (int)s->fps;
+ c->gop_size=(int)s->fps*10; /*emit I frame every 10 seconds*/
+- c->pix_fmt=PIX_FMT_YUV420P;
++ c->pix_fmt=AV_PIX_FMT_YUV420P;
+ s->comp_buf=allocb(c->bit_rate*2,0);
+- if (s->codec==CODEC_ID_SNOW){
++ if (s->codec==AV_CODEC_ID_SNOW){
+ c->strict_std_compliance=-2;
+ }
+
+@@ -304,7 +304,7 @@ static void prepare_h263(EncState *s){
+ #endif
+ c->rtp_payload_size = s->mtu/2;
+ if (s->profile==0){
+- s->codec=CODEC_ID_H263;
++ s->codec=AV_CODEC_ID_H263;
+ }else{
+ /*
+ c->flags|=CODEC_FLAG_H263P_UMV;
+@@ -313,7 +313,7 @@ static void prepare_h263(EncState *s){
+ c->flags|=CODEC_FLAG_OBMC;
+ c->flags|=CODEC_FLAG_AC_PRED;
+ */
+- s->codec=CODEC_ID_H263P;
++ s->codec=AV_CODEC_ID_H263P;
+ }
+ }
+
+@@ -331,13 +331,13 @@ static void enc_preprocess(MSFilter *f){
+ EncState *s=(EncState*)f->data;
+ int error;
+ prepare(s);
+- if (s->codec==CODEC_ID_H263P || s->codec==CODEC_ID_H263)
++ if (s->codec==AV_CODEC_ID_H263P || s->codec==AV_CODEC_ID_H263)
+ prepare_h263(s);
+- else if (s->codec==CODEC_ID_MPEG4)
++ else if (s->codec==AV_CODEC_ID_MPEG4)
+ prepare_mpeg4(s);
+- else if (s->codec==CODEC_ID_SNOW){
++ else if (s->codec==AV_CODEC_ID_SNOW){
+ /**/
+- }else if (s->codec==CODEC_ID_MJPEG){
++ }else if (s->codec==AV_CODEC_ID_MJPEG){
+ /**/
+ }else {
+ ms_error("Unsupported codec id %i",s->codec);
+@@ -724,12 +724,12 @@ static void split_and_send(MSFilter *f,
+ uint8_t *psc;
+ uint32_t timestamp=f->ticker->time*90LL;
+
+- if (s->codec==CODEC_ID_MPEG4 || s->codec==CODEC_ID_SNOW)
++ if (s->codec==AV_CODEC_ID_MPEG4 || s->codec==AV_CODEC_ID_SNOW)
+ {
+ mpeg4_fragment_and_send(f,s,frame,timestamp);
+ return;
+ }
+- else if (s->codec==CODEC_ID_MJPEG)
++ else if (s->codec==AV_CODEC_ID_MJPEG)
+ {
+ mblk_t *lqt=NULL;
+ mblk_t *cqt=NULL;
+@@ -765,7 +765,7 @@ static void split_and_send(MSFilter *f,
+
+ static void process_frame(MSFilter *f, mblk_t *inm){
+ EncState *s=(EncState*)f->data;
+- AVFrame pict;
++ AVFrame pict = {};
+ AVCodecContext *c=&s->av_context;
+ int error;
+ mblk_t *comp_buf=s->comp_buf;
+@@ -774,7 +774,7 @@ static void process_frame(MSFilter *f, m
+
+ ms_yuv_buf_init_from_mblk(&yuv, inm);
+ /* convert image if necessary */
+- avcodec_get_frame_defaults(&pict);
++ av_frame_unref(&pict);
+ avpicture_fill((AVPicture*)&pict,yuv.planes[0],c->pix_fmt,c->width,c->height);
+
+ /* timestamp used by ffmpeg, unset here */
+@@ -789,7 +789,7 @@ static void process_frame(MSFilter *f, m
+ s->req_vfu=FALSE;
+ }
+ comp_buf->b_rptr=comp_buf->b_wptr=comp_buf->b_datap->db_base;
+- if (s->codec==CODEC_ID_SNOW){
++ if (s->codec==AV_CODEC_ID_SNOW){
+ //prepend picture size
+ uint32_t header=((s->vsize.width&0xffff)<<16) | (s->vsize.height&0xffff);
+ *(uint32_t*)comp_buf->b_wptr=htonl(header);
+@@ -797,10 +797,15 @@ static void process_frame(MSFilter *f, m
+ comp_buf_sz-=4;
+ }
+
+- error=avcodec_encode_video(c, (uint8_t*)comp_buf->b_wptr,comp_buf_sz, &pict);
++ AVPacket pkt;
++ av_init_packet(&pkt);
++ pkt.data = (uint8_t*)comp_buf->b_wptr;
++ pkt.size = comp_buf_sz;
++ int got_packet;
++ error=avcodec_encode_video2(c, &pkt, &pict, &got_packet);
+
+ if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error);
+- else{
++ else if(got_packet){
+ s->framenum++;
+ if (s->framenum==1){
+ video_starter_first_frame (&s->starter,f->ticker->time);
+@@ -808,7 +813,7 @@ static void process_frame(MSFilter *f, m
+ if (c->coded_frame->pict_type==FF_I_TYPE){
+ ms_message("Emitting I-frame");
+ }
+- comp_buf->b_wptr+=error;
++ comp_buf->b_wptr+=pkt.size;
+ split_and_send(f,s,comp_buf);
+ }
+ freemsg(inm);
+@@ -837,7 +842,7 @@ static int enc_get_br(MSFilter *f, void
+
+ static int enc_set_br(MSFilter *f, void *arg){
+ EncState *s=(EncState*)f->data;
+- bool_t snow=s->codec==CODEC_ID_SNOW;
++ bool_t snow=s->codec==AV_CODEC_ID_SNOW;
+ s->maxbr=*(int*)arg;
+ if (s->av_context.codec!=NULL){
+ /*when we are processing, apply new settings immediately*/
+@@ -847,11 +852,11 @@ static int enc_set_br(MSFilter *f, void
+ ms_filter_unlock(f);
+ return 0;
+ }
+- if (s->maxbr>=1024000 && s->codec!=CODEC_ID_H263P){
++ if (s->maxbr>=1024000 && s->codec!=AV_CODEC_ID_H263P){
+ s->vsize.width = MS_VIDEO_SIZE_SVGA_W;
+ s->vsize.height = MS_VIDEO_SIZE_SVGA_H;
+ s->fps=25;
+- }else if (s->maxbr>=800000 && s->codec!=CODEC_ID_H263P){
++ }else if (s->maxbr>=800000 && s->codec!=AV_CODEC_ID_H263P){
+ s->vsize.width = MS_VIDEO_SIZE_VGA_W;
+ s->vsize.height = MS_VIDEO_SIZE_VGA_H;
+ s->fps=25;
+@@ -864,7 +869,7 @@ static int enc_set_br(MSFilter *f, void
+ s->vsize.height=MS_VIDEO_SIZE_CIF_H;
+ s->fps=17;
+ s->qmin=3;
+- }else if (s->maxbr>=170000 && s->codec!=CODEC_ID_H263P && s->codec!=CODEC_ID_H263){
++ }else if (s->maxbr>=170000 && s->codec!=AV_CODEC_ID_H263P && s->codec!=AV_CODEC_ID_H263){
+ s->vsize.width=MS_VIDEO_SIZE_QVGA_W;
+ s->vsize.height=MS_VIDEO_SIZE_QVGA_H;
+ s->fps=15;
+@@ -1075,15 +1080,15 @@ MSFilterDesc ms_mjpeg_enc_desc={
+
+ void __register_ffmpeg_encoders_if_possible(void){
+ ms_ffmpeg_check_init();
+- if (avcodec_find_encoder(CODEC_ID_MPEG4))
++ if (avcodec_find_encoder(AV_CODEC_ID_MPEG4))
+ ms_filter_register(&ms_mpeg4_enc_desc);
+- if (avcodec_find_encoder(CODEC_ID_H263)){
++ if (avcodec_find_encoder(AV_CODEC_ID_H263)){
+ ms_filter_register(&ms_h263_enc_desc);
+ ms_filter_register(&ms_h263_old_enc_desc);
+ }
+- if (avcodec_find_encoder(CODEC_ID_SNOW))
++ if (avcodec_find_encoder(AV_CODEC_ID_SNOW))
+ ms_filter_register(&ms_snow_enc_desc);
+- if (avcodec_find_encoder(CODEC_ID_MJPEG))
++ if (avcodec_find_encoder(AV_CODEC_ID_MJPEG))
+ {
+ ms_filter_register(&ms_mjpeg_enc_desc);
+ }
+Index: mediastreamer-2.9.0/src/voip/msvideo.c
+===================================================================
+--- mediastreamer-2.9.0.orig/src/voip/msvideo.c
++++ mediastreamer-2.9.0/src/voip/msvideo.c
+@@ -351,21 +351,21 @@ void ms_rgb_to_yuv(const uint8_t rgb[3],
+ int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt){
+ switch(fmt){
+ case MS_RGBA32:
+- return PIX_FMT_RGBA;
++ return AV_PIX_FMT_RGBA;
+ case MS_RGB24:
+- return PIX_FMT_RGB24;
++ return AV_PIX_FMT_RGB24;
+ case MS_RGB24_REV:
+- return PIX_FMT_BGR24;
++ return AV_PIX_FMT_BGR24;
+ case MS_YUV420P:
+- return PIX_FMT_YUV420P;
++ return AV_PIX_FMT_YUV420P;
+ case MS_YUYV:
+- return PIX_FMT_YUYV422;
++ return AV_PIX_FMT_YUYV422;
+ case MS_UYVY:
+- return PIX_FMT_UYVY422;
++ return AV_PIX_FMT_UYVY422;
+ case MS_YUY2:
+- return PIX_FMT_YUYV422; /* <- same as MS_YUYV */
++ return AV_PIX_FMT_YUYV422; /* <- same as MS_YUYV */
+ case MS_RGB565:
+- return PIX_FMT_RGB565;
++ return AV_PIX_FMT_RGB565;
+ default:
+ ms_fatal("format not supported.");
+ return -1;
+@@ -375,19 +375,19 @@ int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt){
+
+ MSPixFmt ffmpeg_pix_fmt_to_ms(int fmt){
+ switch(fmt){
+- case PIX_FMT_RGB24:
++ case AV_PIX_FMT_RGB24:
+ return MS_RGB24;
+- case PIX_FMT_BGR24:
++ case AV_PIX_FMT_BGR24:
+ return MS_RGB24_REV;
+- case PIX_FMT_YUV420P:
++ case AV_PIX_FMT_YUV420P:
+ return MS_YUV420P;
+- case PIX_FMT_YUYV422:
++ case AV_PIX_FMT_YUYV422:
+ return MS_YUYV; /* same as MS_YUY2 */
+- case PIX_FMT_UYVY422:
++ case AV_PIX_FMT_UYVY422:
+ return MS_UYVY;
+- case PIX_FMT_RGBA:
++ case AV_PIX_FMT_RGBA:
+ return MS_RGBA32;
+- case PIX_FMT_RGB565:
++ case AV_PIX_FMT_RGB565:
+ return MS_RGB565;
+ default:
+ ms_fatal("format not supported.");
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-libav9.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-libav9.patch
new file mode 100644
index 000000000000..078f360b3382
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-libav9.patch
@@ -0,0 +1,120 @@
+diff --git a/src/videofilters/h264dec.c b/src/videofilters/h264dec.c
+index 38881c1..f306723 100644
+--- a/src/videofilters/h264dec.c
++++ b/src/videofilters/h264dec.c
+@@ -58,10 +58,10 @@ static void dec_open(DecData *d){
+ int error;
+ codec=avcodec_find_decoder(CODEC_ID_H264);
+ if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
+- avcodec_get_context_defaults(&d->av_context);
+- error=avcodec_open(&d->av_context,codec);
++ avcodec_get_context_defaults3(&d->av_context, NULL);
++ error=avcodec_open2(&d->av_context,codec, NULL);
+ if (error!=0){
+- ms_fatal("avcodec_open() failed.");
++ ms_fatal("avcodec_open2() failed.");
+ }
+ }
+
+diff --git a/src/videofilters/jpegwriter.c b/src/videofilters/jpegwriter.c
+index 891f618..96f5d7f 100644
+--- a/src/videofilters/jpegwriter.c
++++ b/src/videofilters/jpegwriter.c
+@@ -90,7 +90,7 @@ static void jpg_process(MSFilter *f){
+ mblk_t *jpegm;
+ struct SwsContext *sws_ctx;
+
+- AVCodecContext *avctx=avcodec_alloc_context();
++ AVCodecContext *avctx=avcodec_alloc_context3(NULL);
+
+ avctx->width=yuvbuf.w;
+ avctx->height=yuvbuf.h;
+@@ -98,9 +98,9 @@ static void jpg_process(MSFilter *f){
+ avctx->time_base.den =1;
+ avctx->pix_fmt=PIX_FMT_YUVJ420P;
+
+- error=avcodec_open(avctx,s->codec);
++ error=avcodec_open2(avctx,s->codec,NULL);
+ if (error!=0) {
+- ms_error("avcodec_open() failed: %i",error);
++ ms_error("avcodec_open2() failed: %i",error);
+ cleanup(s,NULL);
+ av_free(avctx);
+ return;
+diff --git a/src/videofilters/nowebcam.c b/src/videofilters/nowebcam.c
+index 60e3853..329c453 100644
+--- a/src/videofilters/nowebcam.c
++++ b/src/videofilters/nowebcam.c
+@@ -68,9 +68,9 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf, int bufsize, MSVideoSize *reqsize){
+ return NULL;
+ }
+
+- avcodec_get_context_defaults(&av_context);
+- if (avcodec_open(&av_context,codec)<0){
+- ms_error("jpeg2yuv: avcodec_open failed");
++ avcodec_get_context_defaults3(&av_context, NULL);
++ if (avcodec_open2(&av_context,codec,NULL)<0){
++ ms_error("jpeg2yuv: avcodec_open2 failed");
+ return NULL;
+ }
+ av_init_packet(&pkt);
+diff --git a/src/videofilters/videodec.c b/src/videofilters/videodec.c
+index 494debf..c52e207 100644
+--- a/src/videofilters/videodec.c
++++ b/src/videofilters/videodec.c
+@@ -53,7 +53,7 @@ static void dec_init(MSFilter *f, enum CodecID cid){
+ DecState *s=(DecState *)ms_new0(DecState,1);
+ ms_ffmpeg_check_init();
+
+- avcodec_get_context_defaults(&s->av_context);
++ avcodec_get_context_defaults3(&s->av_context, NULL);
+ s->av_codec=NULL;
+ s->codec=cid;
+ s->input=NULL;
+@@ -135,8 +135,8 @@ static void dec_preprocess(MSFilter *f){
+ if (s->av_context.codec==NULL){
+ /* we must know picture size before initializing snow decoder*/
+ if (s->codec!=CODEC_ID_SNOW){
+- error=avcodec_open(&s->av_context, s->av_codec);
+- if (error!=0) ms_error("avcodec_open() failed: %i",error);
++ error=avcodec_open2(&s->av_context, s->av_codec,NULL);
++ if (error!=0) ms_error("avcodec_open2() failed: %i",error);
+ if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){
+ s->av_context.extradata=s->dci;
+ s->av_context.extradata_size=s->dci_size;
+@@ -225,8 +225,8 @@ static mblk_t * parse_snow_header(DecState *s,mblk_t *inm){
+ int error;
+ s->av_context.width=h>>16;
+ s->av_context.height=h&0xffff;
+- error=avcodec_open(&s->av_context, s->av_codec);
+- if (error!=0) ms_error("avcodec_open() failed for snow: %i",error);
++ error=avcodec_open2(&s->av_context, s->av_codec, NULL);
++ if (error!=0) ms_error("avcodec_open2() failed for snow: %i",error);
+ else {
+ s->snow_initialized=TRUE;
+ ms_message("Snow decoder initialized,size=%ix%i",
+diff --git a/src/videofilters/videoenc.c b/src/videofilters/videoenc.c
+index da35592..09dcc9d 100644
+--- a/src/videofilters/videoenc.c
++++ b/src/videofilters/videoenc.c
+@@ -242,7 +242,7 @@ static void prepare(EncState *s){
+ AVCodecContext *c=&s->av_context;
+ const int max_br_vbv=128000;
+
+- avcodec_get_context_defaults(c);
++ avcodec_get_context_defaults3(c, NULL);
+ if (s->codec==CODEC_ID_MJPEG)
+ {
+ ms_message("Codec bitrate set to %i",c->bit_rate);
+@@ -348,9 +348,9 @@ static void enc_preprocess(MSFilter *f){
+ ms_error("could not find encoder for codec id %i",s->codec);
+ return;
+ }
+- error=avcodec_open(&s->av_context, s->av_codec);
++ error=avcodec_open2(&s->av_context, s->av_codec, NULL);
+ if (error!=0) {
+- ms_error("avcodec_open() failed: %i",error);
++ ms_error("avcodec_open2() failed: %i",error);
+ return;
+ }
+ video_starter_init(&s->starter);
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-tests.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-tests.patch
new file mode 100644
index 000000000000..3bcb8bd36618
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-tests.patch
@@ -0,0 +1,26 @@
+From d9f448013bd5ea92ce42c99ef3338932ec694b62 Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@gentoo.org>
+Date: Wed, 9 Oct 2013 21:18:28 +0200
+Subject: [PATCH] fix tests
+
+---
+ configure.ac | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 4b923a9..4aec221 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -873,6 +873,9 @@ case "$target_os" in
+ #hack for macport
+ CUNIT_LIBS+=" -lncurses"
+ ;;
++ *linux*)
++ CUNIT_LIBS+=" -lncurses"
++ ;;
+ *mingw*)
+ CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0501"
+ LIBS="$LIBS -lws2_32 -liphlpapi"
+--
+1.8.3.2
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-underlinking.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-underlinking.patch
new file mode 100644
index 000000000000..19d6af803c2c
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-underlinking.patch
@@ -0,0 +1,57 @@
+From 497ad9c27385c02f4f038b6e787ada9c7b6f8373 Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@gentoo.org>
+Date: Wed, 9 Oct 2013 18:24:28 +0200
+Subject: [PATCH] fix underlinking
+
+---
+ configure.ac | 20 ++++++++++++++++++++
+ src/Makefile.am | 2 +-
+ 2 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9f402bd..4b923a9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -893,6 +893,26 @@ fi
+
+ AM_CONDITIONAL(BUILD_TESTS,test x$found_cunit = xyes)
+
++dnl Check for clock_gettime, in libc for FreeBSD, in rt for linux,
++dnl in rt for Solaris 7, in posix4 for Solaris 2.5.1
++LIB_CLOCK_GETTIME=
++clk_saved_libs=$LIBS
++AC_SEARCH_LIBS([clock_gettime], [rt posix4],
++ [test "$ac_cv_search_clock_gettime" = "none required" ||
++ LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
++AC_SUBST([LIB_CLOCK_GETTIME])
++
++AC_MSG_CHECKING([for working clock_gettime])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
++ [[clock_gettime(CLOCK_REALTIME, 0);]])], [gnupg_cv_clock_gettime=yes], [gnupg_cv_clock_gettime=no])
++AC_MSG_RESULT($gnupg_cv_clock_gettime)
++
++if test x"$gnupg_cv_clock_gettime" = xyes; then
++ AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
++ [Define to 1 if you have the `clock_gettime' function.])
++fi
++LIBS=$clk_saved_libs
++
+
+ dnl ##################################################
+ dnl # Check for doxygen
+diff --git a/src/Makefile.am b/src/Makefile.am
+index a315e92..a5e144c 100755
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -266,7 +266,7 @@ voipdescs.h: Makefile $(libmediastreamer_voip_la_SOURCES)
+ awk 'BEGIN { print("MSFilterDesc * ms_voip_filter_descs[]={") } { printf("&%s,\n",$$1) } END{ print("NULL\n};\n") } ' $$builddir/voipdescs.txt >> $$builddir/$@
+
+
+-libmediastreamer_base_la_LIBADD= $(ORTP_LIBS)
++libmediastreamer_base_la_LIBADD= $(ORTP_LIBS) @LIB_CLOCK_GETTIME@
+ libmediastreamer_base_la_LDFLAGS= -no-undefined -version-info $(LIBMEDIASTREAMER_SO_VERSION)
+
+ if !BUILD_WIN32
+--
+1.8.3.2
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-v4l-automagic.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-v4l-automagic.patch
new file mode 100644
index 000000000000..c590aef3b713
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-v4l-automagic.patch
@@ -0,0 +1,55 @@
+From b99ddff6f322c8b466f3cdfd71b0d629cea33aac Mon Sep 17 00:00:00 2001
+From: hasufell <hasufell@gentoo.org>
+Date: Wed, 9 Oct 2013 18:12:46 +0200
+Subject: [PATCH] Support disabling V4L support completely
+
+---
+ configure.ac | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 94b6f18..9f402bd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -746,6 +746,16 @@ PACKAGE_DATA_DIR="$prefix/share"
+ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data])
+ AC_SUBST(PACKAGE_DATA_DIR)
+
++AC_ARG_ENABLE(v4l,
++ [ --disable-v4l Disable usage of v4l],
++ [case "${enableval}" in
++ yes) v4l=yes ;;
++ no) v4l=no ;;
++ *) AC_MSG_ERROR(bad value ${enableval} for --disable-v4l) ;;
++ esac],[v4l=yes])
++
++if test "$v4l" = "yes" ; then
++
+ dnl check for video4linux headers
+ AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
+ if test "${ac_cv_header_linux_videodev_h}" = "yes" ; then
+@@ -759,9 +769,6 @@ else
+ found_v4l2=no
+ fi
+
+-AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
+-AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
+-
+ AC_ARG_ENABLE(libv4l1,
+ [AS_HELP_STRING([--disable-libv4l1], [Disable usage of libv4l1, really discouraged])],
+ [case "${enableval}" in
+@@ -805,6 +812,11 @@ this check.
+ fi
+ fi
+
++fi
++
++AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
++AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
++
+
+ AC_PATH_PROG(PCAP,pcap-config,false)
+ AM_CONDITIONAL(HAVE_PCAP, test $PCAP != false)
+--
+1.8.3.2
+
diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-xxd.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-xxd.patch
new file mode 100644
index 000000000000..2337e1343002
--- /dev/null
+++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-xxd.patch
@@ -0,0 +1,18 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Fri Oct 11 11:37:19 UTC 2013
+Subject: avoid dependency on vim-core
+
+--- mediastreamer-2.9.0/src/Makefile.am
++++ mediastreamer-2.9.0/src/Makefile.am
+@@ -385,9 +385,9 @@
+ yuv2rgb.fs.h: yuv2rgb.fs
+ builddir=`pwd` && \
+ cd $(top_srcdir)/src && \
+- xxd -i yuv2rgb.fs | sed s/}\;/,0x00}\;/ > $$builddir/yuv2rgb.fs.h
++ xxdi.pl yuv2rgb.fs | sed s/}\;/0x00}\;/ > $$builddir/yuv2rgb.fs.h
+
+ yuv2rgb.vs.h: yuv2rgb.vs
+ builddir=`pwd` && \
+ cd $(top_srcdir)/src && \
+- xxd -i yuv2rgb.vs | sed s/}\;/,0x00}\;/ > $$builddir/yuv2rgb.vs.h
++ xxdi.pl yuv2rgb.vs | sed s/}\;/0x00}\;/ > $$builddir/yuv2rgb.vs.h
diff --git a/media-libs/mediastreamer/mediastreamer-2.7.3-r3.ebuild b/media-libs/mediastreamer/mediastreamer-2.7.3-r3.ebuild
new file mode 100644
index 000000000000..24f960f98802
--- /dev/null
+++ b/media-libs/mediastreamer/mediastreamer-2.7.3-r3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils autotools multilib
+
+DESCRIPTION="Mediastreaming library for telephony application"
+HOMEPAGE="http://www.linphone.org/"
+SRC_URI="mirror://nongnu/linphone/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86 ~x64-macos ~x86-macos"
+# Many cameras will not work or will crash an application if mediastreamer2 is
+# not built with v4l2 support (taken from configure.ac)
+# TODO: run-time test for ipv6: does it really need ortp[ipv6] ?
+IUSE="+alsa amr bindist coreaudio debug examples gsm ilbc ipv6 jack oss portaudio
+pulseaudio sdl +speex static-libs theora v4l video x264 X"
+REQUIRED_USE="|| ( oss alsa jack portaudio coreaudio pulseaudio )
+ video? ( || ( sdl X ) )
+ theora? ( video )
+ X? ( video )
+ v4l? ( video )"
+
+RDEPEND=">=net-libs/ortp-0.16.2[ipv6?]
+ alsa? ( media-libs/alsa-lib )
+ gsm? ( media-sound/gsm )
+ jack? ( >=media-libs/libsamplerate-0.0.13
+ media-sound/jack-audio-connection-kit )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( >=media-sound/pulseaudio-0.9.21 )
+ speex? ( >=media-libs/speex-1.2_beta3 )
+ video? (
+ virtual/ffmpeg
+ v4l? ( media-libs/libv4l
+ sys-kernel/linux-headers )
+ theora? ( media-libs/libtheora )
+ sdl? ( media-libs/libsdl[video,X] )
+ X? ( x11-libs/libX11
+ x11-libs/libXv ) )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-proto/videoproto"
+
+PDEPEND="amr? ( !bindist? ( media-plugins/mediastreamer-amr ) )
+ ilbc? ( media-plugins/mediastreamer-ilbc )
+ video? ( x264? ( media-plugins/mediastreamer-x264 ) )"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_prepare() {
+ # respect user's CFLAGS
+ sed -i -e "s:-O2::;s: -g::" configure.ac || die "patching configure.ac failed"
+
+ # change default paths
+ sed -i -e "s:\(\${prefix}/\)lib:\1$(get_libdir):" \
+ -e "s:\(prefix/share\):\1/${PN}:" configure.ac \
+ || die "patching configure.ac failed"
+
+ # fix html doc installation dir
+ sed -i -e "s:\$(pkgdocdir):\$(docdir):" help/Makefile.am \
+ || die "patching help/Makefile.am failed"
+ sed -i -e "s:\(doc_htmldir=\).*:\1\$(htmldir):" help/Makefile.am \
+ || die "patching help/Makefile.am failed"
+
+ epatch "${FILESDIR}/${PN}-2.7.3-v4l-automagic.patch"
+ epatch "${FILESDIR}/${P}-sdl-build.patch"
+ epatch "${FILESDIR}/${P}-videoenc_282.patch"
+ epatch "${FILESDIR}/${P}-ffmpeg-0.11.patch"
+
+ # linux/videodev.h dropped in 2.6.38
+ sed -i -e 's:msv4l.c::' src/Makefile.am || die
+ sed -i -e 's:linux/videodev.h ::' configure.ac || die
+ eautoreconf
+
+ # don't build examples in tests/
+ sed -i -e "s:\(SUBDIRS = .*\) tests \(.*\):\1 \2:" Makefile.in \
+ || die "patching Makefile.in failed"
+}
+
+src_configure() {
+ # Mac OS X Audio Queue is an audio recording facility, available on
+ # 10.5 (Leopard, Darwin9) and onward
+ local macaqsnd="--disable-macaqsnd"
+ if use coreaudio && [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -ge 9 ]];
+ then
+ macaqsnd="--enable-macaqsnd"
+ fi
+
+ # strict: don't want -Werror
+ # external-ortp: don't use bundled libs
+ # arts: arts is deprecated
+ econf \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --datadir="${EPREFIX}"/usr/share/${PN} \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-strict \
+ --enable-external-ortp \
+ --disable-artsc \
+ $(use_enable alsa) \
+ $(use_enable pulseaudio) \
+ $(use_enable coreaudio macsnd) ${macaqsnd} \
+ $(use_enable debug) \
+ $(use_enable gsm) \
+ $(use_enable ipv6) \
+ $(use_enable jack) \
+ $(use_enable oss) \
+ $(use_enable portaudio) \
+ $(use_enable speex) \
+ $(use_enable static-libs static) \
+ $(use_enable theora) \
+ $(use_enable video) \
+ $(use_enable v4l) \
+ $(use_enable v4l libv4l) \
+ $(use_enable sdl) \
+ $(use_enable X x11) \
+ $(use_enable X xv)
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -exec rm -f {} +
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins tests/*.c
+ fi
+}
diff --git a/media-libs/mediastreamer/mediastreamer-2.8.2.ebuild b/media-libs/mediastreamer/mediastreamer-2.8.2.ebuild
new file mode 100644
index 000000000000..2b029f159483
--- /dev/null
+++ b/media-libs/mediastreamer/mediastreamer-2.8.2.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools eutils multilib
+
+DESCRIPTION="Mediastreaming library for telephony application"
+HOMEPAGE="http://www.linphone.org/"
+SRC_URI="mirror://nongnu/linphone/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+# Many cameras will not work or will crash an application if mediastreamer2 is
+# not built with v4l2 support (taken from configure.ac)
+# TODO: run-time test for ipv6: does it really need ortp[ipv6] ?
+IUSE="+alsa amr bindist coreaudio debug doc examples g726 g729 gsm ilbc
+ ipv6 oss portaudio pulseaudio sdl silk +speex static-libs theora v4l
+ video x264 X"
+
+REQUIRED_USE="|| ( oss alsa portaudio coreaudio pulseaudio )
+ video? ( || ( sdl X ) )
+ theora? ( video )
+ X? ( video )
+ v4l? ( video )"
+
+RDEPEND=">=net-libs/ortp-0.17[ipv6?]
+ alsa? ( media-libs/alsa-lib )
+ g726? ( >=media-libs/spandsp-0.0.6_pre1 )
+ gsm? ( media-sound/gsm )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( >=media-sound/pulseaudio-0.9.21 )
+ speex? ( >=media-libs/speex-1.2_beta3 )
+ video? (
+ virtual/ffmpeg
+ v4l? ( media-libs/libv4l
+ sys-kernel/linux-headers )
+ theora? ( media-libs/libtheora )
+ sdl? ( media-libs/libsdl[video,X] )
+ X? ( x11-libs/libX11
+ x11-libs/libXv ) )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ virtual/pkgconfig
+ x11-proto/videoproto
+ doc? ( app-doc/doxygen )"
+
+PDEPEND="amr? ( !bindist? ( media-plugins/mediastreamer-amr ) )
+ g729? ( !bindist? ( media-plugins/mediastreamer-bcg729 ) )
+ ilbc? ( media-plugins/mediastreamer-ilbc )
+ video? ( x264? ( media-plugins/mediastreamer-x264 ) )
+ silk? ( !bindist? ( media-plugins/mediastreamer-silk ) )"
+
+src_prepare() {
+ # respect user's CFLAGS
+ sed -i -e "s:-O2::;s: -g::" configure.ac || die "patching configure.ac failed"
+
+ # change default paths
+ sed -i -e "s:\(\${prefix}/\)lib:\1$(get_libdir):" \
+ -e "s:\(prefix/share\):\1/${PN}:" configure.ac \
+ || die "patching configure.ac failed"
+
+ # fix html doc installation dir
+ sed -i -e "s:\$(pkgdocdir):\$(docdir):" help/Makefile.am \
+ || die "patching help/Makefile.am failed"
+ sed -i -e "s:\(doc_htmldir=\).*:\1\$(htmldir):" help/Makefile.am \
+ || die "patching help/Makefile.am failed"
+
+ epatch "${FILESDIR}/${P}-v4l-automagic.patch" \
+ "${FILESDIR}/${P}-autopoint.patch" \
+ "${FILESDIR}/${P}-ffmpeg-1.0.patch" \
+ "${FILESDIR}/${P}-libav9.patch"
+
+ # linux/videodev.h dropped in 2.6.38
+ sed -i -e 's:linux/videodev.h ::' configure.ac || die
+
+ # don't build examples in tests/
+ sed -i -e "/SUBDIRS/s/ tests//" Makefile.in || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ --datadir="${EPREFIX}"/usr/share/${PN}
+ # arts is deprecated
+ --disable-artsc
+ # don't want -Werror
+ --disable-strict
+ --disable-libv4l1
+ # don't use bundled libs
+ --enable-external-ortp
+ $(use_enable alsa)
+ $(use_enable pulseaudio)
+ $(use_enable coreaudio macsnd)
+ $(use_enable debug)
+ $(use_enable g726 spandsp )
+ $(use_enable gsm)
+ $(use_enable ipv6)
+ $(use_enable oss)
+ $(use_enable portaudio)
+ $(use_enable speex)
+ $(use_enable static-libs static)
+ $(use_enable theora)
+ $(use_enable video)
+ $(use_enable v4l)
+ $(use_enable v4l libv4l2)
+ $(use_enable sdl)
+ $(use_enable X x11)
+ $(use_enable X xv)
+
+ $(use doc || echo ac_cv_path_DOXYGEN=false)
+ )
+
+ # Mac OS X Audio Queue is an audio recording facility, available on
+ # 10.5 (Leopard, Darwin9) and onward
+ if use coreaudio && [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -ge 9 ]]
+ then
+ myeconfargs+=( --enable-macaqsnd )
+ else
+ myeconfargs+=( --disable-macaqsnd )
+ fi
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins tests/*.c
+ fi
+}
diff --git a/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild b/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild
new file mode 100644
index 000000000000..bf240cf613cc
--- /dev/null
+++ b/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils
+
+DESCRIPTION="Mediastreaming library for telephony application"
+HOMEPAGE="http://www.linphone.org/"
+SRC_URI="mirror://nongnu/linphone/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/3"
+KEYWORDS="amd64 ppc ppc64 x86"
+# Many cameras will not work or will crash an application if mediastreamer2 is
+# not built with v4l2 support (taken from configure.ac)
+# TODO: run-time test for ipv6: does it really need ortp[ipv6] ?
+IUSE="+alsa amr bindist coreaudio debug doc examples +filters g726 g729 gsm ilbc
+ ipv6 libav ntp-timestamp opengl opus +ortp oss pcap portaudio pulseaudio sdl
+ silk +speex static-libs test theora upnp v4l video x264 X"
+
+REQUIRED_USE="|| ( oss alsa portaudio coreaudio pulseaudio )
+ video? ( || ( opengl sdl X ) )
+ theora? ( video )
+ X? ( video )
+ v4l? ( video )
+ opengl? ( video )"
+
+RDEPEND="alsa? ( media-libs/alsa-lib )
+ g726? ( >=media-libs/spandsp-0.0.6_pre1 )
+ gsm? ( media-sound/gsm )
+ opus? ( media-libs/opus )
+ ortp? ( >=net-libs/ortp-0.21.0[ipv6?] )
+ pcap? ( sys-libs/libcap )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( >=media-sound/pulseaudio-0.9.21 )
+ speex? ( >=media-libs/speex-1.2_beta3 )
+ upnp? ( net-libs/libupnp )
+ video? (
+ libav? ( >=media-video/libav-9.12:0= )
+ !libav? ( >=media-video/ffmpeg-1.2.6-r1:0= )
+
+ opengl? ( media-libs/glew
+ virtual/opengl
+ x11-libs/libX11 )
+ v4l? ( media-libs/libv4l
+ sys-kernel/linux-headers )
+ theora? ( media-libs/libtheora )
+ sdl? ( media-libs/libsdl[video,X] )
+ X? ( x11-libs/libX11
+ x11-libs/libXv ) )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ opengl? ( dev-util/xxdi )
+ test? ( >=dev-util/cunit-2.1_p2[ncurses] )
+ X? ( x11-proto/videoproto )"
+
+PDEPEND="amr? ( !bindist? ( media-plugins/mediastreamer-amr ) )
+ g729? ( !bindist? ( media-plugins/mediastreamer-bcg729 ) )
+ ilbc? ( media-plugins/mediastreamer-ilbc )
+ video? ( x264? ( media-plugins/mediastreamer-x264 ) )
+ silk? ( !bindist? ( media-plugins/mediastreamer-silk ) )"
+
+src_prepare() {
+ # variable causes "command not found" warning and is not
+ # needed anyway
+ sed -i \
+ -e 's/$(ACLOCAL_MACOS_FLAGS)//' \
+ Makefile.am || die
+
+ # respect user's CFLAGS
+ sed -i \
+ -e "s:-O2::;s: -g::" \
+ configure.ac || die "patching configure.ac failed"
+
+ # change default paths
+ sed -i \
+ -e "s:\(prefix/share\):\1/${PN}:" \
+ configure.ac || die "patching configure.ac failed"
+
+ # fix doc installation dir
+ sed -i \
+ -e "s:\$(pkgdocdir):\$(docdir):" \
+ help/Makefile.am || die "patching help/Makefile.am failed"
+
+ # fix html installation dir
+ sed -i \
+ -e "s:\(doc_htmldir=\).*:\1\$(htmldir):" \
+ help/Makefile.am || die "patching help/Makefile.am failed"
+
+ # linux/videodev.h dropped in 2.6.38
+ sed -i \
+ -e 's:linux/videodev.h ::' \
+ configure.ac || die
+
+ epatch "${FILESDIR}/${P}-v4l-automagic.patch" \
+ "${FILESDIR}/${P}-libav9.patch" \
+ "${FILESDIR}/${P}-underlinking.patch" \
+ "${FILESDIR}/${P}-tests.patch" \
+ "${FILESDIR}/${P}-xxd.patch" \
+ "${FILESDIR}/${P}-ffmpeg3.patch"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ --datadir="${EPREFIX}"/usr/share/${PN}
+ # arts is deprecated
+ --disable-artsc
+ # don't want -Werror
+ --disable-strict
+ --disable-libv4l1
+ # don't use bundled libs
+ --enable-external-ortp
+ $(use_enable alsa)
+ $(use_enable pulseaudio)
+ $(use_enable coreaudio macsnd)
+ $(use_enable debug)
+ $(use_enable filters)
+ $(use_enable g726 spandsp)
+ $(use_enable gsm)
+ $(use_enable ipv6)
+ $(use_enable ntp-timestamp)
+ $(use_enable opengl glx)
+ $(use_enable opus)
+ $(use_enable ortp)
+ $(use_enable oss)
+ $(use_enable pcap)
+ $(use_enable portaudio)
+ $(use_enable speex)
+ $(use_enable static-libs static)
+ $(use_enable theora)
+ $(use_enable upnp)
+ $(use_enable video)
+ $(use_enable v4l)
+ $(use_enable v4l libv4l2)
+ $(use_enable sdl)
+ $(use_enable X x11)
+ $(use_enable X xv)
+
+ $(use doc || echo ac_cv_path_DOXYGEN=false)
+ )
+
+ # Mac OS X Audio Queue is an audio recording facility, available on
+ # 10.5 (Leopard, Darwin9) and onward
+ if use coreaudio && [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -ge 9 ]]
+ then
+ myeconfargs+=( --enable-macaqsnd )
+ else
+ myeconfargs+=( --disable-macaqsnd )
+ fi
+
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ default
+ cd tester || die
+ ./mediastreamer2_tester || die
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins tester/*.c
+ fi
+}
diff --git a/media-libs/mediastreamer/mediastreamer-2.9.0.ebuild b/media-libs/mediastreamer/mediastreamer-2.9.0.ebuild
new file mode 100644
index 000000000000..68ed29238df3
--- /dev/null
+++ b/media-libs/mediastreamer/mediastreamer-2.9.0.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils
+
+DESCRIPTION="Mediastreaming library for telephony application"
+HOMEPAGE="http://www.linphone.org/"
+SRC_URI="mirror://nongnu/linphone/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0/3"
+KEYWORDS="amd64 ppc ppc64 x86"
+# Many cameras will not work or will crash an application if mediastreamer2 is
+# not built with v4l2 support (taken from configure.ac)
+# TODO: run-time test for ipv6: does it really need ortp[ipv6] ?
+IUSE="+alsa amr bindist coreaudio debug doc examples +filters g726 g729 gsm ilbc
+ ipv6 ntp-timestamp opengl opus +ortp oss pcap portaudio pulseaudio sdl silk +speex
+ static-libs test theora upnp v4l video x264 X"
+
+REQUIRED_USE="|| ( oss alsa portaudio coreaudio pulseaudio )
+ video? ( || ( opengl sdl X ) )
+ theora? ( video )
+ X? ( video )
+ v4l? ( video )
+ opengl? ( video )"
+
+RDEPEND="alsa? ( media-libs/alsa-lib )
+ g726? ( >=media-libs/spandsp-0.0.6_pre1 )
+ gsm? ( media-sound/gsm )
+ opus? ( media-libs/opus )
+ ortp? ( >=net-libs/ortp-0.21.0[ipv6?] )
+ pcap? ( sys-libs/libcap )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( >=media-sound/pulseaudio-0.9.21 )
+ speex? ( >=media-libs/speex-1.2_beta3 )
+ upnp? ( net-libs/libupnp )
+ video? (
+ virtual/ffmpeg
+ opengl? ( media-libs/glew
+ virtual/opengl
+ x11-libs/libX11 )
+ v4l? ( media-libs/libv4l
+ sys-kernel/linux-headers )
+ theora? ( media-libs/libtheora )
+ sdl? ( media-libs/libsdl[video,X] )
+ X? ( x11-libs/libX11
+ x11-libs/libXv ) )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ opengl? ( dev-util/xxdi )
+ test? ( >=dev-util/cunit-2.1_p2[ncurses] )
+ X? ( x11-proto/videoproto )"
+
+PDEPEND="amr? ( !bindist? ( media-plugins/mediastreamer-amr ) )
+ g729? ( !bindist? ( media-plugins/mediastreamer-bcg729 ) )
+ ilbc? ( media-plugins/mediastreamer-ilbc )
+ video? ( x264? ( media-plugins/mediastreamer-x264 ) )
+ silk? ( !bindist? ( media-plugins/mediastreamer-silk ) )"
+
+src_prepare() {
+ # variable causes "command not found" warning and is not
+ # needed anyway
+ sed -i \
+ -e 's/$(ACLOCAL_MACOS_FLAGS)//' \
+ Makefile.am || die
+
+ # respect user's CFLAGS
+ sed -i \
+ -e "s:-O2::;s: -g::" \
+ configure.ac || die "patching configure.ac failed"
+
+ # change default paths
+ sed -i \
+ -e "s:\(prefix/share\):\1/${PN}:" \
+ configure.ac || die "patching configure.ac failed"
+
+ # fix doc installation dir
+ sed -i \
+ -e "s:\$(pkgdocdir):\$(docdir):" \
+ help/Makefile.am || die "patching help/Makefile.am failed"
+
+ # fix html installation dir
+ sed -i \
+ -e "s:\(doc_htmldir=\).*:\1\$(htmldir):" \
+ help/Makefile.am || die "patching help/Makefile.am failed"
+
+ # linux/videodev.h dropped in 2.6.38
+ sed -i \
+ -e 's:linux/videodev.h ::' \
+ configure.ac || die
+
+ epatch "${FILESDIR}/${P}-v4l-automagic.patch" \
+ "${FILESDIR}/${P}-libav9.patch" \
+ "${FILESDIR}/${P}-underlinking.patch" \
+ "${FILESDIR}/${P}-tests.patch" \
+ "${FILESDIR}/${P}-xxd.patch"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ --datadir="${EPREFIX}"/usr/share/${PN}
+ # arts is deprecated
+ --disable-artsc
+ # don't want -Werror
+ --disable-strict
+ --disable-libv4l1
+ # don't use bundled libs
+ --enable-external-ortp
+ $(use_enable alsa)
+ $(use_enable pulseaudio)
+ $(use_enable coreaudio macsnd)
+ $(use_enable debug)
+ $(use_enable filters)
+ $(use_enable g726 spandsp)
+ $(use_enable gsm)
+ $(use_enable ipv6)
+ $(use_enable ntp-timestamp)
+ $(use_enable opengl glx)
+ $(use_enable opus)
+ $(use_enable ortp)
+ $(use_enable oss)
+ $(use_enable pcap)
+ $(use_enable portaudio)
+ $(use_enable speex)
+ $(use_enable static-libs static)
+ $(use_enable theora)
+ $(use_enable upnp)
+ $(use_enable video)
+ $(use_enable v4l)
+ $(use_enable v4l libv4l2)
+ $(use_enable sdl)
+ $(use_enable X x11)
+ $(use_enable X xv)
+
+ $(use doc || echo ac_cv_path_DOXYGEN=false)
+ )
+
+ # Mac OS X Audio Queue is an audio recording facility, available on
+ # 10.5 (Leopard, Darwin9) and onward
+ if use coreaudio && [[ ${CHOST} == *-darwin* && ${CHOST##*-darwin} -ge 9 ]]
+ then
+ myeconfargs+=( --enable-macaqsnd )
+ else
+ myeconfargs+=( --disable-macaqsnd )
+ fi
+
+ econf "${myeconfargs[@]}"
+}
+
+src_test() {
+ default
+ cd tester || die
+ ./mediastreamer2_tester || die
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins tester/*.c
+ fi
+}
diff --git a/media-libs/mediastreamer/metadata.xml b/media-libs/mediastreamer/metadata.xml
new file mode 100644
index 000000000000..f49ee62249f2
--- /dev/null
+++ b/media-libs/mediastreamer/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+ </maintainer>
+ <use>
+ <flag name="amr">Use of AMR Narrow Band codec plugin</flag>
+ <flag name="filters">Enable compilation of filters</flag>
+ <flag name="g726">Support g726 codec</flag>
+ <flag name="g729">Use g726 codec plugin</flag>
+ <flag name="ilbc">Use of iLBC (RFC3951) codec plugin</flag>
+ <flag name="ntp-timestamp">Turn on NTP timestamping on received
+ packet</flag>
+ <flag name="opus">Enable opus codec support</flag>
+ <flag name="ortp">Enable usage of <pkg>net-libs/ortp</pkg></flag>
+ <flag name="pcap">Enable usage of <pkg>net-libs/libpcap</pkg></flag>
+ <flag name="silk">Use silk (skype protocol) codec plugin</flag>
+ <flag name="video">Enable video support</flag>
+ </use>
+</pkgmetadata>