Backup.
This commit is contained in:
parent
70749f4612
commit
f5043e8efe
|
@ -37,7 +37,7 @@ bool TopState::ExecuteStateMsg(VStateMachineData *msg)
|
||||||
}
|
}
|
||||||
StatusCode TopState::ReportEvent(const MediaReportEvent &event)
|
StatusCode TopState::ReportEvent(const MediaReportEvent &event)
|
||||||
{
|
{
|
||||||
LogInfo("==================================================================ReportEvent:\n");
|
LogInfo(" ReportEvent:\n");
|
||||||
std::shared_ptr<VMissionData> message = std::make_shared<VMissionDataV2<MediaReportEvent>>(
|
std::shared_ptr<VMissionData> message = std::make_shared<VMissionDataV2<MediaReportEvent>>(
|
||||||
static_cast<MissionEvent>(InternalStateEvent::MEDIA_REPORT_EVENT), event);
|
static_cast<MissionEvent>(InternalStateEvent::MEDIA_REPORT_EVENT), event);
|
||||||
MissionStateMachine::GetInstance()->SendStateMessage(message);
|
MissionStateMachine::GetInstance()->SendStateMessage(message);
|
||||||
|
|
|
@ -29,12 +29,12 @@ namespace MediaManager_Mock_Test
|
||||||
TEST_F(HunttingCameraTest, INTEGRATION_HunttingCamera_EXAMPLE_MediaReprot)
|
TEST_F(HunttingCameraTest, INTEGRATION_HunttingCamera_EXAMPLE_MediaReprot)
|
||||||
{
|
{
|
||||||
SetAllCamerasResult(mAllCamerasMock);
|
SetAllCamerasResult(mAllCamerasMock);
|
||||||
|
MockReportCameraEvent("/tmp/test.MP4", CameraType::MAIN_CAMERA);
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
// McuManagerTestTool::MockMcuDeviceOpenFailed(mLinuxTest);
|
// McuManagerTestTool::MockMcuDeviceOpenFailed(mLinuxTest);
|
||||||
MainThread::GetInstance()->Init();
|
MainThread::GetInstance()->Init();
|
||||||
TestManager::ResetTimeOut(1000 * 3);
|
TestManager::ResetTimeOut(1000 * 3);
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
MockReportCameraEvent("/tmp/test.MP4", "test path", CameraEvent::PICTIRUE, CameraType::MAIN_CAMERA);
|
|
||||||
// MockAppPlayback();
|
// MockAppPlayback();
|
||||||
MainThread::GetInstance()->Runing();
|
MainThread::GetInstance()->Runing();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,9 @@ void CameraHalTest::SetCameraMonitor(std::shared_ptr<VCameraHalMonitor> &monitor
|
||||||
LogInfo("CameraHalTest::SetCameraMonitor.\n");
|
LogInfo("CameraHalTest::SetCameraMonitor.\n");
|
||||||
mMonitor = monitor;
|
mMonitor = monitor;
|
||||||
SetCameraMonitorTrace(monitor);
|
SetCameraMonitorTrace(monitor);
|
||||||
|
if (nullptr != mFastBootEvent) {
|
||||||
|
monitor->ReportEvent(*(mFastBootEvent.get()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void CameraHalTest::SetCameraMonitorTrace(std::shared_ptr<VCameraHalMonitor> &monitor)
|
void CameraHalTest::SetCameraMonitorTrace(std::shared_ptr<VCameraHalMonitor> &monitor)
|
||||||
{
|
{
|
||||||
|
@ -35,7 +38,8 @@ void CameraHalMock::MockReportCameraEvent(const CameraReportEvent &event)
|
||||||
{
|
{
|
||||||
auto monitor = mMonitor.lock();
|
auto monitor = mMonitor.lock();
|
||||||
if (mMonitor.expired()) {
|
if (mMonitor.expired()) {
|
||||||
LogError("monitor is nullptr.\n");
|
LogWarning("monitor is nullptr.\n");
|
||||||
|
mFastBootEvent = std::make_shared<CameraReportEvent>(event.mFileName, event.mCameraType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
monitor->ReportEvent(event);
|
monitor->ReportEvent(event);
|
||||||
|
|
|
@ -29,6 +29,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
const CameraType mCameraType;
|
const CameraType mCameraType;
|
||||||
std::weak_ptr<VCameraHalMonitor> mMonitor;
|
std::weak_ptr<VCameraHalMonitor> mMonitor;
|
||||||
|
std::shared_ptr<CameraReportEvent> mFastBootEvent;
|
||||||
};
|
};
|
||||||
class CameraHalMock : public CameraHalTest
|
class CameraHalMock : public CameraHalTest
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user