예제 #1
0
Boolean awaitConfigInfo(RTPSink* sink)
{
    // Check whether the sink's 'auxSDPLine()' is ready:
    checkForAuxSDPLine(sink);
    uenv->taskScheduler().doEventLoop(&doneFlag);
    char const* auxSDPLine = sink->auxSDPLine();
    return auxSDPLine != NULL;
}
예제 #2
0
char const* H264LiveServerMediaSession::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource) {
	if (fAuxSDPLine != NULL)
		return fAuxSDPLine;
	if (fDummySink == NULL) {
		fDummySink = rtpSink;
		fDummySink->startPlaying(*inputSource, afterPlayingDummy, this);
		checkForAuxSDPLine(this);
	}

	envir().taskScheduler().doEventLoop(&fDoneFlag);
	return fAuxSDPLine;
}
void H264VideoFileServerMediaSubsession::checkForAuxSDPLine1()
{
    // If encode stream is mjpeg, the done flag is also needed to be set.
    // If not set for mjpeg, rtsp_server will not come out of  DESBRIBE command processing from client
    // Modified by Zhaoyang
    //if (fDummyRTPSink->auxSDPLine() != NULL) {
#if defined( USE_V3_3_CODE )
    if (fEncType == IAV_ENCODE_MJPEG || fDummyRTPSink->auxSDPLine() != NULL)
    {
#else
    if (fDummyRTPSink->auxSDPLine() != NULL)
    {
#endif
        // Signal the event loop that we're done:
        setDoneFlag();
    }
    else
    {
        // try again after a brief delay:
        int uSecsToDelay = 100000; // 100 ms
        nextTask() = envir().taskScheduler().scheduleDelayedTask(uSecsToDelay,
                     (TaskFunc*)checkForAuxSDPLine, this);
    }
}

char const* H264VideoFileServerMediaSubsession
::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource)
{
    // Note: For MPEG-4 video files, the 'config' information isn't known
    // until we start reading the file.  This means that "rtpSink"s
    // "auxSDPLine()" will be NULL initially, and we need to start reading
    // data from our file until this changes.
    fDummyRTPSink = rtpSink;

    // Start reading the file:
    fDummyRTPSink->startPlaying(*inputSource, afterPlayingDummy, this);

    // Check whether the sink's 'auxSDPLine()' is ready:
    checkForAuxSDPLine(this);

    envir().taskScheduler().doEventLoop(&fDoneFlag);

    char const* auxSDPLine = fDummyRTPSink->auxSDPLine();
    return auxSDPLine;
}
char const* H264LiveStreamServerMediaSubsession::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource) {
  if (fAuxSDPLine != NULL) return fAuxSDPLine; // it's already been set up (for a previous client)

  if (fDummyRTPSink == NULL) { // we're not already setting it up for another, concurrent stream
    // Note: For H264 video files, the 'config' information ("profile-level-id" and "sprop-parameter-sets") isn't known
    // until we start reading the file.  This means that "rtpSink"s "auxSDPLine()" will be NULL initially,
    // and we need to start reading data from our file until this changes.
    fDummyRTPSink = rtpSink;

    // Start reading the file:
    fDummyRTPSink->startPlaying(*inputSource, afterPlayingDummy, this);

    // Check whether the sink's 'auxSDPLine()' is ready:
    checkForAuxSDPLine(this);
  }

  envir().taskScheduler().doEventLoop(&fDoneFlag);

  return fAuxSDPLine;
}
char const* WISH264VideoServerMediaSubsession
::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource) {
  // Note: For MPEG-4 video buffer, the 'config' information isn't known
  // until we start reading the Buffer.  This means that "rtpSink"s
  // "auxSDPLine()" will be NULL initially, and we need to start reading
  // data from our buffer until this changes.
  fDummyRTPSink = rtpSink;

  // Start reading the buffer:
  fDummyRTPSink->startPlaying(*inputSource, afterPlayingDummy, this);

  // Check whether the sink's 'auxSDPLine()' is ready:
  checkForAuxSDPLine(this);

  fDoneFlag = 1;
  envir().taskScheduler().doEventLoop(&fDoneFlag);

  char const* auxSDPLine = fDummyRTPSink->auxSDPLine();
  return auxSDPLine;
  //return NULL;
}