mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
feat: rust connection implementation
This commit is contained in:
@@ -5,7 +5,7 @@ use std::{
|
||||
|
||||
use hbb_common::{
|
||||
log,
|
||||
message_proto::{video_frame, VideoFrame},
|
||||
message_proto::{video_frame, VideoFrame, Message, VoiceCallRequest, VoiceCallResponse}, get_time,
|
||||
};
|
||||
|
||||
const MAX_LATENCY: i64 = 500;
|
||||
@@ -115,3 +115,24 @@ pub struct QualityStatus {
|
||||
pub target_bitrate: Option<i32>,
|
||||
pub codec_format: Option<CodecFormat>,
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new_voice_call_request(is_connect: bool) -> Message {
|
||||
let mut req = VoiceCallRequest::new();
|
||||
req.is_connect = is_connect;
|
||||
req.req_timestamp = get_time();
|
||||
let mut msg = Message::new();
|
||||
msg.set_voice_call_request(req);
|
||||
msg
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn new_voice_call_response(request_timestamp: i64, accepted: bool) -> Message {
|
||||
let mut resp = VoiceCallResponse::new();
|
||||
resp.accepted = accepted;
|
||||
resp.req_timestamp = request_timestamp;
|
||||
resp.ack_timestamp = get_time();
|
||||
let mut msg = Message::new();
|
||||
msg.set_voice_call_response(resp);
|
||||
msg
|
||||
}
|
||||
Reference in New Issue
Block a user