mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
Display of livestream infos in IV if no EPG data available
This commit is contained in:
@@ -162,6 +162,9 @@ void CInfoViewer::Init()
|
|||||||
rt_x = rt_y = rt_h = rt_w = 0;
|
rt_x = rt_y = rt_h = rt_w = 0;
|
||||||
|
|
||||||
infobar_txt = NULL;
|
infobar_txt = NULL;
|
||||||
|
|
||||||
|
_livestreamInfo1.clear();
|
||||||
|
_livestreamInfo2.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -533,7 +536,11 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos)
|
|||||||
loc = LOCALE_INFOVIEWER_EPGWAIT;
|
loc = LOCALE_INFOVIEWER_EPGWAIT;
|
||||||
else
|
else
|
||||||
loc = LOCALE_INFOVIEWER_EPGNOTLOAD;
|
loc = LOCALE_INFOVIEWER_EPGNOTLOAD;
|
||||||
display_Info(g_Locale->getText(loc), NULL);
|
|
||||||
|
_livestreamInfo1.clear();
|
||||||
|
_livestreamInfo2.clear();
|
||||||
|
if (!showLivestreamInfo())
|
||||||
|
display_Info(g_Locale->getText(loc), NULL);
|
||||||
} else {
|
} else {
|
||||||
show_Data ();
|
show_Data ();
|
||||||
}
|
}
|
||||||
@@ -924,6 +931,66 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CInfoViewer::showLivestreamInfo()
|
||||||
|
{
|
||||||
|
CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel();
|
||||||
|
if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv &&
|
||||||
|
cc->getEpgID() == 0 && !cc->getScriptName().empty()) {
|
||||||
|
std::string livestreamInfo1 = "";
|
||||||
|
std::string livestreamInfo2 = "";
|
||||||
|
std::string tmp1 = "";
|
||||||
|
CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1);
|
||||||
|
|
||||||
|
if (!(videoDecoder->getBlank())) {
|
||||||
|
int xres, yres, framerate;
|
||||||
|
std::string tmp2;
|
||||||
|
videoDecoder->getPictureInfo(xres, yres, framerate);
|
||||||
|
switch (framerate) {
|
||||||
|
case 0:
|
||||||
|
tmp2 = "23.976fps";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
tmp2 = "24fps";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
tmp2 = "25fps";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
tmp2 = "29,976fps";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
tmp2 = "30fps";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
tmp2 = "50fps";
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
tmp2 = "50,94fps";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
tmp2 = "60fps";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
livestreamInfo2 = to_string(xres) + "x" + to_string(yres) + ", " + tmp2;
|
||||||
|
if (!tmp1.empty())
|
||||||
|
livestreamInfo2 += (std::string)", " + tmp1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) {
|
||||||
|
display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str());
|
||||||
|
_livestreamInfo1 = livestreamInfo1;
|
||||||
|
_livestreamInfo2 = livestreamInfo2;
|
||||||
|
infoViewerBB->showBBButtons(true /*paintFooter*/);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void CInfoViewer::loop(bool show_dot)
|
void CInfoViewer::loop(bool show_dot)
|
||||||
{
|
{
|
||||||
bool hideIt = true;
|
bool hideIt = true;
|
||||||
@@ -939,9 +1006,14 @@ void CInfoViewer::loop(bool show_dot)
|
|||||||
if (isVolscale)
|
if (isVolscale)
|
||||||
CVolume::getInstance()->showVolscale();
|
CVolume::getInstance()->showVolscale();
|
||||||
|
|
||||||
|
_livestreamInfo1.clear();
|
||||||
|
_livestreamInfo2.clear();
|
||||||
|
|
||||||
while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) {
|
while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) {
|
||||||
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
|
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
|
||||||
|
|
||||||
|
showLivestreamInfo();
|
||||||
|
|
||||||
#ifdef ENABLE_PIP
|
#ifdef ENABLE_PIP
|
||||||
if ((msg == (neutrino_msg_t) g_settings.key_pip_close) ||
|
if ((msg == (neutrino_msg_t) g_settings.key_pip_close) ||
|
||||||
(msg == (neutrino_msg_t) g_settings.key_pip_setup) ||
|
(msg == (neutrino_msg_t) g_settings.key_pip_setup) ||
|
||||||
@@ -1418,6 +1490,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data)
|
|||||||
if ((*(t_channel_id *) data) == current_channel_id) {
|
if ((*(t_channel_id *) data) == current_channel_id) {
|
||||||
if (is_visible && showButtonBar) {
|
if (is_visible && showButtonBar) {
|
||||||
infoViewerBB->showIcon_DD();
|
infoViewerBB->showIcon_DD();
|
||||||
|
showLivestreamInfo();
|
||||||
infoViewerBB->showBBButtons(true /*paintFooter*/); // in case button text has changed
|
infoViewerBB->showBBButtons(true /*paintFooter*/); // in case button text has changed
|
||||||
}
|
}
|
||||||
if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio))
|
if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio))
|
||||||
|
@@ -112,6 +112,8 @@ class CInfoViewer
|
|||||||
bool channellogoChange;
|
bool channellogoChange;
|
||||||
uint32_t lcdUpdateTimer;
|
uint32_t lcdUpdateTimer;
|
||||||
int zap_mode;
|
int zap_mode;
|
||||||
|
std::string _livestreamInfo1;
|
||||||
|
std::string _livestreamInfo2;
|
||||||
|
|
||||||
void paintBackground(int col_Numbox);
|
void paintBackground(int col_Numbox);
|
||||||
void paintHead();
|
void paintHead();
|
||||||
@@ -146,6 +148,8 @@ class CInfoViewer
|
|||||||
void reset_allScala();
|
void reset_allScala();
|
||||||
void check_channellogo_ca_SettingsChange();
|
void check_channellogo_ca_SettingsChange();
|
||||||
void sendNoEpg(const t_channel_id channel_id);
|
void sendNoEpg(const t_channel_id channel_id);
|
||||||
|
bool showLivestreamInfo();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool chanready;
|
bool chanready;
|
||||||
bool is_visible;
|
bool is_visible;
|
||||||
|
@@ -203,6 +203,8 @@ void CMoviePlayerGui::Init(void)
|
|||||||
m_screensaver = false;
|
m_screensaver = false;
|
||||||
m_idletime = time(NULL);
|
m_idletime = time(NULL);
|
||||||
liveStreamList.clear();
|
liveStreamList.clear();
|
||||||
|
livestreamInfo1.clear();
|
||||||
|
livestreamInfo2.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMoviePlayerGui::cutNeutrino()
|
void CMoviePlayerGui::cutNeutrino()
|
||||||
@@ -887,10 +889,9 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st
|
|||||||
}
|
}
|
||||||
|
|
||||||
static t_channel_id oldChan = 0;
|
static t_channel_id oldChan = 0;
|
||||||
std::string realUrl = file;
|
std::string realUrl = file;
|
||||||
|
std::string _script = script;
|
||||||
std::string _pretty_name = name;
|
std::string _pretty_name = name;
|
||||||
std::string _epgTitle = name;
|
|
||||||
std::string _script = script;
|
|
||||||
livestream_info_t info;
|
livestream_info_t info;
|
||||||
if (!_script.empty()) {
|
if (!_script.empty()) {
|
||||||
if (_script.find("/") == std::string::npos)
|
if (_script.find("/") == std::string::npos)
|
||||||
@@ -900,24 +901,48 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st
|
|||||||
if ((file_exists(_script.c_str())) && (pos != std::string::npos) && (_script.length()-pos == 4)) {
|
if ((file_exists(_script.c_str())) && (pos != std::string::npos) && (_script.length()-pos == 4)) {
|
||||||
if ((oldChan != chan) || liveStreamList.empty()) {
|
if ((oldChan != chan) || liveStreamList.empty()) {
|
||||||
liveStreamList.clear();
|
liveStreamList.clear();
|
||||||
if (!luaGetUrl(_script, file, liveStreamList))
|
if (!luaGetUrl(_script, file, liveStreamList)) {
|
||||||
|
liveStreamList.clear();
|
||||||
|
printf(">>>>> [%s:%s:%d] lua script error\n", __file__, __func__, __LINE__);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
oldChan = chan;
|
oldChan = chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info))
|
if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) {
|
||||||
|
liveStreamList.clear();
|
||||||
|
printf(">>>>> [%s:%s:%d] error selectLivestream\n", __file__, __func__, __LINE__);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
realUrl = info.url;
|
realUrl = info.url;
|
||||||
if (!info.name.empty()) {
|
if (!info.name.empty()) {
|
||||||
|
livestreamInfo1 = info.name;
|
||||||
_pretty_name = info.name;
|
_pretty_name = info.name;
|
||||||
_epgTitle = info.name;
|
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
if (!info.resolution.empty())
|
if (!info.resolution.empty())
|
||||||
_epgTitle += (std::string)" (" + info.resolution + ")";
|
livestreamInfo2 = info.resolution;
|
||||||
|
if (info.bandwidth > 0) {
|
||||||
|
char buf[32];
|
||||||
|
memset(buf, '\0', sizeof(buf));
|
||||||
|
snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000));
|
||||||
|
livestreamInfo2 += (std::string)", " + (std::string)buf;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (info.bandwidth > 0) {
|
||||||
|
char buf[32];
|
||||||
|
memset(buf, '\0', sizeof(buf));
|
||||||
|
snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000));
|
||||||
|
livestreamInfo2 = (std::string)buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
liveStreamList.clear();
|
||||||
|
printf(">>>>> [%s:%s:%d] script error\n", __file__, __func__, __LINE__);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
|
||||||
@@ -932,7 +957,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st
|
|||||||
instance_bg->file_name = realUrl;
|
instance_bg->file_name = realUrl;
|
||||||
instance_bg->pretty_name = _pretty_name;
|
instance_bg->pretty_name = _pretty_name;
|
||||||
|
|
||||||
instance_bg->movie_info.epgTitle = _epgTitle;
|
instance_bg->movie_info.epgTitle = name;
|
||||||
instance_bg->movie_info.epgChannel = realUrl;
|
instance_bg->movie_info.epgChannel = realUrl;
|
||||||
instance_bg->movie_info.epgId = chan;
|
instance_bg->movie_info.epgId = chan;
|
||||||
instance_bg->p_movie_info = &movie_info;
|
instance_bg->p_movie_info = &movie_info;
|
||||||
@@ -959,6 +984,8 @@ void CMoviePlayerGui::stopPlayBack(void)
|
|||||||
pthread_join(bgThread, NULL);
|
pthread_join(bgThread, NULL);
|
||||||
bgThread = 0;
|
bgThread = 0;
|
||||||
}
|
}
|
||||||
|
livestreamInfo1.clear();
|
||||||
|
livestreamInfo2.clear();
|
||||||
printf("%s: stopped\n", __func__);
|
printf("%s: stopped\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,6 +94,9 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
int bandwidth;
|
int bandwidth;
|
||||||
} livestream_info_struct_t;
|
} livestream_info_struct_t;
|
||||||
|
|
||||||
|
std::string livestreamInfo1;
|
||||||
|
std::string livestreamInfo2;
|
||||||
|
|
||||||
CFrameBuffer * frameBuffer;
|
CFrameBuffer * frameBuffer;
|
||||||
int m_LastMode;
|
int m_LastMode;
|
||||||
|
|
||||||
@@ -257,6 +260,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; };
|
void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; };
|
||||||
bool getBlockedFromPlugin() { return blockedFromPlugin; };
|
bool getBlockedFromPlugin() { return blockedFromPlugin; };
|
||||||
void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; };
|
void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; };
|
||||||
|
void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user