[vlc-devel] Re: Multiple instances of vlc have incorrect instance references

Tony Anecito adanecito at yahoo.com
Thu May 10 20:01:52 CEST 2007


I understand what you are saying and will give you more detail when I am in front of my computer at home.
   
  Here is more detail that hopefully does not confuse but it might be helpful.
   
  Environment: Windows 200, I have an java app and I am using jvlc bindings where I have two child windows (JInternalFrame) in a JDesktopPane.
   
  Sequence of events:
  1. I create two JInternalFrame one with a jvlc instance and one without (blank child).
  2. The JInternalFrame without the jvlc instance has focus initially.
  3. I then select via a mouse the JInternalFrame with the jvlc instance.
  4. I destroy the jvlc instance (libvlc instance) and create a new one for the Canvas since the jre destroys the windows peer that has the window handle for the Canvas.
  5. The new windows peer is created and after that occurs I create a new libvlc instance.
  6. I then call the vlc libvlc_video_set_parent() via the jvlc bindings and the values for the p_instance and window handle are not zero from the debug statement I put into the code.
  7. The vlc calls the vout_RequestWindow() and the  p_vout->p_libvlc is different value from the p_instance->p_libvlc_int that was used to store the windows handle using var_SetInteger and I get back the correct window handle value of 0 which causes a separate window to be drawn outside the java canvas.
   
   
  Now I run the same test but with only one child with the libvlc video step 7 above has matching libvlc instances so  get the correct window handle back and the video plays int the canvas as expected.
   
  So I was curious where in the code the p_vout->p_libvlc is set since that is part of the key for the retrieval of the window handle from the  var_Get( p_vout->p_libvlc, "drawable", &val ) function. The other part of the key for retrieval is the "drawable" string.
   
  Does that help more?
   
  Thanks,
  -Tony




Damien Fouilleul <damien.fouilleul at laposte.net> wrote:
  Tony,

I don't really understand anything you are saying, it is not possible to 
have a have vout without a matching libvlc instance.

Damien


Tony Anecito wrote:
> Hi All,
> 
> While working with vlc I noticed that there were multiple instances of 
> v_out with incorrect instance references to vlclib. I suspect this has 
> something to do with multiple windows being displayed and need to get 
> a question answered about vlc code in order to help.
> 
> What I have discovered in the windows environment that two calls to 
> get what should be the same instance to vlc come up with different 
> references. The fucntions I notice this in is:
> 
> 1. Setting a window handle to an instance of libvlc
> file: video.c (in vlc-trunk/src/control folder)
> function: libvlc_video_set_parent()
> statement: var_SetInteger(p_instance->p_libvlc_int, "drawable", (int)d);
> 
> 2. Retrieveing a window handle to an instance of libvlc
> file: vout_intf.c (in vlc-trunk/src/video_output folder)
> function: vout_RequestWindow()
> statement: var_Get( p_vout->p_libvlc, "drawable", &val );
> 
> When I do a call to setParent() and when a video is started the 
> reference for libvlc is different when two windows (one without a vlc 
> lib instance) I GET TWO DIFFERENT LIBVLC INSTANCES and there should 
> only be one! What this does is when switching between an application 
> with vlc embedded in a child window and in the same application a 
> child window without vlc the video pops out of the child window in a 
> separate standalone window because the call to RequestWindow points to 
> a different instance of vlc and the window handle returned from that 
> call in val is zero which causes a separate video output window to be 
> created.
> 
> So in order to help figure this out and potentially help the team I 
> need to know where in the code the p_vout-p_libvlc gets set. I 
> verified the call to setParent occurs once. I tried tracking down the 
> p_libvlc variable but no luck on finding where.
> 
> Thanks,
> -Tony
> 
>
> ------------------------------------------------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos. 
> 


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070510/d9d287eb/attachment.html>


More information about the vlc-devel mailing list