update debugging output
authorMirakels <mirakels@openpli.org>
Sun, 22 Mar 2015 10:41:57 +0000 (11:41 +0100)
committerMirakels <mirakels@openpli.org>
Sun, 22 Mar 2015 10:41:57 +0000 (11:41 +0100)
Fix NoNewline eDebug messages so time info does not clobber output.
Improve several eDebugs to indicate what part is issuing the message.

27 files changed:
lib/base/eerror.cpp
lib/base/eerror.h
lib/driver/hdmi_cec.cpp
lib/dvb/decoder.cpp
lib/dvb/epgcache.cpp
lib/dvb/esection.h
lib/dvb/frontend.cpp
lib/dvb/scan.cpp
lib/dvb/sec.cpp
lib/dvb/teletext.cpp
lib/dvb_ci/dvbci.cpp
lib/dvb_ci/dvbci_appmgr.cpp
lib/dvb_ci/dvbci_camgr.cpp
lib/dvb_ci/dvbci_datetimemgr.cpp
lib/dvb_ci/dvbci_mmi.cpp
lib/dvb_ci/dvbci_resmgr.cpp
lib/dvb_ci/dvbci_session.cpp
lib/gdi/font.cpp
lib/gdi/lcd.cpp
lib/mmi/mmi_ui.cpp
lib/network/socket.cpp
lib/python/Plugins/Extensions/SocketMMI/src/socket_mmi.cpp
lib/service/listboxservice.cpp
lib/service/servicedvb.cpp
lib/service/servicedvbrecord.cpp
lib/service/servicedvbstream.cpp
lib/service/servicem2ts.cpp

index 1022b8f..f8c26a1 100644 (file)
@@ -120,7 +120,7 @@ void eDebug(const char* fmt, ...)
                fprintf(stderr, "%s\n", buf);
 }
 
-void eDebugNoNewLine(const char* fmt, ...)
+void eDebugNoNewLineStart(const char* fmt, ...)
 {
        char buf[1024];
        struct timespec tp;
@@ -136,6 +136,19 @@ void eDebugNoNewLine(const char* fmt, ...)
                fprintf(stderr, "%s", buf);
 }
 
+void eDebugNoNewLine(const char* fmt, ...)
+{
+       char buf[1024];
+       va_list ap;
+       va_start(ap, fmt);
+       vsnprintf(buf, 1024, fmt, ap);
+       va_end(ap);
+       singleLock s(DebugLock);
+       logOutput(lvlDebug, std::string(buf));
+       if (logOutputConsole)
+               fprintf(stderr, "%s", buf);
+}
+
 void eWarning(const char* fmt, ...)
 {
        char buf[1024];
index 86bd7f1..32d0c75 100644 (file)
@@ -117,6 +117,7 @@ enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 };
 
 #ifdef DEBUG
     void CHECKFORMAT eDebug(const char*, ...);
+    void CHECKFORMAT eDebugNoNewLineStart(const char*, ...);
     void CHECKFORMAT eDebugNoNewLine(const char*, ...);
     void CHECKFORMAT eWarning(const char*, ...);
     #define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); }
@@ -125,6 +126,10 @@ enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 };
     {
     }
 
+    inline void eDebugNoNewLineStart(const char* fmt, ...)
+    {
+    }
+
     inline void eDebugNoNewLine(const char* fmt, ...)
     {
     }
index 4861134..0be4ca0 100644 (file)
@@ -236,12 +236,12 @@ void eHdmiCEC::hdmiEvent(int what)
                        bool keypressed = false;
                        static unsigned char pressedkey = 0;
 
-                       eDebugNoNewLine("eHdmiCEC: received message");
+                       eDebugNoNewLineStart("eHdmiCEC: received message");
                        for (int i = 0; i < rxmessage.length; i++)
                        {
                                eDebugNoNewLine(" %02X", rxmessage.data[i]);
                        }
-                       eDebug(" ");
+                       eDebugNoNewLine("\n");
                        bool hdmicec_report_active_menu = eConfigManager::getConfigBoolValue("config.hdmicec.report_active_menu", false);
                        if (hdmicec_report_active_menu)
                        {
@@ -389,12 +389,12 @@ void eHdmiCEC::sendMessage(struct cec_message &message)
 {
        if (hdmiFd >= 0)
        {
-               eDebugNoNewLine("eHdmiCEC: send message");
+               eDebugNoNewLineStart("eHdmiCEC: send message");
                for (int i = 0; i < message.length; i++)
                {
                        eDebugNoNewLine(" %02X", message.data[i]);
                }
-               eDebug(" ");
+               eDebugNoNewLine("\n");
 #ifdef DREAMBOX
                message.flag = 1;
                ::ioctl(hdmiFd, 3, &message);
index 9d1728c..5ec74e0 100644 (file)
@@ -75,20 +75,20 @@ int eDVBAudio::startPid(int pid, int type)
                        break;
                }
                pes.flags    = 0;
-               eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - audio - ", pid);
+               eDebugNoNewLineStart("DMX_SET_PES_FILTER(0x%02x) - audio%d - ", pid, m_dev);
                if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
                {
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                        return -errno;
                }
-               eDebug("ok");
-               eDebugNoNewLine("DEMUX_START - audio - ");
+               eDebugNoNewLine("ok\n");
+               eDebugNoNewLineStart("DEMUX_START - audio - ");
                if (::ioctl(m_fd_demux, DMX_START) < 0)
                {
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                        return -errno;
                }
-               eDebug("ok");
+               eDebugNoNewLine("ok\n");
        }
 
        if (m_fd >= 0)
@@ -123,17 +123,17 @@ int eDVBAudio::startPid(int pid, int type)
                        break;
                }
 
