ENH:fet the correct Agora status

jira:[none]

Change-Id: Ic779e41f0b652212aa8e4ce016cfe1ef2aba3608
This commit is contained in:
tao wang 2025-01-08 16:20:59 +08:00 committed by lane.wei
parent fad04b5725
commit 1c1b366d00
5 changed files with 22 additions and 8 deletions

View File

@ -1668,6 +1668,21 @@ bool MachineObject::is_recording()
return camera_recording;
}
int MachineObject::get_liveview_remote()
{
if (is_support_agora) {
liveview_remote == LVR_None ? LVR_Agora : liveview_remote == LVR_Tutk ? LVR_TutkAgora : liveview_remote;
}
return liveview_remote;
}
int MachineObject::get_file_remote()
{
if (is_support_agora)
file_remote = file_remote == FR_None ? FR_Agora : file_remote == FR_Tutk ? FR_TutkAgora : file_remote;
return file_remote;
}
std::string MachineObject::parse_version()
{
auto ota_version = module_vers.find("ota");
@ -4074,16 +4089,12 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
liveview_local = enum_index_of(ipcam["liveview"].value<std::string>("local", "none").c_str(), local_protos, 5, LiveviewLocal::LVL_None);
char const *remote_protos[] = {"none", "tutk", "agora", "tutk_agaro"};
liveview_remote = enum_index_of(ipcam["liveview"].value<std::string>("remote", "none").c_str(), remote_protos, 4, LiveviewRemote::LVR_None);
if (is_support_agora)
liveview_remote = liveview_remote == LVR_None ? LVR_Agora : liveview_remote == LVR_Tutk ? LVR_TutkAgora : liveview_remote;
}
if (ipcam.contains("file")) {
char const *local_protos[] = {"none", "local"};
file_local = enum_index_of(ipcam["file"].value<std::string>("local", "none").c_str(), local_protos, 2, FileLocal::FL_None);
char const *remote_protos[] = {"none", "tutk", "agora", "tutk_agaro"};
file_remote = enum_index_of(ipcam["file"].value<std::string>("remote", "none").c_str(), remote_protos, 4, FileRemote::FR_None);
if (is_support_agora)
file_remote = file_remote == FR_None ? FR_Agora : file_remote == FR_Tutk ? FR_TutkAgora : file_remote;
file_model_download = ipcam["file"].value<std::string>("model_download", "disabled") == "enabled";
}
virtual_camera = ipcam.value<std::string>("virtual_camera", "disabled") == "enabled";

View File

@ -1034,6 +1034,9 @@ public:
bool is_recording();
int get_liveview_remote();
int get_file_remote();
MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip);
~MachineObject();

View File

@ -225,7 +225,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
m_device_busy = obj->is_camera_busy_off();
m_sdcard_exist = obj->sdcard_state == MachineObject::SdcardState::HAS_SDCARD_NORMAL || obj->sdcard_state == MachineObject::SdcardState::HAS_SDCARD_READONLY;
m_local_proto = obj->file_local;
m_remote_proto = obj->file_remote;
m_remote_proto = obj->get_file_remote();
m_model_download_support = obj->file_model_download;
} else {
m_lan_mode = false;

View File

@ -157,7 +157,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
m_dev_ver = obj->get_ota_version();
m_lan_mode = obj->is_lan_mode_printer();
m_lan_proto = obj->liveview_local;
m_remote_proto = obj->liveview_remote;
m_remote_proto = obj->get_liveview_remote();
m_lan_ip = obj->dev_ip;
m_lan_passwd = obj->get_access_code();
m_device_busy = obj->is_camera_busy_off();

View File

@ -1198,7 +1198,7 @@ void SendToPrinterDialog::update_show_status()
std::string dev_id = obj_->dev_ip;
if (m_file_sys) {
if (dev_id == m_device_select) {
if ((m_waiting_enable && IsEnabled()) || (m_waiting_support && obj_->file_remote))
if ((m_waiting_enable && IsEnabled()) || (m_waiting_support && obj_->get_file_remote()))
m_file_sys->Retry();
return;
}
@ -1665,7 +1665,7 @@ void SendToPrinterDialog::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
std::string dev_ver = obj->get_ota_version();
std::string dev_id = obj->dev_id;
int remote_proto = obj->file_remote;
int remote_proto = obj->get_file_remote();
if (!remote_proto) {
m_waiting_support = true;
fs->SetUrl("0");