|
@@ -858,10 +858,11 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
|
|
|
m_pAudioMgr = CreateAudioMgrObj(&t_callback);
|
|
|
if (m_pAudioMgr && 0 == m_pAudioMgr->audio_mgr_initialize()) {
|
|
|
m_bAudioMgrInited = true;
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode("QLR0402301A1")("audio manager initialize success");
|
|
|
}
|
|
|
else {
|
|
|
LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SIPPHONE_AUDIOMGR_INITIAL_FAILED, "audio manager initialize failed!");
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setResultCode("RTA310B")("音频服务初始化失败");
|
|
|
+ DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setLogCode("QLR0402301A1").setResultCode("RTA310B")("音频服务初始化失败");
|
|
|
}
|
|
|
SetSoundCardSysVar(SOUNDCARD_INIT_STATE);
|
|
|
|
|
@@ -1335,6 +1336,8 @@ ErrorCodeEnum CSIPEntity::RvcGetAudioDeviceInfo()
|
|
|
CSimpleStringA strJsonInData = CSimpleStringA::Format("audio in devices [{%s}]", strJsonIn.GetData());
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_SIPPHONE_GET_AUDIO_IN_INFOS, strJsonInData.GetData());
|
|
|
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode("QLR0402301A2").setAPI("RvcMedia_GetAudioInDevInfo")(GetAudioDeviceJsonInfos(true).GetData());
|
|
|
+
|
|
|
CSimpleStringA strJsonOut("");
|
|
|
int icountspeaker = m_pAudioMgr->audio_get_device_count(false);
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("audio output devices(%d):", icountspeaker);
|
|
@@ -1350,6 +1353,8 @@ ErrorCodeEnum CSIPEntity::RvcGetAudioDeviceInfo()
|
|
|
CSimpleStringA strJsonOutData = CSimpleStringA::Format("audio out devices [{%s}]", strJsonOut.GetData());
|
|
|
LogWarn(Severity_Low, Error_Debug, LOG_EVT_SIPPHONE_GET_AUDIO_OUT_INFOS, strJsonOutData.GetData());
|
|
|
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode("QLR0402301A2").setAPI("RvcMedia_GetAudioOutDevInfo")(GetAudioDeviceJsonInfos(false).GetData());
|
|
|
+
|
|
|
Error = Error_Succeed;
|
|
|
}
|
|
|
return Error;
|
|
@@ -2367,6 +2372,39 @@ void CSIPEntity::ShowBothVideo()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+CSimpleStringA CSIPEntity::GetAudioDeviceJsonInfos(bool bmicro)
|
|
|
+{
|
|
|
+ CSimpleStringA strAudioDevJson("");
|
|
|
+ if (NULL != m_pAudioMgr) {
|
|
|
+ int iaudiocount = m_pAudioMgr->audio_get_device_count(bmicro);
|
|
|
+ for (int i = 0; i < iaudiocount; i++) {
|
|
|
+ rvc_audio_device_t* audio_dev = m_pAudioMgr->audio_get_device_infos(bmicro, i);
|
|
|
+
|
|
|
+ std::map<std::string, std::string> msgInfo;
|
|
|
+ msgInfo["name"] = audio_dev->name;
|
|
|
+ msgInfo["description"] = audio_dev->description;
|
|
|
+ msgInfo["samprate"] = CSimpleStringA::Format("%d", audio_dev->samprate).GetData();
|
|
|
+ msgInfo["channels"] = CSimpleStringA::Format("%d", audio_dev->channels).GetData();
|
|
|
+ msgInfo["low_latency"] = CSimpleStringA::Format("%.2f", audio_dev->low_latency).GetData();
|
|
|
+ msgInfo["high_latency"] = CSimpleStringA::Format("%.2f", audio_dev->high_latency).GetData();
|
|
|
+
|
|
|
+ std::pair<bool, std::string> strResult;
|
|
|
+ strResult = generateJsonStr(msgInfo);
|
|
|
+ if (strResult.first) {
|
|
|
+ strAudioDevJson += strResult.second.c_str();
|
|
|
+ strAudioDevJson += ",";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (strAudioDevJson.GetLength() > 0) {
|
|
|
+ strAudioDevJson[strAudioDevJson.GetLength() - 1] = '\0';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return strAudioDevJson;
|
|
|
+}
|
|
|
+
|
|
|
#endif
|
|
|
|
|
|
//
|