支持动态创建GB28181收流端口并可指定stream_id:#338

This commit is contained in:
xiongziliang
2020-07-07 10:01:12 +08:00
parent 30260e5414
commit 477f99b756
10 changed files with 89 additions and 73 deletions

View File

@@ -38,6 +38,7 @@ static bool loadFile(const char *path){
uint16_t len;
char rtp[2 * 1024];
struct sockaddr addr = {0};
string stream_id;
while (true) {
if (2 != fread(&len, 1, 2, fp)) {
WarnL;
@@ -55,7 +56,7 @@ static bool loadFile(const char *path){
}
uint32_t timeStamp;
RtpSelector::Instance().inputRtp(nullptr,rtp,len, &addr,&timeStamp);
RtpSelector::Instance().inputRtp(nullptr, stream_id, rtp, len, &addr, &timeStamp);
if(timeStamp_last){
auto diff = timeStamp - timeStamp_last;
if(diff > 0 && diff < 500){