-               eDebugNoNewLine("AUDIO_SET_BYPASS(%d) - ", bypass);
+               eDebugNoNewLineStart("AUDIO_SET_BYPASS(%d) - ", bypass);
                if (::ioctl(m_fd, AUDIO_SET_BYPASS_MODE, bypass) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
                freeze();  // why freeze here?!? this is a problem when only a pid change is requested... because of the unfreeze logic in Decoder::setState
-               eDebugNoNewLine("AUDIO_PLAY - ");
+               eDebugNoNewLineStart("AUDIO_PLAY - ");
                if (::ioctl(m_fd, AUDIO_PLAY) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
        return 0;
 }
@@ -142,19 +142,19 @@ void eDVBAudio::stop()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("AUDIO_STOP - ");
+               eDebugNoNewLineStart("AUDIO_STOP - ");
                if (::ioctl(m_fd, AUDIO_STOP) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
        if (m_fd_demux >= 0)
        {
-               eDebugNoNewLine("DEMUX_STOP - audio - ");
+               eDebugNoNewLineStart("DEMUX_STOP - audio - ");
                if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -162,11 +162,11 @@ void eDVBAudio::flush()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("AUDIO_CLEAR_BUFFER - ");
+               eDebugNoNewLineStart("AUDIO_CLEAR_BUFFER - ");
                if (::ioctl(m_fd, AUDIO_CLEAR_BUFFER) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -174,11 +174,11 @@ void eDVBAudio::freeze()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("AUDIO_PAUSE - ");
+               eDebugNoNewLineStart("AUDIO_PAUSE - ");
                if (::ioctl(m_fd, AUDIO_PAUSE) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -186,11 +186,11 @@ void eDVBAudio::unfreeze()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("AUDIO_CONTINUE - ");
+               eDebugNoNewLineStart("AUDIO_CONTINUE - ");
                if (::ioctl(m_fd, AUDIO_CONTINUE) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -205,11 +205,11 @@ void eDVBAudio::setChannel(int channel)
                case aMonoRight: val = AUDIO_MONO_RIGHT; break;
                default: break;
                }
-               eDebugNoNewLine("AUDIO_CHANNEL_SELECT(%d) - ", val);
+               eDebugNoNewLineStart("AUDIO_CHANNEL_SELECT(%d) - ", val);
                if (::ioctl(m_fd, AUDIO_CHANNEL_SELECT, val) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -325,11 +325,11 @@ int eDVBVideo::startPid(int pid, int type)
                        break;
                }
 
-               eDebugNoNewLine("VIDEO_SET_STREAMTYPE %d - ", streamtype);
+               eDebugNoNewLineStart("VIDEO_SET_STREAMTYPE %d - ", streamtype);
                if (::ioctl(m_fd, VIDEO_SET_STREAMTYPE, streamtype) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 
        if (m_fd_demux >= 0)
@@ -354,30 +354,30 @@ int eDVBVideo::startPid(int pid, int type)
                        break;
                }
                pes.flags    = 0;
-               eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - video - ", pid);
+               eDebugNoNewLineStart("DMX_SET_PES_FILTER(0x%02x) - video%d - ", pid, m_dev);
                if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
                {
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                        return -errno;
                }
-               eDebug("ok");
-               eDebugNoNewLine("DEMUX_START - video - ");
+               eDebugNoNewLine("ok\n");
+               eDebugNoNewLineStart("DEMUX_START - video - ");
                if (::ioctl(m_fd_demux, DMX_START) < 0)
                {
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                        return -errno;
                }
-               eDebug("ok");
+               eDebugNoNewLine("ok\n");
        }
 
        if (m_fd >= 0)
        {
                freeze();  // why freeze here?!? this is a problem when only a pid change is requested... because of the unfreeze logic in Decoder::setState
-               eDebugNoNewLine("VIDEO_PLAY - ");
+               eDebugNoNewLineStart("VIDEO_PLAY - ");
                if (::ioctl(m_fd, VIDEO_PLAY) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
        return 0;
 }
@@ -386,20 +386,20 @@ void eDVBVideo::stop()
 {
        if (m_fd_demux >= 0)
        {
-               eDebugNoNewLine("DEMUX_STOP - video - ");
+               eDebugNoNewLineStart("DEMUX_STOP - video - ");
                if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_STOP - ");
+               eDebugNoNewLineStart("VIDEO_STOP - ");
                if (::ioctl(m_fd, VIDEO_STOP, 1) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -407,11 +407,11 @@ void eDVBVideo::flush()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_CLEAR_BUFFER - ");
+               eDebugNoNewLineStart("VIDEO_CLEAR_BUFFER - ");
                if (::ioctl(m_fd, VIDEO_CLEAR_BUFFER) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -419,11 +419,11 @@ void eDVBVideo::freeze()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_FREEZE - ");
+               eDebugNoNewLineStart("VIDEO_FREEZE - ");
                if (::ioctl(m_fd, VIDEO_FREEZE) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -431,11 +431,11 @@ void eDVBVideo::unfreeze()
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_CONTINUE - ");
+               eDebugNoNewLineStart("VIDEO_CONTINUE - ");
                if (::ioctl(m_fd, VIDEO_CONTINUE) < 0)
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
        }
 }
 
@@ -443,12 +443,12 @@ int eDVBVideo::setSlowMotion(int repeat)
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_SLOWMOTION(%d) - ", repeat);
+               eDebugNoNewLineStart("VIDEO_SLOWMOTION(%d) - ", repeat);
                int ret = ::ioctl(m_fd, VIDEO_SLOWMOTION, repeat);
                if (ret < 0)
-                       eDebug("failed(%m)");
+                       eDebugNoNewLine("failed(%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
                return ret;
        }
        return 0;
@@ -458,12 +458,12 @@ int eDVBVideo::setFastForward(int skip)
 {
        if (m_fd >= 0)
        {
-               eDebugNoNewLine("VIDEO_FAST_FORWARD(%d) - ", skip);
+               eDebugNoNewLineStart("VIDEO_FAST_FORWARD(%d) - ", skip);
                int ret = ::ioctl(m_fd, VIDEO_FAST_FORWARD, skip);
                if (ret < 0)
-                       eDebug("failed(%m)");
+                       eDebugNoNewLine("failed(%m)\n");
                else
-                       eDebug("ok");
+                       eDebugNoNewLine("ok\n");
                return ret;
        }
        return 0;
@@ -501,15 +501,14 @@ void eDVBVideo::video_event(int)
                if (retval < 0 && errno == EINTR) continue;
                if (retval <= 0) break;
                struct video_event evt;
-               eDebugNoNewLine("VIDEO_GET_EVENT - ");
+               eDebugNoNewLineStart("VIDEO_GET_EVENT - ");
                if (::ioctl(m_fd, VIDEO_GET_EVENT, &evt) < 0)
                {
-                       eDebug("failed (%m)");
+                       eDebugNoNewLine("failed (%m)\n");
                        break;
                }
                else
                {
-                       eDebug("ok");
                        if (evt.type == VIDEO_EVENT_SIZE_CHANGED)
                        {
                                struct iTSMPEGDecoder::videoEvent event;
@@ -517,6 +516,7 @@ void eDVBVideo::video_event(int)
                                m_aspect = event.aspect = evt.u.size.aspect_ratio == 0 ? 2 : 3;  // convert dvb api to etsi
                                m_height = event.height = evt.u.size.h;
                                m_width = event.width = evt.u.size.w;
+                               eDebugNoNewLine("got SIZE_CHANGED %dx%d aspect %d\n", m_width, m_height, m_aspect);
                                /* emit */ m_event(event);
                        }
                        else if (evt.type == VIDEO_EVENT_FRAME_RATE_CHANGED)
@@ -524,6 +524,7 @@ void eDVBVideo::video_event(int)
                                struct iTSMPEGDecoder::videoEvent event;
                                event.type = iTSMPEGDecoder::videoEvent::eventFrameRateChanged;
                                m_framerate = event.framerate = evt.u.frame_rate;
+                               eDebugNoNewLine("got FRAME_RATE_CHANGED %d fps\n", m_framerate);
                                /* emit */ m_event(event);
                        }
                        else if (evt.type == 16 /*VIDEO_EVENT_PROGRESSIVE_CHANGED*/)
@@ -531,10 +532,11 @@ void eDVBVideo::video_event(int)
                                struct iTSMPEGDecoder::videoEvent event;
                                event.type = iTSMPEGDecoder::videoEvent::eventProgressiveChanged;
                                m_progressive = event.progressive = evt.u.frame_rate;
+                               eDebugNoNewLine("got PROGRESSIVE_CHANGED %d\n", m_progressive);
                                /* emit */ m_event(event);
                        }
                        else
-                               eDebug("unhandled DVBAPI Video Event %d", evt.type);
+                               eDebugNoNewLine("unhandled DVBAPI Video Event %d\n", evt.type);
                }
        }
 }
@@ -658,30 +660,30 @@ int eDVBPCR::startPid(int pid)
                break;
        }
        pes.flags    = 0;
-       eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - pcr - ", pid);
+       eDebugNoNewLineStart("DMX_SET_PES_FILTER(0x%02x) - pcr%d - ", pid, m_dev);
        if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
        {
-               eDebug("failed (%m)");
+               eDebugNoNewLine("failed (%m)\n");
                return -errno;
        }
-       eDebug("ok");
-       eDebugNoNewLine("DEMUX_START - pcr - ");
+       eDebugNoNewLine("ok\n");
+       eDebugNoNewLineStart("DEMUX_START - pcr - ");
        if (::ioctl(m_fd_demux, DMX_START) < 0)
        {
-               eDebug("failed (%m)");
+               eDebugNoNewLine("failed (%m)\n");
                return -errno;
        }
-       eDebug("ok");
+       eDebugNoNewLine("ok\n");
        return 0;
 }
 
 void eDVBPCR::stop()
 {
-       eDebugNoNewLine("DEMUX_STOP - pcr - ");
+       eDebugNoNewLineStart("DEMUX_STOP - pcr - ");
        if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-               eDebug("failed(%m)");
+               eDebugNoNewLine("failed(%m)\n");
        else
-               eDebug("ok");
+               eDebugNoNewLine("ok\n");
 }
 
 eDVBPCR::~eDVBPCR()
@@ -728,30 +730,30 @@ int eDVBTText::startPid(int pid)
        }
        pes.flags    = 0;
 
-       eDebugNoNewLine("DMX_SET_PES_FILTER(0x%02x) - ttx - ", pid);
+       eDebugNoNewLineStart("DMX_SET_PES_FILTER(0x%02x) - ttx%d - ", pid, m_dev);
        if (::ioctl(m_fd_demux, DMX_SET_PES_FILTER, &pes) < 0)
        {
-               eDebug("failed(%m)");
+               eDebugNoNewLine("failed(%m)\n");
                return -errno;
        }
-       eDebug("ok");
-       eDebugNoNewLine("DEMUX_START - ttx - ");
+       eDebugNoNewLine("ok\n");
+       eDebugNoNewLineStart("DEMUX_START - ttx - ");
        if (::ioctl(m_fd_demux, DMX_START) < 0)
        {
-               eDebug("failed(%m)");
+               eDebugNoNewLine("failed(%m)\n");
                return -errno;
        }
-       eDebug("ok");
+       eDebugNoNewLine("ok\n");
        return 0;
 }
 
 void eDVBTText::stop()
 {
-       eDebugNoNewLine("DEMUX_STOP - ttx - ");
+       eDebugNoNewLineStart("DEMUX_STOP - ttx - ");
        if (::ioctl(m_fd_demux, DMX_STOP) < 0)
-               eDebug("failed(%m)");
+               eDebugNoNewLine("failed(%m)\n");
        else
-               eDebug("ok");
+               eDebugNoNewLine("ok\n");
 }
 
 eDVBTText::~eDVBTText()
index bfc082f..f82c615 100644 (file)
@@ -1934,7 +1934,7 @@ void eEPGCache::channel_data::readData( const uint8_t *data, int source)
        tidMap &calcedSections = this->calcedSections[map];
        if ( (state == 1 && calcedSections == seenSections) || state > 1 )
        {
-               eDebugNoNewLine("[EPGC] ");
+               eDebugNoNewLineStart("[EPGC] ");
                switch (source)
                {
                        case NOWNEXT:
@@ -1975,7 +1975,7 @@ void eEPGCache::channel_data::readData( const uint8_t *data, int source)
 #endif
                        default: eDebugNoNewLine("unknown");break;
                }
-               eDebug(" finished(%ld)", ::time(0));
+               eDebugNoNewLine(" finished(%ld)\n", ::time(0));
                if ( reader )
                        reader->stop();
                isRunning &= ~source;
@@ -4287,7 +4287,7 @@ void eEPGCache::channel_data::readMHWData2(const uint8_t *data)
                pos = 18;
                while (pos < dataLen)
                {
-//                     eDebugNoNewLine("    [%02x] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x [%02x %02x %02x %02x %02x %02x %02x] LL - DESCR - ",
+//                     eDebugNoNewLineStart("    [%02x] %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x [%02x %02x %02x %02x %02x %02x %02x] LL - DESCR - ",
 //                             data[pos], data[pos+1], data[pos+2], data[pos+3], data[pos+4], data[pos+5], data[pos+6], data[pos+7],
 //                             data[pos+8], data[pos+9], data[pos+10], data[pos+11], data[pos+12], data[pos+13], data[pos+14], data[pos+15], data[pos+16], data[pos+17]);
                        title.channel_id = data[pos]+1;
@@ -4308,7 +4308,7 @@ void eEPGCache::channel_data::readMHWData2(const uint8_t *data)
                        memcpy(dest, &data[pos+19], slen>35 ? 35 : slen);
                        memset(dest+slen, 0, 35-slen);
                        pos += 19 + slen;
-//                     eDebug("%02x [%02x %02x]: %s", data[pos], data[pos+1], data[pos+2], dest);
+//                     eDebugNoNewLine("%02x [%02x %02x]: %s\n", data[pos], data[pos+1], data[pos+2], dest);
 
 //                     not used theme id (data[7] & 0x3f) + (data[pos] & 0x3f);
                        uint32_t summary_id = (data[pos+1] << 8) | data[pos+2];
index f1e2520..1743877 100644 (file)
@@ -5,6 +5,7 @@
 #include <set>
 
 #define TABLE_eDebug(x...) do { if (m_debug) eDebug(x); } while(0)
+#define TABLE_eDebugNoNewLineStart(x...) do { if (m_debug) eDebugNoNewLineStart(x); } while(0)
 #define TABLE_eDebugNoNewLine(x...) do { if (m_debug) eDebugNoNewLine(x); } while(0)
 
 class eGTable: public iObject, public Object
@@ -47,7 +48,7 @@ protected:
                unsigned int ssize = sections.size();
                if (max < ssize || nr >= max)
                {
-                       TABLE_eDebug("kaputt max(%d) < ssize(%d) || nr(%d) >= max(%d)",
+                       TABLE_eDebug("eTable: bounds error: max(%d) < ssize(%d) || nr(%d) >= max(%d)",
                                max, ssize, nr, max);
                        return 0;
                }
@@ -58,17 +59,18 @@ protected:
                sections[nr] = new Section(data);
                avail.insert(nr);
 
+               TABLE_eDebugNoNewLineStart("eTable: ");
                for (unsigned int i = 0; i < max; ++i)
                        if (avail.find(i) != avail.end())
                                TABLE_eDebugNoNewLine("+");
                        else
                                TABLE_eDebugNoNewLine("-");
 
-               TABLE_eDebug(" %zd/%d TID %02x", avail.size(), max, data[0]);
+               TABLE_eDebugNoNewLine(" %zd/%d TID %02x\n", avail.size(), max, data[0]);
 
                if (avail.size() == max)
                {
-                       TABLE_eDebug("done!");
+                       TABLE_eDebug("eTable: done!");
                        return 1;
                } else
                        return 0;
@@ -225,7 +227,7 @@ public:
                                        m_table_cnt = -1;
                                else if (m_table_cnt > 1) // two pmt update within one second
                                {
-                                       eDebug("Seen two consecutive table version changes within 500ms. "
+                                       eDebug("eAUTable: Seen two consecutive table version changes within 500ms. "
                                            "This seems broken, so auto update for pid %04x, table %02x is now disabled!!",
                                            spec.pid, spec.tid);
                                        m_table_cnt = 0;
index 1370599..619433f 100644 (file)
 #if 0
                else \
                { \
-                       eDebugNoNewLine("SIMULATE:"); \
-                       eDebug(x); \
+                       eDebugNoNewLineStart("SIMULATE:"); \
+                       eDebugNoNewline(x); \
+                       eDebugNoNewline("\n"); \
                }
 #endif
 
-#define eDebugNoSimulateNoNewLine(x...) \
+#define eDebugNoSimulateNoNewLineStart(x...) \
        do { \
                if (!m_simulate) \
-                       eDebugNoNewLine(x); \
+                       eDebugNoNewLineStart(x); \
        } while(0)
 #if 0
                else \
                { \
-                       eDebugNoNewLine("SIMULATE:"); \
+                       eDebugNoNewLineStart("SIMULATE:"); \
                        eDebugNoNewLine(x); \
                }
 #endif
@@ -1341,15 +1342,16 @@ int eDVBFrontend::tuneLoopInt()  // called by m_tuneTimer
                                break;
                        case eSecCommand::SEND_DISEQC:
                                sec_fe->sendDiseqc(m_sec_sequence.current()->diseqc);
-                               eDebugNoSimulateNoNewLine("[SEC] sendDiseqc: ");
+                               eDebugNoSimulateNoNewLineStart("[SEC] sendDiseqc: ");
                                for (int i=0; i < m_sec_sequence.current()->diseqc.len; ++i)
-                                   eDebugNoSimulateNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]);
+                                   eDebugNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]);
                                if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x00", 3))
-                                       eDebugNoSimulate("(DiSEqC reset)");
+                                       eDebugNoNewLine("(DiSEqC reset)\n");
                                else if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x03", 3))
-                                       eDebugNoSimulate("(DiSEqC peripherial power on)");
+                                       eDebugNoNewLine("(DiSEqC peripherial power on)\n");
                                else
-                                       eDebugNoSimulate("(?)");
+                                       eDebugNoNewLine("(?)\n");
                                ++m_sec_sequence.current();
                                break;
                        case eSecCommand::SEND_TONEBURST:
@@ -1407,7 +1409,7 @@ int eDVBFrontend::tuneLoopInt()  // called by m_tuneTimer
                                        int diff = abs(idle-m_idleInputpower[idx]);
                                        if ( diff > 0)
                                        {
-                                               eDebugNoSimulate("measure idle(%d) was not okay.. (%d - %d = %d) retry", idx, m_idleInputpower[idx], idle, diff);
+                                               eDebugNoSimulate("  measure idle(%d) was not okay.. (%d - %d = %d) retry", idx, m_idleInputpower[idx], idle, diff);
                                                setSecSequencePos(compare.steps);
                                                break;
                                        }
index e79a121..419af73 100644 (file)
@@ -23,6 +23,7 @@
 #include <errno.h>
 
 #define SCAN_eDebug(x...) do { if (m_scan_debug) eDebug(x); } while(0)
+#define SCAN_eDebugNoNewLineStart(x...) do { if (m_scan_debug) eDebugNoNewLineStart(x); } while(0)
 #define SCAN_eDebugNoNewLine(x...) do { if (m_scan_debug) eDebugNoNewLine(x); } while(0)
 
 DEFINE_REF(eDVBScan);
@@ -193,10 +194,8 @@ RESULT eDVBScan::nextChannel()
 
        if (m_ch_toScan.empty())
        {
-               SCAN_eDebug("no channels left to scan.");
-               SCAN_eDebug("%zd channels scanned, %zd were unavailable.",
-                               m_ch_scanned.size(), m_ch_unavailable.size());
-               SCAN_eDebug("%zd channels in database.", m_new_channels.size());
+               SCAN_eDebug("no channels left: %zd scanned, %zd unavailable, %zd database.",
+                       m_ch_scanned.size(), m_ch_unavailable.size(), m_new_channels.size());
                m_event(evtFinish);
                return -ENOENT;
        }
@@ -341,7 +340,7 @@ void eDVBScan::NITready(int err)
 
 void eDVBScan::BATready(int err)
 {
-       SCAN_eDebug("got bat");
+       SCAN_eDebug("got bat, err %d", err);
        m_ready |= readyBAT;
        if (!err)
                m_ready |= validBAT;
@@ -350,7 +349,7 @@ void eDVBScan::BATready(int err)
 
 void eDVBScan::PATready(int err)
 {
-       SCAN_eDebug("got pat");
+       SCAN_eDebug("got pat, err %d", err);
        m_ready |= readyPAT;
        if (!err)
                m_ready |= validPAT;
@@ -374,7 +373,7 @@ void eDVBScan::PMTready(int err)
                        if (pcrpid == 0xFFFF)
                                pcrpid = pmt.getPcrPid();
                        else
-                               SCAN_eDebug("already have a pcrpid %04x %04x", pcrpid, pmt.getPcrPid());
+                               SCAN_eDebug("  already have a pcrpid %04x %04x", pcrpid, pmt.getPcrPid());
                        ElementaryStreamInfoConstIterator es;
                        for (es = pmt.getEsInfo()->begin(); es != pmt.getEsInfo()->end(); ++es)
                        {
@@ -515,7 +514,7 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
        {
                eDVBFrontendParametersSatellite parm;
                feparm->getDVBS(parm);
-               SCAN_eDebug("try to add %d %d %d %d %d %d",
+               SCAN_eDebug("try to add sat %d %d %d %d %d %d",
                        parm.orbital_position, parm.frequency, parm.symbol_rate, parm.polarisation, parm.fec, parm.modulation);
                break;
        }
@@ -523,7 +522,7 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
        {
                eDVBFrontendParametersCable parm;
                feparm->getDVBC(parm);
-               SCAN_eDebug("try to add %d %d %d %d",
+               SCAN_eDebug("try to add cable %d %d %d %d",
                        parm.frequency, parm.symbol_rate, parm.modulation, parm.fec_inner);
                break;
        }
@@ -531,7 +530,7 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
        {
                eDVBFrontendParametersTerrestrial parm;
                feparm->getDVBT(parm);
-               SCAN_eDebug("try to add %d %d %d %d %d %d %d %d",
+               SCAN_eDebug("try to add terres %d %d %d %d %d %d %d %d",
                        parm.frequency, parm.modulation, parm.transmission_mode, parm.hierarchy,
                        parm.guard_interval, parm.code_rate_LP, parm.code_rate_HP, parm.bandwidth);
                break;
@@ -547,11 +546,11 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
                        if (!found_count)
                        {
                                *i = feparm;  // update
-                               SCAN_eDebug("update");
+                               SCAN_eDebug("  update");
                        }
                        else
                        {
-                               SCAN_eDebug("remove dupe");
+                               SCAN_eDebug("  remove dupe");
                                m_ch_toScan.erase(i++);
                                continue;
                        }
@@ -562,7 +561,7 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
 
        if (found_count > 0)
        {
-               SCAN_eDebug("already in todo list");
+               SCAN_eDebug("  already in todo list");
                return;
        }
 
@@ -570,7 +569,7 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
        for (std::list<ePtr<iDVBFrontendParameters> >::const_iterator i(m_ch_scanned.begin()); i != m_ch_scanned.end(); ++i)
                if (sameChannel(*i, feparm))
                {
-                       SCAN_eDebug("successfully scanned");
+                       SCAN_eDebug("  successfully scanned");
                        return;
                }
 
@@ -578,18 +577,18 @@ void eDVBScan::addChannelToScan(iDVBFrontendParameters *feparm)
        for (std::list<ePtr<iDVBFrontendParameters> >::const_iterator i(m_ch_unavailable.begin()); i != m_ch_unavailable.end(); ++i)
                if (sameChannel(*i, feparm, true))
                {
-                       SCAN_eDebug("scanned but not available");
+                       SCAN_eDebug("  scanned but not available");
                        return;
                }
 
                /* ... on the current channel */
        if (sameChannel(m_ch_current, feparm))
        {
-               SCAN_eDebug("is current");
+               SCAN_eDebug("  is current");
                return;
        }
 
-       SCAN_eDebug("really add");
+       SCAN_eDebug("  really add");
                /* otherwise, add it to the todo list. */
        m_ch_toScan.push_front(feparm); // better.. then the rotor not turning wild from east to west :)
 }
@@ -1283,7 +1282,7 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription
        for (ServiceDescriptionConstIterator s(services.begin()); s != services.end(); ++s)
        {
                unsigned short service_id = (*s)->getServiceId();
-               SCAN_eDebugNoNewLine("SID %04x: ", service_id);
+               SCAN_eDebugNoNewLineStart("SID %04x: ", service_id);
                bool is_crypted = false;
 
                std::map<unsigned short, service>::iterator it = m_pmts_to_read.find(service_id);
@@ -1291,12 +1290,13 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription
                {
                        if (it->second.scrambled)
                        {
-                               SCAN_eDebug("is scrambled!");
+                               SCAN_eDebugNoNewLine("is scrambled!");
                                is_crypted = true;
                        }
                        else
-                               SCAN_eDebug("is free");
+                               SCAN_eDebugNoNewLine("is free");
                }
+               SCAN_eDebugNoNewLine("\n");
 
                if (!(m_flags & scanOnlyFree) || !is_crypted)
                {
@@ -1342,24 +1342,24 @@ RESULT eDVBScan::processSDT(eDVBNamespace dvbnamespace, const ServiceDescription
                                        service->genSortName();
 
                                        service->m_provider_name = convertDVBUTF8(d.getServiceProviderName());
-                                       SCAN_eDebug("name '%s', provider_name '%s'", service->m_service_name.c_str(), service->m_provider_name.c_str());
+                                       SCAN_eDebug("  name '%s', provider_name '%s'", service->m_service_name.c_str(), service->m_provider_name.c_str());
                                        break;
                                }
                                case CA_IDENTIFIER_DESCRIPTOR:
                                {
                                        CaIdentifierDescriptor &d = (CaIdentifierDescriptor&)**desc;
                                        const CaSystemIdList &caids = *d.getCaSystemIds();
-                                       SCAN_eDebugNoNewLine("CA");
+                                       SCAN_eDebugNoNewLineStart("  CA");
                                        for (CaSystemIdList::const_iterator i(caids.begin()); i != caids.end(); ++i)
                                        {
                                                SCAN_eDebugNoNewLine(" %04x", *i);
                                                service->m_ca.push_front(*i);
                                        }
-                                       SCAN_eDebug(".");
+                                       SCAN_eDebugNoNewLine("\n");
                                        break;
                                }
                                default:
-                                       SCAN_eDebug("descr<%x>", (*desc)->getTag());
+                                       SCAN_eDebug("  descr<%x>", (*desc)->getTag());
                                        break;
                                }
                        }
index f0c0a04..4df14bf 100644 (file)
@@ -496,13 +496,13 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, const eDVB
                                }
 
 #if 0
-                               eDebugNoNewLine("sendmask: ");
+                               eDebugNoNewLineStart("sendmask: ");
                                for (int i=3; i >= 0; --i)
                                        if ( send_mask & (1<<i) )
                                                eDebugNoNewLine("1");
                                        else
                                                eDebugNoNewLine("0");
-                               eDebug("");
+                               eDebugNoNewLine("");
 #endif
                                if ( diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2
                                        && !sat.no_rotor_command_on_tune )
index f9246aa..6e80cdf 100644 (file)
@@ -224,7 +224,7 @@ eDVBTeletextParser::eDVBTeletextParser(iDVBDemux *demux) : m_pid(-1)
        setPageAndMagazine(-1, -1, "und");
 
        if (demux->createPESReader(eApp, m_pes_reader))
-               eDebug("failed to create teletext subtitle PES reader!");
+               eDebug("TTX: failed to create teletext subtitle PES reader!");
        else
                m_pes_reader->connectRead(slot(*this, &eDVBTeletextParser::processData), m_read_connection);
 }
@@ -270,7 +270,7 @@ void eDVBTeletextParser::processPESPacket(uint8_t *pkt, int len)
 
                if (len < data_unit_length)
                {
-                       eDebug("data_unit_length > len");
+                       eDebug("TTX: PES data_unit_length > len");
                        break;
                }
 
@@ -363,7 +363,7 @@ void eDVBTeletextParser::processPESPacket(uint8_t *pkt, int len)
                                                        continue;
                                                }
                                                else
-                                                       eDebugNoNewLine("ignore unimplemented: ");
+                                                       eDebugNoNewLineStart("TTX: ignore unimplemented mode: ");
                                        }
                                        else //0..39 means column 0..39
                                        {
@@ -401,18 +401,17 @@ void eDVBTeletextParser::processPESPacket(uint8_t *pkt, int len)
                                                                        continue;
                                                                }
                                                                else
-                                                                       eDebugNoNewLine("ignore G2 char < 0x20: ");
+                                                                       eDebugNoNewLineStart("TTX: ignore G2 char < 0x20: ");
                                                        }
                                                        else
-                                                               eDebugNoNewLine("ignore unimplemented: ");
+                                                               eDebugNoNewLineStart("TTX: ignore unimplemented: ");
                                                }
                                                else
-                                                       eDebugNoNewLine("row is not selected.. ignore: ");
+                                                       eDebugNoNewLineStart("TTX: row is not selected.. ignore: ");
                                        }
-                                       eDebugNoNewLine("triplet = %08x(%s) ", val, get_bits(val, 18));
-                                       eDebugNoNewLine("address = %02x(%s) ", addr, get_bits(addr, 6));
-                                       eDebugNoNewLine("mode = %02x(%s) ", mode, get_bits(mode, 5));
-                                       eDebug("data = %02x(%s)", data, get_bits(data, 7));
+                                       eDebugNoNewLine("triplet = %08x(%s) address = %02x(%s) mode = %02x(%s) data = %02x(%s)\n",
+                                                       val, get_bits(val, 18), addr, get_bits(addr, 6),
+                                                       mode, get_bits(mode, 5), data, get_bits(data, 7));
                                }
                        }
                }
