[vlc-devel] Re: Drawing the VLC video

lastrainson lastrainson at gmail.com
Fri Apr 14 16:29:58 CEST 2006


I finally managed to get VLC render in a Qt widget. ^_^

One problem remains though. As the mouse pass over the widget rendering the
video or the vizualization for audio file, the libVLC instance automagically
gain the focus and respond to keyboard events for example. In the
application program I'm developing it can cause quite a real mess out there
if the user can do whatever his / her want to using VLC built-in keyboard
accelerators. Moreover, if the VLC rendering zone gets focus, my application
can't handle keyboard events anymore while the mouse cursor is over the
rendering zone, and I really need to process them. I would be glad if
someone could give me a way or even an idea to explore for me to be able to
overcome my problem.

PS : I do the rendering ala netscape plugin method : I get a Handle / X11
window ID / Whatever and do a VLC_SetVariable(instance, "drawable",
what_i_got). It would probably be a solution to change my way to render the
video but the only available way I know to do this, is to write a special
video out (vout) plugin for it to be directly interfaced with the VLC core
and my app. Please tell me if I'm wrong, but I think it would be a very
complex and time-consuming task.

Anyway, any help is greatly appreciated ;-)

Thanks

Guillaume


On 4/11/06, lastrainson <lastrainson at gmail.com> wrote:
>
> Hey again !
>
> After digging into the vlc mozilla plugin code, I managed to get a mini C
> libvlc player that uses alsa + xv for rendering. I didn't manage to learn
> how to render inside a widget or anything else than a standalone vout_plugin
> window though.
> When looking inside the NPP_SetWindow function inside vlcshell.cpp, it
> seems that vlc is told to render inside the browser using these two lines :
>
>     value.i_int = (int) (ptrdiff_t) (void *) window->window;
>     VLC_VariableSet( p_plugin->i_vlc, "drawable", value );
>
> The fact is that I don't really understand what is actually passed to
> libVLC. the window variable is a NPWindow* and window->window is a
> platform-dependant value that corresponds to the window ID under X11, HWND
> under win32 and NP_PORT under OSX. Does that mean that to render inside a
> widget, i have to find this window unique ID so that libvlc renders directly
> into the application window? If true, what are the variables I should set
> using VLC_VariableSet under each platform to actually get the rendering
> working?
>
> Thanks again.
>
>
> On 3/23/06, Benjamin Pracht < bigben+spam at videolan.org> wrote:
> >
> > Le jeudi 23 mars 2006 à 08:57 +0100, lastrainson a écrit :
> > > Hello everyone.
> > >
> > > This is my first post here, therefore I hope I'm posting at the right
> > > place.
> > >
> > > I would like to write an application program which would embed the VLC
> >
> > > library for embedded video playing and that would be written in Qt. I
> > > looked into the VLC code but I must admit that I'm a little confused
> > > about how and what I should work with to have my video playing inside
> > > a QWidget for example. What I'd like is to code my own Qt widget that
> > > would draw itself by calling what should render the video inside the
> > > VLC code.
> > >
> >
> > Well, this is possible using libvlc... You may want to have al look at
> > the code of the mozilla plugin to have an instance of how to use the
> > API. Don't hesitate to ask any further question.
> >
> > --
> > BigBen
> >
> > --
> > This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
> > To unsubscribe, please read http://developers.videolan.org/lists.html
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20060414/27ddec33/attachment.html>


More information about the vlc-devel mailing list