Multiple instances with vmem issue

This forum is about all development around libVLC.
versor
New Cone
New Cone
Posts: 3
Joined: 23 Nov 2008 17:58

Multiple instances with vmem issue

Postby versor » 24 Nov 2008 20:16

Hi,

I'm trying to use libvlc as a frame server in my application. I use vmem to obtain frame data. LibVlc is initialized with something like this:

Code: Select all

argv = new string[]{ "--ignore-config", "--no-video-title-show", "--vout", "vmem", "--vmem-width", videoWidth.ToString(), "--vmem-height", videoHeight.ToString(), "--vmem-pitch", (videoWidth * BYTES_PER_PIXEL).ToString(), "--vmem-chroma", "RV32", "--vmem-lock", Marshal.GetFunctionPointerForDelegate(lock_delegate).ToInt64().ToString(), "--vmem-unlock", Marshal.GetFunctionPointerForDelegate(unlock_delegate).ToInt64().ToString() }; handle = libvlc_new(argv.Length, argv, exception);
When I'm using single instance, everything seems to be fine. However when i'm trying to make few instances of libvlc (making one after another instantly) all instances are using same callback address for vmem-lock and unlock.
In other words vmem is calling address of the function that it shouldn't be (one that is used with different libvlc instance).

erwan10
Developer
Developer
Posts: 415
Joined: 02 Nov 2008 23:16

Re: Multiple instances with vmem issue

Postby erwan10 » 28 Nov 2008 17:38

I experienced the same problem. The thing is that options passed to a new instance overwrite options from an older instance. I suppose this is eligible as a bug.

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:

Re: Multiple instances with vmem issue

Postby Jean-Baptiste Kempf » 29 Nov 2008 13:31

Possibly. VMEM is still very new.
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.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Multiple instances with vmem issue

Postby VLC_help » 29 Nov 2008 13:50

Someone send patches to mailing list related to this.
http://mailman.videolan.org/pipermail/v ... 53443.html

versor
New Cone
New Cone
Posts: 3
Joined: 23 Nov 2008 17:58

Re: Multiple instances with vmem issue

Postby versor » 03 Dec 2008 15:07

Indeed vmem options are overwritten. I resolved this by adding extra command line parameter that specifies a callback on vmem initialization. Then in this callback I set all the parameters instead of taking ones from command line.

I've looked into mailing list VLC_help suggested, but I still see problem with this solution. Generally we define video size before vmem initialization, so there is no way to use native video dimensions (because we don't know them before initialization).


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 33 guests