/Multimedia/Vlc/LibVlc/VlcCore.cs
# · C# · 122 lines · 91 code · 19 blank · 12 comment · 0 complexity · 1c6b1243c970e8fe9fd6c880fe9638c9 MD5 · raw file
- using System;
- using System.Runtime.InteropServices;
-
- namespace Delta.Multimedia.Vlc.LibVlc
- {
- /// <summary>
- /// Credits go to Helyar.net which provided a really nice starting point
- /// to an own vlc wrapper implementation.
- /// <para />
- /// http://www.helyar.net/2009/libvlc-media-player-in-c-part-2/
- /// <para />
- /// For VLC method information see:
- /// http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html
- /// <para />
- /// Vlc commands:
- /// http://wiki.videolan.org/VLC_command-line_help
- /// </summary>
- internal static class VlcCore
- {
- #region libvlc_new (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr libvlc_new(int argc,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] argv);
- #endregion
-
- #region libvlc_release (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_release(IntPtr instance);
- #endregion
-
- #region libvlc_media_new_location (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr libvlc_media_new_location(IntPtr p_instance,
- [MarshalAs(UnmanagedType.LPStr)] string psz_mrl);
- #endregion
-
- #region libvlc_media_release (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_release(IntPtr p_meta_desc);
- #endregion
-
- #region libvlc_media_get_state (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern VlcMediaState libvlc_media_get_state(
- IntPtr p_meta_desc);
- #endregion
-
- #region libvlc_media_player_new_from_media (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr libvlc_media_player_new_from_media(
- IntPtr media);
- #endregion
-
- #region libvlc_media_player_release (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_player_release(IntPtr player);
- #endregion
-
- #region libvlc_media_player_set_hwnd (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_player_set_hwnd(IntPtr player,
- IntPtr drawable);
- #endregion
-
- #region libvlc_media_player_get_media (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr libvlc_media_player_get_media(IntPtr player);
- #endregion
-
- #region libvlc_media_player_set_media (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_player_set_media(IntPtr player,
- IntPtr media);
- #endregion
-
- #region libvlc_media_player_play (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern int libvlc_media_player_play(IntPtr player);
- #endregion
-
- #region libvlc_media_player_pause (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_player_pause(IntPtr player);
- #endregion
-
- #region libvlc_media_player_stop (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_media_player_stop(IntPtr player);
- #endregion
-
- #region libvlc_media_player_get_time (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern long libvlc_media_player_get_time(IntPtr player);
- #endregion
-
- #region libvlc_media_player_get_length (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern long libvlc_media_player_get_length(IntPtr player);
- #endregion
-
- #region libvlc_audio_set_volume (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern int libvlc_audio_set_volume(IntPtr player,
- int volume);
- #endregion
-
- #region libvlc_audio_get_volume (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern int libvlc_audio_get_volume(IntPtr player);
- #endregion
-
- #region libvlc_clearerr (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern void libvlc_clearerr();
- #endregion
-
- #region libvlc_errmsg (Static)
- [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
- public static extern IntPtr libvlc_errmsg();
- #endregion
- }
- }