@@ -426,10 +425,10 @@ void eDVBTeletextParser::processPESPacket(uint8_t *pkt, int len)
                                if ((m_M29_t1 & 0xF) == 0) // format1
                                        m_M29_0_valid = 1;
                                else
-                                       eDebug("non handled packet M/%d/0 format %d", Y, m_M29_t1 & 0xF);
+                                       eDebug("TTX: non handled packet M/%d/0 format %d", Y, m_M29_t1 & 0xF);
                        }
                        else
-                               eDebug("non handled packet M/%d/%d", Y, designation_code);
+                               eDebug("TTX: non handled packet M/%d/%d", Y, designation_code);
                }
                else if (m_page_open && M == m_page_M)
                {
@@ -441,10 +440,10 @@ void eDVBTeletextParser::processPESPacket(uint8_t *pkt, int len)
                                if ((m_X28_t1 & 0xF) == 0) // format1
                                        m_X28_0_valid = 1;
                                else
-                                       eDebug("non handled packet X/%d/0 format %d", Y, m_X28_t1 & 0xF);
+                                       eDebug("TTX: non handled packet X/%d/0 format %d", Y, m_X28_t1 & 0xF);
                        }
                        else
-                               eDebug("non handled packet X/%d/%d", Y, designation_code);
+                               eDebug("TTX: non handled packet X/%d/%d", Y, designation_code);
                }
        }
 }
@@ -557,7 +556,7 @@ void eDVBTeletextParser::handleLine(unsigned char *data, int len)
                        else if (b == 0xb)  // open box
                                ++m_box_open;
                        else
-                               eDebug("[ignore %x]", b);
+                               eDebug("TTX: [ignore %x]", b);
                                /* ignore other attributes */
                }
                else
@@ -632,9 +631,9 @@ void eDVBTeletextParser::setPageAndMagazine(int page, int magazine, const char *
        }
 
        if (page > 0)
-               eDebug("enable teletext subtitle page %x%02x (%s)%d", magazine, page, lang, m_L);
+               eDebug("TTX: enable teletext subtitle page %x%02x (%s)%d", magazine, page, lang, m_L);
        else
-               eDebug("disable teletext subtitles page %x%02x (%s)", magazine, page, lang);
+               eDebug("TTX: disable teletext subtitles page %x%02x (%s)", magazine, page, lang);
        m_M29_0_valid = 0;
        m_X28_0_valid = 0;
        m_page_M = magazine; /* magazine to look for */
index 23e9d8f..56ad5e6 100644 (file)
@@ -34,7 +34,7 @@ eDVBCIInterfaces::eDVBCIInterfaces()
 
        instance = this;
 
-       eDebug("scanning for common interfaces..");
+       eDebug("[CI] scanning for common interfaces..");
 
        while (1)
        {
@@ -67,7 +67,7 @@ eDVBCIInterfaces::eDVBCIInterfaces()
                setInputSource(1, TUNER_B);
        }
 
-       eDebug("done, found %d common interface slots", num_ci);
+       eDebug("[CI] done, found %d common interface slots", num_ci);
 }
 
 eDVBCIInterfaces::~eDVBCIInterfaces()
@@ -85,7 +85,7 @@ eDVBCISlot *eDVBCIInterfaces::getSlot(int slotid)
                if(i->getSlotID() == slotid)
                        return i;
 
-       eDebug("FIXME: request for unknown slot");
+       eDebug("[CI] FIXME: request for unknown slot");
 
        return 0;
 }
@@ -200,7 +200,7 @@ void eDVBCIInterfaces::ciRemoved(eDVBCISlot *slot)
 {
        if (slot->use_count)
        {
-               eDebug("CI Slot %d: removed... usecount %d", slot->getSlotID(), slot->use_count);
+               eDebug("[CI] Slot %d: removed... usecount %d", slot->getSlotID(), slot->use_count);
                for (PMTHandlerList::iterator it(m_pmt_handlers.begin());
                        it != m_pmt_handlers.end(); ++it)
                {
@@ -251,7 +251,7 @@ static bool canDescrambleMultipleServices(int slotid)
 
 void eDVBCIInterfaces::recheckPMTHandlers()
 {
-       eDebugCI("recheckPMTHAndlers()");
+       eDebugCI("[CI] recheckPMTHAndlers()");
        for (PMTHandlerList::iterator it(m_pmt_handlers.begin());
                it != m_pmt_handlers.end(); ++it)
        {
@@ -266,11 +266,11 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                pmthandler->getServiceReference(ref);
                pmthandler->getService(service);
 
-               eDebugCI("recheck %p %s", pmthandler, ref.toString().c_str());
+               eDebugCI("[CI] recheck %p %s", pmthandler, ref.toString().c_str());
                for (eSmartPtrList<eDVBCISlot>::iterator ci_it(m_slots.begin()); ci_it != m_slots.end(); ++ci_it)
                        if (ci_it->plugged && ci_it->getCAManager())
                        {
-                               eDebug("Slot %d plugged", ci_it->getSlotID());
+                               eDebug("[CI] Slot %d plugged", ci_it->getSlotID());
                                ci_it->plugged = false;
                                plugged_cis_exist = true;
                        }
@@ -286,7 +286,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                        }
                        if (tmp) // we dont like to change tsmux for running services
                        {
-                               eDebugCI("already assigned and running CI!\n");
+                               eDebugCI("[CI] already assigned and running CI!\n");
                                continue;
                        }
                }
@@ -309,7 +309,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
 
                for (eSmartPtrList<eDVBCISlot>::iterator ci_it(m_slots.begin()); ci_it != m_slots.end(); ++ci_it)
                {
-                       eDebugCI("check Slot %d", ci_it->getSlotID());
+                       eDebugCI("[CI] check Slot %d", ci_it->getSlotID());
                        bool useThis=false;
                        bool user_mapped=true;
                        eDVBCICAManagerSession *ca_manager = ci_it->getCAManager();
@@ -323,7 +323,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                        serviceSet::iterator it = ci_it->possible_services.find(ref);
                                        if (it != ci_it->possible_services.end())
                                        {
-                                               eDebug("'%s' is in service list of slot %d... so use it", ref.toString().c_str(), ci_it->getSlotID());
+                                               eDebug("[CI] '%s' is in service list of slot %d... so use it", ref.toString().c_str(), ci_it->getSlotID());
                                                useThis = true;
                                        }
                                        else // check parent
@@ -334,7 +334,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                        it = ci_it->possible_services.find(ref);
                                                        if (it != ci_it->possible_services.end())
                                                        {
-                                                               eDebug("parent '%s' of '%s' is in service list of slot %d... so use it",
+                                                               eDebug("[CI] parent '%s' of '%s' is in service list of slot %d... so use it",
                                                                        parent_ref.toString().c_str(), ref.toString().c_str(), ci_it->getSlotID());
                                                                useThis = true;
                                                        }
@@ -355,7 +355,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                providerSet::iterator it = ci_it->possible_providers.find(providerPair(service->m_provider_name, ns.get()));
                                                if (it != ci_it->possible_providers.end())
                                                {
-                                                       eDebug("'%s/%08x' is in provider list of slot %d... so use it", service->m_provider_name.c_str(), ns.get(), ci_it->getSlotID());
+                                                       eDebug("[CI] '%s/%08x' is in provider list of slot %d... so use it", service->m_provider_name.c_str(), ns.get(), ci_it->getSlotID());
                                                        useThis = true;
                                                }
                                        }
@@ -368,7 +368,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                caidSet::iterator it = ci_it->possible_caids.find(*ca);
                                                if (it != ci_it->possible_caids.end())
                                                {
-                                                       eDebug("caid '%04x' is in caid list of slot %d... so use it", *ca, ci_it->getSlotID());
+                                                       eDebug("[CI] caid '%04x' is in caid list of slot %d... so use it", *ca, ci_it->getSlotID());
                                                        useThis = true;
                                                        break;
                                                }
@@ -383,7 +383,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                        std::lower_bound(ci_caids.begin(), ci_caids.end(), *ca);
                                                if ( z != ci_caids.end() && *z == *ca )
                                                {
-                                                       eDebug("The CI in Slot %d has said it can handle caid %04x... so use it", ci_it->getSlotID(), *z);
+                                                       eDebug("[CI] The CI in Slot %d has said it can handle caid %04x... so use it", ci_it->getSlotID(), *z);
                                                        useThis = true;
                                                        user_mapped = false;
                                                        break;
@@ -404,10 +404,10 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                }
                                if (tmp) // ignore already assigned cislots...
                                {
-                                       eDebugCI("already assigned!");
+                                       eDebugCI("[CI] already assigned!");
                                        continue;
                                }
-                               eDebugCI("current slot %d usecount %d", ci_it->getSlotID(), ci_it->use_count);
+                               eDebugCI("[CI] current slot %d usecount %d", ci_it->getSlotID(), ci_it->use_count);
                                if (ci_it->use_count)  // check if this CI can descramble more than one service
                                {
                                        bool found = false;
@@ -415,39 +415,39 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                        PMTHandlerList::iterator tmp = m_pmt_handlers.begin();
                                        while (!found && tmp != m_pmt_handlers.end())
                                        {
-                                               eDebugCI(".");
+                                               eDebugCI("[CI] .");
                                                eDVBCISlot *tmp_cislot = tmp->cislot;
                                                while (!found && tmp_cislot)
                                                {
-                                                       eDebugCI("..");
+                                                       eDebugCI("[CI] ..");
                                                        eServiceReferenceDVB ref2;
                                                        tmp->pmthandler->getServiceReference(ref2);
                                                        if ( tmp_cislot == ci_it && it->pmthandler != tmp->pmthandler )
                                                        {
-                                                               eDebugCI("check pmthandler %s for same service/tp", ref2.toString().c_str());
+                                                               eDebugCI("[CI] check pmthandler %s for same service/tp", ref2.toString().c_str());
                                                                eDVBChannelID s1, s2;
                                                                if (ref != ref2)
                                                                {
-                                                                       eDebugCI("different services!");
+                                                                       eDebugCI("[CI] different services!");
                                                                        ref.getChannelID(s1);
                                                                        ref2.getChannelID(s2);
                                                                }
                                                                if (ref == ref2 || (s1 == s2 && canDescrambleMultipleServices(tmp_cislot->getSlotID())))
                                                                {
                                                                        found = true;
-                                                                       eDebugCI("found!");
+                                                                       eDebugCI("[CI] found!");
                                                                        eDVBCISlot *tmpci = it->cislot = tmp->cislot;
                                                                        while(tmpci)
                                                                        {
                                                                                ++tmpci->use_count;
-                                                                               eDebug("(2)CISlot %d, usecount now %d", tmpci->getSlotID(), tmpci->use_count);
+                                                                               eDebug("[CI] (2)CISlot %d, usecount now %d", tmpci->getSlotID(), tmpci->use_count);
                                                                                tmpci=tmpci->linked_next;
                                                                        }
                                                                }
                                                        }
                                                        tmp_cislot=tmp_cislot->linked_next;
                                                }
-                                               eDebugCI("...");
+                                               eDebugCI("[CI] ...");
                                                ++tmp;
                                        }
                                }
@@ -456,12 +456,12 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                {
                                        if (ci_it->user_mapped)  // we dont like to link user mapped CIs
                                        {
-                                               eDebugCI("user mapped CI already in use... dont link!");
+                                               eDebugCI("[CI] user mapped CI already in use... dont link!");
                                                continue;
                                        }
 
                                        ++ci_it->use_count;
-                                       eDebug("(1)CISlot %d, usecount now %d", ci_it->getSlotID(), ci_it->use_count);
+                                       eDebug("[CI] (1)Slot %d, usecount now %d", ci_it->getSlotID(), ci_it->use_count);
 
                                        data_source ci_source=CI_A;
                                        switch(ci_it->getSlotID())
@@ -471,7 +471,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                case 2: ci_source = CI_C; break;
                                                case 3: ci_source = CI_D; break;
                                                default:
-                                                       eDebug("try to get source for CI %d!!\n", ci_it->getSlotID());
+                                                       eDebug("[CI] try to get source for CI %d!!\n", ci_it->getSlotID());
                                                        break;
                                        }
 
@@ -497,7 +497,7 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                        case 2: tuner_source = TUNER_C; break;
                                                        case 3: tuner_source = TUNER_D; break;
                                                        default:
-                                                               eDebug("try to get source for tuner %d!!\n", tunernum);
+                                                               eDebug("[CI] try to get source for tuner %d!!\n", tunernum);
                                                                break;
                                                }
                                                ci_it->current_tuner = tunernum;
@@ -512,13 +512,13 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                                                ci_it->linked_next->setSource(ci_source);
                                        }
                                        it->cislot = ci_it;
-                                       eDebugCI("assigned!");
+                                       eDebugCI("[CI] assigned!");
                                        gotPMT(pmthandler);
                                }
 
                                if (it->cislot && user_mapped) // CI assigned to this pmthandler in this run.. and user mapped? then we break here.. we dont like to link other CIs to user mapped CIs
                                {
-                                       eDebugCI("user mapped CI assigned... dont link CIs!");
+                                       eDebugCI("[CI] user mapped CI assigned... dont link CIs!");
                                        break;
                                }
                        }
@@ -608,7 +608,7 @@ void eDVBCIInterfaces::removePMTHandler(eDVBServicePMTHandler *pmthandler)
                                slot->linked_next = 0;
                                slot->user_mapped = false;
                        }
-                       eDebug("(3) slot %d usecount is now %d", slot->getSlotID(), slot->use_count);
+                       eDebug("[CI] (3) slot %d usecount is now %d", slot->getSlotID(), slot->use_count);
                        slot = next;
                }
                // check if another service is waiting for the CI
