please help - I'm stumped
- From: sajit r93aag000117 sbo ma cable rcn com
- To: gtk-list redhat com
- Subject: please help - I'm stumped
- Date: Sat, 17 Jul 1999 04:32:42 -0400
For the last few months I've been trying to write a gtk application that reads
data from a video card and shows the video in a window. I don't understand
how to write an equivalent of the gtk_main_loop but with calls to the framegrabber
thrown in.
I've tried the following approach:
----------------------
GtkWidget *mainwin, *imgwin;
GdkImage *im;
/* make a main window */
mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/* make a gdkimage */
im = gdk_image_new(GDK_IMAGE_NORMAL, gtk_widget_get_visual(mainwin), width, height);
/* make an image window*/
imgwin = gtk_image_new(im, NULL);
/* specify exit callback for main window */
gtk_signal_connect (GTK_OBJECT (mainwin), "delete_event",
GTK_SIGNAL_FUNC (destroy_main), NULL);
/* add the image window to the main window */
gtk_container_add(GTK_CONTAINER (mainwin), imgwin);
/* go into the main loop */
for(;;)
{
while(gtk_events_pending())
gtk_main_iteration_do (FALSE);
getframe(im->mem); /* This grabs the image and shoves it into the image */
gtk_widget_show(imgwin);
gtk_widget_show(mainwin);
gdk_flush();
}
-----------------------------------------
But it simply loads the first image and freezes, it doesn't refresh. It doesn't
respond to the delete_event either.
What am I doing wrong? and How do i fix it to display video at frame rate?
(The framegrabber, does work - I've been able to display video with other programs )
Thanks in advance,
Sajit
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]