Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.0 KiB

  1. #ifndef _NAC_PACKET_SENDER_H_
  2. #define _NAC_PACKET_SENDER_H_
  3. #define PS_INITSIZE 32
  4. #define PS_GROWRATE 10
  5. #define PS_AUDIO 1
  6. #define PS_VIDEO 2
  7. #include "NacList.h"
  8. class MediaPacket;
  9. class TxStream;
  10. typedef struct _psqelement
  11. {
  12. MediaPacket *pMP;
  13. DWORD dwPacketType;
  14. IRTPSend *pRTPSend;
  15. BYTE *data;
  16. DWORD dwSize;
  17. UINT fMark;
  18. BYTE *pHeaderInfo;
  19. DWORD dwHdrSize;
  20. } PS_QUEUE_ELEMENT;
  21. class PacketSender
  22. {
  23. private:
  24. // adding to the queue is done via the interface exposed by
  25. // m_SendQueue. It's thread safe, but we don't want both
  26. // threads trying to send from this queue at the same time,
  27. // we may accidentally send packets our of order
  28. CRITICAL_SECTION m_cs;
  29. public:
  30. // audio thread will "PushFront" elements containing packets
  31. // to this queue. VideoThread will PushRear packets.
  32. ThreadSafeList<PS_QUEUE_ELEMENT> m_SendQueue;
  33. BOOL SendPacket(); // sends one packet in a thread safe manner
  34. PacketSender();
  35. ~PacketSender();
  36. };
  37. #endif