using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.SatIp.RtspRequests
{
	internal class RtspSetupRequest : RtspRequest
	{
		public RtspSetupRequest() : base("SETUP")
		{
		}

		public uint CSeq
		{
			set
			{
				base.args["CSeq"] = Convert.ToString(value);
			}
			get
			{
				return uint.Parse(base.args["CSeq"]);
			}
		}

		public string UserAgent
		{
			set
			{
				base.args["User-Agent"] = value;
			}
			get
			{
				return base.args["User-Agent"];
			}
		}

		public string Transport
		{
			set
			{
				base.args["Transport"] = value;
			}
			get
			{
				return base.args["Transport"];
			}
		}

		public void SetRtpAvpUnicast(int rtpPort, int rtcpPort)
		{
			Transport = String.Format("RTP/AVP;unicast;client_port={0}-{1}", rtpPort, rtcpPort);
		}

		public void SetRtpAvpMulticast(IPAddress targetIp, int rtpPort, int rtcpPort)
		{
			Transport = String.Format("RTP/AVP;multicast;destination={2};port={0}-{1}", rtpPort, rtcpPort, targetIp.ToString());
        }
	}
	
}
