Skip to content
Snippets Groups Projects
Commit 9cbe8223 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Code tidy

parent 3124613c
No related branches found
No related tags found
1 merge request!343Recorder and packet ordering fixes
Pipeline #29522 passed
......@@ -7,7 +7,7 @@
#define POOL_SIZE 10
#define DEBUG_MUTEX
//#define DEBUG_MUTEX
#define MUTEX_TIMEOUT 2
#if defined DEBUG_MUTEX
......
......@@ -64,9 +64,6 @@ class Receiver : public ftl::Configurable, public ftl::data::Generator {
InternalVideoStates();
int64_t timestamps[32];
int64_t interval = 2000;
std::pair<ftl::codecs::StreamPacket, ftl::codecs::Packet> todos[32];
//ftl::rgbd::Frame frame;
ftl::codecs::Decoder* decoders[32];
cv::cuda::GpuMat surface[32];
RECURSIVE_MUTEX mutex;
......
......@@ -532,7 +532,7 @@ bool File::end() {
}
void File::reset() {
UNIQUE_LOCK(mutex_, lk);
/*UNIQUE_LOCK(mutex_, lk);
// TODO: Find a better solution
while (jobs_ > 0) std::this_thread::sleep_for(std::chrono::milliseconds(2));
......@@ -544,7 +544,7 @@ void File::reset() {
timestart_ = (ftl::timer::get_time() / ftl::timer::getInterval()) * ftl::timer::getInterval();
//timestamp_ = timestart_;
for (auto &fsd : framesets_) fsd.second.timestamp = timestart_;
for (auto &fsd : framesets_) fsd.second.timestamp = timestart_;*/
}
bool File::active() {
......
......@@ -119,7 +119,6 @@ Receiver::InternalVideoStates::InternalVideoStates() {
for (int i=0; i<32; ++i) {
decoders[i] = nullptr;
timestamps[i] = 0;
todos[i].first.timestamp = -1;
}
}
......@@ -406,13 +405,6 @@ void Receiver::_processVideo(const StreamPacket &spkt, const Packet &pkt) {
_finishPacket(fs, spkt.frame_number);
}
{
UNIQUE_LOCK(ividstate.mutex, lk);
if (ividstate.todos[int(spkt.channel)].first.timestamp > spkt.timestamp) {
_processVideo(ividstate.todos[int(spkt.channel)].first, ividstate.todos[int(spkt.channel)].second);
}
}
}
void Receiver::_finishPacket(ftl::streams::LockedFrameSet &fs, size_t fix) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment