Code: Select all
public static void Main(string[] args)
{
string file = "hrd.avi"; //File to Play (Heavy Rain Demo :)
IntPtr hDT = Win32.GetDesktopWindow(); //Handle to Desktop Window (from Win32)
Marx_lib_vlc_new libvlc = new Marx_lib_vlc_new(); //Create instance of libvlc
Marx_lib_vlc_media_new libvlc_media = new Marx_lib_vlc_media_new(libvlc.Handle, file); //Create instance of selected media
Marx_media_player_new libvlc_media_player = new Marx_media_player_new(libvlc_media.Handle); //Create instance of the media player
libvlc_media_player.video_set_parent(libvlc.Handle, hDT); //Attach libvlc to the Desktop for output
libvlc_media_player.play(); //Play the file
Console.ReadLine();
}
U R welcome. Waiting to see moreThanks j-b...
Code: Select all
static void Main(string[] args)
{
string link = "http://160.79.128.61:7244";
IntPtr hDT = Win32.GetDesktopWindow();
string[] argv = new string[] { "-I", "dummy", "--ignore-config" };
libvlc_exception_struct ex = new libvlc_exception_struct();
//Temporary init for struct (to be removed)
ex.b_raised = 0;
ex.i_code = 0;
ex.psz_message = "";
//Create new libvlc instance, media instance from file and media player instance from media
Marx_libvlc_core libvlc_core = new Marx_libvlc_core(argv, ref ex);
Marx_libvlc_media libvlc_media = new Marx_libvlc_media(libvlc_core.Handle, link, ref ex);
Marx_libvlc_media_player libvlc_media_player = new Marx_libvlc_media_player(libvlc_media.Handle, 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
libvlc_media_player.video_set_parent(libvlc_core.Handle, hDT, ref ex);
libvlc_media_player.play(ref ex);
//Wait for input (play for a while)
Console.ReadKey();
//Release Media player resources
libvlc_media_player.stop(ref ex);
libvlc_media_player.Handle.Dispose();
GC.Collect();
libvlc_media_player = null;
/* Bug - Will crash libvlc
//Release core resources
libvlc_core.Handle.Dispose();
GC.Collect();
libvlc_core = null;
*/
//Release unreferenced object resources
GC.WaitForPendingFinalizers();
Console.ReadKey();
}
Yes, I hope the new libvlc is well designed now (3rd redesign ? )...Thanks J-B, its coming along quite nicely. libvlc is quite well designed and it makes the process a lot easier.
I have added PLS file support to the front-end, so playing streams from the web, or sharing playlists should be straightforward. I also abstracted the interface from the wrapper. This serves two functions, it makes the interface a little agnostic to changes in the underlying wrapper and also allows me to multi-thread the interface. So, no interruptions if the interface is taking its time.
I thought I'd upload a better screenshot...I'll remove the previous one to save some space...
There is a new GUI in VLC 0.9.0, and this isn't the object of this thread...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.
I agree, the purpose of this thread is to test the wrapper and inform people of new releases.There is a new GUI in VLC 0.9.0, and this isn't the object of this thread...
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.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 ?
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.Will the "power-user" options still be available, but tucked away? Or will they simply be inaccessible with the C# wrapper/gui ?
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.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?
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....and this isn't the object of this thread...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, ....
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 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.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...
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.Your C#-Wrapper for 0.9 ist fantistic.
five minutes, and a winforms-app is written
Of cause, I'am interesting on the new "test-version" on the wrapper.
I'm working on it, I just need some free time. Then I'll finish off the wrapper and release it.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
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.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
Hey, that was not useless then !Hi,
just after reading the announce of j-b on the dev mailing list I started to read your forum posting,
They know. There are reasons they chose WMP.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...
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.Marx: How can we help the distribution of your work ?
Return to “Development around libVLC”
Users browsing this forum: No registered users and 16 guests