Beispiel #1
0
        /**
         * Constructor.
         */
        public Streaming()
        {
            log.Trace("Creating streaming server");
            this.livePublishingPoint     = null;
            this.onDemandPublishingPoint = null;
            this.onDemandState           = State.Stopped;
            this.liveState = State.Stopped;
            this.mode      = Modes.None;

            this.wmServer = new WMSServerClass();

            // Remove existing publishing points
            for (int i = 0; i < this.wmServer.PublishingPoints.length; ++i)
            {
                log.Trace("Existing publishing points = " + this.wmServer.PublishingPoints.length);
                if (this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST ||
                    this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND)
                {
                    try
                    {
                        this.wmServer.PublishingPoints.Remove(i);
                        i--;
                    }
                    catch (Exception e)
                    {
                        log.ErrorException("Exception raised while removing publishing point: " + e.Message, e);
                    }
                }
            }
        }
Beispiel #2
0
        /**
         * Constructor.
         */
        public Streaming()
        {
            log.Trace("Creating streaming server");
            this.livePublishingPoint = null;
            this.onDemandPublishingPoint = null;
            this.onDemandState = State.Stopped;
            this.liveState = State.Stopped;
            this.mode = Modes.None;

            this.wmServer = new WMSServerClass();

            // Remove existing publishing points
            for (int i = 0; i < this.wmServer.PublishingPoints.length; ++i)
            {
                log.Trace("Existing publishing points = " + this.wmServer.PublishingPoints.length);
                if (this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST ||
                    this.wmServer.PublishingPoints[i].Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND)
                {
                    try
                    {
                        this.wmServer.PublishingPoints.Remove(i);
                        i--;
                    }
                    catch (Exception e)
                    {
                        log.ErrorException("Exception raised while removing publishing point: " + e.Message, e);
                    }
                }
            }
        }
Beispiel #3
0
 void MainFormLoad(object sender, EventArgs e)
 {
     try{
         LoadConfig();
         Server         = new WMSServerClass();
         timer1.Enabled = true;
         PubPoints      = Server.PublishingPoints;
         for (int i = 0; i < PubPoints.length; i++)
         {
             PubPoint = PubPoints[i];
             if (PubPoint.Name == AirPoint)
             {
                 CastPointDJ = (IWMSBroadcastPublishingPoint)PubPoint;
             }
             else if (PubPoint.Name == OutPoint)
             {
                 CastPointFM = (IWMSBroadcastPublishingPoint)PubPoint;
             }
         }
         if (CastPointFM == null)
         {
             MessageBox.Show("错误,找不到" + OutPoint + "发布点!");
         }
         checkState();
     }
     catch {
         MessageBox.Show("无法创建WMS对象!请确保安装了WMS。", "错误", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }