mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-22 10:03:01 +08:00
c842650c11
Signed-off-by: 21pages <pages21@163.com>
36 lines
946 B
Rust
36 lines
946 B
Rust
use hbb_common::{
|
|
get_time,
|
|
message_proto::{Message, VoiceCallRequest, VoiceCallResponse},
|
|
};
|
|
use scrap::CodecFormat;
|
|
|
|
#[derive(Debug, Default)]
|
|
pub struct QualityStatus {
|
|
pub speed: Option<String>,
|
|
pub fps: Option<i32>,
|
|
pub delay: Option<i32>,
|
|
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
|
|
}
|