Hello,

I'm looking for a way to listen an RTPSession in a blocking way.

in all examples, RTPSession object runs a thread that handle RTCP, sends due RTP packets, and takes incoming packets from its socket to the Incoming packet queue.
However, My application can not block on getData() method, and has to poll and sleep, waiting for data to be inserted to the queue.
I dont like this solution since my application will continue sleeping for a fixed time  while a packet may be already waiting for it to process.
I thought about inheriting RTPSession and override virtual onRTPPacketRecv () method,  but its risky, since it is called from takeInDataPacket() before the packet is actually inserted to the queue.

today the the code looks like that

RTPSession socket;
while(1) {
  if (socket.getData(getFirstTimestamp() )
    //do somthing
  else
   sleep(100);
}

I would like somthing like

while(1) {
  socket.getData(getFirstTimestamp() )
  {  //do somthing}
}

Thanks,
Yaniv
_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to