PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/Multimedia/Vlc/LibVlc/VlcCore.cs

#
C# | 122 lines | 91 code | 19 blank | 12 comment | 0 complexity | 1c6b1243c970e8fe9fd6c880fe9638c9 MD5 | raw file
Possible License(s): Apache-2.0
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Delta.Multimedia.Vlc.LibVlc
  4. {
  5. /// <summary>
  6. /// Credits go to Helyar.net which provided a really nice starting point
  7. /// to an own vlc wrapper implementation.
  8. /// <para />
  9. /// http://www.helyar.net/2009/libvlc-media-player-in-c-part-2/
  10. /// <para />
  11. /// For VLC method information see:
  12. /// http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html
  13. /// <para />
  14. /// Vlc commands:
  15. /// http://wiki.videolan.org/VLC_command-line_help
  16. /// </summary>
  17. internal static class VlcCore
  18. {
  19. #region libvlc_new (Static)
  20. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  21. public static extern IntPtr libvlc_new(int argc,
  22. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] argv);
  23. #endregion
  24. #region libvlc_release (Static)
  25. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  26. public static extern void libvlc_release(IntPtr instance);
  27. #endregion
  28. #region libvlc_media_new_location (Static)
  29. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  30. public static extern IntPtr libvlc_media_new_location(IntPtr p_instance,
  31. [MarshalAs(UnmanagedType.LPStr)] string psz_mrl);
  32. #endregion
  33. #region libvlc_media_release (Static)
  34. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  35. public static extern void libvlc_media_release(IntPtr p_meta_desc);
  36. #endregion
  37. #region libvlc_media_get_state (Static)
  38. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  39. public static extern VlcMediaState libvlc_media_get_state(
  40. IntPtr p_meta_desc);
  41. #endregion
  42. #region libvlc_media_player_new_from_media (Static)
  43. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  44. public static extern IntPtr libvlc_media_player_new_from_media(
  45. IntPtr media);
  46. #endregion
  47. #region libvlc_media_player_release (Static)
  48. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  49. public static extern void libvlc_media_player_release(IntPtr player);
  50. #endregion
  51. #region libvlc_media_player_set_hwnd (Static)
  52. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  53. public static extern void libvlc_media_player_set_hwnd(IntPtr player,
  54. IntPtr drawable);
  55. #endregion
  56. #region libvlc_media_player_get_media (Static)
  57. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  58. public static extern IntPtr libvlc_media_player_get_media(IntPtr player);
  59. #endregion
  60. #region libvlc_media_player_set_media (Static)
  61. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  62. public static extern void libvlc_media_player_set_media(IntPtr player,
  63. IntPtr media);
  64. #endregion
  65. #region libvlc_media_player_play (Static)
  66. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  67. public static extern int libvlc_media_player_play(IntPtr player);
  68. #endregion
  69. #region libvlc_media_player_pause (Static)
  70. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  71. public static extern void libvlc_media_player_pause(IntPtr player);
  72. #endregion
  73. #region libvlc_media_player_stop (Static)
  74. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  75. public static extern void libvlc_media_player_stop(IntPtr player);
  76. #endregion
  77. #region libvlc_media_player_get_time (Static)
  78. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  79. public static extern long libvlc_media_player_get_time(IntPtr player);
  80. #endregion
  81. #region libvlc_media_player_get_length (Static)
  82. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  83. public static extern long libvlc_media_player_get_length(IntPtr player);
  84. #endregion
  85. #region libvlc_audio_set_volume (Static)
  86. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  87. public static extern int libvlc_audio_set_volume(IntPtr player,
  88. int volume);
  89. #endregion
  90. #region libvlc_audio_get_volume (Static)
  91. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  92. public static extern int libvlc_audio_get_volume(IntPtr player);
  93. #endregion
  94. #region libvlc_clearerr (Static)
  95. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  96. public static extern void libvlc_clearerr();
  97. #endregion
  98. #region libvlc_errmsg (Static)
  99. [DllImport("libvlc", CallingConvention = CallingConvention.Cdecl)]
  100. public static extern IntPtr libvlc_errmsg();
  101. #endregion
  102. }
  103. }