[Live-devel] True push DeviceSource

Ross Finlayson finlayson at live555.com
Thu Oct 24 13:03:19 PDT 2013


> Thank you Ross for clarification, its more clear now. Now I am facing issue that i have separate thread that pushes audio packets for my device source to stream. I trigger event each time I push packet to that queue. I noticed that on VLC my audio comes for about a second and then stops. When I debugged my code I found that I have more than 1000 packets in my audio queue waiting to be streamed by devicesource.
> 
> I think what is happening is that whenever I trigger an event and that event is already happening it ignores it, is it correct? Whats is the correct way to handle this. I think the audio packets should be streamed at the same rate as they are being encoded from live source.

This should all be OK, provided that your "doGetNextFrame()" implementation knows to check for (queued) data that is immediately available, rather than always waiting for a triggered event.  Note this code on lines 87-90 of "DeviceSource.cpp":

  // If a new frame of data is immediately available to be delivered, then do this now:
  if (0 /* a new frame of data is immediately available to be delivered*/ /*%%% TO BE WRITTEN %%%*/) {
    deliverFrame();
  }

Replace the "0" with some test that checks whether queued data is immediately available.  (Remember that because your queue data structure is also being written to by the encoding thread, it needs to be 'thread safe'.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20131024/b8748458/attachment.html>


More information about the live-devel mailing list