2021-01-07 00:26:08 +08:00
|
|
|
/* ---------------------------------------------------------------------------
|
|
|
|
** This software is in the public domain, furnished "as is", without technical
|
|
|
|
** support, and with no warranty, express or implied, as to its usefulness for
|
|
|
|
** any purpose.
|
|
|
|
**
|
|
|
|
** ServerMediaSubsession.cpp
|
|
|
|
**
|
|
|
|
** -------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include "zm_rtsp_server_unicast_server_media_subsession.h"
|
2021-02-04 11:47:28 +08:00
|
|
|
|
|
|
|
#include "zm_config.h"
|
2021-02-28 01:26:19 +08:00
|
|
|
#include "zm_rtsp_server_fifo_source.h"
|
2021-01-07 00:26:08 +08:00
|
|
|
|
2021-02-04 11:47:28 +08:00
|
|
|
#if HAVE_RTSP_SERVER
|
2021-01-07 00:26:08 +08:00
|
|
|
// -----------------------------------------
|
|
|
|
// ServerMediaSubsession for Unicast
|
|
|
|
// -----------------------------------------
|
|
|
|
UnicastServerMediaSubsession* UnicastServerMediaSubsession::createNew(
|
2021-01-23 09:24:12 +08:00
|
|
|
UsageEnvironment& env,
|
|
|
|
StreamReplicator* replicator,
|
|
|
|
//FramedSource *source,
|
|
|
|
const std::string& format
|
|
|
|
) {
|
2021-01-07 00:26:08 +08:00
|
|
|
return new UnicastServerMediaSubsession(env, replicator, format);
|
2021-01-23 09:24:12 +08:00
|
|
|
//return new UnicastServerMediaSubsession(env, replicator, source, format);
|
2021-01-07 00:26:08 +08:00
|
|
|
}
|
|
|
|
|
2021-01-23 09:24:12 +08:00
|
|
|
FramedSource* UnicastServerMediaSubsession::createNewStreamSource(
|
|
|
|
unsigned clientSessionId,
|
|
|
|
unsigned& estBitrate
|
|
|
|
) {
|
|
|
|
FramedSource* replica = m_replicator->createStreamReplica();
|
|
|
|
return createSource(envir(), replica, m_format);
|
2021-01-07 00:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
RTPSink* UnicastServerMediaSubsession::createNewRTPSink(
|
2021-01-23 09:24:12 +08:00
|
|
|
Groupsock* rtpGroupsock,
|
|
|
|
unsigned char rtpPayloadTypeIfDynamic,
|
|
|
|
FramedSource* inputSource
|
|
|
|
) {
|
|
|
|
return createSink(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic, m_format, inputSource);
|
2021-01-07 00:26:08 +08:00
|
|
|
}
|
|
|
|
|
2021-01-23 09:24:12 +08:00
|
|
|
char const* UnicastServerMediaSubsession::getAuxSDPLine(
|
|
|
|
RTPSink* rtpSink, FramedSource* inputSource
|
|
|
|
) {
|
2021-02-28 01:26:19 +08:00
|
|
|
return this->getAuxLine(
|
|
|
|
dynamic_cast<ZoneMinderFifoSource*>(m_replicator->inputSource()),
|
|
|
|
rtpSink->rtpPayloadType());
|
2021-01-07 00:26:08 +08:00
|
|
|
}
|
2021-02-04 11:59:03 +08:00
|
|
|
#endif // HAVE_RTSP_SERVER
|