@@ -625,7 +625,7 @@ void eDVBCIInterfaces::gotPMT(eDVBServicePMTHandler *pmthandler)
                eDVBCISlot *tmp = it->cislot;
                while(tmp)
                {
-                       eDebugCI("check slot %d %d %d", tmp->getSlotID(), tmp->running_services.empty(), canDescrambleMultipleServices(tmp->getSlotID()));
+                       eDebugCI("[CI] check slot %d %d %d", tmp->getSlotID(), tmp->running_services.empty(), canDescrambleMultipleServices(tmp->getSlotID()));
                        if (tmp->running_services.empty() || canDescrambleMultipleServices(tmp->getSlotID()))
                                tmp->sendCAPMT(pmthandler);
                        tmp = tmp->linked_next;
@@ -645,7 +645,7 @@ int eDVBCIInterfaces::getMMIState(int slotid)
 
 int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
 {
-//     eDebug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+//     eDebug("[CI] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
 //     eDebug("eDVBCIInterfaces::setInputSource(%d %d)", tuner_no, (int)source);
        if (getNumOfSlots() > 1) // FIXME .. we force DM8000 when more than one CI Slot is avail
        {
@@ -654,12 +654,12 @@ int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
 
                FILE *input=0;
                if((input = fopen(buf, "wb")) == NULL) {
-                       eDebug("cannot open %s", buf);
+                       eDebug("[CI] cannot open %s", buf);
                        return 0;
                }
 
                if (tuner_no > 3)
-                       eDebug("setInputSource(%d, %d) failed... dm8000 just have four inputs", tuner_no, (int)source);
+                       eDebug("[CI] setInputSource(%d, %d) failed... dm8000 just have four inputs", tuner_no, (int)source);
 
                switch(source)
                {
@@ -688,7 +688,7 @@ int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
                                fprintf(input, "D");
                                break;
                        default:
-                               eDebug("setInputSource for input %d failed!!!\n", (int)source);
+                               eDebug("[CI] setInputSource for input %d failed!!!\n", (int)source);
                                break;
                }
 
@@ -700,11 +700,11 @@ int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
                snprintf(buf, 64, "/proc/stb/tsmux/input%d", tuner_no);
 
                if (tuner_no > 1)
-                       eDebug("setInputSource(%d, %d) failed... dm7025 just have two inputs", tuner_no, (int)source);
+                       eDebug("[CI] setInputSource(%d, %d) failed... dm7025 just have two inputs", tuner_no, (int)source);
 
                FILE *input=0;
                if((input = fopen(buf, "wb")) == NULL) {
-                       eDebug("cannot open %s", buf);
+                       eDebug("[CI] cannot open %s", buf);
                        return 0;
                }
 
@@ -720,13 +720,13 @@ int eDVBCIInterfaces::setInputSource(int tuner_no, data_source source)
                                fprintf(input, "B");
                                break;
                        default:
-                               eDebug("setInputSource for input %d failed!!!\n", (int)source);
+                               eDebug("[CI] setInputSource for input %d failed!!!\n", (int)source);
                                break;
                }
 
                fclose(input);
        }
-       eDebug("eDVBCIInterfaces->setInputSource(%d, %d)", tuner_no, (int)source);
+       eDebug("[CI] eDVBCIInterfaces->setInputSource(%d, %d)", tuner_no, (int)source);
        return 0;
 }
 
@@ -842,7 +842,7 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject)
                if (ref.valid())
                        slot->possible_services.insert(ref);
                else
-                       eDebug("eDVBCIInterfaces::setDescrambleRules '%s' is not a valid service reference... ignore!!", tmpstr);
+                       eDebug("[CI] eDVBCIInterfaces::setDescrambleRules '%s' is not a valid service reference... ignore!!", tmpstr);
        };
        size = PyList_Size(provider_list);
        while(size)
@@ -882,7 +882,7 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject)
                if (strlen(tmpstr))
                        slot->possible_providers.insert(std::pair<std::string, uint32_t>(tmpstr, orbpos));
                else
-                       eDebug("eDVBCIInterfaces::setDescrambleRules ignore invalid entry in provider tuple (string is empty)!!");
+                       eDebug("[CI] eDVBCIInterfaces::setDescrambleRules ignore invalid entry in provider tuple (string is empty)!!");
        };
        size = PyList_Size(caid_list);
        while(size)
@@ -900,7 +900,7 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject)
                if (tmpcaid > 0 && tmpcaid < 0x10000)
                        slot->possible_caids.insert(tmpcaid);
                else
-                       eDebug("eDVBCIInterfaces::setDescrambleRules %d is not a valid caid... ignore!!", tmpcaid);
+                       eDebug("[CI] eDVBCIInterfaces::setDescrambleRules %d is not a valid caid... ignore!!", tmpcaid);
        };
        return 0;
 }
