Page 1 of 1

Delphi with libVLC

Posted: 21 Jul 2009 09:59
by klchin
Hi,

I'm new to VLC and libVLC, i had converted some of the libVLC 1.0.0 header to Delphi 5.
If anyone needs it, please give me your email address.

I was able to open a media and play the video, but it had some problem.

When play the video with below steps many times, so far so good no problem,

1.a) press the "Open" button to pen a dialog - to specify the file, it will auto play
1.b) before or after stop, press "Play" button (without open dialog), it will call stop then play again

or

2.a) press then "Open" button to pen a dialog - to specify the file, it will auto play
2.b) press the "Stop" button to stop
2.c) follow 2.a


But with steps below, it randomly occured, always stuck on "libvlc_media_player_stop"

3.a) press the "Open" button to pen a dialog - to specify the file, it will auto play
3.b) before or after stop, 3.a


Can the experts tell me what wrong with my step/code.

Functions the general code use

hVlcHnd := libvlc_new( 0,@argv,@fVlcError );

DoStop Funcion
if Playing, libvlc_media_player_stop( hMPlayr,@fVlcError );
libvlc_event_attach( hEvents,mi_events[ncnt],vlcCallBack,PVOID(Self),@fVlcError );
libvlc_media_player_release( hMPlayr );


DoPlay Function
libvlc_media_player_set_hwnd( hMPlayr,PVOID(Self.Handle),@fVlcError );
libvlc_media_player_event_manager( hMPlayr,@fVlcError );
libvlc_event_attach( hEvents,mi_events[ncnt],vlcCallBack,PVOID(Self),@fVlcError );
libvlc_media_player_play( hMPlayr,@fVlcError );
libvlc_playlist_play( hVlcHnd,fVlcVideo,0,NIL,@fVlcError );


Play Function
will call DoStop
hVMedia := libvlc_media_new( hVlcHnd,PCHAR(FilePath),@fVlcError );
hMPlayr := libvlc_media_player_new_from_media( hVMedia,@fVlcError );
libvlc_media_release( hVMedia );
will call DoPlay



Reagrds,
KL Chin

Re: Delphi with libVLC

Posted: 21 Jul 2009 10:05
by Beardless2
Hi,

I also get the random deadlock on libvlc_media_player_stop in Delphi.

The way i got round it was to remove the parent object and then stop it, then reshow the hwnd of the video.

e.g.

oParent := Parent;
Parent:=Nil;
FVLC.MediaPlayer.stop; // this is the call to libvlc_media_player_stop
Parent:=oParent;

Its not a elegant fix, but seems to do the trick. Does that work for you?

Re: Delphi with libVLC

Posted: 21 Jul 2009 10:29
by klchin
Hi,

Thx for your reply,
BTW, I modify TTFPlayer - VLC Player for Delphi (0.9.2) (c)2008 by Keypad

I'm not sure which parent you refer to.

Are your refer to libvlc_media_player_set_hwnd( hMPlayr,PVOID(NIL),@fVlcError );

Can you email your source code to klchin@1asia.com.my?

Regards,
KL Chin

Re: Delphi with libVLC

Posted: 21 Jul 2009 13:06
by Beardless2
Basically i create a TWinControl, then i set vlc to draw its video on that TWinControl Handle. (i use the libvlc_media_player_set_drawable routine)

type
TVideoLanControl= class(TWinControl)
protected
procedure SetParent(AParent: TWinControl); override;
end;

procedure TVideoLanControl.SetParent(AParent: TWinControl);
begin
// inherited routine
Inherited SetParent(AParent);
// Media player video output is hwnd of panel
libvlc_media_player_set_drawable(FInstance,Self.Handle,Exception);
CheckException;
end;


I then place the TWinControl onto a TPanel which is on a TForm.

Then before i stop the video, i set the TWintrol Parent to be Nil, before setting it back to the TPanel again.

Does that help?

Re: Delphi with libVLC

Posted: 22 Jul 2009 05:59
by klchin
Hi Beardless2,

