Multiple ActiveX VLC controls in MFC application

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
erj
Blank Cone
Blank Cone
Posts: 10
Joined: 07 Nov 2005 02:15

Multiple ActiveX VLC controls in MFC application

Postby erj » 10 May 2006 16:10

In my MFC C++ application I am trying to have two VLC activex controls side by side for multiple stream viewing. Everything works great until I shut down the application.

When the application is shutting down and the controls are being released I get an exception. The first VLC control CWnd.DestroyWindow() works fine, but the second takes an exception because it appears to be pointing to already released memory.

This could be an issue in my code, I am not sure. I was just wondering if anyone else was doing this with success? Could there be something in the activex control where it is sharing memory between the two controls?

Thanks for the help,
Ehren

Guest

Postby Guest » 19 Jul 2006 02:33

I have the same problem. When closing an IE window with 2 streaming videos it generates a memory error on occasion. I also get this error when I refresh the screen sometimes.

Bug??

uli_soehnel
Blank Cone
Blank Cone
Posts: 15
Joined: 27 Oct 2005 17:23
Location: Germany

Postby uli_soehnel » 18 Sep 2006 11:01

Hi eri,

I use in my application 4 different vlc windows at the same time and I have no problems when destroying my windows. But I use Xbase++ and not C++.
The only thing what I found is, that when you destroy a activex window of vlc and you want to recreate it, you have to wait because the destroy process takes time. But this is a problem of Xbase++

Uli

lemangw
New Cone
New Cone
Posts: 8
Joined: 15 Jan 2007 15:48

VLC activex controls

Postby lemangw » 15 Jan 2007 16:10

Hello!

I am trying to have only one VLC activex controls, but it does not work. Nothing appends, I only have the icon.

Could you help me? Do you have a code source, or any sample? What is the function to be used to set the URL to be played, how to use it?....

Many thanks, it seems that ther is nothing dealing with this subject (ActiveX MFC VC++...)

Thanks

G.

uli_soehnel
Blank Cone
Blank Cone
Posts: 15
Joined: 27 Oct 2005 17:23
Location: Germany

Postby uli_soehnel » 15 Jan 2007 16:28

I can give you some of my code. I assume, that you have correctly initialized the activex object, but it seems so because you see the icon in the window.

In xbase++ i use:
//Define an array to pass to vlc
//In my app the settings in the array do no function, but you have to
//pass an array
public aoptions:={}
aadd(aoptions,":brightness=2")
aadd(aoptions,":contrast=0")
aadd(aoptions,":saturation=0")
aadd(aoptions,":gamma=1")

//Initializing a window to use with vlc
bgwnd := XbpDialog():new( nda, , {200,200},{400,300},{ { GRA_CLR_YELLOW, GRA_CLR_BLACK } },.T.) //{224,151}
bgwnd:border:=XBPDLG_NO_BORDER
bgwnd:titlebar:=.F.
bgwnd:tasklist:=.F.
bgwnd:clipchildren:=.T.
bgwnd:create()
nda8:=bgwnd:drawingarea
nda8:setcolorbg(GRA_CLR_RED)

//Initializing the activex control
oP1 := XbpActiveXControl():new(nda8)
oP1:CLSID := "VideoLAN.VLCPlugin.1"
oP1:create(,,,nda8:currentsize())
// This are 3 examples to define the source for the player.
//Choose your way.
//oP1:addTarget('udp:@239.255.0.1', aoptions, 2, 0) //show multicast udp stream
//oP1:addTarget('http://192.168.0.4:8080', aoptions, 2, 0) // show http stream
oP1:addTarget("c:\movies\test.mpg", aoptions, 2, 0) // show file
//The possible commands and settings you can see in the documentation vlcax.chm
oP1:play()
oP1:volume:=50

If you don't have the documentation for vlcax.dll, give me an information by email hitech@t-online.de and I will send it to you.

Regards Uli

lemangw
New Cone
New Cone
Posts: 8
Joined: 15 Jan 2007 15:48

Postby lemangw » 15 Jan 2007 18:07

Thanks for your quick answer. Unfortunately, I do not know Xbase++, I work with VC6.0 and VS2005, and I already have a project in which I just would like to add a player, such as VLC ActiveX.

I do not manage to use the addTraget(...) function, I 've got an exception, and it seems that the put_MRL(...) function does nothing ...!?

To be honest, I don't understand why it is not simple and easy to use??!

angelo0802
New Cone
New Cone
Posts: 3
Joined: 12 Jan 2007 09:25

addTraget function

Postby angelo0802 » 16 Jan 2007 02:14

ok, i have sucessed. the sample code:

VARIANT v;
long pos = 0;
LPSAFEARRAY pSA = SafeArrayCreateVector(VT_VARIANT, 0, 1);
_variant_t var(_bstr_t("deinterlace-mode=mode"));
SafeArrayPutElement(pSA, &pos, (void FAR *)&var);
v.parray = pSA;
v.vt = VT_ARRAY;

m_VLCControl.put_Visible(TRUE);
m_VLCControl.addTarget("http://people.videolan.org/~dionoea/vlc ... /sw_3M.mov", v, CVlcplugin1::VLCPlayListInsertAndGo, 10);
m_VLCControl.put_Position(0);
m_VLCControl.put_Time(0);
m_VLCControl.put_AutoPlay(TRUE);
m_VLCControl.play();


but when the program exit, the assertion error happens.
i dont know how to solve it

anildhameliya
New Cone
New Cone
Posts: 1
Joined: 01 Mar 2007 07:41

Postby anildhameliya » 04 Apr 2007 09:20

VC6.0 and VS2005
add VLC activex control
then,

just set the property
mrl
url (with port number)

run application while streaming server running

knight730
New Cone
New Cone
Posts: 5
Joined: 22 Jan 2008 09:41

Re: Multiple ActiveX VLC controls in MFC application

Postby knight730 » 23 Jan 2008 09:15

I have the same question!
Nobody knows why?


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 11 guests