Skip to content

Commit 95820b7

Browse files
committed
update .
1 parent 7ac88bb commit 95820b7

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

crates/rtc-manager/src/entities/room.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ impl Room {
104104
// Add the shared UDP socket as a host candidate
105105
let addr = self.udp_socket.local_addr().unwrap();
106106
let candidate = Candidate::host(addr, "udp").expect("a host candidate");
107-
rtc.add_local_candidate(candidate).unwrap();
108-
info!("📡 Added host candidate: {}", addr);
107+
rtc.add_local_candidate(candidate.clone()).unwrap();
108+
info!("📡 Added host candidate: {:?}", candidate.to_sdp_string());
109109

110110
// Create publisher with the new str0m-based architecture
111111
let publisher = Publisher::new(rtc, params.clone());
@@ -150,15 +150,16 @@ impl Room {
150150
.map_err(|_| WebRTCError::FailedToCreateAnswer)?
151151
};
152152

153-
let answer_json = serde_json::to_string(&answer).unwrap();
154-
info!("📄 SFU SDP answer created: {} chars", answer_json.len());
155-
156153
// Create response with real SDP
157154
let response = JoinRoomResponse {
158-
sdp: answer_json,
155+
sdp: answer.to_sdp_string(),
159156
is_recording: false,
160157
};
161158

159+
tokio::spawn(async move {
160+
(params.callback)(false).await;
161+
});
162+
162163
info!(
163164
"✅ SFU join room successful for participant: {}",
164165
participant_id

crates/rtc-manager/src/rtc_manager.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::sync::Arc;
2-
use std::time::Duration;
32

43
use dashmap::DashMap;
54
use parking_lot::RwLock;
@@ -108,7 +107,7 @@ impl RtcManager {
108107
room.join_room(params, room_id)?
109108
};
110109

111-
info!("✅ Join room completed for participant: {}", participant_id);
110+
info!("✅ Join room completed for participant: {}", res.as_ref().unwrap().sdp.len());
112111
Ok(res)
113112
}
114113

sfu/src/application/sfu_grpc_service.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
use std::sync::Arc;
22

33
use parking_lot::RwLock;
4-
use tokio::sync::Mutex;
5-
use tonic::{Request, Response, Status};
6-
use waterbus_proto::{
7-
AddPublisherCandidateRequest, AddSubscriberCandidateRequest, JoinRoomRequest, JoinRoomResponse,
8-
LeaveRoomRequest, LeaveRoomResponse, MigratePublisherRequest, MigratePublisherResponse,
9-
NewUserJoinedRequest, PublisherRenegotiationRequest,
10-
PublisherRenegotiationResponse, SetCameraType, SetEnabledRequest, SetScreenSharingRequest,
11-
SetSubscriberSdpRequest, StatusResponse, SubscribeHlsLiveStreamRequest,
12-
SubscribeHlsLiveStreamResponse, SubscribeRequest, SubscribeResponse, SubscriberRenegotiateRequest, sfu_service_server::SfuService,
13-
};
144
use rtc_manager::{
155
models::{
166
connection_type::ConnectionType,
177
input_params::{IceCandidate, JoinedCallback, RenegotiationCallback, RtcManagerConfig},
188
},
199
rtc_manager::{JoinRoomReq, RtcManager},
2010
};
11+
use tokio::sync::Mutex;
12+
use tonic::{Request, Response, Status};
13+
use waterbus_proto::{
14+
AddPublisherCandidateRequest, AddSubscriberCandidateRequest, JoinRoomRequest, JoinRoomResponse,
15+
LeaveRoomRequest, LeaveRoomResponse, MigratePublisherRequest, MigratePublisherResponse,
16+
NewUserJoinedRequest, PublisherRenegotiationRequest, PublisherRenegotiationResponse,
17+
SetCameraType, SetEnabledRequest, SetScreenSharingRequest, SetSubscriberSdpRequest,
18+
StatusResponse, SubscribeHlsLiveStreamRequest, SubscribeHlsLiveStreamResponse,
19+
SubscribeRequest, SubscribeResponse, SubscriberRenegotiateRequest,
20+
sfu_service_server::SfuService,
21+
};
2122

2223
use super::dispacher_grpc_client::DispatcherGrpcClient;
2324

0 commit comments

Comments
 (0)