]> git.vomp.tv Git - vompclient.git/commitdiff
Log lines, comments
authorChris Tallon <chris@vomp.tv>
Sat, 2 Oct 2021 14:07:40 +0000 (15:07 +0100)
committerChris Tallon <chris@vomp.tv>
Sat, 2 Oct 2021 14:07:40 +0000 (15:07 +0100)
osdopenvg.cc
osdvector.cc
osdvector.h
surfacevector.cc
surfacevector.h
tcp.cc

index 8717d4e69020f86a372c393d22cfecda28e0dec6..795988d946583441f90b40aff515a917c191116a 100644 (file)
@@ -1447,7 +1447,7 @@ unsigned int OsdOpenVG::handleOpenVGCommand(OpenVGCommand& command)
       if (info->lindex & 0xffffffff) static_image = false;
 
       Message* m = new  Message();
-      // We have a pictures! send a message to ourself, to switch to gui thread    // FIXME MQSUB
+      // We have a pictures! send a message to ourself, to switch to gui thread
       m->from = this;
       m->to = this;
       m->data = reinterpret_cast<void*>(handle);
@@ -1462,7 +1462,7 @@ unsigned int OsdOpenVG::handleOpenVGCommand(OpenVGCommand& command)
         m->message = Message::NEW_PICTURE_STATIC;
         m->tag = info->lindex >> 32LL;
       }
-      MessageQueue::getInstance()->postMessage(m); // inform control about new picture
+      MessageQueue::getInstance()->postMessage(m);
 
       delete info;
       break;
index 57621a70e13dde187f0aa634ed80a011d845539d..71a6d30b73faca89b5898b4fc5011e6d9fc2363f 100644 (file)
@@ -116,6 +116,8 @@ bool MagickDecoder::getDecodedPicture(struct OsdVector::PictureInfo& pict_inf)
 
 OsdVector::OsdVector()
 {
+  logger = LogNT::getInstance();
+
   setlocale(LC_CTYPE, "C.UTF-8");
 #ifdef PICTURE_DECODER_MAGICK
   reader.addDecoder(new MagickDecoder(&reader));
@@ -143,7 +145,7 @@ bool OsdVector::screenShot(const char* fileName)
 
     if (!screenShotInternal(mem, width, height, true))
     {
-      LogNT::getInstance()->debug(TAG, "Screenshot failed!");
+      logger->debug(TAG, "Screenshot failed!");
       free(mem);
       return false;
     }
@@ -154,7 +156,7 @@ bool OsdVector::screenShot(const char* fileName)
   }
   catch ( Exception& error_ )
   {
-    LogNT::getInstance()->debug("MagickEncoder", "Libmagick: {}", error_.what());
+    logger->debug("MagickEncoder", "Libmagick: {}", error_.what());
     return false;
   }
 
