houxiao
2016-12-30 cc445067d1f61e12dbea4e6458f2c85ba58f01bf
RtspFace/live555/testProgs/testRTSPClient.hpp
@@ -33,10 +33,11 @@
// Even though we're not going to be doing anything with the incoming data, we still need to receive it.
// Define the size of the buffer that we'll use:
#define DUMMY_SINK_RECEIVE_BUFFER_SIZE 1920*1080*3
#define DUMMY_SINK_RECEIVE_BUFFER_SIZE 1920*1080*3//#todo
// If you don't want to see debugging output for each received frame, then comment out the following line:
#define DEBUG_PRINT_EACH_RECEIVED_FRAME 1
//#define DEBUG_PRINT_EACH_RECEIVED_FRAME 1
//#define DEBUG_PRINT_NPT 1
// Forward function definitions:
@@ -52,7 +53,7 @@
  // called at the end of a stream's expected duration (if the stream has not already signaled its end using a RTCP "BYE")
// The main streaming routine (for each "rtsp://" URL):
void openURL(UsageEnvironment& env, const RTSPConfig& _rtspConfig);
void openURL(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig);
// Used to iterate through each stream's 'subsessions', setting up each one:
void setupNextSubsession(RTSPClient* rtspClient);
@@ -61,34 +62,39 @@
void shutdownStream(RTSPClient* rtspClient, int exitCode = 1);
// A function that outputs a string that identifies each stream (for debugging output).  Modify this if you wish:
UsageEnvironment& operator<<(UsageEnvironment& env, const RTSPClient& rtspClient) {
  return env << "[URL:\"" << rtspClient.url() << "\"]: ";
log4cpp::CategoryStream& operator<<(log4cpp::CategoryStream& logRoot, const RTSPClient& rtspClient)
{
   return logRoot << "[URL:\"" << rtspClient.url() << "\"]: ";
}
// A function that outputs a string that identifies each subsession (for debugging output).  Modify this if you wish:
UsageEnvironment& operator<<(UsageEnvironment& env, const MediaSubsession& subsession) {
  return env << subsession.mediumName() << "/" << subsession.codecName();
log4cpp::CategoryStream& operator<<(log4cpp::CategoryStream& logRoot, const MediaSubsession& subsession)
{
   return logRoot << subsession.mediumName() << "/" << subsession.codecName();
}
void usage(UsageEnvironment& env, char const* progName) {
  env << "Usage: " << progName << " <rtsp-url-1> ... <rtsp-url-N>\n";
  env << "\t(where each <rtsp-url-i> is a \"rtsp://\" URL)\n";
void usage(UsageEnvironment& env, char const* progName)
{
   LOG_DEBUG << "Usage: " << progName << " <rtsp-url-1> ... <rtsp-url-N>";
   LOG_DEBUG << "\t(where each <rtsp-url-i> is a \"rtsp://\" URL)";
}
char eventLoopWatchVariable = 0;
int test_main(int argc, char** argv) {
int test_main(int argc, char** argv)
{
  // Begin by setting up our usage environment:
  TaskScheduler* scheduler = BasicTaskScheduler::createNew();
  UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);
  // We need at least one "rtsp://" URL argument:
  if (argc < 2) {
   if (argc < 2)
      {
    usage(*env, argv[0]);
    return 1;
  }
   RTSPConfig rtspConfig;
   PL_RTSPClient_Config rtspConfig;
   rtspConfig.progName = argv[0];
   rtspConfig.rtspURL = "";
   rtspConfig.aux = false;
@@ -97,7 +103,8 @@
   rtspConfig.args = nullptr;
  
  // There are argc-1 URLs: argv[1] through argv[argc-1].  Open and start streaming each one:
  for (int i = 1; i <= argc-1; ++i) {
   for (int i = 1; i <= argc-1; ++i)
      {
   rtspConfig.rtspURL = argv[i];
   openURL(*env, rtspConfig);
  }
@@ -119,7 +126,8 @@
// Define a class to hold per-stream state that we maintain throughout each stream's lifetime:
class StreamClientState {
class StreamClientState
{
public:
  StreamClientState();
  virtual ~StreamClientState();
@@ -137,18 +145,19 @@
// showing how to play multiple streams, concurrently, we can't do that.  Instead, we have to have a separate "StreamClientState"
// structure for each "RTSPClient".  To do this, we subclass "RTSPClient", and add a "StreamClientState" field to the subclass:
class ourRTSPClient: public RTSPClient {
class ourRTSPClient: public RTSPClient
{
public:
  static ourRTSPClient* createNew(UsageEnvironment& env, const RTSPConfig& _rtspConfig);
   static ourRTSPClient* createNew(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig);
protected:
  ourRTSPClient(UsageEnvironment& env, const RTSPConfig& _rtspConfig);
   ourRTSPClient(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig);
    // called only by createNew();
  virtual ~ourRTSPClient();
public:
  StreamClientState scs;
  const RTSPConfig& rtspConfig;
   const PL_RTSPClient_Config& rtspConfig;
};
// Define a data sink (a subclass of "MediaSink") to receive the data for each subsession (i.e., each audio or video 'substream').
@@ -160,12 +169,12 @@
{
public:
   static DummySink* createNew(UsageEnvironment& env, 
              const RTSPConfig& _rtspConfig,
                               const PL_RTSPClient_Config& _rtspConfig,
              MediaSubsession& subsession, // identifies the kind of data that's being received
              char const* streamId = NULL); // identifies the stream itself (optional)
private:
   DummySink(UsageEnvironment& env, const RTSPConfig& _rtspConfig, MediaSubsession& subsession, char const* streamId);
   DummySink(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig, MediaSubsession& subsession, char const* streamId);
   // called only by "createNew()"
   virtual ~DummySink();
@@ -177,7 +186,7 @@
          struct timeval presentationTime, unsigned durationInMicroseconds);
public:
   const RTSPConfig& rtspConfig;
   const PL_RTSPClient_Config& rtspConfig;
private:
   // redefined virtual functions:
@@ -191,14 +200,14 @@
static unsigned rtspClientCount = 0; // Counts how many streams (i.e., "RTSPClient"s) are currently in use.
void openURL(UsageEnvironment& env, const RTSPConfig& _rtspConfig)
void openURL(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig)
{
   // Begin by creating a "RTSPClient" object.  Note that there is a separate "RTSPClient" object for each stream that we wish
   // to receive (even if more than stream uses the same "rtsp://" URL).
   RTSPClient* rtspClient = ourRTSPClient::createNew(env, _rtspConfig);
   if (rtspClient == NULL)
   {
      env << "Failed to create a RTSP client for URL \"" << _rtspConfig.rtspURL.c_str() << "\": " << env.getResultMsg() << "\n";
         LOG_ERROR << "Failed to create a RTSP client for URL \"" << _rtspConfig.rtspURL.c_str() << "\": " << env.getResultMsg();
      return;
   }
@@ -222,25 +231,25 @@
      if (resultCode != 0)
      {
         env << *rtspClient << "Failed to get a SDP description: " << resultString << "\n";
               LOG_WARN << *rtspClient << "Failed to get a SDP description: " << resultString;
         delete[] resultString;
         break;
      }
      char* const sdpDescription = resultString;
      env << *rtspClient << "Got a SDP description:\n" << sdpDescription << "\n";
         LOG_INFO << *rtspClient << "Got a SDP description:\n" << sdpDescription;
      // Create a media session object from this SDP description:
      scs.session = MediaSession::createNew(env, sdpDescription);
      delete[] sdpDescription; // because we don't need it anymore
      if (scs.session == NULL)
      {
         env << *rtspClient << "Failed to create a MediaSession object from the SDP description: " << env.getResultMsg() << "\n";
               LOG_ERROR << *rtspClient << "Failed to create a MediaSession object from the SDP description: " << env.getResultMsg();
         break;
      }
      else if (!scs.session->hasSubsessions())
      {
         env << *rtspClient << "This session has no media subsessions (i.e., no \"m=\" lines)\n";
               LOG_WARN << *rtspClient << "This session has no media subsessions (i.e., no \"m=\" lines)";
         break;
      }
@@ -250,7 +259,8 @@
      scs.iter = new MediaSubsessionIterator(*scs.session);
      setupNextSubsession(rtspClient);
      return;
   } while (0);
      }
   while (0);
   // An unrecoverable error occurred with this stream.
   shutdownStream(rtspClient);
@@ -262,18 +272,21 @@
  StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias
  
  scs.subsession = scs.iter->next();
  if (scs.subsession != NULL) {
    if (!scs.subsession->initiate()) {
      env << *rtspClient << "Failed to initiate the \"" << *scs.subsession << "\" subsession: " << env.getResultMsg() << "\n";
   if (scs.subsession != NULL)
      {
         if (!scs.subsession->initiate())
            {
               LOG_ERROR << *rtspClient << "Failed to initiate the \"" << *scs.subsession << "\" subsession: " << env.getResultMsg();
      setupNextSubsession(rtspClient); // give up on this subsession; go to the next one
    } else {
      env << *rtspClient << "Initiated the \"" << *scs.subsession << "\" subsession (";
      if (scs.subsession->rtcpIsMuxed()) {
   env << "client port " << scs.subsession->clientPortNum();
      } else {
   env << "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1;
      }
      env << ")\n";
         else
            {
               LOG_INFO <<  *rtspClient << "Initiated the \"" << *scs.subsession << "\" subsession (";
               if (scs.subsession->rtcpIsMuxed())
                  LOG_INFO <<  "client port " << scs.subsession->clientPortNum();
               else
                  LOG_INFO <<  "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1;
               LOG_INFO <<  ")";
      // Continue setting up this subsession, by sending a RTSP "SETUP" command:
      rtspClient->sendSetupCommand(*scs.subsession, continueAfterSETUP, False, REQUEST_STREAMING_OVER_TCP);
@@ -282,32 +295,41 @@
  }
  // We've finished setting up all of the subsessions.  Now, send a RTSP "PLAY" command to start the streaming:
  if (scs.session->absStartTime() != NULL) {
   if (scs.session->absStartTime() != NULL)
      {
    // Special case: The stream is indexed by 'absolute' time, so send an appropriate "PLAY" command:
    rtspClient->sendPlayCommand(*scs.session, continueAfterPLAY, scs.session->absStartTime(), scs.session->absEndTime());
  } else {
      }
   else
      {
    scs.duration = scs.session->playEndTime() - scs.session->playStartTime();
    rtspClient->sendPlayCommand(*scs.session, continueAfterPLAY);
  }
}
void continueAfterSETUP(RTSPClient* rtspClient, int resultCode, char* resultString) {
  do {
void continueAfterSETUP(RTSPClient* rtspClient, int resultCode, char* resultString)
{
   do
      {
    UsageEnvironment& env = rtspClient->envir(); // alias
    StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias
    if (resultCode != 0) {
      env << *rtspClient << "Failed to set up the \"" << *scs.subsession << "\" subsession: " << resultString << "\n";
         if (resultCode != 0)
            {
               LOG_ERROR << *rtspClient << "Failed to set up the \"" << *scs.subsession << "\" subsession: " << resultString;
      break;
    }
    env << *rtspClient << "Set up the \"" << *scs.subsession << "\" subsession (";
    if (scs.subsession->rtcpIsMuxed()) {
      env << "client port " << scs.subsession->clientPortNum();
    } else {
      env << "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1;
         LOG_INFO << *rtspClient << "Set up the \"" << *scs.subsession << "\" subsession (";
         if (scs.subsession->rtcpIsMuxed())
            {
               LOG_INFO << "client port " << scs.subsession->clientPortNum();
    }
    env << ")\n";
         else
            {
               LOG_INFO << "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1;
            }
         LOG_INFO << ")";
    // Having successfully setup the subsession, create a data sink for it, and call "startPlaying()" on it.
    // (This will prepare the data sink to receive data; the actual flow of data from the client won't start happening until later,
@@ -316,36 +338,42 @@
    scs.subsession->sink = DummySink::createNew(env, ((ourRTSPClient*)rtspClient)->rtspConfig, 
                                    *scs.subsession, rtspClient->url());
      // perhaps use your own custom "MediaSink" subclass instead
    if (scs.subsession->sink == NULL) {
      env << *rtspClient << "Failed to create a data sink for the \"" << *scs.subsession
     << "\" subsession: " << env.getResultMsg() << "\n";
         if (scs.subsession->sink == NULL)
            {
               LOG_ERROR << *rtspClient << "Failed to create a data sink for the \"" << *scs.subsession
                   << "\" subsession: " << env.getResultMsg();
      break;
    }
    env << *rtspClient << "Created a data sink for the \"" << *scs.subsession << "\" subsession\n";
         LOG_INFO << *rtspClient << "Created a data sink for the \"" << *scs.subsession << "\" subsession";
    scs.subsession->miscPtr = rtspClient; // a hack to let subsession handler functions get the "RTSPClient" from the subsession 
    scs.subsession->sink->startPlaying(*(scs.subsession->readSource()),
                   subsessionAfterPlaying, scs.subsession);
    // Also set a handler to be called if a RTCP "BYE" arrives for this subsession:
    if (scs.subsession->rtcpInstance() != NULL) {
         if (scs.subsession->rtcpInstance() != NULL)
            {
      scs.subsession->rtcpInstance()->setByeHandler(subsessionByeHandler, scs.subsession);
    }
  } while (0);
      }
   while (0);
  delete[] resultString;
  // Set up the next subsession, if any:
  setupNextSubsession(rtspClient);
}
void continueAfterPLAY(RTSPClient* rtspClient, int resultCode, char* resultString) {
void continueAfterPLAY(RTSPClient* rtspClient, int resultCode, char* resultString)
{
  Boolean success = False;
  do {
   do
      {
    UsageEnvironment& env = rtspClient->envir(); // alias
    StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias
    if (resultCode != 0) {
      env << *rtspClient << "Failed to start playing session: " << resultString << "\n";
         if (resultCode != 0)
            {
               LOG_ERROR << *rtspClient << "Failed to start playing session: " << resultString;
      break;
    }
@@ -353,24 +381,28 @@
    // using a RTCP "BYE").  This is optional.  If, instead, you want to keep the stream active - e.g., so you can later
    // 'seek' back within it and do another RTSP "PLAY" - then you can omit this code.
    // (Alternatively, if you don't want to receive the entire stream, you could set this timer for some shorter value.)
    if (scs.duration > 0) {
         if (scs.duration > 0)
            {
      unsigned const delaySlop = 2; // number of seconds extra to delay, after the stream's expected duration.  (This is optional.)
      scs.duration += delaySlop;
      unsigned uSecsToDelay = (unsigned)(scs.duration*1000000);
      scs.streamTimerTask = env.taskScheduler().scheduleDelayedTask(uSecsToDelay, (TaskFunc*)streamTimerHandler, rtspClient);
    }
    env << *rtspClient << "Started playing session";
    if (scs.duration > 0) {
      env << " (for up to " << scs.duration << " seconds)";
         LOG_INFO << *rtspClient << "Started playing session";
         if (scs.duration > 0)
            {
               LOG_INFO << " (for up to " << scs.duration << " seconds)";
    }
    env << "...\n";
         LOG_INFO << "...";
    success = True;
  } while (0);
      }
   while (0);
  delete[] resultString;
  if (!success) {
   if (!success)
      {
    // An unrecoverable error occurred with this stream.
    shutdownStream(rtspClient);
  }
@@ -379,7 +411,8 @@
// Implementation of the other event handlers:
void subsessionAfterPlaying(void* clientData) {
void subsessionAfterPlaying(void* clientData)
{
  MediaSubsession* subsession = (MediaSubsession*)clientData;
  RTSPClient* rtspClient = (RTSPClient*)(subsession->miscPtr);
@@ -390,7 +423,8 @@
  // Next, check whether *all* subsessions' streams have now been closed:
  MediaSession& session = subsession->parentSession();
  MediaSubsessionIterator iter(session);
  while ((subsession = iter.next()) != NULL) {
   while ((subsession = iter.next()) != NULL)
      {
    if (subsession->sink != NULL) return; // this subsession is still active
  }
@@ -398,18 +432,20 @@
  shutdownStream(rtspClient);
}
void subsessionByeHandler(void* clientData) {
void subsessionByeHandler(void* clientData)
{
  MediaSubsession* subsession = (MediaSubsession*)clientData;
  RTSPClient* rtspClient = (RTSPClient*)subsession->miscPtr;
  UsageEnvironment& env = rtspClient->envir(); // alias
  env << *rtspClient << "Received RTCP \"BYE\" on \"" << *subsession << "\" subsession\n";
   LOG_INFO << *rtspClient << "Received RTCP \"BYE\" on \"" << *subsession << "\" subsession";
  // Now act as if the subsession had closed:
  subsessionAfterPlaying(subsession);
}
void streamTimerHandler(void* clientData) {
void streamTimerHandler(void* clientData)
{
  ourRTSPClient* rtspClient = (ourRTSPClient*)clientData;
  StreamClientState& scs = rtspClient->scs; // alias
@@ -419,22 +455,27 @@
  shutdownStream(rtspClient);
}
void shutdownStream(RTSPClient* rtspClient, int exitCode) {
void shutdownStream(RTSPClient* rtspClient, int exitCode)
{
  UsageEnvironment& env = rtspClient->envir(); // alias
  StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias
  // First, check whether any subsessions have still to be closed:
  if (scs.session != NULL) {
   if (scs.session != NULL)
      {
    Boolean someSubsessionsWereActive = False;
    MediaSubsessionIterator iter(*scs.session);
    MediaSubsession* subsession;
    while ((subsession = iter.next()) != NULL) {
      if (subsession->sink != NULL) {
         while ((subsession = iter.next()) != NULL)
            {
               if (subsession->sink != NULL)
                  {
   Medium::close(subsession->sink);
   subsession->sink = NULL;
   if (subsession->rtcpInstance() != NULL) {
                     if (subsession->rtcpInstance() != NULL)
                        {
     subsession->rtcpInstance()->setByeHandler(NULL, NULL); // in case the server sends a RTCP "BYE" while handling "TEARDOWN"
   }
@@ -442,18 +483,20 @@
      }
    }
    if (someSubsessionsWereActive) {
         if (someSubsessionsWereActive)
            {
      // Send a RTSP "TEARDOWN" command, to tell the server to shutdown the stream.
      // Don't bother handling the response to the "TEARDOWN".
      rtspClient->sendTeardownCommand(*scs.session, NULL);
    }
  }
  env << *rtspClient << "Closing the stream.\n";
   LOG_NOTICE << *rtspClient << "Closing the stream.";
  Medium::close(rtspClient);
    // Note that this will also cause this stream's "StreamClientState" structure to get reclaimed.
  if (--rtspClientCount == 0) {
   if (--rtspClientCount == 0)
      {
    // The final stream has ended, so exit the application now.
    // (Of course, if you're embedding this code into your own application, you might want to comment this out,
    // and replace it with "eventLoopWatchVariable = 1;", so that we leave the LIVE555 event loop, and continue running "main()".)
@@ -464,30 +507,34 @@
// Implementation of "ourRTSPClient":
ourRTSPClient* ourRTSPClient::createNew(UsageEnvironment& env, const RTSPConfig& _rtspConfig)
ourRTSPClient* ourRTSPClient::createNew(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig)
{
  return new ourRTSPClient(env, _rtspConfig);
}
ourRTSPClient::ourRTSPClient(UsageEnvironment& env, const RTSPConfig& _rtspConfig)
ourRTSPClient::ourRTSPClient(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig)
  : RTSPClient(env, _rtspConfig.rtspURL.c_str(), _rtspConfig.verbosityLevel, _rtspConfig.progName.c_str(), 
            _rtspConfig.tunnelOverHTTPPortNum, -1), rtspConfig(_rtspConfig)
{
}
ourRTSPClient::~ourRTSPClient() {
ourRTSPClient::~ourRTSPClient()
{
}
// Implementation of "StreamClientState":
StreamClientState::StreamClientState()
  : iter(NULL), session(NULL), subsession(NULL), streamTimerTask(NULL), duration(0.0) {
   : iter(NULL), session(NULL), subsession(NULL), streamTimerTask(NULL), duration(0.0)
{
}
StreamClientState::~StreamClientState() {
StreamClientState::~StreamClientState()
{
  delete iter;
  if (session != NULL) {
   if (session != NULL)
      {
    // We also need to delete "session", and unschedule "streamTimerTask" (if set)
    UsageEnvironment& env = session->envir(); // alias
@@ -498,12 +545,12 @@
// Implementation of "DummySink":
DummySink* DummySink::createNew(UsageEnvironment& env, const RTSPConfig& _rtspConfig, MediaSubsession& subsession, char const* streamId)
DummySink* DummySink::createNew(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig, MediaSubsession& subsession, char const* streamId)
{
  return new DummySink(env, _rtspConfig, subsession, streamId);
}
DummySink::DummySink(UsageEnvironment& env, const RTSPConfig& _rtspConfig, MediaSubsession& subsession, char const* streamId)
DummySink::DummySink(UsageEnvironment& env, const PL_RTSPClient_Config& _rtspConfig, MediaSubsession& subsession, char const* streamId)
  : MediaSink(env), rtspConfig(_rtspConfig), fSubsession(subsession)
{
   fStreamId = strDup(streamId);
@@ -512,7 +559,10 @@
   // ffmpeg need AUX header
   if (rtspConfig.aux)
   {
      fReceiveBuffer[0]=0x00; fReceiveBuffer[1]=0x00; fReceiveBuffer[2]=0x00; fReceiveBuffer[3]=0x01;
         fReceiveBuffer[0]=0x00;
         fReceiveBuffer[1]=0x00;
         fReceiveBuffer[2]=0x00;
         fReceiveBuffer[3]=0x01;
   }
   //parse sdp
@@ -524,7 +574,8 @@
   //std::cout << strFmtp << std::endl;
}
DummySink::~DummySink() {
DummySink::~DummySink()
{
  delete[] fReceiveBuffer;
  delete[] fStreamId;
}
@@ -546,22 +597,26 @@
}
void DummySink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes,
              struct timeval presentationTime, unsigned /*durationInMicroseconds*/) {
                                  struct timeval presentationTime, unsigned /*durationInMicroseconds*/)
{
  // We've just received a frame of data.  (Optionally) print out information about it:
#ifdef DEBUG_PRINT_EACH_RECEIVED_FRAME
  if (fStreamId != NULL) envir() << "Stream \"" << fStreamId << "\"; ";
  envir() << fSubsession.mediumName() << "/" << fSubsession.codecName() << ":\tReceived " << frameSize << " bytes";
  if (numTruncatedBytes > 0) envir() << " (with " << numTruncatedBytes << " bytes truncated)";
   if (fStreamId != NULL)
      LOG_DEBUG << "Stream \"" << fStreamId << "\"; ";
   LOG_DEBUG << "\t" << fSubsession.mediumName() << "/" << fSubsession.codecName() << ":\tReceived " << frameSize << " bytes";
   if (numTruncatedBytes > 0)
      LOG_DEBUG << " (with " << numTruncatedBytes << " bytes truncated)";
  char uSecsStr[6+1]; // used to output the 'microseconds' part of the presentation time
  sprintf(uSecsStr, "%06u", (unsigned)presentationTime.tv_usec);
  envir() << ".\tPresentation time: " << (int)presentationTime.tv_sec << "." << uSecsStr;
  if (fSubsession.rtpSource() != NULL && !fSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP()) {
    envir() << "!"; // mark the debugging output to indicate that this presentation time is not RTCP-synchronized
   LOG_DEBUG << "\tPresentation time: " << (int)presentationTime.tv_sec << "." << uSecsStr;
   if (fSubsession.rtpSource() != NULL && !fSubsession.rtpSource()->hasBeenSynchronizedUsingRTCP())
      {
         LOG_DEBUG << "\tPTS not RTCP-synchronized"; // mark the debugging output to indicate that this presentation time is not RTCP-synchronized
  }
#ifdef DEBUG_PRINT_NPT
  envir() << "\tNPT: " << fSubsession.getNormalPlayTime(presentationTime);
   LOG_DEBUG << "\tNPT: " << fSubsession.getNormalPlayTime(presentationTime);
#endif
  envir() << "\n";
#endif
  
  // Then continue, to request the next frame of data:
@@ -570,7 +625,8 @@
Boolean DummySink::continuePlaying()
{
   if (fSource == NULL) return False; // sanity check (should not happen)
   if (fSource == NULL)
      return False; // sanity check (should not happen)
   rtsp_client_continue_callback(rtspConfig.args);