diff --git a/camera_hdf/hdi_impl/include/dstream_operator/dstream_operator.h b/camera_hdf/hdi_impl/include/dstream_operator/dstream_operator.h index 3885d5033f23cb3cbba5d465b3856026652e1f45..229a9f2120df915b080a32e28beffe0c8a845558 100644 --- a/camera_hdf/hdi_impl/include/dstream_operator/dstream_operator.h +++ b/camera_hdf/hdi_impl/include/dstream_operator/dstream_operator.h @@ -64,6 +64,7 @@ public: DCamRetCode SetCallBack(OHOS::sptr const &callback); DCamRetCode SetDeviceCallback(function &errorCbk, function)> &resultCbk); + void SnapShotStreamOnCaptureEnded(int32_t captureId, int streamId); void Release(); private: diff --git a/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp b/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp index 21af8d7640b6d29ab9d715628463aaed5850e0f9..aa9a0d3261fb80e0cb3f1ae7210e6cffcc6a0718 100644 --- a/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp +++ b/camera_hdf/hdi_impl/src/dstream_operator/dstream_operator.cpp @@ -492,6 +492,8 @@ DCamRetCode DStreamOperator::ShutterBuffer(int streamId, const std::shared_ptrsecond->type_ != DCStreamType::SNAPSHOT_FRAME) { + return; + } + if (dcStreamOperatorCallback_ == nullptr) { + return; + } + std::vector> info; + std::shared_ptr tmp = std::make_shared(); + tmp->frameCount_ = acceptedBufferNum_[std::make_pair(captureId, streamId)]; + tmp->streamId_ = streamId; + info.push_back(tmp); + dcStreamOperatorCallback_->OnCaptureEnded(captureId, info); + DHLOGD("snapshot stream successfully reported captureId = %d streamId = %d.", captureId, streamId); +} + void DStreamOperator::Release() { DHLOGI("DStreamOperator::Release, begin release stream operator.");