public MediaInfo(string xml) { try { using (TextReader ms = new StringReader(xml)) { XmlSerializer xs = new XmlSerializer(typeof(ffprobeType)); ffprobeType ff = xs.Deserialize(ms) as ffprobeType; if (ff == null || ff.streams == null || ff.format == null) { throw new CoreException(I18n.Get("ErrorInvalidFormat")); } if (ff.streams.Length > 2) { throw new CoreException(I18n.Get("ErrorNoMore2Streams")); } FormatInfo = ff.format; foreach (streamType st in ff.streams) { if ("video".Equals(st.codec_type)) { if (VideoInfo != null) { throw new CoreException(I18n.Get("ErrorNoMore1Video")); } VideoInfo = st; } else { if (AudioInfo != null) { throw new CoreException(I18n.Get("ErrorNoMore1Audio")); } AudioInfo = st; } } } } catch (Exception ex) { FormatInfo = null; VideoInfo = null; AudioInfo = null; ex.PreserveStackTrace(); throw new CoreException(ex.Message, ex); } }
void OnPreviewCallBack(int lPlayHandle, streamType enStreamType, IntPtr pArray, int iDataLen, IntPtr pUserData) { }
public static extern int ISMS_StartPreviewEx(string szCameraUuid, IntPtr pWnd, streamType enStreamType, DelegateDef.StreamCallBack fnTranformedData, DelegateDef.PlayMsgCallBack fnPlayMsg, DelegateDef.DecodedDataCallBack fnDecodedData, IntPtr pUserData);