/// <summary> /// 获取媒体的基本流的描述,注意,在调用该方法之前你需要首先调用 <see cref="ParseMedia"/> 方法,或者至少播放一次. /// 否则,你将的得到一个空数组 /// </summary> /// <returns>一个 <see cref="MediaTrackInfo"/> 数组</returns> public MediaTrackInfo[] GetTrackInfo() { IntPtr pointer; var count = _getTracksInfoFunction.Delegate(InstancePointer, out pointer); var result = new MediaTrackInfo[count]; var temp = pointer; for (var i = 0; i < count; i++) { result[i] = (MediaTrackInfo)Marshal.PtrToStructure(temp, typeof(MediaTrackInfo)); temp = (IntPtr)((int)temp + Marshal.SizeOf(typeof(MediaTrackInfo))); } Vlc.Free(pointer); return(result); }
public void Dispose() { HandleManager.Remove(this); Vlc.Free(InstancePointer); InstancePointer = IntPtr.Zero; }