Options opt;
mv_colorspace_e colorspace = MEDIA_VISION_COLORSPACE_INVALID;
- mv_source_get_colorspace(mv_sources[src_idx], &colorspace);
+ int ret = mv_source_get_colorspace(mv_sources[src_idx], &colorspace);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to get color space.");
+ return ret;
+ }
if (mMetadata.GetInputMeta().IsParsed()) {
layerInfo = mMetadata.GetInputMeta().GetLayer().at(buffer.first);
}
// TODO: try-catch{} error handling
- int ret = mPreProc.Run(cv_sources[src_idx++], colorspace, data_type, layerInfo, opt, tensor_buffer.buffer);
+ ret = mPreProc.Run(cv_sources[src_idx++], colorspace, data_type, layerInfo, opt, tensor_buffer.buffer);
if (ret != MEDIA_VISION_ERROR_NONE) {
LOGE("Fail to run pre-process.");
return ret;