Beispiel #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;
     }
 }
Beispiel #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();
 }
Beispiel #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);
 }
Beispiel #4
0
 public void Stop()
 {
     Logger.LogInfo("DelaylessFrameDecoder.Stop() called.");
     frameQueue         = null;
     requestTermination = true;
 }
Beispiel #5
0
 public DelaylessFrameDecoder(FrameQueue _queue)
 {
     frameQueue = _queue;
 }
Beispiel #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);
        }
Beispiel #7
0
        // for GET
        public void StartAsync(string _url, FrameQueue _frameQueue, OnDisconnect _onDisconnect = null)
        {
            HttpWebRequest request = CreateRequestForGET(_url);

            StartAsync(_frameQueue, request, _onDisconnect);
        }