|
Line 0
a/Tools/efl/patches/gst-plugins-bad-remove-gnustep-support.patch_sec1
|
|
|
1 |
From 13c8517570c3550b5c46a3cb0ff7f8b7888a4ddf Mon Sep 17 00:00:00 2001 |
| 2 |
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com> |
| 3 |
Date: Thu, 13 Nov 2014 11:58:07 +0100 |
| 4 |
Subject: gl/cocoa: Remove GNUStep support |
| 5 |
|
| 6 |
Until gcc and GNUStep properly support Objective-C blocks and other |
| 7 |
"new" features of Objective-C we can't properly support them without |
| 8 |
making the code much more ugly. |
| 9 |
|
| 10 |
https://bugzilla.gnome.org/show_bug.cgi?id=739152 |
| 11 |
|
| 12 |
diff --git a/configure.ac b/configure.ac |
| 13 |
index fdb6c88..120cd44 100644 |
| 14 |
--- a/configure.ac |
| 15 |
+++ b/configure.ac |
| 16 |
@@ -611,7 +611,7 @@ AC_ARG_ENABLE([glx], |
| 17 |
esac],[NEED_GLX=auto]) |
| 18 |
|
| 19 |
AC_ARG_ENABLE([cocoa], |
| 20 |
- [ --enable-cocoa Enable Cocoa support (using GNUstep on non OS X platforms) @<:@default=auto@:>@], |
| 21 |
+ [ --enable-cocoa Enable Cocoa support @<:@default=auto@:>@], |
| 22 |
[case "${enableval}" in |
| 23 |
yes) NEED_COCOA=yes ;; |
| 24 |
no) NEED_COCOA=no ;; |
| 25 |
@@ -653,7 +653,6 @@ save_LIBS="$LIBS" |
| 26 |
HAVE_GL=no |
| 27 |
HAVE_GLES2=no |
| 28 |
HAVE_GLU=no |
| 29 |
-HAVE_GNUSTEP_COCOA=no |
| 30 |
HAVE_WAYLAND_EGL=no |
| 31 |
|
| 32 |
HAVE_EGL_RPI=no |
| 33 |
@@ -744,35 +743,6 @@ case $host in |
| 34 |
;; |
| 35 |
esac |
| 36 |
|
| 37 |
-case $host in |
| 38 |
- *-darwin* ) ;; |
| 39 |
- *) |
| 40 |
- AC_PATH_PROG([GNUSTEP_CONFIG],[gnustep-config]) |
| 41 |
- if test "x$GNUSTEP_CONFIG" != "x"; then |
| 42 |
- GNUSTEP_HOST="`$GNUSTEP_CONFIG --variable=GNUSTEP_HOST`" |
| 43 |
- case $host in |
| 44 |
- *-mingw* ) |
| 45 |
- case $GNUSTEP_HOST in |
| 46 |
- *-mingw* ) |
| 47 |
- HAVE_GNUSTEP_COCOA=yes |
| 48 |
- ;; |
| 49 |
- esac |
| 50 |
- ;; |
| 51 |
- * ) |
| 52 |
- HAVE_GNUSTEP_COCOA=yes |
| 53 |
- ;; |
| 54 |
- esac |
| 55 |
- fi |
| 56 |
- ;; |
| 57 |
-esac |
| 58 |
- |
| 59 |
-AC_MSG_CHECKING([for GNUstep]) |
| 60 |
-if test "x$HAVE_GNUSTEP_COCOA" = "xyes" ; then |
| 61 |
- AC_MSG_RESULT([yes]) |
| 62 |
-else |
| 63 |
- AC_MSG_RESULT([no]) |
| 64 |
-fi |
| 65 |
- |
| 66 |
CPPFLAGS="$save_CPPFLAGS" |
| 67 |
LIBS="$save_LIBS" |
| 68 |
|
| 69 |
@@ -1009,19 +979,6 @@ case $host in |
| 70 |
fi |
| 71 |
fi |
| 72 |
fi |
| 73 |
- |
| 74 |
- dnl GNUstep provides the Cocoa API on unix |
| 75 |
- if test "x$NEED_COCOA" != "xno"; then |
| 76 |
- if test "x$HAVE_GNUSTEP_COCOA" = "xyes" ; then |
| 77 |
- GNUSTEP_OBJCFLAGS="`$GNUSTEP_CONFIG --objc-flags`" |
| 78 |
- GNUSTEP_LIBS="`$GNUSTEP_CONFIG --gui-libs`" |
| 79 |
- GL_LIBS="$GL_LIBS $GNUSTEP_LIBS -lgnustep-gui -lgnustep-base" |
| 80 |
- GL_OBJCFLAGS="$GL_OBJCFLAGS $GNUSTEP_OBJCFLAGS" |
| 81 |
- |
| 82 |
- USE_COCOA=yes |
| 83 |
- HAVE_WINDOW_COCOA=yes |
| 84 |
- fi |
| 85 |
- fi |
| 86 |
;; |
| 87 |
*-darwin*) |
| 88 |
if test "x$HAVE_IOS" = "xyes"; then |
| 89 |
@@ -1114,17 +1071,6 @@ case $host in |
| 90 |
fi |
| 91 |
fi |
| 92 |
fi |
| 93 |
- |
| 94 |
- dnl GNUstep provides the Cocoa API on win32 |
| 95 |
- if test "x$HAVE_GNUSTEP_COCOA" = "xyes" ; then |
| 96 |
- GNUSTEP_CFLAGS="`$GNUSTEP_CONFIG --objc-flags`" |
| 97 |
- GNUSTEP_LIBS="`$GNUSTEP_CONFIG --gui-libs`" |
| 98 |
- GL_LIBS="$GL_LIBS $GNUSTEP_LIBS -lgnustep-gui -lgnustep-base" |
| 99 |
- GL_OBJCFLAGS="$OBJCFLAGS $GNUSTEP_CFLAGS" |
| 100 |
- |
| 101 |
- USE_COCOA=yes |
| 102 |
- HAVE_WINDOW_COCOA=yes |
| 103 |
- fi |
| 104 |
;; |
| 105 |
*) |
| 106 |
AC_MSG_WARN([Don't know how to check for OpenGL on your platform.]) |
| 107 |
diff --git a/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m b/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m |
| 108 |
index 94da0bc..84e3a99 100644 |
| 109 |
--- a/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m |
| 110 |
+++ b/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m |
| 111 |
@@ -40,7 +40,6 @@ static GstGLPlatform gst_gl_context_cocoa_get_gl_platform (GstGLContext * contex |
| 112 |
|
| 113 |
G_DEFINE_TYPE (GstGLContextCocoa, gst_gl_context_cocoa, GST_GL_TYPE_CONTEXT); |
| 114 |
|
| 115 |
-#ifndef GNUSTEP |
| 116 |
static GMutex nsapp_lock; |
| 117 |
static GCond nsapp_cond; |
| 118 |
|
| 119 |
@@ -96,16 +95,12 @@ gst_gl_window_cocoa_nsapp_iteration (gpointer data) |
| 120 |
|
| 121 |
return TRUE; |
| 122 |
} |
| 123 |
-#endif |
| 124 |
|
| 125 |
static void |
| 126 |
gst_gl_context_cocoa_class_init (GstGLContextCocoaClass * klass) |
| 127 |
{ |
| 128 |
GstGLContextClass *context_class = (GstGLContextClass *) klass; |
| 129 |
- |
| 130 |
-#ifndef GNUSTEP |
| 131 |
NSAutoreleasePool* pool = nil; |
| 132 |
-#endif |
| 133 |
|
| 134 |
g_type_class_add_private (klass, sizeof (GstGLContextCocoaPrivate)); |
| 135 |
|
| 136 |
@@ -121,7 +116,6 @@ gst_gl_context_cocoa_class_init (GstGLContextCocoaClass * klass) |
| 137 |
context_class->get_gl_platform = |
| 138 |
GST_DEBUG_FUNCPTR (gst_gl_context_cocoa_get_gl_platform); |
| 139 |
|
| 140 |
-#ifndef GNUSTEP |
| 141 |
pool = [[NSAutoreleasePool alloc] init]; |
| 142 |
|
| 143 |
/* [NSApplication sharedApplication] will usually be |
| 144 |
@@ -191,7 +185,6 @@ gst_gl_context_cocoa_class_init (GstGLContextCocoaClass * klass) |
| 145 |
} |
| 146 |
|
| 147 |
[pool release]; |
| 148 |
-#endif |
| 149 |
} |
| 150 |
|
| 151 |
static void |
| 152 |
@@ -219,9 +212,7 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api, |
| 153 |
GstGLWindowCocoa *window_cocoa = GST_GL_WINDOW_COCOA (window); |
| 154 |
__block NSOpenGLContext *glContext = nil; |
| 155 |
|
| 156 |
-#ifndef GNUSTEP |
| 157 |
priv->source_id = g_timeout_add (200, gst_gl_window_cocoa_nsapp_iteration, NULL); |
| 158 |
-#endif |
| 159 |
|
| 160 |
priv->gl_context = nil; |
| 161 |
if (other_context) |
| 162 |
@@ -243,9 +234,6 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api, |
| 163 |
|
| 164 |
pool = [[NSAutoreleasePool alloc] init]; |
| 165 |
|
| 166 |
-#ifdef GNUSTEP |
| 167 |
- [NSApplication sharedApplication]; |
| 168 |
-#endif |
| 169 |
rect.origin.x = 0; |
| 170 |
rect.origin.y = 0; |
| 171 |
rect.size.width = 320; |
| 172 |
@@ -265,7 +253,6 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api, |
| 173 |
|
| 174 |
[window_handle setContentView:glView]; |
| 175 |
|
| 176 |
-#ifndef GNUSTEP |
| 177 |
glContext = [[NSOpenGLContext alloc] initWithFormat:fmt |
| 178 |
shareContext:context_cocoa->priv->external_gl_context]; |
| 179 |
|
| 180 |
@@ -275,10 +262,6 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api, |
| 181 |
|
| 182 |
[glContext setView:glView]; |
| 183 |
|
| 184 |
-#else |
| 185 |
- /* FIXME try to make context sharing work in GNUstep */ |
| 186 |
- context_cocoa->priv->gl_context = glContext; |
| 187 |
-#endif |
| 188 |
[pool release]; |
| 189 |
}); |
| 190 |
|
| 191 |
@@ -300,11 +283,7 @@ gst_gl_context_cocoa_create_context (GstGLContext *context, GstGLAPI gl_api, |
| 192 |
*/ |
| 193 |
NS_DURING { |
| 194 |
if (glContext) { |
| 195 |
-#ifdef GNUSTEP |
| 196 |
- const long swapInterval = 1; |
| 197 |
-#else |
| 198 |
const GLint swapInterval = 1; |
| 199 |
-#endif |
| 200 |
[glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; |
| 201 |
} |
| 202 |
} NS_HANDLER { |
| 203 |
diff --git a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m |
| 204 |
index 0771662..d776477 100644 |
| 205 |
--- a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m |
| 206 |
+++ b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m |
| 207 |
@@ -257,11 +257,9 @@ draw_cb (gpointer data) |
| 208 |
x += 20; |
| 209 |
y += 20; |
| 210 |
|
| 211 |
-#ifndef GNUSTEP |
| 212 |
[priv->internal_win_id setFrame:windowRect display:NO]; |
| 213 |
GST_DEBUG ("make the window available\n"); |
| 214 |
[priv->internal_win_id makeMainWindow]; |
| 215 |
-#endif |
| 216 |
|
| 217 |
[priv->internal_win_id orderFrontRegardless]; |
| 218 |
|
| 219 |
@@ -457,17 +455,6 @@ close_window_cb (gpointer data) |
| 220 |
} |
| 221 |
|
| 222 |
- (void) applicationWillTerminate:(NSNotification *)aNotification { |
| 223 |
-#ifdef GNUSTEP |
| 224 |
- /* fixes segfault with gst-launch-1.0 -e ... and sending SIGINT (Ctrl-C) |
| 225 |
- * which causes GNUstep to run a signal handler in the main thread. |
| 226 |
- * However that thread has never been 'registered' with GNUstep so |
| 227 |
- * the autorelease magic of objective-c causes a segfault from accessing |
| 228 |
- * a null NSThread object somewhere deep in GNUstep. |
| 229 |
- * |
| 230 |
- * I put it here because this is the first time we can register the thread. |
| 231 |
- */ |
| 232 |
- GSRegisterCurrentThread(); |
| 233 |
-#endif |
| 234 |
} |
| 235 |
|
| 236 |
@end |
| 237 |
@@ -488,9 +475,7 @@ close_window_cb (gpointer data) |
| 238 |
|
| 239 |
window_cocoa = window; |
| 240 |
|
| 241 |
-#ifndef GNUSTEP |
| 242 |
[self setWantsLayer:NO]; |
| 243 |
-#endif |
| 244 |
|
| 245 |
/* Get notified about changes */ |
| 246 |
[self setPostsFrameChangedNotifications:YES]; |
| 247 |
diff --git a/tests/examples/gl/cocoa/cocoa-videooverlay.m b/tests/examples/gl/cocoa/cocoa-videooverlay.m |
| 248 |
index 683abe1..9c5fc9a 100755 |
| 249 |
--- a/tests/examples/gl/cocoa/cocoa-videooverlay.m |
| 250 |
+++ b/tests/examples/gl/cocoa/cocoa-videooverlay.m |
| 251 |
@@ -136,15 +136,8 @@ static void end_stream_cb(GstBus* bus, GstMessage* message, MainWindow* window) |
| 252 |
|
| 253 |
static gpointer thread_func (MainWindow* window) |
| 254 |
{ |
| 255 |
-#ifdef GNUSTEP |
| 256 |
- GSRegisterCurrentThread(); |
| 257 |
-#endif |
| 258 |
- |
| 259 |
g_main_loop_run ([window loop]); |
| 260 |
|
| 261 |
-#ifdef GNUSTEP |
| 262 |
- GSUnregisterCurrentThread(); |
| 263 |
-#endif |
| 264 |
return NULL; |
| 265 |
} |
| 266 |
|
| 267 |
@@ -172,10 +165,6 @@ int main(int argc, char **argv) |
| 268 |
NSAutoreleasePool *pool=nil; |
| 269 |
NSRect rect; |
| 270 |
MainWindow *window=nil; |
| 271 |
- |
| 272 |
-#ifdef GNUSTEP |
| 273 |
- GstState state; |
| 274 |
-#endif |
| 275 |
|
| 276 |
g_print("app created\n"); |
| 277 |
|
| 278 |
@@ -203,18 +192,8 @@ int main(int argc, char **argv) |
| 279 |
if (!ok) |
| 280 |
g_warning("could not link videosrc to videosink\n"); |
| 281 |
|
| 282 |
-#ifdef GNUSTEP |
| 283 |
- gst_element_set_state (pipeline, GST_STATE_PAUSED); |
| 284 |
- state = GST_STATE_PAUSED; |
| 285 |
- gst_element_get_state (pipeline, &state, &state, GST_CLOCK_TIME_NONE); |
| 286 |
- g_print("pipeline paused\n"); |
| 287 |
- GSRegisterCurrentThread(); |
| 288 |
-#endif |
| 289 |
- |
| 290 |
pool = [[NSAutoreleasePool alloc] init]; |
| 291 |
-#ifndef GNUSTEP |
| 292 |
[NSApplication sharedApplication]; |
| 293 |
-#endif |
| 294 |
|
| 295 |
rect.origin.x = 0; rect.origin.y = 0; |
| 296 |
rect.size.width = width; rect.size.height = height; |
| 297 |
@@ -236,7 +215,6 @@ int main(int argc, char **argv) |
| 298 |
|
| 299 |
[window orderFront:window]; |
| 300 |
|
| 301 |
-#ifndef GNUSTEP |
| 302 |
while (![window isClosed]) { |
| 303 |
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask |
| 304 |
untilDate:[NSDate dateWithTimeIntervalSinceNow:1] |
| 305 |
@@ -244,7 +222,6 @@ int main(int argc, char **argv) |
| 306 |
if (event) |
| 307 |
[NSApp sendEvent:event]; |
| 308 |
} |
| 309 |
-#endif |
| 310 |
|
| 311 |
g_thread_join (loop_thread); |
| 312 |
|
| 313 |
@@ -252,9 +229,5 @@ int main(int argc, char **argv) |
| 314 |
|
| 315 |
[pool release]; |
| 316 |
|
| 317 |
-#ifdef GNUSTEP |
| 318 |
- GSUnregisterCurrentThread(); |
| 319 |
-#endif |
| 320 |
- |
| 321 |
return 0; |
| 322 |
} |
| 323 |
-- |
| 324 |
2.0.0.rc2 |
| 325 |
|