Delphi with libVLC

This forum is about all development around libVLC.
klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Delphi with libVLC

Postby klchin » 21 Jul 2009 09:59

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

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: Delphi with libVLC

Postby Beardless2 » 21 Jul 2009 10:05

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?

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 21 Jul 2009 10:29

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

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: Delphi with libVLC

Postby Beardless2 » 21 Jul 2009 13:06

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?

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 22 Jul 2009 05:59

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.

alex99
New Cone
New Cone
Posts: 2
Joined: 28 Jul 2009 11:24

Re: Delphi with libVLC

Postby alex99 » 28 Jul 2009 11:29

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. :)
Last edited by alex99 on 28 Jul 2009 12:51, edited 1 time in total.

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 28 Jul 2009 11:59

Hi,

Pls check your email.

trin
New Cone
New Cone
Posts: 2
Joined: 15 Sep 2009 16:49

Re: Delphi with libVLC

Postby trin » 18 Sep 2009 15:23

Hi,
Could you send me converted VLC 1 headers?
Thanks in advance

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 23 Sep 2009 04:56

Hi Trin,

Wat is your email address?

Regards,
KL Chin

trin
New Cone
New Cone
Posts: 2
Joined: 15 Sep 2009 16:49

Re: Delphi with libVLC

Postby trin » 24 Sep 2009 11:52

Hi Trin,
Wat is your email address?
...
Hi KL Chin,
my email adress is:
d...o@i...s.it

thanks in advance,
Danilo
Last edited by trin on 02 Oct 2009 12:03, edited 1 time in total.

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 25 Sep 2009 04:14

Hi Danilo,

Pls check your email.

mcbotha
New Cone
New Cone
Posts: 3
Joined: 08 Sep 2007 14:38

Re: Delphi with libVLC

Postby mcbotha » 07 Oct 2009 22:08

Hi, could you please email me the headers for version 1 and/or 2.
My email address is mcbotha@gmail.com.

Regards

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 08 Oct 2009 10:00

Hi mcbotha,

Pls check your email.

BobaL
New Cone
New Cone
Posts: 8
Joined: 01 Dec 2009 17:40

Re: Delphi with libVLC

Postby BobaL » 01 Dec 2009 17:50

Hi,
Could anyone email me the two headers ?
bobal@yopmail.com

Thx

Slavikk
New Cone
New Cone
Posts: 1
Joined: 02 Feb 2010 11:01

Re: Delphi with libVLC

Postby Slavikk » 02 Feb 2010 11:05

Hi,

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

Thx

whome
Blank Cone
Blank Cone
Posts: 37
Joined: 14 Jun 2008 15:40

Re: Delphi with libVLC

Postby whome » 11 Feb 2010 00:34

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

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 11 Feb 2010 02:57

hi whome,

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

Mukatai
New Cone
New Cone
Posts: 4
Joined: 22 Feb 2010 00:00

Re: Delphi with libVLC

Postby Mukatai » 22 Feb 2010 00:06

Hi,

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

thank's
@+

whome
Blank Cone
Blank Cone
Posts: 37
Joined: 14 Jun 2008 15:40

Re: Delphi with libVLC

Postby whome » 06 Mar 2010 14:46

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

Mukatai
New Cone
New Cone
Posts: 4
Joined: 22 Feb 2010 00:00

Re: Delphi with libVLC

Postby Mukatai » 23 Mar 2010 10:17

hello,
I have not received mail. :(
Can you try again on my profil mail or upload the files ? please

thank's
@+

Beardless2
Cone that earned his stripes
Cone that earned his stripes
Posts: 125
Joined: 02 Feb 2007 09:53

Re: Delphi with libVLC

Postby Beardless2 » 23 Mar 2010 12:27

why does't someone just post the header code in here? or publish it on an ftp somewhere

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 24 Mar 2010 04:47

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

Mukatai
New Cone
New Cone
Posts: 4
Joined: 22 Feb 2010 00:00

Re: Delphi with libVLC

Postby Mukatai » 26 Mar 2010 10:37

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

@+

klchin
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2009 18:19

Re: Delphi with libVLC

Postby klchin » 29 Mar 2010 04:50

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.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests