mirror of
https://github.com/openharmony/distributed_camera.git
synced 2026-07-21 04:05:22 -04:00
@@ -42,8 +42,6 @@ int32_t DCameraSinkHandler::InitSink(const std::string& params)
|
||||
DHLOGE("GetSourceLocalDHMS GetSystemAbilityManager failed");
|
||||
return DCAMERA_INIT_ERR;
|
||||
}
|
||||
ReportDcamerInitFail(DCAMERA_INIT_FAIL, DCAMERA_SA_ERROR,
|
||||
CreateMsg("dcamera sink OnLoadSystemAbilityFail, systemAbilityId: %d", DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID));
|
||||
ReportSaEvent(INIT_SA_EVENT, DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID, "init sink sa event.");
|
||||
sptr<DCameraSinkLoadCallback> loadCallback = new DCameraSinkLoadCallback(params);
|
||||
int32_t ret = sm->LoadSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SINK_SA_ID, loadCallback);
|
||||
|
||||
@@ -44,8 +44,6 @@ int32_t DCameraSourceHandler::InitSource(const std::string& params)
|
||||
DHLOGE("GetSourceLocalDHMS GetSystemAbilityManager failed");
|
||||
return DCAMERA_INIT_ERR;
|
||||
}
|
||||
ReportDcamerInitFail(DCAMERA_INIT_FAIL, DCAMERA_SA_ERROR,
|
||||
CreateMsg("dcamera source OnLoadSystemAbilityFail, systemAbilityId: %d", DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID));
|
||||
ReportSaEvent(INIT_SA_EVENT, DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID, "init source sa event.");
|
||||
sptr<DCameraSourceLoadCallback> loadCallback = new DCameraSourceLoadCallback(params);
|
||||
int32_t ret = sm->LoadSystemAbility(DISTRIBUTED_HARDWARE_CAMERA_SOURCE_SA_ID, loadCallback);
|
||||
|
||||
+1
-3
@@ -234,12 +234,10 @@ int32_t DistributedCameraSinkService::OpenChannel(const std::string& dhId, std::
|
||||
|
||||
std::shared_ptr<DCameraSinkDev> sinkDevice = iter->second;
|
||||
int32_t ret = sinkDevice->OpenChannel(openInfo);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_SINK_OPEN_CAM_ERROR,
|
||||
CreateMsg("sink service open channel failed, dhId %s", GetAnonyString(dhId).c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("DistributedCameraSinkService::OpenChannel failed, ret: %d", ret);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_SINK_OPEN_CAM_ERROR,
|
||||
CreateMsg("sink service open channel failed, dhId %s", GetAnonyString(dhId).c_str()));
|
||||
CreateMsg("sink service open channel failed, dhId: %s", GetAnonyString(dhId).c_str()));
|
||||
return ret;
|
||||
}
|
||||
DHLOGI("DistributedCameraSinkService::OpenChannel success");
|
||||
|
||||
-3
@@ -141,8 +141,6 @@ int32_t DistributedCameraSourceService::RegisterDistributedHardware(const std::s
|
||||
}
|
||||
|
||||
ret = camDev->RegisterDistributedHardware(devId, dhId, reqId, param.version, param.attrs);
|
||||
ReportRegisterCameraFail(DCAMERA_REGISTER_FAIL, GetAnonyString(devId), dhId, param.version,
|
||||
"dcamera source RegisterDistributedHardware fail.");
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("DistributedCameraSourceService RegisterDistributedHardware failed, ret: %d", ret);
|
||||
ReportRegisterCameraFail(DCAMERA_REGISTER_FAIL, GetAnonyString(devId), dhId, param.version,
|
||||
@@ -198,7 +196,6 @@ int32_t DistributedCameraSourceService::LoadDCameraHDF()
|
||||
{
|
||||
DHLOGI("load hdf driver start");
|
||||
int32_t ret = DCameraHdfOperate::GetInstance().LoadDcameraHDFImpl();
|
||||
ReportDcamerInitFail(DCAMERA_INIT_FAIL, DCAMERA_HDF_ERROR, CreateMsg("dcamera load hdf driver fail."));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("load hdf driver failed, ret %d", ret);
|
||||
ReportDcamerInitFail(DCAMERA_INIT_FAIL, DCAMERA_HDF_ERROR, CreateMsg("dcamera load hdf driver fail."));
|
||||
|
||||
@@ -124,12 +124,10 @@ int32_t DCameraSoftbusAdapter::CreateSoftbusSessionServer(std::string sessionNam
|
||||
}
|
||||
|
||||
int32_t ret = CreateSessionServer(PKG_NAME.c_str(), sessionName.c_str(), &sessListeners_[role]);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_CREATE_SESSIONSVR_ERROR,
|
||||
CreateMsg("create session server failed, sessionName %s", sessionName.c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("DCameraSoftbusAdapter CreateSessionServer failed, ret: %d", ret);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_CREATE_SESSIONSVR_ERROR,
|
||||
CreateMsg("create session server failed, sessionName %s", sessionName.c_str()));
|
||||
CreateMsg("create session server failed, sessionName: %s", sessionName.c_str()));
|
||||
return ret;
|
||||
}
|
||||
sessionTotal_[sessionName]++;
|
||||
@@ -200,13 +198,10 @@ int32_t DCameraSoftbusAdapter::OpenSoftbusSession(std::string mySessName, std::s
|
||||
}
|
||||
attr.attr.streamAttr.streamType = (StreamType)streamType;
|
||||
int32_t sessionId = OpenSession(mySessName.c_str(), peerSessName.c_str(), peerDevId.c_str(), "0", &attr);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_OPEN_SESSION_ERROR,
|
||||
CreateMsg("open softbus session failed, mySessName %s, peerSessName %s, peerDevId %s",
|
||||
mySessName.c_str(), peerSessName.c_str(), peerDevId.c_str()));
|
||||
if (sessionId < 0) {
|
||||
DHLOGE("DCameraSoftbusAdapter OpenSoftbusSession failed %d", sessionId);
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_OPEN_SESSION_ERROR,
|
||||
CreateMsg("open softbus session failed, mySessName %s, peerSessName %s, peerDevId %s",
|
||||
CreateMsg("open softbus session failed, mySessName: %s, peerSessName: %s, peerDevId: %s",
|
||||
mySessName.c_str(), peerSessName.c_str(), peerDevId.c_str()));
|
||||
return DCAMERA_BAD_OPERATE;
|
||||
}
|
||||
|
||||
+1
-5
@@ -109,14 +109,10 @@ int32_t DecodeDataProcess::InitDecoder()
|
||||
}
|
||||
|
||||
ret = StartVideoDecoder();
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_DECODE_ERROR,
|
||||
CreateMsg("start video decoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("Start Video decoder failed.");
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_DECODE_ERROR,
|
||||
CreateMsg("start video decoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
CreateMsg("start video decoder failed, width: %d, height: %d, format: %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
return ret;
|
||||
|
||||
+1
-5
@@ -109,14 +109,10 @@ int32_t DecodeDataProcess::InitDecoder()
|
||||
}
|
||||
|
||||
ret = StartVideoDecoder();
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_DECODE_ERROR,
|
||||
CreateMsg("start video decoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("Start Video decoder failed.");
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_DECODE_ERROR,
|
||||
CreateMsg("start video decoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
CreateMsg("start video decoder failed, width: %d, height: %d, format: %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
return ret;
|
||||
|
||||
+1
-5
@@ -114,14 +114,10 @@ int32_t EncodeDataProcess::InitEncoder()
|
||||
}
|
||||
|
||||
ret = StartVideoEncoder();
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_ENCODE_ERROR,
|
||||
CreateMsg("start video encoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("Start Video encoder failed.");
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_ENCODE_ERROR,
|
||||
CreateMsg("start video encoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
CreateMsg("start video encoder failed, width: %d, height: %d, format: %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
return ret;
|
||||
|
||||
+1
-5
@@ -114,14 +114,10 @@ int32_t EncodeDataProcess::InitEncoder()
|
||||
}
|
||||
|
||||
ret = StartVideoEncoder();
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_ENCODE_ERROR,
|
||||
CreateMsg("start video encoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
if (ret != DCAMERA_OK) {
|
||||
DHLOGE("Start Video encoder failed.");
|
||||
ReportDcamerOptFail(DCAMERA_OPT_FAIL, DCAMERA_ENCODE_ERROR,
|
||||
CreateMsg("start video encoder failed, width %d, height %d, format %s", sourceConfig_.GetWidth(),
|
||||
CreateMsg("start video encoder failed, width: %d, height: %d, format: %s", sourceConfig_.GetWidth(),
|
||||
sourceConfig_.GetHeight(),
|
||||
ENUM_VIDEOFORMAT_STRINGS[static_cast<int32_t>(sourceConfig_.GetVideoformat())].c_str()));
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user