]> git.vomp.tv Git - vompclient.git/commitdiff
Add some telemetry
authorChris Tallon <chris@vomp.tv>
Tue, 21 May 2024 20:43:08 +0000 (20:43 +0000)
committerChris Tallon <chris@vomp.tv>
Tue, 21 May 2024 20:43:08 +0000 (20:43 +0000)
src/demuxer.cc
src/playervideorec.cc
src/stream.cc
src/stream.h
src/videoomx.cc

index a9e176e9f99467dc7c45769ec2fa987310823553..2e7e7938f4e6e48c9a01c41771e98929566e6b2f 100644 (file)
@@ -24,6 +24,7 @@
 #include "callback.h"
 #include "dvbsubtitles.h"
 #include "log.h"
+#include "telem.h"
 
 #include <cstdlib>
 #include <algorithm>
@@ -701,6 +702,9 @@ bool Demuxer::writeTeletext(bool * dataavail)
 
 bool Demuxer::submitPacket(PESPacket& packet)
 {
+  TELEM(2, packet.getPacketType());
+  TELEM(3, packet.getPTS());
+
   u4 sent = 0;
   u1 packet_type = packet.getPacketType();
   const u1* packetdata = packet.getData();
index 9e598dc5b3af4f38f75fbd365f8c2fdc21c63be7..cab64868b1c380310c140245ef69065decf735ce 100644 (file)
@@ -31,6 +31,7 @@
 #include "osdreceiver.h"
 #include "buffer.h"
 #include "util.h"
+#include "telem.h"
 
 #include "playervideorec.h"
 
@@ -1149,6 +1150,8 @@ void PlayerVideoRec::threadFeedPlay()
     threadBuffer.set(vdr->getBlock(feedPosition, askFor, &thisRead));
     //logger->log("Player", Log::DEBUG, "Get Block out");
 
+    TELEM(1, feedPosition);
+
     feedPosition += thisRead;
 
     if (!vdr->isConnected())
index 73dd5f21a3a7461c1a91456e6dab773af6f259b4..9af19c734917801054f8c870c8db5512b9451eef 100644 (file)
 #include <string.h>
 
 //#include "oldlog.h"
+
+#include "telem.h"
+
 #include "stream.h"
 
+int Stream::which{};
+
+Stream::Stream()
+{
+  localWhich = which++;
+}
+
 Stream::~Stream()
 {
   shutdown();
@@ -99,12 +109,25 @@ int Stream::put(const u1* inbuf, int len, u1 type, unsigned int index)
         hasdts = true;
       }
 
+      TELEM((localWhich ? 11 : 4), newPacket.pts);
+      TELEM((localWhich ? 12 : 5), newPacket.dts);
+
       //ok we have the pts now convert it to a continously time code in 100ns units
-      if (hasdts && draintarget->dtsTimefix()) newPacket.presentation_time = static_cast<u8>(newPacket.dts * 10000LL / 90LL);
-      else newPacket.presentation_time = static_cast<u8>(newPacket.pts * 10000LL / 90LL);
+      if (hasdts && draintarget->dtsTimefix()) newPacket.presentation_time = static_cast<u8>(newPacket.dts * 10000LL / 90LL); // Windows only
+      else                                     newPacket.presentation_time = static_cast<u8>(newPacket.pts * 10000LL / 90LL);
+
+      TELEM((localWhich ? 13 : 6), newPacket.presentation_time);
+
+      // now PTS & DTS are original, presentation_time is OMX ticks. If it's rolled, it's rolled!
 
       //newPacket.presentation_time-=draintarget->SetStartOffset(static_cast<u8>(newPacket.pts*10000LL/90LL),&newPacket.disconti);
-      newPacket.presentation_time -= draintarget->SetStartOffset(static_cast<u8>(newPacket.pts * 10000LL / 90LL), &newPacket.disconti);
+      //newPacket.presentation_time -= draintarget->SetStartOffset(static_cast<u8>(newPacket.pts * 10000LL / 90LL), &newPacket.disconti);
+      long long returnedStartOffset = draintarget->SetStartOffset(static_cast<u8>(newPacket.pts * 10000LL / 90LL), &newPacket.disconti);
+      newPacket.presentation_time -= returnedStartOffset;
+      //LogNT::getInstance()->debug("MP", "draintarget {} PTSmod {} disconti {} rso: {}", (void*)draintarget, newPacket.presentation_time, newPacket.disconti, returnedStartOffset);
+
+      TELEM((localWhich ? 14 : 7), newPacket.presentation_time);
+      TELEM((localWhich ? 15 : 8), returnedStartOffset);
     }
   }
 
index 22c4b4b0d596210c1f6af6392bb247402eebf376..c9859fc5b22bd9dbb9bc540400f7b42bae4d2c86 100644 (file)
@@ -28,6 +28,7 @@
 class Stream
 {
   public:
+    Stream();
     ~Stream();
     int init(DrainTarget* tdt, int bufsize);
     void shutdown();
@@ -36,6 +37,8 @@ class Stream
     bool drain(bool* dataavail = NULL);
 
   private:
+    static int which;
+    int localWhich{};
     MediaPacketList mediapackets;
     u4 cur_packet_pos{};
     std::mutex mutex;
index d9b2984a36bad4981f8fd4f1d84b78bcf1efbcd2..d07a93efc7e31d6dbc4c6388e1bfafd891374306 100644 (file)
@@ -33,6 +33,7 @@
 #include "inputman.h"
 #include "util.h"
 #include "config.h"
+#include "telem.h"
 
 #include "videoomx.h"
 
@@ -3184,6 +3185,8 @@ u4 VideoOMX::DeliverMediaPacket(MediaPacket packet, const u1* buffer, u4* sample
   //   logger->debug(TAG, "DMP mark 1");
   //logger->debug(TAG, "DeliverMediaPacketOMX time {}", packet.presentation_time);
 
+  TELEM(9, packet.presentation_time);
+
   /*First Check, if we have an video sample*/
   if (iframemode)
   {
@@ -3302,6 +3305,7 @@ u4 VideoOMX::DeliverMediaPacket(MediaPacket packet, const u1* buffer, u4* sample
       }
 
       lastreftimeOMX = packet.presentation_time;
+      TELEM(10, lastreftimeOMX);
       // logger->debug(TAG, "Time code {} pts {}", lastreftimeOMX,packet.pts);
       lastreftimePTS = packet.pts;
       cur_input_buf_omx->nTimeStamp = intToOMXTicks(lastreftimeOMX / 10LL); // the clock component is faulty;