Integration of libvlc within an Wxwidgets application

*nix specific usage questions
EricOnVlc
Blank Cone
Blank Cone
Posts: 10
Joined: 05 Apr 2007 09:58

Integration of libvlc within an Wxwidgets application

Postby EricOnVlc » 05 Apr 2007 10:40

Hi all,

I was looking over the web and I found a nice tutorial to integrate Vlc to an Qt apps. http://doc.qtfr.org/post/2007/02/21/Integration-de-VLC

I was wondering if anybody as already done it with an Wxwidget apps devel?

I am using libvlc to integrate the player inside my wxwidget application. I have created an vlcInstance an now I'd like to attache it to my panel using

Code: Select all

libvlc_video_set_parent(_vlcinstance ,mywxPanel,&_vlcexcep);
Does anyone know if libvlc_drawable_t is compatible with a wxPanel?
Does anyone already tryed this implementation?

Thanks in advance for your answer
Eric

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 05 Apr 2007 12:13

Well, VLC's GUI IS written in wx.... so you should read that code.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

EricOnVlc
Blank Cone
Blank Cone
Posts: 10
Joined: 05 Apr 2007 09:58

Postby EricOnVlc » 06 Apr 2007 12:48

Thanks, I already know that the GUI of VLC is in Wxwidget but I have really no idea how to integrate to my existing Wxwidget application.

I try to use libvlc to implement Vlc inside my application. However my Vlc doesn't start when I m doing :

Code: Select all

libvlc_instance_t *_vlcinstance; _vlcinstance=libvlc_new(argc,argv,&_vlcexcep);
argc => number of arguments
argv => path to VLC

This function libvlc_new give me these errors :

Code: Select all

[00000013] main interface error: no interface module matched "hotkeys,none" [00000013] main interface error: no suitable interface module [00000001] main private error: interface "hotkeys,none" initialization failed [00000014] main interface error: no interface module matched "screensaver,none"
If I add the option --version. Those message doesn't appear but the constructor also crash with the message playlist initialization failed.

Does anyone already got those errors? Or already managed to use libvlc in an wxwidget app?

Thanks for any helps, links ... :)

EricOnVlc
Blank Cone
Blank Cone
Posts: 10
Joined: 05 Apr 2007 09:58

Postby EricOnVlc » 06 Apr 2007 13:02

I forgot some informations.

My program is running under linux. => Kubuntu 6.06

I have compiled VLC 0.8.6.a by hand and used for my app libvlc.a from this compilation. I got no error during the compilation and the compiled VLC is working fine.

Any ideas?

EricOnVlc
Blank Cone
Blank Cone
Posts: 10
Joined: 05 Apr 2007 09:58

Postby EricOnVlc » 10 Apr 2007 15:37

Hi all,

I got some of my problems fixed. However I got some question with the function void libvlc_video_set_parent (libvlc_instance_t *, libvlc_drawable_t ,libvlc_exception_t *)

This function is used for set the default video output parent. This settings will be used as default for all video outputs.

Code: Select all

Parameters: p_instance libvlc instance drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32) p_exception an initialized exception
I tryed to use libvlc_video_set_parent(_vlcinstance ,reinterpret_cast<libvlc_drawable_t>(m_vlcWindow),&_vlcexcep);
or libvlc_video_set_parent(_vlcinstance ,(libvlc_drawable_t)m_vlcWindow),&_vlcexcep);

but the drawable parameter doesn't work, I got an

Code: Select all

X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 7 (X_ReparentWindow) Resource id in failed request: 0x8770c00 Serial number of failed request: 220 Current serial number in output stream: 221
m_vlcWindow is an wxPanel, but it doesn't work.

Does anybody know what can be a drawable object for wxwidget which can be used with libvlc_video_set_parent?

I looked over the web but I didn't found any solution of wxwidget using libvlc.

Any helps welcome :roll:
Eric

Quietlife2k
Blank Cone
Blank Cone
Posts: 11
Joined: 21 Oct 2007 11:46

Re: Integration of libvlc within an Wxwidgets application

Postby Quietlife2k » 21 Oct 2007 12:47

Hi,
I'm having an identical problem with the .net binding and connecting the video output to a gtk# window on mono/linux.

I suspect that we (in our respective languages) need to get the underlying X11 window handle rather than the pseudo handle given to us by our toolkits.

At this point I'm stuck :-(

Hope this helps you anyway.

Quietlife2k
Blank Cone
Blank Cone
Posts: 11
Joined: 21 Oct 2007 11:46

Re: Integration of libvlc within an Wxwidgets application

Postby Quietlife2k » 24 Oct 2007 02:55

For what it's worth :
As my toolkit is gtk I could import libgdk-x11-2.0 and expose gdk_x11_drawable_get_xid which takes an IntPtr to the GdkWindow handle and returns and IntPtr pointing to an X11 drawable. Casting this to an int gets you the required parameter.

I hope that this can help point the way in your toolkit.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests