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 65A934B439 for ; Mon, 21 Jul 2025 11:32:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 4ACCE68C3AD; Mon, 21 Jul 2025 14:31:11 +0300 (EEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 8C93C68C3AD for ; Mon, 21 Jul 2025 14:31:09 +0300 (EEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-74b54cead6cso2610541b3a.1 for ; Mon, 21 Jul 2025 04:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753097467; x=1753702267; 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=JmEbAfSNSnWcD+IF7MHPYtXcjz4nIlna30r3l+31j0kmrn+RNsxkIq48f9y7P4Vw07 CeSdm86z+ioxbcqsfL1xIMve5SlQ3AnmdSIdLrxN0HSWYylMTWV/JTxYwPqPzjAYepcb DPWoDOfvDWkEClfH1HN1m61/q1BXVR32FY8b2ENJFWW6tEeJLY0WA7FHyqz2BNha+6ow +a08e1rLadKaA4lHQbueDBFJtVr44nZDQgkRFEHlB8Vtn4bc2HqiqfVCmTzi77bGmlXZ S6nURk049U1rQA3i3XpH1pX6GWnGdrKkHIpQP5rmt7hWPPKy0lFIGrfLZFvKdedAlTuD HWFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753097467; x=1753702267; 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=MSQsyaKdhkFsHxk/QvQLQmCqr3BzoA1EoPW/XgcAwCKfak0BBlXUIrZ3bYHEct/QIR EMi5HkOMJhZTnzZzBxDlCJb/Ay2cq6A+iJHH+pyfN4rgyoLh+ap11PkLVTr1IseF6uaE L4VaDLLisujUWV8K7t8wqqeDdo+QBlExU3pDReq066qajH+3f3j0fbRxi8k1rhLGhR11 9tzYKhQb6gYfYTxDsEsWfrSjSZUbBiV4jTjZlln3tV9MTO3KY+FDkAAU+oIGxGrslWxo Yaq4ZC0hBxtwta9c4arIbX/OKRJxPZg3ltiaUK0FAHvXWuyk1QMdQbXBMSNMEUvI/NU7 mNuA== X-Gm-Message-State: AOJu0YytGj9TNsycvVR7f9jk0l5+29jh+se+wB58rbpu7dB3/CElfpCb YYuPZZQojn6oovgq5yarlvpndUpv6kmwzg41oQvRkU2pDSQmOLmFYS73UCUueOll X-Gm-Gg: ASbGncusDwExGTtsPR1UdNT1600ZRPG0WnBSGz/WdtD6o8nlvCjzSl7REIQw36gNUuF iJsM+VZ2QOYZvWXKQ+r7CXTwbAqYavezqNi5EbuFEkqLGg6WfNdQ54FcsBdI6Fs/O1Pt2snSQpj km3rsCrW5fHnEzMwn36wKLLunyTehxzcp7vtjDjdsOtNxoGgGeS/N25/Ei+g9RDuQhbEkhd5CjC fd3r/PHGHqNYaPVvgXC0miYOLShTx0Rj50ApN8qYIZXKEzDIyKHcs7U4msfNZkF1188qDCSN4P6 BcQ+VwqmU5RUc/kkO1u/RsZjIKCjZxoI7DXHGNzs2xNmNOxIAwllzKnP/ROrJwPdfJf6m8AmyuS JSolc3fOkbLCCOOwOx65oDE8PbyZl4OJL X-Google-Smtp-Source: AGHT+IFyBGvWh5eNo0A0pPfWIpFYKPEPSMghnfGb5FupPxi+R/CKKiWahBXFJn+yba+MBszBCcKSxg== X-Received: by 2002:a05:6a00:2d08:b0:73c:b86:b47f with SMTP id d2e1a72fcca58-75722282778mr29732810b3a.4.1753097467143; Mon, 21 Jul 2025 04:31:07 -0700 (PDT) Received: from localhost.localdomain ([5.34.218.160]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-759cbd68350sm5630277b3a.148.2025.07.21.04.31.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 21 Jul 2025 04:31:06 -0700 (PDT) From: Jack Lau X-Google-Original-From: Jack Lau To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Jul 2025 19:30:21 +0800 Message-ID: <20250721113023.91931-11-jacklau1222@qq.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250721113023.91931-1-jacklau1222@qq.com> References: <20250721113023.91931-1-jacklau1222@qq.com> MIME-Version: 1.0 X-Unsent: 1 Subject: [FFmpeg-devel] [PATCH v4 10/11] 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".