mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
gl/eagl: Notify the window's resize callback about surface dimension changes
https://bugzilla.gnome.org/show_bug.cgi?id=728107
This commit is contained in:
parent
d462e7f6df
commit
a6f5b079d8
1 changed files with 17 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
#endif
|
||||
|
||||
#import <OpenGLES/EAGL.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include "gstglwindow_eagl.h"
|
||||
|
@ -229,6 +230,22 @@ draw_cb (gpointer data)
|
|||
GstGLContextEagl *eagl_context = GST_GL_CONTEXT_EAGL (context);
|
||||
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
|
||||
|
||||
if (window_eagl->view) {
|
||||
CGSize size;
|
||||
CAEAGLLayer *eagl_layer;
|
||||
|
||||
eagl_layer = (CAEAGLLayer *)[window_eagl->priv->view layer];
|
||||
size = eagl_layer.frame.size;
|
||||
|
||||
if (window_eagl->priv->window_width != size.width || window_eagl->priv->window_height != size.height) {
|
||||
window_eagl->priv->window_width = size.width;
|
||||
window_eagl->priv->window_height = size.height;
|
||||
|
||||
if (window->resize_cb)
|
||||
window->resize_cb (window->resize_data, size.width, size.height);
|
||||
}
|
||||
}
|
||||
|
||||
gst_gl_context_eagl_prepare_draw (eagl_context);
|
||||
|
||||
if (window->draw)
|
||||
|
|
Loading…
Reference in a new issue