problem displaying rgb images on window



Hi,
I am writing an application using GTK+ (version 2.10.0) for x86 pc.
Iam decoding an mp4 video stream and displaying the RGB data on the window.
This is in a loop.

while(!feof(fp))
{

decode(); //decodes one frame of mp4 data to yuv format
convert_yuv_to_rgb(); //converts one frame of decoded  yuv data to rgb
format

/* Iam using the following code to render the rgb data on display window */

pixbuf =
gdk_pixbuf_new_from_data(rgb_buffer,0,0,8,width,height,width,NULL,NULL);
gtk_image_set_from_pixbuf(image_display,pixbuf);
gtk_widget_show_all(display_window); //image_display is contained in this
window
g_object_unref(pixbuf);

}

Now my problem is that the decoding and conversion is happening at a very
high rate but the display changes only once in a while and out of 370 frames
decoded only abt 8 to 10 are displayed. I also observed that clicking on the
application or any button increases the number of frames displayed.
Please let me know the solution to this or if there is any better way to
display rgb images on the window.

Thanks



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]