This repository was archived by the owner on Apr 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -152,12 +152,10 @@ fn send_sdp_offer(app_control: &AppControl, offer: gst_webrtc::WebRTCSessionDesc
152
152
) {
153
153
return ;
154
154
}
155
- let message = json ! ( {
156
- "sdp" : {
157
- "type" : "offer" ,
158
- "sdp" : offer. get_sdp( ) . as_text( ) ,
159
- }
160
- } ) ;
155
+ let message = serde_json:: to_string ( & JsonMsg :: Sdp {
156
+ type_ : "offer" . to_string ( ) ,
157
+ sdp : offer. get_sdp ( ) . as_text ( ) . unwrap ( ) ,
158
+ } ) . unwrap ( ) ;
161
159
app_control. send_text_msg ( message. to_string ( ) ) ;
162
160
}
163
161
@@ -297,16 +295,13 @@ fn send_ice_candidate_message(app_control: &AppControl, values: &[glib::Value])
297
295
if !app_control. app_state_lt ( AppState :: PeerCallNegotiating , "Can't send ICE, not in call" ) {
298
296
return ;
299
297
}
300
-
301
298
let _webrtc = values[ 0 ] . get :: < gst:: Element > ( ) . expect ( "Invalid argument" ) ;
302
299
let mlineindex = values[ 1 ] . get :: < u32 > ( ) . expect ( "Invalid argument" ) ;
303
300
let candidate = values[ 2 ] . get :: < String > ( ) . expect ( "Invalid argument" ) ;
304
- let message = json ! ( {
305
- "ice" : {
306
- "candidate" : candidate,
307
- "sdpMLineIndex" : mlineindex,
308
- }
309
- } ) ;
301
+ let message = serde_json:: to_string ( & JsonMsg :: Ice {
302
+ candidate : candidate,
303
+ sdp_mline_index : mlineindex,
304
+ } ) . unwrap ( ) ;
310
305
app_control. send_text_msg ( message. to_string ( ) ) ;
311
306
}
312
307
You can’t perform that action at this time.
0 commit comments