diff --git a/data/y-web/Y_Infopage.yhtm b/data/y-web/Y_Infopage.yhtm new file mode 100644 index 000000000..2cf93f846 --- /dev/null +++ b/data/y-web/Y_Infopage.yhtm @@ -0,0 +1,12 @@ +{=include-block:Y_Blocks.txt;head_ni=} + + +
+
+ + + diff --git a/src/driver/record.cpp b/src/driver/record.cpp index a154aa165..e16a64909 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2301,6 +2301,12 @@ bool CStreamRec::Open(CZapitChannel * channel) if (!headers.empty())//add cookies av_dict_set(&options, "headers", headers.c_str(), 0); + if (0 == strncmp(url.c_str(), "http://", 7) || 0 == strncmp(url.c_str(), "https://", 8)) + { + av_dict_set(&options, "timeout", "20000000", 0); //20sec + av_dict_set(&options, "reconnect", "1", 0); + } + if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str()); if (!headers.empty()) diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index d1ef886bf..6a2a23460 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -66,14 +66,6 @@ #define av_packet_unref av_free_packet #endif -/* experimental mode: - * stream not possible, if record running - * pids in url ignored, and added from channel, with fake PAT/PMT - * different channels supported, - * with url like http://coolstream:31339/id=c32400030070283e (channel id) - */ -#define ENABLE_MULTI_CHANNEL - #define TS_SIZE 188 #define DMX_BUFFER_SIZE (2048*TS_SIZE) #define IN_SIZE (250*TS_SIZE) @@ -200,11 +192,8 @@ void CStreamInstance::run() printf("CStreamInstance::run: add pid 0x%04x\n", *it); dmx->addPid(*it); } -#ifdef ENABLE_MULTI_CHANNEL - dmx->Start();//FIXME -#else - dmx->Start(true);//FIXME -#endif + + dmx->Start(true); if (!send_raw) CCamManager::getInstance()->Start(channel_id, CCamManager::STREAM); @@ -435,24 +424,13 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro chid = CZapit::getInstance()->GetCurrentChannelID(); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); -#ifndef ENABLE_MULTI_CHANNEL - /* parse stdin / url path, start dmx filters */ - do { - int pid; - int res = sscanf(bp, "%x", &pid); - if (res == 1) { - printf("CStreamManager::Parse: pid: 0x%x\n", pid); - pids.insert(pid); - } - } while ((bp = strchr(bp, ',')) && (bp++)); -#else t_channel_id tmpid = 0; bp = &cbuf[5]; if (sscanf(bp, "id=%" SCNx64, &tmpid) == 1) { channel = CServiceManager::getInstance()->FindChannel(tmpid); chid = tmpid; } -#endif + int tmpraw = 0; bp = &cbuf[25]; @@ -474,11 +452,10 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro if (tmp_channel) { - printf("e2 -> n chid:%" SCNx64 "\n", channel->getChannelID()); + printf("e2 -> n chid:%" SCNx64 "\n", tmp_channel->getChannelID()); channel = tmp_channel; chid = tmp_channel->getChannelID(); send_raw = true; - pids.clear(); // to catch and stream all pids later ! } } } @@ -486,6 +463,14 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro return false; 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)) return true; @@ -563,6 +548,8 @@ bool CStreamManager::AddClient(int connfd) t_channel_id channel_id; CFrontend *frontend; bool send_raw; + + pids.clear(); // to catch and stream all pids later ! if (Parse(connfd, pids, channel_id, frontend, send_raw)) { OpenThreads::ScopedLock m_lock(mutex); @@ -652,11 +639,14 @@ void CStreamManager::run() perror("CStreamManager::run(): accept"); continue; } -#if 0 + if (!AddClient(connfd)) + { close(connfd); -#endif - g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_START, connfd); + g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_STOP, 0); + } + else + g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_START, 0); poll_timeout = 1000; } else { if (pfd[i].revents & (POLLHUP | POLLRDHUP)) { @@ -862,6 +852,13 @@ bool CStreamStream::Open() AVDictionary *options = NULL; if (!headers.empty()) av_dict_set(&options, "headers", headers.c_str(), 0); + + if (0 == strncmp(url.c_str(), "http://", 7) || 0 == strncmp(url.c_str(), "https://", 8)) + { + av_dict_set(&options, "timeout", "20000000", 0); //20sec + av_dict_set(&options, "reconnect", "1", 0); + } + if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); if (!headers.empty()) diff --git a/src/gui/widget/colorpicker.cpp b/src/gui/widget/colorpicker.cpp new file mode 100644 index 000000000..b2eb7a2e4 --- /dev/null +++ b/src/gui/widget/colorpicker.cpp @@ -0,0 +1,40 @@ +/* + Color picker + + Copyright (C) 2022 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + License: GPLv2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "colorpicker.h" +#include "colorpicker_colors.h" + +CColorPicker::~CColorPicker() +{ +} + +void CColorPicker::hide() +{ + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); +} diff --git a/src/gui/widget/colorpicker.h b/src/gui/widget/colorpicker.h new file mode 100644 index 000000000..cfaa3857f --- /dev/null +++ b/src/gui/widget/colorpicker.h @@ -0,0 +1,42 @@ +/* + Color picker + + Copyright (C) 2022 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + License: GPLv2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __colorpicker__ +#define __colorpicker__ + +#define COL_ROWS 14 +#define COL_COLUMNS 2 + +class CFrameBuffer; + +class ColorPicker: public CMenuTarget +{ + protected: + CFrameBuffer *frameBuffer; + + public: + ~CColorPicker(); + + void hide(); +}; + +#endif diff --git a/src/gui/widget/colorpicker_colors.h b/src/gui/widget/colorpicker_colors.h new file mode 100644 index 000000000..7086b15f0 --- /dev/null +++ b/src/gui/widget/colorpicker_colors.h @@ -0,0 +1,40 @@ +/* + Color picker + + Copyright (C) 2022 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + License: GPLv2 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +static std::string material_colors[COL_ROWS][COL_COLUMNS] = +{ +// red pink +/* 50*/{ "ffebee", "fce4ec" }, +/* 100*/{ "ffcdd2", "f8bbd0" }, +/* 200*/{ "ef9a9a", "f48fb1" }, +/* 300*/{ "e57373", "f06292" }, +/* 400*/{ "ef5350", "ec407a" }, +/* 500*/{ "f44336", "e91e63" }, +/* 600*/{ "e53935", "d81b60" }, +/* 700*/{ "d32f2f", "c2185b" }, +/* 800*/{ "c62828", "ad1457" }, +/* 900*/{ "b71c1c", "880e4f" }, +/*A100*/{ "ff8a80", "ff80ab" }, +/*A200*/{ "ff5252", "ff4081" }, +/*A400*/{ "ff1744", "f50057" }, +/*A700*/{ "d50000", "c51162" } +}; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 5c46b16f2..5e6816229 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4330,16 +4330,16 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_STREAM_START) { - int fd = (int) data; - printf("NeutrinoMessages::EVT_STREAM_START: fd %d\n", fd); + printf("NeutrinoMessages::EVT_STREAM_START\n"); wakeupFromStandby(); if (g_Radiotext) 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 (!CRecordManager::getInstance()->GetRecordCount()) { + CVFD::getInstance()->ShowIcon(FP_ICON_CAM1, false); } +#endif return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_STREAM_STOP) {