@@ -48,6 +48,7 @@ public:
strideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;
virtual void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;
+ virtual void stop() = 0;
virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;
@@ -788,6 +788,16 @@ void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output
inputBufferReady.emit(input);
}
+/**
+ * \fn void Debayer::stop()
+ * \brief Stop the debayering process and perform cleanup
+ *
+ * In the DebayerCPU case this is an empty stub function but
+ * for the GPU case this does something useful. The stub here is to
+ * ensure the right version of the virtual gets called.
+ */
+void DebayerCpu::stop() {}
+
SizeRange DebayerCpu::sizes(PixelFormat inputFormat, const Size &inputSize)
{
Size patternSize = this->patternSize(inputFormat);
@@ -38,6 +38,7 @@ public:
std::tuple<unsigned int, unsigned int>
strideAndFrameSize(const PixelFormat &outputFormat, const Size &size);
void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params);
+ void stop();
SizeRange sizes(PixelFormat inputFormat, const Size &inputSize);
const SharedFD &getStatsFD() { return stats_->getStatsFD(); }
@@ -367,6 +367,9 @@ int SoftwareIsp::start()
*/
void SoftwareIsp::stop()
{
+ debayer_->invokeMethod(&Debayer::stop,
+ ConnectionTypeBlocking);
+
ispWorkerThread_.exit();
ispWorkerThread_.wait();
ispWorkerThread_.removeMessages(debayer_.get());