Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.cpp #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 1 addition & 38 deletions 06_recordVideo_cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ int main(int argc, char* argv[])
//comment out the following line to prevent saving to disk
worker.set_exporter(&exporter);

std::cout << "configuring FPS Analysis Stuff" << std::endl;
using std::chrono::duration;
using std::chrono::duration_cast;
using std::chrono::high_resolution_clock;
Expand Down Expand Up @@ -190,45 +189,9 @@ int main(int argc, char* argv[])
auto workerContainer = worker.get_next_result();
if (workerContainer.mesu.has_value())
{
auto t2 = t1;
t1 = high_resolution_clock::now();

std::cout
<< "current handle index: "
<< workerContainer.mesu.value().get_meta()->session_info.sequence_no
<< "mesu available!"
<< std::endl;

auto ms_int = duration_cast<milliseconds>(t1 - t2);

if (frametimes.size() >= fpsAveraging)
{
frametimes.erase(frametimes.begin());
}
frametimes.push_back(ms_int.count());
long long totalFrametime = 0;
for (int i = 0; i < frametimes.size(); i++)
{
totalFrametime += frametimes[i];
}
double actualFps =
1 / (((double)totalFrametime / (double)frametimes.size()) / 1000);
if (abs(actualFps - fps) > 0.5 &&
frametimes.size() ==
fpsAveraging) //fps is significantly different from user setting and averaging vector is full
{
std::cout << "WARNING: FPS was set to " << fps
<< " but on average we only get " << actualFps << std::endl;
}
if (worker.get_queue_limits().second == worker.get_queue_used())
{
std::cout << "worker queue is full! Main() loop can not keep up!"
<< std::endl;
}
if (acq.get_queue_size() == acq.get_queue_used())
{
std::cout << "Acquisition queue is full! Worker can not keep up!"
<< std::endl;
}
}
}

Expand Down