C# Wrapper for libvlc 0.9.0 - Testers Required

This forum is about all development around libVLC.
Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Jean-Baptiste Kempf » 23 Jun 2008 21:58

Personlly, I rate myself as a power user... but I too would very much like to see a better gui for VLC - especially one that has a more modern "Windows" feel. It's actually been on the top of my wish-list for quite some time.
There is a new GUI in VLC 0.9.0, and this isn't the object of this thread...
But wtf does "a more modern Windows feel" mean ?
Office, Live Messenger, Live Mail, Outlook, WMP, Explorer have all a different look, so what is a windows feel ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 24 Jun 2008 05:04

There is a new GUI in VLC 0.9.0, and this isn't the object of this thread...
I agree, the purpose of this thread is to test the wrapper and inform people of new releases.
But wtf does "a more modern Windows feel" mean ?
Office, Live Messenger, Live Mail, Outlook, WMP, Explorer have all a different look, so what is a windows feel ?
I think he is referring to Vista's transition to a black colour scheme and how the interface I have been working on fits well with that and glossy screens. VLC's interface is still based upon a style found in business applications and Win2K colour schemes. I know its a result of the cross-OS development tool chain, but Windows users only see the end product and first impressions count.
Will the "power-user" options still be available, but tucked away? Or will they simply be inaccessible with the C# wrapper/gui ?
Anything that is required to watch media will be exposed. I may create a power user version and add some advanced features to it at a later stage. The main purpose of this interface is to serve as a coding example, so I want to keep the features to a mininium and that fits well with deploying it to new users.
The preview screenshots look quite attractive. The black with blue-icons.. nice. Will it be skinnable, or at least have a colour chooser, like WMP does?
Not at this point. That may be a feature of a power user's version. The code will be open source and I'm sure there will be a lot of variations in time.

ltwally
Blank Cone
Blank Cone
Posts: 14
Joined: 15 Apr 2008 05:21

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby ltwally » 24 Jun 2008 20:36

Personlly, I rate myself as a power user... but I too would very much like to see a better gui for VLC - especially one that has a more modern "Windows" feel. It's actually been on the top of my wish-list for quite some time.
...and this isn't the object of this thread...
I did not know that there was another place to discuss the end-user type questions I had about Marx's C# work. Feel free to move my posts to that thread, if it exists.
There is a new GUI in VLC 0.9.0, ....
But wtf does "a more modern Windows feel" mean ?
Office, Live Messenger, Live Mail, Outlook, WMP, Explorer have all a different look, so what is a windows feel ?
I think he is referring to Vista's transition to a black colour scheme and how the interface I have been working on fits well with that and glossy screens. VLC's interface is still based upon a style found in business applications and Win2K colour schemes...
I didn't come here looking to start a flame war, or to insult you. I will only say that I have used VLC for about 4 years, and in that time VLC's interface has not changed, and is really starting to feel out-dated. And, yes, I have tested a 0.9 beta... I was not a fan of the new GUI. So, one of the advantages I'm hoping for with Marx's project is something that just plain looks nicer. I'm sorry if that offends you.

Teddy
New Cone
New Cone
Posts: 1
Joined: 25 Jun 2008 11:21

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Teddy » 25 Jun 2008 15:40

Great :D
I am looking for a vlc-c#-Wrapper, but the wrapper for the version 0.86 are not very good.

Your C#-Wrapper for 0.9 ist fantistic.
five minutes, and a winforms-app is written :lol:
Of cause, I'am interesting on the new "test-version" on the wrapper.

Now, I miss two functions in the libvlc-api:
- to get the total frames of the video
- to get the current frame-position in the video

And I have problems with the function "pause". The video will not halted on the current position. After the stop, the video will start 1-2 second after the pause.
If I use "stop", the period of time is lower

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 26 Jun 2008 14:53

Your C#-Wrapper for 0.9 ist fantistic.
five minutes, and a winforms-app is written :lol:
Of cause, I'am interesting on the new "test-version" on the wrapper.
It makes the whole process a lot easier. I started out several weeks ago with those old wrappers and I wasn't impressed either. The redesign of libvlc has help a lot though.
Now, I miss two functions in the libvlc-api:
- to get the total frames of the video
- to get the current frame-position in the video
I'm working on it, I just need some free time. Then I'll finish off the wrapper and release it.
And I have problems with the function "pause". The video will not halted on the current position. After the stop, the video will start 1-2 second after the pause.
If I use "stop", the period of time is lower
The pause function causing a delayed restart of the video is a known issue with libvlc. Several people have now reported it. Keep an eye on the nightly builds, when someone has a chance I'm sure they'll look at it in-depth.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Jean-Baptiste Kempf » 26 Jun 2008 19:38

