mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-18 12:50:07 +01:00
added lock
This commit is contained in:
@@ -1431,14 +1431,14 @@ void AC_MainWindow::updateFrame(QImage img) {
|
|||||||
if(!recording) {
|
if(!recording) {
|
||||||
frame_stream << "(Current/Total Frames/Seconds) - (" << frame_index << "/" << video_frames << "/" << (unsigned long)(frame_index/video_fps) << ") - ";
|
frame_stream << "(Current/Total Frames/Seconds) - (" << frame_index << "/" << video_frames << "/" << (unsigned long)(frame_index/video_fps) << ") - ";
|
||||||
|
|
||||||
unsigned long mem = ac::calculateMemory();
|
unsigned long mem = playback->calcMem();
|
||||||
frame_stream << "Memory Allocated: " << ((mem > 0) ? (mem/1024/1024) : 0) << " MB - " << " Initalized: " << ac::all_objects.size() << " - Allocated: " << ac::getCurrentAllocatedFrames() << "\n";
|
frame_stream << "Memory Allocated: " << ((mem > 0) ? (mem/1024/1024) : 0) << " MB - " << " Initalized: " << ac::all_objects.size() << " - Allocated: " << ac::getCurrentAllocatedFrames() << "\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
stat(video_file_name.toStdString().c_str(), &buf);
|
stat(video_file_name.toStdString().c_str(), &buf);
|
||||||
frame_stream << "(Current/Total Frames/Seconds/Size) - (" << frame_index << "/" << video_frames << "/" << (unsigned int)(frame_index/video_fps) << "/" << ((buf.st_size/1000)/1000) << " MB) - ";
|
frame_stream << "(Current/Total Frames/Seconds/Size) - (" << frame_index << "/" << video_frames << "/" << (unsigned int)(frame_index/video_fps) << "/" << ((buf.st_size/1000)/1000) << " MB) - ";
|
||||||
unsigned long mem = ac::calculateMemory();
|
unsigned long mem = playback->calcMem();
|
||||||
frame_stream << "Memory Allocated: " << ((mem > 0) ? (mem/1024/1024) : 0) << " MB - " << "Initalized: " << ac::all_objects.size() << " - Allocated: " << ac::getCurrentAllocatedFrames() << "\n";
|
frame_stream << "Memory Allocated: " << ((mem > 0) ? (mem/1024/1024) : 0) << " MB - " << "Initalized: " << ac::all_objects.size() << " - Allocated: " << ac::getCurrentAllocatedFrames() << "\n";
|
||||||
}
|
}
|
||||||
if(programMode == MODE_VIDEO) {
|
if(programMode == MODE_VIDEO) {
|
||||||
|
|||||||
@@ -119,6 +119,13 @@ void Playback::setVector(std::vector<FilterValue> v) {
|
|||||||
mutex_add.unlock();
|
mutex_add.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long Playback::calcMem() {
|
||||||
|
mutex.lock();
|
||||||
|
unsigned long calc = ac::calculateMemory();
|
||||||
|
mutex.unlock();
|
||||||
|
return calc;
|
||||||
|
}
|
||||||
|
|
||||||
void Playback::setOptions(bool n, int c) {
|
void Playback::setOptions(bool n, int c) {
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
ac::isNegative = n;
|
ac::isNegative = n;
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
void setCycle(int type, int frame_skip, std::vector<std::string> &val);
|
void setCycle(int type, int frame_skip, std::vector<std::string> &val);
|
||||||
void setCycle(int type);
|
void setCycle(int type);
|
||||||
void setPref(int thread_count, int intense);
|
void setPref(int thread_count, int intense);
|
||||||
|
unsigned long calcMem();
|
||||||
void setCustomCycle(bool b);
|
void setCustomCycle(bool b);
|
||||||
void setCustomCycleDelay(int delay);
|
void setCustomCycleDelay(int delay);
|
||||||
signals:
|
signals:
|
||||||
|
|||||||
Reference in New Issue
Block a user