Subject: [rtcweb] Add, remove, add, remove, add, remove a media stream (lines in SDP)

From: Iñaki Baz Castillo <[email-masked]>
Date: Sun, 22 Apr 2012 19:12:16 +0200

Hi, a stream in an SDP cannot be removed but just "disabled" (by
setting its port to 0). In the same media session a participant could
add a video stream and "disable" it later multiple times.

Let's assume a media session initiated with just an audio stream:

1) A participant adds a video stream and the remote accepts it. This
involves a new media section in the SDP.
2) Later the same participant removes the video stream which means
setting its port to 0 in the SDP.
3) Later he adds video again.
4) ...and so on.

AFAIK there are two choices for step 2 and 3:

a) Releasing video resources and the UDP socket so when video is
enabled again a new line should be added to the SDP and new resources
(ICE, UDP socket) required.

b) Not releasing all the resources (keep the UDP socket but stop
sending/receiving data on it), and re-enabling it when video is added
again, so the same SDP line would be reused by setting its port to the
previous value.

Choice a) means more and more lines in the SDP for each video
activation. Option b) means not releasing resources after disabling a
media stream.

If I'm not wrong in the above text, which would be the WebRTC approach
for this topic?

Thanks a lot.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Christer Holmberg <[email-masked]>
Date: Mon, 23 Apr 2012 08:40:30 +0200

Hi,

I see no reason why you couldn't release resources when you disable media (read: set port to zero), but still re-use the associated m- line later.

Regards,

Christer

________________________________________
From: [email-masked] [[email-masked]] On Behalf Of Iñaki Baz Castillo [[email-masked]]
Sent: Sunday, April 22, 2012 8:12 PM
To: [email-masked]
Subject: [rtcweb] Add, remove, add, remove, add,        remove a media stream (lines in SDP)

Thanks a lot.

--
Iñaki Baz Castillo
<[email-masked]>
_______________________________________________
rtcweb mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/rtcweb

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Mon, 23 Apr 2012 09:29:29 +0200

> I see no reason why you couldn't release resources when you disable media (read: set port to zero), but still re-use the associated m- line later.

Maybe the previosly used UDP port is not available later. Probably
there are no more reasons :)

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Saúl Ibarra Corretgé <[email-masked]>
Date: Mon, 23 Apr 2012 09:41:26 +0200

Hi,

> there are no more reasons :)

But when you disabled the stream you did set the port to zero, so when you resurrect the stream you'd allocate a new port. Were you thinking about setting the stream as inactive (a=inactive in SDP terms) instead?

--
Saúl Ibarra Corretgé
AG Projects

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Mon, 23 Apr 2012 10:03:34 +0200

2012/4/23 Saúl Ibarra Corretgé <[email-masked]>:
> But when you disabled the stream you did set the port to zero, so when you resurrect the stream you'd allocate a new port.

The stack could try to allocate the same port as default bahavior.

> Were you thinking about setting the stream as inactive (a=inactive in SDP terms) instead?

But setting a=inactive just pauses the stream in a single direction
(according to RFC 4566). You could be interested in stopping sending
and receiving video.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Saúl Ibarra Corretgé <[email-masked]>
Date: Mon, 23 Apr 2012 10:12:12 +0200

> The stack could try to allocate the same port as default bahavior.

Well, then the stack needs to be fixed :-) The stack should 'forget' the port as soon as it sets it as zero in the stream, and allocate a new one, the same way it would do for a brand new stream.

> (according to RFC 4566). You could be interested in stopping sending

IIRC inactive pauses the stream in both directions. For pausing it in a single direction you can use sendonly / recvonly.

Regards,

--
Saúl Ibarra Corretgé
AG Projects

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Mon, 23 Apr 2012 10:24:09 +0200

2012/4/23 Saúl Ibarra Corretgé <[email-masked]>:
>> The stack could try to allocate the same port as default behavior.
>>
>

The WebRTCP stack is being designed right now :)

> IIRC inactive pauses the stream in both directions. For pausing it in a single direction you can use sendonly / recvonly.

You are totally right, my fault. Anyhow setting a=inactive means that
resources are not freed (for example, RTCP must be still sent). Not
sure if this is good or bad.

-- 
Iñaki Baz Castillo
<[email-masked]>

---

From: Randell Jesup <[email-masked]>
Date: Mon, 23 Apr 2012 04:26:09 -0400

On 4/23/2012 2:40 AM, Christer Holmberg wrote:
> Hi,
>
> I see no reason why you couldn't release resources when you disable media (read:
> set port to zero), but still re-use the associated m- line later.

Exactly - m-lines can't be removed, but they can be re-used - and the 
critical point is that the port doesn't have to match the previous port. 
  So generally they should be no worse than a high-water-mark of the 
number of audio and video streams in use at any one time.

Of course with bundle the port issue is simpler.

-- 
Randell Jesup
[email-masked]

---

From: Iñaki Baz Castillo <[email-masked]>
Date: Mon, 23 Apr 2012 10:32:43 +0200

2012/4/23 Randell Jesup <[email-masked]>:
> Exactly - m-lines can't be removed, but they can be re-used -

> and the critical point is that the port doesn't have to match the previous port.

Definitely I need a coffee. No idea why I assumed that the same port
should be re-used. So things become easier:

- Reuse the same m-line.
- Set port to zero when disabling the stream and free resources.
- Allocate a new port when re-enabling it and write the new port in the m-line.

Sorry, I was creating a non existing issue.

-- 
Iñaki Baz Castillo
<[email-masked]>