From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- media-libs/libquicktime/Manifest | 9 + media-libs/libquicktime/files/CVE-2016-2399.patch | 25 ++ .../files/libquicktime-1.2.4+libav-9.patch | 12 + .../files/libquicktime-1.2.4-ffmpeg2.patch | 98 +++++++ .../files/libquicktime-1.2.4-ffmpeg29.patch | 287 +++++++++++++++++++++ .../libquicktime/libquicktime-1.2.4-r2.ebuild | 123 +++++++++ media-libs/libquicktime/metadata.xml | 13 + 7 files changed, 567 insertions(+) create mode 100644 media-libs/libquicktime/Manifest create mode 100644 media-libs/libquicktime/files/CVE-2016-2399.patch create mode 100644 media-libs/libquicktime/files/libquicktime-1.2.4+libav-9.patch create mode 100644 media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg2.patch create mode 100644 media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg29.patch create mode 100644 media-libs/libquicktime/libquicktime-1.2.4-r2.ebuild create mode 100644 media-libs/libquicktime/metadata.xml (limited to 'media-libs/libquicktime') diff --git a/media-libs/libquicktime/Manifest b/media-libs/libquicktime/Manifest new file mode 100644 index 000000000000..c7f86bd13ae6 --- /dev/null +++ b/media-libs/libquicktime/Manifest @@ -0,0 +1,9 @@ +AUX CVE-2016-2399.patch 801 SHA256 006c6be761075ca25217fe510e1ec7cfbb6262c3d758c1bd629719072ddb0935 SHA512 759fee13bc96db036063efcd8288c0e467ce811b597cf6c0ceed1c8927593963174f4f3324512db0e773e936a4b9fe5c8d8fc9e0f00b2ce59110661175986f9c WHIRLPOOL 17b0c541287dabc04d736e89dd6172409b4020b044fd0df69267c8126a3a881510f49c2a8d3e22efe13a7c981d0ec01fa613f74a29d331623a0f6b300a113ff8 +AUX libquicktime-1.2.4+libav-9.patch 464 SHA256 d2ae77357d52e522f56c12fb1409b6d27bd576582122d04177a7433b39538bb3 SHA512 691110dc18f6646e2e17f40c6a42911a6b8eaa8cea20b5595f20d218d51da11d11923a3001b7ad7c3ad6bd0d90e712b95ccee5526fa1bec176cd27813e4a775e WHIRLPOOL 5906f1cc37d305616579084e0e4338f08a41817e51dc66e3d044b0e9012253aef2674c9fb06df48d689dea8e7431f73a8d8c278af723982d7e873d8376f717d4 +AUX libquicktime-1.2.4-ffmpeg2.patch 4046 SHA256 2c7bb532ea8ac3b0e7a9a76ca6ad41127810529e7f7c2faac6f1e2f7c5c4bb93 SHA512 32ddf394aad4ed80e89ec72a534e0466268ab0061b991815e905b78eae55a7d935117b0915faf6f7f51bd7e2d9fbaa4b0e07bfcef1ef1e2f4a7e2061c489122d WHIRLPOOL c22a21bd245f51c457d68291bb86536f7b381fbf01f9ff5ad6e3f4b727938dde9cbe0bc0ba7eb4fbef71dbced2aa02121a097a9cdeb5bdd4c24dac699df48c08 +AUX libquicktime-1.2.4-ffmpeg29.patch 13436 SHA256 c3a8dfb6bfb69c2b54aeafe3306a8af1fff5a3a06fd05b28725d3ea7688ce2cd SHA512 2a7e06c03b0f64f02b923c1a0e7121f4e1ea735f19a6df8ce8daf18177ead132d1ae921c64f3770042db3bbf29f15a7fcceece835d475e052c4c3bb7139c9e2e WHIRLPOOL 5d49286623c4114dea667fa634ceff5c128a9f79933ba894ccdbf454903223b1375917651c56db206d5234ac3f9911e0db85b2f2d00556e5eafed25a028f695b +DIST libquicktime-1.2.4.tar.gz 1028626 SHA256 1c53359c33b31347b4d7b00d3611463fe5e942cae3ec0fefe0d2fd413fd47368 SHA512 6ab6cd62ae2361bb3ad73725e9e8baa2b03361bc23e9e34b24f90c0e2bec4337de950ed7f30a6a1d2e67ab33e8f0c43538369fd07e417f54b84583a3c331f8dd WHIRLPOOL 8eda1c75d86d728157f4e4c9e07555dd8dfa2a6ad5fc37d022142111993610d8350e54d586fe1c6627402f22ce42a9b9505a3ffb909f9bb530b9ea0f71b6b192 +EBUILD libquicktime-1.2.4-r2.ebuild 3792 SHA256 4b862b14488889fd43af2ad93ef1584e2bf8c90eed31b94d4f58297dbda2fe5d SHA512 047d41d3a2a40c2ba52748a84f50b7d3ab444daf4a253947ec84698013aa4d203846cd226000573daecce3d7f40590aaa578feff08e1736e85184682fe43e769 WHIRLPOOL e0d3fab00927bef8cdc110c45de64b8bc8cb41fbdf506b95c9ea3c2fe64c226995131f963d5fc12042bcaa2fa3518de5f5724cce11f46c45093c60d0f5055d11 +MISC ChangeLog 2948 SHA256 eac313909bdb517c79ecf49e2792fd7b7f47c89a2c9a167e09467f286436e445 SHA512 26d0329a3e2658c3b94d83bfe3f4bbfb146f83c82ec159307dc3674123238feac3be21f7ef34a7e86b337c13274009660f5502107489f3f9281602620893dfc4 WHIRLPOOL 613d19ea8acc929f524559148a6fc09450a5284947bd6e2a43fc72aaf941dd8beb3c93675fbfe13d8dd6604b86dbcac60000150be037ab8efa57125b041d611b +MISC ChangeLog-2015 30238 SHA256 610674037877fea9b860e033563e9a9d6112c916ffbc42ad6e80771296d5ae88 SHA512 23ecb87b9ff9bda0940adb55cc86de9ed8b1d2f8a9ba7747a653f52eaefcacc01002db5cc95c8411285b95f267e43818692b8a268ffdc7a84aee285b14fb04af WHIRLPOOL 652340781d5c70c1b4c6195e565b0a7d9ae05aab13584acf1da65b8a924dc77daf09f4e9ad8ba7d3ee30c64416ca4061d7023f8685d7112866246e97c0227e30 +MISC metadata.xml 506 SHA256 fce9a80a875f6573f7b442a525e1ac221ea7730ae4b2131c3a2b3910860d8fcb SHA512 80ee7f91a4fafe6a9f9380bab5236633672484dea9389ab5b391319fbcbe010607903b21c12c37211575f4e55251f1718c2000225226fd0a63183ac903817ce1 WHIRLPOOL ffaaf0670953cb328d5c33a60195c6122b8b2583de7a0c8a0af9c91ca07af600ff7625bcc0e5b312f48fe973672b318b3e9547a516e2aef9a331b8f6ee9c3612 diff --git a/media-libs/libquicktime/files/CVE-2016-2399.patch b/media-libs/libquicktime/files/CVE-2016-2399.patch new file mode 100644 index 000000000000..a1737c0dc0a9 --- /dev/null +++ b/media-libs/libquicktime/files/CVE-2016-2399.patch @@ -0,0 +1,25 @@ +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855099 +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-2399 + +diff --git a/src/util.c b/src/util.c +index d8dc3c3..9422fc5 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -340,9 +340,14 @@ int64_t quicktime_byte_position(quicktime_t *file) + + void quicktime_read_pascal(quicktime_t *file, char *data) + { +- char len = quicktime_read_char(file); +- quicktime_read_data(file, (uint8_t*)data, len); +- data[(int)len] = 0; ++ int len = quicktime_read_char(file); ++ if ((len > 0) && (len < 256)) { ++ /* data[] is expected to be 256 bytes long */ ++ quicktime_read_data(file, (uint8_t*)data, len); ++ data[len] = 0; ++ } else { ++ data[0] = 0; ++ } + } + + void quicktime_write_pascal(quicktime_t *file, char *data) diff --git a/media-libs/libquicktime/files/libquicktime-1.2.4+libav-9.patch b/media-libs/libquicktime/files/libquicktime-1.2.4+libav-9.patch new file mode 100644 index 000000000000..99a4d39e501a --- /dev/null +++ b/media-libs/libquicktime/files/libquicktime-1.2.4+libav-9.patch @@ -0,0 +1,12 @@ +Index: libquicktime-1.2.4/plugins/ffmpeg/ffmpeg.h +=================================================================== +--- libquicktime-1.2.4.orig/plugins/ffmpeg/ffmpeg.h ++++ libquicktime-1.2.4/plugins/ffmpeg/ffmpeg.h +@@ -27,6 +27,7 @@ + + #include + #include AVCODEC_HEADER ++#include + + void quicktime_init_video_codec_ffmpeg(quicktime_codec_t * codec, + quicktime_video_map_t *vtrack, diff --git a/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg2.patch b/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg2.patch new file mode 100644 index 000000000000..7add44220a2b --- /dev/null +++ b/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg2.patch @@ -0,0 +1,98 @@ +Extracted from upstream CVS. +https://bugs.gentoo.org/show_bug.cgi?id=476498 + +Index: libquicktime-1.2.4/plugins/ffmpeg/audio.c +=================================================================== +--- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c ++++ libquicktime-1.2.4/plugins/ffmpeg/audio.c +@@ -45,6 +45,11 @@ + #define ENCODE_AUDIO 1 + #endif + ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++/* from libavcodec/avcodec.h dated Dec 23 2012 */ ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio ++#endif ++ + /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */ + + /* MPEG Audio header parsing code */ +Index: libquicktime-1.2.4/plugins/ffmpeg/params.c +=================================================================== +--- libquicktime-1.2.4.orig/plugins/ffmpeg/params.c ++++ libquicktime-1.2.4/plugins/ffmpeg/params.c +@@ -101,6 +101,17 @@ typedef struct + } \ + } + ++#define PARAM_DICT_INT(name, dict_name) \ ++ { \ ++ if(!strcasecmp(name, key)) \ ++ { \ ++ char buf[128]; \ ++ snprintf(buf, sizeof(buf), "%d", *(int*)value); \ ++ av_dict_set(options, dict_name, buf, 0); \ ++ found = 1; \ ++ } \ ++ } ++ + #define PARAM_DICT_FLAG(name, dict_name) \ + { \ + if(!strcasecmp(name, key)) \ +@@ -202,8 +213,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon + PARAM_INT("ff_max_b_frames",max_b_frames); + PARAM_FLOAT("ff_b_quant_factor",b_quant_factor); + PARAM_INT("ff_b_frame_strategy",b_frame_strategy); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold"); ++ PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold"); ++#else + PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold); + PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold); ++#endif ++ + PARAM_INT("ff_strict_std_compliance",strict_std_compliance); + PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset); + PARAM_INT("ff_rc_min_rate",rc_min_rate); +@@ -241,8 +259,15 @@ void lqt_ffmpeg_set_parameter(AVCodecCon + PARAM_QP2LAMBDA("ff_lmax", lmax); + PARAM_INT("ff_noise_reduction",noise_reduction); + PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_inter_threshold","inter_threshold"); ++ PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping"); ++#else + PARAM_INT("ff_inter_threshold",inter_threshold); + PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping); ++#endif ++ + PARAM_INT("ff_thread_count",thread_count); + PARAM_INT("ff_me_threshold",me_threshold); + PARAM_INT("ff_mb_threshold",mb_threshold); +@@ -272,8 +297,16 @@ void lqt_ffmpeg_set_parameter(AVCodecCon + PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT); + PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED); + // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd"); ++ PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd"); ++ PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop"); ++#else + PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD); + PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD); ++ PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); ++#endif + + #if LIBAVCODEC_VERSION_MAJOR >= 54 + PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv"); +@@ -288,7 +321,6 @@ void lqt_ffmpeg_set_parameter(AVCodecCon + PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER); + PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP); + PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST); +- PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); + PARAM_ENUM("ff_coder_type",coder_type,coder_type); + + } diff --git a/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg29.patch b/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg29.patch new file mode 100644 index 000000000000..96a323aa8170 --- /dev/null +++ b/media-libs/libquicktime/files/libquicktime-1.2.4-ffmpeg29.patch @@ -0,0 +1,287 @@ +Index: libquicktime-1.2.4/plugins/ffmpeg/video.c +=================================================================== +--- libquicktime-1.2.4.orig/plugins/ffmpeg/video.c ++++ libquicktime-1.2.4/plugins/ffmpeg/video.c +@@ -37,10 +37,10 @@ + #endif + + +-#ifdef PIX_FMT_YUV422P10 +-#define PIX_FMT_YUV422P10_OR_DUMMY PIX_FMT_YUV422P10 ++#ifdef AV_PIX_FMT_YUV422P10 ++#define AV_PIX_FMT_YUV422P10_OR_DUMMY AV_PIX_FMT_YUV422P10 + #else +-#define PIX_FMT_YUV422P10_OR_DUMMY -1234 ++#define AV_PIX_FMT_YUV422P10_OR_DUMMY -1234 + #endif + + #if LIBAVCODEC_VERSION_INT >= ((54<<16)|(1<<8)|0) +@@ -90,9 +90,9 @@ typedef struct + int imx_bitrate; + int imx_strip_vbi; + +- /* In some cases FFMpeg would report something like PIX_FMT_YUV422P, while +- we would like to treat it as PIX_FMT_YUVJ422P. It's only used for decoding */ +- enum PixelFormat reinterpret_pix_fmt; ++ /* In some cases FFMpeg would report something like AV_PIX_FMT_YUV422P, while ++ we would like to treat it as AV_PIX_FMT_YUVJ422P. It's only used for decoding */ ++ enum AVPixelFormat reinterpret_pix_fmt; + + int is_imx; + int y_offset; +@@ -137,42 +137,42 @@ typedef struct + + static const struct + { +- enum PixelFormat ffmpeg_id; ++ enum AVPixelFormat ffmpeg_id; + int lqt_id; + int exact; + } + colormodels[] = + { +- { PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) ++ { AV_PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) + #if LIBAVUTIL_VERSION_INT < (50<<16) +- { PIX_FMT_YUV422, BC_YUV422, 1 }, ++ { AV_PIX_FMT_YUV422, BC_YUV422, 1 }, + #else +- { PIX_FMT_YUYV422, BC_YUV422, 1 }, ++ { AV_PIX_FMT_YUYV422, BC_YUV422, 1 }, + #endif +- { PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB... +- { PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR... +- { PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) +- { PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) +- { PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) +- { PIX_FMT_YUV422P16, BC_YUV422P16, 1 }, ///< Planar 16 bit YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) +-#ifdef PIX_FMT_YUV422P10 +- { PIX_FMT_YUV422P10, BC_YUV422P10, 1 }, ///< 10 bit samples in uint16_t containers, planar 4:2:2 +-#endif +- { PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness +- { PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg) +- { PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg) +- { PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg) ++ { AV_PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB... ++ { AV_PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR... ++ { AV_PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) ++ { AV_PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) ++ { AV_PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) ++ { AV_PIX_FMT_YUV422P16, BC_YUV422P16, 1 }, ///< Planar 16 bit YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) ++#ifdef AV_PIX_FMT_YUV422P10 ++ { AV_PIX_FMT_YUV422P10, BC_YUV422P10, 1 }, ///< 10 bit samples in uint16_t containers, planar 4:2:2 ++#endif ++ { AV_PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness ++ { AV_PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg) ++ { AV_PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg) ++ { AV_PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg) + #if LIBAVUTIL_VERSION_INT < (50<<16) +- { PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... ++ { AV_PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... + #else +- { PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... ++ { AV_PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... + #endif +- { PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1 +- { PIX_FMT_GRAY8, BC_RGB888, 0 }, +- { PIX_FMT_MONOWHITE, BC_RGB888, 0 }, ///< 0 is white +- { PIX_FMT_MONOBLACK, BC_RGB888, 0 }, ///< 0 is black +- { PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette +- { PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) ++ { AV_PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1 ++ { AV_PIX_FMT_GRAY8, BC_RGB888, 0 }, ++ { AV_PIX_FMT_MONOWHITE, BC_RGB888, 0 }, ///< 0 is white ++ { AV_PIX_FMT_MONOBLACK, BC_RGB888, 0 }, ///< 0 is black ++ { AV_PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette ++ { AV_PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) + }; + + static const struct +@@ -343,16 +343,16 @@ static int lqt_tenbit_dnxhd_supported(AV + if (!codec->pix_fmts) + return 0; + +- for (i = 0; codec->pix_fmts[i] != PIX_FMT_NONE; ++i) ++ for (i = 0; codec->pix_fmts[i] != AV_PIX_FMT_NONE; ++i) + { +- if (codec->pix_fmts[i] == PIX_FMT_YUV422P10_OR_DUMMY) ++ if (codec->pix_fmts[i] == AV_PIX_FMT_YUV422P10_OR_DUMMY) + return 1; + } + + return 0; + } + +-static enum PixelFormat lqt_ffmpeg_get_ffmpeg_colormodel(int id) ++static enum AVPixelFormat lqt_ffmpeg_get_ffmpeg_colormodel(int id) + { + int i; + +@@ -361,10 +361,10 @@ static enum PixelFormat lqt_ffmpeg_get_f + if(colormodels[i].lqt_id == id) + return colormodels[i].ffmpeg_id; + } +- return PIX_FMT_NB; ++ return AV_PIX_FMT_NB; + } + +-static int lqt_ffmpeg_get_lqt_colormodel(enum PixelFormat id, int * exact) ++static int lqt_ffmpeg_get_lqt_colormodel(enum AVPixelFormat id, int * exact) + { + int i; + +@@ -402,24 +402,24 @@ static void lqt_ffmpeg_setup_decoding_co + /* First we try codec-specific colormodel matching. */ + if(codec->decoder->id == AV_CODEC_ID_DNXHD) + { +- /* FFMpeg supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 for DNxHD, which +- we sometimes interpret as PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10. */ +- if (codec->avctx->pix_fmt == PIX_FMT_YUV422P || codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY) ++ /* FFMpeg supports AV_PIX_FMT_YUV422P and AV_PIX_FMT_YUV422P10 for DNxHD, which ++ we sometimes interpret as AV_PIX_FMT_YUVJ422P and AV_PIX_FMT_YUVJ422P10. */ ++ if (codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P || codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P10_OR_DUMMY) + { +- int p10 = (codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY); ++ int p10 = (codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P10_OR_DUMMY); + *exact = 1; + if (lqt_ffmpeg_get_avid_yuv_range(vtrack->track) == AVID_FULL_YUV_RANGE) + { + vtrack->stream_cmodel = p10 ? BC_YUVJ422P10 : BC_YUVJ422P; +- codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUVJ422P; +- // Note: reinterpret_pix_fmt should really be PIX_FMT_YUVJ422P10, except ++ codec->reinterpret_pix_fmt = p10 ? AV_PIX_FMT_YUV422P10_OR_DUMMY : AV_PIX_FMT_YUVJ422P; ++ // Note: reinterpret_pix_fmt should really be AV_PIX_FMT_YUVJ422P10, except + // there is no such colormodel in FFMpeg. Fortunately, it's not a problem + // in this case, as reinterpret_pix_fmt is only used when *exact == 0. + } + else + { + vtrack->stream_cmodel = p10 ? BC_YUV422P10 : BC_YUV422P; +- codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUV422P; ++ codec->reinterpret_pix_fmt = p10 ? AV_PIX_FMT_YUV422P10_OR_DUMMY : AV_PIX_FMT_YUV422P; + } + return; + } +@@ -440,14 +440,14 @@ static void lqt_ffmpeg_setup_encoding_co + + if (codec->encoder->id == AV_CODEC_ID_DNXHD) + { +- /* FFMpeg's DNxHD encoder only supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 +- and doesn't know anything about PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10 ++ /* FFMpeg's DNxHD encoder only supports AV_PIX_FMT_YUV422P and AV_PIX_FMT_YUV422P10 ++ and doesn't know anything about AV_PIX_FMT_YUVJ422P and AV_PIX_FMT_YUVJ422P10 + (in fact, the latter doesn't even exist) */ +- codec->avctx->pix_fmt = PIX_FMT_YUV422P; ++ codec->avctx->pix_fmt = AV_PIX_FMT_YUV422P; + if (vtrack->stream_cmodel == BC_YUV422P10 || vtrack->stream_cmodel == BC_YUVJ422P10) + { + if (lqt_tenbit_dnxhd_supported(codec->encoder)) +- codec->avctx->pix_fmt = PIX_FMT_YUV422P10_OR_DUMMY; ++ codec->avctx->pix_fmt = AV_PIX_FMT_YUV422P10_OR_DUMMY; + } + } + } +@@ -458,7 +458,7 @@ static void lqt_ffmpeg_setup_encoding_co + /* From avcodec.h: */ + + /* +- * PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA ++ * AV_PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA + * color is put together as: + * (A << 24) | (R << 16) | (G << 8) | B + * This is stored as BGRA on little endian CPU architectures and ARGB on +@@ -530,7 +530,7 @@ static void convert_rgba_to_argb(uint8_t + */ + + static void convert_image_decode(quicktime_ffmpeg_video_codec_t *codec, +- AVFrame * in_frame, enum PixelFormat in_format, ++ AVFrame * in_frame, enum AVPixelFormat in_format, + unsigned char ** out_frame, int out_format, + int width, int height, int row_span, int row_span_uv) + { +@@ -547,9 +547,9 @@ static void convert_image_decode(quickti + * RGBA format like in ffmpeg?? + */ + #if LIBAVUTIL_VERSION_INT < (50<<16) +- if((in_format == PIX_FMT_RGBA32) && (out_format == BC_RGBA8888)) ++ if((in_format == AV_PIX_FMT_RGBA32) && (out_format == BC_RGBA8888)) + #else +- if((in_format == PIX_FMT_RGB32) && (out_format == BC_RGBA8888)) ++ if((in_format == AV_PIX_FMT_RGB32) && (out_format == BC_RGBA8888)) + #endif + { + convert_image_decode_rgba(in_frame, out_frame, width, height, codec->y_offset); +@@ -829,7 +829,7 @@ static int lqt_ffmpeg_decode_video(quick + if(avcodec_open2(codec->avctx, codec->decoder, NULL) != 0) + return -1; + #endif +- codec->frame = avcodec_alloc_frame(); ++ codec->frame = av_frame_alloc(); + vtrack->stream_cmodel = LQT_COLORMODEL_NONE; + codec->initialized = 1; + } +@@ -929,10 +929,10 @@ static int lqt_ffmpeg_decode_video(quick + #ifdef HAVE_LIBSWSCALE + + #if LIBAVUTIL_VERSION_INT < (50<<16) +- if(!((codec->avctx->pix_fmt == PIX_FMT_RGBA32) && ++ if(!((codec->avctx->pix_fmt == AV_PIX_FMT_RGBA32) && + (vtrack->stream_cmodel == BC_RGBA8888))) + #else +- if(!((codec->avctx->pix_fmt == PIX_FMT_RGB32) && ++ if(!((codec->avctx->pix_fmt == AV_PIX_FMT_RGB32) && + (vtrack->stream_cmodel == BC_RGBA8888))) + #endif + { +@@ -1318,7 +1318,7 @@ static int lqt_ffmpeg_encode_video(quick + + if(!codec->initialized) + { +- codec->frame = avcodec_alloc_frame(); ++ codec->frame = av_frame_alloc(); + + /* time_base is 1/framerate for constant framerate */ + +@@ -1396,9 +1396,9 @@ static int lqt_ffmpeg_encode_video(quick + if(vtrack->stream_cmodel == BC_RGBA8888) + { + /* Libquicktime doesn't natively support a color model equivalent +- to PIX_FMT_ARGB, which is required for QTRLE with alpha channel. ++ to AV_PIX_FMT_ARGB, which is required for QTRLE with alpha channel. + So, we use BC_RGBA8888 and do ad hoc conversion below. */ +- codec->avctx->pix_fmt = PIX_FMT_ARGB; ++ codec->avctx->pix_fmt = AV_PIX_FMT_ARGB; + vtrack->track->mdia.minf.stbl.stsd.table[0].depth = 32; + } + } +@@ -1467,7 +1467,7 @@ static int lqt_ffmpeg_encode_video(quick + } + // codec->lqt_colormodel = ffmepg_2_lqt(codec->com.ffcodec_enc); + +- if(codec->y_offset != 0 || codec->avctx->pix_fmt == PIX_FMT_ARGB) ++ if(codec->y_offset != 0 || codec->avctx->pix_fmt == AV_PIX_FMT_ARGB) + { + if(!codec->tmp_rows) + { +@@ -1492,7 +1492,7 @@ static int lqt_ffmpeg_encode_video(quick + vtrack->stream_cmodel, + 0, 0, 0, codec->y_offset); + } +- else if(codec->avctx->pix_fmt == PIX_FMT_ARGB) ++ else if(codec->avctx->pix_fmt == AV_PIX_FMT_ARGB) + { + convert_rgba_to_argb(row_pointers[0], vtrack->stream_row_span, + codec->tmp_rows[0], codec->tmp_row_span, +Index: libquicktime-1.2.4/plugins/ffmpeg/audio.c +=================================================================== +--- libquicktime-1.2.4.orig/plugins/ffmpeg/audio.c ++++ libquicktime-1.2.4/plugins/ffmpeg/audio.c +@@ -1266,7 +1266,7 @@ static int lqt_ffmpeg_encode_audio(quick + pkt.data = codec->chunk_buffer; + pkt.size = codec->chunk_buffer_alloc; + +- avcodec_get_frame_defaults(&f); ++ av_frame_unref(&f); + f.nb_samples = codec->avctx->frame_size; + + avcodec_fill_audio_frame(&f, channels, codec->avctx->sample_fmt, diff --git a/media-libs/libquicktime/libquicktime-1.2.4-r2.ebuild b/media-libs/libquicktime/libquicktime-1.2.4-r2.ebuild new file mode 100644 index 000000000000..baecbef11725 --- /dev/null +++ b/media-libs/libquicktime/libquicktime-1.2.4-r2.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit libtool eutils multilib-minimal + +DESCRIPTION="An enhanced version of the quicktime4linux library" +HOMEPAGE="http://libquicktime.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd" +IUSE="aac alsa doc dv encode ffmpeg gtk jpeg lame libav cpu_flags_x86_mmx opengl png schroedinger static-libs vorbis X x264" + +RDEPEND=">=virtual/libintl-0-r1[${MULTILIB_USEDEP}] + sys-libs/zlib:= + aac? ( + >=media-libs/faad2-2.7-r3[${MULTILIB_USEDEP}] + encode? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] ) + ) + alsa? ( >=media-libs/alsa-lib-1.0.20 ) + dv? ( >=media-libs/libdv-1.0.0-r3[${MULTILIB_USEDEP}] ) + ffmpeg? ( + libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] ) + !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] ) + ) + gtk? ( x11-libs/gtk+:2 ) + jpeg? ( >=virtual/jpeg-0-r2:0[${MULTILIB_USEDEP}] ) + lame? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] ) + opengl? ( virtual/opengl ) + png? ( >=media-libs/libpng-1.6.10:0[${MULTILIB_USEDEP}] ) + schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] ) + vorbis? ( + >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] + >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}] + ) + X? ( + x11-libs/libX11 + x11-libs/libXaw + x11-libs/libXext + x11-libs/libXt + x11-libs/libXv + ) + x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] + sys-devel/gettext + doc? ( app-doc/doxygen ) + X? ( >=x11-proto/videoproto-2.3.1-r1[${MULTILIB_USEDEP}] )" + +REQUIRED_USE="opengl? ( X )" + +DOCS="ChangeLog README TODO" + +src_prepare() { + epatch "${FILESDIR}"/${P}+libav-9.patch \ + "${FILESDIR}"/${P}-ffmpeg2.patch \ + "${FILESDIR}/CVE-2016-2399.patch" + if has_version '>=media-video/ffmpeg-2.9' || + has_version '>=media-video/libav-12'; then + epatch "${FILESDIR}"/${P}-ffmpeg29.patch + fi + + for FILE in lqt_ffmpeg.c video.c audio.c ; do + sed -i -e "s:CODEC_ID_:AV_&:g" "${S}/plugins/ffmpeg/${FILE}" || die + done + + elibtoolize # Required for .so versioning on g/fbsd +} + +multilib_src_configure() { + # utils use: alsa, opengl, gtk+, X + + ECONF_SOURCE=${S} \ + econf \ + --enable-gpl \ + $(use_enable static-libs static) \ + $(use_enable cpu_flags_x86_mmx asm) \ + $(multilib_native_use_with doc doxygen) \ + $(use vorbis || echo --without-vorbis) \ + $(use_with lame) \ + $(multilib_native_use_with X x) \ + $(multilib_native_use_with opengl) \ + $(multilib_native_use_with alsa) \ + $(multilib_native_use_with gtk) \ + $(use_with dv libdv) \ + $(use_with jpeg libjpeg) \ + $(use_with ffmpeg) \ + $(use_with png libpng) \ + $(use_with schroedinger) \ + $(use_with aac faac) \ + $(use encode || echo --without-faac) \ + $(use_with aac faad2) \ + $(use_with x264) \ + --without-cpuflags + + if ! multilib_is_native_abi; then + # disable building utilities + sed -i -e '/SUBDIRS =/s:utils::' Makefile || die + fi +} + +multilib_src_install_all() { + einstalldocs + prune_libtool_files --all + + # Compatibility with software that uses quicktime prefix, but + # don't do that when building for Darwin/MacOS + [[ ${CHOST} != *-darwin* ]] && dosym /usr/include/lqt /usr/include/quicktime +} + +pkg_preinst() { + if [[ -d /usr/include/quicktime && ! -L /usr/include/quicktime ]]; then + elog "For compatibility with other quicktime libraries, ${PN} was" + elog "going to create a /usr/include/quicktime symlink, but for some" + elog "reason that is a directory on your system." + + elog "Please check that is empty, and remove it, or submit a bug" + elog "telling us which package owns the directory." + die "/usr/include/quicktime is a directory." + fi +} diff --git a/media-libs/libquicktime/metadata.xml b/media-libs/libquicktime/metadata.xml new file mode 100644 index 000000000000..a9599b9652e0 --- /dev/null +++ b/media-libs/libquicktime/metadata.xml @@ -0,0 +1,13 @@ + + + + + media-video@gentoo.org + + + Enable Dirac video support (an advanced royalty-free video compression format) via libschroedinger (high-speed implementation in C of the Dirac codec) + + + libquicktime + + -- cgit v1.2.3