예제 #1
0
 /// <summary>
 /// Stop sending the data stream.
 /// </summary>
 public virtual void Stop()
 {
     if (fgm != null)
     {
         fgm.Stop();
     }
 }
예제 #2
0
        /// <summary>
        /// Call the graphmanager stop method.
        /// </summary>
        /// <returns></returns>
        public bool Stop()
        {
            if (!playing)
            {
                Debug.WriteLine("Graph is not running.");
                return(false);
            }

            playing = false;

            if (fgm == null)
            {
                return(true);
            }

            try
            {
                //If stream is paused Stop will hang unless we first call
                //RtpStream.UnblockNextFrame
                if (this.stream != null)
                {
                    this.stream.UnblockNextFrame();
                }
                fgm.Stop();
            }
            catch (Exception e)
            {
                eventLog.WriteEntry("Failed to stop graph: " + e.ToString(), EventLogEntryType.Error, 1001);
                Debug.WriteLine("Failed to stop graph: " + e.ToString());
                return(false);
            }
            return(true);
        }
예제 #3
0
        public override bool RemoveCapability(ICapability capability)
        {
            bool ret = base.RemoveCapability(capability);

            if (ret)
            {
                if (fgm != null)
                {
                    fgm.Stop();
                    FilterGraph.RemoveFromRot(rotID);
                    FilterGraph.RemoveAllFilters(fgm);
                    fgm = null;
                }

                if (fgmEventMonitor != null)
                {
                    fgmEventMonitor.FgmEvent -= new FgmEventMonitor.FgmEventHandler(FgmEvent);
                    fgmEventMonitor.Dispose();
                    fgmEventMonitor = null;
                }

                wmf = null;
            }

            return(ret);
        }
예제 #4
0
        public override bool RemoveCapability(ICapability capability)
        {
            bool ret = base.RemoveCapability(capability);

            if (ret)
            {
                ssc = null;

                fgm.Stop();
                FilterGraph.RemoveAllFilters(fgm);
                fgm = null;
            }

            return(ret);
        }
        // CF3, CF2, CF1
        private void Cleanup()
        {
            // CF3, Quit processing received data
            if (fgm != null)
            {
                rtpStream.UnblockNextFrame();
                fgm.Stop();
                FilterGraph.RemoveAllFilters(fgm);
                fgm = null;
            }

            DisposeDevice();   // CF2
            LeaveRtpSession(); // CF1
        }