From: Andreas Oberritter Date: Thu, 3 Mar 2011 15:09:07 +0000 (+0100) Subject: Merge branch 'obi/master' X-Git-Tag: 3.1.0~12 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/d0380b44396cbcd497f42eb0047b58b309596007?hp=ebc557a0311087e573d497fb454e3a94d24cdbe0 Merge branch 'obi/master' --- diff --git a/lib/python/Components/PluginComponent.py b/lib/python/Components/PluginComponent.py index e5194b28..93b08900 100755 --- a/lib/python/Components/PluginComponent.py +++ b/lib/python/Components/PluginComponent.py @@ -14,6 +14,7 @@ class PluginComponent: def __init__(self): self.plugins = {} self.pluginList = [ ] + self.installedPluginList = [ ] self.setPluginPrefix("Plugins.") self.resetWarnings() @@ -73,6 +74,7 @@ class PluginComponent: plugins = [ plugins ] for p in plugins: + p.path = path p.updateIcon(path) new_plugins.append(p) @@ -91,17 +93,25 @@ class PluginComponent: #ignore already installed but reloaded plugins for p in plugins_removed: for pa in plugins_added: - if pa.name == p.name and pa.where == p.where: + if pa.path == p.path and pa.where == p.where: pa.needsRestart = False for p in plugins_removed: self.removePlugin(p) for p in plugins_added: - self.addPlugin(p) - + if self.firstRun or p.needsRestart is False: + self.addPlugin(p) + else: + for installed_plugin in self.installedPluginList: + if installed_plugin.path == p.path: + if installed_plugin.where == p.where: + p.needsRestart = False + self.addPlugin(p) + if self.firstRun: self.firstRun = False + self.installedPluginList = self.pluginList def getPlugins(self, where): """Get list of plugins in a specific category""" @@ -124,8 +134,6 @@ class PluginComponent: def clearPluginList(self): self.pluginList = [] self.plugins = {} - self.firstRun = True - self.restartRequired = False def shutdown(self): for p in self.pluginList[:]: diff --git a/lib/python/Plugins/Extensions/DVDBurn/Process.py b/lib/python/Plugins/Extensions/DVDBurn/Process.py index e00dedd9..2e7435bb 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Process.py +++ b/lib/python/Plugins/Extensions/DVDBurn/Process.py @@ -174,7 +174,8 @@ class DemuxTask(Task): print "[DemuxTask::cleanup]" self.mplex_streamfiles = [ self.mplex_videofile ] for pid in self.relevantAudioPIDs: - self.mplex_streamfiles.append(self.mplex_audiofiles[pid]) + if pid in self.mplex_audiofiles: + self.mplex_streamfiles.append(self.mplex_audiofiles[pid]) print self.mplex_streamfiles if failed: diff --git a/lib/python/Plugins/Plugin.py b/lib/python/Plugins/Plugin.py index 9ecdbc26..e26174a1 100755 --- a/lib/python/Plugins/Plugin.py +++ b/lib/python/Plugins/Plugin.py @@ -65,6 +65,7 @@ class PluginDescriptor: self.name = name self.internal = internal self.needsRestart = needsRestart + self.path = None if isinstance(where, list): self.where = where else: diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py index 1a7ebbd1..94a56ee4 100644 --- a/lib/python/Screens/Standby.py +++ b/lib/python/Screens/Standby.py @@ -160,14 +160,9 @@ class TryQuitMainloop(MessageBox): self.conntected=False self.session.nav.record_event.remove(self.getRecordEvent) if value: - # hack .. we dont like to show any other screens when this screen has closed - self.onClose = [self.__closed] - self.session.dialog_stack = [] - self.session.summary_stack = [None] - MessageBox.close(self, True) - - def __closed(self): - quitMainloop(self.retval) + quitMainloop(self.retval) + else: + MessageBox.close(self, True) def __onShow(self): global inTryQuitMainloop diff --git a/lib/service/servicemp3.cpp b/lib/service/servicemp3.cpp index b05b1030..be55d0cd 100644 --- a/lib/service/servicemp3.cpp +++ b/lib/service/servicemp3.cpp @@ -228,6 +228,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref) m_buffer_size = 1*1024*1024; m_prev_decoder_time = -1; m_decoder_time_valid_state = 0; + m_errorInfo.missing_codec = ""; CONNECT(m_seekTimeout->timeout, eServiceMP3::seekTimeoutCB); CONNECT(m_subtitle_sync_timer->timeout, eServiceMP3::pushSubtitles); @@ -327,7 +328,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref) m_gst_playbin = gst_element_factory_make("playbin2", "playbin"); if (!m_gst_playbin) - m_error_message = "failed to create GStreamer pipeline!\n"; + m_errorInfo.error_message = "failed to create GStreamer pipeline!\n"; g_object_set (G_OBJECT (m_gst_playbin), "uri", uri, NULL); @@ -360,6 +361,10 @@ eServiceMP3::eServiceMP3(eServiceReference ref) eDebug("eServiceMP3::subtitle uri: %s", g_filename_to_uri(srt_filename, NULL, NULL)); g_object_set (G_OBJECT (m_gst_playbin), "suburi", g_filename_to_uri(srt_filename, NULL, NULL), NULL); } + if ( m_sourceinfo.is_streaming ) + { + g_signal_connect (G_OBJECT (m_gst_playbin), "notify::source", G_CALLBACK (gstHTTPSourceSetAgent), this); + } } else { m_event((iPlayableService*)this, evUser+12); @@ -367,7 +372,7 @@ eServiceMP3::eServiceMP3(eServiceReference ref) if (m_gst_playbin) gst_object_unref(GST_OBJECT(m_gst_playbin)); - eDebug("eServiceMP3::sorry, can't play: %s",m_error_message.c_str()); + eDebug("eServiceMP3::sorry, can't play: %s",m_errorInfo.error_message.c_str()); m_gst_playbin = 0; } @@ -931,7 +936,7 @@ std::string eServiceMP3::getInfoString(int w) tag = "channel-mode"; break; case sUser+12: - return m_error_message; + return m_errorInfo.error_message; default: return ""; } @@ -1161,18 +1166,18 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) return; gchar *sourceName; GstObject *source; - source = GST_MESSAGE_SRC(msg); + if (!GST_IS_OBJECT(source)) + return; sourceName = gst_object_get_name(source); #if 0 + gchar *string; if (gst_message_get_structure(msg)) - { - gchar *string = gst_structure_to_string(gst_message_get_structure(msg)); - eDebug("eServiceMP3::gst_message from %s: %s", sourceName, string); - g_free(string); - } + string = gst_structure_to_string(gst_message_get_structure(msg)); else - eDebug("eServiceMP3::gst_message from %s: %s (without structure)", sourceName, GST_MESSAGE_TYPE_NAME(msg)); + string = g_strdup(GST_MESSAGE_TYPE_NAME(msg)); + eDebug("eTsRemoteSource::gst_message from %s: %s", sourceName, string); + g_free(string); #endif switch (GST_MESSAGE_TYPE (msg)) { @@ -1373,44 +1378,58 @@ void eServiceMP3::gstBusCall(GstBus *bus, GstMessage *msg) g_free (g_lang); } m_event((iPlayableService*)this, evUpdatedEventInfo); + + if ( m_errorInfo.missing_codec != "" ) + { + if ( m_errorInfo.missing_codec.find("video/") == 0 || ( m_errorInfo.missing_codec.find("audio/") == 0 && getNumberOfTracks() == 0 ) ) + m_event((iPlayableService*)this, evUser+12); + } break; } case GST_MESSAGE_ELEMENT: { - if ( gst_is_missing_plugin_message(msg) ) + if (const GstStructure *msgstruct = gst_message_get_structure(msg)) { - gchar *description = gst_missing_plugin_message_get_description(msg); - if ( description ) + if ( gst_is_missing_plugin_message(msg) ) { - m_error_message = "GStreamer plugin " + (std::string)description + " not available!\n"; - g_free(description); - m_event((iPlayableService*)this, evUser+12); - } - } - else if (const GstStructure *msgstruct = gst_message_get_structure(msg)) - { - const gchar *eventname = gst_structure_get_name(msgstruct); - if ( eventname ) - { - if (!strcmp(eventname, "eventSizeChanged") || !strcmp(eventname, "eventSizeAvail")) + GstCaps *caps; + gst_structure_get (msgstruct, "detail", GST_TYPE_CAPS, &caps, NULL); + std::string codec = (const char*) gst_caps_to_string(caps); + gchar *description = gst_missing_plugin_message_get_description(msg); + if ( description ) { - gst_structure_get_int (msgstruct, "aspect_ratio", &m_aspect); - gst_structure_get_int (msgstruct, "width", &m_width); - gst_structure_get_int (msgstruct, "height", &m_height); - if (strstr(eventname, "Changed")) - m_event((iPlayableService*)this, evVideoSizeChanged); + eDebug("eServiceMP3::m_errorInfo.missing_codec = %s", codec.c_str()); + m_errorInfo.error_message = "GStreamer plugin " + (std::string)description + " not available!\n"; + m_errorInfo.missing_codec = codec.substr(0,(codec.find_first_of(','))); + g_free(description); } - else if (!strcmp(eventname, "eventFrameRateChanged") || !strcmp(eventname, "eventFrameRateAvail")) - { - gst_structure_get_int (msgstruct, "frame_rate", &m_framerate); - if (strstr(eventname, "Changed")) - m_event((iPlayableService*)this, evVideoFramerateChanged); - } - else if (!strcmp(eventname, "eventProgressiveChanged") || !strcmp(eventname, "eventProgressiveAvail")) + gst_caps_unref(caps); + } + else + { + const gchar *eventname = gst_structure_get_name(msgstruct); + if ( eventname ) { - gst_structure_get_int (msgstruct, "progressive", &m_progressive); - if (strstr(eventname, "Changed")) - m_event((iPlayableService*)this, evVideoProgressiveChanged); + if (!strcmp(eventname, "eventSizeChanged") || !strcmp(eventname, "eventSizeAvail")) + { + gst_structure_get_int (msgstruct, "aspect_ratio", &m_aspect); + gst_structure_get_int (msgstruct, "width", &m_width); + gst_structure_get_int (msgstruct, "height", &m_height); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoSizeChanged); + } + else if (!strcmp(eventname, "eventFrameRateChanged") || !strcmp(eventname, "eventFrameRateAvail")) + { + gst_structure_get_int (msgstruct, "frame_rate", &m_framerate); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoFramerateChanged); + } + else if (!strcmp(eventname, "eventProgressiveChanged") || !strcmp(eventname, "eventProgressiveAvail")) + { + gst_structure_get_int (msgstruct, "progressive", &m_progressive); + if (strstr(eventname, "Changed")) + m_event((iPlayableService*)this, evVideoProgressiveChanged); + } } } } diff --git a/lib/service/servicemp3.h b/lib/service/servicemp3.h index a92a4cf7..f3cc6ddf 100644 --- a/lib/service/servicemp3.h +++ b/lib/service/servicemp3.h @@ -173,6 +173,12 @@ public: { } }; + struct errorInfo + { + std::string error_message; + std::string missing_codec; + }; + private: static int pcm_delay; static int ac3_delay; @@ -189,6 +195,7 @@ private: eServiceReference m_ref; int m_buffer_size; bufferInfo m_bufferInfo; + errorInfo m_errorInfo; eServiceMP3(eServiceReference ref); Signal2 m_event; enum @@ -220,7 +227,6 @@ private: }; eFixedMessagePump m_pump; - std::string m_error_message; audiotype_t gstCheckAudioPad(GstStructure* structure); void gstBusCall(GstBus *bus, GstMessage *msg); diff --git a/main/enigma.cpp b/main/enigma.cpp index 1cdd867b..91645d89 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -251,8 +251,9 @@ int main(int argc, char **argv) { gPainter p(my_lcd_dc); - p.resetClip(eRect(0, 0, 132, 64)); + p.resetClip(eRect(ePoint(0, 0), my_lcd_dc->size())); p.clear(); + p.flush(); } return exit_code;