LibVLCStructs.cs 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace UMP
  4. {
  5. [StructLayout(LayoutKind.Sequential)]
  6. public struct MediaStats
  7. {
  8. public int InputReadBytes;
  9. public float InputBitrate;
  10. public int DemuxReadBytes;
  11. public float DemuxBitrate;
  12. public int DemuxCorrupted;
  13. public int DemuxDiscontinuity;
  14. public int DecodedVideo;
  15. public int DecodedAudio;
  16. public int VideoDisplayedPictures;
  17. public int VideoLostPictures;
  18. public int AudioPlayedAbuffers;
  19. public int AudioLostAbuffers;
  20. public int StreamSentPackets;
  21. public int StreamSentBytes;
  22. public float StreamSendBitrate;
  23. }
  24. }
  25. namespace UMP.Wrappers
  26. {
  27. [StructLayout(LayoutKind.Sequential)]
  28. internal struct EventStruct
  29. {
  30. public EventTypes Type;
  31. public IntPtr PObj;
  32. public MediaDescriptorUnion MediaDescriptor;
  33. }
  34. [StructLayout(LayoutKind.Sequential)]
  35. internal struct TrackDescription
  36. {
  37. public int Id;
  38. [MarshalAs(UnmanagedType.LPStr)]
  39. public string Name;
  40. public IntPtr NextDescription;
  41. }
  42. [StructLayout(LayoutKind.Sequential)]
  43. internal struct AudioDescription
  44. {
  45. [MarshalAs(UnmanagedType.LPStr)]
  46. public string Name;
  47. [MarshalAs(UnmanagedType.LPStr)]
  48. public string Description;
  49. public IntPtr NextDescription;
  50. }
  51. [StructLayout(LayoutKind.Sequential)]
  52. internal struct AudioOutputDevice
  53. {
  54. public IntPtr NextDevice;
  55. [MarshalAs(UnmanagedType.LPStr)]
  56. public string Device;
  57. [MarshalAs(UnmanagedType.LPStr)]
  58. public string Description;
  59. }
  60. [StructLayout(LayoutKind.Sequential)]
  61. internal struct AudioTrackInfo
  62. {
  63. public int Channels;
  64. public int Rate;
  65. }
  66. [StructLayout(LayoutKind.Sequential)]
  67. internal struct VideoTrackInfo
  68. {
  69. public int Height;
  70. public int Width;
  71. }
  72. [StructLayout(LayoutKind.Explicit)]
  73. internal struct TrackInfo
  74. {
  75. [FieldOffset(0)]
  76. public int Codec;
  77. [FieldOffset(4)]
  78. public int Id;
  79. [FieldOffset(8)]
  80. public TrackTypes Type;
  81. [FieldOffset(12)]
  82. public int Profile;
  83. [FieldOffset(16)]
  84. public int Level;
  85. [FieldOffset(20)]
  86. public AudioTrackInfo Audio;
  87. [FieldOffset(20)]
  88. public VideoTrackInfo Video;
  89. }
  90. [StructLayout(LayoutKind.Explicit)]
  91. internal struct MediaDescriptorUnion
  92. {
  93. [FieldOffset(0)]
  94. public MetaChanged MetaChanged;
  95. [FieldOffset(0)]
  96. public SubitemAdded SubitemAdded;
  97. [FieldOffset(0)]
  98. public PlayerBuffering PlayerBuffering;
  99. [FieldOffset(0)]
  100. public DurationChanged DurationChanged;
  101. [FieldOffset(0)]
  102. public ParsedChanged ParsedChanged;
  103. [FieldOffset(0)]
  104. public Freed Freed;
  105. [FieldOffset(0)]
  106. public StateChanged StateChanged;
  107. [FieldOffset(0)]
  108. public PlayerPositionChanged PlayerPositionChanged;
  109. [FieldOffset(0)]
  110. public PlayerTimeChanged PlayerTimeChanged;
  111. [FieldOffset(0)]
  112. public PlayerTitleChanged PlayerTitleChanged;
  113. [FieldOffset(0)]
  114. public PlayerSeekableChanged PlayerSeekableChanged;
  115. [FieldOffset(0)]
  116. public PlayerPausableChanged PlayerPausableChanged;
  117. [FieldOffset(0)]
  118. public ListItemAdded ListItemAdded;
  119. [FieldOffset(0)]
  120. public ListWillAddItem ListWillAddItem;
  121. [FieldOffset(0)]
  122. public ListItemDeleted ListItemDeleted;
  123. [FieldOffset(0)]
  124. public ListWillDeleteItem ListWillDeleteItem;
  125. [FieldOffset(0)]
  126. public ListPlayerNextItemSet ListPlayerNextItemSet;
  127. [FieldOffset(0)]
  128. public PlayerSnapshotTaken PlayerSnapshotTaken;
  129. [FieldOffset(0)]
  130. public PlayerLengthChanged PlayerLengthChanged;
  131. [FieldOffset(0)]
  132. public VlmMediaEvent VlmMediaEvent;
  133. [FieldOffset(0)]
  134. public PlayerMediaChanged PlayerMediaChanged;
  135. }
  136. #region Media descriptor
  137. [StructLayout(LayoutKind.Sequential)]
  138. internal struct MetaChanged
  139. {
  140. public MediaMetadatas MetaType;
  141. }
  142. [StructLayout(LayoutKind.Sequential)]
  143. internal struct SubitemAdded
  144. {
  145. public IntPtr NewChild;
  146. }
  147. [StructLayout(LayoutKind.Sequential)]
  148. internal struct DurationChanged
  149. {
  150. public long NewDuration;
  151. }
  152. [StructLayout(LayoutKind.Sequential)]
  153. internal struct ParsedChanged
  154. {
  155. public int NewStatus;
  156. }
  157. [StructLayout(LayoutKind.Sequential)]
  158. internal struct Freed
  159. {
  160. public IntPtr Md;
  161. }
  162. [StructLayout(LayoutKind.Sequential)]
  163. internal struct StateChanged
  164. {
  165. public MediaStates NewState;
  166. }
  167. /* media instance */
  168. [StructLayout(LayoutKind.Sequential)]
  169. internal struct PlayerPositionChanged
  170. {
  171. public float NewPosition;
  172. }
  173. [StructLayout(LayoutKind.Sequential)]
  174. internal struct PlayerTimeChanged
  175. {
  176. public long NewTime;
  177. }
  178. [StructLayout(LayoutKind.Sequential)]
  179. internal struct PlayerTitleChanged
  180. {
  181. public int NewTitle;
  182. }
  183. [StructLayout(LayoutKind.Sequential)]
  184. internal struct PlayerSeekableChanged
  185. {
  186. public int NewSeekable;
  187. }
  188. [StructLayout(LayoutKind.Sequential)]
  189. internal struct PlayerPausableChanged
  190. {
  191. public int NewPausable;
  192. }
  193. #endregion
  194. #region List
  195. [StructLayout(LayoutKind.Sequential)]
  196. internal struct ListItemAdded
  197. {
  198. public IntPtr Item;
  199. public int Index;
  200. }
  201. [StructLayout(LayoutKind.Sequential)]
  202. internal struct ListWillAddItem
  203. {
  204. public IntPtr Item;
  205. public int Index;
  206. }
  207. [StructLayout(LayoutKind.Sequential)]
  208. internal struct ListItemDeleted
  209. {
  210. public IntPtr Item;
  211. public int Index;
  212. }
  213. [StructLayout(LayoutKind.Sequential)]
  214. internal struct ListWillDeleteItem
  215. {
  216. public IntPtr Item;
  217. public int Index;
  218. }
  219. [StructLayout(LayoutKind.Sequential)]
  220. internal struct ListPlayerNextItemSet
  221. {
  222. public IntPtr Item;
  223. }
  224. #endregion
  225. /// <summary>
  226. /// Snapshot
  227. /// </summary>
  228. [StructLayout(LayoutKind.Sequential)]
  229. internal struct PlayerSnapshotTaken
  230. {
  231. public IntPtr Filename;
  232. }
  233. /// <summary>
  234. /// Length
  235. /// </summary>
  236. [StructLayout(LayoutKind.Sequential)]
  237. internal struct PlayerLengthChanged
  238. {
  239. public long NewLength;
  240. }
  241. /// <summary>
  242. /// VLM media
  243. /// </summary>
  244. [StructLayout(LayoutKind.Sequential)]
  245. internal struct VlmMediaEvent
  246. {
  247. public IntPtr MediaName;
  248. public IntPtr InstanceName;
  249. }
  250. /// <summary>
  251. /// Buffering value
  252. /// </summary>
  253. [StructLayout(LayoutKind.Sequential)]
  254. internal struct PlayerBuffering
  255. {
  256. public float NewCache;
  257. }
  258. /// <summary>
  259. /// Extra MediaPlayer
  260. /// </summary>
  261. [StructLayout(LayoutKind.Sequential)]
  262. internal struct PlayerMediaChanged
  263. {
  264. public IntPtr NewMedia;
  265. }
  266. }