Added --ignore-sending-port option to RTSP output

This commit is contained in:
Thulinma 2017-10-11 11:02:46 +02:00
parent d700571922
commit b81f980932
2 changed files with 9 additions and 1 deletions

View file

@ -26,6 +26,7 @@ namespace Mist{
setBlocking(false); setBlocking(false);
maxSkipAhead = 0; maxSkipAhead = 0;
expectTCP = false; expectTCP = false;
checkPort = !config->getBool("ignsendport");
lastTimeSync = 0; lastTimeSync = 0;
mainConn = &myConn; mainConn = &myConn;
classPointer = this; classPointer = this;
@ -86,6 +87,12 @@ namespace Mist{
capa["optional"]["maxsend"]["option"] = "--max-packet-size"; capa["optional"]["maxsend"]["option"] = "--max-packet-size";
capa["optional"]["maxsend"]["short"] = "m"; capa["optional"]["maxsend"]["short"] = "m";
capa["optional"]["ignsendport"]["name"] = "Ignore sending port #";
capa["optional"]["ignsendport"]["help"] = "Ignore the sending port number of incoming data";
capa["optional"]["ignsendport"]["default"] = false;
capa["optional"]["ignsendport"]["option"] = "--ignore-sending-port";
capa["optional"]["ignsendport"]["short"] = "I";
cfg->addConnectorOptions(5554, capa); cfg->addConnectorOptions(5554, capa);
config = cfg; config = cfg;
} }
@ -372,7 +379,7 @@ namespace Mist{
it != sdpState.tracks.end(); ++it){ it != sdpState.tracks.end(); ++it){
Socket::UDPConnection &s = it->second.data; Socket::UDPConnection &s = it->second.data;
while (s.Receive()){ while (s.Receive()){
if (s.getDestPort() != it->second.cPort){ if (s.getDestPort() != it->second.cPort && checkPort){
// wrong sending port, ignore packet // wrong sending port, ignore packet
continue; continue;
} }

View file

@ -27,6 +27,7 @@ namespace Mist{
std::string source; std::string source;
uint64_t lastTimeSync; uint64_t lastTimeSync;
bool expectTCP; bool expectTCP;
bool checkPort;
bool handleTCP(); bool handleTCP();
void handleUDP(); void handleUDP();
}; };