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 
    66PortGroup               waf 1.0
    77
    88# Please revbump mpv whenever ffmpeg{,-devel} is updated!
    9 github.setup            mpv-player mpv 0.11.0 v
    10 revision                2
     9github.setup            mpv-player mpv 0.15.0 v
     10revision                0
    1111categories              multimedia
    1212license                 GPL-2+
    1313maintainers             ionic
    distfiles-append ${waf_distfile}:waf 
    3131extract.only-delete     ${waf_distfile}
    3232
    3333checksums               ${mpv_distfile} \
    34                         rmd160  47d625b899b7bbe3867845e9710fef14d41d5249 \
    35                         sha256  7d0598a0f5f5825143e2678f058d6305683c82ff36702235703e8d54048132fe \
     34                        rmd160  78569931a3bf6bfe18154da8eaf9f3623d543957 \
     35                        sha256  c2011c9c9a9e22cf84d16dcb5f23572bbbcf414b51955b5e095af274e51351c1 \
    3636                        ${waf_distfile} \
    3737                        rmd160  bb1dcd10a0c336a5497bb1247a301c27f997078c \
    3838                        sha256  01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b
    configure.args-append --enable-manpage-build \ 
    6161                        --enable-libass \
    6262                        --enable-coreaudio \
    6363                        --enable-cocoa \
    64                         --disable-vda-hwaccel \
    6564                        --disable-videotoolbox-hwaccel \
    66                         --disable-vda-gl \
    6765                        --disable-videotoolbox-gl
    6866
    6967# mpv autodetects many support libs. To prevent undeclared
    configure.args-append --disable-pdf-build \ 
    10098                        --disable-jpeg \
    10199                        --disable-tv \
    102100                        --disable-lua \
    103                         --disable-apple-remote
     101                        --disable-apple-remote \
     102                        --disable-libmpv-shared
    104103
    105104# Fix picking up the correct talloc version.
    106105# -isystem has the added benefit of moving the include
    platform macosx { 
    145144                            --enable-apple-remote
    146145}
    147146
    148 set has_vda 0
    149147set has_vtb 0
    150148
    151149platform darwin {
    platform darwin { 
    159157                    and adjust it to your needs.
    160158    }]
    161159
    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/2299
    168     if {${os.major} > 10 || (${os.major} == 10 && ${os.minor} >= 3)} {
    169         set has_vda 1
    170         configure.args-delete   --disable-vda-hwaccel \
    171                                 --disable-vda-gl
    172         configure.args-append   --enable-vda-hwaccel \
    173                                 --enable-vda-gl
    174     }
    175 
    176160    # VideotoolBox, a new hardware acceleration framework, is supported on 10.8+ and "here to stay".
    177161    # It provides support for H264, H263, MPEG1, MPEG2 and MPEG4.
    178162    if {${os.major} > 11} {
    platform darwin { 
    183167                                --enable-videotoolbox-gl
    184168    }
    185169
    186     if {(${has_vtb}) || (${has_vda})} {
     170    if {${has_vtb}} {
    187171        notes-append {
    188172                        This config file already defines the necessary video output settings to make \
    189173                        use of the hardware acceleration features provided by your operating system.
    190174        }
    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 as
    197                             * ${prefix}/share/examples/${name}/config-maintainer-vda.
    198             }]
    199         }
    200175    } else {
    201176        notes-append {
    202177                        Sadly, your system is incapable of utilizing mpv's hardware decoding features.
    platform darwin { 
    229204                            patch-video_out_opengl_cocoa.c-hardcode-OpenGL-2.diff \
    230205                            patch-osdep_macosx_compat.m-add-subscripting-implementation.diff \
    231206                            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.diff
    234 
    235207                            # Let's hope this is actually unneeded...
    236208                            #patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff
    237209
    platform darwin { 
    246218    }
    247219
    248220    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/"
    250222    }
    251223
    252224    pre-configure {
    253225        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
    256227        } 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
    259229        }
    260230    }
    261231}
    post-extract { 
    312282
    313283post-destroot {
    314284    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} {
    316286        xinstall -m 0644 ${worksrcpath}/etc/${etcfile} \
    317287            ${destroot}${prefix}/etc/${name}/${etcfile}
    318288    }
    post-destroot { 
    324294
    325295    if {${os.platform} eq "darwin"} {
    326296        if {(${has_vtb})} {
    327             xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer-vtb \
     297            xinstall -m 0644 ${worksrcpath}/TOOLS/config-maintainer \
    328298                             ${destroot}${prefix}/share/examples/${name}/config-maintainer
    329299
    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-maintainer
    337300        }
    338301    }
    339302}
    variant printable_doc description {Generate printable documents (PDF help)} { 
    496459    configure.args-replace  --disable-pdf-build \
    497460                            --enable-pdf-build
    498461}
     462
     463variant 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
     4vo=opengl-hq:backend=cocoa
     5ao=coreaudio
     6
     7sub-scale=3
     8
     9af=scaletempo
     10
     11softvol=yes
     12softvol-max=800
     13
     14framedrop=vo
     15
     16hwdec=videotoolbox
     17
     18#alang=en,eng,de,ger
     19
     20cache=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=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=vda
    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-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=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/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.orig
    2 +++ video/decode/vda.c
    3 @@ -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_lo
    12  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 >= 1070
    16  #if HAVE_VDA_DEFAULT_INIT2
    17      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_ctx
    20  #else
    21      int err = av_vda_default_init(ctx->avctx);
    22  #endif
    23 +#else
    24 +    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.orig
    2 +++ video/out/opengl/hwdec_vda.c
    3 @@ -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 >= 1070
    18 +    , {
    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_hwdec
    31  static int create(struct gl_hwdec *hw)
    32  {
    33      // For videotoolbox, we always request NV12.
    34 +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
    35  #if HAVE_VDA_DEFAULT_INIT2
    36      struct vda_format *f = vda_get_gl_format_from_imgfmt(IMGFMT_NV12);
    37  #else
    38      struct vda_format *f = vda_get_gl_format_from_imgfmt(IMGFMT_UYVY);
    39  #endif
    40 +#else
    41 +    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