mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-12-24 11:20:23 -05:00
more ReBuffer<> updates
This commit is contained in:
parent
f731602017
commit
2d8c2800cb
@ -98,8 +98,7 @@ void DemodulatorPreThread::threadMain() {
|
|||||||
|
|
||||||
std::cout << "Demodulator preprocessor thread started.." << std::endl;
|
std::cout << "Demodulator preprocessor thread started.." << std::endl;
|
||||||
|
|
||||||
std::deque<DemodulatorThreadPostIQData *> buffers;
|
ReBuffer<DemodulatorThreadPostIQData> buffers;
|
||||||
std::deque<DemodulatorThreadPostIQData *>::iterator buffers_i;
|
|
||||||
|
|
||||||
std::vector<liquid_float_complex> in_buf_data;
|
std::vector<liquid_float_complex> in_buf_data;
|
||||||
std::vector<liquid_float_complex> out_buf_data;
|
std::vector<liquid_float_complex> out_buf_data;
|
||||||
@ -207,19 +206,7 @@ void DemodulatorPreThread::threadMain() {
|
|||||||
out_buf = temp_buf;
|
out_buf = temp_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
DemodulatorThreadPostIQData *resamp = NULL;
|
DemodulatorThreadPostIQData *resamp = buffers.getBuffer();
|
||||||
|
|
||||||
for (buffers_i = buffers.begin(); buffers_i != buffers.end(); buffers_i++) {
|
|
||||||
if ((*buffers_i)->getRefCount() <= 0) {
|
|
||||||
resamp = (*buffers_i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resamp == NULL) {
|
|
||||||
resamp = new DemodulatorThreadPostIQData;
|
|
||||||
buffers.push_back(resamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
int out_size = ceil((double) (bufSize) * iqResampleRatio) + 512;
|
int out_size = ceil((double) (bufSize) * iqResampleRatio) + 512;
|
||||||
|
|
||||||
@ -326,12 +313,8 @@ void DemodulatorPreThread::threadMain() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!buffers.empty()) {
|
buffers.purge();
|
||||||
DemodulatorThreadPostIQData *iqDataDel = buffers.front();
|
|
||||||
buffers.pop_front();
|
|
||||||
delete iqDataDel;
|
|
||||||
}
|
|
||||||
|
|
||||||
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_PREPROCESS_TERMINATED);
|
DemodulatorThreadCommand tCmd(DemodulatorThreadCommand::DEMOD_THREAD_CMD_DEMOD_PREPROCESS_TERMINATED);
|
||||||
tCmd.context = this;
|
tCmd.context = this;
|
||||||
threadQueueNotify->push(tCmd);
|
threadQueueNotify->push(tCmd);
|
||||||
|
@ -229,7 +229,7 @@ void SDRPostThread::threadMain() {
|
|||||||
data_in->decRefCount();
|
data_in->decRefCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// buffers.purge();
|
buffers.purge();
|
||||||
|
|
||||||
if (iqVisualQueue.load() && !iqVisualQueue.load()->empty()) {
|
if (iqVisualQueue.load() && !iqVisualQueue.load()->empty()) {
|
||||||
DemodulatorThreadIQData *visualDataDummy;
|
DemodulatorThreadIQData *visualDataDummy;
|
||||||
|
@ -298,7 +298,7 @@ void SDRThread::threadMain() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// buffers.purge();
|
buffers.purge();
|
||||||
|
|
||||||
std::cout << "SDR thread done." << std::endl;
|
std::cout << "SDR thread done." << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user