Marx: How can we help the distribution of your work ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

atmo
Blank Cone
Blank Cone
Posts: 41
Joined: 28 Jan 2008 12:59

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby atmo » 26 Jun 2008 19:55

Hi,
just after reading the announce of j-b on the dev mailing list I started to read your forum posting, the .NET wrapper my be interesting for the guys working on MediaPortal - which is completly based on C# and .NET and currently sticks on Windows Mediaplayer - may be they want to use something else - if they knew you work?

may be you would like to drop a posting here? http://forum.team-mediaportal.com/newcomers-forum-240/ (or in some of the other english sub forums?) or if you like - there are also german discussion groups...
--
Atmo
a VLC - Windows - Developer

God gives some people a halo. I gave my TV AtmoLight :-) 1 2

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Jean-Baptiste Kempf » 26 Jun 2008 20:45

Hi,
just after reading the announce of j-b on the dev mailing list I started to read your forum posting,
Hey, that was not useless then !
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Cheetah
New Cone
New Cone
Posts: 6
Joined: 19 Jan 2008 12:25

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Cheetah » 27 Jun 2008 01:07

Hi,
just after reading the announce of j-b on the dev mailing list I started to read your forum posting, the .NET wrapper my be interesting for the guys working on MediaPortal - which is completly based on C# and .NET and currently sticks on Windows Mediaplayer - may be they want to use something else - if they knew you work?

may be you would like to drop a posting here? http://forum.team-mediaportal.com/newcomers-forum-240/ (or in some of the other english sub forums?) or if you like - there are also german discussion groups...
They know. There are reasons they chose WMP.

But a plugin for using VLC in MediaPortal already exists based on the 0.8.6 wrapper i believe so I will point the author to this thread.

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 28 Jun 2008 19:02

Marx: How can we help the distribution of your work ?
Right now, this is enough. I want to get the wrapper finished and properly tested. It means that I won't have a headache dealing with pre-release versions. When its finished, I'll upload it to a repository where everyone can access it. The idea is to produce a wrapper for each version of VLC that is released.

As for a release of the interface, I normally distribute my freeware software via networks such as CNET, Softpedia, Windowsmarketplace, Tucows, etc.

frankexp
New Cone
New Cone
Posts: 3
Joined: 24 Jan 2008 17:15

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby frankexp » 08 Jul 2008 23:10

I'd like to test this. However I'm a bit of a newbie in C#. So if you have an example how to implement this in a C#-form I'd be gratefull.

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 09 Jul 2008 11:17

Sorry, I've been busy on project work. I'll be releasing the source of the Media player interface and wrapper soon. I've just got to test the latest nightly build with it and the guys have corrected a lot of bugs. I'm just amending my code to deal with some deadlocks and introducing features that are now functioning as expected.

As a quick overview, here is the structure of how the wrapper functions:

libvlc.dll --> Marx_libvlc_wrapper.dll --> Interface.exe

Internally, the interface is separated from the wrapper by a class:

libvlc.dll --> Marx_libvlc_wrapper --> Marx_Threaded_VLC.cs --> Interface

Marx_Threaded_VLC.cs exposes functions required by the interface (play, stop, volume, etc) and is launched in a separate thread. Thus, the interface is running on one thread and the media is running on another. The interface talks to Marx_Threaded_VLC.cs, which then uses the wrapper. In practice, it means that to port the interface to another version of libvlc, or even a different media player, you simply edit Marx_Threaded_VLC.cs and never need to touch the interface itself.

Once it is released, I'll create examples that will demonstrate how to use it.

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

I have been testing! Fantastic and Thanks!!!

Postby corvusvideo » 11 Jul 2008 21:58

I have been testing your C# wrapper and so far it has been really fantastic! Thanks for the excellent and much appreciated work! I have a few problems, which are probably due to my lack of understanding and or the early nature of the wrapper but I thought I would bring them up to get this thread back on track.

In the following test where I am playing a video on a form, the video plays fine, but I always get the message "no active input" at the position shown in the code snippet (video_set_parent).

Code: Select all

