Rewrite of Comms
This commit is contained in:
		
							parent
							
								
									c6265f6659
								
							
						
					
					
						commit
						7297336e46
					
				
					 14 changed files with 173 additions and 303 deletions
				
			
		|  | @ -1605,7 +1605,7 @@ namespace Mist{ | |||
|     } | ||||
|     emptyCount = 0; // valid packet - reset empty counter
 | ||||
| 
 | ||||
|     if (!userSelect[nxt.tid].isAlive()){ | ||||
|     if (!userSelect[nxt.tid]){ | ||||
|       INFO_MSG("Track %zu is not alive!", nxt.tid); | ||||
|       return false; | ||||
|     } | ||||
|  | @ -1691,7 +1691,6 @@ namespace Mist{ | |||
|     statComm.setTime(now - myConn.connTime()); | ||||
|     statComm.setLastSecond(thisPacket ? thisPacket.getTime() : 0); | ||||
|     statComm.setPid(getpid()); | ||||
|     statComm.keepAlive(); | ||||
| 
 | ||||
|     /*LTS-START*/ | ||||
|     // Tag the session with the user agent
 | ||||
|  | @ -1710,21 +1709,16 @@ namespace Mist{ | |||
| 
 | ||||
|     if (isPushing()){ | ||||
|       for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){ | ||||
|         it->second.keepAlive(); | ||||
|         if (it->second.getStatus() == COMM_STATUS_REQDISCONNECT){ | ||||
|           if (dropPushTrack(it->second.getTrack(), "disconnect request from buffer")){break;} | ||||
|         } | ||||
|         if (!it->second.isAlive()){ | ||||
|         if (!it->second){ | ||||
|           if (dropPushTrack(it->second.getTrack(), "track mapping no longer valid")){break;} | ||||
|         } | ||||
|         //if (Util::bootSecs() - M.getLastUpdated(it->first) > 5){
 | ||||
|         //  if (dropPushTrack(it->second.getTrack(), "track updates being ignored by buffer")){break;}
 | ||||
|         //}
 | ||||
|       } | ||||
|     }else{ | ||||
|       for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){ | ||||
|         it->second.keepAlive(); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
|  | @ -811,12 +811,7 @@ namespace Mist{ | |||
|       } | ||||
|       Util::wait(100); | ||||
|       //Make sure we don't accidentally timeout while waiting - runs approximately every second.
 | ||||
|       if (i % 10 == 0){ | ||||
|         for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); ++it){ | ||||
|           it->second.keepAlive(); | ||||
|           stats(); | ||||
|         } | ||||
|       } | ||||
|       if (i % 10 == 0){stats();} | ||||
|     } | ||||
|     return (keys.getEndValid() > currentKey + 1 && M.getLastms(thisIdx) > M.getTimeForKeyIndex(getMainSelectedTrack(), currentKey+1)); | ||||
|   } | ||||
|  |  | |||
|  | @ -1406,7 +1406,7 @@ namespace Mist{ | |||
|           } | ||||
|           uint64_t idx = reTrackToID[reTrack]; | ||||
|           if (idx != INVALID_TRACK_ID && !userSelect.count(idx)){ | ||||
|             userSelect[idx].reload(streamName, idx, COMM_STATUS_SOURCE); | ||||
|             userSelect[idx].reload(streamName, idx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE); | ||||
|           } | ||||
|           if (M.getCodec(idx) == "PCM" && M.getSize(idx) == 16){ | ||||
|             char *ptr = F.getData(); | ||||
|  |  | |||
|  | @ -812,7 +812,7 @@ namespace Mist{ | |||
|       videoTrack.rtpToDTSC.setCallbacks(onDTSCConverterHasPacketCallback, onDTSCConverterHasInitDataCallback); | ||||
|       videoTrack.sorter.setCallback(M.getID(vIdx), onRTPSorterHasPacketCallback); | ||||
| 
 | ||||
|       userSelect[vIdx].reload(streamName, vIdx, COMM_STATUS_SOURCE); | ||||
|       userSelect[vIdx].reload(streamName, vIdx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE); | ||||
|       INFO_MSG("Video push received on track %zu", vIdx); | ||||
|     } | ||||
| 
 | ||||
|  | @ -834,7 +834,7 @@ namespace Mist{ | |||
|       audioTrack.rtpToDTSC.setCallbacks(onDTSCConverterHasPacketCallback, onDTSCConverterHasInitDataCallback); | ||||
|       audioTrack.sorter.setCallback(M.getID(aIdx), onRTPSorterHasPacketCallback); | ||||
| 
 | ||||
|       userSelect[aIdx].reload(streamName, aIdx, COMM_STATUS_SOURCE); | ||||
|       userSelect[aIdx].reload(streamName, aIdx, COMM_STATUS_ACTIVE | COMM_STATUS_SOURCE); | ||||
|       INFO_MSG("Audio push received on track %zu", aIdx); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma