Пример #1
0
 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);
     }
 }
Пример #2
0
 void OnPreviewCallBack(int lPlayHandle, streamType enStreamType, IntPtr pArray, int iDataLen, IntPtr pUserData)
 {
 }
Пример #3
0
 public static extern int ISMS_StartPreviewEx(string szCameraUuid, IntPtr pWnd, streamType enStreamType, DelegateDef.StreamCallBack fnTranformedData,
                                              DelegateDef.PlayMsgCallBack fnPlayMsg, DelegateDef.DecodedDataCallBack fnDecodedData, IntPtr pUserData);