[maemo-developers] [maemo-developers] gtk, gstreamer movie window = problem
From: cmonst cmonst at gmail.comDate: Thu Oct 26 15:11:54 EEST 2006
- Previous message: [maemo-developers] gtk, gstreamer movie window = problem
- Next message: [maemo-developers] gtk, gstreamer movie window = problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi!
I tried to solve this problem but still the same happens. I'm running
program from xterm so I think I don't need osso_initialize(), and on
console I don't get any error messages. This is code I'm using (I'm
out of ideas what can be wrong):
//main gui function
gui(){
HildonProgram *app;
/* Create the hildon application and setup the title */
app = HILDON_PROGRAM (hildon_program_get_instance ());
g_set_application_name ("Menu Example App");
/* Create HildonAppView and set it to HildonApp */
appview = HILDON_WINDOW (hildon_window_new ());
hildon_program_add_window (app, appview);
/* Create menu for view */
create_menu (appview);
///box1 = gtk_hbox_new (FALSE, 0);
///box2 = gtk_vbox_new (homogeneous, spacing);
///label = gtk_label_new ("Volume:");
///gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
///gtk_box_pack_start (GTK_BOX (box2), label, FALSE, FALSE, 0);
///gtk_widget_show (label);
///adj1 = gtk_adjustment_new (1.0, 0.0, 4.0, 0.1, 1.0, 1.0);
///g_signal_connect (G_OBJECT (adj1), "value_changed",G_CALLBACK
(cb_digits_scale), NULL);
///scale = gtk_vscrollbar_new (GTK_ADJUSTMENT (adj1));
///gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0);
///gtk_box_pack_start (GTK_BOX (box1), box2, expand, fill, padding);
content = gtk_event_box_new ();
gtk_container_add (GTK_CONTAINER (appview), content);
GstBus *bus;
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, NULL);
gst_object_unref (bus);
g_signal_connect (content, "expose-event", G_CALLBACK (cb_expose), videosink);
//gtk_box_pack_start (GTK_BOX (box1), content, TRUE, TRUE, padding);
///gtk_container_add (GTK_CONTAINER (appview), box1);
///gtk_widget_show (box1);
gtk_widget_show_all (appview);
g_signal_connect(G_OBJECT(appview), "delete_event",
G_CALLBACK(item_close_cb), NULL);
}
//callback functins
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
{
XGCValues values;
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))
return GST_BUS_PASS;
// ignore anything but 'prepare-xwindow-id' element messages
content = gtk_event_box_new ();
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY
(GST_MESSAGE_SRC (message)), content->window);
return GST_BUS_DROP;
}
cb_expose (GtkWidget * w, GdkEventExpose * ev, GstElement * e)
{
if (GST_IS_X_OVERLAY (e) &&
!GTK_WIDGET_NO_WINDOW (w) && GTK_WIDGET_REALIZED (w))
{
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (e),
GDK_WINDOW_XWINDOW (w->window));
}
}
>
> As described in
> http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html#desc
>
> you need to set it in a message handler in order to set it at the right time.
>
>
> This sounds indeed like the element creates the window itself instead
> of using the one you want.
>
> --
> Kalle Vahlman, zuh at iki.fi
> Powered by http://movial.fi
> Interesting stuff at http://syslog.movial.fi
>
--
Regards,
-= Bartosz Put =-
- Previous message: [maemo-developers] gtk, gstreamer movie window = problem
- Next message: [maemo-developers] gtk, gstreamer movie window = problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
