summaryrefslogtreecommitdiffstats
path: root/sys/osxvideo
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2007-03-16 16:27:20 +0000
committerEdward Hervey <bilboed@bilboed.com>2007-03-16 16:27:20 +0000
commit64c3e76a841e69a67c3497355a261ad94a457f54 (patch)
tree85bbf0aee186c3b61c82177137efc8ec639917e2 /sys/osxvideo
parenta0a99f1096c82288ed4767ba15019d1027f01104 (diff)
sys/osxvideo/osxvideosink.m: Emit 'have-ns-view' message when working in embedded mode. The message will contain a po...
Original commit message from CVS: * sys/osxvideo/osxvideosink.m: Emit 'have-ns-view' message when working in embedded mode. The message will contain a pointer to the newly created NSView.
Diffstat (limited to 'sys/osxvideo')
-rw-r--r--sys/osxvideo/osxvideosink.m22
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/osxvideo/osxvideosink.m b/sys/osxvideo/osxvideosink.m
index a521d068..faac2fb1 100644
--- a/sys/osxvideo/osxvideosink.m
+++ b/sys/osxvideo/osxvideosink.m
@@ -256,6 +256,9 @@ gst_osx_video_sink_osxwindow_new (GstOSXVideoSink * osxvideosink, gint width,
// insert event dispatch in the glib main loop
g_idle_add ((GSourceFunc) cocoa_event_loop, osxvideosink);
} else {
+ GstStructure *s;
+ GstMessage *msg;
+ gchar * tmp;
/* Needs to be embedded */
rect.origin.x = 0.0;
@@ -264,11 +267,20 @@ gst_osx_video_sink_osxwindow_new (GstOSXVideoSink * osxvideosink, gint width,
rect.size.height = (float) osxwindow->height;
osxwindow->gstview =[[GstGLView alloc] initWithFrame:rect];
[osxwindow->gstview autorelease];
- /* send signal
- FIXME: need to send a bus message */
- /*g_signal_emit (G_OBJECT(osxvideosink),
- gst_osx_video_sink_signals[SIGNAL_VIEW_CREATED], 0,
- osxwindow->gstview); */
+
+ s = gst_structure_new ("have-ns-view",
+ "nsview", G_TYPE_POINTER, osxwindow,
+ nil);
+
+ tmp = gst_structure_to_string (s);
+ GST_DEBUG_OBJECT (osxvideosink, "Sending message %s",
+ tmp);
+ g_free (tmp);
+
+ msg = gst_message_new_element (GST_OBJECT (osxvideosink), s);
+ gst_element_post_message (GST_ELEMENT (osxvideosink), msg);
+
+ GST_LOG_OBJECT (osxvideosink, "'have-ns-view' message sent");
}
return osxwindow;
}