feat: add voice call proto

This commit is contained in:
Kingtous
2023-02-05 23:47:06 +08:00
parent b335d2c828
commit 45b93100d6
7 changed files with 138 additions and 69 deletions

View File

@@ -1,26 +1,30 @@
use crate::client::io_loop::Remote;
use crate::client::{
check_if_retry, handle_hash, handle_login_error, handle_login_from_ui, handle_test_delay,
input_os_password, load_config, send_mouse, start_video_audio_threads, FileManager, Key,
LoginConfigHandler, QualityStatus, KEY_MAP,
};
use crate::common::{self, GrabState};
use crate::keyboard;
use crate::{client::Data, client::Interface};
use async_trait::async_trait;
use bytes::Bytes;
use hbb_common::config::{Config, LocalConfig, PeerConfig, RS_PUB_KEY};
use hbb_common::rendezvous_proto::ConnType;
use hbb_common::tokio::{self, sync::mpsc};
use hbb_common::{allow_err, message_proto::*};
use hbb_common::{fs, get_version_number, log, Stream};
use rdev::{Event, EventType::*};
use std::collections::HashMap;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{Arc, Mutex, RwLock};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use async_trait::async_trait;
use bytes::Bytes;
use rdev::{Event, EventType::*};
use uuid::Uuid;
use hbb_common::{allow_err, message_proto::*};
use hbb_common::{fs, get_version_number, log, Stream};
use hbb_common::config::{Config, LocalConfig, PeerConfig, RS_PUB_KEY};
use hbb_common::rendezvous_proto::ConnType;
use hbb_common::tokio::{self, sync::mpsc};
use crate::{client::Data, client::Interface};
use crate::client::{
check_if_retry, FileManager, handle_hash, handle_login_error, handle_login_from_ui,
handle_test_delay, input_os_password, Key, KEY_MAP, load_config, LoginConfigHandler,
QualityStatus, send_mouse, start_video_audio_threads,
};
use crate::client::io_loop::Remote;
use crate::common::{self, GrabState};
use crate::keyboard;
pub static IS_IN: AtomicBool = AtomicBool::new(false);
#[derive(Clone, Default)]
@@ -669,6 +673,14 @@ impl<T: InvokeUiSession> Session<T> {
}
}
}
pub fn request_voice_call(&self) {
self.send(Data::NewVoiceCall);
}
pub fn close_voice_call(&self) {
self.send(Data::CloseVoiceCall);
}
}
pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {