Пример #1
0
 public void Stop()
 {
     if (request != null)
     {
         //request.Abort ();
         request = null;
     }
     if (mjpgReader != null)
     {
         mjpgReader.Stop();
         mjpgReader = null;
     }
     if (response != null)
     {
         response.Close();
         response = null;
     }
     if (thread != null)
     {
         //thread.Abort ();
         thread = null;
     }
     lock (this) {
         frameQueue = null;
     }
 }
Пример #2
0
 public void Start(string _url, FrameQueue _frameQueue, OnDisconnect _onDisconnect = null)
 {
     Stop();
     url             = _url;
     frameQueue      = _frameQueue;
     onDisconnect    = _onDisconnect;
     eof             = false;
     failed          = false;
     thread          = new Thread(ReadThread);
     thread.Priority = System.Threading.ThreadPriority.AboveNormal;
     thread.Start();
 }
Пример #3
0
 private void StartAsync(FrameQueue _frameQueue, HttpWebRequest request, OnDisconnect _onDisconnect = null)
 {
     if (mjpgReader != null)
     {
         Debug.LogError("previous play not stopped.");
         return;
     }
     frameQueue   = _frameQueue;
     onDisconnect = _onDisconnect;
     eof          = false;
     failed       = false;
     StartConnectionAsync(request);
 }
Пример #4
0
 public void Stop()
 {
     Logger.LogInfo("DelaylessFrameDecoder.Stop() called.");
     frameQueue         = null;
     requestTermination = true;
 }
Пример #5
0
 public DelaylessFrameDecoder(FrameQueue _queue)
 {
     frameQueue = _queue;
 }
Пример #6
0
        // for POST
        public void StartAsync(string _url, FrameQueue _frameQueue, byte[] postBytes, OnDisconnect _onDisconnect = null)
        {
            HttpWebRequest request = CreateRequestForPOST(_url, postBytes);

            StartAsync(_frameQueue, request, _onDisconnect);
        }
Пример #7
0
        // for GET
        public void StartAsync(string _url, FrameQueue _frameQueue, OnDisconnect _onDisconnect = null)
        {
            HttpWebRequest request = CreateRequestForGET(_url);

            StartAsync(_frameQueue, request, _onDisconnect);
        }