mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
Revert "eagl: Don't dispatch_sync() to the main thread if we are on the main thread"
This reverts commit 0bff481011
.
It wasn't supposed to be merged and also doesn't fix the problem.
This commit is contained in:
parent
281a13efa1
commit
ad579b73e6
1 changed files with 10 additions and 31 deletions
|
@ -168,7 +168,7 @@ gst_gl_context_eagl_update_layer (GstGLContext * context)
|
||||||
if (priv->eagl_layer)
|
if (priv->eagl_layer)
|
||||||
gst_gl_context_eagl_release_layer (context);
|
gst_gl_context_eagl_release_layer (context);
|
||||||
|
|
||||||
void (^create_block) (void) = ^{
|
dispatch_sync (dispatch_get_main_queue (), ^{
|
||||||
eagl_layer = (CAEAGLLayer *)[window_handle layer];
|
eagl_layer = (CAEAGLLayer *)[window_handle layer];
|
||||||
[EAGLContext setCurrentContext:priv->eagl_context];
|
[EAGLContext setCurrentContext:priv->eagl_context];
|
||||||
|
|
||||||
|
@ -194,13 +194,7 @@ gst_gl_context_eagl_update_layer (GstGLContext * context)
|
||||||
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
|
||||||
GL_RENDERBUFFER, depth_renderbuffer);
|
GL_RENDERBUFFER, depth_renderbuffer);
|
||||||
[EAGLContext setCurrentContext:nil];
|
[EAGLContext setCurrentContext:nil];
|
||||||
};
|
});
|
||||||
|
|
||||||
if ([NSThread isMainThread]) {
|
|
||||||
create_block ();
|
|
||||||
} else {
|
|
||||||
dispatch_sync (dispatch_get_main_queue (), create_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
[EAGLContext setCurrentContext:priv->eagl_context];
|
[EAGLContext setCurrentContext:priv->eagl_context];
|
||||||
|
|
||||||
|
@ -230,7 +224,7 @@ gst_gl_context_eagl_create_context (GstGLContext * context, GstGLAPI gl_api,
|
||||||
GstGLContextEagl *context_eagl = GST_GL_CONTEXT_EAGL (context);
|
GstGLContextEagl *context_eagl = GST_GL_CONTEXT_EAGL (context);
|
||||||
GstGLContextEaglPrivate *priv = context_eagl->priv;
|
GstGLContextEaglPrivate *priv = context_eagl->priv;
|
||||||
|
|
||||||
void (^create_block) (void) = ^{
|
dispatch_sync (dispatch_get_main_queue (), ^{
|
||||||
if (other_context) {
|
if (other_context) {
|
||||||
EAGLContext *external_gl_context = (EAGLContext *)
|
EAGLContext *external_gl_context = (EAGLContext *)
|
||||||
gst_gl_context_get_gl_context (other_context);
|
gst_gl_context_get_gl_context (other_context);
|
||||||
|
@ -241,14 +235,8 @@ gst_gl_context_eagl_create_context (GstGLContext * context, GstGLAPI gl_api,
|
||||||
} else {
|
} else {
|
||||||
priv->eagl_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
priv->eagl_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
if ([NSThread isMainThread]) {
|
|
||||||
create_block ();
|
|
||||||
} else {
|
|
||||||
dispatch_sync (dispatch_get_main_queue (), create_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->eagl_layer = NULL;
|
priv->eagl_layer = NULL;
|
||||||
priv->framebuffer = 0;
|
priv->framebuffer = 0;
|
||||||
priv->color_renderbuffer = 0;
|
priv->color_renderbuffer = 0;
|
||||||
|
@ -296,26 +284,17 @@ gst_gl_context_eagl_choose_format (GstGLContext * context, GError ** error)
|
||||||
gst_object_unref (window);
|
gst_object_unref (window);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void (^create_block) (void) = ^{
|
dispatch_sync (dispatch_get_main_queue (), ^{
|
||||||
CAEAGLLayer *eagl_layer;
|
CAEAGLLayer *eagl_layer;
|
||||||
NSDictionary * dict =[NSDictionary dictionaryWithObjectsAndKeys:
|
NSDictionary * dict =[NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
[NSNumber numberWithBool:NO],
|
[NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking,
|
||||||
kEAGLDrawablePropertyRetainedBacking,
|
kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
|
||||||
kEAGLColorFormatRGBA8,
|
|
||||||
kEAGLDrawablePropertyColorFormat,
|
|
||||||
nil];
|
|
||||||
|
|
||||||
eagl_layer = (CAEAGLLayer *)[window_handle layer];
|
eagl_layer = (CAEAGLLayer *)[window_handle layer];
|
||||||
[eagl_layer setOpaque:YES];
|
[eagl_layer setOpaque:YES];
|
||||||
[eagl_layer setDrawableProperties:dict];
|
[eagl_layer setDrawableProperties:dict];
|
||||||
};
|
});
|
||||||
|
|
||||||
if ([NSThread isMainThread]) {
|
|
||||||
create_block ();
|
|
||||||
} else {
|
|
||||||
dispatch_sync (dispatch_get_main_queue (), create_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_object_unref (window);
|
gst_object_unref (window);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue