mirror of
https://github.com/vale981/Taevitas
synced 2025-03-05 09:31:42 -05:00
dirty_debug
This commit is contained in:
parent
df9c8eddc4
commit
28749d3d01
4 changed files with 11 additions and 7 deletions
|
@ -49,10 +49,12 @@ void CameraManager::connectCamera(unsigned int index) {
|
|||
|
||||
// The capture callback is a wrapper to emit the frameCaptured signal.
|
||||
void CameraManager::captureCallback(FlyCapture2::Image* image, const void *camManager) {
|
||||
lock.lock();
|
||||
if(camManager) {
|
||||
static_cast<const CameraManager*>(camManager)->frameCaptured(image);
|
||||
}
|
||||
qDebug() << "here";
|
||||
lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
// TODO: implement camera arrival removal
|
||||
#include <QObject>
|
||||
#include "FlyCapture2.h"
|
||||
#include <QMutex>
|
||||
|
||||
class CameraManager : public QObject
|
||||
{
|
||||
|
@ -24,7 +25,7 @@ public:
|
|||
// Throws FlyCapture2::Error
|
||||
void startCapture();
|
||||
void stopCapture();
|
||||
|
||||
|
||||
//TODO remove, if not needed
|
||||
const FlyCapture2::Camera* getCamera() const {
|
||||
return &camera;
|
||||
|
@ -67,6 +68,9 @@ private:
|
|||
// State Variable
|
||||
bool is_capturing;
|
||||
|
||||
// Make captureCallback thread safe
|
||||
static QMutex lock;
|
||||
|
||||
signals:
|
||||
void frameCaptured(FlyCapture2::Image* image) const;
|
||||
};
|
||||
|
|
|
@ -126,12 +126,10 @@ void MainWindow::toggle_preview(bool checked) {
|
|||
}
|
||||
|
||||
void MainWindow::frame_captured(FlyCapture2::Image* image) {
|
||||
test.lock();
|
||||
qDebug() << "Image Captured!";
|
||||
// If preview is activated...
|
||||
// if(ui->preview_widget->isVisible())
|
||||
// displayPreview(image);
|
||||
test.unlock();
|
||||
If preview is activated...
|
||||
if(ui->preview_widget->isVisible())
|
||||
displayPreview(image);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ void Recorder::cleanup() {
|
|||
|
||||
void Recorder::appendFrame(FlyCapture2::Image *image) {
|
||||
write_lock.lock();
|
||||
// If not recording, just stop.
|
||||
// If not recording, just stop.
|
||||
if(!is_recording)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue