On May 2, 2007, at 8:17 PM, Joerg Desch wrote:

> I'm looking for a way to use FLTK for an DirectShow video display.  
> I've found a library which must be called from within an separate  
> thread. This library waits for a new video frame (inside the  
> thread) and returns after a frame is fetched. Now I have a RGB  
> frame, but
>
> * whats the fastest way to display the frame with fltk 1.1.*  
> running windows? Do I have to subclass a widget? Which one?
> * should I use fltk's thread?
> * can I use fltk to draw (lines/text) into the frame?

Phew, that's a lot of questions.

Usually, video images are not sent into RAM, but decoded by hardware  
and written directly into the graphics board memory or into an  
overlay system. If you use this (and DirectShow often does), you need  
to provide a window handle hWin to DirectShow. DirectShow will then  
take care of the rest. Due to the nature of overlays, you will not be  
able to draw on top of the video frame though. FLTK returns the hWnd  
by calling fl_xid().

If you realy *do* get the uncompressed RGB data, then you can either  
use a MSWindows native command like BitBlt to move the image data  
over, or use OpenGL and texture mapping (which allows for fantastic  
video effects), or use the FLTK Fl_RGB_Image interface which can  
create an image from RGB data. The most efficient version is likely  
the first one, but I doubt that any of those will play TV-sized video  
on a smaller machine without skipping frames.

FLTK does not provide threads. It does provide an example code in the  
test directory, and it does provide some simple locking mechanism  
which you probably will use. You find documentation on this in  
chapter 10 of the curren FLTK 1.1.8 documentation.

You can use any widget as a prototype for your video output since you  
will have to programm pretty much everything anyways. I like to start  
with Fl_Box, simply because it is minimal and renders a box by default.

> For now I've always written fixed sized applications with fltk. How  
> do I resize a main window (note, there are some buttons below  
> `video frame widget') where the `video frame widget' depends on the  
> selected video size. I need to resize it from within the  
> application. The user should not be able to resize it.

Read the docs for "Fl_Group::resizable()", then search for "resizing"  
in the archives. Several articles were written on that. You can then  
play around with resizable widgets using Fluids "live mode".

----
http://robowerk.com/


_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to