예제 #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);
     });
 }
예제 #3
0
        //------------------------------------------------------------------------------------------------------------------------

        public bool serverNegotiation(Yodiwo.YPChannel.Channel channel)
        {
            var resp = channel.SendRequest<AudioAuthenticationResponse>(new AudioAuthenticationRequest());
            if (resp == null)
                return false;
            else
            {
                //handle response
                if (!audiopipes.ContainsKey(resp.audiotoken))
                    return false;
                else
                {
                    //create context
                    var ctx = new ChannelContext()
                    {
                        audioInfo = audiopipes[resp.audiotoken],
                    };
                    channel.Tags.Add(typeof(ChannelContext), ctx);
                    ctx.Receiving = true;
                    return true;
                }
            }
        }