mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
osxvideosink: fix setting window handle after transition
The destroyed flag was not reset properly and it's also not needed as we can check osxwindow != NULL
This commit is contained in:
parent
4a78a77e65
commit
bb980775f8
2 changed files with 12 additions and 13 deletions
|
@ -135,8 +135,6 @@ GType gst_osx_video_sink_get_type(void);
|
||||||
|
|
||||||
@interface GstOSXVideoSinkObject : NSObject
|
@interface GstOSXVideoSinkObject : NSObject
|
||||||
{
|
{
|
||||||
BOOL destroyed;
|
|
||||||
|
|
||||||
@public
|
@public
|
||||||
GstOSXVideoSink *osxvideosink;
|
GstOSXVideoSink *osxvideosink;
|
||||||
}
|
}
|
||||||
|
|
|
@ -862,7 +862,7 @@ gst_osx_video_sink_get_type (void)
|
||||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
GstBuffer *buf = object->buf;
|
GstBuffer *buf = object->buf;
|
||||||
|
|
||||||
if (!destroyed)
|
if (osxvideosink->osxwindow != NULL)
|
||||||
{
|
{
|
||||||
gst_buffer_map (buf, &info, GST_MAP_READ);
|
gst_buffer_map (buf, &info, GST_MAP_READ);
|
||||||
viewdata = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer];
|
viewdata = (guint8 *) [osxvideosink->osxwindow->gstview getTextureBuffer];
|
||||||
|
@ -880,25 +880,26 @@ gst_osx_video_sink_get_type (void)
|
||||||
-(void) destroy
|
-(void) destroy
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
|
GstOSXWindow *osxwindow;
|
||||||
|
|
||||||
pool = [[NSAutoreleasePool alloc] init];
|
pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
destroyed = TRUE;
|
osxwindow = osxvideosink->osxwindow;
|
||||||
|
|
||||||
if (osxvideosink->osxwindow) {
|
|
||||||
if (osxvideosink->superview) {
|
|
||||||
[osxvideosink->osxwindow->gstview removeFromSuperview];
|
|
||||||
}
|
|
||||||
[osxvideosink->osxwindow->gstview release];
|
|
||||||
if (osxvideosink->osxwindow->internal) {
|
|
||||||
if (!osxvideosink->osxwindow->closed) {
|
|
||||||
osxvideosink->osxwindow->closed = TRUE;
|
|
||||||
[osxvideosink->osxwindow->win release];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (osxvideosink->osxwindow);
|
|
||||||
osxvideosink->osxwindow = NULL;
|
osxvideosink->osxwindow = NULL;
|
||||||
|
|
||||||
|
if (osxwindow) {
|
||||||
|
if (osxvideosink->superview) {
|
||||||
|
[osxwindow->gstview removeFromSuperview];
|
||||||
|
}
|
||||||
|
[osxwindow->gstview release];
|
||||||
|
if (osxwindow->internal) {
|
||||||
|
if (!osxwindow->closed) {
|
||||||
|
osxwindow->closed = TRUE;
|
||||||
|
[osxwindow->win release];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (osxwindow);
|
||||||
}
|
}
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue