[DEBUG] set zeus framework work again
This commit is contained in:
parent
1ae7682017
commit
3dd3b7526d
@ -68,7 +68,13 @@ Start the service:
|
|||||||
|
|
||||||
systemctl start zeus-router.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)
|
License (MPL v2.0)
|
||||||
|
@ -127,6 +127,7 @@ uint16_t appl::GateWay::getId() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void appl::GateWay::start() {
|
void appl::GateWay::start() {
|
||||||
|
APPL_WARNING("start [START]");
|
||||||
if (*propertyRouterNo == false) {
|
if (*propertyRouterNo == false) {
|
||||||
m_routerClient = ememory::makeShared<appl::RouterInterface>(propertyRouterIp.get(), propertyRouterPort.get(), propertyUserName.get(), this, propertyDirectPort.get());
|
m_routerClient = ememory::makeShared<appl::RouterInterface>(propertyRouterIp.get(), propertyRouterPort.get(), propertyUserName.get(), this, propertyDirectPort.get());
|
||||||
if (m_routerClient->isAlive() == false) {
|
if (m_routerClient->isAlive() == false) {
|
||||||
@ -141,13 +142,14 @@ void appl::GateWay::start() {
|
|||||||
APPL_WARNING("#################################");
|
APPL_WARNING("#################################");
|
||||||
m_interfaceNewService->start(*propertyServiceIp, *propertyServicePort);
|
m_interfaceNewService->start(*propertyServiceIp, *propertyServicePort);
|
||||||
}
|
}
|
||||||
// Ebale access of direct Client
|
// Enable access of direct Client
|
||||||
if (propertyDirectPort.get() != 0) {
|
if (propertyDirectPort.get() != 0) {
|
||||||
APPL_WARNING("#################################");
|
APPL_WARNING("#################################");
|
||||||
APPL_WARNING("## Open interface for Direct client : " << *propertyDirectIp << ":" << *propertyDirectPort);
|
APPL_WARNING("## Open interface for Direct client : " << *propertyDirectIp << ":" << *propertyDirectPort);
|
||||||
APPL_WARNING("#################################");
|
APPL_WARNING("#################################");
|
||||||
m_interfaceNewClient->start(*propertyDirectIp, *propertyDirectPort);
|
m_interfaceNewClient->start(*propertyDirectIp, *propertyDirectPort);
|
||||||
}
|
}
|
||||||
|
APPL_WARNING("start [ END ]");
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::GateWay::stop() {
|
void appl::GateWay::stop() {
|
||||||
|
@ -128,6 +128,9 @@ class PlugginAccess {
|
|||||||
}
|
}
|
||||||
(*m_SERVICE_IO_peridic_call)();
|
(*m_SERVICE_IO_peridic_call)();
|
||||||
}
|
}
|
||||||
|
const etk::String getName() const {
|
||||||
|
return m_name;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -147,6 +150,7 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
uint32_t routerDisconnectionDelay = 30;
|
uint32_t routerDisconnectionDelay = 30;
|
||||||
for (int32_t iii=0; iii<_argc ; ++iii) {
|
for (int32_t iii=0; iii<_argc ; ++iii) {
|
||||||
etk::String data = _argv[iii];
|
etk::String data = _argv[iii];
|
||||||
|
APPL_PRINT("parameter: [" << iii << "] '" << data << "'");
|
||||||
if (etk::start_with(data, "--user=") == true) {
|
if (etk::start_with(data, "--user=") == true) {
|
||||||
basicGateway.propertyUserName.set(etk::String(&data[7]));
|
basicGateway.propertyUserName.set(etk::String(&data[7]));
|
||||||
} else if (data == "--no-router") {
|
} 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) {
|
for (auto &it: listElements) {
|
||||||
|
APPL_WARNING(" init: " << it->getName());
|
||||||
it->init(_argc, _argv, basePath);
|
it->init(_argc, _argv, basePath);
|
||||||
}
|
}
|
||||||
|
APPL_WARNING("=================================================");
|
||||||
|
APPL_WARNING("== check client connected:");
|
||||||
|
APPL_WARNING("=================================================");
|
||||||
if (m_client.connect() == false) {
|
if (m_client.connect() == false) {
|
||||||
|
APPL_WARNING(" ==> not connected");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
APPL_WARNING("=================================================");
|
||||||
|
APPL_WARNING("== Publish all service");
|
||||||
|
APPL_WARNING("=================================================");
|
||||||
for (auto &it: listElements) {
|
for (auto &it: listElements) {
|
||||||
|
APPL_WARNING(" publish: " << it->getName());
|
||||||
it->publish(m_client);
|
it->publish(m_client);
|
||||||
}
|
}
|
||||||
uint32_t iii = 0;
|
uint32_t iii = 0;
|
||||||
|
@ -60,7 +60,7 @@ namespace appl {
|
|||||||
class StreamBuffering : public ememory::EnableSharedFromThis<StreamBuffering> {
|
class StreamBuffering : public ememory::EnableSharedFromThis<StreamBuffering> {
|
||||||
public:
|
public:
|
||||||
StreamBuffering();
|
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
|
ememory::SharedPtr<appl::ClientProperty> m_property; //!< Remote interface that must get data
|
||||||
uint32_t m_mediaId; //!< remote media ID that need to get data
|
uint32_t m_mediaId; //!< remote media ID that need to get data
|
||||||
zeus::ProxyFile m_fileHandle; //!< Reference on the remote file
|
zeus::ProxyFile m_fileHandle; //!< Reference on the remote file
|
||||||
|
@ -80,6 +80,7 @@ void appl::widget::VideoDisplay::loadProgram() {
|
|||||||
m_GLtexID = m_GLprogram->getUniform("EW_texID");
|
m_GLtexID = m_GLprogram->getUniform("EW_texID");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void appl::widget::VideoDisplay::setFile(const etk::String& _filename) {
|
void appl::widget::VideoDisplay::setFile(const etk::String& _filename) {
|
||||||
/*
|
/*
|
||||||
// Stop playing in all case...
|
// 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:
|
// check the slot is valid and check display time of the element:
|
||||||
if ( idSlot != -1
|
if ( idSlot != -1
|
||||||
&& m_currentTime > m_decoder->m_videoPool[idSlot].m_time) {
|
&& 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]->get().swap(m_decoder->m_videoPool[idSlot].m_image);
|
||||||
m_resource[m_useElement]->flush();
|
m_resource[m_useElement]->flush();
|
||||||
m_useElement++;
|
m_useElement++;
|
||||||
|
@ -224,11 +224,12 @@ ememory::SharedPtr<appl::GateWayInterface> appl::Router::get(const etk::String&
|
|||||||
// just trash IO ...
|
// just trash IO ...
|
||||||
//pclose(it.m_subProcess);
|
//pclose(it.m_subProcess);
|
||||||
#else
|
#else
|
||||||
if (fork()) {
|
pid_t pid = fork();
|
||||||
|
if (pid > 0) {
|
||||||
// We're in the parent here.
|
// We're in the parent here.
|
||||||
// nothing to do ...
|
// nothing to do ...
|
||||||
APPL_ERROR("Parent Execution ...");
|
APPL_ERROR("Parent Execution ...");
|
||||||
} else {
|
} else if (pid == 0) {
|
||||||
// We're in the child here.
|
// We're in the child here.
|
||||||
APPL_ERROR("Child Execution ...");
|
APPL_ERROR("Child Execution ...");
|
||||||
etk::Path binary = etk::path::getBinaryDirectory() / "zeus-gateway";
|
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 ...
|
binary.getNative().c_str(), // must repeate the binary name to have the name as first argument ...
|
||||||
userConf.c_str(),
|
userConf.c_str(),
|
||||||
"--srv=all",
|
"--srv=all",
|
||||||
"--service-extern=false",
|
/*"--service-extern=false",*/
|
||||||
delay.c_str(),
|
delay.c_str(),
|
||||||
basePath.c_str(),
|
basePath.c_str(),
|
||||||
logFile.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);
|
APPL_ERROR("Child Execution ret = " << ret);
|
||||||
exit (-1);
|
exit (-1);
|
||||||
APPL_ERROR("Must never appear ... child of fork killed ...");
|
APPL_ERROR("Must never appear ... child of fork killed ...");
|
||||||
|
} else {
|
||||||
|
// fork failed
|
||||||
|
APPL_ERROR("fork() failed!\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int32_t nbCheckDelayMax = 24;
|
int32_t nbCheckDelayMax = 24;
|
||||||
|
@ -223,7 +223,7 @@ namespace appl {
|
|||||||
if (zeus::getExtention(futType.get()) != "") {
|
if (zeus::getExtention(futType.get()) != "") {
|
||||||
ethread::UniqueLock lock(g_mutex);
|
ethread::UniqueLock lock(g_mutex);
|
||||||
etk::uri::move(tmpFileName, g_basePath / (sha512String + "." + zeus::getExtention(futType.get())));
|
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("sha512", sha512String);
|
||||||
property->setMetadata("mime-type", futType.get());
|
property->setMetadata("mime-type", futType.get());
|
||||||
property->setCallbackMetadataChange(&metadataChange);
|
property->setCallbackMetadataChange(&metadataChange);
|
||||||
|
@ -674,7 +674,7 @@ void zeus::WebServer::threadAsyncCallback() {
|
|||||||
if (m_threadAsyncList2.size() != 0) {
|
if (m_threadAsyncList2.size() != 0) {
|
||||||
ethread::UniqueLock lock(m_threadAsyncMutex);
|
ethread::UniqueLock lock(m_threadAsyncMutex);
|
||||||
for (auto &it : m_threadAsyncList2) {
|
for (auto &it : m_threadAsyncList2) {
|
||||||
ZEUS_INFO("Add async");
|
ZEUS_DEBUG("Add async");
|
||||||
m_threadAsyncList.pushBack(it);
|
m_threadAsyncList.pushBack(it);
|
||||||
}
|
}
|
||||||
m_threadAsyncList2.clear();
|
m_threadAsyncList2.clear();
|
||||||
@ -689,7 +689,7 @@ void zeus::WebServer::threadAsyncCallback() {
|
|||||||
bool ret = (*it)(this);
|
bool ret = (*it)(this);
|
||||||
if (ret == true) {
|
if (ret == true) {
|
||||||
// Remove it ...
|
// Remove it ...
|
||||||
ZEUS_INFO("Remove async");
|
ZEUS_DEBUG("Remove async");
|
||||||
it = m_threadAsyncList.erase(it);
|
it = m_threadAsyncList.erase(it);
|
||||||
} else {
|
} else {
|
||||||
++it;
|
++it;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user