ENH:fet the correct Agora status
jira:[none] Change-Id: Ic779e41f0b652212aa8e4ce016cfe1ef2aba3608
This commit is contained in:
parent
fad04b5725
commit
1c1b366d00
|
@ -1668,6 +1668,21 @@ bool MachineObject::is_recording()
|
||||||
return camera_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()
|
std::string MachineObject::parse_version()
|
||||||
{
|
{
|
||||||
auto ota_version = module_vers.find("ota");
|
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);
|
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"};
|
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);
|
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")) {
|
if (ipcam.contains("file")) {
|
||||||
char const *local_protos[] = {"none", "local"};
|
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);
|
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"};
|
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);
|
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";
|
file_model_download = ipcam["file"].value<std::string>("model_download", "disabled") == "enabled";
|
||||||
}
|
}
|
||||||
virtual_camera = ipcam.value<std::string>("virtual_camera", "disabled") == "enabled";
|
virtual_camera = ipcam.value<std::string>("virtual_camera", "disabled") == "enabled";
|
||||||
|
|
|
@ -1034,6 +1034,9 @@ public:
|
||||||
bool is_recording();
|
bool is_recording();
|
||||||
|
|
||||||
|
|
||||||
|
int get_liveview_remote();
|
||||||
|
int get_file_remote();
|
||||||
|
|
||||||
MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip);
|
MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip);
|
||||||
~MachineObject();
|
~MachineObject();
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ void MediaFilePanel::SetMachineObject(MachineObject* obj)
|
||||||
m_device_busy = obj->is_camera_busy_off();
|
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_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_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;
|
m_model_download_support = obj->file_model_download;
|
||||||
} else {
|
} else {
|
||||||
m_lan_mode = false;
|
m_lan_mode = false;
|
||||||
|
|
|
@ -157,7 +157,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||||
m_dev_ver = obj->get_ota_version();
|
m_dev_ver = obj->get_ota_version();
|
||||||
m_lan_mode = obj->is_lan_mode_printer();
|
m_lan_mode = obj->is_lan_mode_printer();
|
||||||
m_lan_proto = obj->liveview_local;
|
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_ip = obj->dev_ip;
|
||||||
m_lan_passwd = obj->get_access_code();
|
m_lan_passwd = obj->get_access_code();
|
||||||
m_device_busy = obj->is_camera_busy_off();
|
m_device_busy = obj->is_camera_busy_off();
|
||||||
|
|
|
@ -1198,7 +1198,7 @@ void SendToPrinterDialog::update_show_status()
|
||||||
std::string dev_id = obj_->dev_ip;
|
std::string dev_id = obj_->dev_ip;
|
||||||
if (m_file_sys) {
|
if (m_file_sys) {
|
||||||
if (dev_id == m_device_select) {
|
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();
|
m_file_sys->Retry();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1665,7 +1665,7 @@ void SendToPrinterDialog::fetchUrl(boost::weak_ptr<PrinterFileSystem> wfs)
|
||||||
|
|
||||||
std::string dev_ver = obj->get_ota_version();
|
std::string dev_ver = obj->get_ota_version();
|
||||||
std::string dev_id = obj->dev_id;
|
std::string dev_id = obj->dev_id;
|
||||||
int remote_proto = obj->file_remote;
|
int remote_proto = obj->get_file_remote();
|
||||||
if (!remote_proto) {
|
if (!remote_proto) {
|
||||||
m_waiting_support = true;
|
m_waiting_support = true;
|
||||||
fs->SetUrl("0");
|
fs->SetUrl("0");
|
||||||
|
|
Loading…
Reference in New Issue