Fixed RTSP input not counting as input, fixed UDP-style input disconnect bug

# Conflicts:
#	src/output/output.h
This commit is contained in:
Thulinma 2017-02-02 11:31:00 +01:00
parent 28106cf396
commit 7b1ef6c76e
3 changed files with 12 additions and 2 deletions

View file

@ -95,12 +95,12 @@ namespace Mist {
int pageNumMax(long unsigned int trackId);
bool isRecordingToFile;
unsigned int lastStats;///<Time of last sending of stats.
long long unsigned int firstTime;///< Time of first packet after last seek. Used for real-time sending.
std::map<unsigned long, unsigned long> nxtKeyNum;///< Contains the number of the next key, for page seeking purposes.
std::set<sortedPageInfo> buffer;///< A sorted list of next-to-be-loaded packets.
bool sought;///<If a seek has been done, this is set to true. Used for seeking on prepareNext().
uint64_t lastRecv;
protected://these are to be messed with by child classes
uint64_t lastRecv;
long long unsigned int firstTime;///< Time of first packet after last seek. Used for real-time sending.
virtual std::string getConnectedHost();
virtual std::string getConnectedBinHost();
virtual std::string getStatsName();

View file

@ -147,6 +147,14 @@ namespace Mist {
}
std::string OutRTSP::getStatsName(){
if (isPushing){
return "INPUT";
}else{
return Output::getStatsName();
}
}
/// This request handler also checks for UDP packets
void OutRTSP::requestHandler(){
if (!expectTCP){
@ -460,6 +468,7 @@ namespace Mist {
//wrong sending port, ignore packet
continue;
}
lastRecv = Util::epoch();//prevent disconnect of idle TCP connection when using UDP
RTP::Packet pack(s.data, s.data_len);
if (!it->second.rtpSeq){it->second.rtpSeq = pack.getSequence();}
//packet is very early - assume dropped after 10 packets

View file

@ -170,6 +170,7 @@ namespace Mist {
void handleIncomingRTP(const uint64_t track, const RTP::Packet & pkt);
void h264MultiParse(uint64_t ts, const uint64_t track, char * buffer, const uint32_t len);
void h264Packet(uint64_t ts, const uint64_t track, const char * buffer, const uint32_t len, bool isKey);
std::string getStatsName();
};
}