[DEV] update new etk
This commit is contained in:
parent
e1d4a8c7ea
commit
859417e4fe
@ -84,7 +84,7 @@ int32_t audio::blockEngine::Thread::start() {
|
||||
return audio::blockEngine::ERR_FAIL;
|
||||
}
|
||||
m_state = audio::blockEngine::statusCreating;
|
||||
m_thread = std::make_shared<ethread::Thread>(audio::blockEngine::Thread::genericThreadCall, reinterpret_cast<void*>(this));
|
||||
m_thread = ememory::makeShared<ethread::Thread>([&]() { threadCall();});
|
||||
// no else ==> the thread is started corectly... (we think)
|
||||
return audio::blockEngine::ERR_NONE;
|
||||
}
|
||||
@ -142,15 +142,6 @@ bool audio::blockEngine::Thread::stateStop() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void audio::blockEngine::Thread::genericThreadCall(void* _data) {
|
||||
audio::blockEngine::Thread * self = reinterpret_cast<audio::blockEngine::Thread*>(_data);
|
||||
if (self != nullptr) {
|
||||
self->threadCall();
|
||||
} else {
|
||||
ABE_ERROR("can not start th ethraead ...");
|
||||
}
|
||||
}
|
||||
|
||||
void audio::blockEngine::Thread::threadCall() {
|
||||
bool autoKill = false;
|
||||
// Endless loop.
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <ethread/Thread.hpp>
|
||||
#include <ethread/Mutex.hpp>
|
||||
#include <ememory/memory.hpp>
|
||||
#include <etk/os/Fifo.hpp>
|
||||
#include <audio/blockEngine/core/audio.hpp>
|
||||
|
||||
@ -24,10 +25,8 @@ namespace audio {
|
||||
statusDie, //!< the thread is diing or dead
|
||||
};
|
||||
class Thread {
|
||||
private:
|
||||
static void genericThreadCall(void * data);
|
||||
protected:
|
||||
std::shared_ptr<ethread::Thread> m_thread;
|
||||
ememory::SharedPtr<ethread::Thread> m_thread;
|
||||
ethread::Mutex m_interfaceMutex;
|
||||
int32_t m_flags;
|
||||
public:
|
||||
|
@ -65,14 +65,14 @@ int32_t audio::blockEngine::ReceiverRiver::algoInit() {
|
||||
return audio::blockEngine::ERR_FAIL;
|
||||
}
|
||||
// set callback mode ...
|
||||
m_interface->setOutputCallback(std::bind(&ReceiverRiver::onDataNeeded,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2,
|
||||
std::placeholders::_3,
|
||||
std::placeholders::_4,
|
||||
std::placeholders::_5,
|
||||
std::placeholders::_6));
|
||||
m_interface->setOutputCallback([&](void* _data,
|
||||
const audio::Time& _time,
|
||||
size_t _nbChunk,
|
||||
enum audio::format _format,
|
||||
uint32_t _frequency,
|
||||
const etk::Vector<audio::channel>& _map) {
|
||||
onDataNeeded(_data, _time, _nbChunk, _format, _frequency, _map);
|
||||
});
|
||||
m_interface->start();
|
||||
return audio::blockEngine::ERR_NONE;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user