#include <H264VideoRTPSink.hh>
#include <H264VideoStreamFramer.hh>
#include "h264livevideoservermediasubsession.h"
#include "h264livevideosource.h"
H264LiveVideoServerMediaSubsession* H264LiveVideoServerMediaSubsession::createNew(UsageEnvironment &env, Boolean reuseFirstSource, void *listener)
{
return new H264LiveVideoServerMediaSubsession(env, reuseFirstSource, listener);
}
H264LiveVideoServerMediaSubsession::H264LiveVideoServerMediaSubsession(UsageEnvironment& env, Boolean reuseFirstSource, void *listener)
:OnDemandServerMediaSubsession(env, reuseFirstSource),
fAuxSDPLine(NULL), fDoneFlag(0), fDummyRTPSink(NULL)
{
fListener = listener;
}
H264LiveVideoServerMediaSubsession::~H264LiveVideoServerMediaSubsession()
{
}
static void afterPlayingDummy(void* clientData)
{
H264LiveVideoServerMediaSubsession* subsess = (H264LiveVideoServerMediaSubsession*)clientData;
subsess->afterPlayingDummy1();
}
void H264LiveVideoServerMediaSubsession::afterPlayingDummy1()
{
// Unschedule any pending 'checking' task:
envir().taskScheduler().unscheduleDelayedTask(nextTask());
// Signal the event loop that we're done:
setDoneFlag();
}
static void checkForAuxSDPLine(void* clientData)
{
H264LiveVideoServerMediaSubsession* subsess = (H264LiveVideoServerMediaSubsession*)clientData;
subsess->checkForAuxSDPLine1();
}
void H264LiveVideoServerMediaSubsession::checkForAuxSDPLine1()
{
char const* dasl;
if (fAuxSDPLine != NULL) {
// Signal the event loop that we're done:
setDoneFlag();
}
else if (fDummyRTPSink != NULL && (dasl = fDummyRTPSink->auxSDPLine()) != NULL) {
fAuxSDPLine = strDup(dasl);
fDummyRTPSink = NULL;
// Signal the event loop that we're done:
setDoneFlag();
}
else if (!fDoneFlag) {
// try again after a brief delay:
int uSecsToDelay = 100;
nextTask() = envir().taskScheduler().scheduleDelayedTask(uSecsToDelay, (TaskFunc*)checkForAuxSDPLine, this);
}
}
char const* H264LiveVideoServerMediaSubsession::getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource)
{
if (fAuxSDPLine != NULL)
return fAuxSDPLine; // it's already been set up (for a previous client)
if (fDummyRTPSink == NULL) {
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;
}
FramedSource* H264LiveVideoServerMediaSubsession::createNewStreamSource(unsigned, unsigned& estBitrate)
{
estBitrate = 1000; // kbps, estimate
// Create the video source:
H264LiveVideoSource* liveSource = H264LiveVideoSource::createNew(envir(), fListener);
if (liveSource == NULL)
return NULL;
// Create a framer for the Video Elementary Stream:
return H264VideoStreamFramer::createNew(envir(), liveSource);
}
RTPSink* H264LiveVideoServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
unsigned char rtpPayloadTypeIfDynamic,
FramedSource* /*inputSource*/)
{
return H264VideoRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic);
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
live555 rtsp+x264模拟实时编码推流 (243个子文件)
H264LiveVideoServerMediaSubsession.cpp 3KB
live555_rtsp.cpp 2KB
H264EncWrapper.cpp 2KB
H264LiveVideoSource.cpp 1KB
main.cpp 192B
libcrypto-1_1-x64.dll 3.15MB
libcrypto-1_1-x64.dll 3.15MB
libssl-1_1-x64.dll 644KB
libssl-1_1-x64.dll 644KB
rtsp_server.exe 3.44MB
rtsp_server.vcxproj.filters 2KB
x264.h 48KB
NetCommon.h 3KB
H264LiveVideoServerMediaSubsession.h 1KB
live555_rtsp.h 824B
H264LiveVideoSource.h 601B
H264EncWrapper.h 580B
x264_config.h 227B
RTSPClient.hh 23KB
RTSPServer.hh 21KB
MediaSession.hh 16KB
ProxyServerMediaSession.hh 10KB
RTCP.hh 10KB
OnDemandServerMediaSubsession.hh 10KB
GenericMediaServer.hh 9KB
RTPSource.hh 9KB
RTPSink.hh 9KB
MatroskaFile.hh 9KB
ServerMediaSession.hh 8KB
Groupsock.hh 7KB
UsageEnvironment.hh 7KB
QuickTimeFileSink.hh 7KB
SRTPCryptographicContext.hh 6KB
RTSPRegisterSender.hh 6KB
OggFile.hh 6KB
uLawAudioFilter.hh 6KB
NetAddress.hh 6KB
MultiFramedRTPSink.hh 6KB
GroupsockHelper.hh 6KB
MultiFramedRTPSource.hh 5KB
MPEG2TransportFileServerMediaSubsession.hh 5KB
SIPClient.hh 5KB
MPEG1or2Demux.hh 5KB
MPEG2TransportStreamMultiplexor.hh 5KB
liveMedia.hh 5KB
MediaSink.hh 5KB
RTPInterface.hh 5KB
DelayQueue.hh 5KB
MPEG4LATMAudioRTPSource.hh 4KB
MPEG2TransportStreamIndexFile.hh 4KB
StreamReplicator.hh 4KB
MatroskaFileServerDemux.hh 4KB
AVIFileSink.hh 4KB
Media.hh 4KB
MP3ADUinterleaving.hh 4KB
BasicUsageEnvironment0.hh 4KB
VorbisAudioRTPSink.hh 4KB
T140TextRTPSink.hh 4KB
MPEG2TransportStreamTrickModeFilter.hh 4KB
H264or5VideoStreamFramer.hh 4KB
OggFileServerDemux.hh 3KB
BasicHashTable.hh 3KB
PassiveServerMediaSubsession.hh 3KB
MPEG2IndexFromTransportStream.hh 3KB
BasicUsageEnvironment.hh 3KB
OggFileSink.hh 3KB
DVVideoStreamFramer.hh 3KB
DigestAuthentication.hh 3KB
FramedSource.hh 3KB
MPEG1or2VideoStreamDiscreteFramer.hh 3KB
SimpleRTPSink.hh 3KB
MIKEY.hh 3KB
MP3AudioFileServerMediaSubsession.hh 3KB
HLSSegmenter.hh 3KB
MP3ADU.hh 3KB
NetInterface.hh 3KB
TheoraVideoRTPSink.hh 3KB
MPEG4VideoStreamDiscreteFramer.hh 3KB
ByteStreamFileSource.hh 3KB
WAVAudioFileServerMediaSubsession.hh 3KB
MPEG2TransportStreamFramer.hh 3KB
RawVideoRTPSink.hh 3KB
MPEG4ESVideoRTPSink.hh 3KB
MediaTranscodingTable.hh 3KB
MPEGVideoStreamFramer.hh 3KB
Locale.hh 3KB
MPEG1or2VideoRTPSink.hh 3KB
RTSPCommon.hh 3KB
MPEG4GenericRTPSource.hh 3KB
InputFile.hh 3KB
H265VideoRTPSink.hh 3KB
FileSink.hh 3KB
MPEG2TransportStreamFromESSource.hh 3KB
MPEG1or2FileServerDemux.hh 3KB
WAVAudioFileSource.hh 3KB
VorbisAudioRTPSource.hh 3KB
MPEG4VideoStreamFramer.hh 3KB
SimpleRTPSource.hh 3KB
MPEG4GenericRTPSink.hh 3KB
ByteStreamMultiFileSource.hh 3KB
共 243 条
- 1
- 2
- 3
资源评论
- l712302023-11-23运行久了过后,在liveMedia.lib中发生崩溃,具体位置在test4Bytes()中
猪蹄小凤爪儿
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功