@@ -942,10 +942,10 @@ int eDVBCISlot::send(const unsigned char *data, size_t len)
 {
        int res=0;
        //int i;
-       //eDebugNoNewLine("< ");
+       //eDebugNoNewLineStart("< ");
        //for(i=0;i<len;i++)
        //      eDebugNoNewLine("%02x ",data[i]);
-       //eDebug("");
+       //eDebugNoNewLine("\n");
 
        if (sendqueue.empty())
                res = ::write(fd, data, len);
@@ -963,7 +963,7 @@ int eDVBCISlot::send(const unsigned char *data, size_t len)
 
 void eDVBCISlot::data(int what)
 {
-       eDebugCI("CISlot %d what %d\n", getSlotID(), what);
+       eDebugCI("[CI] Slot %d what %d\n", getSlotID(), what);
        if(what == eSocketNotifier::Priority) {
                if(state != stateRemoved) {
                        state = stateRemoved;
@@ -984,7 +984,7 @@ void eDVBCISlot::data(int what)
                reset();
 
        if(state != stateInserted) {
-               eDebug("ci inserted in slot %d", getSlotID());
+               eDebug("[CI] ci inserted in slot %d", getSlotID());
                state = stateInserted;
                eDVBCI_UI::getInstance()->setState(getSlotID(),1);
                notifier->setRequested(eSocketNotifier::Read|eSocketNotifier::Priority);
@@ -997,10 +997,10 @@ void eDVBCISlot::data(int what)
                r = ::read(fd, data, 4096);
                if(r > 0) {
 //                     int i;
-//                     eDebugNoNewLine("> ");
+//                     eDebugNoNewLineStart("> ");
 //                     for(i=0;i<r;i++)
 //                             eDebugNoNewLine("%02x ",data[i]);
-//                     eDebug("");
+//                     eDebugNoNewLine("\n");
                        eDVBCISession::receiveData(this, data, r);
                        eDVBCISession::pollAll();
                        return;
@@ -1045,7 +1045,7 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
 
        fd = ::open(filename, O_RDWR | O_NONBLOCK | O_CLOEXEC);
 
-       eDebugCI("CI Slot %d has fd %d", getSlotID(), fd);
+       eDebugCI("[CI] Slot %d has fd %d", getSlotID(), fd);
        state = stateInvalid;
 
        if (fd >= 0)
@@ -1085,12 +1085,12 @@ int eDVBCISlot::getSlotID()
 
 int eDVBCISlot::reset()
 {
-       eDebug("CI Slot %d: reset requested", getSlotID());
+       eDebug("[CI] Slot %d: reset requested", getSlotID());
 
        if (state == stateInvalid)
        {
                unsigned char buf[256];
-               eDebug("ci flush");
+               eDebug("[CI] flush");
                while(::read(fd, buf, 256)>0);
                state = stateResetted;
        }
@@ -1108,7 +1108,7 @@ int eDVBCISlot::reset()
 
 int eDVBCISlot::startMMI()
 {
-       eDebug("CI Slot %d: startMMI()", getSlotID());
+       eDebug("[CI] Slot %d: startMMI()", getSlotID());
 
        if(application_manager)
                application_manager->startMMI();
@@ -1118,7 +1118,7 @@ int eDVBCISlot::startMMI()
 
 int eDVBCISlot::stopMMI()
 {
-       eDebug("CI Slot %d: stopMMI()", getSlotID());
+       eDebug("[CI] Slot %d: stopMMI()", getSlotID());
 
        if(mmi_session)
                mmi_session->stopMMI();
@@ -1128,7 +1128,7 @@ int eDVBCISlot::stopMMI()
 
 int eDVBCISlot::answerText(int answer)
 {
-       eDebug("CI Slot %d: answerText(%d)", getSlotID(), answer);
+       eDebug("[CI] Slot %d: answerText(%d)", getSlotID(), answer);
 
        if(mmi_session)
                mmi_session->answerText(answer);
@@ -1146,7 +1146,7 @@ int eDVBCISlot::getMMIState()
 
 int eDVBCISlot::answerEnq(char *value)
 {
-       eDebug("CI Slot %d: answerENQ(%s)", getSlotID(), value);
+       eDebug("[CI] Slot %d: answerENQ(%s)", getSlotID(), value);
 
        if(mmi_session)
                mmi_session->answerEnq(value);
@@ -1156,7 +1156,7 @@ int eDVBCISlot::answerEnq(char *value)
 
 int eDVBCISlot::cancelEnq()
 {
-       eDebug("CI Slot %d: cancelENQ", getSlotID());
+       eDebug("[CI] Slot %d: cancelENQ", getSlotID());
 
        if(mmi_session)
                mmi_session->cancelEnq();
@@ -1168,7 +1168,7 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector<u
 {
        if (!ca_manager)
        {
-               eDebug("no ca_manager (no CI plugged?)");
+               eDebug("[CI] no ca_manager (no CI plugged?)");
                return -1;
        }
        const std::vector<uint16_t> &caids = ids.empty() ? ca_manager->getCAIDs() : ids;
@@ -1192,7 +1192,7 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector<u
                        (pmt_version == it->second) &&
                        !sendEmpty )
                {
-                       eDebug("[eDVBCISlot] dont send self capmt version twice");
+                       eDebug("[CI] [eDVBCISlot] dont send self capmt version twice");
                        return -1;
                }
 
@@ -1203,7 +1203,7 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector<u
                {
                        unsigned char raw_data[2048];
 
-//                     eDebug("send %s capmt for service %04x to slot %d",
+//                     eDebug("[CI] send %s capmt for service %04x to slot %d",
 //                             it != running_services.end() ? "UPDATE" : running_services.empty() ? "ONLY" : "ADD",
 //                             program_number, slotid);
 
@@ -1211,7 +1211,7 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector<u
                                it != running_services.end() ? 0x05 /*update*/ : running_services.empty() ? 0x03 /*only*/ : 0x04 /*add*/, 0x01, caids );
                        while( i != ptr->getSections().end() )
                        {
-               //                      eDebug("append");
+               //                      eDebug("[CI] append");
                                capmt.append(*i++);
                        }
                        capmt.writeToBuffer(raw_data);
@@ -1239,18 +1239,18 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector<u
 
                        if (sendEmpty)
                        {
-//                             eDebugNoNewLine("SEND EMPTY CAPMT.. old version is %02x", raw_data[hlen+3]);
+//                             eDebugNoNewLineStart("[CI[ SEND EMPTY CAPMT.. old version is %02x", raw_data[hlen+3]);
                                if (sendEmpty && running_services.size() == 1)  // check if this is the capmt for the last running service
                                        raw_data[hlen] = 0x03; // send only instead of update... because of strange effects with alphacrypt
                                raw_data[hlen+3] &= ~0x3E;
                                raw_data[hlen+3] |= ((pmt_version+1) & 0x1F) << 1;
-//                             eDebug(" new version is %02x", raw_data[hlen+3]);
+//                             eDebugNoNewLine(" new version is %02x\n", raw_data[hlen+3]);
                        }
 
-//                     eDebug("ca_manager %p dump capmt:", ca_manager);
+//                     eDebugNoNewLineStart("[CI[ ca_manager %p dump capmt:", ca_manager);
 //                     for(int i=0;i<wp;i++)
 //                             eDebugNoNewLine("%02x ", raw_data[i]);
-//                     eDebug("");
+//                     eDebugNoNewLine("\n");
 
                        //dont need tag and lenfield
                        ca_manager->sendCAPMT(raw_data + hlen, wp - hlen);
@@ -1303,27 +1303,27 @@ int eDVBCISlot::setSource(data_source source)
                                fprintf(ci, "D");
                                break;
                        default:
-                               eDebug("CI Slot %d: setSource %d failed!!!\n", getSlotID(), (int)source);
+                               eDebug("[CI] Slot %d: setSource %d failed!!!\n", getSlotID(), (int)source);
                                break;
                }
                fclose(ci);
        }
        else // DM7025
        {
-//             eDebug("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-//             eDebug("eDVBCISlot::enableTS(%d %d)", enable, (int)source);
+//             eDebug("[CI] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+//             eDebug("[CI] eDVBCISlot::enableTS(%d %d)", enable, (int)source);
                FILE *ci = fopen("/proc/stb/tsmux/input2", "wb");
                if(ci == NULL) {
-                       eDebug("cannot open /proc/stb/tsmux/input2");
+                       eDebug("[CI] cannot open /proc/stb/tsmux/input2");
                        return 0;
                }
                if (source != TUNER_A && source != TUNER_B)
-                       eDebug("CI Slot %d: setSource %d failed!!!\n", getSlotID(), (int)source);
+                       eDebug("[CI] Slot %d: setSource %d failed!!!\n", getSlotID(), (int)source);
                else
                        fprintf(ci, "%s", source==TUNER_A ? "A" : "B");  // configure CI data source (TunerA, TunerB)
                fclose(ci);
        }
-       eDebug("CI Slot %d setSource(%d)", getSlotID(), (int)source);
+       eDebug("[CI] Slot %d setSource(%d)", getSlotID(), (int)source);
        return 0;
 }
 
index b3e9ca1..bec7fe0 100644 (file)
@@ -17,10 +17,10 @@ eDVBCIApplicationManagerSession::~eDVBCIApplicationManagerSession()
 
 int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
 {
-       eDebugNoNewLine("SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
+       eDebugNoNewLine("[CI AM] SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
        for (int i=0; i<len; i++)
                eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
 
        if ((tag[0]==0x9f) && (tag[1]==0x80))
        {
@@ -29,24 +29,24 @@ int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const
                case 0x21:
                {
                        int dl;
-                       eDebug("application info:");
-                       eDebug("  len: %d", len);
-                       eDebug("  application_type: %d", ((unsigned char*)data)[0]);
-                       eDebug("  application_manufacturer: %02x %02x", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
-                       eDebug("  manufacturer_code: %02x %02x", ((unsigned char*)data)[4],((unsigned char*)data)[3]);
-                       eDebugNoNewLine("  menu string: ");
+                       eDebug("[CI AM] application info:");
+                       eDebug("[CI AM]   len: %d", len);
+                       eDebug("[CI AM]   application_type: %d", ((unsigned char*)data)[0]);
+                       eDebug("[CI AM]   application_manufacturer: %02x %02x", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
+                       eDebug("[CI AM]   manufacturer_code: %02x %02x", ((unsigned char*)data)[4],((unsigned char*)data)[3]);
                        dl=((unsigned char*)data)[5];
                        if ((dl + 6) > len)
                        {
-                               eDebug("warning, invalid length (%d vs %d)", dl+6, len);
+                               eDebug("[CI AM] warning, invalid length (%d vs %d)", dl+6, len);
                                dl=len-6;
                        }
                        char str[dl + 1];
                        memcpy(str, ((char*)data) + 6, dl);
                        str[dl] = '\0';
+                       eDebugNoNewLine("[CI AM]   menu string: ");
                        for (int i = 0; i < dl; ++i)
                                eDebugNoNewLine("%c", ((unsigned char*)data)[i+6]);
-                       eDebug("");
+                       eDebugNoNewLine("\n");
 
                        eDVBCI_UI::getInstance()->setAppName(slot->getSlotID(), str);
 
@@ -54,7 +54,7 @@ int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const
                        break;
                }
                default:
-                       eDebug("unknown APDU tag 9F 80 %02x", tag[2]);
+                       eDebug("[CI AM] unknown APDU tag 9F 80 %02x", tag[2]);
                        break;
                }
        }
@@ -73,11 +73,11 @@ int eDVBCIApplicationManagerSession::doAction()
     return 1;
   }
   case stateFinal:
-    eDebug("in final state.");
+    eDebug("[CI AM] in final state.");
                wantmenu = 0;
     if (wantmenu)
     {
-      eDebug("wantmenu: sending Tenter_menu");
+      eDebug("[CI AM] wantmenu: sending Tenter_menu");
       const unsigned char tag[3]={0x9F, 0x80, 0x22};  // Tenter_menu
       sendAPDU(tag);
       wantmenu=0;
@@ -91,7 +91,7 @@ int eDVBCIApplicationManagerSession::doAction()
 
 int eDVBCIApplicationManagerSession::startMMI()
 {
-       eDebug("in appmanager -> startmmi()");
+       eDebug("[CI AM] in appmanager -> startmmi()");
        const unsigned char tag[3]={0x9F, 0x80, 0x22};  // Tenter_menu
        sendAPDU(tag);
        return 0;
index 42317b3..34e49cf 100644 (file)
@@ -16,28 +16,28 @@ eDVBCICAManagerSession::~eDVBCICAManagerSession()
 
 int eDVBCICAManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
 {
-       eDebugNoNewLine("SESSION(%d)/CA %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
+       eDebugNoNewLine("[CI CA] SESSION(%d)/CA %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
        for (int i=0; i<len; i++)
                eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
 
        if ((tag[0]==0x9f) && (tag[1]==0x80))
        {
                switch (tag[2])
                {
                case 0x31:
-                       eDebug("ca info:");
+                       eDebugNoNewLineStart("[CI CA]ca info:");
                        for (int i=0; i<len; i+=2)
                        {
                                eDebugNoNewLine("%04x ", (((const unsigned char*)data)[i]<<8)|(((const unsigned char*)data)[i+1]));
                                caids.push_back((((const unsigned char*)data)[i]<<8)|(((const unsigned char*)data)[i+1]));
                        }
                        std::sort(caids.begin(), caids.end());
-                       eDebug("");
+                       eDebugNoNewLine("\n");
                        eDVBCIInterfaces::getInstance()->recheckPMTHandlers();
                        break;
                default:
-                       eDebug("unknown APDU tag 9F 80 %02x", tag[2]);
+                       eDebug("[CI CA] unknown APDU tag 9F 80 %02x", tag[2]);
                        break;
                }
        }
@@ -56,7 +56,7 @@ int eDVBCICAManagerSession::doAction()
                return 0;
        }
        case stateFinal:
-               eDebug("stateFinal und action! kann doch garnicht sein ;)");
+               eDebug("[CI CA] stateFinal and action should not happen");
        default:
                return 0;
        }
index f2b8a5c..cfe2707 100644 (file)
@@ -5,10 +5,10 @@
 
 int eDVBCIDateTimeSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
 {
-       eDebugNoNewLine("SESSION(%d)/DATETIME %02x %02x %02x: ", session_nb, tag[0],tag[1], tag[2]);
+       eDebugNoNewLine("[CI DT] SESSION(%d)/DATETIME %02x %02x %02x: ", session_nb, tag[0],tag[1], tag[2]);
        for (int i=0; i<len; i++)
                eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
 
        if ((tag[0]==0x9f) && (tag[1]==0x84))
        {
@@ -19,7 +19,7 @@ int eDVBCIDateTimeSession::receivedAPDU(const unsigned char *tag,const void *dat
                        return 1;
                        break;
                default:
-                       eDebug("unknown APDU tag 9F 84 %02x", tag[2]);
+                       eDebug("[CI DT] unknown APDU tag 9F 84 %02x", tag[2]);
                        break;
                }
        }
@@ -40,7 +40,7 @@ int eDVBCIDateTimeSession::doAction()
                return 0;
        }
        case stateFinal:
-               eDebug("stateFinal und action! kann doch garnicht sein ;)");
+               eDebug("[CI DT] stateFinal and action should not happen");
        default:
                return 0;
        }
index 64006e6..0f85e91 100644 (file)
@@ -31,10 +31,10 @@ eDVBCIMMISession::~eDVBCIMMISession()
 
 int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
 {
-       eDebugNoNewLine("SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
+       eDebugNoNewLineStart("[CI MMI] SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
        for (int i=0; i<len; i++)
                eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
 
        if ((tag[0]==0x9f) && (tag[1]==0x88))
                if (eDVBCI_UI::getInstance()->processMMIData(slot->getSlotID(), tag, data, len) == 1)
@@ -81,7 +81,7 @@ int eDVBCIMMISession::doAction()
 
 int eDVBCIMMISession::stopMMI()
 {
-       eDebug("eDVBCIMMISession::stopMMI()");
+       eDebug("[CI MMI] eDVBCIMMISession::stopMMI()");
 
        unsigned char tag[]={0x9f, 0x88, 0x00};
        unsigned char data[]={0x00};
@@ -92,7 +92,7 @@ int eDVBCIMMISession::stopMMI()
 
 int eDVBCIMMISession::answerText(int answer)
 {
-       eDebug("eDVBCIMMISession::answerText(%d)",answer);
+       eDebug("[CI MMI] eDVBCIMMISession::answerText(%d)",answer);
 
        unsigned char tag[]={0x9f, 0x88, 0x0B};
        unsigned char data[]={0x00};
@@ -105,7 +105,7 @@ int eDVBCIMMISession::answerText(int answer)
 int eDVBCIMMISession::answerEnq(char *answer)
 {
        unsigned int len = strlen(answer);
-       eDebug("eDVBCIMMISession::answerEnq(%d bytes)", len);
+       eDebug("[CI MMI] eDVBCIMMISession::answerEnq(%d bytes)", len);
 
        unsigned char data[len+1];
        data[0] = 0x01; // answer ok
@@ -119,7 +119,7 @@ int eDVBCIMMISession::answerEnq(char *answer)
 
 int eDVBCIMMISession::cancelEnq()
 {
-       eDebug("eDVBCIMMISession::cancelEnq()");
+       eDebug("[CI MMI] eDVBCIMMISession::cancelEnq()");
 
        unsigned char tag[]={0x9f, 0x88, 0x08};
        unsigned char data[]={0x00}; // canceled
index 5590f22..098a446 100644 (file)
@@ -5,26 +5,27 @@
 
 int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
 {
-       eDebugNoNewLine("SESSION(%d) %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
+       eDebugNoNewLineStart("[CI] SESSION(%d) %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
        for (int i=0; i<len; i++)
                eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
        if ((tag[0]==0x9f) && (tag[1]==0x80))
        {
                switch (tag[2])
                {
                case 0x10:  // profile enquiry
-                       eDebug("cam fragt was ich kann.");
+                       eDebug("[CI] cam profile inquiry");
                        state=stateProfileEnquiry;
                        return 1;
                        break;
                case 0x11: // Tprofile
-                       eDebugNoNewLine("mein cam kann: ");
+                       eDebugNoNewLineStart("[CI] can do: ");
                        if (!len)
-                               eDebug("nichts");
+                               eDebugNoNewLine("nothing");
                        else
                                for (int i=0; i<len; i++)
                                        eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
+                       eDebugNoNewLine("\n");
 
                        if (state == stateFirstProfileEnquiry)
                        {
@@ -34,7 +35,7 @@ int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag,const vo
                        state=stateFinal;
                        break;
                default:
-                       eDebug("unknown APDU tag 9F 80 %02x", tag[2]);
+                       eDebug("[CI] unknown APDU tag 9F 80 %02x", tag[2]);
                }
        }
 
@@ -61,7 +62,7 @@ int eDVBCIResourceManagerSession::doAction()
        }
        case stateProfileChange:
        {
-               eDebug("bla kaputt");
+               eDebug("[CI] cannot deal with statProfileChange");
                break;
        }
        case stateProfileEnquiry:
@@ -82,7 +83,7 @@ int eDVBCIResourceManagerSession::doAction()
                return 0;
        }
        case stateFinal:
-               eDebug("stateFinal und action! kann doch garnicht sein ;)");
+               eDebug("[CI] stateFinal und action! kann doch garnicht sein ;)");
        default:
                break;
        }
index 3cbd2ec..16014fd 100644 (file)
@@ -31,7 +31,7 @@ int eDVBCISession::buildLengthField(unsigned char *pkt, int len)
                return 3;
        } else
        {
-               eDebug("too big length");
+               eDebug("[CI SESS] too big length");
                exit(0);
        }
 }
@@ -91,7 +91,7 @@ void eDVBCISession::sendOpenSessionResponse(eDVBCISlot *slot, unsigned char sess
 {
        char pkt[6];
        pkt[0]=session_status;
-       eDebug("sendOpenSessionResponse");
+       eDebug("[CI SESS] sendOpenSessionResponse");
        memcpy(pkt + 1, resource_identifier, 4);
        sendSPDU(slot, 0x92, pkt, 5, session_nb);
 }
@@ -101,14 +101,14 @@ void eDVBCISession::recvCreateSessionResponse(const unsigned char *data)
        status = data[0];
        state = stateStarted;
        action = 1;
-       eDebug("create Session Response, status %x", status);
+       eDebug("[CI SESS] create Session Response, status %x", status);
 }
 
 void eDVBCISession::recvCloseSessionRequest(const unsigned char *data)
 {
        state = stateInDeletion;
        action = 1;
-       eDebug("close Session Request");
+       eDebug("[CI SESS] close Session Request");
 }
 
 void eDVBCISession::deleteSessions(const eDVBCISlot *slot)
@@ -145,42 +145,42 @@ void eDVBCISession::createSession(eDVBCISlot *slot, const unsigned char *resourc
        {
        case 0x00010041:
                session=new eDVBCIResourceManagerSession;
-               eDebug("RESOURCE MANAGER");
+               eDebug("[CI SESS] RESOURCE MANAGER");
                break;
        case 0x00020041:
                session=new eDVBCIApplicationManagerSession(slot);
-               eDebug("APPLICATION MANAGER");
+               eDebug("[CI SESS] APPLICATION MANAGER");
                break;
        case 0x00030041:
                session = new eDVBCICAManagerSession(slot);
-               eDebug("CA MANAGER");
+               eDebug("[CI SESS] CA MANAGER");
                break;
        case 0x00240041:
                session=new eDVBCIDateTimeSession;
-               eDebug("DATE-TIME");
+               eDebug("[CI SESS] DATE-TIME");
                break;
        case 0x00400041:
                session = new eDVBCIMMISession(slot);
-               eDebug("MMI - create session");
+               eDebug("[CI SESS] MMI - create session");
                break;
        case 0x00100041:
 //             session=new eDVBCIAuthSession;
-               eDebug("AuthSession");
+               eDebug("[CI SESS] AuthSession");
 //             break;
        case 0x00200041:
        default:
-               eDebug("unknown resource type %02x %02x %02x %02x", resource_identifier[0], resource_identifier[1], resource_identifier[2],resource_identifier[3]);
+               eDebug("[CI SESS] unknown resource type %02x %02x %02x %02x", resource_identifier[0], resource_identifier[1], resource_identifier[2],resource_identifier[3]);
                session=0;
                status=0xF0;
        }
 
        if (!session)
        {
-               eDebug("unknown session.. expect crash");
+               eDebug("[CI SESS] unknown session.. expect crash");
                return;
        }
 
-       eDebug("new session nb %d %p", session_nb, &(*session));
+       eDebug("[CI SESS] new session nb %d %p", session_nb, &(*session));
        session->session_nb = session_nb;
 
        if (session)
@@ -225,11 +225,12 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size
        unsigned char tag = *pkt++;
        int llen, hlen;
 
-       eDebug("slot: %p",slot);
+       eDebug("[CI SESS] slot: %p",slot);
 
+       eDebugNoNewLineStart("[CI SESS]: ");
        for(unsigned int i=0;i<len;i++)
                eDebugNoNewLine("%02x ",ptr[i]);
-       eDebug("");
+       eDebugNoNewLine("\n");
 
        llen = parseLengthField(pkt, hlen);
        pkt += llen;
@@ -256,14 +257,14 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size
 
                if ((!session_nb) || (session_nb >= SLMS))
                {
-                       eDebug("PROTOCOL: illegal session number %x", session_nb);
+                       eDebug("[CI SESS] PROTOCOL: illegal session number %x", session_nb);
                        return;
                }
 
                session=sessions[session_nb-1];
                if (!session)
                {
-                       eDebug("PROTOCOL: data on closed session %x", session_nb);
+                       eDebug("[CI SESS] PROTOCOL: data on closed session %x", session_nb);
                        return;
                }
 
@@ -275,11 +276,11 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size
                        session->recvCreateSessionResponse(pkt);
                        break;
                case 0x95:
-                       eDebug("recvCloseSessionRequest");
+                       eDebug("[CI SESS] recvCloseSessionRequest");
                        session->recvCloseSessionRequest(pkt);
                        break;
                default:
-                       eDebug("INTERNAL: nyi, tag %02x.", tag);
+                       eDebug("[CI SESS] INTERNAL: nyi, tag %02x.", tag);
                        return;
                }
        }
@@ -304,7 +305,7 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size
                        {
                                if (((len-alen) > 0) && ((len - alen) < 3))
                                {
-                                       eDebug("WORKAROUND: applying work around MagicAPDULength");
+                                       eDebug("[CI SESS] WORKAROUND: applying work around MagicAPDULength");
                                        alen=len;
                                }
                        }
@@ -315,11 +316,11 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size
                }
 
        if (len)
-               eDebug("PROTOCOL: warning, TL-Data has invalid length");
+               eDebug("[CI SESS] PROTOCOL: warning, TL-Data has invalid length");
 }
 
 eDVBCISession::~eDVBCISession()
 {
-//     eDebug("destroy %p", this);
+//     eDebug("[CI SESS] destroy %p", this);
 }
 
index 611bbbb..18067f7 100644 (file)
@@ -63,9 +63,10 @@ static gLookup &getColor(const gPalette &pal, const gRGB &start, const gRGB &end
 //     eDebug("[FONT] creating new font color cache entry %02x%02x%02x%02x .. %02x%02x%02x%02x", start.a, start.r, start.g, start.b,
 //             end.a, end.r, end.g, end.b);
        n.build(16, pal, start, end);
+//     eDebugNoNewLine("[FONT] ");
 //     for (int i=0; i<16; i++)
 //             eDebugNoNewLine("%02x|%02x%02x%02x%02x ", (int)n.lookup[i], pal.data[n.lookup[i]].a, pal.data[n.lookup[i]].r, pal.data[n.lookup[i]].g, pal.data[n.lookup[i]].b);
-//     eDebug("");
+//     eDebugNoNewLine("\n");
        return n;
 }
 
@@ -94,7 +95,7 @@ FT_Error fontRenderClass::FTC_Face_Requester(FTC_FaceID       face_id, FT_Face* aface)
        int error;
        if ((error=FT_New_Face(library, font->filename.c_str(), 0, aface)))
        {
-               eDebug(" failed: %s", strerror(error));
+               eDebug("[FONT] failed: %s", strerror(error));
                return error;
        }
        FT_Select_Charmap(*aface, ft_encoding_unicode);
@@ -166,7 +167,7 @@ std::string fontRenderClass::AddFont(const std::string &filename, const std::str
        singleLock s(ftlock);
 
        if ((error=FT_New_Face(library, filename.c_str(), 0, &face)))
-               eFatal(" failed: %s", strerror(error));
+               eFatal("[FONT] failed: %s", strerror(error));
 
        n->filename=filename;
        n->face=name;
@@ -174,7 +175,7 @@ std::string fontRenderClass::AddFont(const std::string &filename, const std::str
        FT_Done_Face(face);
 
        n->next=font;
-       eDebug("OK (%s)", n->face.c_str());
+       eDebug("[FONT] OK (%s)", n->face.c_str());
        font=n;
 
        return n->face;
@@ -244,7 +245,7 @@ float fontRenderClass::getLineHeight(const gFont& font)
        if ((FTC_Manager_LookupFace(cacheManager, fnt->scaler.face_id, &current_face) < 0) ||
            (FTC_Manager_LookupSize(cacheManager, &fnt->scaler, &fnt->size) < 0))
        {
-               eDebug("FTC_Manager_Lookup_Size failed!");
+               eDebug("[FONT] FTC_Manager_Lookup_Size failed!");
                return 0;
        }
        int height = current_face->size->metrics.height;
@@ -537,7 +538,7 @@ void eTextPara::calc_bbox()
        }
        boundBox.setTop(area.y());
        boundBox.setBottom(area.y() + totalheight);
-//     eDebug("boundBox left = %i, top = %i, right = %i, bottom = %i", boundBox.left(), boundBox.top(), boundBox.right(), boundBox.bottom() );
+//     eDebug("[FONT] boundBox left = %i, top = %i, right = %i, bottom = %i", boundBox.left(), boundBox.top(), boundBox.right(), boundBox.bottom() );
 }
 
 void eTextPara::newLine(int flags)
@@ -601,7 +602,7 @@ void eTextPara::setFont(Font *fnt, Font *replacement)
                                            &replacement_font->scaler,
                                            &replacement_font->size) < 0))
                {
-                       eDebug("FTC_Manager_Lookup_Size failed!");
+                       eDebug("[FONT] FTC_Manager_Lookup_Size failed!");
                        return;
                }
        }
@@ -614,7 +615,7 @@ void eTextPara::setFont(Font *fnt, Font *replacement)
                                            &current_font->scaler,
                                            &current_font->size) < 0))
                {
-                       eDebug("FTC_Manager_Lookup_Size failed!");
+                       eDebug("[FONT] FTC_Manager_Lookup_Size failed!");
                        return;
                }
        }
@@ -668,7 +669,7 @@ int eTextPara::renderString(const char *string, int rflags, int border)
                                    &current_font->scaler,
                                    &current_font->size) < 0))
        {
-               eDebug("FTC_Manager_Lookup_Size failed!");
+               eDebug("[FONT] FTC_Manager_Lookup_Size failed!");
                return -1;
        }
 
@@ -848,7 +849,7 @@ nprint:                             isprintable=0;
                                        index=(rflags&RS_DIRECT)? chr : FT_Get_Char_Index(replacement_face, chr);
 
                                if (!index)
-                                       eDebug("unicode U+%4lx not present", chr);
+                                       eDebug("[FONT] unicode U+%4lx not present", chr);
                                else
                                        appendGlyph(replacement_font, replacement_face, index, flags, rflags, border, i == uc_visual.end() - 1, activate_newcolor, newcolor);
                        } else
@@ -888,7 +889,7 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
                                    &current_font->scaler,
                                    &current_font->size) < 0))
        {
-               eDebug("FTC_Manager_Lookup_Size failed!");
+               eDebug("[FONT] FTC_Manager_Lookup_Size failed!");
                return;
        }
 
index dde9974..5a9195f 100644 (file)
@@ -32,7 +32,7 @@ void eLCD::setSize(int xres, int yres, int bpp)
        _buffer=new unsigned char[xres * yres * bpp/8];
        memset(_buffer, 0, res.height()*res.width()*bpp/8);
        _stride=res.width()*bpp/8;
-       eDebug("lcd buffer %p %d bytes, stride %d", _buffer, xres*yres*bpp/8, _stride);
+       eDebug("[LCD] buffer %p %d bytes, stride %d", _buffer, xres*yres*bpp/8, _stride);
 }
 
 eLCD::~eLCD()
@@ -83,12 +83,12 @@ eDBoxLCD::eDBoxLCD()
                lcdfd = open("/dev/dbox/lcd0", O_RDWR);
        } else
        {
-               eDebug("found OLED display!");
+               eDebug("[LCD] found OLED display!");
                lcd_type = 1;
        }
 
        if (lcdfd < 0)
