[Live-devel] Bug analyze_sei_data() & Session timeout questions

Julien Vary kuroueie at hotmail.com
Fri May 24 22:12:49 PDT 2013






Code base : live.2013.04.30.tar.gz


Question1:
    RtspServer: An OPTIONS with a proper "Session: XYZ" does not seem to trigger RTSPClientSession::noteLiveness().
    Is that a wanted behavior ?
    If yes, apart from sending RTCP, what would be the best keep-alive from the client? requesting GET_PARAMETER ?
    If no, could it trigger 'handleCmd_withinSession()' the same way 
      that TEARDOWN/PLAY/PAUSE/GET_PARAMETER/SET_PARAMETER do, so it could 'touch' the session liveness?


Question2/Request : 

    In 
        void RTSPServer::RTSPClientSession
        ::handleCmd_SETUP(RTSPServer::RTSPClientConnection* ourClientConnection,
         char const* urlPreSuffix, char const* urlSuffix, char const* fullRequestStr) 

    would it be possible to change the many

          snprintf((char*)ourClientConnection->fResponseBuffer, sizeof ourClientConnection->fResponseBuffer,
               "RTSP/1.0 200 OK\r\n"
               "CSeq: %s\r\n"
               "%s"
               "Transport: blablabla \r\n"
               "Session: %08X\r\n\r\n",
               
    to use

        "Session: %08X;timeout=%u\r\n\r\n",  ...,  fOurSessionId, fReclamationTestSeconds);
        
    instead, so the clients can be aware of custom timeouts, and 'ping' OPTIONS & RTCP accordingly ?
    (if I am mistaken on the usage of 'fReclamationTestSeconds', any suitable value instead ?)
    
    Searching the net/list, I found : 
        http://lists.live555.com/pipermail/live-devel/2009-August/011129.html
        http://lists.live555.com/pipermail/live-devel/2007-August/007292.html
    It looks like people agreed on it, but 5 years later, it still absent ?    
    
    Sorry if this has been already discussed and ruled out for a specific reason.


Bug:
In following code, if "if (NumBytesInNALunit > maxSize) return;" occurs, 'nalUnitCopySize' is not set to 0, 'seiSize' is unset/random, and it will most likely crash in the while loop.
Solution : 
 1: Put 'nalUnitCopySize = 0;' before the return in H264VideoStreamParser::removeEmulationBytes
 2: unsigned seiSize = 0;
 
 
 Code:
    void H264VideoStreamParser::analyze_sei_data() {
      // Begin by making a copy of the NAL unit data, removing any 'emulation prevention' bytes:
      u_int8_t sei[SEI_MAX_SIZE];
      unsigned seiSize;
      removeEmulationBytes(sei, sizeof sei, seiSize);
      
      unsigned j = 1; // skip the initial byte (forbidden_zero_bit; nal_ref_idc; nal_unit_type); we've already seen it 
      while (j < seiSize) {
        unsigned payloadType = 0;
        do {
          payloadType += sei[j];      
      ...
    }

    void H264VideoStreamParser::removeEmulationBytes(u_int8_t* nalUnitCopy, unsigned maxSize, unsigned& nalUnitCopySize) {
      u_int8_t* nalUnitOrig = fStartOfFrame + fOutputStartCodeSize;
      unsigned const NumBytesInNALunit = fTo - nalUnitOrig;
      if (NumBytesInNALunit > maxSize) return;
      nalUnitCopySize = 0;
       ...
    }     
    

Regards,

Julien
 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130525/09149a5d/attachment-0001.html>


More information about the live-devel mailing list