reverting neutrino streaming to old behavior, raw streaming only for e2 notating supported

Origin commit data
------------------
Commit: 870cc205fb
Author: TangoCash <eric@loxat.de>
Date: 2022-10-02 (Sun, 02 Oct 2022)
This commit is contained in:
TangoCash
2022-10-02 21:58:43 +02:00
committed by vanhofen
parent 3e31020ecb
commit 58de442f8e
2 changed files with 23 additions and 30 deletions

View File

@@ -193,7 +193,7 @@ void CStreamInstance::run()
dmx->addPid(*it); dmx->addPid(*it);
} }
dmx->Start(true); dmx->Start();
if (!send_raw) if (!send_raw)
CCamManager::getInstance()->Start(channel_id, CCamManager::STREAM); CCamManager::getInstance()->Start(channel_id, CCamManager::STREAM);
@@ -384,6 +384,7 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro
{ {
char cbuf[512]; char cbuf[512];
char *bp; char *bp;
send_raw = false;
FILE * fp = fdopen(fd, "r+"); FILE * fp = fdopen(fd, "r+");
if (fp == NULL) { if (fp == NULL) {
@@ -426,22 +427,18 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro
t_channel_id tmpid = 0; t_channel_id tmpid = 0;
bp = &cbuf[5]; bp = &cbuf[5];
if (sscanf(bp, "id=%" SCNx64, &tmpid) == 1) {
channel = CServiceManager::getInstance()->FindChannel(tmpid);
chid = tmpid;
}
int tmpraw = 0; if (strstr(bp,"id="))
bp = &cbuf[25];
if (sscanf(bp, "raw=%d", &tmpraw) == 1)
{ {
send_raw = (tmpraw > 0); if (sscanf(bp, "id=%" SCNx64, &tmpid) == 1) {
channel = CServiceManager::getInstance()->FindChannel(tmpid);
chid = tmpid;
send_raw = false;
pids.clear(); // to catch and stream all pids later !
}
} }
else
if (!tmpid)
{ {
bp = &cbuf[5];
u_int service; u_int service;
u_int i1, i2, i3, i4, satpos; u_int i1, i2, i3, i4, satpos;
@@ -454,23 +451,18 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro
{ {
printf("e2 -> n chid:%" SCNx64 "\n", tmp_channel->getChannelID()); printf("e2 -> n chid:%" SCNx64 "\n", tmp_channel->getChannelID());
channel = tmp_channel; channel = tmp_channel;
chid = tmp_channel->getChannelID(); chid = channel->getChannelID();
send_raw = true; send_raw = true;
pids.clear(); // to catch and stream all pids later !
} }
} }
} }
if (!channel) if (!channel)
return false; return false;
printf("CStreamManager::Parse: channel_id %" PRIx64 " [%s] send %s\n", chid, channel->getName().c_str(), send_raw ? "raw" : "decrypted"); printf("CStreamManager::Parse: channel_id %" PRIx64 " [%s] send %s\n", chid, channel->getName().c_str(), send_raw ? "raw" : "decrypted");
streammap_iterator_t it = streams.find(chid);
if (it != streams.end())
{
printf("CStreamManager::Parse: channel_id %" PRIx64 " already streaming, just add client %d\n", chid, fd);
return true;
}
if (IS_WEBCHAN(chid)) if (IS_WEBCHAN(chid))
return true; return true;
@@ -547,9 +539,7 @@ bool CStreamManager::AddClient(int connfd)
stream_pids_t pids; stream_pids_t pids;
t_channel_id channel_id; t_channel_id channel_id;
CFrontend *frontend; CFrontend *frontend;
bool send_raw; bool send_raw = false;
pids.clear(); // to catch and stream all pids later !
if (Parse(connfd, pids, channel_id, frontend, send_raw)) { if (Parse(connfd, pids, channel_id, frontend, send_raw)) {
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex); OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
@@ -639,13 +629,11 @@ void CStreamManager::run()
perror("CStreamManager::run(): accept"); perror("CStreamManager::run(): accept");
continue; continue;
} }
#if 0
g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_START, 0);
if (!AddClient(connfd)) if (!AddClient(connfd))
{
close(connfd); close(connfd);
g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_STOP, 0); #endif
} g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_START, connfd);
poll_timeout = 1000; poll_timeout = 1000;
} else { } else {
if (pfd[i].revents & (POLLHUP | POLLRDHUP)) { if (pfd[i].revents & (POLLHUP | POLLRDHUP)) {

View File

@@ -4330,11 +4330,16 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled; return messages_return::handled;
} }
else if (msg == NeutrinoMessages::EVT_STREAM_START) { else if (msg == NeutrinoMessages::EVT_STREAM_START) {
printf("NeutrinoMessages::EVT_STREAM_START\n"); int fd = (int) data;
printf("NeutrinoMessages::EVT_STREAM_START: fd %d\n", fd);
wakeupFromStandby(); wakeupFromStandby();
if (g_Radiotext) if (g_Radiotext)
g_Radiotext->setPid(0); g_Radiotext->setPid(0);
if (!CStreamManager::getInstance()->AddClient(fd)) {
close(fd);
g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_STOP, 0);
}
#if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE
if (!CRecordManager::getInstance()->GetRecordCount()) { if (!CRecordManager::getInstance()->GetRecordCount()) {
CVFD::getInstance()->ShowIcon(FP_ICON_CAM1, false); CVFD::getInstance()->ShowIcon(FP_ICON_CAM1, false);