houxiao
2017-08-09 d9ffa50c7e8d6b8c3157690aef8e2a70af1d1695
RtspFace/FFmpegRTSPServer/LiveServerMediaSubsession.cpp
@@ -7,9 +7,11 @@
//
#include "LiveServerMediaSubsession.h"
#include "H264FramedSource.h"
namespace MESAI
{
   LiveServerMediaSubsession * LiveServerMediaSubsession::createNew(UsageEnvironment& env, StreamReplicator* replicator)
   { 
      return new LiveServerMediaSubsession(env,replicator);
@@ -18,6 +20,7 @@
   FramedSource* LiveServerMediaSubsession::createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate)
   {
      FramedSource* source = m_replicator->createStreamReplica();
   estBitrate = 5000;//#todo
      return H264VideoStreamDiscreteFramer::createNew(envir(), source);
   }
      
@@ -26,4 +29,25 @@
      return H264VideoRTPSink::createNew(envir(), rtpGroupsock,rtpPayloadTypeIfDynamic);
   }
char const* LiveServerMediaSubsession::sdpLines()
{
   if (m_SDPLines.empty())
   {
      m_SDPLines.assign(OnDemandServerMediaSubsession::sdpLines());
      H264FramedSource* framedSource = nullptr;
      {
         FramedSource* _framedSource = m_replicator->inputSource();
         framedSource = dynamic_cast<H264FramedSource*>(_framedSource);
      };
      if (framedSource != nullptr)
      {
         m_SDPLines.append(framedSource->getAuxLine());
      }
   }
   return m_SDPLines.c_str();
}
}