Thx for your tips, it works for me.
FYI, when calling 'libvlc_media_player_release' it also required to set the Parent to NIL also.

BTW, how far had you convert the header files?
Also do you had sample code to broadcast file, vcd and camera, becasue I did not
found any sample code from the web.

Re: Delphi with libVLC

Posted: 28 Jul 2009 11:29
by alex99
KL Chin
Hi.
Can you send me converted VLC 1 headers. I had 0.9 version and it works but with new 1 version I had problems.
------------------------
Thanks, I got it. :)

Re: Delphi with libVLC

Posted: 28 Jul 2009 11:59
by klchin
Hi,

Pls check your email.

Re: Delphi with libVLC

Posted: 18 Sep 2009 15:23
by trin
Hi,
Could you send me converted VLC 1 headers?
Thanks in advance

Re: Delphi with libVLC

Posted: 23 Sep 2009 04:56
by klchin
Hi Trin,

Wat is your email address?

Regards,
KL Chin

Re: Delphi with libVLC

Posted: 24 Sep 2009 11:52
by trin
Hi Trin,
Wat is your email address?
...
Hi KL Chin,
my email adress is:
d...o@i...s.it

thanks in advance,
Danilo

Re: Delphi with libVLC

Posted: 25 Sep 2009 04:14
by klchin
Hi Danilo,

Pls check your email.

Re: Delphi with libVLC

Posted: 07 Oct 2009 22:08
by mcbotha
Hi, could you please email me the headers for version 1 and/or 2.
My email address is mcbotha@gmail.com.

Regards

Re: Delphi with libVLC

Posted: 08 Oct 2009 10:00
by klchin
Hi mcbotha,

Pls check your email.

Re: Delphi with libVLC

Posted: 01 Dec 2009 17:50
by BobaL
Hi,
Could anyone email me the two headers ?
bobal@yopmail.com

Thx

Re: Delphi with libVLC

Posted: 02 Feb 2010 11:05
by Slavikk
Hi,

Could anyone email me the two headers ?
sonwol@yandex.ru

Thx

Re: Delphi with libVLC

Posted: 11 Feb 2010 00:34
by whome
Do anyone has VLC1.x headers for Delphi?
I would like to have one and can put .zip to a web page. There is so many asking it should probably be available somewhere for direct download.
thx
mailmur (a) yahoo.com

Re: Delphi with libVLC

Posted: 11 Feb 2010 02:57
by klchin
hi whome,

do you have other eamil account?
i had try [mailmur at yahoo.com], but failed.

Re: Delphi with libVLC

Posted: 22 Feb 2010 00:06
by Mukatai
Hi,

Can you email me the headers ?
draz72 (a) hotmail.fr

thank's
@+

Re: Delphi with libVLC

Posted: 06 Mar 2010 14:46
by whome
hi whome,
do you have other eamil account?
i had try [mailmur at yahoo.com], but failed.
Thx for trying, please try this account: aki_601 at hotmail.com

Re: Delphi with libVLC

Posted: 23 Mar 2010 10:17
by Mukatai
hello,
I have not received mail. :(
Can you try again on my profil mail or upload the files ? please

thank's
@+

Re: Delphi with libVLC

Posted: 23 Mar 2010 12:27
by Beardless2
why does't someone just post the header code in here? or publish it on an ftp somewhere

Re: Delphi with libVLC

Posted: 24 Mar 2010 04:47
by klchin
Hi Mukatai,

I had sent out on the 2010/03/06.
BTW, try this link http://60.49.242.118/cie_corp/Temp/Vlc/Default.htm

Re: Delphi with libVLC

Posted: 26 Mar 2010 10:37
by Mukatai
Thank's for your code :D

I tested your code but I miss TXdvTrakBar. i have the TMC Component Pack v5.0.3.0 with the component AdvTrackBar but it did not work. Is this normal?

Thank's

@+

Re: Delphi with libVLC

Posted: 29 Mar 2010 04:50
by klchin
Hi,

I had changed the code for my needs, due to AdVTrackBar had problem on drag during playing the movie,
so you had to enhance it or use other trackbar.

Regards.