123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- using System;
- using System.Runtime.InteropServices;
- namespace UMP
- {
- [StructLayout(LayoutKind.Sequential)]
- public struct MediaStats
- {
- public int InputReadBytes;
- public float InputBitrate;
- public int DemuxReadBytes;
- public float DemuxBitrate;
- public int DemuxCorrupted;
- public int DemuxDiscontinuity;
- public int DecodedVideo;
- public int DecodedAudio;
- public int VideoDisplayedPictures;
- public int VideoLostPictures;
- public int AudioPlayedAbuffers;
- public int AudioLostAbuffers;
- public int StreamSentPackets;
- public int StreamSentBytes;
- public float StreamSendBitrate;
- }
- }
- namespace UMP.Wrappers
- {
- [StructLayout(LayoutKind.Sequential)]
- internal struct EventStruct
- {
- public EventTypes Type;
- public IntPtr PObj;
- public MediaDescriptorUnion MediaDescriptor;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct TrackDescription
- {
- public int Id;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Name;
- public IntPtr NextDescription;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct AudioDescription
- {
- [MarshalAs(UnmanagedType.LPStr)]
- public string Name;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Description;
- public IntPtr NextDescription;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct AudioOutputDevice
- {
- public IntPtr NextDevice;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Device;
- [MarshalAs(UnmanagedType.LPStr)]
- public string Description;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct AudioTrackInfo
- {
- public int Channels;
- public int Rate;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct VideoTrackInfo
- {
- public int Height;
- public int Width;
- }
- [StructLayout(LayoutKind.Explicit)]
- internal struct TrackInfo
- {
- [FieldOffset(0)]
- public int Codec;
- [FieldOffset(4)]
- public int Id;
- [FieldOffset(8)]
- public TrackTypes Type;
- [FieldOffset(12)]
- public int Profile;
- [FieldOffset(16)]
- public int Level;
- [FieldOffset(20)]
- public AudioTrackInfo Audio;
- [FieldOffset(20)]
- public VideoTrackInfo Video;
- }
- [StructLayout(LayoutKind.Explicit)]
- internal struct MediaDescriptorUnion
- {
- [FieldOffset(0)]
- public MetaChanged MetaChanged;
- [FieldOffset(0)]
- public SubitemAdded SubitemAdded;
- [FieldOffset(0)]
- public PlayerBuffering PlayerBuffering;
- [FieldOffset(0)]
- public DurationChanged DurationChanged;
- [FieldOffset(0)]
- public ParsedChanged ParsedChanged;
- [FieldOffset(0)]
- public Freed Freed;
- [FieldOffset(0)]
- public StateChanged StateChanged;
- [FieldOffset(0)]
- public PlayerPositionChanged PlayerPositionChanged;
- [FieldOffset(0)]
- public PlayerTimeChanged PlayerTimeChanged;
- [FieldOffset(0)]
- public PlayerTitleChanged PlayerTitleChanged;
- [FieldOffset(0)]
- public PlayerSeekableChanged PlayerSeekableChanged;
- [FieldOffset(0)]
- public PlayerPausableChanged PlayerPausableChanged;
- [FieldOffset(0)]
- public ListItemAdded ListItemAdded;
- [FieldOffset(0)]
- public ListWillAddItem ListWillAddItem;
- [FieldOffset(0)]
- public ListItemDeleted ListItemDeleted;
- [FieldOffset(0)]
- public ListWillDeleteItem ListWillDeleteItem;
- [FieldOffset(0)]
- public ListPlayerNextItemSet ListPlayerNextItemSet;
- [FieldOffset(0)]
- public PlayerSnapshotTaken PlayerSnapshotTaken;
- [FieldOffset(0)]
- public PlayerLengthChanged PlayerLengthChanged;
- [FieldOffset(0)]
- public VlmMediaEvent VlmMediaEvent;
- [FieldOffset(0)]
- public PlayerMediaChanged PlayerMediaChanged;
- }
- #region Media descriptor
- [StructLayout(LayoutKind.Sequential)]
- internal struct MetaChanged
- {
- public MediaMetadatas MetaType;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct SubitemAdded
- {
- public IntPtr NewChild;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct DurationChanged
- {
- public long NewDuration;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct ParsedChanged
- {
- public int NewStatus;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct Freed
- {
- public IntPtr Md;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct StateChanged
- {
- public MediaStates NewState;
- }
- /* media instance */
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerPositionChanged
- {
- public float NewPosition;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerTimeChanged
- {
- public long NewTime;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerTitleChanged
- {
- public int NewTitle;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerSeekableChanged
- {
- public int NewSeekable;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerPausableChanged
- {
- public int NewPausable;
- }
- #endregion
- #region List
- [StructLayout(LayoutKind.Sequential)]
- internal struct ListItemAdded
- {
- public IntPtr Item;
- public int Index;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct ListWillAddItem
- {
- public IntPtr Item;
- public int Index;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct ListItemDeleted
- {
- public IntPtr Item;
- public int Index;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct ListWillDeleteItem
- {
- public IntPtr Item;
- public int Index;
- }
- [StructLayout(LayoutKind.Sequential)]
- internal struct ListPlayerNextItemSet
- {
- public IntPtr Item;
- }
- #endregion
- /// <summary>
- /// Snapshot
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerSnapshotTaken
- {
- public IntPtr Filename;
- }
- /// <summary>
- /// Length
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerLengthChanged
- {
- public long NewLength;
- }
- /// <summary>
- /// VLM media
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- internal struct VlmMediaEvent
- {
- public IntPtr MediaName;
- public IntPtr InstanceName;
- }
- /// <summary>
- /// Buffering value
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerBuffering
- {
- public float NewCache;
- }
- /// <summary>
- /// Extra MediaPlayer
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- internal struct PlayerMediaChanged
- {
- public IntPtr NewMedia;
- }
- }
|