mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
examples: fix macOS 9.12 deprecation warnings
Add #defines to allow older versions of macOS to use the new constant names.
This commit is contained in:
parent
f805608075
commit
2c9b513695
2 changed files with 16 additions and 3 deletions
|
@ -25,6 +25,10 @@
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
#include <CoreMedia/CoreMedia.h>
|
#include <CoreMedia/CoreMedia.h>
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||||
|
#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
|
||||||
|
#endif
|
||||||
|
|
||||||
static NSRunLoop *loop;
|
static NSRunLoop *loop;
|
||||||
static int quit = 0;
|
static int quit = 0;
|
||||||
|
|
||||||
|
@ -97,7 +101,7 @@ gint main (gint argc, gchar *argv[])
|
||||||
g_object_get (videosink, "layer", &layer, NULL);
|
g_object_get (videosink, "layer", &layer, NULL);
|
||||||
|
|
||||||
NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect (0, 0, 320, 240)
|
NSWindow *window = [[NSWindow alloc] initWithContentRect:NSMakeRect (0, 0, 320, 240)
|
||||||
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
|
styleMask:NSWindowStyleMaskBorderless backing:NSBackingStoreBuffered defer:NO];
|
||||||
[window setOpaque:NO];
|
[window setOpaque:NO];
|
||||||
[window.contentView setWantsLayer:YES];
|
[window.contentView setWantsLayer:YES];
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,14 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/video/videooverlay.h>
|
#include <gst/video/videooverlay.h>
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||||
|
#define NSEventMaskAny NSAnyEventMask
|
||||||
|
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||||
|
#define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||||
|
#define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||||
|
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
/* */
|
/* */
|
||||||
/* MainWindow */
|
/* MainWindow */
|
||||||
|
@ -48,7 +56,8 @@
|
||||||
m_isClosed = FALSE;
|
m_isClosed = FALSE;
|
||||||
|
|
||||||
self = [super initWithContentRect: contentRect
|
self = [super initWithContentRect: contentRect
|
||||||
styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask)
|
styleMask: (NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
||||||
|
NSWindowStyleMaskResizable | NSWindowStyleMaskMiniaturizable)
|
||||||
backing: NSBackingStoreBuffered defer: NO screen: nil];
|
backing: NSBackingStoreBuffered defer: NO screen: nil];
|
||||||
|
|
||||||
[self setReleasedWhenClosed:NO];
|
[self setReleasedWhenClosed:NO];
|
||||||
|
@ -211,7 +220,7 @@ int main(int argc, char **argv)
|
||||||
[window orderFront:window];
|
[window orderFront:window];
|
||||||
|
|
||||||
while (![window isClosed]) {
|
while (![window isClosed]) {
|
||||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask
|
NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny
|
||||||
untilDate:[NSDate dateWithTimeIntervalSinceNow:1]
|
untilDate:[NSDate dateWithTimeIntervalSinceNow:1]
|
||||||
inMode:NSDefaultRunLoopMode dequeue:YES];
|
inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||||
if (event)
|
if (event)
|
||||||
|
|
Loading…
Reference in a new issue