[153258] trunk/dports/multimedia/mpv

ionic at macports.org ionic at macports.org
Wed Sep 28 01:32:48 PDT 2016


Revision: 153258
          https://trac.macports.org/changeset/153258
Author:   ionic at macports.org
Date:     2016-09-28 01:32:48 -0700 (Wed, 28 Sep 2016)
Log Message:
-----------
multimedia/mpv: update to 0.20.0. Fixes: #52114.

Changes:
  - Drop dependency upon ossp-uuid. Was probably unneeded to begin with.
  - Update sample config file - some options were renamed or removed.
  - Refresh and rework patches, mostly more generic now. Use
    MAC_OS_X_VERSION_MAX_ALLOWED instead of MAC_OS_X_VERSION_MIN_REQUIRED.
  - Add new patches (sadly, supporting OS X 10.7 and below is becoming
    increasingly difficult.)

Modified Paths:
--------------
    trunk/dports/multimedia/mpv/Portfile
    trunk/dports/multimedia/mpv/files/config-maintainer
    trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-port-lightsensor.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.h-remove-NSDraggingDestination-protocol.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_video_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL320-section.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.h-guard-GL3-stuff.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_context_cocoa.c-hardcode-OpenGL-2.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_vo_opengl.c-guard-GL3-and-backport-old-behavior.diff

Added Paths:
-----------
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL3-timer-functions.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_utils.c-hide-pbo-texture-upload.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-fix-compile-warnings.diff
    trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-remove-timer-functionality.diff

Modified: trunk/dports/multimedia/mpv/Portfile
===================================================================
--- trunk/dports/multimedia/mpv/Portfile	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/Portfile	2016-09-28 08:32:48 UTC (rev 153258)
@@ -6,8 +6,8 @@
 PortGroup               waf 1.0
 
 # Please revbump mpv whenever ffmpeg{,-devel} is updated!
-github.setup            mpv-player mpv 0.17.0 v
-revision                3
+github.setup            mpv-player mpv 0.20.0 v
+revision                0
 categories              multimedia
 license                 GPL-2+
 maintainers             ionic
@@ -31,8 +31,8 @@
 extract.only-delete     ${waf_distfile}
 
 checksums               ${mpv_distfile} \
-                        rmd160  67eba1820d4dc287bbdcba344aa5278417922c12 \
-                        sha256  9c3a6f35153e270066299d70cb0049a9868b9e2b6631dcaeb80d1ce255152042 \
+                        rmd160  41466df9f6aa69eb31dcd1651b14def189b782da \
+                        sha256  1a8a98cf4785206fa27387f752af0bdc1e303fe2e0a5d5be306123c6151ced08 \
                         ${waf_distfile} \
                         rmd160  bb1dcd10a0c336a5497bb1247a301c27f997078c \
                         sha256  01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b
@@ -44,8 +44,7 @@
                         port:zlib \
                         port:libass \
                         port:libbluray \
-                        port:lcms2 \
-                        port:ossp-uuid
+                        port:lcms2
 
 universal_variant       no
 
@@ -101,7 +100,8 @@
                         --disable-jpeg \
                         --disable-tv \
                         --disable-lua \
-                        --disable-apple-remote
+                        --disable-apple-remote \
+                        --disable-gl
 
 # Fix picking up the correct talloc version.
 # -isystem has the added benefit of moving the include
@@ -207,16 +207,17 @@
                             patch-video_out_cocoa_common.m-define-constants.diff \
                             patch-video_out_cocoa_common.m-port-lightsensor.diff \
                             patch-video_out_opengl_context_cocoa.c-hardcode-OpenGL-2.diff \
+                            patch-video_out_opengl_video.c-fix-compile-warnings.diff \
                             patch-osdep_macosx_compat.h-fix-YES-NO-macro-warnings.diff \
                             patch-osdep_macosx_compat.m-add-subscripting-implementation.diff \
                             patch-audio_out_ao_coreaudio_utils.c-add-missing-header-for-getpid.diff \
                             patch-video_out_opengl_common.h-guard-GL3-stuff.diff \
                             patch-video_out_vo_opengl.c-guard-GL3-and-backport-old-behavior.diff \
-                            patch-video_out_opengl_common.c-hide-GL320-section.diff
+                            patch-video_out_opengl_common.c-hide-GL320-section.diff \
+                            patch-video_out_opengl_common.c-hide-GL3-timer-functions.diff \
+                            patch-video_out_opengl_video.c-remove-timer-functionality.diff \
+                            patch-video_out_opengl_utils.c-hide-pbo-texture-upload.diff
 
-                            # Let's hope this is actually unneeded...
-                            #patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff
-
         notes-append {
                         On systems older than Lion (10.7), Cocoa output support is currently \
                         being patched by the MacPorts maintainer to make it work.
@@ -417,6 +418,8 @@
 variant opengl description {Enable glx output support.  Both the CoreVideo and X11 outputs are supported} {
     configure.args-replace  --disable-gl-cocoa \
                             --enable-gl-cocoa
+    configure.args-replace  --disable-gl \
+                            --enable-gl
 
     if {[variant_isset x11]} {
         depends_lib-append      port:mesa

Modified: trunk/dports/multimedia/mpv/files/config-maintainer
===================================================================
--- trunk/dports/multimedia/mpv/files/config-maintainer	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/config-maintainer	2016-09-28 08:32:48 UTC (rev 153258)
@@ -8,8 +8,7 @@
 
 af=scaletempo
 
-softvol=yes
-softvol-max=800
+volume-max=800
 
 framedrop=vo
 

Modified: trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -21,7 +21,7 @@
 +
 +#include "osdep/macosx_compat.h"
 +
-+#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8)
++#if !defined (MAC_OS_X_VERSION_10_8) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8)
 +
 + at implementation NSArray (SubscriptingAdditions)
 +- (id)objectAtIndexedSubscript:(NSUInteger)index
@@ -57,7 +57,7 @@
 +#endif
 --- wscript_build.py.orig
 +++ wscript_build.py
-@@ -394,6 +394,7 @@ def build(ctx):
+@@ -391,6 +391,7 @@ def build(ctx):
          ( "osdep/ar/HIDRemote.m",                "apple-remote" ),
          ( "osdep/macosx_application.m",          "cocoa" ),
          ( "osdep/macosx_events.m",               "cocoa" ),

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,7 +1,15 @@
 --- video/out/cocoa_common.m.orig
 +++ video/out/cocoa_common.m
-@@ -50,6 +50,11 @@
+@@ -23,6 +23,7 @@
+ #import <AppKit/AppKit.h>
+ #include <mach/mach.h>
+ #import <CoreVideo/CoreVideo.h>
++#import <AvailabilityMacros.h>
  
+ #import "cocoa_common.h"
+ #import "video/out/cocoa/window.h"
+@@ -50,6 +51,11 @@
+ 
  #include "common/msg.h"
  
 +/* not used on OS X < 10.8 */
@@ -9,6 +17,6 @@
 +#define kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep")
 +#endif
 +
- static int vo_cocoa_fullscreen(struct vo *vo);
- static void cocoa_rm_fs_screen_profile_observer(struct vo_cocoa_state *s);
- static void cocoa_add_screen_reconfiguration_observer(struct vo *vo);
+ static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, 
+                                     const CVTimeStamp* outputTime, CVOptionFlags flagsIn, 
+                                     CVOptionFlags* flagsOut, void* displayLinkContext);

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-port-lightsensor.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-port-lightsensor.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-port-lightsensor.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,26 +1,20 @@
 --- video/out/cocoa_common.m.orig
 +++ video/out/cocoa_common.m
-@@ -23,6 +23,7 @@
- #import <AppKit/AppKit.h>
- #include <mach/mach.h>
- #import <CoreVideo/CoreVideo.h>
-+#import <AvailabilityMacros.h>
- 
- #import "cocoa_common.h"
- #import "video/out/cocoa/window.h"
-@@ -87,6 +88,7 @@ struct vo_cocoa_state {
+@@ -91,6 +91,9 @@ struct vo_cocoa_state {
      uint64_t last_lmuvalue;
      int last_lux;
      IONotificationPortRef light_sensor_io_port;
++#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
 +    CFRunLoopSourceRef light_sensor_notify_rl_source;
++#endif
  
      struct mp_log *log;
  
-@@ -230,8 +232,18 @@ static void cocoa_init_light_sensor(stru
+@@ -232,8 +235,18 @@ static void cocoa_init_light_sensor(stru
  
          // subscribe to notifications from the light sensor driver
          s->light_sensor_io_port = IONotificationPortCreate(kIOMasterPortDefault);
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
          IONotificationPortSetDispatchQueue(
              s->light_sensor_io_port, dispatch_get_main_queue());
 +#else
@@ -35,14 +29,16 @@
  
          io_object_t n;
          IOServiceAddInterestNotification(
-@@ -253,6 +265,11 @@ static void cocoa_init_light_sensor(stru
+@@ -255,6 +268,13 @@ static void cocoa_init_light_sensor(stru
  static void cocoa_uninit_light_sensor(struct vo_cocoa_state *s)
  {
      if (s->light_sensor_io_port) {
++#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
 +        if (s->light_sensor_notify_rl_source) {
 +            CFRunLoopSourceInvalidate (s->light_sensor_notify_rl_source);
 +            s->light_sensor_notify_rl_source = NULL;
 +        }
++#endif
 +
          IONotificationPortDestroy(s->light_sensor_io_port);
          IOObjectRelease(s->light_sensor);

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.h-remove-NSDraggingDestination-protocol.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.h-remove-NSDraggingDestination-protocol.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.h-remove-NSDraggingDestination-protocol.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,11 +1,17 @@
 --- video/out/cocoa/events_view.h.orig
 +++ video/out/cocoa/events_view.h
-@@ -18,7 +18,7 @@
+@@ -16,9 +16,13 @@
+  */
+ 
  #import <Cocoa/Cocoa.h>
++#import <AvailabilityMacros.h>
  #import "video/out/cocoa/mpvadapter.h"
  
 - at interface MpvEventsView : NSView <NSDraggingDestination>
 + at interface MpvEventsView : NSView
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
++                                  <NSDraggingDestination>
++#endif
  @property(nonatomic, retain) MpvCocoaAdapter *adapter;
  - (void)setFullScreen:(BOOL)willBeFullscreen;
  - (void)clear;

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,13 +1,15 @@
 --- video/out/cocoa/events_view.m.orig
 +++ video/out/cocoa/events_view.m
-@@ -205,7 +205,9 @@
+@@ -208,7 +208,12 @@
  - (NSPoint)convertPointToPixels:(NSPoint)point
  {
      point = [self convertPoint:point fromView:nil];
--    point = [self convertPointToBacking:point];
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     point = [self convertPointToBacking:point];
++#else
 +    CGFloat scale_factor = [self.window userSpaceScaleFactor];
-+    //point = [self convertPointToBacking:point];
 +    point = NSMakePoint (point.x * scale_factor, point.y * scale_factor);
++#endif
      // flip y since isFlipped returning YES doesn't affect the backing
      // coordinate system
      point.y = -point.y;

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_events_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,16 +1,18 @@
 --- video/out/cocoa/events_view.m.orig
 +++ video/out/cocoa/events_view.m
-@@ -133,7 +133,12 @@
+@@ -133,7 +133,15 @@
  - (BOOL)containsMouseLocation
  {
      NSRect vF  = [[self.window screen] visibleFrame];
--    NSRect vFW = [self.window convertRectFromScreen:vF];
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     NSRect vFW = [self.window convertRectFromScreen:vF];
++#else
 +    NSPoint vFStart = vF.origin;
 +    NSPoint vFEnd = NSMakePoint (vFStart.x + vF.size.width, vFStart.y + vF.size.height);
-+    //NSRect vFW = [self.window convertRectFromScreen:vF];
 +    NSPoint vFStartW = [self.window convertScreenToBase:vFStart];
 +    NSPoint vFEndW = [self.window convertScreenToBase:vFEnd];
 +    NSRect vFW = NSMakeRect (vFStartW.x, vFStartW.y, vFEndW.x - vFStartW.x, vFEndW.y - vFStartW.y);
++#endif
      NSRect vFV = [self convertRect:vFW fromView:nil];
      NSPoint pt = [self convertPoint:[self mouseLocation] fromView:nil];
  

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_video_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_video_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_video_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,10 +1,21 @@
 --- video/out/cocoa/video_view.m.orig
 +++ video/out/cocoa/video_view.m
-@@ -38,7 +38,15 @@
+@@ -15,6 +15,8 @@
+  * with mpv.  If not, see <http://www.gnu.org/licenses/>.
+  */
  
++#import <AvailabilityMacros.h>
++
+ #include "osdep/macosx_compat.h"
+ #include "video/out/cocoa_common.h"
+ #include "video_view.h"
+@@ -38,7 +40,18 @@
+ 
  - (NSRect)frameInPixels
  {
--    return [self convertRectToBacking:[self frame]];
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     return [self convertRectToBacking:[self frame]];
++#else
 +    NSRect cur_frame = self.frame;
 +    NSPoint frame_point = cur_frame.origin;
 +    NSSize frame_extents = cur_frame.size;
@@ -12,8 +23,8 @@
 +    NSPoint conv_frame_point = NSMakePoint (frame_point.x * scale_factor, frame_point.y * scale_factor);
 +    NSSize conv_frame_extents = NSMakeSize (frame_extents.width * scale_factor, frame_extents.height * scale_factor);
 +    NSRect conv_frame = NSMakeRect (conv_frame_point.x, conv_frame_point.y, conv_frame_extents.width, conv_frame_extents.height);
-+    //return [self.window convertRectToBacking:[self frame]];
 +    return conv_frame;
++#endif
  }
  
  

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,6 +1,15 @@
 --- video/out/cocoa/window.m.orig
 +++ video/out/cocoa/window.m
-@@ -30,6 +30,14 @@
+@@ -15,6 +15,8 @@
+  * with mpv.  If not, see <http://www.gnu.org/licenses/>.
+  */
+ 
++#import <AvailabilityMacros.h>
++
+ #include <libavutil/common.h>
+ 
+ #include "input/keycodes.h"
+@@ -30,6 +32,14 @@
  - (void)setCenteredContentSize:(NSSize)newSize;
  @end
  

Added: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL3-timer-functions.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL3-timer-functions.diff	                        (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL3-timer-functions.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -0,0 +1,18 @@
+--- video/out/opengl/common.c.orig
++++ video/out/opengl/common.c
+@@ -275,7 +275,6 @@ static const struct gl_functions gl_func
+             {0}
+         },
+     },
+-#endif
+     {
+         .ver_core = 330,
+         .extension = "GL_ARB_timer_query",
+@@ -309,6 +308,7 @@ static const struct gl_functions gl_func
+             {0}
+         },
+     },
++#endif
+     {
+         .ver_core = 430,
+         .ver_es_core = 300,

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL320-section.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL320-section.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.c-hide-GL320-section.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,18 +1,18 @@
 --- video/out/opengl/common.c.orig
 +++ video/out/opengl/common.c
-@@ -227,6 +227,7 @@ static const struct gl_functions gl_func
-         .extension = "GL_ARB_texture_rg",
-         .provides = MPGL_CAP_TEX_RG,
+@@ -264,6 +264,7 @@ static const struct gl_functions gl_func
+         .ver_exclude = 1,
+         .ver_es_exclude = 320,
      },
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      {
          .ver_core = 320,
          .extension = "GL_ARB_sync",
-@@ -237,6 +238,7 @@ static const struct gl_functions gl_func
+@@ -274,6 +275,7 @@ static const struct gl_functions gl_func
              {0}
          },
      },
 +#endif
-     // Swap control, always an OS specific extension
-     // The OSX code loads this manually.
      {
+         .ver_core = 330,
+         .extension = "GL_ARB_timer_query",

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.h-guard-GL3-stuff.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.h-guard-GL3-stuff.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_common.h-guard-GL3-stuff.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,22 +1,17 @@
 --- video/out/opengl/common.h.orig
 +++ video/out/opengl/common.h
-@@ -22,6 +22,8 @@
- #include <stdint.h>
- #include <stdbool.h>
+@@ -190,6 +190,7 @@ struct GL {
  
-+#include <AvailabilityMacros.h>
-+
- #include "config.h"
- #include "common/msg.h"
- #include "misc/bstr.h"
-@@ -176,9 +178,11 @@ struct GL {
-     void (GLAPIENTRY *UniformMatrix3fv)(GLint, GLsizei, GLboolean,
-                                         const GLfloat *);
+     void (GLAPIENTRY *InvalidateFramebuffer)(GLenum, GLsizei, const GLenum *);
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      GLsync (GLAPIENTRY *FenceSync)(GLenum, GLbitfield);
      GLenum (GLAPIENTRY *ClientWaitSync)(GLsync, GLbitfield, GLuint64);
      void (GLAPIENTRY *DeleteSync)(GLsync sync);
+@@ -204,6 +205,7 @@ struct GL {
+     void (GLAPIENTRY *GetQueryObjecti64v)(GLuint, GLenum, GLint64 *);
+     void (GLAPIENTRY *GetQueryObjectuiv)(GLuint, GLenum, GLuint *);
+     void (GLAPIENTRY *GetQueryObjectui64v)(GLuint, GLenum, GLuint64 *);
 +#endif
  
      void (GLAPIENTRY *VDPAUInitNV)(const GLvoid *, const GLvoid *);

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_context_cocoa.c-hardcode-OpenGL-2.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_context_cocoa.c-hardcode-OpenGL-2.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_context_cocoa.c-hardcode-OpenGL-2.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,22 +1,14 @@
 --- video/out/opengl/common.c.orig
 +++ video/out/opengl/common.c
-@@ -28,6 +28,7 @@
- #include <stdbool.h>
- #include <math.h>
- #include <assert.h>
-+#include <AvailabilityMacros.h>
- 
- #include "common.h"
- #include "common/common.h"
-@@ -399,6 +400,7 @@ void mpgl_load_functions2(GL *gl, void *
+@@ -473,6 +473,7 @@ void mpgl_load_functions2(GL *gl, void *
      if (shader)
          mp_verbose(log, "GL_SHADING_LANGUAGE_VERSION='%s'\n", shader);
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined (__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      if (gl->version >= 300) {
          gl->GetStringi = get_fn(fn_ctx, "glGetStringi");
          gl->GetIntegerv = get_fn(fn_ctx, "glGetIntegerv");
-@@ -413,7 +415,9 @@ void mpgl_load_functions2(GL *gl, void *
+@@ -487,7 +488,9 @@ void mpgl_load_functions2(GL *gl, void *
              gl->extensions = talloc_asprintf_append(gl->extensions, " %s", ext);
          }
  
@@ -29,192 +21,98 @@
      }
 --- video/out/opengl/common.h.orig
 +++ video/out/opengl/common.h
-@@ -34,7 +34,6 @@
+@@ -22,6 +22,10 @@
+ #include <stdint.h>
+ #include <stdbool.h>
+ 
++#ifdef __APPLE__
++#include <AvailabilityMacros.h>
++#endif
++
+ #include "config.h"
+ #include "common/msg.h"
+ #include "misc/bstr.h"
+@@ -34,7 +38,9 @@
  #if HAVE_GL_COCOA
  #define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED 1
  #include <OpenGL/gl.h>
--#include <OpenGL/gl3.h>
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ #include <OpenGL/gl3.h>
++#endif
  #include <OpenGL/glext.h>
  #elif HAVE_ANDROID_GL
  #include <GLES3/gl3.h>
---- video/out/opengl/utils.c.orig
-+++ video/out/opengl/utils.c
-@@ -22,6 +22,7 @@
- #include <string.h>
- #include <stdarg.h>
- #include <assert.h>
-+#include <AvailabilityMacros.h>
- 
- #include "common/common.h"
- #include "utils.h"
-@@ -79,14 +80,20 @@ int glFmt2bpp(GLenum format, GLenum type
-         return 2;
-     case GL_RGB:
-     case GL_BGR:
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     case GL_RGB_INTEGER:
-+#endif
-         return 3 * component_size;
-     case GL_RGBA:
-     case GL_BGRA:
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     case GL_RGBA_INTEGER:
-+#endif
-         return 4 * component_size;
-     case GL_RED:
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     case GL_RED_INTEGER:
-+#endif
-         return component_size;
-     case GL_RG:
-     case GL_LUMINANCE_ALPHA:
-@@ -322,10 +329,12 @@ static const struct gl_format gl_formats
-     {GL_RGB,    GL_UNSIGNED_SHORT,              GL_RGB16},
-     {GL_RGBA,   GL_UNSIGNED_INT_2_10_10_10_REV, GL_RGB10_A2},
-     // not texture filterable in GLES 3.0
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     {GL_RGB,    GL_FLOAT,                       GL_RGB16F},
-     {GL_RGBA,   GL_FLOAT,                       GL_RGBA16F},
-     {GL_RGB,    GL_FLOAT,                       GL_RGB32F},
-     {GL_RGBA,   GL_FLOAT,                       GL_RGBA32F},
-+#endif
-     // Desktop GL
-     {GL_RGB,    GL_UNSIGNED_SHORT,              GL_RGB10},
-     {GL_RGBA,   GL_UNSIGNED_SHORT,              GL_RGBA12},
 --- video/out/opengl/video.c.orig
 +++ video/out/opengl/video.c
-@@ -20,6 +20,7 @@
- #include <stdbool.h>
- #include <string.h>
- #include <assert.h>
-+#include <AvailabilityMacros.h>
- 
- #include <libavutil/common.h>
- #include <libavutil/lfg.h>
-@@ -284,6 +285,7 @@ static const struct fmt_entry gl_byte_fo
-     {0, 0,           0,         0},                     // 4 x 16
- };
- 
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
- static const struct fmt_entry gl_ui_byte_formats_gles3[] = {
-     {0, GL_R8UI,      GL_RED_INTEGER,   GL_UNSIGNED_BYTE},  // 1 x 8
-     {0, GL_RG8UI,     GL_RG_INTEGER,    GL_UNSIGNED_BYTE},  // 2 x 8
-@@ -294,6 +296,7 @@ static const struct fmt_entry gl_ui_byte
-     {0, GL_RGB16UI,   GL_RGB_INTEGER,   GL_UNSIGNED_SHORT}, // 3 x 16
-     {0, GL_RGBA16UI,  GL_RGBA_INTEGER,  GL_UNSIGNED_SHORT}, // 4 x 16
- };
-+#endif
- 
- static const struct fmt_entry gl_byte_formats_gles2[] = {
-     {0, GL_LUMINANCE,           GL_LUMINANCE,       GL_UNSIGNED_BYTE}, // 1 x 8
-@@ -318,10 +321,10 @@ static const struct fmt_entry gl_byte_fo
- };
- 
- static const struct fmt_entry gl_float16_formats[] = {
--    {0, GL_R16F,    GL_RED,     GL_FLOAT},              // 1 x f
--    {0, GL_RG16F,   GL_RG,      GL_FLOAT},              // 2 x f
--    {0, GL_RGB16F,  GL_RGB,     GL_FLOAT},              // 3 x f
--    {0, GL_RGBA16F, GL_RGBA,    GL_FLOAT},              // 4 x f
-+    {0, 0,    GL_RED,     GL_FLOAT},              // 1 x f
-+    {0, 0,   GL_RG,      GL_FLOAT},              // 2 x f
-+    {0, 0,  GL_RGB,     GL_FLOAT},              // 3 x f
-+    {0, 0, GL_RGBA,    GL_FLOAT},              // 4 x f
- };
- 
- static const struct fmt_entry gl_apple_formats[] = {
-@@ -456,12 +459,7 @@ const struct m_sub_options gl_video_conf
+@@ -407,12 +407,22 @@ const struct m_sub_options gl_video_conf
                      {"rgb10",  GL_RGB10},
                      {"rgb10_a2", GL_RGB10_A2},
                      {"rgb16",  GL_RGB16},
--                    {"rgb16f", GL_RGB16F},
--                    {"rgb32f", GL_RGB32F},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+                     {"rgb16f", GL_RGB16F},
+                     {"rgb32f", GL_RGB32F},
++#else
++                    {"rgb16f", GL_RGB16F_ARB},
++                    {"rgb32f", GL_RGB32F_ARB},
++#endif
                      {"rgba12", GL_RGBA12},
--                    {"rgba16", GL_RGBA16},
--                    {"rgba16f", GL_RGBA16F},
--                    {"rgba32f", GL_RGBA32F},
+                     {"rgba16", GL_RGBA16},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+                     {"rgba16f", GL_RGBA16F},
+                     {"rgba32f", GL_RGBA32F},
++#else
++                    {"rgba16f", GL_RGBA16F_ARB},
++                    {"rgba32f", GL_RGBA32F_ARB},
++#endif
                      {"auto",   0})),
          OPT_CHOICE_OR_INT("dither-depth", dither_depth, 0, -1, 16,
                            ({"no", -1}, {"auto", 0})),
-@@ -565,10 +563,14 @@ static bool is_integer_format(const stru
- {
-     // Tests only the formats which we actually declare somewhere.
-     switch (fmt->format) {
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     case GL_RED_INTEGER:
-+#endif
-     case GL_RG_INTEGER:
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     case GL_RGB_INTEGER:
-     case GL_RGBA_INTEGER:
-+#endif
-         return true;
-     }
-     return false;
-@@ -1003,7 +1005,7 @@ static void pass_prepare_src_tex(struct 
- static void render_pass_quad(struct gl_video *p, int vp_w, int vp_h,
-                              const struct mp_rect *dst)
- {
--    struct vertex va[4] = {0};
-+    struct vertex va[4] = {{{0}}};
+@@ -3009,7 +3019,11 @@ static void check_gl_features(struct gl_
+     bool have_texrg = gl->mpgl_caps & MPGL_CAP_TEX_RG;
+     bool have_tex16 = !gl->es || (gl->mpgl_caps & MPGL_CAP_EXT16);
  
-     struct gl_transform t;
-     gl_transform_ortho(&t, 0, vp_w, 0, vp_h);
-@@ -2636,7 +2638,11 @@ static void check_gl_features(struct gl_
-         if (!p->opts.fbo_format) {
-             p->opts.fbo_format = GL_RGBA16;
-             if (gl->es)
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-                 p->opts.fbo_format = have_float_tex ? GL_RGBA16F : GL_RGB10_A2;
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     const GLint auto_fbo_fmts[] = {GL_RGBA16, GL_RGBA16F, GL_RGB10_A2,
 +#else
-+                p->opts.fbo_format = GL_RGB10_A2;
++    const GLint auto_fbo_fmts[] = {GL_RGBA16, GL_RGBA16F_ARB, GL_RGB10_A2,
 +#endif
-         }
-         have_fbo = test_fbo(p);
-     }
-@@ -2855,7 +2861,9 @@ static const struct fmt_entry *find_plan
-     const struct fmt_entry *e = find_tex_format(gl, bytes_per_comp, n_channels);
-     if (e->format || gl->es < 300)
-         return e;
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-     return &gl_ui_byte_formats_gles3[n_channels - 1 + (bytes_per_comp - 1) * 4];
-+#endif
- }
- 
- static bool init_format(int fmt, struct gl_video *init)
+                                    GL_RGBA8, 0};
+     GLint user_fbo_fmts[] = {p->opts.fbo_format, 0};
+     const GLint *fbo_fmts = user_fbo_fmts[0] ? user_fbo_fmts : auto_fbo_fmts;
 --- video/out/opengl/context_cocoa.c.orig
 +++ video/out/opengl/context_cocoa.c
-@@ -56,12 +56,17 @@ static void *cocoa_glgetaddr(const char 
+@@ -48,12 +48,17 @@ static void *cocoa_glgetaddr(const char 
  
  static CGLError test_gl_version(struct vo *vo,
                                  CGLContextObj *ctx,
 -                                CGLPixelFormatObj *pix,
 -                                CGLOpenGLProfile version)
 +                                CGLPixelFormatObj *pix
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
 +                                , CGLOpenGLProfile version
 +#endif
 +                                )
  {
      CGLPixelFormatAttribute attrs[] = {
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
          kCGLPFAOpenGLProfile,
          (CGLPixelFormatAttribute) version,
 +#endif
          kCGLPFADoubleBuffer,
          kCGLPFAAccelerated,
          #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
-@@ -99,16 +104,22 @@ static bool create_gl_context(struct MPG
+@@ -91,16 +96,22 @@ static bool create_gl_context(struct MPG
      struct cgl_context *p = ctx->priv;
      CGLError err;
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      CGLOpenGLProfile gl_versions[] = {
          kCGLOGLPVersion_3_2_Core,
          kCGLOGLPVersion_Legacy,
      };
 +#endif
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      for (int n = 0; n < MP_ARRAY_SIZE(gl_versions); n++) {
          err = test_gl_version(ctx->vo, &p->ctx, &p->pix, gl_versions[n]);
          if (err == kCGLNoError)
@@ -226,3 +124,139 @@
  
      if (err != kCGLNoError) {
          MP_FATAL(ctx->vo, "error creating CGL context: %s (%d)\n",
+@@ -164,4 +175,4 @@ const struct mpgl_driver mpgl_driver_coc
+     .swap_buffers   = cocoa_swap_buffers,
+     .control        = cocoa_control,
+     .uninit         = cocoa_uninit,
+-};
+\ No newline at end of file
++};
+--- video/out/opengl/formats.c.orig
++++ video/out/opengl/formats.c
+@@ -42,24 +42,49 @@ const struct gl_format gl_formats[] = {
+ 
+     // Non-normalized integer formats.
+     // Follows ES 3.0 as to which are color-renderable.
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_R8UI,                GL_RED_INTEGER,     T_U8,  F_CR | F_GL3 | F_ES3},
++#else
++    {GL_R8UI,                GL_RED_INTEGER_EXT, T_U8,  F_CR | F_GL3 | F_ES3},
++#endif
+     {GL_RG8UI,               GL_RG_INTEGER,      T_U8,  F_CR | F_GL3 | F_ES3},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB8UI,              GL_RGB_INTEGER,     T_U8,         F_GL3 | F_ES3},
+     {GL_RGBA8UI,             GL_RGBA_INTEGER,    T_U8,  F_CR | F_GL3 | F_ES3},
+     {GL_R16UI,               GL_RED_INTEGER,     T_U16, F_CR | F_GL3 | F_ES3},
++#else
++    {GL_RGB8UI_EXT,          GL_RGB_INTEGER_EXT,  T_U8,         F_GL3 | F_ES3},
++    {GL_RGBA8UI_EXT,         GL_RGBA_INTEGER_EXT, T_U8,  F_CR | F_GL3 | F_ES3},
++    {GL_R16UI,               GL_RED_INTEGER_EXT,  T_U16, F_CR | F_GL3 | F_ES3},
++#endif
+     {GL_RG16UI,              GL_RG_INTEGER,      T_U16, F_CR | F_GL3 | F_ES3},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB16UI,             GL_RGB_INTEGER,     T_U16,        F_GL3 | F_ES3},
+     {GL_RGBA16UI,            GL_RGBA_INTEGER,    T_U16, F_CR | F_GL3 | F_ES3},
++#else
++    {GL_RGB16UI_EXT,         GL_RGB_INTEGER_EXT,  T_U16,        F_GL3 | F_ES3},
++    {GL_RGBA16UI_EXT,        GL_RGBA_INTEGER_EXT, T_U16, F_CR | F_GL3 | F_ES3},
++#endif
+ 
+     // On GL3+ or GL2.1 with GL_ARB_texture_float, floats work fully.
+     {GL_R16F,                GL_RED,             T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
+     {GL_RG16F,               GL_RG,              T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB16F,              GL_RGB,             T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
+     {GL_RGBA16F,             GL_RGBA,            T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
++#else
++    {GL_RGB16F_ARB,          GL_RGB,             T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
++    {GL_RGBA16F_ARB,         GL_RGBA,            T_FL,  F_F16 | F_CF | F_GL3 | F_GL2F},
++#endif
+     {GL_R32F,                GL_RED,             T_FL,          F_CF | F_GL3 | F_GL2F},
+     {GL_RG32F,               GL_RG,              T_FL,          F_CF | F_GL3 | F_GL2F},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB32F,              GL_RGB,             T_FL,          F_CF | F_GL3 | F_GL2F},
+     {GL_RGBA32F,             GL_RGBA,            T_FL,          F_CF | F_GL3 | F_GL2F},
++#else
++    {GL_RGB32F_ARB,          GL_RGB,             T_FL,          F_CF | F_GL3 | F_GL2F},
++    {GL_RGBA32F_ARB,         GL_RGBA,            T_FL,          F_CF | F_GL3 | F_GL2F},
++#endif
+ 
+     // Note: we simply don't support float anything on ES2, despite extensions.
+     // We also don't bother with non-filterable float formats, and we ignore
+@@ -69,15 +94,25 @@ const struct gl_format gl_formats[] = {
+     // F_EXTF16 implies extensions that also enable 16 bit floats fully.
+     {GL_R16F,                GL_RED,             T_FL,  F_F16 | F_CF | F_ES32 | F_EXTF16},
+     {GL_RG16F,               GL_RG,              T_FL,  F_F16 | F_CF | F_ES32 | F_EXTF16},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB16F,              GL_RGB,             T_FL,  F_F16 | F_TF | F_ES32 | F_EXTF16},
+     {GL_RGBA16F,             GL_RGBA,            T_FL,  F_F16 | F_CF | F_ES32 | F_EXTF16},
++#else
++    {GL_RGB16F_ARB,          GL_RGB,             T_FL,  F_F16 | F_TF | F_ES32 | F_EXTF16},
++    {GL_RGBA16F_ARB,         GL_RGBA,            T_FL,  F_F16 | F_CF | F_ES32 | F_EXTF16},
++#endif
+ 
+     // On ES3.0+, 16 bit floats are texture-filterable.
+     // Don't bother with 32 bit floats; they exist but are neither CR nor TF.
+     {GL_R16F,                GL_RED,             T_FL,  F_F16 | F_TF | F_ES3},
+     {GL_RG16F,               GL_RG,              T_FL,  F_F16 | F_TF | F_ES3},
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     {GL_RGB16F,              GL_RGB,             T_FL,  F_F16 | F_TF | F_ES3},
+     {GL_RGBA16F,             GL_RGBA,            T_FL,  F_F16 | F_TF | F_ES3},
++#else
++    {GL_RGB16F_ARB,          GL_RGB,             T_FL,  F_F16 | F_TF | F_ES3},
++    {GL_RGBA16F_ARB,         GL_RGBA,            T_FL,  F_F16 | F_TF | F_ES3},
++#endif
+ 
+     // These might be useful as FBO formats.
+     {GL_RGB10_A2,            GL_RGBA,
+@@ -213,10 +248,19 @@ int gl_format_type(const struct gl_forma
+ GLenum gl_integer_format_to_base(GLenum format)
+ {
+     switch (format) {
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     case GL_RED_INTEGER:        return GL_RED;
++#else
++    case GL_RED_INTEGER_EXT:    return GL_RED;
++#endif
+     case GL_RG_INTEGER:         return GL_RG;
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     case GL_RGB_INTEGER:        return GL_RGB;
+     case GL_RGBA_INTEGER:       return GL_RGBA;
++#else
++    case GL_RGB_INTEGER_EXT:    return GL_RGB;
++    case GL_RGBA_INTEGER_EXT:   return GL_RGBA;
++#endif
+     }
+     return 0;
+ }
+@@ -239,7 +283,11 @@ int gl_format_components(GLenum format)
+ {
+     switch (format) {
+     case GL_RED:
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     case GL_RED_INTEGER:
++#else
++    case GL_RED_INTEGER_EXT:
++#endif
+     case GL_LUMINANCE:
+         return 1;
+     case GL_RG:
+@@ -247,10 +295,18 @@ int gl_format_components(GLenum format)
+     case GL_LUMINANCE_ALPHA:
+         return 2;
+     case GL_RGB:
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     case GL_RGB_INTEGER:
++#else
++    case GL_RGB_INTEGER_EXT:
++#endif
+         return 3;
+     case GL_RGBA:
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     case GL_RGBA_INTEGER:
++#else
++    case GL_RGBA_INTEGER_EXT:
++#endif
+         return 4;
+     }
+     return 0;

Added: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_utils.c-hide-pbo-texture-upload.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_utils.c-hide-pbo-texture-upload.diff	                        (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_utils.c-hide-pbo-texture-upload.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -0,0 +1,18 @@
+--- video/out/opengl/utils.c.orig
++++ video/out/opengl/utils.c
+@@ -1168,6 +1168,7 @@ void gl_pbo_upload_tex(struct gl_pbo_upl
+     pbo->index = (pbo->index + 1) % 2;
+ 
+     gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo->buffers[pbo->index]);
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     void *data = gl->MapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, needed_size,
+                                     GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
+     if (!data)
+@@ -1185,6 +1186,7 @@ void gl_pbo_upload_tex(struct gl_pbo_upl
+     gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ 
+     return;
++#endif
+ 
+ no_pbo:
+     gl_upload_tex(gl, target, format, type, dataptr, stride, x, y, w, h);

Added: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-fix-compile-warnings.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-fix-compile-warnings.diff	                        (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-fix-compile-warnings.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -0,0 +1,38 @@
+--- video/out/opengl/video.c.orig
++++ video/out/opengl/video.c
+@@ -897,7 +897,7 @@ static void uninit_video(struct gl_video
+         gl->DeleteTextures(1, &plane->gl_texture);
+         gl_pbo_upload_uninit(&plane->pbo);
+     }
+-    *vimg = (struct video_image){0};
++    *vimg = (struct video_image){{0}};
+ 
+     // Invalidate image_params to ensure that gl_video_config() will call
+     // init_video() on uninitialized gl_video.
+@@ -949,7 +949,7 @@ static void pass_prepare_src_tex(struct 
+ static void render_pass_quad(struct gl_video *p, int vp_w, int vp_h,
+                              const struct mp_rect *dst)
+ {
+-    struct vertex va[4] = {0};
++    struct vertex va[4] = {{{0}}};
+ 
+     struct gl_transform t;
+     gl_transform_ortho(&t, 0, vp_w, 0, vp_h);
+@@ -2844,7 +2844,7 @@ struct voctrl_performance_data gl_video_
+ // This assumes nv12, with textures set to GL_NEAREST filtering.
+ static void reinterleave_vdpau(struct gl_video *p, struct gl_hwdec_frame *frame)
+ {
+-    struct gl_hwdec_frame res = {0};
++    struct gl_hwdec_frame res = {{0}};
+     for (int n = 0; n < 2; n++) {
+         struct fbotex *fbo = &p->vdpau_deinterleave_fbo[n];
+         // This is an array of the 2 to-merge planes.
+@@ -2902,7 +2902,7 @@ static bool gl_video_upload_image(struct
+ 
+     if (p->hwdec_active) {
+         // Hardware decoding
+-        struct gl_hwdec_frame gl_frame = {0};
++        struct gl_hwdec_frame gl_frame = {{0}};
+         gl_timer_start(p->upload_timer);
+         bool ok = p->hwdec->driver->map_frame(p->hwdec, vimg->mpi, &gl_frame) >= 0;
+         gl_timer_stop(p->upload_timer);

Added: trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-remove-timer-functionality.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-remove-timer-functionality.diff	                        (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_opengl_video.c-remove-timer-functionality.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -0,0 +1,236 @@
+--- video/out/opengl/utils.c.orig
++++ video/out/opengl/utils.c
+@@ -999,6 +999,7 @@ void gl_sc_gen_shader_and_reset(struct g
+     gl_sc_reset(sc);
+ }
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ // Maximum number of simultaneous query objects to keep around. Reducing this
+ // number might cause rendering to block until the result of a previous query is
+ // available
+@@ -1124,6 +1125,7 @@ void gl_timer_stop(struct gl_timer *time
+     if (gl->EndQuery)
+         gl->EndQuery(GL_TIME_ELAPSED);
+ }
++#endif
+ 
+ // Upload a texture, going through a PBO. PBO supposedly can facilitate
+ // asynchronous copy from CPU to GPU, so this is an optimization. Note that
+--- video/out/opengl/utils.h.orig
++++ video/out/opengl/utils.h
+@@ -19,6 +19,10 @@
+ #ifndef MP_GL_UTILS_
+ #define MP_GL_UTILS_
+ 
++#ifdef __APPLE__
++#include <AvailabilityMacros.h>
++#endif
++
+ #include "common.h"
+ #include "math.h"
+ 
+@@ -170,6 +174,7 @@ void gl_sc_enable_extension(struct gl_sh
+ void gl_sc_gen_shader_and_reset(struct gl_shader_cache *sc);
+ void gl_sc_reset(struct gl_shader_cache *sc);
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ struct gl_timer;
+ 
+ struct gl_timer *gl_timer_create(GL *gl);
+@@ -181,6 +186,7 @@ int gl_timer_sample_count(struct gl_time
+ uint64_t gl_timer_last_us(struct gl_timer *timer);
+ uint64_t gl_timer_avg_us(struct gl_timer *timer);
+ uint64_t gl_timer_peak_us(struct gl_timer *timer);
++#endif
+ 
+ struct gl_pbo_upload {
+     GL *gl;
+--- video/out/opengl/video.c.orig
++++ video/out/opengl/video.c
+@@ -192,9 +192,11 @@ struct gl_video {
+     GLuint dither_texture;
+     int dither_size;
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     struct gl_timer *upload_timer;
+     struct gl_timer *render_timer;
+     struct gl_timer *present_timer;
++#endif
+ 
+     struct mp_image_params real_image_params;   // configured format
+     struct mp_image_params image_params;        // texture format (mind hwdec case)
+@@ -2407,7 +2409,9 @@ static void pass_render_frame(struct gl_
+     // start the render timer here. it will continue to the end of this
+     // function, to render the time needed to draw (excluding screen
+     // presentation)
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_start(p->render_timer);
++#endif
+ 
+     p->use_linear = p->opts.linear_scaling || p->opts.sigmoid_upscaling;
+     pass_read_video(p);
+@@ -2466,12 +2470,16 @@ static void pass_render_frame(struct gl_
+ 
+     pass_opt_hook_point(p, "SCALED", NULL);
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_stop(p->render_timer);
++#endif
+ }
+ 
+ static void pass_draw_to_screen(struct gl_video *p, int fbo)
+ {
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_start(p->present_timer);
++#endif
+ 
+     if (p->dumb_mode)
+         pass_render_frame_dumb(p, fbo);
+@@ -2498,7 +2506,9 @@ static void pass_draw_to_screen(struct g
+     pass_dither(p);
+     finish_pass_direct(p, fbo, p->vp_w, p->vp_h, &p->dst_rect);
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_stop(p->present_timer);
++#endif
+ }
+ 
+ // Draws an interpolate frame to fbo, based on the frame timing in t
+@@ -2677,6 +2687,7 @@ static void gl_video_interpolate_frame(s
+     p->frames_drawn += 1;
+ }
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ static void timer_dbg(struct gl_video *p, const char *name, struct gl_timer *t)
+ {
+     if (gl_timer_sample_count(t) > 0) {
+@@ -2686,6 +2697,7 @@ static void timer_dbg(struct gl_video *p
+                (int)gl_timer_peak_us(t));
+     }
+ }
++#endif
+ 
+ // (fbo==0 makes BindFramebuffer select the screen backbuffer)
+ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo)
+@@ -2798,10 +2810,12 @@ done:
+ 
+     p->frames_rendered++;
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     // Report performance metrics
+     timer_dbg(p, "upload", p->upload_timer);
+     timer_dbg(p, "render", p->render_timer);
+     timer_dbg(p, "present", p->present_timer);
++#endif
+ }
+ 
+ // vp_w/vp_h is the implicit size of the target framebuffer.
+@@ -2823,6 +2837,7 @@ void gl_video_resize(struct gl_video *p,
+         mpgl_osd_resize(p->osd, p->osd_rect, p->image_params.stereo_out);
+ }
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ static struct voctrl_performance_entry gl_video_perfentry(struct gl_timer *t)
+ {
+     return (struct voctrl_performance_entry) {
+@@ -2840,6 +2855,7 @@ struct voctrl_performance_data gl_video_
+         .present = gl_video_perfentry(p->present_timer),
+     };
+ }
++#endif
+ 
+ // This assumes nv12, with textures set to GL_NEAREST filtering.
+ static void reinterleave_vdpau(struct gl_video *p, struct gl_hwdec_frame *frame)
+@@ -2903,9 +2919,13 @@ static bool gl_video_upload_image(struct
+     if (p->hwdec_active) {
+         // Hardware decoding
+         struct gl_hwdec_frame gl_frame = {{0}};
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+         gl_timer_start(p->upload_timer);
++#endif
+         bool ok = p->hwdec->driver->map_frame(p->hwdec, vimg->mpi, &gl_frame) >= 0;
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+         gl_timer_stop(p->upload_timer);
++#endif
+         vimg->hwdec_mapped = true;
+         if (ok) {
+             struct mp_image layout = {0};
+@@ -2935,7 +2955,9 @@ static bool gl_video_upload_image(struct
+     // Software decoding
+     assert(mpi->num_planes == p->plane_count);
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_start(p->upload_timer);
++#endif
+ 
+ 
+     for (int n = 0; n < p->plane_count; n++) {
+@@ -2951,7 +2973,9 @@ static bool gl_video_upload_image(struct
+         gl->BindTexture(plane->gl_target, 0);
+     }
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_stop(p->upload_timer);
++#endif
+ 
+     return true;
+ 
+@@ -3188,9 +3212,11 @@ static void init_gl(struct gl_video *p)
+         gl->BindFramebuffer(GL_FRAMEBUFFER, 0);
+     }
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     p->upload_timer = gl_timer_create(p->gl);
+     p->render_timer = gl_timer_create(p->gl);
+     p->present_timer = gl_timer_create(p->gl);
++#endif
+ 
+     debug_check_gl(p, "after init_gl");
+ }
+@@ -3210,9 +3236,11 @@ void gl_video_uninit(struct gl_video *p)
+ 
+     gl->DeleteTextures(1, &p->lut_3d_texture);
+ 
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+     gl_timer_free(p->upload_timer);
+     gl_timer_free(p->render_timer);
+     gl_timer_free(p->present_timer);
++#endif
+ 
+     mpgl_osd_destroy(p->osd);
+ 
+--- video/out/opengl/video.h.orig
++++ video/out/opengl/video.h
+@@ -20,6 +20,10 @@
+ 
+ #include <stdbool.h>
+ 
++#ifdef __APPLE__
++#include <AvailabilityMacros.h>
++#endif
++
+ #include "options/m_option.h"
+ #include "sub/osd.h"
+ #include "common.h"
+@@ -158,7 +162,9 @@ void gl_video_render_frame(struct gl_vid
+ void gl_video_resize(struct gl_video *p, int vp_w, int vp_h,
+                      struct mp_rect *src, struct mp_rect *dst,
+                      struct mp_osd_res *osd);
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+ struct voctrl_performance_data gl_video_perfdata(struct gl_video *p);
++#endif
+ struct mp_csp_equalizer;
+ struct mp_csp_equalizer *gl_video_eq_ptr(struct gl_video *p);
+ void gl_video_eq_update(struct gl_video *p);
+--- video/out/vo_opengl.c.orig
++++ video/out/vo_opengl.c
+@@ -349,7 +349,9 @@ static int control(struct vo *vo, uint32
+         }
+         return true;
+     case VOCTRL_PERFORMANCE_DATA:
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+         *(struct voctrl_performance_data *)data = gl_video_perfdata(p->renderer);
++#endif
+         return true;
+     }
+ 

Modified: trunk/dports/multimedia/mpv/files/patch-video_out_vo_opengl.c-guard-GL3-and-backport-old-behavior.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_vo_opengl.c-guard-GL3-and-backport-old-behavior.diff	2016-09-28 08:32:33 UTC (rev 153257)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_vo_opengl.c-guard-GL3-and-backport-old-behavior.diff	2016-09-28 08:32:48 UTC (rev 153258)
@@ -1,31 +1,32 @@
 --- video/out/vo_opengl.c.orig
 +++ video/out/vo_opengl.c
-@@ -69,6 +69,9 @@ struct gl_priv {
-     int use_gl_debug;
-     int allow_sw;
-     int swap_interval;
-+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
-+    int current_swap_interval;
+@@ -24,6 +24,10 @@
+ #include <stdbool.h>
+ #include <assert.h>
+ 
++#ifdef __APPLE__
++#include <AvailabilityMacros.h>
 +#endif
-     int dwm_flush;
-     int opt_vsync_fences;
++
+ #include <libavutil/common.h>
  
-@@ -83,8 +86,10 @@ struct gl_priv {
+ #include "config.h"
+@@ -84,8 +88,10 @@ struct gl_priv {
      int last_pattern;
      int matches, mismatches;
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      GLsync vsync_fences[NUM_VSYNC_FENCES];
      int num_vsync_fences;
 +#endif
  };
  
  static void resize(struct gl_priv *p)
-@@ -124,13 +129,21 @@ static void draw_frame(struct vo *vo, st
+@@ -125,13 +131,21 @@ static void draw_frame(struct vo *vo, st
      struct gl_priv *p = vo->priv;
      GL *gl = p->gl;
  
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      if (gl->FenceSync && p->num_vsync_fences < p->opt_vsync_fences) {
          GLsync fence = gl->FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);;
          if (fence)
@@ -33,8 +34,8 @@
      }
 +#endif
  
-     gl_video_render_frame(p->renderer, frame, 0);
-+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+     gl_video_render_frame(p->renderer, frame, gl->main_fb);
++#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED < 1070
 +    // The playloop calls this last before waiting some time until it decides
 +    // to call flip_page(). Tell OpenGL to start execution of the GPU commands
 +    // while we sleep (this happens asynchronously).
@@ -43,11 +44,11 @@
  
      if (p->use_glFinish)
          gl->Finish();
-@@ -167,11 +180,13 @@ static void flip_page(struct vo *vo)
+@@ -168,11 +182,13 @@ static void flip_page(struct vo *vo)
              p->opt_pattern[0] = 0;
          }
      }
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++#if !defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
      while (p->opt_vsync_fences > 0 && p->num_vsync_fences >= p->opt_vsync_fences) {
          gl->ClientWaitSync(p->vsync_fences[0], GL_SYNC_FLUSH_COMMANDS_BIT, 1e9);
          gl->DeleteSync(p->vsync_fences[0]);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160928/b65a9977/attachment-0001.html>


More information about the macports-changes mailing list