[Live-devel] problems with DeviceSource and OnDemandServerMediaSubsession

Ottavio Campana ottavio at videotec.com
Wed Jul 8 03:36:39 PDT 2009


Hi,

I'm trying to create a subclass of DeviceSource, namely
VideoDeviceSource that extracts the NAL units of an H.264 compressed
video from a queue and feeds them to a subclass of
OnDemandServerMediaSubsession called VideoOnDemandServerMediaSubsession .

As client I use openRTSP to fetch the stream. It connects but it never
receives data. I noticed that VideoDeviceSource::deliverFrame() is never
called, but I cannot understand why. I suspect it's a problem of
VideoOnDemandServerMediaSubsession but I'd like to ask you for feedback.

My implementation of VideoOnDemandServerMediaSubsession is attached. Do
you see anything wrong? (f_rtsp_layer is a pointer to a struct holding a
bunch of variables)

#include "VideoOnDemandServerMediaSubsession.h"
#include "VideoDeviceSource.h"
#include <H264VideoRTPSink.hh>

VideoOnDemandServerMediaSubsession *
VideoOnDemandServerMediaSubsession::createNew (UsageEnvironment & env,
                                               Boolean reuseFirstSource,
                                               rtsp_layer_t * rtsp_layer)
{
  return new VideoOnDemandServerMediaSubsession (env, reuseFirstSource,
rtsp_layer);
}

VideoOnDemandServerMediaSubsession::VideoOnDemandServerMediaSubsession
(UsageEnvironment & env, Boolean reuseFirstSource, rtsp_layer_t *
rtsp_layer):OnDemandServerMediaSubsession (env,
                               reuseFirstSource), f_rtsp_layer (rtsp_layer)
{
}

VideoOnDemandServerMediaSubsession::~VideoOnDemandServerMediaSubsession ()
{
}

FramedSource *
VideoOnDemandServerMediaSubsession::
createNewStreamSource (unsigned clientSessionId, unsigned &estBitrate)
{
  /* this number of kbps is now totally fake, we just use this as a
remider. */
  estBitrate = 2000;

  return VideoDeviceSource::createNew (envir (), f_rtsp_layer);
}

RTPSink *
VideoOnDemandServerMediaSubsession::createNewRTPSink (Groupsock *
                                                      rtpGroupsock,
                                                      unsigned char

rtpPayloadTypeIfDynamic,
                                                      FramedSource *
                                                      inputSource)
{
  return H264VideoRTPSink::createNew (envir (), rtpGroupsock, 96,
                                      f_rtsp_layer->profile_idc,

((VideoDeviceSource*)inputSource)->sprop_parameter_sets() );
}


More information about the live-devel mailing list