Marx_libvlc_exception exClass = null; Marx_libvlc_core libvlc_core = null; Marx_libvlc_media libvlc_media = null; Marx_libvlc_media_player libvlc_media_player = null; private void button1_Click(object sender, EventArgs e) { IntPtr hDT = videoWindow.Handle; string[] argv = new string[] { "-I", "title", "--ignore-config" }; libvlc_exception_struct ex = new libvlc_exception_struct(); //Create new libvlc instance, media instance from file and media player instance from media exClass = new Marx_libvlc_exception(ref ex); libvlc_core = new Marx_libvlc_core(argv, ref ex); if (exClass.raised(ref ex) != 0) MessageBox.Show(exClass.get_message(ref ex)); String filename = textBox1.Text; //D:\temp\samplevideo.mp4 for example libvlc_media = new Marx_libvlc_media(libvlc_core.Handle, filename, ref ex); if (exClass.raised(ref ex) != 0) MessageBox.Show(exClass.get_message(ref ex)); libvlc_media_player = new Marx_libvlc_media_player(libvlc_media.Handle, ref ex); if (exClass.raised(ref ex) != 0) MessageBox.Show(exClass.get_message(ref ex)); //Dispose of media Handle and force garbage collection libvlc_media.Handle.Dispose(); GC.Collect(); libvlc_media = null; //Set the output Window and play //********************************************************* //******* ALWAYS GET "no active input" HERE ************** libvlc_media_player.video_set_parent(libvlc_core.Handle, videoWindow.Handle, ref ex); if (exClass.raised(ref ex) != 0) MessageBox.Show(exClass.get_message(ref ex)); //********************************************************* libvlc_media_player.play(ref ex); if (exClass.raised(ref ex) != 0) MessageBox.Show(exClass.get_message(ref ex)); GC.Collect(); GC.WaitForPendingFinalizers(); }
Also I see that getting of state is not yet implemented. Is there any other way to get state?

Finally. Can I be of any help to you other than just testing?

Thanks again for the wrapper. It is excellent and should be a real boon to folks trying to develop under the new API.

RKM

bradturm
New Cone
New Cone
Posts: 2
Joined: 12 Jul 2008 16:43

It's looking great - count me in!

Postby bradturm » 12 Jul 2008 17:18

This is a great thing! Please count me in on any testing, or any other way I can help.

I have tried out the version from the link provided earlier in the thread, and it works fine when I use the wrapper in a VB.Net project as a referenced dot.net assembly in Visual Studio 2005. In VS 2008, which applies different rules for exceptions, however, an exception is thrown at the same point as in the previous post:

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

This is at the line
libvlc_media_player.video_set_parent(libvlc_core.Handle, hDT, ex)

ex also reports 'no input'.

It looks, therefore, that this is an issue that needs to be resolved, at least for Dot.Net 2.0.

I had a bit of a look at implementing the other parts of the wrapper, such as events and getting status, etc. with limited success - but it would obviously be best to co-ordinate efforts (or you to do it, your coding is a lot better than mine I think :)

For a start, though, it would be great to resolve the exception issue above so at least I have a working version for my VS2008 development environment.

Is there a later build to try? Please count me in, and I promise to give it some thorough testing over the coming weeks!

Finally, thanks. As for other posters, I had been looking at previous efforts at a wrapper for dot.net, and your wrapper is easily the best.

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 13 Jul 2008 12:27

The two problems mentioned happen to be related.

Firstly, libvlc_media_player.video_set_parent(libvlc_core.Handle, hDT, ex) in my multithreaded version needs to be placed after the play() command, or else I get a deadlock and the interface freezes. I've also had to wrap it in a try/Catch block to handle the exception.

The exception appears to be coming from libvlc, but does not effect binding VLC's output to the window. So, I think there may be a some code that references a null pointer within libvlc, after it has attached the output to a window.
Also I see that getting of state is not yet implemented. Is there any other way to get state?
When I get a chance, I'll get the wrapper finished. I have only two portions to do now, libvlc_vlm and libvlc_event. I need to review how the events are managed and the best way to connect to them. In fact, for a basic media player, you can avoid using libvlc_event and lib_vlm. In terms of state info, there are a few commands that will give you some info, anything that I found to be lacking I just created flags for in the interface and kept track of the state that way.

Here is a copy of the latest build, I haven't had a chance to work on this the last few weeks, but I'll get back to it soon:

Marx libvlc Wrapper for 0.9.0 version 0.0.2 (Alpha Release)

http://www.2shared.com/file/3586524/6c4 ... apper.html

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

Bug introduced in 0.0.2 calling libvlc_media_add_option

Postby corvusvideo » 14 Jul 2008 16:16

I think I found a bug in 0.0.2. You changed the add_option member that wraps libvlc_media_add_option to take a string[] instead of a string. I believe this is incorrect (although the API doc is a little hard to decipher). I think you had it right the first time and it takes either a single option, or a delimited string, not an array of options. It was working in 0.0.1 and now does not work for me. I switched it back to

Code: Select all

[DllImport("libvlc")] private static extern void libvlc_media_add_option(Marx_libvlc_media_handle libvlc_media_handle, string option, ref libvlc_exception_struct ex);
and

Code: Select all

public void add_option(string option, ref libvlc_exception_struct ex);
and now it works again for me when I call it as

Code: Select all

string[] options = new string[] { ":no-overlay", ":drop-late-frames", ":no-video-title-show" }; foreach (string s in options) { libvlc_media.add_option(s, ref ex); if (exClass.raised(ref ex) != 0) { Exception except = new Exception(exClass.get_message(ref ex)); throw except; } }
Thanks again....

RKM

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

Small item

Postby corvusvideo » 14 Jul 2008 17:50

So far things are working great! I am playing with setting volume, position, etc.

I noticed one small inconsistancy. Most "set" method, such as "set_position", and "audio_set_volume" take the value as the second to last argument and the exception structure as the last. "set_position" takes the exception followed by the value.

Just FYI

On the whole though, this wrapper is truly excellent!

Thanks
Last edited by corvusvideo on 14 Jul 2008 19:26, edited 1 time in total.

nfogel
New Cone
New Cone
Posts: 4
Joined: 04 Feb 2008 15:03

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby nfogel » 14 Jul 2008 18:01

Sorry of the newbie questions, this is my first attempt at interfacing libvlc.
I followed the instructions on this thread, downloaded the wrapper, downloaded the last nightly build of VLC and copied the necesary files to the debug folder of the sample tester application.

Opened the SLN in VS2005, compilation was successful.

Now, when executing the sample tester in the debugger, the "play" call throws an exception with the message text "no active input". This happens when I set the variable "link" to a URL stream as well as when I set it to an MP3 file.

Any idea what is causing this?

Also, my aim is to develop an application that will save live streams to a local file. I would greatly appreciate some guidance here as I found no documentation on this can be achieved.

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

calling video_take_snapshot causes core_handle release to h

Postby corvusvideo » 14 Jul 2008 20:38

If I call

video_take_snapshot

snapshot file is generated as expected, but when I go to close the application or terminate the video

Marx_libvlc_core_handle.ReleaseHandle() will hang indefinitely. Specifically the call to libvlc_release(this); never returns!

This is probably not a problem with your wrapper, but instead a problem with libvlc. But I wanted to let you know about it.

RKM

Marx
Blank Cone
Blank Cone
Posts: 21
Joined: 08 Jun 2008 12:17

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby Marx » 15 Jul 2008 19:06

Corvusvideo thanks for the feedback. I'd been trying to figure out how libvlc_media_add_option worked. Now that I know, I'll add the changes to the wrapper.

That should correct the problem I was having with visualisations. I'll also correct the coding standard that you mentioned.

The issue with Marx_libvlc_core_handle.ReleaseHandle()/Marx_libvlc_core_handle.Dispose() has been mentioned to the developers. libvlc is not disposing of the class properly. I'm sure they'll get round to correcting it soon enough.

I've also seen the exception in video_take_snapshot. Again, its an issue in libvlc and will be corrected in time. Wrap it in a try/catch block for now and it should function as expected.
Now, when executing the sample tester in the debugger, the "play" call throws an exception with the message text "no active input".
Did you download the 0.0.2 release at the bottom of page 2?

Its not the play() function that generates the exception, it is set_parent(). I've added code to the 0.0.2 version to handle this until the cause is found within libvlc. You also need to clear the exception struct ( exClass.clear(ref ex) ), or this generates more errors if another exception occurs and attempts to write to the memory. As a rule, after every use of a command from the wrapper, check for exceptions and clear the struct.

BexX
Blank Cone
Blank Cone
Posts: 18
Joined: 16 Jul 2008 00:26

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby BexX » 16 Jul 2008 19:20

Hi!

First of all i would like to say thanks for your work, Marx!
And now, to fill this post with some topic related content, here is some feedback:

I sucessfully tested the on the test-app (from wrapper ver. 0.0.2) on the folowing plattforms:

- WinXP / .NET 2.0 / Visual Studio 2008 / vlc-0.9.0-test3-20080715-0003-win32
-- with default settings VS fails to run an Debug build propperly:
--- one needs to uncheck Marx_libvlc_wrapper_test->properties->debug->"Enable unmanaged code debugging"
--- uncheck "Enable the Visual Studio hosting process" to see console output.

- WinXP / Mono 1.9.1 / vlc-0.9.0-test3-20080715-0003-win32
-- compiled with VS and .NET compiler
-- testrun from command prompt fails to load the plugins, cause libvlc's cwd is not the apllications bin/debug folder
--- add plugin path to argv. e.g.

Code: Select all

string[] argv = new string[] { "-I", "dummy", "--ignore-config", "-vvvv", @"--plugin-path=..\..\plugins" };
---- assuming you have the pluginsfolder in "Marx_libvlc_wrapper_test\"

Ubuntu Hardy / Mono 1.2.6 / compiled vlc git sources 200807015 folowing these instructions: viewtopic.php?f=13&t=47431
-- works like charm with plugin-path set as described above and comment out the win32 code

Code: Select all

44: //IntPtr hDT = Win32.GetDesktopWindowHandle(); 64: //libvlc_media_player.video_set_parent(libvlc_core.Handle, hDT, ref ex);
I am going to do some testing on Linux/mono with dvb input and streaming output for now.

bradturm
New Cone
New Cone
Posts: 2
Joined: 12 Jul 2008 16:43

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby bradturm » 17 Jul 2008 07:59

Hi again Marx,

I downloaded version 0.0.2 and I'm getting things to work much better. Thanks!

I started thinking playlists, particularly for gapless playback of consecutive audio tracks, and noticed there was no support yet for this in the wrapper although there is in the API. I took the liberty of adding some in the form of an extra .cs file. The code is here if you want to include it in the wrapper:

Code: Select all

using System; using System.Runtime.InteropServices; using System.IO; namespace Marx_libvlc_wrapper { #region Handle for libvlc_media_list_player_handle public class Marx_libvlc_media_list_player_handle : SafeHandle { public Marx_libvlc_media_list_player_handle() : base(IntPtr.Zero, true) { } public override bool IsInvalid { get { return handle == IntPtr.Zero; } } protected override bool ReleaseHandle() { if (!IsInvalid) { libvlc_media_list_player_release(this); handle = IntPtr.Zero; } return true; } protected override void Dispose(bool disposing) { ReleaseHandle(); base.Dispose(disposing); } [DllImport("libvlc")] private static extern void libvlc_media_list_player_release(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle); } #endregion public class Marx_libvlc_media_list_player { private Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle; #region Constructor /// <summary> /// Create an instance of the media list player /// </summary> /// <param name="libvlc_handle"></param> public Marx_libvlc_media_list_player(Marx_libvlc_core_handle libvlc_core_handle, ref libvlc_exception_struct ex) { libvlc_media_list_player_handle = libvlc_media_list_player_new(libvlc_core_handle, ref ex); } #endregion #region Properties /// <summary> /// Returns a Handle to the Media List Player Instance /// </summary> public Marx_libvlc_media_list_player_handle Handle { get { return libvlc_media_list_player_handle; } } #endregion #region Methods public void set_media_player(Marx_libvlc_media_player_handle libvlc_media_player_handle, ref libvlc_exception_struct ex) { libvlc_media_list_player_set_media_player(libvlc_media_list_player_handle, libvlc_media_player_handle, ref ex); } public void set_media_list(Marx_libvlc_media_list_handle libvlc_media_list_handle, ref libvlc_exception_struct ex) { libvlc_media_list_player_set_media_list(libvlc_media_list_player_handle, libvlc_media_list_handle, ref ex); } public void play(ref libvlc_exception_struct ex) { libvlc_media_list_player_play(libvlc_media_list_player_handle, ref ex); } public int is_playing(ref libvlc_exception_struct ex) { return libvlc_media_list_player_is_playing(libvlc_media_list_player_handle, ref ex); } // TO DO - GET STATE libvlc_state_t libvlc_media_list_player_get_state (libvlc_media_list_player_t *p_mlp, libvlc_exception_t *p_e) public void pause(ref libvlc_exception_struct ex) { libvlc_media_list_player_pause(libvlc_media_list_player_handle, ref ex); } public void play_item_at_index(int index, ref libvlc_exception_struct ex) { libvlc_media_list_player_play_item_at_index(libvlc_media_list_player_handle, index, ref ex); } public void play_item(Marx_libvlc_media_handle libvlc_media_handle, ref libvlc_exception_struct ex) { libvlc_media_list_player_play_item(libvlc_media_list_player_handle, libvlc_media_handle, ref ex); } public void stop(ref libvlc_exception_struct ex) { libvlc_media_list_player_stop(libvlc_media_list_player_handle, ref ex); } public void next(ref libvlc_exception_struct ex) { libvlc_media_list_player_next(libvlc_media_list_player_handle, ref ex); } #endregion #region DLL Imports [DllImport("libvlc")] private static extern Marx_libvlc_media_list_player_handle libvlc_media_list_player_new(Marx_libvlc_core_handle libvlc_core_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_set_media_player(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, Marx_libvlc_media_player_handle libvlc_media_player_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_set_media_list(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, Marx_libvlc_media_list_handle libvlc_media_list_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_play(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern int libvlc_media_list_player_is_playing(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, ref libvlc_exception_struct ex); // TO DO - GET STATE libvlc_state_t libvlc_media_list_player_get_state (libvlc_media_list_player_t *p_mlp, libvlc_exception_t *p_e) [DllImport("libvlc")] private static extern void libvlc_media_list_player_pause(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_play_item_at_index(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, int index, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_play_item(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, Marx_libvlc_media_handle libvlc_media_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_stop(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, ref libvlc_exception_struct ex); [DllImport("libvlc")] private static extern void libvlc_media_list_player_next(Marx_libvlc_media_list_player_handle libvlc_media_list_player_handle, ref libvlc_exception_struct ex); #endregion } }
The thing is, 'play_item_at_index' appears to work with the nightly build of a couple of nights ago, while 'play' does nothing (no exception or other error). So I can play a single track in the playlist, but not the entire playlist (which is what I assume 'play' should do), which rather defeats the object! Is this broken in the VLC build, do you think, or am I missing something?

I could of course handle playlists externally but as I said it is really for smooth playback of tracks that do not necessarily end or begin with silence. Is there another way to do this?

Anyway, just thought I'd share this. I'll continue to play with it. Just really missing some feedback from VLC in the form of events with event_manager support.

Keep up the excellent work!

tckitty
Blank Cone
Blank Cone
Posts: 12
Joined: 20 Jul 2006 21:42

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby tckitty » 22 Jul 2008 00:05

I downloaded the 0.9.0 but added the vlc as an activex in my c# proj. Has anyone else try this? Is it bad? Should I stick w/ the lib*.dll instead of the axvlc.dll?

corvusvideo
Blank Cone
Blank Cone
Posts: 29
Joined: 03 Mar 2008 16:14

Suggested feature with impl

Postby corvusvideo » 24 Jul 2008 14:29

Marx is doing a fantastic job on this wrapper! It will be extremely useful when complete.

Let's as a community suggest and contribute useful code to implement features that would really make a C# VLC library useful.

I will get the ball rolling by suggesting that I find the ability to determine which plugins are currently loaded is very useful. It helps with diagnostics and also if you want to make a minimum redistribution set for a particular media type.

Here is the code I use for that.

Code: Select all

/// <summary> /// Return list of plugins currently loaded /// </summary> /// <returns></returns> public System.Collections.Specialized.StringCollection LoadedPlugins() { System.Collections.Specialized.StringCollection plugins = new System.Collections.Specialized.StringCollection(); foreach (System.Diagnostics.ProcessModule module in System.Diagnostics.Process.GetCurrentProcess().Modules) { String smod = module.FileName; if (module.FileName.ToUpper().EndsWith(@"_PLUGIN.DLL")) { plugins.Add(smod.Substring(smod.LastIndexOf('\\') + 1)); } } return plugins; }

cybercockroach
Blank Cone
Blank Cone
Posts: 19
Joined: 11 Jul 2008 03:35

Re: C# Wrapper for libvlc 0.9.0 - Testers Required

Postby cybercockroach » 31 Jul 2008 05:15

Hi Marx:
It would be nice if the Wrapper you create be put on sourceforge(http://sourceforge.net/) or something like that.
The link you provide seem can not be accessed from my country(accessDenied >< I came from Taiwan).
It is nice to know you have created a nice wrapper for C#. Thanks.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 24 guests