-               eDebug("couldn't open LCD - load lcd.ko!");
+               eDebug("[LCD] couldn't open LCD - load lcd.ko!");
        else
        {
 
@@ -171,14 +171,14 @@ int eDBoxLCD::setLCDContrast(int contrast)
 int eDBoxLCD::setLCDBrightness(int brightness)
 {
 #ifndef NO_LCD
-       eDebug("setLCDBrightness %d", brightness);
+       eDebug("[LCD] setLCDBrightness %d", brightness);
        FILE *f=fopen("/proc/stb/lcd/oled_brightness", "w");
        if (!f)
                f = fopen("/proc/stb/fp/oled_brightness", "w");
        if (f)
        {
                if (fprintf(f, "%d", brightness) == 0)
-                       eDebug("write /proc/stb/lcd/oled_brightness failed!! (%m)");
+                       eDebug("[LCD] write /proc/stb/lcd/oled_brightness failed!! (%m)");
                fclose(f);
        }
        else
index 70124f3..af5108d 100644 (file)
@@ -114,9 +114,10 @@ int eMMI_UI::processMMIData(int slot_id, const unsigned char *tag, const void *d
                        memcpy(str, ((char*)d), textlen);
                        str[textlen] = '\0';
                        mmiScreenAddText(slot_id, pos++, (char*)convertDVBUTF8(str).c_str());
+                       eDebugNoNewLineStart("");
                        while (textlen--)
                                eDebugNoNewLine("%c", *d++);
-                       eDebug("");
+                       eDebugNoNewLine("\n");
                }
                mmiScreenFinish(slot_id);
                break;
index 9d938b9..ce2ed3f 100644 (file)
@@ -2,6 +2,7 @@
 #include <asm/ioctls.h>
 #include <unistd.h>
 #include <errno.h>
+#include <time.h>
 #include <linux/serial.h>
 #include <lib/network/socket.h>
 
@@ -205,10 +206,13 @@ int eSocket::writeBlock(const char *data, unsigned int len)
        if (issocket && writebuffer.empty())
        {
                int tw=::send(getDescriptor(), data, len, MSG_NOSIGNAL);
-               if ((tw < 0) && (errno != EWOULDBLOCK))
+               if ((tw < 0) && (errno != EWOULDBLOCK)) {
        // don't use eDebug here because of a adaptive mutex in the eDebug call..
        // and eDebug self can cause a call of writeBlock !!
-                       printf("write: %m\n");
+                       struct timespec tp;
+                       clock_gettime(CLOCK_MONOTONIC, &tp);
+                       fprintf(stderr, "<%6lu.%06lu> write: %m\n", tp.tv_sec, tp.tv_nsec/1000);
+               }
                if (tw < 0)
                        tw = 0;
                data+=tw;
index 9a69de3..b7d0c78 100644 (file)
@@ -215,7 +215,7 @@ void eSocketMMIHandler::connDataAvail(int what)
                        name = new char[length + 1];
                        memcpy(name, &msgbuffer[4], length);
                        name[length] = '\0';
-                       eDebug("MMI NAME %s", name);
+                       eDebug("[eSocketMMIHandler] MMI NAME %s", name);
                } else {
                        int len = length;
                        unsigned char *data = (unsigned char*)msgbuffer;
@@ -232,14 +232,14 @@ void eSocketMMIHandler::connDataAvail(int what)
                        {
                                buffer.clear();
 #ifdef MMIDEBUG
-                               eDebug("clear buffer");
+                               eDebug("[eSocketMMIHandler] clear buffer");
 #endif
                        }
 #ifdef MMIDEBUG
-                       eDebug("Put to buffer:");
+                       eDebugNoNewLineStart("[eSocketMMIHandler] Put to buffer:");
                        for (int i=0; i < len; ++i)
                                eDebugNoNewLine("%02x ", data[i]);
-                       eDebug("\n--------");
+                       eDebugNoNewLine("\n--------\n");
 #endif
                        buffer.write( data, len );
 
@@ -251,7 +251,7 @@ void eSocketMMIHandler::connDataAvail(int what)
                                {
                                        buffer.skip(1);
 #ifdef MMIDEBUG
-                                       eDebug("skip %02x", tmp[0]);
+                                       eDebug("[eSocketMMIHandler] skip %02x", tmp[0]);
 #endif
                                        continue;
                                }
@@ -269,10 +269,10 @@ void eSocketMMIHandler::connDataAvail(int what)
                                        unsigned char dest[messageLength];
                                        buffer.read(dest, messageLength);
 #ifdef MMIDEBUG
-                                       eDebug("dump mmi:");
+                                       eDebugNoNewLineStart("[eSocketMMIHandler] dump mmi:");
                                        for (int i=0; i < messageLength; ++i)
                                                eDebugNoNewLine("%02x ", dest[i]);
-                                       eDebug("\n--------");
+                                       eDebugNoNewLine("\n--------\n");
 #endif
                                        /*emit*/ mmi_progress(0, dest, (const void*)(dest+3+LengthBytes), messageLength-3-LengthBytes);
                                }
@@ -281,7 +281,7 @@ void eSocketMMIHandler::connDataAvail(int what)
        }
 
        if (what & (POLLERR | POLLHUP)) {
-               eDebug("pollhup/pollerr");
+               eDebug("[eSocketMMIHandler] pollhup/pollerr");
                closeConn();
                /*emit*/ mmi_progress(0, (const unsigned char*)"\x9f\x88\x00", "\x00", 1);
        }
index 5198c57..e398773 100644 (file)
@@ -78,9 +78,9 @@ void eListboxServiceContent::setRoot(const eServiceReference &root, bool justSet
        ASSERT(m_service_center);
 
        if (m_service_center->list(m_root, m_lst))
-               eDebug("no list available!");
+               eDebug("eListboxServiceContent: no list available!");
        else if (m_lst->getContent(m_list))
-               eDebug("getContent failed");
+               eDebug("eListboxServiceContent: getContent failed");
 
        FillFinished();
 }
@@ -375,26 +375,26 @@ int eListboxServiceContent::setCurrentMarked(bool state)
                        {
                                ePtr<iMutableServiceList> list;
                                if (m_lst->startEdit(list))
-                                       eDebug("no editable list");
+                                       eDebug("eListboxServiceContent: no editable list");
                                else
                                {
                                        eServiceReference ref;
                                        getCurrent(ref);
                                        if(!ref)
-                                               eDebug("no valid service selected");
+                                               eDebug("eListboxServiceContent: no valid service selected");
                                        else
                                        {
                                                int pos = cursorGet();
-                                               eDebugNoNewLine("move %s to %d ", ref.toString().c_str(), pos);
+                                               eDebugNoNewLineStart("eListboxServiceContent: move %s to %d ", ref.toString().c_str(), pos);
                                                if (list->moveService(ref, cursorGet()))
-                                                       eDebug("failed");
+                                                       eDebugNoNewLine("failed\n");
                                                else
-                                                       eDebug("ok");
+                                                       eDebugNoNewLine("ok\n");
                                        }
                                }
                        }
                        else
-                               eDebug("no list available!");
+                               eDebug("eListboxServiceContent: no list available!");
                }
        }
 
index d4a9b3c..6539e39 100644 (file)
@@ -90,7 +90,7 @@ int eStaticServiceDVBInformation::isPlayable(const eServiceReference &ref, const
 {
        ePtr<eDVBResourceManager> res_mgr;
        if ( eDVBResourceManager::getInstance( res_mgr ) )
-               eDebug("isPlayable... no res manager!!");
+               eDebug("eStaticServiceDVBInformation: isPlayable... no res manager!!");
        else
        {
                eDVBChannelID chid, chid_ignore;
@@ -153,7 +153,7 @@ ePtr<iDVBTransponderData> eStaticServiceDVBInformation::getTransponderData(const
                                                                break;
                                                        }
                                                        default:
-                                                               eDebug("unknown frontend type %d", system);
+                                                               eDebug("eStaticServiceDVBInformation: unknown frontend type %d", system);
                                                                break;
                                                }
                                        }
@@ -521,11 +521,11 @@ RESULT eDVBPVRServiceOfflineOperations::deleteFromDisk(int simulate)
 
                eBackgroundFileEraser *eraser = eBackgroundFileEraser::getInstance();
                if (!eraser)
-                       eDebug("FATAL !! can't get background file eraser");
+                       eDebug("eDVBPVRServiceOfflineOperations::deleteFromDisk: FATAL !! can't get background file eraser");
 
                for (std::list<std::string>::iterator i(res.begin()); i != res.end(); ++i)
                {
-                       eDebug("Removing %s...", i->c_str());
+                       eDebug("eDVBPVRServiceOfflineOperations::deleteFromDisk: Removing %s...", i->c_str());
                        if (eraser)
                                eraser->erase(*i);
                        else
@@ -583,20 +583,20 @@ static int reindex_work(const std::string& filename)
                err = tstools.findPMT(program);
                if (err)
                {
-                       eDebug("reindex - Failed to find PMT");
+                       eDebug("eDVBPVRServiceOfflineOperations:: reindex - Failed to find PMT");
                        return err;
                }
                for (i = 0; i < program.videoStreams.size(); i++)
                {
                        if (timingpidset) break;
-                       eDebug("reindex: video pid=0x%x", program.videoStreams[i].pid);
+                       eDebug("eDVBPVRServiceOfflineOperations:: reindex: video pid=0x%x", program.videoStreams[i].pid);
                        parser.setPid(program.videoStreams[i].pid, iDVBTSRecorder::video_pid, program.videoStreams[i].type);
                        timingpidset = true;
                }
                for (i = 0; i < program.audioStreams.size(); i++)
                {
                        if (timingpidset) break;
-                       eDebug("reindex: audio pid=0x%x", program.audioStreams[i].pid);
+                       eDebug("eDVBPVRServiceOfflineOperations:: reindex: audio pid=0x%x", program.audioStreams[i].pid);
                        parser.setPid(program.audioStreams[i].pid, iDVBTSRecorder::audio_pid, program.audioStreams[i].type);
                        timingpidset = true;
                }
@@ -684,12 +684,12 @@ RESULT eDVBServiceList::startQuery()
        int err;
        if ((err = eDVBResourceManager::getInstance(res)) != 0)
        {
-               eDebug("no resource manager");
+               eDebug("eDVBServiceList: no resource manager");
                return err;
        }
        if ((err = res->getChannelList(db)) != 0)
        {
-               eDebug("no channel list");
+               eDebug("eDVBServiceList: no channel list");
                return err;
        }
 
@@ -700,14 +700,14 @@ RESULT eDVBServiceList::startQuery()
                eDVBChannelQuery::compile(q, m_parent.path);
                if (!q)
                {
-                       eDebug("compile query failed");
+                       eDebug("eDVBServiceList: compile query failed");
                        return err;
                }
        }
 
        if ((err = db->startQuery(m_query, q, m_parent)) != 0)
        {
-               eDebug("startQuery failed");
+               eDebug("eDVBServiceList: startQuery failed");
                return err;
        }
 
@@ -998,19 +998,19 @@ RESULT eServiceFactoryDVB::lookupService(ePtr<eDVBService> &service, const eServ
                int err;
                if ((err = eDVBResourceManager::getInstance(res)) != 0)
                {
-                       eDebug("no resource manager");
+                       eDebug("eServiceFactoryDVB: no resource manager");
                        return err;
                }
                if ((err = res->getChannelList(db)) != 0)
                {
-                       eDebug("no channel list");
+                       eDebug("eServiceFactoryDVB: no channel list");
                        return err;
                }
 
                /* we are sure to have a ..DVB reference as the info() call was forwarded here according to it's ID. */
                if ((err = db->getService((eServiceReferenceDVB&)ref, service)) != 0)
                {
-//                     eDebug("getService failed!");
+//                     eDebug("eServiceFactoryDVB: getService failed!");
                        return err;
                }
        }
@@ -1086,9 +1086,9 @@ void eDVBServicePlay::gotNewEvent(int error)
        getEvent(event_next, 1);
 
        if (event_now)
-               eDebug("now running: %s (%d seconds :)", event_now->m_event_name.c_str(), event_now->m_duration);
+               eDebug("eDVBServicePlay: now running: %s (%d seconds :)", event_now->m_event_name.c_str(), event_now->m_duration);
        if (event_next)
-               eDebug("next running: %s (%d seconds :)", event_next->m_event_name.c_str(), event_next->m_duration);
+               eDebug("eDVBServicePlay: next running: %s (%d seconds :)", event_next->m_event_name.c_str(), event_next->m_duration);
 #endif
        if (!error)
        {
@@ -1110,7 +1110,7 @@ void eDVBServicePlay::gotNewEvent(int error)
                if (m_record)
                {
                        if (m_record->getCurrentPCR(now_pts))
-                               eDebug("getting current PTS failed!");
+                               eDebug("eDVBServicePlay: getting current PTS failed!");
                        else
                        {
                                if (m_record->getFirstPTS(first_pts))
@@ -1121,7 +1121,7 @@ void eDVBServicePlay::gotNewEvent(int error)
                                        fixup_pts = now_pts - first_pts;
                                m_cue_entries.insert(cueEntry(fixup_pts, 2));
                                m_cuesheet_changed = 1;
-                               eDebug("pts of eit change: %llx, fixup_pts: %llx, first_pts: %llx", now_pts, fixup_pts, first_pts);
+                               eDebug("eDVBServicePlay: pts of eit change: %llx, fixup_pts: %llx, first_pts: %llx", now_pts, fixup_pts, first_pts);
                                m_event((iPlayableService*)this, evCuesheetChanged);
                        }
                }
@@ -1205,13 +1205,13 @@ void eDVBServicePlay::serviceEvent(int event)
        case eDVBServicePMTHandler::eventTuneFailed:
        case eDVBServicePMTHandler::eventMisconfiguration:
        {
-               eDebug("DVB service failed to tune - error %d", event);
+               eDebug("eDVBServicePlay: DVB service failed to tune - error %d", event);
                m_event((iPlayableService*)this, evTuneFailed);
                break;
        }
        case eDVBServicePMTHandler::eventNewProgramInfo:
        {
-               eDebug("eventNewProgramInfo %d %d", m_timeshift_enabled, m_timeshift_active);
+               eDebug("eDVBServicePlay: eventNewProgramInfo %d %d", m_timeshift_enabled, m_timeshift_active);
                if (m_timeshift_enabled)
                        updateTimeshiftPids();
                if (!m_timeshift_active)
@@ -1247,7 +1247,7 @@ void eDVBServicePlay::serviceEventTimeshift(int event)
        switch (event)
        {
        case eDVBServicePMTHandler::eventNewProgramInfo:
-               eDebug("eventNewProgramInfo TS");
+               eDebug("eDVBServicePlay: eventNewProgramInfo TS");
                if (m_timeshift_active)
                {
                        updateDecoder();
@@ -1255,12 +1255,12 @@ void eDVBServicePlay::serviceEventTimeshift(int event)
                        {
                                if (m_slowmotion)
                                {
-                                       eDebug("re-apply slowmotion after timeshift file change");
+                                       eDebug("eDVBServicePlay: re-apply slowmotion after timeshift file change");
                                        m_decoder->setSlowMotion(m_slowmotion);
                                }
                                if (m_fastforward)
                                {
-                                       eDebug("re-apply skip %d, ratio %d after timeshift file change", m_skipmode, m_fastforward);
+                                       eDebug("eDVBServicePlay: re-apply skip %d, ratio %d after timeshift file change", m_skipmode, m_fastforward);
                                        if (m_skipmode)
                                                m_cue->setSkipmode(m_skipmode * 90000); /* convert to 90000 per second */
                                        if (m_fastforward != 1)
@@ -1279,7 +1279,7 @@ void eDVBServicePlay::serviceEventTimeshift(int event)
 #if 0
                if (!m_timeshift_file_next.empty())
                {
-                       eDebug("timeshift SOF, switch to next file");
+                       eDebug("eDVBServicePlay: timeshift SOF, switch to next file");
                        m_decoder->pause();
 
                        m_first_program_info |= 2;
@@ -1307,12 +1307,12 @@ void eDVBServicePlay::serviceEventTimeshift(int event)
                {
                        if (m_timeshift_file_next.empty())
                        {
-                               eDebug("timeshift EOF, so let's go live");
+                               eDebug("eDVBServicePlay: timeshift EOF, so let's go live");
                                switchToLive();
                        }
                        else
                        {
-                               eDebug("timeshift EOF, switch to next file");
+                               eDebug("eDVBServicePlay: timeshift EOF, switch to next file");
 
                                m_first_program_info |= 2;
 
@@ -1554,7 +1554,7 @@ RESULT eDVBServicePlay::setFastForward_internal(int ratio, bool final_seek)
 
        if (m_skipmode != skipmode)
        {
-               eDebug("setting cue skipmode to %d", skipmode);
+               eDebug("eDVBServicePlay::setFastForward: setting cue skipmode to %d", skipmode);
                if (m_cue)
                        m_cue->setSkipmode(skipmode * 90000); /* convert to 90000 per second */
        }
@@ -1562,7 +1562,7 @@ RESULT eDVBServicePlay::setFastForward_internal(int ratio, bool final_seek)
        m_skipmode = skipmode;
 
        if (final_seek)
-               eDebug("trickplay stopped .. ret %d, pos %lld", getPlayPosition(pos), pos);
+               eDebug("eDVBServicePlay::setFastForward: trickplay stopped .. ret %d, pos %lld", getPlayPosition(pos), pos);
 
        m_fastforward = ffratio;
 
@@ -1577,7 +1577,7 @@ RESULT eDVBServicePlay::setFastForward_internal(int ratio, bool final_seek)
                ret = m_decoder->setTrickmode();
 
        if (pos)
-               eDebug("final seek after trickplay ret %d", seekTo(pos));
+               eDebug("eDVBServicePlay::setFastForward: final seek after trickplay ret %d", seekTo(pos));
 
        return ret;
 }
@@ -1758,7 +1758,7 @@ RESULT eDVBServicePlay::timeshift(ePtr<iTimeshiftService> &ptr)
                        std::string tspath = eConfigManager::getConfigValue("config.usage.timeshift_path");
                        if(tspath == "")
                        {
-                               eDebug("could not query ts path from config");
+                               eDebug("eDVBServicePlay::timeshift: could not query ts path from config");
                                return -4;
                        }
                        tspath.append("/");
@@ -1766,13 +1766,13 @@ RESULT eDVBServicePlay::timeshift(ePtr<iTimeshiftService> &ptr)
                        struct statfs fs;
                        if (statfs(tspath.c_str(), &fs) < 0)
                        {
-                               eDebug("statfs failed!");
+                               eDebug("eDVBServicePlay::timeshift: statfs failed!");
                                return -2;
                        }
 
                        if (((off_t)fs.f_bavail) * ((off_t)fs.f_bsize) < 200*1024*1024LL)
                        {
-                               eDebug("not enough diskspace for timeshift! (less than 200MB)");
+                               eDebug("eDVBServicePlay::timeshift: not enough diskspace for timeshift! (less than 200MB)");
                                return -3;
                        }
                }
@@ -2157,18 +2157,18 @@ int eDVBServicePlay::selectAudioStream(int i)
        }
 
        if (i != -1 && apid != m_current_audio_pid && (m_is_pvr || m_timeshift_active))
-               eDebug("getPlayPosition ret %d, pos %lld in selectAudioStream", getPlayPosition(position), position);
+               eDebug("eDVBServicePlay: getPlayPosition ret %d, pos %lld in selectAudioStream", getPlayPosition(position), position);
 
        m_current_audio_pid = apid;
 
        if (m_decoder->setAudioPID(apid, apidtype))
        {
-               eDebug("set audio pid failed");
+               eDebug("eDVBServicePlay: set audio pid failed");
                return -4;
        }
 
        if (position != -1)
-               eDebug("seekTo ret %d", seekTo(position));
+               eDebug("eDVBServicePlay: seekTo ret %d", seekTo(position));
 
        int rdsPid = apid;
 
@@ -2275,13 +2275,13 @@ void eDVBServicePlay::showRassSlidePicture()
                        if (rass_slide_pic.length())
                                m_decoder->showSinglePic(rass_slide_pic.c_str());
                        else
-                               eDebug("empty filename for rass slide picture received!!");
+                               eDebug("eDVBServicePlay: empty filename for rass slide picture received!!");
                }
                else
-                       eDebug("no MPEG Decoder to show iframes avail");
+                       eDebug("eDVBServicePlay: no MPEG Decoder to show iframes avail");
        }
        else
-               eDebug("showRassSlidePicture called.. but not decoder");
+               eDebug("eDVBServicePlay: showRassSlidePicture called.. but not decoder");
 }
 
 void eDVBServicePlay::showRassInteractivePic(int page, int subpage)
@@ -2294,13 +2294,13 @@ void eDVBServicePlay::showRassInteractivePic(int page, int subpage)
                        if (rass_interactive_pic.length())
                                m_decoder->showSinglePic(rass_interactive_pic.c_str());
                        else
-                               eDebug("empty filename for rass interactive picture %d/%d received!!", page, subpage);
+                               eDebug("eDVBServicePlay: empty filename for rass interactive picture %d/%d received!!", page, subpage);
                }
                else
-                       eDebug("no MPEG Decoder to show iframes avail");
+                       eDebug("eDVBServicePlay: no MPEG Decoder to show iframes avail");
        }
        else
-               eDebug("showRassInteractivePic called.. but not decoder");
+               eDebug("eDVBServicePlay: showRassInteractivePic called.. but not decoder");
 }
 
 ePyObject eDVBServicePlay::getRassInteractiveMask()
@@ -2384,7 +2384,7 @@ RESULT eDVBServicePlay::startTimeshift()
 {
        ePtr<iDVBDemux> demux;
 
-       eDebug("Start timeshift!");
+       eDebug("eDVBServicePlay: Start timeshift!");
 
        if (m_timeshift_enabled)
                return -1;
@@ -2400,12 +2400,12 @@ RESULT eDVBServicePlay::startTimeshift()
        std::string tspath = eConfigManager::getConfigValue("config.usage.timeshift_path");
        if (tspath == "")
        {
-               eDebug("could not query ts path");
+               eDebug("eDVBServicePlay: could not query ts path");
                return -5;
        }
        if (tspath.empty())
        {
-               eDebug("TS path is empty");
+               eDebug("eDVBServicePlay: TS path is empty");
                return -5;
        }
        if (tspath[tspath.length()-1] != '/')
@@ -2415,7 +2415,7 @@ RESULT eDVBServicePlay::startTimeshift()
        strcpy(templ, tspath.c_str());
        m_timeshift_fd = mkstemp(templ);
        m_timeshift_file = std::string(templ);
-       eDebug("recording to %s", templ);
+       eDebug("eDVBServicePlay: recording to %s", templ);
        delete [] templ;
 
        if (m_timeshift_fd < 0)
@@ -2456,14 +2456,14 @@ RESULT eDVBServicePlay::stopTimeshift(bool swToLive)
 
        if (!m_save_timeshift)
        {
-               eDebug("remove timeshift files");
+               eDebug("eDVBServicePlay: remove timeshift files");
                eBackgroundFileEraser::getInstance()->erase(m_timeshift_file);
                eBackgroundFileEraser::getInstance()->erase(m_timeshift_file + ".sc");
                eBackgroundFileEraser::getInstance()->erase(m_timeshift_file + ".cuts");
        }
        else
        {
-               eDebug("timeshift files not deleted");
+               eDebug("eDVBServicePlay: timeshift files not deleted");
                m_save_timeshift = 0;
        }
        return 0;
@@ -2541,24 +2541,24 @@ void eDVBServicePlay::setCutList(ePyObject list)
                ePyObject tuple = PyList_GET_ITEM(list, i);
                if (!PyTuple_Check(tuple))
                {
-                       eDebug("non-tuple in cutlist");
+                       eDebug("eDVBServicePlay: non-tuple in cutlist");
                        continue;
                }
                if (PyTuple_Size(tuple) != 2)
                {
-                       eDebug("cutlist entries need to be a 2-tuple");
+                       eDebug("eDVBServicePlay: cutlist entries need to be a 2-tuple");
                        continue;
                }
                ePyObject ppts = PyTuple_GET_ITEM(tuple, 0), ptype = PyTuple_GET_ITEM(tuple, 1);
                if (!(PyLong_Check(ppts) && PyInt_Check(ptype)))
                {
-                       eDebug("cutlist entries need to be (pts, type)-tuples (%d %d)", PyLong_Check(ppts), PyInt_Check(ptype));
+                       eDebug("eDVBServicePlay: cutlist entries need to be (pts, type)-tuples (%d %d)", PyLong_Check(ppts), PyInt_Check(ptype));
                        continue;
                }
                pts_t pts = PyLong_AsLongLong(ppts);
                int type = PyInt_AsLong(ptype);
                m_cue_entries.insert(cueEntry(pts, type));
-               eDebug("adding %08llx, %d", pts, type);
+               eDebug("eDVBServicePlay: adding %08llx, %d", pts, type);
        }
        m_cuesheet_changed = 1;
 
@@ -2660,7 +2660,7 @@ void eDVBServicePlay::switchToLive()
        if (!m_timeshift_active)
                return;
 
-       eDebug("SwitchToLive");
+       eDebug("eDVBServicePlay: SwitchToLive");
 
        resetTimeshift(0);
 
@@ -2735,7 +2735,7 @@ void eDVBServicePlay::switchToTimeshift()
        ePtr<iTsSource> source = createTsSource(r);
        m_service_handler_timeshift.tuneExt(r, 1, source, m_timeshift_file.c_str(), m_cue, 0, m_dvb_service, eDVBServicePMTHandler::timeshift_playback, false); /* use the decoder demux for everything */
 
-       eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now.");
+       eDebug("eDVBServicePlay: eDVBServicePlay::switchToTimeshift, in pause mode now.");
        pause();
        updateDecoder(true); /* mainly to switch off PCR, and to set pause */
 }
@@ -2749,10 +2749,10 @@ void eDVBServicePlay::updateDecoder(bool sendSeekableStateChanged)
 
        eDVBServicePMTHandler::program program;
        if (h.getProgramInfo(program))
-               eDebug("getting program info failed.");
+               eDebug("eDVBServicePlay: getting program info failed.");
        else
        {
-               eDebugNoNewLine("have %zd video stream(s)", program.videoStreams.size());
+               eDebugNoNewLineStart("eDVBServicePlay: have %zd video stream(s)", program.videoStreams.size());
                if (!program.videoStreams.empty())
                {
                        eDebugNoNewLine(" (");
@@ -2787,7 +2787,7 @@ void eDVBServicePlay::updateDecoder(bool sendSeekableStateChanged)
                }
                eDebugNoNewLine(", and the pcr pid is %04x", program.pcrPid);
                pcrpid = program.pcrPid;
-               eDebug(", and the text pid is %04x", program.textPid);
+               eDebugNoNewLine(", and the text pid is %04x\n", program.textPid);
                tpid = program.textPid;
        }
 
@@ -2953,9 +2953,9 @@ void eDVBServicePlay::loadCuesheet()
                        m_cue_entries.insert(cueEntry(where, what));
                }
                fclose(f);
-               eDebug("cuts file has %zd entries", m_cue_entries.size());
+               eDebug("eDVBServicePlay: cuts file has %zd entries", m_cue_entries.size());
        } else
-               eDebug("cutfile not found!");
+               eDebug("eDVBServicePlay: cutfile not found!");
 
        m_cuesheet_changed = 0;
        cutlistToCuesheet();
