ENH:fet the correct Agora status

jira:[none]

Change-Id: Ic779e41f0b652212aa8e4ce016cfe1ef2aba3608
(cherry picked from commit 1c1b366d0035298b387fbeb3a7ee69ef4afb8e2d)
This commit is contained in:
tao wang
2025-01-08 16:20:59 +08:00
committed by Noisyfox
parent 057ba55c87
commit 5246fc4c0c
4 changed files with 20 additions and 6 deletions

View File

@@ -1640,6 +1640,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");
@@ -3906,16 +3921,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

@@ -918,6 +918,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

@@ -222,7 +222,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
m_device_busy = obj->is_camera_busy_off();
m_sdcard_exist = obj->has_sdcard();
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

@@ -150,7 +150,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();