diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1b08514b3..8b60996c9 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2042,6 +2042,7 @@ miscsettings.shutdown_real Standby-Modus miscsettings.shutdown_real_rcdelay Verzögertes Ausschalten miscsettings.sleeptimer Ausschalten nach Inaktivität miscsettings.sleeptimer_min Sleeptimer Vorgabe +miscsettings.streaming Streaming miscsettings.volume Lautstärke miscsettings.zapto_pre_time Umschaltstart-Vorlaufzeit motorcontrol.calc_positions Positionen (Neu)-Berechne(n)) @@ -2825,8 +2826,11 @@ streaminfo.resolution Auflösung streaminfo.signal Tuner streaminfo.videosystem Videosystem streaming.busy Einer oder mehrere Aufnahmeprozesse sind aktiv.\nSollte die Aufnahme eigentlich beendet sein,\nschafft ein Neustart der GUI Abhilfe. +streaming.decryptmode HTTP Streams entschlüsseln streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufnahmen sind daher nicht möglich. +streaming.ecmmode ECMs mitsenden streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. +streaming.port Streaming-Port streaming.slow System oder Datenträger zu langsam! Bitte ggf. einige Aufnahmen beenden. streaming.write_error Die Aufnahme wurde leider abgebrochen,\nda ein Fehler beim Schreiben der Daten auftrat. stringinput.backspace Rücktaste diff --git a/data/locale/english.locale b/data/locale/english.locale index b0d2a061d..f1f15a38f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2042,6 +2042,7 @@ miscsettings.shutdown_real Enable standby miscsettings.shutdown_real_rcdelay Delayed shutdown miscsettings.sleeptimer Inactivity shutdown timer miscsettings.sleeptimer_min Sleeptimer default +miscsettings.streaming Streaming miscsettings.volume Volume miscsettings.zapto_pre_time Zapto Start Time Correction motorcontrol.calc_positions (Re)-Calculate Positions @@ -2825,8 +2826,11 @@ streaminfo.resolution Resolution streaminfo.signal Tuner streaminfo.videosystem Videosystem streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart GUI. +streaming.decryptmode Decrypt HTTP Streams streaming.dir_not_writable The recording directory is not writable.\nRecording will not work. +streaming.ecmmode integrate ECM in HTTP streams streaming.overflow Record buffer overflow, consider to stop some records +streaming.port Streaming port streaming.slow System/hdd too slow, consider to stop some records streaming.write_error The recording was aborted,\nsince an error occured during the writing process. stringinput.backspace Backspace diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 17ca4c724..882152dcc 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -195,7 +195,10 @@ void CStreamInstance::run() dmx->Start(true); - //if (!g_settings.stream_raw && is_e2_stream) + if (is_e2_stream) + if (g_settings.streaming_decryptmode) + CCamManager::getInstance()->Start(channel_id, CCamManager::STREAM); + else CCamManager::getInstance()->Start(channel_id, CCamManager::STREAM); #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE @@ -212,7 +215,10 @@ void CStreamInstance::run() Send(r); } - //if (!g_settings.stream_raw && is_e2_stream) + if (is_e2_stream) + if (g_settings.streaming_decryptmode) + CCamManager::getInstance()->Stop(channel_id, CCamManager::STREAM); + else CCamManager::getInstance()->Stop(channel_id, CCamManager::STREAM); #if HAVE_ARM_HARDWARE || HAVE_MIPS_HARDWARE @@ -242,7 +248,7 @@ CStreamManager::CStreamManager() enabled = true; running = false; listenfd = -1; - port = 31339; + port = g_settings.streaming_port; } CStreamManager::~CStreamManager() @@ -490,12 +496,12 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro return false; } - PreparePids(channel, pids); + PreparePids(channel, pids, is_e2); return !pids.empty(); } -void CStreamManager::PreparePids(CZapitChannel *channel, stream_pids_t &pids) +void CStreamManager::PreparePids(CZapitChannel *channel, stream_pids_t &pids, bool is_e2) { pids.clear(); @@ -518,8 +524,7 @@ void CStreamManager::PreparePids(CZapitChannel *channel, stream_pids_t &pids) printf("CStreamManager::PreparePids: apid 0x%04x \n", channel->getAudioChannel(i)->pid); } -#if 0 - if (!channel->capids.empty() && g_settings.stream_raw && is_e2_stream) + if (!channel->capids.empty() && g_settings.streaming_ecmmode && is_e2) { for(casys_pids_iterator_t it = channel->capids.begin(); it != channel->capids.end(); ++it) { @@ -527,7 +532,6 @@ void CStreamManager::PreparePids(CZapitChannel *channel, stream_pids_t &pids) printf("CStreamManager::PreparePids: capid 0x%04x \n", (*it)); } } -#endif //add pcr pid if (channel->getPcrPid() && (channel->getPcrPid() != channel->getVideoPid())) { diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 4fafd94e6..33221f0b7 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -122,7 +122,7 @@ class CStreamManager : public OpenThreads::Thread bool Listen(); bool Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFrontend * &frontend, bool &is_e2); - void PreparePids(CZapitChannel * channel, stream_pids_t &pids); + void PreparePids(CZapitChannel * channel, stream_pids_t &pids, bool is_e2); void CheckStandby(bool enter); CFrontend * FindFrontend(CZapitChannel * channel); bool StopAll(); diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 7a765f3af..440d1111a 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -152,6 +152,10 @@ int CMiscMenue::exec(CMenuTarget *parent, const std::string &actionKey) { return showMiscSettingsMenuPlugins(); } + else if(actionKey == "streaming") + { + return showMiscSettingsMenuStreaming(); + } else if (actionKey == "epg_read_now" || actionKey == "epg_read_now_usermenu") { CLoaderHint *lh = new CLoaderHint(LOCALE_MISCSETTINGS_EPG_READ); @@ -350,6 +354,10 @@ int CMiscMenue::showMiscSettingsMenu() mf->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_PLUGINS_CONTROL); misc_menue.addItem(mf); + // streaming + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_STREAMING, true, NULL, this, "streaming", CRCInput::convertDigitToKey(shortcut++)); + //mf->setHint("", LOCALE_MENU_HINT_MISC_STREAMING); + misc_menue.addItem(mf); int res = misc_menue.exec(NULL, ""); delete fanNotifier; @@ -719,6 +727,32 @@ int CMiscMenue::showMiscSettingsMenuPlugins() return res; } +// streaming +int CMiscMenue::showMiscSettingsMenuStreaming() +{ + CMenuWidget *ms_sservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_STREAMING); + ms_sservices->addIntroItems(LOCALE_MISCSETTINGS_STREAMING); + + // port + CIntInput * miscSettings_streamingport = new CIntInput(LOCALE_STREAMING_PORT, &g_settings.streaming_port, 5); + CMenuForwarder * mf = new CMenuDForwarder(LOCALE_STREAMING_PORT, true, std::to_string(g_settings.streaming_port), miscSettings_streamingport); + ms_sservices->addItem(mf); + + // ecm + ecm_onoff = new CMenuOptionChooser(LOCALE_STREAMING_ECMMODE, &g_settings.streaming_ecmmode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + //ecm_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_ECMMODE_ENABLED); + ms_sservices->addItem(ecm_onoff); + + // ecm + dec_onoff = new CMenuOptionChooser(LOCALE_STREAMING_DECRYPTMODE, &g_settings.streaming_decryptmode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + //ecm_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_DECRYPTMODE_ENABLED); + ms_sservices->addItem(dec_onoff); + + int res = ms_sservices->exec(NULL, ""); + delete ms_sservices; + return res; +} + // CPU void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) { diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 0a03dc3cc..f4c45cc65 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -58,6 +58,8 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser *shoutcast_onoff; CMenuForwarder *epg_dir; CMenuForwarder *epg_read_now; + CMenuOptionChooser *ecm_onoff; + CMenuOptionChooser *dec_onoff; int width; @@ -79,6 +81,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver int showMiscSettingsMenuChanlist(); int showMiscSettingsMenuOnlineServices(); int showMiscSettingsMenuPlugins(); + int showMiscSettingsMenuStreaming(); void showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu); public: CMiscMenue(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 85d63846f..bab128fcd 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -833,6 +833,11 @@ int CNeutrinoApp::loadSetup(const char *fname) g_settings.recording_audio_pids_default = configfile.getInt32("recording_audio_pids_default", TIMERD_APIDS_STD | TIMERD_APIDS_AC3); + // streaming + g_settings.streaming_ecmmode = configfile.getInt32("streaming_ecmmode", 0); + g_settings.streaming_decryptmode = configfile.getInt32("streaming_decryptmode", 1); + g_settings.streaming_port = configfile.getInt32("streaming_port", 31339); + // timeshift g_settings.timeshiftdir = configfile.getString("timeshiftdir", ""); g_settings.timeshift_auto = configfile.getInt32("timeshift_auto", 0); @@ -1849,6 +1854,11 @@ void CNeutrinoApp::saveSetup(const char *fname) configfile.setInt32("recording_audio_pids_default", g_settings.recording_audio_pids_default); + // streaming + configfile.setInt32("streaming_ecmmode", g_settings.streaming_ecmmode); + configfile.setInt32("streaming_decryptmode", g_settings.streaming_decryptmode); + configfile.setInt32("streaming_port", g_settings.streaming_port); + // timeshift configfile.setString("timeshiftdir", g_settings.timeshiftdir); configfile.setInt32("timeshift_auto", g_settings.timeshift_auto); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index d08ef8d04..49290a392 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -125,6 +125,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_MISCSETUP_CHANNELLIST, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES, MN_WIDGET_ID_MISCSETUP_PLUGINS, + MN_WIDGET_ID_MISCSETUP_STREAMING, // media menu MN_WIDGET_ID_MEDIA, diff --git a/src/system/locals.h b/src/system/locals.h index b0d77fe3d..c842b084b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2069,6 +2069,7 @@ typedef enum LOCALE_MISCSETTINGS_SHUTDOWN_REAL_RCDELAY, LOCALE_MISCSETTINGS_SLEEPTIMER, LOCALE_MISCSETTINGS_SLEEPTIMER_MIN, + LOCALE_MISCSETTINGS_STREAMING, LOCALE_MISCSETTINGS_VOLUME, LOCALE_MISCSETTINGS_ZAPTO_PRE_TIME, LOCALE_MOTORCONTROL_CALC_POSITIONS, @@ -2852,8 +2853,11 @@ typedef enum LOCALE_STREAMINFO_SIGNAL, LOCALE_STREAMINFO_VIDEOSYSTEM, LOCALE_STREAMING_BUSY, + LOCALE_STREAMING_DECRYPTMODE, LOCALE_STREAMING_DIR_NOT_WRITABLE, + LOCALE_STREAMING_ECMMODE, LOCALE_STREAMING_OVERFLOW, + LOCALE_STREAMING_PORT, LOCALE_STREAMING_SLOW, LOCALE_STREAMING_WRITE_ERROR, LOCALE_STRINGINPUT_BACKSPACE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 05840df88..36650ea19 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2069,6 +2069,7 @@ const char * locale_real_names[] = "miscsettings.shutdown_real_rcdelay", "miscsettings.sleeptimer", "miscsettings.sleeptimer_min", + "miscsettings.streaming", "miscsettings.volume", "miscsettings.zapto_pre_time", "motorcontrol.calc_positions", @@ -2852,8 +2853,11 @@ const char * locale_real_names[] = "streaminfo.signal", "streaminfo.videosystem", "streaming.busy", + "streaming.decryptmode", "streaming.dir_not_writable", + "streaming.ecmmode", "streaming.overflow", + "streaming.port", "streaming.slow", "streaming.write_error", "stringinput.backspace", diff --git a/src/system/settings.h b/src/system/settings.h index f9a16fce2..90853305f 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -649,6 +649,11 @@ struct SNeutrinoSettings int recording_audio_pids_alt; int recording_audio_pids_std; + // streaming; + int streaming_ecmmode; + int streaming_decryptmode; + int streaming_port; + // timeshift std::string timeshiftdir; int timeshift_auto;