Exemplo n.º 1
0
 public Task ProcessRequestAsync(byte[] requestBytes, IPEndPoint remoteEndPoint)
 {
     if (IsRtcpPacket(requestBytes))
     {
         var rtcpPacket = RtcpPacketParser.ParseRtcpPacket(requestBytes);
     }
     else
     {
         var rtp = RtpPacketParser.ParseRtpPacket(requestBytes);
         // todo: srtp decryption
     }
     return(Task.CompletedTask);
 }
Exemplo n.º 2
0
        private async Task <RtpPacket> ReceiveUnorderedAsync()
        {
            try
            {
                var result = await ReceiveRawBytesAsync();

                var rtpPacket = RtpPacketParser.ParseRtpPacket(result.Buffer);
                rtpPacket.RemoteEndPoint = result.RemoteEndPoint;

                return(rtpPacket);
            }
            catch (Exception e)
            {
                Debug.WriteLine($"Exception when receiving bytes. {e}", nameof(RtpClient));
                throw;
            }
        }