25 #include <sys/socket.h>
31 #include <condition_variable>
34 #ifdef SUBTEC_PACKET_DEBUG
35 #define AAMPLOG_WARN(...) printf
36 #define AAMPLOG_INFO(...) printf
37 #define AAMPLOG_TRACE(...) printf
38 #define AAMPLOG_ERR(...) printf
43 #include "SubtecPacket.hpp"
45 #ifdef AAMP_SIMULATOR_BUILD
46 const constexpr
char *SOCKET_PATH =
"subtecsim";
48 const constexpr
char *SOCKET_PATH =
"/run/subttx/pes_data_main";
51 void runWorkerTask(
void *ctx);
61 bool Init(
const char *socket_path);
62 void SendPacket(PacketPtr && packet);
67 void closeSenderTask();
68 void flushPacketQueue();
69 void sendPacket(PacketPtr && pkt);
70 bool initSenderTask();
71 bool initSocket(
const char *socket_path);
73 std::thread mSendThread;
74 int mSubtecSocketHandle;
75 std::atomic_bool running;
76 std::queue<PacketPtr> mPacketQueue;
78 std::condition_variable mCv;
79 std::mutex mStartMutex;
84 mSubtecSocketHandle(-1),