forked from sambios/UsbCameraRtspServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFfmpegH264LiveServerMediaSubsession.cpp
41 lines (32 loc) · 1.36 KB
/
FfmpegH264LiveServerMediaSubsession.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "FfmpegH264LiveServerMediaSubsession.h"
#include "FfmpegFrameSource.h"
ServerMediaSubsession* FfmpegH264LiveServerMediaSubsession::createNew(UsageEnvironment &env, const char *inputType, const char *inputDevice)
{
return new FfmpegH264LiveServerMediaSubsession(inputType, inputDevice, env);
}
FfmpegH264LiveServerMediaSubsession::FfmpegH264LiveServerMediaSubsession(const char *inputType,
const char *inputDevice,
UsageEnvironment &env,
portNumBits initialPortNum,
Boolean multiplexRTCPWithRTP):
OnDemandServerMediaSubsession(env, true, initialPortNum, multiplexRTCPWithRTP)
{
}
FfmpegH264LiveServerMediaSubsession::~FfmpegH264LiveServerMediaSubsession()
{
}
// Override
FramedSource* FfmpegH264LiveServerMediaSubsession::createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate)
{
estBitrate = 500; // kbps, estimate
FFmpegH264Source *ffmpegSource = FFmpegH264Source::createNew(envir());
// Create a framer for the Video Elementary Stream:
return H264VideoStreamFramer::createNew(envir(), ffmpegSource);
}
// "estBitrate" is the stream's estimated bitrate, in kbps
RTPSink* FfmpegH264LiveServerMediaSubsession::createNewRTPSink(Groupsock* rtpGroupsock,
unsigned char rtpPayloadTypeIfDynamic,
FramedSource* inputSource)
{
return H264VideoRTPSink::createNew(envir(), rtpGroupsock, rtpPayloadTypeIfDynamic);
}