Programming from vb.net

This forum is about all development around libVLC.
pedrollanes
New Cone
New Cone
Posts: 6
Joined: 02 Mar 2011 18:31

Programming from vb.net

Postby pedrollanes » 02 Mar 2011 18:35

Hello I’m makeing an application that shows 4 panels with a vlc player (AxAXVLC.AxVLCPlugin2) for each panel. Each player plays one picture(png;jpg;gif;etc) or a video(wmp;mov;etc) using this code:

Private Sub msReproducir(ByVal obj As Objeto, ByVal d As dsAlbum.dtContenidosRow)
Me.sem.WaitOne()
Try
Dim vlc As AxAXVLC.AxVLCPlugin2 = obj.obj
obj.pnl.BringToFront()
obj.pnl.Refresh()
Threading.Thread.Sleep(200)
If vlc.playlist IsNot Nothing AndAlso vlc.playlist.items.count > 0 Then
Try
If vlc.playlist IsNot Nothing Then
vlc.playlist.stop()
End If
vlc.playlist.items.clear()
Catch ex As Exception
End Try
End If
GC.Collect()
If My.Computer.FileSystem.FileExists(d.cUrlFinal) Then
vlc.playlist.add(d.cUrlFinal)
vlc.playlist.playItem(0)
Threading.Thread.Sleep(200)
End If
obj.pnl.SendToBack()
Catch ex As Exception
MsgI(ex.Message, "Reproducir")
Finally
Me.sem.ReleaseMutex()
End Try

End Sub

Where obj.pnl is a panel for hide the player while makes the change of the item to play. When play videos all going right but when I play images my application grows in memory and I don’t know if is a bug of the vlc player, or there is a function for release memory, or my code is not right. Please I need help urgently.
Thanks for all
Pedro Llanes (from spain).
Best regards.

over_2
New Cone
New Cone
Posts: 3
Joined: 03 Mar 2011 14:28

Re: Programming from vb.net

Postby over_2 » 03 Mar 2011 17:20

if everything is ok with except images then it should be about that plugin. Now i have a question :D - I downloaded a project that use axvlc but when i compile it it seems i need to register something dll , active x, or whatever, i just wanna know how u use this component?

pedrollanes
New Cone
New Cone
Posts: 6
Joined: 02 Mar 2011 18:31

Re: Programming from vb.net

Postby pedrollanes » 03 Mar 2011 18:06

There is no developer of vlc that could say me how I release memory after play a picture???
Please It's very urgent!!
Thank you

pedrollanes
New Cone
New Cone
Posts: 6
Joined: 02 Mar 2011 18:31

Re: Programming from vb.net

Postby pedrollanes » 03 Mar 2011 18:09

if everything is ok with except images then it should be about that plugin. Now i have a question :D - I downloaded a project that use axvlc but when i compile it it seems i need to register something dll , active x, or whatever, i just wanna know how u use this component?
when you execute the program says that a class need to be registered?? When It's ocurr may be in two cases I detected:
1- You haven't installed vlc programm (v.1.7 I have). In pc you need install to use axvlc.
2- You have 64 bits, and the dll causes problems with 64 bits.

over_2
New Cone
New Cone
Posts: 3
Joined: 03 Mar 2011 14:28

Re: Programming from vb.net

Postby over_2 » 04 Mar 2011 15:11

thank you man i think the problem comes from my x64 os.
About releasing the memory, of course i'm not a dev, you can use below code:
WeakReference w= new WeakReference(ObjectToDispose);
ObjectToDispose=null;
GC.Collect();
some times your object has a strong refrence(by gerenration).you can use this to weaken and then dispose it. sorry for my bad english , also i hope it works

pedrollanes
New Cone
New Cone
Posts: 6
Joined: 02 Mar 2011 18:31

Re: Programming from vb.net

Postby pedrollanes » 07 Mar 2011 13:31

thank you man i think the problem comes from my x64 os.
About releasing the memory, of course i'm not a dev, you can use below code:
WeakReference w= new WeakReference(ObjectToDispose);
ObjectToDispose=null;
GC.Collect();
some times your object has a strong refrence(by gerenration).you can use this to weaken and then dispose it. sorry for my bad english , also i hope it works
Don't worry for your english...mine is not good ... I'm happy for helping you.
Your code is not good for me because I'm not disposing the control axVLC, simply I'm clearing playlist and playing other picture (png). So I can't dispose the object axVLC. I think, that is a bug of axVLC, but I think I could be repaired Using this code below each play item, and a timer makeing it each 30 seconds:
Private Declare Auto Function SetProcessWorkingSetSize Lib "kernel32.dll" (ByVal procHandle As IntPtr, ByVal min As Int32, ByVal max As Int32) As Boolean
Dim Mem As Process
Mem = Process.GetCurrentProcess()
SetProcessWorkingSetSize(Mem.Handle, -1, -1)
Please, any developer of VLC... how could I order to axVLC, free memory used by reproduce item (picture). Thanks.

pedrollanes
New Cone
New Cone
Posts: 6
Joined: 02 Mar 2011 18:31

Re: Programming from vb.net

Postby pedrollanes » 10 Mar 2011 17:02

There is not any developer of Vlc dll for vb.net that could help me?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests