示例#1
0
        //------------------------------------------------------------------------------------------------------------------------
        public bool serverNegotiation(Yodiwo.YPChannel.Channel channel)
        {
            //requires authentication
            var resp = channel.SendRequest <VideoAuthenticationResponse>(new VideoAuthenticationRequest());

            if (resp == null)
            {
                return(false);
            }
            else
            {
                //handle response
                if (!videofeeds.ContainsKey(resp.videotoken))
                {
                    return(false);
                }
                else
                {
                    //create context
                    var ctx = new ChannelContext()
                    {
                        videoInfo = videofeeds[resp.videotoken],
                    };
                    channel.Tags.Add(typeof(ChannelContext), ctx);
                    ctx.Receiving = true;
                    return(true);
                }
            }
        }
示例#2
0
 //------------------------------------------------------------------------------------------------------------------------
 public void serverChannel_OnOpenEvent(Yodiwo.YPChannel.Channel channel)
 {
     DebugEx.TraceLog("A mjpeg recorder has been connected to me");
     Task.Run(() =>
     {
         var req = new VideoDataReq()
         {
             vflow = VideoFlow.Start
         };
         channel.SendRequest(req);
     });
 }