mDfsAsyncQueue = nullptr;
}
- if (mInternalSource) {
- int ret = mv_destroy_source(mInternalSource);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to destroy intern source. But keep going..");
- }
- mInternalSource = nullptr;
- }
-
GetDfsDataFromSources(baseSource, extraSource, input);
mDfsAdaptor->run(input);
auto depthData = mDfsAdaptor->getOutputData();
-
- mDepthCallback(baseSource, static_cast<DepthTypePtr>(depthData.data), depthData.width, depthData.height,
- mDepthUserData);
+ if (input.format != DFS_DATA_INPUT_FORMAT_DECOUPLED_SBS) {
+ if (!mInternalSource) {
+ int ret = mv_create_source(&mInternalSource);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to create internal source");
+ return MEDIA_VISION_ERROR_INTERNAL;
+ }
+ }
+ auto leftData = mDfsAdaptor->getLeftData();
+ auto ret = mv_source_fill_by_buffer(mInternalSource, static_cast<unsigned char *>(leftData.data),
+ leftData.stride * leftData.height, leftData.width, leftData.height,
+ leftData.type == DFS_DATA_TYPE_UINT8C3 ?
+ MEDIA_VISION_COLORSPACE_RGB888 :
+ MEDIA_VISION_COLORSPACE_Y800);
+ if (MEDIA_VISION_ERROR_NONE != ret) {
+ LOGE("Errors were occurred during source filling %i, but continue", ret);
+ }
+ mDepthCallback(mInternalSource, static_cast<DepthTypePtr>(depthData.data), depthData.width,
+ depthData.height, mDepthUserData);
+ } else {
+ mDepthCallback(baseSource, static_cast<DepthTypePtr>(depthData.data), depthData.width, depthData.height,
+ mDepthUserData);
+ }
#ifdef MV_3D_POINTCLOUD_IS_AVAILABLE
if (mPointcloudCallback) {
mv_3d_pointcloud_s p { .type = MV_3D_POINTCLOUD_TYPE_PCD_BIN,
#endif
delete[] static_cast<unsigned char *>(input.data);
delete[] static_cast<unsigned char *>(input.extraData);
+ mv_source_clear(mInternalSource);
} catch (const std::exception &e) {
LOGE("Failed to Run with %s", e.what());
return MEDIA_VISION_ERROR_INVALID_OPERATION;