osxvideosink: allow switching views at runtime.
This commit is contained in:
parent
c209a6ab40
commit
3fdd51952b
@ -424,11 +424,20 @@ gst_osx_video_sink_set_xwindow_id (GstXOverlay * overlay, gulong window_id)
|
|||||||
|
|
||||||
if (osxvideosink->superview) {
|
if (osxvideosink->superview) {
|
||||||
GST_INFO_OBJECT (osxvideosink, "old xwindow id %p", osxvideosink->superview);
|
GST_INFO_OBJECT (osxvideosink, "old xwindow id %p", osxvideosink->superview);
|
||||||
|
if (osxvideosink->osxwindow) {
|
||||||
|
[osxvideosink->osxwindow->gstview
|
||||||
|
performSelectorOnMainThread:@selector(removeFromSuperview:)
|
||||||
|
withObject:(id)nil waitUntilDone:YES];
|
||||||
|
}
|
||||||
[osxvideosink->superview release];
|
[osxvideosink->superview release];
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_INFO_OBJECT (osxvideosink, "set xwindow id 0x%lx", window_id);
|
GST_INFO_OBJECT (osxvideosink, "set xwindow id 0x%lx", window_id);
|
||||||
osxvideosink->superview = [((NSView *) window_id) retain];
|
osxvideosink->superview = [((NSView *) window_id) retain];
|
||||||
|
if (osxvideosink->osxwindow) {
|
||||||
|
[osxvideosink->osxwindow->gstview performSelectorOnMainThread:@selector(addToSuperview:)
|
||||||
|
withObject:osxvideosink->superview waitUntilDone:YES];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user