@@ -289,7 +291,7 @@ void OsdVector::updateOrAddSurface(const SurfaceVector* surf, float x, float y,
   SurfacesIterator si;
 
   #if DEV
-  LogNT::getInstance()->trace(TAG, "updateOrAddSurface, surfaces.length {}", surfaces.size());
+  logger->trace(TAG, "updateOrAddSurface, surfaces.length {}", surfaces.size());
   dumpStyles();
   #endif
 
@@ -341,19 +343,19 @@ void OsdVector::updateOrAddSurface(const SurfaceVector* surf, float x, float y,
   cleanupOrphanedRefs();
 
   #if DEV
-  LogNT::getInstance()->trace(TAG, "After UOAS:");
+  logger->trace(TAG, "After UOAS:");
   dumpStyles();
   #endif
 
   // OSDOVG-ROD-EXPERIMENT
-  LogNT::getInstance()->trace(TAG, "EXPERIMENT - call doRender");
+  logger->trace(TAG, "EXPERIMENT - call doRender");
   doRender();
 }
 
 void OsdVector::removeSurface(const SurfaceVector* surf)
 {
   std::lock_guard<std::mutex> lg(surfaces_mutex);                      // FIXME - Can block here on shutdown if a timer is fired just as the wrong time
-        LogNT::getInstance()->trace("OsdVector-348", "EXPERIMENT - removeSurface");
+        logger->trace("OsdVector-348", "EXPERIMENT - removeSurface");
   for (auto i = surfaces.begin(); i != surfaces.end(); i++)
   {
     if (i->surface == surf)
@@ -458,7 +460,7 @@ void OsdVector::removeLoadIndexRef(const LoadIndex ref)
     }
 
     tvmedias_loaded.erase(ref);
-    //         LogNT::getInstance()->debug(TAG, "TVMedia removeLoadIndexRef {} {:#x}",tvmedias_load.size(),ref);
+    //         logger->debug(TAG, "TVMedia removeLoadIndexRef {} {:#x}",tvmedias_load.size(),ref);
     tvmedias_load.erase(tvmedias_load_inv[ref]);
     tvmedias_load_inv.erase(ref);
 
@@ -692,13 +694,13 @@ void OsdVector::dumpStyles()
   for(i = drawstyleHandles.begin(); i != drawstyleHandles.end(); i++)
   {
     const DrawStyle* test = &(i->first);
-    LogNT::getInstance()->debug(TAG, "DumpStyles: {} {}", (void*)test , i->second);
+    logger->debug(TAG, "DumpStyles: {} {}", (void*)test , i->second);
   }
 
   std::map<VectorHandle, int>::iterator i2;
   for (i2 = drawstyleHandlesRefCounts.begin(); i2 != drawstyleHandlesRefCounts.end(); i2++)
   {
-    LogNT::getInstance()->debug(TAG, "DumpStylesRef: {} {}", i2->first, i2->second);
+    logger->debug(TAG, "DumpStylesRef: {} {}", i2->first, i2->second);
   }
 }
 #endif
@@ -709,11 +711,11 @@ LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
   LoadIndex loadindex = 0;
   surfaces_mutex.lock();
 
-  if (tvmedias.find(tvmedia) == tvmedias.end())
+  if (tvmedias.find(tvmedia) == tvmedias.end())   // if not found, return a loadIndex from loadTVMedia(tvmedia)
   {
     loadindex = loadTVMedia(tvmedia);
   }
-  else
+  else   // if found, return a real imageIndex. incImageRef(image_handle). EXCEPT: If it's not found in images_ref (???) in which case do same as above.
   {
     image_handle = tvmedias[tvmedia];
 
@@ -736,11 +738,11 @@ LoadIndex OsdVector::getTVMediaRef(TVMediaInfo& tvmedia, ImageIndex& image)
   return loadindex;
 }
 
-LoadIndex OsdVector::loadTVMedia(TVMediaInfo& tvmedia)
+LoadIndex OsdVector::loadTVMedia(TVMediaInfo& tvmedia)          // insert a tvmedia for loading
 {
   LoadIndex index = 0;
 
-  if (tvmedias_load.find(tvmedia) == tvmedias_load.end())
+  if (tvmedias_load.find(tvmedia) == tvmedias_load.end())        // if not found in tvmedias_load
   {
     switch (tvmedia.getType())
     {
@@ -790,7 +792,7 @@ void OsdVector::informPicture(LoadIndex index, ImageIndex imageIndex)
   //Beware for thread safety
   ImageIndex image_index = 0;
 
-  LogNT::getInstance()->debug(TAG, "TVMedia Picture for request id {:#x} arrived {:#x}", index, imageIndex);
+  logger->debug(TAG, "TVMedia Picture for load-id {:#x} arrived index {:#x}", index, imageIndex);
   surfaces_mutex.lock();
   TVMediaInfo tvmedia = tvmedias_load_inv[index];
 
@@ -824,13 +826,13 @@ void OsdVector::processMessage(Message* m)
   {
     case Message::NEW_PICTURE:
     {
-      //LogNT::getInstance()->debug(TAG, "TVMedia NEW_PICTURE");
+      //logger->debug(TAG, "TVMedia NEW_PICTURE");
       informPicture(m->tag, reinterpret_cast<ImageIndex>(m->data));
       break;
     }
     case Message::NEW_PICTURE_STATIC:
     {
-      //LogNT::getInstance()->debug(TAG, "TVMedia NEW_PICTURE {:#x} {:#x}", m->tag, m->parameter);
+      //logger->debug(TAG, "TVMedia NEW_PICTURE {:#x} {:#x}", m->tag, m->parameter);
       informPicture(static_cast<unsigned long long>(m->tag) << 32LL, reinterpret_cast<ImageIndex>(m->data));
       break;
     }
@@ -980,7 +982,7 @@ void OsdVector::PictureReader::threadMethod()
 
       while (itty != decoders.end())
       {
-        if ((*itty)->getDecodedPicture(pictinf))
+        if ((*itty)->getDecodedPicture(pictinf))    // FIXME somewhere around here?, or in getDecodedPicture, try SA optimisation
         {
           todos = true;
           osdvector->createPicture(pictinf);
index d9aa510408793022774fdd9e2ba1134aca40860a..60e43ef2735900863d577facdecf4a9724c9cbd6 100644 (file)
@@ -37,6 +37,8 @@
 #include "vdr.h"
 #include "teletextdecodervbiebu.h"
 
+class LogNT;
+
 enum SVGCommandInstr
 {
   DrawNoop,
@@ -334,6 +336,7 @@ class OsdVector : public Osd, public MessageReceiver
     PictureReader* getPictReader() { return &reader; };
 
   protected:
+    LogNT* logger{};
 
     PictureReader reader;
 
index 035cf7b7ed4fb9635764bb60e13e04d4ef46b516..2b0e133131341980b90160f88d5f158502de094b 100644 (file)
 #include "staticartwork.h"
 #include "surfacevector.h"
 
+const static char* TAG = "SurfaceVector";
+
 SurfaceVector::SurfaceVector(OsdVector* vosd)
 {
+  logger = LogNT::getInstance();
   osd = vosd;
   commands.reserve(2048);
 }
@@ -268,14 +271,13 @@ void SurfaceVector::drawTVMedia(TVMediaInfo& tvmedia, float x, float y, float  w
 
   if (image)
   {
-    //Log::getInstance()->log("SurfaceVector", Log::DEBUG, "TVMedia Add instru image %d %d", load_index,image);
+    logger->trace(TAG, "drawTVMedia: i=true, Add instr PaintImage load_index={} image={}", load_index, image);
     commands.push_back(SVGCommand::PaintImage(x, y, width, height, image, 0, corner));
   }
   else
   {
-
+    logger->trace(TAG, "drawTVMedia: i=false, Add instr PaintImageLoading {} {}", load_index, image);
     commands.push_back(SVGCommand::PaintImageLoading(load_index, x, y, width, height, corner));
-    //Log::getInstance()->log("SurfaceVector", Log::DEBUG, "TVMedia Add instru image loading %d %d", load_index,image);
   }
 
   command_mutex.unlock();
index ce20315413d85b4c2def11f648a028892d78e030..57f9cfaac2bbf30b53a78fb0c56f85434cd45a70 100644 (file)
@@ -68,6 +68,7 @@ class SurfaceVector : public Surface
     bool screenShot(const char* /* fileName */) { return false; }
 
   protected:
+    LogNT* logger{};
 
     int removeCommands(float x, float y, float width, float height);
 
diff --git a/tcp.cc b/tcp.cc
index 7debd2cf7b9362a25e040ba47135c4836167c9c5..6b8f3669113f2c016e16399a7a3a433f2d57455c 100644 (file)
--- a/tcp.cc
+++ b/tcp.cc
@@ -212,8 +212,6 @@ bool TCP::waitForConnect(int)
     return false;
   }
 
-  logger->trace(TAG, "waitForConnect(): selectResult = {}", selectResult);
-
   if ((selectResult == 1) && FD_ISSET(sockfd, &writefds))
   {
     logger->info(TAG, "Connected");