1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avformat/whip: check the peer whether is ice lite

See RFC 5245 Section 4.3
If an agent is a lite implementation, it MUST include an "a=ice-lite"
session-level attribute in its SDP.  If an agent is a full
implementation, it MUST NOT include this attribute.

Signed-off-by: Jack Lau <jacklau1222@qq.com>
This commit is contained in:
Jack Lau
2025-08-16 20:20:23 +08:00
committed by stevenliu
parent ec0a04de0d
commit 76b13ca0a6

View File

@@ -257,6 +257,7 @@ typedef struct WHIPContext {
*/
char *sdp_offer;
int is_peer_ice_lite;
uint64_t ice_tie_breaker; // random 64 bit, for ICE-CONTROLLING
/* The ICE username and pwd from remote server. */
char *ice_ufrag_remote;
@@ -886,6 +887,8 @@ static int parse_answer(AVFormatContext *s)
for (i = 0; !avio_feof(pb); i++) {
ff_get_chomp_line(pb, line, sizeof(line));
if (av_strstart(line, "a=ice-lite", &ptr))
whip->is_peer_ice_lite = 1;
if (av_strstart(line, "a=ice-ufrag:", &ptr) && !whip->ice_ufrag_remote) {
whip->ice_ufrag_remote = av_strdup(ptr);
if (!whip->ice_ufrag_remote) {