@@ -2997,7 +2997,7 @@ void eDVBServicePlay::cutlistToCuesheet()
 {
        if (!m_cue)
        {
-               eDebug("no cue sheet");
+               eDebug("eDVBServicePlay: no cue sheet");
                return;
        }
        m_cue->clear();
@@ -3005,7 +3005,7 @@ void eDVBServicePlay::cutlistToCuesheet()
        if ((m_cutlist_enabled & 1) == 0)
        {
                m_cue->commitSpans();
-               eDebug("cutlists were disabled");
+               eDebug("eDVBServicePlay: cutlists were disabled");
                return;
        }
 
@@ -3074,7 +3074,7 @@ RESULT eDVBServicePlay::enableSubtitles(iSubtitleUser *user, SubtitleTrack &trac
 
                if (!m_teletext_parser)
                {
-                       eDebug("enable teletext subtitles.. no parser !!!");
+                       eDebug("eDVBServicePlay: enable teletext subtitles.. no parser !!!");
                        return -1;
                }
 
@@ -3104,7 +3104,7 @@ RESULT eDVBServicePlay::enableSubtitles(iSubtitleUser *user, SubtitleTrack &trac
                int pid = 0, composition_page_id = 0, ancillary_page_id = 0;
                if (!m_subtitle_parser)
                {
-                       eDebug("enable dvb subtitles.. no parser !!!");
+                       eDebug("eDVBServicePlay: enable dvb subtitles.. no parser !!!");
                        return -1;
                }
 
@@ -3121,7 +3121,7 @@ RESULT eDVBServicePlay::enableSubtitles(iSubtitleUser *user, SubtitleTrack &trac
                goto error_out;
        return 0;
 error_out:
-       eDebug("enableSubtitles needs a valid type:\n"
+       eDebug("eDVBServicePlay: enableSubtitles needs a valid type:\n"
                "for teletext subtitles (0, pid, teletext_page, teletext_magazine)\n"
                "for dvb subtitles (1, pid, composition_page_id, ancillary_page_id)");
        return -1;
@@ -3215,7 +3215,7 @@ RESULT eDVBServicePlay::getSubtitleList(std::vector<SubtitleTrack> &subtitlelist
        eDVBServicePMTHandler &h = m_timeshift_active ? m_service_handler_timeshift : m_service_handler;
        eDVBServicePMTHandler::program program;
        if (h.getProgramInfo(program))
-               eDebug("getting program info failed.");
+               eDebug("eDVBServicePlay: getting program info failed.");
        else
        {
                for (std::vector<eDVBServicePMTHandler::subtitleStream>::iterator it(program.subtitleStreams.begin());
@@ -3291,7 +3291,7 @@ void eDVBServicePlay::newSubtitlePage(const eDVBTeletextSubtitlePage &page)
                m_decoder->getPTS(0, pts);
                if (m_is_pvr || m_timeshift_enabled)
                {
-                       eDebug("Subtitle in recording/timeshift");
+                       eDebug("eDVBServicePlay: Subtitle in recording/timeshift");
                        subtitledelay = eConfigManager::getConfigIntValue("config.subtitles.subtitle_noPTSrecordingdelay", 315000);
                }
                else
@@ -3300,7 +3300,7 @@ void eDVBServicePlay::newSubtitlePage(const eDVBTeletextSubtitlePage &page)
                        subtitledelay = eConfigManager::getConfigIntValue("config.subtitles.subtitle_bad_timing_delay", 0);
                }
 
-               // eDebug("Subtitle get  TTX have_pts=%d pvr=%d timeshift=%d page.pts=%lld pts=%lld delay=%d", page.m_have_pts, m_is_pvr, m_timeshift_enabled, page.m_pts, pts, subtitledelay);
+               // eDebug("eDVBServicePlay: Subtitle get  TTX have_pts=%d pvr=%d timeshift=%d page.pts=%lld pts=%lld delay=%d", page.m_have_pts, m_is_pvr, m_timeshift_enabled, page.m_pts, pts, subtitledelay);
                eDVBTeletextSubtitlePage tmppage = page;
                tmppage.m_have_pts = true;
 
@@ -3317,7 +3317,7 @@ void eDVBServicePlay::newSubtitlePage(const eDVBTeletextSubtitlePage &page)
 void eDVBServicePlay::checkSubtitleTiming()
 {
        pts_t pos = 0;
-//     eDebug("checkSubtitleTiming");
+//     eDebug("eDVBServicePlay: checkSubtitleTiming");
        if (!m_subtitle_widget)
                return;
        if (m_subtitle_pages.empty() && m_dvb_subtitle_pages.empty())
@@ -3351,7 +3351,7 @@ void eDVBServicePlay::checkSubtitleTiming()
                        return;
 
                int diff = show_time - pos;
-//             eDebug("Subtitle show %d page.pts=%lld pts=%lld diff=%d", type, show_time, pos, diff);
+//             eDebug("eDVBServicePlay: Subtitle show %d page.pts=%lld pts=%lld diff=%d", type, show_time, pos, diff);
 
                if (diff < 20*90 || diff > 1800000)
                {
@@ -3382,7 +3382,7 @@ void eDVBServicePlay::newDVBSubtitlePage(const eDVBSubtitlePage &p)
                        m_decoder->getPTS(0, pos);
                if ( abs(pos-p.m_show_time)>1800000 && (m_is_pvr || m_timeshift_enabled))
                {
-                       eDebug("Subtitle without PTS and recording");
+                       eDebug("eDVBServicePlay: Subtitle without PTS and recording");
                        int subtitledelay = eConfigManager::getConfigIntValue("config.subtitles.subtitle_noPTSrecordingdelay", 315000);
 
                        eDVBSubtitlePage tmppage;
index 75b8c49..091018e 100644 (file)
@@ -31,12 +31,12 @@ eDVBServiceRecord::eDVBServiceRecord(const eServiceReferenceDVB &ref, bool isstr
 
 void eDVBServiceRecord::serviceEvent(int event)
 {
-       eDebug("RECORD service event %d", event);
+       eDebug("eDVBServiceRecord: RECORD service event %d", event);
        switch (event)
        {
        case eDVBServicePMTHandler::eventTuned:
        {
-               eDebug("tuned..");
+               eDebug("eDVBServiceRecord: tuned..");
                m_tuned = 1;
 
                        /* start feeding EIT updates */
@@ -61,7 +61,7 @@ void eDVBServiceRecord::serviceEvent(int event)
        }
        case eDVBServicePMTHandler::eventTuneFailed:
        {
-               eDebug("record failed to tune");
+               eDebug("eDVBServiceRecord: record failed to tune");
                m_event((iRecordableService*)this, evTuneFailed);
                break;
        }
@@ -182,7 +182,7 @@ RESULT eDVBServiceRecord::start(bool simulate)
 RESULT eDVBServiceRecord::stop()
 {
        if (!m_simulate)
-               eDebug("stop recording!");
+               eDebug("eDVBServiceRecord: stop recording!");
        if (m_state == stateRecording)
        {
                if (m_record)
@@ -197,7 +197,7 @@ RESULT eDVBServiceRecord::stop()
 
                m_state = statePrepared;
        } else if (!m_simulate)
-               eDebug("(was not recording)");
+               eDebug("eDVBServiceRecord: (was not recording)");
        if (m_state == statePrepared)
        {
                m_record = 0;
@@ -272,12 +272,12 @@ int eDVBServiceRecord::doRecord()
 
        if (!m_record && m_tuned && !m_streaming && !m_simulate)
        {
-               eDebug("Recording to %s...", m_filename.c_str());
+               eDebug("eDVBServiceRecord: Recording to %s...", m_filename.c_str());
                ::remove(m_filename.c_str());
                int fd = ::open(m_filename.c_str(), O_WRONLY | O_CREAT | O_LARGEFILE | O_CLOEXEC, 0666);
                if (fd == -1)
                {
-                       eDebug("eDVBServiceRecord - can't open recording file!");
+                       eDebug("eDVBServiceRecord: can't open recording file!");
                        m_error = errOpenRecordFile;
                        m_event((iRecordableService*)this, evRecordFailed);
                        return errOpenRecordFile;
@@ -286,7 +286,7 @@ int eDVBServiceRecord::doRecord()
                ePtr<iDVBDemux> demux;
                if (m_service_handler.getDataDemux(demux))
                {
-                       eDebug("eDVBServiceRecord - NO DEMUX available!");
+                       eDebug("eDVBServiceRecord: NO DEMUX available!");
                        m_error = errNoDemuxAvailable;
                        m_event((iRecordableService*)this, evRecordFailed);
                        return errNoDemuxAvailable;
@@ -294,7 +294,7 @@ int eDVBServiceRecord::doRecord()
                demux->createTSRecorder(m_record);
                if (!m_record)
                {
-                       eDebug("eDVBServiceRecord - no ts recorder available.");
+                       eDebug("eDVBServiceRecord: no ts recorder available.");
                        m_error = errNoTsRecorderAvailable;
                        m_event((iRecordableService*)this, evRecordFailed);
                        return errNoTsRecorderAvailable;
@@ -309,14 +309,14 @@ int eDVBServiceRecord::doRecord()
        if (m_streaming)
        {
                m_state = stateRecording;
-               eDebug("start streaming...");
+               eDebug("eDVBServiceRecord: start streaming...");
        } else
        {
-               eDebug("start recording...");
+               eDebug("eDVBServiceRecord: start recording...");
 
                eDVBServicePMTHandler::program program;
                if (m_service_handler.getProgramInfo(program))
-                       eDebug("getting program info failed.");
+                       eDebug("eDVBServiceRecord: getting program info failed.");
                else
                {
                        std::set<int> pids_to_record;
@@ -329,7 +329,7 @@ int eDVBServiceRecord::doRecord()
                        int timing_pid = -1, timing_stream_type = -1;
                        iDVBTSRecorder::timing_pid_type timing_pid_type = iDVBTSRecorder::none;
 
-                       eDebugNoNewLine("RECORD: have %zd video stream(s)", program.videoStreams.size());
+                       eDebugNoNewLineStart("eDVBServiceRecord: RECORD: have %zd video stream(s)", program.videoStreams.size());
                        if (!program.videoStreams.empty())
                        {
                                eDebugNoNewLine(" (");
@@ -393,7 +393,7 @@ int eDVBServiceRecord::doRecord()
                        eDebugNoNewLine(", and the pcr pid is %04x", program.pcrPid);
                        if (program.pcrPid >= 0 && program.pcrPid < 0x1fff)
                                pids_to_record.insert(program.pcrPid);
-                       eDebug(", and the text pid is %04x", program.textPid);
+                       eDebugNoNewLine(", and the text pid is %04x\n", program.textPid);
                        if (program.textPid != -1)
                                pids_to_record.insert(program.textPid); // Videotext
 
@@ -421,13 +421,13 @@ int eDVBServiceRecord::doRecord()
 
                        for (std::set<int>::iterator i(new_pids.begin()); i != new_pids.end(); ++i)
                        {
-                               eDebug("ADD PID: %04x", *i);
+                               eDebug("eDVBServiceRecord: ADD PID: %04x", *i);
                                m_record->addPID(*i);
                        }
 
                        for (std::set<int>::iterator i(obsolete_pids.begin()); i != obsolete_pids.end(); ++i)
                        {
-                               eDebug("REMOVED PID: %04x", *i);
+                               eDebug("eDVBServiceRecord: REMOVED PID: %04x", *i);
                                m_record->removePID(*i);
                        }
 
@@ -488,7 +488,7 @@ void eDVBServiceRecord::recordEvent(int event)
                m_event((iRecordableService*)this, evRecordWriteError);
                return;
        default:
-               eDebug("unhandled record event %d", event);
+               eDebug("eDVBServiceRecord: unhandled record event %d", event);
        }
 }
 
@@ -507,11 +507,11 @@ void eDVBServiceRecord::gotNewEvent(int /*error*/)
        if (m_record)
        {
                if (m_record->getCurrentPCR(p))
-                       eDebug("getting PCR failed!");
+                       eDebug("eDVBServiceRecord: getting PCR failed!");
                else
                {
                        m_event_timestamps[event_id] = p;
-                       eDebug("pcr of eit change: %llx", p);
+                       eDebug("eDVBServiceRecord: pcr of eit change: %llx", p);
                }
        }
 
@@ -552,7 +552,7 @@ void eDVBServiceRecord::saveCutlist()
                                eDebug("[eDVBServiceRecord] fixing up PTS failed, not saving");
                                continue;
                        }
-                       eDebug("fixed up %llx to %llx (offset %llx)", i->second, p, offset);
+                       eDebug("eDVBServiceRecord: fixed up %llx to %llx (offset %llx)", i->second, p, offset);
                        where = htobe64(p);
                        what = htonl(2); /* mark */
                        fwrite(&where, sizeof(where), 1, f);
index c82daf3..d9a0ccc 100644 (file)
@@ -22,12 +22,12 @@ eDVBServiceStream::eDVBServiceStream()
 
 void eDVBServiceStream::serviceEvent(int event)
 {
-       eDebug("STREAM service event %d", event);
+       eDebug("[eDVBServiceStream] STREAM service event %d", event);
        switch (event)
        {
        case eDVBServicePMTHandler::eventTuned:
        {
-               eDebug("tuned..");
+               eDebug("[eDVBServiceStream] tuned..");
                m_tuned = 1;
 
                        /* start feeding EIT updates */
@@ -51,7 +51,7 @@ void eDVBServiceStream::serviceEvent(int event)
        }
        case eDVBServicePMTHandler::eventTuneFailed:
        {
-               eDebug("stream failed to tune");
+               eDebug("[eDVBServiceStream] failed to tune");
                tuneFailed();
                break;
        }
@@ -84,7 +84,7 @@ int eDVBServiceStream::start(const char *serviceref, int fd)
 
 RESULT eDVBServiceStream::stop()
 {
-       eDebug("stop streaming");
+       eDebug("[eDVBServiceStream] stop streaming");
 
        if (m_state == stateRecording)
        {
@@ -135,25 +135,25 @@ int eDVBServiceStream::doRecord()
                ePtr<iDVBDemux> demux;
                if (m_service_handler.getDataDemux(demux))
                {
-                       eDebug("eDVBServiceStream - NO DEMUX available");
+                       eDebug("[eDVBServiceStream] NO DEMUX available");
                        return -1;
                }
                demux->createTSRecorder(m_record, /*packetsize*/ 188, /*streaming*/ true);
                if (!m_record)
                {
-                       eDebug("eDVBServiceStream - no ts recorder available.");
+                       eDebug("[eDVBServiceStream] no ts recorder available.");
                        return -1;
                }
                m_record->setTargetFD(m_target_fd);
                m_record->connectEvent(slot(*this, &eDVBServiceStream::recordEvent), m_con_record_event);
        }
 
-       eDebug("start streaming...");
+       eDebug("[eDVBServiceStream] start streaming...");
 
        eDVBServicePMTHandler::program program;
        if (m_service_handler.getProgramInfo(program))
        {
-               eDebug("getting program info failed.");
+               eDebug("[eDVBServiceStream] getting program info failed.");
        }
        else
        {
@@ -167,7 +167,7 @@ int eDVBServiceStream::doRecord()
                int timing_pid = -1, timing_stream_type = -1;
                iDVBTSRecorder::timing_pid_type timing_pid_type = iDVBTSRecorder::none;
 
-               eDebugNoNewLine("STREAM: have %zd video stream(s)", program.videoStreams.size());
+               eDebugNoNewLineStart("[eDVBServiceStream]: have %zd video stream(s)", program.videoStreams.size());
                if (!program.videoStreams.empty())
                {
                        eDebugNoNewLine(" (");
@@ -231,7 +231,7 @@ int eDVBServiceStream::doRecord()
                eDebugNoNewLine(", and the pcr pid is %04x", program.pcrPid);
                if (program.pcrPid >= 0 && program.pcrPid < 0x1fff)
                        pids_to_record.insert(program.pcrPid);
-               eDebug(", and the text pid is %04x", program.textPid);
+               eDebugNoNewLine(", and the text pid is %04x\n", program.textPid);
                if (program.textPid != -1)
                        pids_to_record.insert(program.textPid); // Videotext
 
@@ -272,13 +272,13 @@ int eDVBServiceStream::doRecord()
 
                for (std::set<int>::iterator i(new_pids.begin()); i != new_pids.end(); ++i)
                {
-                       eDebug("ADD PID: %04x", *i);
+                       eDebug("[eDVBServiceStream] ADD PID: %04x", *i);
                        m_record->addPID(*i);
                }
 
                for (std::set<int>::iterator i(obsolete_pids.begin()); i != obsolete_pids.end(); ++i)
                {
-                       eDebug("REMOVED PID: %04x", *i);
+                       eDebug("[eDVBServiceStream] REMOVED PID: %04x", *i);
                        m_record->removePID(*i);
                }
 
@@ -306,7 +306,7 @@ void eDVBServiceStream::recordEvent(int event)
                streamStopped();
                break;
        default:
-               eDebug("unhandled record event %d", event);
+               eDebug("[eDVBServiceStream] unhandled record event %d", event);
                break;
        }
 }
index ad09242..fa30a9f 100644 (file)
@@ -199,7 +199,7 @@ ssize_t eM2TSFile::read(off_t offset, void *b, size_t count)
 sync:
        if ((offset+m_sync_offset) != m_current_offset)
        {
-//             eDebug("seekTo %lld", offset+m_sync_offset);
+//             eDebug("eM2TSFile: seekTo %lld", offset+m_sync_offset);
                m_current_offset = lseek_internal(offset+m_sync_offset, SEEK_SET);
                if (m_current_offset < 0)
                        return m_current_offset;
@@ -214,7 +214,7 @@ sync:
                if (tmp[4] != 0x47)
                {
                        if (rd > 0) {
-                               eDebug("short read at pos %lld async!!", m_current_offset);
+                               eDebug("eM2TSFile: short read at pos %lld async!!", m_current_offset);
                                return rd;
                        }
                        else {
@@ -222,20 +222,20 @@ sync:
                                ret = ::read(m_fd, tmp+192, 384);
 
 #if 0
-                               eDebugNoNewLine("m2ts out of sync at pos %lld, real %lld:", offset + m_sync_offset, m_current_offset);
+                               eDebugNoNewLineStart("eM2TSFile: m2ts out of sync at pos %lld, real %lld:", offset + m_sync_offset, m_current_offset);
                                for (; x < 192; ++x)
                                        eDebugNoNewLine(" %02x", tmp[x]);
-                               eDebug("");
+                               eDebugNoNewLine("\n");
                                x=0;
 #else
-                               eDebug("m2ts out of sync at pos %lld, real %lld", offset + m_sync_offset, m_current_offset);
+                               eDebug("eM2TSFile: m2ts out of sync at pos %lld, real %lld", offset + m_sync_offset, m_current_offset);
 #endif
                                for (; x < 192; ++x)
                                {
                                        if (tmp[x] == 0x47 && tmp[x+192] == 0x47)
                                        {
                                                int add_offs = (x - 4);
-                                               eDebug("sync found at pos %d, sync_offset is now %d, old was %d", x, add_offs + m_sync_offset, m_sync_offset);
+                                               eDebug("eM2TSFile: sync found at pos %d, sync_offset is now %d, old was %d", x, add_offs + m_sync_offset, m_sync_offset);
                                                m_sync_offset += add_offs;
                                                goto sync;
                                        }