[DEBUG] set zeus framework work again

This commit is contained in:
Edouard DUPIN 2019-04-01 22:06:03 +02:00
parent 1ae7682017
commit 3dd3b7526d
8 changed files with 38 additions and 9 deletions

View File

@ -68,7 +68,13 @@ Start the service:
systemctl start zeus-router.service
Run some command tools:
=======================
Access to the video backend:
```
lutin -cclang -mdebug zeus-package-base?run%zeus-cli-video:--login=HeeroYui:--pass=plop:list
```
License (MPL v2.0)

View File

@ -127,6 +127,7 @@ uint16_t appl::GateWay::getId() {
}
void appl::GateWay::start() {
APPL_WARNING("start [START]");
if (*propertyRouterNo == false) {
m_routerClient = ememory::makeShared<appl::RouterInterface>(propertyRouterIp.get(), propertyRouterPort.get(), propertyUserName.get(), this, propertyDirectPort.get());
if (m_routerClient->isAlive() == false) {
@ -141,13 +142,14 @@ void appl::GateWay::start() {
APPL_WARNING("#################################");
m_interfaceNewService->start(*propertyServiceIp, *propertyServicePort);
}
// Ebale access of direct Client
// Enable access of direct Client
if (propertyDirectPort.get() != 0) {
APPL_WARNING("#################################");
APPL_WARNING("## Open interface for Direct client : " << *propertyDirectIp << ":" << *propertyDirectPort);
APPL_WARNING("#################################");
m_interfaceNewClient->start(*propertyDirectIp, *propertyDirectPort);
}
APPL_WARNING("start [ END ]");
}
void appl::GateWay::stop() {

View File

@ -128,6 +128,9 @@ class PlugginAccess {
}
(*m_SERVICE_IO_peridic_call)();
}
const etk::String getName() const {
return m_name;
}
};
#endif
@ -147,6 +150,7 @@ int main(int _argc, const char *_argv[]) {
uint32_t routerDisconnectionDelay = 30;
for (int32_t iii=0; iii<_argc ; ++iii) {
etk::String data = _argv[iii];
APPL_PRINT("parameter: [" << iii << "] '" << data << "'");
if (etk::start_with(data, "--user=") == true) {
basicGateway.propertyUserName.set(etk::String(&data[7]));
} else if (data == "--no-router") {
@ -294,13 +298,25 @@ int main(int _argc, const char *_argv[]) {
}
}
}
APPL_WARNING("=================================================");
APPL_WARNING("== INIT All service");
APPL_WARNING("=================================================");
for (auto &it: listElements) {
APPL_WARNING(" init: " << it->getName());
it->init(_argc, _argv, basePath);
}
APPL_WARNING("=================================================");
APPL_WARNING("== check client connected:");
APPL_WARNING("=================================================");
if (m_client.connect() == false) {
APPL_WARNING(" ==> not connected");
return -1;
}
APPL_WARNING("=================================================");
APPL_WARNING("== Publish all service");
APPL_WARNING("=================================================");
for (auto &it: listElements) {
APPL_WARNING(" publish: " << it->getName());
it->publish(m_client);
}
uint32_t iii = 0;

View File

@ -60,7 +60,7 @@ namespace appl {
class StreamBuffering : public ememory::EnableSharedFromThis<StreamBuffering> {
public:
StreamBuffering();
ethread::Mutex m_mutex; //!< local Lock Data protection
ethread::Mutex m_mutex; //!< local Lock Data protection
ememory::SharedPtr<appl::ClientProperty> m_property; //!< Remote interface that must get data
uint32_t m_mediaId; //!< remote media ID that need to get data
zeus::ProxyFile m_fileHandle; //!< Reference on the remote file

View File

@ -80,6 +80,7 @@ void appl::widget::VideoDisplay::loadProgram() {
m_GLtexID = m_GLprogram->getUniform("EW_texID");
}
}
void appl::widget::VideoDisplay::setFile(const etk::String& _filename) {
/*
// Stop playing in all case...
@ -357,7 +358,7 @@ void appl::widget::VideoDisplay::periodicEvent(const ewol::event::Time& _event)
// check the slot is valid and check display time of the element:
if ( idSlot != -1
&& m_currentTime > m_decoder->m_videoPool[idSlot].m_time) {
APPL_WARNING("Get Slot VIDEO " << m_currentTime << " > " << m_decoder->m_audioPool[idSlot].m_time);
APPL_WARNING("Get Slot VIDEO " << m_currentTime << " > " << m_decoder->m_videoPool[idSlot].m_time);
m_resource[m_useElement]->get().swap(m_decoder->m_videoPool[idSlot].m_image);
m_resource[m_useElement]->flush();
m_useElement++;

View File

@ -224,11 +224,12 @@ ememory::SharedPtr<appl::GateWayInterface> appl::Router::get(const etk::String&
// just trash IO ...
//pclose(it.m_subProcess);
#else
if (fork()) {
pid_t pid = fork();
if (pid > 0) {
// We're in the parent here.
// nothing to do ...
APPL_ERROR("Parent Execution ...");
} else {
} else if (pid == 0) {
// We're in the child here.
APPL_ERROR("Child Execution ...");
etk::Path binary = etk::path::getBinaryDirectory() / "zeus-gateway";
@ -258,7 +259,7 @@ ememory::SharedPtr<appl::GateWayInterface> appl::Router::get(const etk::String&
binary.getNative().c_str(), // must repeate the binary name to have the name as first argument ...
userConf.c_str(),
"--srv=all",
"--service-extern=false",
/*"--service-extern=false",*/
delay.c_str(),
basePath.c_str(),
logFile.c_str(),
@ -267,6 +268,9 @@ ememory::SharedPtr<appl::GateWayInterface> appl::Router::get(const etk::String&
APPL_ERROR("Child Execution ret = " << ret);
exit (-1);
APPL_ERROR("Must never appear ... child of fork killed ...");
} else {
// fork failed
APPL_ERROR("fork() failed!\n");
}
#endif
int32_t nbCheckDelayMax = 24;

View File

@ -223,7 +223,7 @@ namespace appl {
if (zeus::getExtention(futType.get()) != "") {
ethread::UniqueLock lock(g_mutex);
etk::uri::move(tmpFileName, g_basePath / (sha512String + "." + zeus::getExtention(futType.get())));
ememory::SharedPtr<zeus::MediaImpl> property = ememory::makeShared<zeus::MediaImpl>(id, g_basePath / sha512String + "." + zeus::getExtention(futType.get()));
ememory::SharedPtr<zeus::MediaImpl> property = ememory::makeShared<zeus::MediaImpl>(id, g_basePath / (sha512String + "." + zeus::getExtention(futType.get())));
property->setMetadata("sha512", sha512String);
property->setMetadata("mime-type", futType.get());
property->setCallbackMetadataChange(&metadataChange);

View File

@ -674,7 +674,7 @@ void zeus::WebServer::threadAsyncCallback() {
if (m_threadAsyncList2.size() != 0) {
ethread::UniqueLock lock(m_threadAsyncMutex);
for (auto &it : m_threadAsyncList2) {
ZEUS_INFO("Add async");
ZEUS_DEBUG("Add async");
m_threadAsyncList.pushBack(it);
}
m_threadAsyncList2.clear();
@ -689,7 +689,7 @@ void zeus::WebServer::threadAsyncCallback() {
bool ret = (*it)(this);
if (ret == true) {
// Remove it ...
ZEUS_INFO("Remove async");
ZEUS_DEBUG("Remove async");
it = m_threadAsyncList.erase(it);
} else {
++it;