From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 935B34B93E for ; Tue, 22 Jul 2025 12:38:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id D19DD68D0BA; Tue, 22 Jul 2025 15:37:14 +0300 (EEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 671C468D130 for ; Tue, 22 Jul 2025 15:37:08 +0300 (EEST) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-234c5b57557so47887625ad.3 for ; Tue, 22 Jul 2025 05:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753187826; x=1753792626; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sYnO5s4KguMkRWKf8qU8jtbP8qnGucKOHo1crDvE7+k=; b=nml/TdxYG6VezxJZ1dEIWp2JpYbJ60beUYGa1a2Ep/kPyzyT8++TEBjz+AFmDqPtRF nNzuYEwXwlf844uVHTwIiK8v0UQHRdPiL2s6DroLUOzSimrHdpy3QJzzPrIeKyViig/Y 1zmWFFUTLiVWwbU5i/mEoRgpZN2Z83OSWSgcR7Q4b1sNEMxW9AjkjKp3OXCA63/UOnrI MQVIRVYkg9fJXFXHgalq7MP/wpE785QmfPqaWcMYpNR7QqlOf+x2UnRE1ZQ3uAs0Wi3d ViC1q0g+xbYDNmZEsFuGXNmHMIu1vY/PjZ+eqf1Kjf0Gnld2GhEp7Nhgn4vyUpv1/7FU 9y4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753187826; x=1753792626; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sYnO5s4KguMkRWKf8qU8jtbP8qnGucKOHo1crDvE7+k=; b=P/wznRjhzsHquvcHMrWEIaMnyQ2Adru8MbLQtK8g+wBtA1WlDLlqPBTR53FFYPQSPG S7WY/d1i5sj6eoYvALo+8omne4IjkWZSa5EBEdE5SplxBFgf8tiUorbMgmLKki/kBazq Ms/C4I8TT+3J/LwBkOFXahV04dSj34OFmCXaAZcoqiTKcaov+fJc+EZdCOYDLm0e4Hpy w0mDl6KeoswOtvs9V6TTsGwkmllmMZ4nNQ39PVkK9pyuVW8IryD6h0pGhbfORL3e51LU zakiqqMD1xMVBCl7e/YFW7aNsdGHldNj5c19tjwJOlXvMfhdt7AtmN5aMEz3ST8Qbksu gmrQ== X-Gm-Message-State: AOJu0Yz4Gmt56MBVhQgThmCAKSMyrfidGc8uaJT4pDC9sZuxMjCXdaGb Q2MvZ2Cfla+V7hEaLcafv6HCLO2PHPkePMbwFw7rcFgenz/7tqkZ5WgpWLEnU6nUQ50= X-Gm-Gg: ASbGncvDyhGz4hKy+RN2ixcvvfq2WNQSxbyGBuNE4Xh3qWKh0wIOSuoMAz1sxTJhMkr W0OOXAx3F27KIpiTlkoWOE7UC56GdonfOFwHPf4nd8ExSYyDW8bole8rf6ny7Mr8plU2iZD164M Vjy9cetfg9etjhwa6ecE4A2kaiuhYpuk361ZSY6OAzDWNLWhsdYqK359GuURCCGDuZ3tpCB5qr9 WZi4HVrFewbE2URMi1mmIP6dfmpBrwyoFrzuClxB4Ie6EDGeaERFxLPCor30Xo+xo9SbOuwHMaU y7kbbfIOYanbYn2hq4Cn/Gse4OuoshnGts/lCwjMVq71QNXM8mEqfIibobEA+Dyy6yQPqm78dzN YweEo25yfeUa/nzAnu1a0jHwUCvNo1XjD7GuaW8399ibTJQ== X-Google-Smtp-Source: AGHT+IEWT26XsGIIvorHR78gi5dmzzFyDaxKT2UMlqZ3H/6jsD5TqEthGZqFGFu9hLyjLYreUCAKmg== X-Received: by 2002:a17:902:ebcb:b0:235:7c6:ebd2 with SMTP id d9443c01a7336-23e25730056mr357586355ad.31.1753187826407; Tue, 22 Jul 2025 05:37:06 -0700 (PDT) Received: from localhost.localdomain ([182.126.128.169]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23e3b60edbasm75740715ad.70.2025.07.22.05.37.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 22 Jul 2025 05:37:06 -0700 (PDT) From: Jack Lau X-Google-Original-From: Jack Lau To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Jul 2025 20:36:11 +0800 Message-ID: <20250722123616.53164-11-jacklau1222@qq.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250722123616.53164-1-jacklau1222@qq.com> References: <20250722123616.53164-1-jacklau1222@qq.com> MIME-Version: 1.0 X-Unsent: 1 Subject: [FFmpeg-devel] [PATCH v5 10/15] avformat/whip: remove WHIP_STATE_DTLS_CONNECTING X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Jack Lau Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This value is only useful when dtls handshake is NONBLOCK mode, dtls handshake just need to call ffurl_handshake once since it force block mode. Signed-off-by: Jack Lau --- libavformat/whip.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/libavformat/whip.c b/libavformat/whip.c index d37a61042f..4c8ed26cef 100644 --- a/libavformat/whip.c +++ b/libavformat/whip.c @@ -187,8 +187,6 @@ enum WHIPState { WHIP_STATE_ICE_CONNECTING, /* The muxer has received the ICE response from the peer. */ WHIP_STATE_ICE_CONNECTED, - /* The muxer starts attempting the DTLS handshake. */ - WHIP_STATE_DTLS_CONNECTING, /* The muxer has finished the DTLS handshake with the peer. */ WHIP_STATE_DTLS_FINISHED, /* The muxer has finished the SRTP setup. */ @@ -1281,7 +1279,7 @@ next_packet: } /* Read the STUN or DTLS messages from peer. */ - for (i = 0; i < ICE_DTLS_READ_INTERVAL / 5 && whip->state < WHIP_STATE_DTLS_CONNECTING; i++) { + for (i = 0; i < ICE_DTLS_READ_INTERVAL / 5 && whip->state < WHIP_STATE_ICE_CONNECTED; i++) { ret = ffurl_read(whip->udp, whip->buf, sizeof(whip->buf)); if (ret > 0) break; @@ -1295,14 +1293,11 @@ next_packet: goto end; } - /* Got nothing, continue to process handshake. */ - if (ret <= 0 && (is_dtls_active ? whip->state < WHIP_STATE_ICE_CONNECTED : whip->state < WHIP_STATE_DTLS_CONNECTING)) - continue; - /* Handle the ICE binding response. */ if (ice_is_binding_response(whip->buf, ret)) { if (whip->state < WHIP_STATE_ICE_CONNECTED) { - whip->state = WHIP_STATE_ICE_CONNECTED; + if (whip->is_peer_ice_lite) + whip->state = WHIP_STATE_ICE_CONNECTED; whip->whip_ice_time = av_gettime(); av_log(whip, AV_LOG_VERBOSE, "ICE STUN ok, state=%d, url=udp://%s:%d, location=%s, username=%s:%s, res=%dB, elapsed=%dms\n", whip->state, whip->ice_host, whip->ice_port, whip->whip_resource_url ? whip->whip_resource_url : "", @@ -1332,16 +1327,15 @@ next_packet: goto next_packet; } - /* When a binding request is received, it is necessary to respond immediately. */ + /* See RFC8445, Triggered check when the peer is ice full mode */ if (ice_is_binding_request(whip->buf, ret)) { if ((ret = ice_handle_binding_request(s, whip->buf, ret)) < 0) goto end; goto next_packet; } - /* If got any DTLS messages, handle it. */ - if ((is_dtls_packet(whip->buf, ret) || is_dtls_active) && whip->state >= WHIP_STATE_ICE_CONNECTED || whip->state == WHIP_STATE_DTLS_CONNECTING) { - whip->state = WHIP_STATE_DTLS_CONNECTING; + if ((is_dtls_packet(whip->buf, ret) || is_dtls_active) && whip->state >= WHIP_STATE_ICE_CONNECTED || whip->state == WHIP_STATE_ICE_CONNECTING) { + whip->state = WHIP_STATE_ICE_CONNECTED; ret = ffurl_handshake(whip->dtls_uc); if (ret < 0) { whip->state = WHIP_STATE_FAILED; -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".