Ticket #50660: mpv-0.15.0.patch
File mpv-0.15.0.patch, 11.6 KB (added by mcg@…, 9 years ago) |
---|
-
Portfile
diff --git a/Portfile b/Portfile index c601817..c4ec48f 100644
a b PortGroup github 1.0 6 6 PortGroup waf 1.0 7 7 8 8 # Please revbump mpv whenever ffmpeg{,-devel} is updated! 9 github.setup mpv-player mpv 0.1 1.0 v10 revision 29 github.setup mpv-player mpv 0.15.0 v 10 revision 0 11 11 categories multimedia 12 12 license GPL-2+ 13 13 maintainers ionic … … distfiles-append ${waf_distfile}:waf 31 31 extract.only-delete ${waf_distfile} 32 32 33 33 checksums ${mpv_distfile} \ 34 rmd160 47d625b899b7bbe3867845e9710fef14d41d5249\35 sha256 7d0598a0f5f5825143e2678f058d6305683c82ff36702235703e8d54048132fe\34 rmd160 78569931a3bf6bfe18154da8eaf9f3623d543957 \ 35 sha256 c2011c9c9a9e22cf84d16dcb5f23572bbbcf414b51955b5e095af274e51351c1 \ 36 36 ${waf_distfile} \ 37 37 rmd160 bb1dcd10a0c336a5497bb1247a301c27f997078c \ 38 38 sha256 01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b … … configure.args-append --enable-manpage-build \ 61 61 --enable-libass \ 62 62 --enable-coreaudio \ 63 63 --enable-cocoa \ 64 --disable-vda-hwaccel \65 64 --disable-videotoolbox-hwaccel \ 66 --disable-vda-gl \67 65 --disable-videotoolbox-gl 68 66 69 67 # mpv autodetects many support libs. To prevent undeclared … … configure.args-append --disable-pdf-build \ 100 98 --disable-jpeg \ 101 99 --disable-tv \ 102 100 --disable-lua \ 103 --disable-apple-remote 101 --disable-apple-remote \ 102 --disable-libmpv-shared 104 103 105 104 # Fix picking up the correct talloc version. 106 105 # -isystem has the added benefit of moving the include … … platform macosx { 145 144 --enable-apple-remote 146 145 } 147 146 148 set has_vda 0149 147 set has_vtb 0 150 148 151 149 platform darwin { … … platform darwin { 159 157 and adjust it to your needs. 160 158 }] 161 159 162 # Note: VDA support has already been removed on master. The next update will probably not include it anymore.163 164 # VDA (video hardware acceleration, mostly H264) is only supported on 10.6.3+ up to (excluding) 10.11.165 #if {(${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)) && (${os.major} < 15)}166 # Due to a bug in ffmpeg(?), we have to enable VDA on 10.11 as well, even though it shouldn't be supported.167 # More information: https://github.com/mpv-player/mpv/issues/2299168 if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {169 set has_vda 1170 configure.args-delete --disable-vda-hwaccel \171 --disable-vda-gl172 configure.args-append --enable-vda-hwaccel \173 --enable-vda-gl174 }175 176 160 # VideotoolBox, a new hardware acceleration framework, is supported on 10.8+ and "here to stay". 177 161 # It provides support for H264, H263, MPEG1, MPEG2 and MPEG4. 178 162 if {${os.major} > 11} { … … platform darwin { 183 167 --enable-videotoolbox-gl 184 168 } 185 169 186 if { (${has_vtb}) || (${has_vda})} {170 if {${has_vtb}} { 187 171 notes-append { 188 172 This config file already defines the necessary video output settings to make \ 189 173 use of the hardware acceleration features provided by your operating system. 190 174 } 191 192 if {(${has_vtb}) && (${has_vda})} {193 notes-append [subst {194 While the default configuration file makes use of the newer and preferred \195 VideoToolBox framework, a separate config file set up for the old VDA \196 framework has been installed as197 * ${prefix}/share/examples/${name}/config-maintainer-vda.198 }]199 }200 175 } else { 201 176 notes-append { 202 177 Sadly, your system is incapable of utilizing mpv's hardware decoding features. … … platform darwin { 229 204 patch-video_out_opengl_cocoa.c-hardcode-OpenGL-2.diff \ 230 205 patch-osdep_macosx_compat.m-add-subscripting-implementation.diff \ 231 206 patch-audio_out_ao_coreaudio_utils.c-add-missing-header-for-getpid.diff \ 232 patch-video_decode_vda.c-disable-HAVE_VDA_DEFAULT_INIT2.diff \233 patch-video_out_opengl_hwdec_vda.c-disable-NV12.diff234 235 207 # Let's hope this is actually unneeded... 236 208 #patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff 237 209 … … platform darwin { 246 218 } 247 219 248 220 post-extract { 249 xinstall -m 0644 -W "${filespath}" config-maintainer -vda config-maintainer-vtb"${worksrcpath}/TOOLS/"221 xinstall -m 0644 -W "${filespath}" config-maintainer "${worksrcpath}/TOOLS/" 250 222 } 251 223 252 224 pre-configure { 253 225 if {[variant_isset network]} { 254 reinplace -W "${worksrcpath}/TOOLS" "s|@@NETWORK@@||" config-maintainer-vda 255 reinplace -W "${worksrcpath}/TOOLS" "s|@@NETWORK@@||" config-maintainer-vtb 226 reinplace -W "${worksrcpath}/TOOLS" "s|@@NETWORK@@||" config-maintainer 256 227 } else { 257 reinplace -W "${worksrcpath}/TOOLS" "|@@NETWORK@@|d" config-maintainer-vda 258 reinplace -W "${worksrcpath}/TOOLS" "|@@NETWORK@@|d" config-maintainer-vtb 228 reinplace -W "${worksrcpath}/TOOLS" "|@@NETWORK@@|d" config-maintainer 259 229 } 260 230 } 261 231 } … … post-extract { 312 282 313 283 post-destroot { 314 284 xinstall -d -m 0755 ${destroot}${prefix}/etc/${name} 315 foreach etcfile {encoding-profiles.conf example.conf input.conf} {285 foreach etcfile {encoding-profiles.conf mpv.conf input.conf} { 316 286 xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \ 317 287 ${destroot}${prefix}/etc/${name}/${etcfile} 318 288 } … … post-destroot { 324 294 325 295 if {${os.platform} eq "darwin"} { 326 296 if {(${has_vtb})} { 327 xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer -vtb\297 xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer \ 328 298 ${destroot}${prefix}/share/examples/${name}/config-maintainer 329 299 330 if {(${has_vda})} {331 xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer-vda \332 ${destroot}${prefix}/share/examples/${name}/333 }334 } else {335 xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer-vda \336 ${destroot}${prefix}/share/examples/${name}/config-maintainer337 300 } 338 301 } 339 302 } … … variant printable_doc description {Generate printable documents (PDF help)} { 496 459 configure.args-replace --disable-pdf-build \ 497 460 --enable-pdf-build 498 461 } 462 463 variant api description {Enable C API} { 464 configure.args-replace --disable-libmpv-shared \ 465 --enable-libmpv-shared 466 } -
new file files/config-maintainer
diff --git a/files/config-maintainer b/files/config-maintainer new file mode 100644 index 0000000..9ff17f5
- + 1 # Write your default config options here! 2 [default] 3 4 vo=opengl-hq:backend=cocoa 5 ao=coreaudio 6 7 sub-scale=3 8 9 af=scaletempo 10 11 softvol=yes 12 softvol-max=800 13 14 framedrop=vo 15 16 hwdec=videotoolbox 17 18 #alang=en,eng,de,ger 19 20 cache=50700 21 22 @@NETWORK@@ytdl 23 @@NETWORK@@ytdl-format=best -
deleted file files/config-maintainer-vda
diff --git a/files/config-maintainer-vda b/files/config-maintainer-vda deleted file mode 100644 index 930e2f4..0000000
+ - 1 # Write your default config options here!2 [default]3 4 vo=opengl-hq:backend=cocoa5 ao=coreaudio6 7 sub-scale=38 9 af=scaletempo10 11 softvol=yes12 softvol-max=80013 14 framedrop=vo15 16 hwdec=vda17 18 #alang=en,eng,de,ger19 20 cache=5070021 22 @@NETWORK@@ytdl23 @@NETWORK@@ytdl-format=best -
deleted file files/config-maintainer-vtb
diff --git a/files/config-maintainer-vtb b/files/config-maintainer-vtb deleted file mode 100644 index 9ff17f5..0000000
+ - 1 # Write your default config options here!2 [default]3 4 vo=opengl-hq:backend=cocoa5 ao=coreaudio6 7 sub-scale=38 9 af=scaletempo10 11 softvol=yes12 softvol-max=80013 14 framedrop=vo15 16 hwdec=videotoolbox17 18 #alang=en,eng,de,ger19 20 cache=5070021 22 @@NETWORK@@ytdl23 @@NETWORK@@ytdl-format=best -
deleted file files/patch-video_decode_vda.c-disable-HAVE_VDA_DEFAULT_INIT2.diff
diff --git a/files/patch-video_decode_vda.c-disable-HAVE_VDA_DEFAULT_INIT2.diff b/files/patch-video_decode_vda.c-disable-HAVE_VDA_DEFAULT_INIT2.diff deleted file mode 100644 index 4d29e97..0000000
+ - 1 --- video/decode/vda.c.orig2 +++ video/decode/vda.c3 @@ -19,6 +19,7 @@4 5 #include <libavcodec/version.h>6 #include <libavcodec/vda.h>7 +#include <AvailabilityMacros.h>8 9 #include "common/av_common.h"10 #include "common/msg.h"11 @@ -76,6 +77,7 @@ static void print_vda_error(struct mp_lo12 static int init_decoder(struct lavc_ctx *ctx, int w, int h)13 {14 av_vda_default_free(ctx->avctx);15 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 107016 #if HAVE_VDA_DEFAULT_INIT217 AVVDAContext *vdactx = av_vda_alloc_context();18 vdactx->cv_pix_fmt_type = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;19 @@ -83,6 +85,9 @@ static int init_decoder(struct lavc_ctx20 #else21 int err = av_vda_default_init(ctx->avctx);22 #endif23 +#else24 + int err = av_vda_default_init(ctx->avctx);25 +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 */26 27 if (err < 0) {28 print_vda_error(ctx->log, MSGL_ERR, "failed to init VDA decoder", err); -
deleted file files/patch-video_out_opengl_hwdec_vda.c-disable-NV12.diff
diff --git a/files/patch-video_out_opengl_hwdec_vda.c-disable-NV12.diff b/files/patch-video_out_opengl_hwdec_vda.c-disable-NV12.diff deleted file mode 100644 index ff8fedf..0000000
+ - 1 --- video/out/opengl/hwdec_vda.c.orig2 +++ video/out/opengl/hwdec_vda.c3 @@ -23,6 +23,7 @@4 #include <CoreVideo/CoreVideo.h>5 #include <OpenGL/OpenGL.h>6 #include <OpenGL/CGLIOSurface.h>7 +#include <AvailabilityMacros.h>8 9 #include "video/mp_image_pool.h"10 #include "hwdec.h"11 @@ -54,7 +55,9 @@ static struct vda_format vda_formats[] =12 .gl = {13 { GL_RGB_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, GL_RGB }14 }15 - }, {16 + }17 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 107018 + , {19 .cvpixfmt = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange,20 .imgfmt = IMGFMT_NV12,21 .planes = 2,22 @@ -63,6 +66,7 @@ static struct vda_format vda_formats[] =23 { GL_RG, GL_UNSIGNED_BYTE, GL_RG } ,24 }25 }26 +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 */27 };28 29 static struct vda_format *vda_get_gl_format(uint32_t cvpixfmt)30 @@ -159,11 +163,15 @@ static int create_common(struct gl_hwdec31 static int create(struct gl_hwdec *hw)32 {33 // For videotoolbox, we always request NV12.34 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 107035 #if HAVE_VDA_DEFAULT_INIT236 struct vda_format *f = vda_get_gl_format_from_imgfmt(IMGFMT_NV12);37 #else38 struct vda_format *f = vda_get_gl_format_from_imgfmt(IMGFMT_UYVY);39 #endif40 +#else41 + struct vda_format *f = vda_get_gl_format_from_imgfmt(IMGFMT_UYVY);42 +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 */43 if (create_common(hw, f))44 return -1;45