~ubuntu-branches/ubuntu/trusty/liblivemedia/trusty

« back to all changes in this revision

Viewing changes to liveMedia/MultiFramedRTPSource.cpp

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2013-05-05 19:49:35 UTC
  • mfrom: (1.4.15) (11.1.9 experimental)
  • Revision ID: package-import@ubuntu.com-20130505194935-pyim0rda30k401ca
Tags: 2013.04.30-1
* Team upload.
* New upstream release.
* Upload to unstable after the Debian 7.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
15
15
**********/
16
16
// "liveMedia"
17
 
// Copyright (c) 1996-2012 Live Networks, Inc.  All rights reserved.
 
17
// Copyright (c) 1996-2013 Live Networks, Inc.  All rights reserved.
18
18
// RTP source for a common kind of payload format: Those that pack multiple,
19
19
// complete codec frames (as many as possible) into each RTP packet.
20
20
// Implementation
105
105
}
106
106
 
107
107
void MultiFramedRTPSource::doStopGettingFrames() {
 
108
  envir().taskScheduler().unscheduleDelayedTask(nextTask());
108
109
  fRTPInterface.stopNetworkReading();
109
110
  fReorderingBuffer->reset();
110
111
  reset();
232
233
  Boolean readSuccess = False;
233
234
  do {
234
235
    Boolean packetReadWasIncomplete = fPacketReadInProgress != NULL;
235
 
    if (!bPacket->fillInData(fRTPInterface, packetReadWasIncomplete)) break;
 
236
    if (!bPacket->fillInData(fRTPInterface, packetReadWasIncomplete)) {
 
237
      if (bPacket->bytesAvailable() == 0) {
 
238
        envir() << "MultiFramedRTPSource error: Hit limit when reading incoming packet over TCP. Increase \"MAX_PACKET_SIZE\"\n";
 
239
      }
 
240
      fPacketReadInProgress = NULL;
 
241
      break;
 
242
    }
236
243
    if (packetReadWasIncomplete) {
237
244
      // We need additional read(s) before we can process the incoming packet:
238
245
      fPacketReadInProgress = bPacket;
322
329
 
323
330
////////// BufferedPacket and BufferedPacketFactory implementation /////
324
331
 
325
 
#define MAX_PACKET_SIZE 10000
 
332
#define MAX_PACKET_SIZE 20000
326
333
 
327
334
BufferedPacket::BufferedPacket()
328
335
  : fPacketSize(MAX_PACKET_SIZE),
370
377
 
371
378
  unsigned numBytesRead;
372
379
  struct sockaddr_in fromAddress;
373
 
  if (!rtpInterface.handleRead(&fBuf[fTail], fPacketSize-fTail, numBytesRead, fromAddress, packetReadWasIncomplete)) {
 
380
  unsigned const maxBytesToRead = bytesAvailable();
 
381
  if (maxBytesToRead == 0) return False; // exceeded buffer size when reading over TCP
 
382
  if (!rtpInterface.handleRead(&fBuf[fTail], maxBytesToRead, numBytesRead, fromAddress, packetReadWasIncomplete)) {
374
383
    return False;
375
384
  }
376
385
  fTail += numBytesRead;