Changeset 410


Ignore:
Timestamp:
03/30/11 10:43:22 (14 months ago)
Author:
shiretu
Message:

-- removed unused code from thelib

Location:
trunk/sources/thelib
Files:
3 deleted
116 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/thelib/include/mediaformats/mp4/atomstsc.h

    r10 r410  
    3434private: 
    3535        vector<STSCEntry> _stscEntries; 
    36  
    37         //map<sampleId, chunkId> 
    3836        vector<uint32_t> _normalizedEntries; 
    3937public: 
  • trunk/sources/thelib/include/netio/epoll/tcpconnector.h

    r387 r410  
    5050 
    5151        virtual ~TCPConnector() { 
    52                 //FINEST("Close socket: %d", _closeSocket); 
    5352                if (_closeSocket) { 
    5453                        close(_inboundFd); 
    55                         //FINEST("Socket closed!"); 
    5654                } 
    5755        } 
  • trunk/sources/thelib/include/netio/kqueue/tcpconnector.h

    r387 r410  
    5151 
    5252        virtual ~TCPConnector() { 
    53                 //FINEST("Close socket: %d", _closeSocket); 
    5453                if (_closeSocket) { 
    5554                        close(_inboundFd); 
    56                         //FINEST("Socket closed!"); 
    5755                } 
    5856        } 
  • trunk/sources/thelib/include/netio/select/tcpconnector.h

    r387 r410  
    5151 
    5252        virtual ~TCPConnector() { 
    53                 //FINEST("Close socket: %d", _closeSocket); 
    5453                if (_closeSocket) { 
    5554                        CLOSE_SOCKET(_inboundFd); 
    56                         //FINEST("Socket closed!"); 
    5755                } 
    5856        } 
     
    6664                IOHandlerManager::EnqueueForDelete(this); 
    6765                WARN("THIS IS NOT COMPLETELY IMPLEMENTED"); 
    68                 //        if (((event.flags & EV_ERROR) != 0) || 
    69                 //                ((event.flags & EV_EOF) != 0)) { 
    70                 //            DEBUG("***CONNECT ERROR***"); 
    71                 //            _closeSocket = true; 
    72                 //            return false; 
    73                 //        } 
    7466 
    7567                BaseProtocol *pProtocol = ProtocolFactoryManager::CreateProtocolChain(_protocolChain, 
  • trunk/sources/thelib/include/protocols/rtmfp/basertmfpprotocol.h

    r296 r410  
    5050        uint8_t id[32]; 
    5151        sockaddr_in address; 
    52         //      EncDec enc; 
    53         //      EncDec dec; 
    5452 
    5553        RTMFPPeer() { 
    5654                memset(tag, 0, sizeof (tag)); 
    5755                memset(cookie, 0, sizeof (cookie)); 
    58                 //              enc.Setup(true, (uint8_t *) "Adobe Systems 02", 128); 
    59                 //              dec.Setup(false, (uint8_t *) "Adobe Systems 02", 128); 
    6056        } 
    61  
    62         //      void SetEncDecKeys(uint8_t *pEnc, uint8_t * pDec) { 
    63         //              enc.Setup(true, (uint8_t *) pEnc, 128); 
    64         //              dec.Setup(false, (uint8_t *) pDec, 128); 
    65         //      } 
    6657}; 
    6758 
     
    10091                enc.Setup(true, (uint8_t *) sec2, 128); 
    10192                dec.Setup(false, (uint8_t *) sec1, 128); 
    102                 //              server.SetEncDecKeys(sec1, sec2); 
    103                 //              client.SetEncDecKeys(sec2, sec1); 
    10493        } 
    10594}; 
  • trunk/sources/thelib/include/protocols/rtp/rtcpprotocol.h

    r259 r410  
    3636        uint32_t _ssrc; 
    3737        bool _validLastAddress; 
    38         //      uint64_t _lastNtpMicroseconds; 
    39         //      uint32_t _lastRtpTimestamp; 
    4038public: 
    4139        RTCPProtocol(); 
     
    4947        virtual bool SignalInputData(IOBuffer &buffer); 
    5048 
    51         //bool SendRR(sockaddr_in &address); 
    5249        uint32_t GetLastSenderReport(); 
    5350        sockaddr_in *GetLastAddress(); 
  • trunk/sources/thelib/include/protocols/rtp/rtpheader.h

    r379 r410  
    3737        uint32_t _timestamp; 
    3838        uint32_t _ssrc; 
    39         //we are not interested in this yet 
    40         //vector<uint32_t> _csrc; 
    4139 
    4240        operator string() { 
  • trunk/sources/thelib/include/protocols/ts/inboundtsprotocol.h

    r317 r410  
    2626#include "protocols/ts/pidtypes.h" 
    2727#include "protocols/ts/tspacketheader.h" 
    28 #include "protocols/ts/tsadaptationfield.h" 
    2928 
    3029#define TS_CHUNK_188 188 
  • trunk/sources/thelib/include/protocols/ts/pidtypes.h

    r317 r410  
    4242} PIDType; 
    4343 
    44 //DLLEXP string GetPIDTypeString(PIDType pidType); 
    45  
    4644#endif  /* _PIDTYPES_H */ 
    4745#endif  /* HAS_PROTOCOL_TS */ 
  • trunk/sources/thelib/include/protocols/ts/streamdescriptors.h

    r317 r410  
    6969        uint8_t length; 
    7070 
    71         //      union { 
    72         // 
    73         //              struct { 
    74         //                      uint8_t data[188]; 
    75         //              } userPrivate; 
    76         // 
    77         //              struct { 
    78         //                      //ISO13818-1 Table 2-40 : Video stream descriptor (82/174) 
    79         //                      //DESCRIPTOR_TYPE_VIDEO 
    80         //                      bool multipleFrameFate; 
    81         //                      uint8_t frameRateCode; 
    82         //                      bool MPEG1Only; 
    83         //                      bool constrainedParameter; 
    84         //                      bool stillPicture; 
    85         //                      uint8_t profileAndLevelIndication; 
    86         //                      uint8_t chromaFormat; 
    87         //                      bool frameRateExtension; 
    88         //              } video; 
    89         // 
    90         //              struct { 
    91         //                      //ISO13818-1 Table 2-45 : Registration descriptor (84/174) 
    92         //                      //DESCRIPTOR_TYPE_REGISTRATION 
    93         //                      uint32_t formatIdentifier; 
    94         //                      uint8_t additionalInfoLength; 
    95         //                      uint8_t additionalInfo[188]; 
    96         //              } registration; 
    97         // 
    98         //              struct { 
    99         //                      //ISO13818-1 Table 2-46 : Registration descriptor (85/174) 
    100         //                      //DESCRIPTOR_TYPE_DATA_STREAM_ALIGNMENT 
    101         //                      uint8_t alignmentType; 
    102         //              } dataStreamAlignment; 
    103         // 
    104         //              struct { 
    105         //                      //ISO13818-1 Table 2-52 : ISO 639 language descriptor (88/174) 
    106         //                      //DESCRIPTOR_TYPE_ISO_639_LANGUAGE 
    107         // 
    108         //                      struct { 
    109         //                              uint8_t languageCode[3]; 
    110         //                              uint8_t audioType; 
    111         //                      } definition[47]; 
    112         //              } iso639Language; 
    113         //      } info; 
    114  
    11571        operator string() { 
    11672                return format("type: %d; length: %d", type, length); 
  • trunk/sources/thelib/src/application/clientapplicationmanager.cpp

    r188 r410  
    6666        if (pClientApplication->IsDefault()) 
    6767                _pDefaultApplication = pClientApplication; 
    68         //    FINEST("Application `%s` (%d) registered", STR(pClientApplication->GetName()), 
    69         //            pClientApplication->GetId()); 
    7068        return true; 
    7169} 
  • trunk/sources/thelib/src/configuration/configfile.cpp

    r391 r410  
    872872 
    873873void ConfigFile::Normalize(Variant &appConfigurationNode) { 
    874         //FINEST("Before:\n%s", STR(configuration.ToString())); 
    875874 
    876875        appConfigurationNode[CONF_APPLICATION_DIRECTORY] = 
     
    906905        //3. Normalize the users db file 
    907906        if (appConfigurationNode.HasKey(CONF_APPLICATION_AUTH)) { 
    908                 //FINEST("Before:\n%s", STR(configuration.ToString())); 
    909907                if (!appConfigurationNode[CONF_APPLICATION_AUTH].HasKey( 
    910908                                CONF_APPLICATION_AUTH_USERS_FILE)) { 
     
    926924                        appConfigurationNode[CONF_APPLICATION_AUTH][CONF_APPLICATION_AUTH_ENCODER_AGENTS] = temp; 
    927925 
    928                         //FINEST("temp:\n%s", STR(temp.ToString())); 
    929                 } 
    930  
    931                 //FINEST("After:\n%s", STR(configuration.ToString())); 
     926                } 
     927 
    932928        } 
    933929 
  • trunk/sources/thelib/src/mediaformats/basemediadocument.cpp

    r398 r410  
    170170        if (framesCount >= 1) { 
    171171                totalTime = _frames[framesCount - 1].absoluteTime; 
    172                 //FINEST("totalTime: %f", totalTime); 
    173172 
    174173                //5. build the table 
     
    176175                uint32_t seekPoint = 0; 
    177176                for (double i = 0; i <= totalTime; i += _seekGranularity) { 
    178                         //FINEST("i: %.2f; frameIndex: %d", i, frameIndex); 
    179177                        while (_frames[frameIndex].absoluteTime < i) { 
    180                                 //FINEST("frame: %.2f", _frames[frameIndex].absoluteTime); 
    181178                                frameIndex++; 
    182179                                if (frameIndex >= framesCount) 
     
    186183                                        if ((_frames[frameIndex].type == MEDIAFRAME_TYPE_VIDEO) 
    187184                                                        && (_frames[frameIndex].isKeyFrame)) { 
    188                                                 //WARN("Seek point"); 
    189185                                                seekPoint = frameIndex; 
    190186                                        } 
     
    195191                        if (frameIndex >= framesCount) 
    196192                                break; 
    197                         //FINEST("%.2f -> %.2f", i, _frames[frameIndex].absoluteTime); 
    198193                        if (!seekFile.WriteUI32(seekPoint, false)) { 
    199194                                FATAL("Unable to write frame index"); 
     
    228223        _metadata[META_RTMP_META]["duration"] = (double) _metadata[META_FILE_DURATION] / 1000.00; 
    229224 
    230         //FINEST("metadata:\n%s", STR(metadata.ToString())); 
    231225        return _metadata.SerializeToBinFile(_metaFilePath + ".tmp"); 
    232226} 
  • trunk/sources/thelib/src/mediaformats/flv/flvdocument.cpp

    r250 r410  
    156156                        WARN("frame: %s", STR(frame)); 
    157157 
    158                 //12. Read the metadata or ignore the data payload 
    159                 //              if (frame.type == MEDIAFRAME_TYPE_DATA) { 
    160                 //                      IOBuffer tempBuffer; 
    161                 //                      tempBuffer.ReadFromFs(_mediaFile, (uint32_t) frame.length); 
    162                 //                      //tempBuffer.PutInputBuffer(&buffer, 0, length); 
    163                 //#ifdef HAS_PROTOCOL_RTMP 
    164                 //                      AMF0Serializer amfSerializer; 
    165                 // 
    166                 //                      string name = ""; 
    167                 //                      Variant parameters; 
    168                 // 
    169                 //                      Variant tempVariant; 
    170                 //                      if (!amfSerializer.Read(tempBuffer, tempVariant)) { 
    171                 //                              FATAL("Unable to read metadata"); 
    172                 //                              return false; 
    173                 //                      } 
    174                 //                      if (tempVariant != V_STRING) { 
    175                 //                              FATAL("Unable to read metadata"); 
    176                 //                              return false; 
    177                 //                      } 
    178                 //                      name = ((string) tempVariant); 
    179                 // 
    180                 //                      while (GETAVAILABLEBYTESCOUNT(tempBuffer) > 0) { 
    181                 //                              tempVariant.Reset(); 
    182                 //                              if (!amfSerializer.Read(tempBuffer, tempVariant)) { 
    183                 //                                      FATAL("Unable to read metadata"); 
    184                 //                                      return false; 
    185                 //                              } 
    186                 //                              parameters.PushToArray(tempVariant); 
    187                 //                      } 
    188                 // 
    189                 //                      FINEST("name:\n%s", STR(name)); 
    190                 //                      FINEST("parameters:\n%s", STR(parameters.ToString())); 
    191                 //                      if (_metadata == V_NULL) 
    192                 //                              _metadata = parameters[(uint32_t) 0]; 
    193                 //#endif 
    194                 //              } else { 
    195158                if (!_mediaFile.SeekAhead(frame.length)) { 
    196159                        WARN("Unable to seek in file"); 
    197160                        break; 
    198161                } 
    199                 //              } 
    200162 
    201163                //13. We are not interested in the previous tag size 
     
    214176        } 
    215177 
    216         //    for (uint32_t i = 0; i < 50; i++) { 
    217         //        FINEST("Before:%s", STR(_frames[i])); 
    218         //    } 
    219178        sort(_frames.begin(), _frames.end(), CompareFrames); 
    220         //    for (uint32_t i = 0; i < _frames.size(); i++) { 
    221         //        FINEST("After:%s", STR(_frames[i])); 
    222         //    } 
    223         //    NYIR; 
    224179 
    225180        //15. Add the binary headers 
  • trunk/sources/thelib/src/mediaformats/mp3/id3parser.cpp

    r195 r410  
    9494        totalSize = (totalSize << 7) | (tempBuffer[2]&0x7f); 
    9595        totalSize = (totalSize << 7) | (tempBuffer[3]&0x7f); 
    96         //FINEST("_totalSize: 0x%08x (%d)", _totalSize, _totalSize); 
    9796 
    9897        //3. See if we go to the end of the ID3 we have a valid media frame 
     
    180179                        size = ENTOHLP(GETIBPOINTER(buffer)); 
    181180                } 
    182                 //FINEST("name: %s; size: %d", STR(name), size); 
    183181                buffer.Ignore(4); 
    184182 
    185183                CHECK_BUFFER_SIZE(buffer, 2); 
    186                 //uint16_t flags = ENTOHSP(GETIBPOINTER(buffer)); 
    187184                buffer.Ignore(2); 
    188185                if (size == 0 || GETAVAILABLEBYTESCOUNT(buffer) < size) { 
     
    190187                        return false; 
    191188                } 
    192                 //FINEST("id: %08x; name: %s; size: %d; flags: %d", id, STR(name), size, flags); 
    193189 
    194190                //3. Get a copy of data 
  • trunk/sources/thelib/src/mediaformats/mp3/mp3document.cpp

    r10 r410  
    165165                        uint8_t version = (firstBytes[1] >> 3)&0x03; 
    166166                        uint8_t layer = (firstBytes[1] >> 1)&0x03; 
    167                         //uint8_t protectBit = firstBytes[1]&0x01; 
    168167                        uint8_t bitRateIndex = firstBytes[2] >> 4; 
    169168                        uint8_t sampleRateIndex = (firstBytes[2] >> 2)&0x03; 
     
    180179                                return false; 
    181180                        } 
    182                         //            FINEST("Bytes: %02x %02x %02x %02x; frameStart: 0x%x; frameLength: 0x%x; Layer: %s", 
    183                         //                    firstBytes[0], firstBytes[1], firstBytes[2], firstBytes[3], 
    184                         //                    frame.start, frame.length, STR(_layerNames[layer])); 
    185181 
    186182                        //6. Compute the frame duration and save the frame start 
     
    203199                        ADD_VECTOR_END(_frames, frame); 
    204200                } else { 
    205                         //            WARN("Invalid bytes: %02x %02x %02x %02x", 
    206                         //                    firstBytes[0], firstBytes[1], firstBytes[2], firstBytes[3]); 
    207201                        break; 
    208202                } 
    209203        } 
    210204 
    211         //FINEST("totalTime: %f", totalDuration); 
    212205 
    213206        return true; 
     
    239232                uint8_t version = (firstBytes[1] >> 3)&0x03; 
    240233                uint8_t layer = (firstBytes[1] >> 1)&0x03; 
    241                 //uint8_t protectBit = firstBytes[1]&0x01; 
    242234                uint8_t bitRateIndex = firstBytes[2] >> 4; 
    243235                uint8_t sampleRateIndex = (firstBytes[2] >> 2)&0x03; 
     
    297289                return false; 
    298290        } 
    299         //FINEST("We have an ID3v%d.%d", majorVersion, minorVersion); 
    300291 
    301292        //3. Instantiate the proper parser 
  • trunk/sources/thelib/src/mediaformats/mp4/atomavc1.cpp

    r10 r410  
    5151                return false; 
    5252        } 
    53         //FINEST("_reserved: %u", _reserved); 
    5453 
    5554        if (!ReadUInt16(_referenceIndex)) { 
     
    5756                return false; 
    5857        } 
    59         //FINEST("_referenceIndex: %u", _referenceIndex); 
    6058 
    6159        if (!ReadUInt16(_qtVideoEncodingVersion)) { 
     
    6361                return false; 
    6462        } 
    65         //FINEST("_qtVideoEncodingVersion: %u", _qtVideoEncodingVersion); 
    6663 
    6764        if (!ReadUInt16(_qtVideoEncodingRevisionLevel)) { 
     
    6966                return false; 
    7067        } 
    71         //FINEST("_qtVideoEncodingRevisionLevel: %u", _qtVideoEncodingRevisionLevel); 
    7268 
    7369        if (!ReadUInt32(_qtVideoEncodingVendor)) { 
     
    7571                return false; 
    7672        } 
    77         //FINEST("_qtVideoEncodingVendor: %u", _qtVideoEncodingVendor); 
    7873 
    7974        if (!ReadUInt32(_qtVideoTemporalQuality)) { 
     
    8176                return false; 
    8277        } 
    83         //FINEST("_qtVideoTemporalQuality: %u", _qtVideoTemporalQuality); 
    8478 
    8579        if (!ReadUInt32(_qtVideoSpatialQuality)) { 
     
    8781                return false; 
    8882        } 
    89         //FINEST("_qtVideoSpatialQuality: %u", _qtVideoSpatialQuality); 
    9083 
    9184        if (!ReadUInt32(_videoFramePixelSize)) { 
     
    9386                return false; 
    9487        } 
    95         //FINEST("_videoFramePixelSize: %u", _videoFramePixelSize); 
    9688 
    9789        if (!ReadUInt32(_horizontalDpi)) { 
     
    9991                return false; 
    10092        } 
    101         //FINEST("_horizontalDpi: %u", _horizontalDpi); 
    10293 
    10394        if (!ReadUInt32(_verticalDpi)) { 
     
    10596                return false; 
    10697        } 
    107         //FINEST("_verticalDpi: %u", _verticalDpi); 
    10898 
    10999        if (!ReadUInt32(_qtVideoDataSize)) { 
     
    111101                return false; 
    112102        } 
    113         //FINEST("_qtVideoDataSize: %u", _qtVideoDataSize); 
    114103 
    115104        if (!ReadUInt16(_videoFrameCount)) { 
     
    117106                return false; 
    118107        } 
    119         //FINEST("_videoFrameCount: %u", _videoFrameCount); 
    120108 
    121109        if (!ReadUInt8(_videoEncoderNameLength)) { 
     
    123111                return false; 
    124112        } 
    125         //FINEST("_videoEncoderNameLength: %u", _videoEncoderNameLength); 
    126113 
    127114        if (_videoEncoderNameLength < 31) 
     
    136123        _videoEncoderName = string((char *) pTemp, _videoEncoderNameLength); 
    137124        delete[] pTemp; 
    138         //FINEST("_videoEncoderName: %s", STR(_videoEncoderName)); 
    139125 
    140126        if (!ReadUInt16(_videoPixelDepth)) { 
     
    142128                return false; 
    143129        } 
    144         //FINEST("_videoPixelDepth: %u", _videoPixelDepth); 
    145130 
    146131        if (!ReadUInt16(_qtVideoColorTableId)) { 
     
    148133                return false; 
    149134        } 
    150         //FINEST("_qtVideoColorTableId: %u", _qtVideoColorTableId); 
    151135        if (_qtVideoColorTableId != 0xffff) { 
    152136                FATAL("_qtVideoColorTableId not supported yet"); 
  • trunk/sources/thelib/src/mediaformats/mp4/atomavcc.cpp

    r10 r410  
    5959                return false; 
    6060        } 
    61         //FINEST("_configurationVersion: %d", _configurationVersion); 
    6261 
    6362        if (!ReadUInt8(_profile)) { 
     
    6564                return false; 
    6665        } 
    67         //FINEST("_profile: %d", _profile); 
    6866 
    6967        if (!ReadUInt8(_profileCompatibility)) { 
     
    7169                return false; 
    7270        } 
    73         //FINEST("_profileCompatibility: %d", _profileCompatibility); 
    7471 
    7572        if (!ReadUInt8(_level)) { 
     
    7774                return false; 
    7875        } 
    79         //FINEST("_level: %d", _level); 
    8076 
    8177        if (!ReadUInt8(_naluLengthSize)) { 
     
    8480        } 
    8581        _naluLengthSize = 1 + (_naluLengthSize & 0x03); 
    86         //FINEST("_naluLengthSize: %d", _naluLengthSize); 
    8782 
    8883        if (!ReadUInt8(_seqCount)) { 
     
    9186        } 
    9287        _seqCount = _seqCount & 0x1f; 
    93         //FINEST("_seqCount: %d", _seqCount); 
    9488 
    9589        for (uint8_t i = 0; i < _seqCount; i++) { 
     
    10094                        return false; 
    10195                } 
    102                 //FINEST("parameter.size: %d", parameter.size); 
    10396 
    10497                if (parameter.size > 0) { 
     
    119112                return false; 
    120113        } 
    121         //FINEST("_picCount: %d", _picCount); 
    122114 
    123115        for (uint8_t i = 0; i < _picCount; i++) { 
     
    128120                        return false; 
    129121                } 
    130                 //FINEST("parameter.size: %d", parameter.size); 
    131122 
    132123                if (parameter.size > 0) { 
  • trunk/sources/thelib/src/mediaformats/mp4/atomco64.cpp

    r10 r410  
    4040                return false; 
    4141        } 
    42         //FINEST("count: %u", count); 
    4342 
    4443        for (uint32_t i = 0; i < count; i++) { 
     
    4847                        return false; 
    4948                } 
    50                 //FINEST("offset[%u]: %u", i, offset); 
    5149                ADD_VECTOR_END(_entries, offset); 
    5250        } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomctts.cpp

    r10 r410  
    4747                return false; 
    4848        } 
    49         //FINEST("count: %u", count); 
    5049 
    5150        for (uint32_t i = 0; i < count; i++) { 
     
    6059                        return false; 
    6160                } 
    62  
    63                 //        FINEST("sampleCount[%u]: %u; sampleOffset[%u]: %u", i, 
    64                 //                entry.sampleCount, i, entry.sampleOffset); 
    65  
     61                 
    6662                ADD_VECTOR_END(_entries, entry); 
    6763        } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomdata.cpp

    r10 r410  
    6666                        return result; 
    6767                        //TODO: for now, return null 
    68                         //return Variant(); 
    6968                } 
    7069                default: 
     
    8281                return false; 
    8382        } 
    84         //FINEST("_type: %d", _type); 
    8583 
    8684        //2. Read unknown 4 bytes 
     
    8987                return false; 
    9088        } 
    91         //FINEST("_unknown: %d", _unknown); 
    9289 
    9390        switch (_type) { 
     
    9996                                return false; 
    10097                        } 
    101                         //FINEST("String: %s", STR(_dataString)); 
    10298                        return true; 
    10399                } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomesds.cpp

    r56 r410  
    239239#endif /* DEBUG_ESDS_ATOM */ 
    240240 
    241                         //NYIA; 
    242241                        return SkipRead(false); 
    243242                } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomftyp.cpp

    r10 r410  
    3535                return false; 
    3636        } 
    37         //FINEST("_majorBrand: %s(%u)", STR(U32TOS(_majorBrand)), _majorBrand); 
    3837 
    3938        if (!ReadUInt32(_minorVersion, false)) { 
     
    4140                return false; 
    4241        } 
    43         //FINEST("_minorVersion: %s(%u)", STR(U32TOS(_minorVersion)), _minorVersion); 
    4442 
    4543        for (uint64_t i = 16; i < _size; i += 4) { 
     
    5048                } 
    5149                ADD_VECTOR_END(_compatibleBrands, val); 
    52                 //FINEST("_compatibleBrand: %s(%u)", STR(U32TOS(val)), val); 
    5350        } 
    5451        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atomhdlr.cpp

    r10 r410  
    4343                return false; 
    4444        } 
    45         //FINEST("_componentType: %u", _componentType); 
    4645 
    4746        if (!ReadUInt32(_componentSubType)) { 
     
    4948                return false; 
    5049        } 
    51         //    FINEST("_componentSubType: %s(%u)", STR(U32TOS(_componentSubType)), 
    52         //            _componentSubType); 
    5350 
    5451        if (!ReadUInt32(_componentManufacturer)) { 
     
    5653                return false; 
    5754        } 
    58         //FINEST("_componentManufacturer: %u", _componentManufacturer); 
    5955 
    6056        if (!ReadUInt32(_componentFlags)) { 
     
    6258                return false; 
    6359        } 
    64         //FINEST("_componentFlags: %u", _componentFlags); 
    6560 
    6661        if (!ReadUInt32(_componentFlagsMask)) { 
     
    6863                return false; 
    6964        } 
    70         //FINEST("_componentFlagsMask: %u", _componentFlagsMask); 
    7165 
    7266        if (!ReadString(_componentName, _size - 32)) { 
     
    7468                return false; 
    7569        } 
    76         //FINEST("_componentFlagsMask: %s", STR(_componentName)); 
    7770 
    7871        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atommdhd.cpp

    r10 r410  
    4848                return false; 
    4949        } 
    50         //FINEST("_creationTime: %u", _creationTime); 
    5150 
    5251        if (!ReadUInt32(_modificationTime)) { 
     
    5453                return false; 
    5554        } 
    56         //FINEST("_modificationTime: %u", _modificationTime); 
    5755 
    5856        if (!ReadUInt32(_timeScale)) { 
     
    6058                return false; 
    6159        } 
    62         //FINEST("_timeScale: %u", _timeScale); 
    6360 
    6461        if (!ReadUInt32(_duration)) { 
     
    6663                return false; 
    6764        } 
    68         //FINEST("_duration: %u", _duration); 
    6965 
    7066        if (!ReadUInt16(_language)) { 
     
    7268                return false; 
    7369        } 
    74         //FINEST("_language: %u", _language); 
    7570 
    7671        if (!ReadUInt16(_quality)) { 
     
    7873                return false; 
    7974        } 
    80         //FINEST("_quality: %u", _quality); 
    8175 
    8276        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atommp4a.cpp

    r10 r410  
    6666                return false; 
    6767        } 
    68         //FINEST("_dataReferenceIndex: %u", _dataReferenceIndex); 
    6968 
    7069        if (!ReadUInt16(_innerVersion)) { 
     
    7271                return false; 
    7372        } 
    74         //FINEST("_innerVersion: %u", _innerVersion); 
    7573 
    7674        if (!ReadUInt16(_revisionLevel)) { 
     
    7876                return false; 
    7977        } 
    80         //FINEST("_revisionLevel: %u", _revisionLevel); 
    8178 
    8279        if (!ReadUInt32(_vendor)) { 
     
    8481                return false; 
    8582        } 
    86         //FINEST("_vendor: %u", _vendor); 
    8783 
    8884        if (!ReadUInt16(_numberOfChannels)) { 
     
    9086                return false; 
    9187        } 
    92         //FINEST("_numberOfChannels: %u", _numberOfChannels); 
    9388 
    9489        if (!ReadUInt16(_sampleSizeInBits)) { 
     
    9691                return false; 
    9792        } 
    98         //FINEST("_sampleSizeInBits: %u", _sampleSizeInBits); 
    9993 
    10094        if (!ReadInt16(_compressionId)) { 
     
    10296                return false; 
    10397        } 
    104         //FINEST("_compressionId: %d", _compressionId); 
    10598 
    10699        if (!ReadUInt16(_packetSize)) { 
     
    108101                return false; 
    109102        } 
    110         //FINEST("_packetSize: %u", _packetSize); 
    111103 
    112104        if (!ReadUInt32(_sampleRate)) { 
     
    114106                return false; 
    115107        } 
    116         //FINEST("_sampleRate: 0x%08x", _sampleRate); 
    117108 
    118109        if (_innerVersion == 0) { 
     
    125116                return false; 
    126117        } 
    127         //FINEST("_samplesPerPacket: %u", _samplesPerPacket); 
    128118 
    129119        if (!ReadUInt32(_bytesPerPacket)) { 
     
    131121                return false; 
    132122        } 
    133         //FINEST("_bytesPerPacket: %u", _bytesPerPacket); 
    134123 
    135124        if (!ReadUInt32(_bytesPerFrame)) { 
     
    137126                return false; 
    138127        } 
    139         //FINEST("_bytesPerFrame: %u", _bytesPerFrame); 
    140128 
    141129        if (!ReadUInt32(_bytesPerSample)) { 
     
    143131                return false; 
    144132        } 
    145         //FINEST("_bytesPerSample: %u", _bytesPerSample); 
    146133 
    147134        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atommvhd.cpp

    r10 r410  
    4848                return false; 
    4949        } 
    50         //FINEST("_creationTime: %u", _creationTime); 
    5150 
    5251        if (!ReadUInt32(_modificationTime)) { 
     
    5453                return false; 
    5554        } 
    56         //FINEST("_modificationTime: %u", _modificationTime); 
    5755 
    5856        if (!ReadUInt32(_timeScale)) { 
     
    6058                return false; 
    6159        } 
    62         //FINEST("_timeScale: %u", _timeScale); 
    6360 
    6461        if (!ReadUInt32(_duration)) { 
     
    6663                return false; 
    6764        } 
    68         //FINEST("_duration: %u", _duration); 
    6965 
    7066        if (!ReadUInt32(_preferredRate)) { 
     
    7268                return false; 
    7369        } 
    74         //FINEST("_preferredRate: %u", _preferredRate); 
    7570 
    7671        if (!ReadUInt16(_preferredVolume)) { 
     
    7873                return false; 
    7974        } 
    80         //FINEST("_preferredVolume: %u", _preferredVolume); 
    8175 
    8276        if (!ReadArray(_reserved, 10)) { 
     
    8478                return false; 
    8579        } 
    86         //    FINEST("_reserved: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x", 
    87         //            _reserved[0], _reserved[1], _reserved[2], _reserved[3], 
    88         //    _reserved[4], _reserved[5], _reserved[6], _reserved[7], 
    89         //            _reserved[8], _reserved[9]); 
    9080 
    9181        if (!ReadArray((uint8_t *) _matrixStructure, 36)) { 
     
    9888                return false; 
    9989        } 
    100         //FINEST("_previewTime: %u", _previewTime); 
    10190 
    10291        if (!ReadUInt32(_previewDuration)) { 
     
    10493                return false; 
    10594        } 
    106         //FINEST("_previewDuration: %u", _previewDuration); 
    10795 
    10896        if (!ReadUInt32(_posterTime)) { 
     
    11098                return false; 
    11199        } 
    112         //FINEST("_posterTime: %u", _posterTime); 
    113100 
    114101        if (!ReadUInt32(_selectionTime)) { 
     
    116103                return false; 
    117104        } 
    118         //FINEST("_selectionTime: %u", _selectionTime); 
    119105 
    120106        if (!ReadUInt32(_selectionDuration)) { 
     
    122108                return false; 
    123109        } 
    124         //FINEST("_selectionDuration: %u", _selectionDuration); 
    125110 
    126111        if (!ReadUInt32(_currentTime)) { 
     
    128113                return false; 
    129114        } 
    130         //FINEST("_currentTime: %u", _currentTime); 
    131115 
    132116        if (!ReadUInt32(_nextTrakId)) { 
     
    134118                return false; 
    135119        } 
    136         //FINEST("_nextTrakId: %u", _nextTrakId); 
    137120 
    138121        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atomsmhd.cpp

    r10 r410  
    3535                return false; 
    3636        } 
    37         //FINEST("_balance: %u", _balance); 
    3837 
    3938        if (!ReadUInt16(_reserved)) { 
     
    4140                return false; 
    4241        } 
    43         //FINEST("_reserved: %u", _reserved); 
    4442 
    4543        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atomstco.cpp

    r10 r410  
    4040                return false; 
    4141        } 
    42         //FINEST("count: %u", count); 
    4342 
    4443        for (uint32_t i = 0; i < count; i++) { 
     
    4847                        return false; 
    4948                } 
    50                 //FINEST("offset[%u]: %u", i, offset); 
    5149                ADD_VECTOR_END(_entries, offset); 
    5250        } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomstsc.cpp

    r10 r410  
    6363                return false; 
    6464        } 
    65         //FINEST("count: %u", count); 
    6665 
    6766        if (count == 0) 
     
    7574                        return false; 
    7675                } 
    77                 //FINEST("entry.firstChunk: %u", entry.firstChunk); 
    7876 
    7977                if (!ReadUInt32(entry.samplesPerChunk)) { 
     
    8179                        return false; 
    8280                } 
    83                 //FINEST("entry.samplesPerChunk: %u", entry.samplesPerChunk); 
    8481 
    8582                if (!ReadUInt32(entry.sampleDescriptionIndex)) { 
     
    8784                        return false; 
    8885                } 
    89                 //FINEST("entry.sampleDescriptionIndex: %u", entry.sampleDescriptionIndex); 
    9086 
    9187                ADD_VECTOR_END(_stscEntries, entry); 
  • trunk/sources/thelib/src/mediaformats/mp4/atomstss.cpp

    r10 r410  
    3939                return false; 
    4040        } 
    41         //FINEST("count: %u", count); 
    4241 
    4342        for (uint32_t i = 0; i < count; i++) { 
     
    4746                        return false; 
    4847                } 
    49                 //FINEST("sampleNumber[%u]: %u", i, sampleNumber); 
    5048 
    5149                ADD_VECTOR_END(_entries, sampleNumber); 
  • trunk/sources/thelib/src/mediaformats/mp4/atomstsz.cpp

    r10 r410  
    3838                return false; 
    3939        } 
    40         //FINEST("_sampleSize: %u", _sampleSize); 
    4140 
    4241        if (!ReadUInt32(_sampleCount)) { 
     
    4443                return false; 
    4544        } 
    46         //FINEST("_sampleCount: %u", _sampleCount); 
    4745 
    4846        if (_sampleSize != 0) { 
     
    5856                                return false; 
    5957                        } 
    60                         //FINEST("size[%u]: %u", i, size); 
    6158                        ADD_VECTOR_END(_entries, size); 
    6259                } 
  • trunk/sources/thelib/src/mediaformats/mp4/atomstts.cpp

    r56 r410  
    4646                return false; 
    4747        } 
    48         //FINEST("entryCount: %d", entryCount); 
    4948 
    5049        for (uint32_t i = 0; i < entryCount; i++) { 
     
    5554                        return false; 
    5655                } 
    57                 //FINEST("entry[%d].count: %d", i, entry.count); 
    5856 
    5957                if (!ReadUInt32(entry.delta)) { 
     
    6159                        return false; 
    6260                } 
    63                 //FINEST("entry[%d].delta: %d", i, entry.delta); 
    6461 
    6562                ADD_VECTOR_END(_sttsEntries, entry); 
  • trunk/sources/thelib/src/mediaformats/mp4/atomtkhd.cpp

    r10 r410  
    5454                return false; 
    5555        } 
    56         //FINEST("_creationTime: %u", _creationTime); 
    5756 
    5857        if (!ReadUInt32(_modificationTime)) { 
     
    6059                return false; 
    6160        } 
    62         //FINEST("_modificationTime: %u", _modificationTime); 
    6361 
    6462        if (!ReadUInt32(_trackId)) { 
     
    6664                return false; 
    6765        } 
    68         //FINEST("_trackId: %u", _trackId); 
    6966 
    7067        if (!ReadArray(_reserved1, 4)) { 
     
    7774                return false; 
    7875        } 
    79         //FINEST("_duration: %u", _duration); 
    8076 
    8177        if (!ReadArray(_reserved2, 8)) { 
     
    8884                return false; 
    8985        } 
    90         //FINEST("_layer: %u", _layer); 
    9186 
    9287        if (!ReadUInt16(_alternateGroup)) { 
     
    9489                return false; 
    9590        } 
    96         //FINEST("_alternateGroup: %u", _alternateGroup); 
    9791 
    9892        if (!ReadUInt16(_volume)) { 
     
    10094                return false; 
    10195        } 
    102         //FINEST("_volume: %u", _volume); 
    10396 
    10497        if (!ReadArray(_reserved3, 2)) { 
     
    116109                return false; 
    117110        } 
    118         //FINEST("_trackWidth: %u", _trackWidth); 
    119111 
    120112        if (!ReadUInt32(_trackHeight)) { 
     
    122114                return false; 
    123115        } 
    124         //FINEST("_trackHeight: %u", _trackHeight); 
    125116 
    126117        return true; 
  • trunk/sources/thelib/src/mediaformats/mp4/atomvmhd.cpp

    r10 r410  
    3535                return false; 
    3636        } 
    37         //FINEST("_graphicsMode: %u", _graphicsMode); 
    3837 
    3938        if (!ReadArray(_opcolor, 6)) { 
  • trunk/sources/thelib/src/mediaformats/mp4/atomwave.cpp

    r10 r410  
    4040                        return true; 
    4141                case 0://NULL atom 
    42                         //WARN("Ignoring NULL atom"); 
    4342                        return true; 
    4443                default: 
  • trunk/sources/thelib/src/mediaformats/mp4/baseatom.cpp

    r168 r410  
    3535        _size = size; 
    3636        _start = start; 
    37         //FINEST("Atom created: %p", this); 
    3837} 
    3938 
    4039BaseAtom::~BaseAtom() { 
    41         //FINEST("Atom deleted: %p", this); 
    4240} 
    4341 
  • trunk/sources/thelib/src/mediaformats/mp4/boxatom.cpp

    r10 r410  
    4040                } 
    4141                if (!pAtom->IsIgnored()) { 
    42                         //FINEST("pAtom: %p (%s)", pAtom, STR(pAtom->GetTypeString())); 
    4342                        if (!AtomCreated(pAtom)) { 
    4443                                FATAL("Unable to signal AtomCreated for atom %s (%x)", 
     
    4948                ADD_VECTOR_END(_subAtoms, pAtom); 
    5049        } 
    51         //    FINEST("Atom %s has %d subatoms", STR(GetTypeString())  , 
    52         //            (uint32_t) _subAtoms.size()); 
    5350        return true; 
    5451} 
     
    5653string BoxAtom::Hierarchy(uint32_t indent) { 
    5754        string result = string(indent * 4, ' ') + GetTypeString() + "\n"; 
    58         //FINEST("%d %s", indent, STR(result)); 
    5955        if (_subAtoms.size() == 0) { 
    6056                result += string((indent + 1) * 4, ' ') + "[empty]"; 
     
    7369        va_list arguments; 
    7470        va_start(arguments, depth); 
    75         //string strPath = ""; 
    7671        for (uint8_t i = 0; i < depth; i++) { 
    7772                uint32_t pathElement = va_arg(arguments, uint32_t); 
    78                 //strPath += format("%s->", STR(U32TOS(pathElement))); 
    7973                ADD_VECTOR_END(path, pathElement); 
    8074        } 
    8175        va_end(arguments); 
    82         //FINEST("Path: %s", STR(strPath)); 
    8376        if (path.size() == 0) 
    8477                return NULL; 
     
    9386        path.erase(path.begin()); 
    9487        for (uint32_t i = 0; i < _subAtoms.size(); i++) { 
    95                 //        FINEST("Wanted s: %s; Got s: %s; Wanted: %08x; Got: %08x", 
    96                 //                STR(U32TOS(search)), 
    97                 //                STR(_subAtoms[i]->GetTypeString()), 
    98                 //                search, 
    99                 //                _subAtoms[i]->GetTypeNumeric()); 
    10088                if (_subAtoms[i]->GetTypeNumeric() == search) { 
    10189                        if (path.size() == 0) 
  • trunk/sources/thelib/src/mediaformats/mp4/mp4document.cpp

    r391 r410  
    248248                default: 
    249249                { 
    250                         //            FATAL("Atom type %s(%u) not yet implemented. Position: 0x%x", 
    251                         //                    STR(U32TOS(type)), type, (uint32_t) _mediaFile.Cursor()); 
    252                         //            return NULL; 
    253250                        pAtom = new IgnoredAtom(this, type, size, currentPos); 
    254251                        break; 
     
    262259                return NULL; 
    263260        } 
    264  
    265         //    FINEST("END reading atom %s at 0x%x with size 0x%x", 
    266         //            STR(U32TOS(type)), currentPos, size); 
    267261 
    268262        if (currentPos + pAtom->GetSize() != _mediaFile.Cursor()) { 
     
    367361                                audioHeader.start, audioHeader.length, audioHeader.length); 
    368362        } 
    369         //ADD_VECTOR_BEGIN(_frames, audioHeader); 
    370363 
    371364        //add binary video header 
     
    380373                videoHeader.deltaTime = 0; 
    381374                videoHeader.compositionOffset = 0; 
    382                 //    FINEST("Start: %u (%x); Length: %u (%x);", videoHeader.start, 
    383                 //            videoHeader.start, videoHeader.length,videoHeader.length); 
    384                 //ADD_VECTOR_BEGIN(_frames, videoHeader); 
    385375        } 
    386376 
     
    492482        INFO("audio: %d; keyFrames: %u; frames: %u; compositionOffsets: %u", 
    493483                        audio, keyFrames.size(), sampleSize.size(), compositionOffsets.size()); 
    494  
    495         //    FINEST("sampleSize count: %d", sampleSize.size()); 
    496         //    FINEST("sampleDeltaTime count: %d", sampleDeltaTime.size()); 
    497         //    FINEST("chunckOffsets count: %d", chunckOffsets.size()); 
    498         //    FINEST("sample2Chunk count: %d", sample2Chunk.size()); 
    499         //    FINEST("keyFrames count: %d", keyFrames.size()); 
    500  
     484         
    501485        uint32_t timeScale = pMDHD->GetTimeScale(); 
    502486        uint32_t totalTime = 0; 
     
    510494                        double doubleVal = ((double) compositionOffsets[i] / (double) timeScale)*(double) 1000.00; 
    511495                        frame.compositionOffset = (int32_t) doubleVal; 
    512                         //FINEST("frame.compositionOffset: %08x", frame.compositionOffset); 
    513496                } else { 
    514497                        frame.compositionOffset = 0; 
     
    548531                totalTime += sampleDeltaTime[i]; 
    549532 
    550                 //FINEST("Frame: %s", STR(frame)); 
    551533                ADD_VECTOR_END(_frames, frame); 
    552534        } 
  • trunk/sources/thelib/src/mediaformats/mp4/versionedatom.cpp

    r10 r410  
    3636                return false; 
    3737        } 
    38         //FINEST("_version: %d", _version); 
    3938 
    4039        if (!ReadArray(_flags, 3)) { 
     
    4241                return false; 
    4342        } 
    44         //FINEST("_flags: %02x %02x %02x", _flags[0], _flags[1], _flags[2]); 
    4543 
    4644        return ReadData(); 
  • trunk/sources/thelib/src/mediaformats/mp4/versionedboxatom.cpp

    r10 r410  
    3636                return false; 
    3737        } 
    38         //FINEST("_version: %d", _version); 
    3938 
    4039        if (!ReadArray(_flags, 3)) { 
     
    4241                return false; 
    4342        } 
    44         //FINEST("_flags: %02x %02x %02x", _flags[0], _flags[1], _flags[2]); 
    4543 
    4644        if (!ReadData()) { 
  • trunk/sources/thelib/src/mediaformats/nsv/mp3media.cpp

    r372 r410  
    203203                audioSamplesCount += samplesCount; 
    204204 
    205                 //FINEST("samplesCount : %d", samplesCount); 
    206                 //FINEST("sampleRate:%d", (_samplingRates[version][sampleRateIndex])); 
    207205 
    208206                //8. All good. Save the frame 
    209                 //ADD_VECTOR_END(_frames, frame); 
    210207        } 
    211208        return true; 
  • trunk/sources/thelib/src/mediaformats/nsv/nsvdocument.cpp

    r372 r410  
    7474 
    7575                if (marker_frame == 0x4e53) { 
    76                         //FINEST("we got NS"); 
    7776                        if (!_mediaFile.PeekUI16(&marker_frame)) { 
    7877                                FATAL("Unable to peek byte"); 
     
    8786                                continue; 
    8887                        } 
    89                         //FINEST("we got Vs"); 
    9088                        if (!_mediaFile.SeekAhead(2)) { 
    9189                                FATAL("Unable to seek ahead "); 
     
    10098        } 
    10199 
    102         //    for (uint32_t i = 0; i < 50; i++) { 
    103         //        FINEST("Before:%s", STR(_frames[i])); 
    104         //    } 
    105100        sort(_frames.begin(), _frames.end(), CompareFrames); 
    106         //    for (uint32_t i = 0; i < _frames.size(); i++) { 
    107         //        FINEST("After:%s", STR(_frames[i])); 
    108         //    } 
    109         //    NYIR; 
    110101 
    111102        //15. Add the binary headers 
    112         //FINEST("binary headers size : %d", binaryHeaders.size()); 
    113103        for (uint32_t i = 0; i < binaryHeaders.size(); i++) { 
    114104                assert(binaryHeaders[i].absoluteTime == 0); 
     
    122112 
    123113bool NSVDocument::ParseNSVs() { 
    124         //FINEST("we got Vs reading header..."); 
    125114        //6. get video format 
    126115        uint32_t vidfmt = 0; 
    127         //FINEST(" reading video format"); 
    128116        if (!_mediaFile.ReadUI32(&vidfmt)) { 
    129117                FATAL("Unable to read video format "); 
     
    138126        //7. get audio format 
    139127        uint32_t audfmt = 0; 
    140         //FINEST(" reading audio format"); 
    141128        if (!_mediaFile.ReadUI32(&audfmt)) { 
    142129                FATAL("Unable to read audio format "); 
     
    151138        //8. get video width 
    152139        uint16_t vid_width = 0; 
    153         //FINEST(" reading video width "); 
    154140        if (!_mediaFile.ReadUI16(&vid_width, false)) { 
    155141                FATAL("Unable to read video width "); 
    156142                return false; 
    157143        } 
    158         // FINEST("vid width : %d ", vid_width); 
    159144 
    160145        //9  get video height 
    161146        uint16_t vid_height = 0; 
    162         //FINEST(" reading video height "); 
    163147        if (!_mediaFile.ReadUI16(&vid_height, false)) { 
    164148                FATAL("Unable to read video height "); 
    165149                return false; 
    166150        } 
    167         // FINEST("vid height : %d ", vid_height); 
    168151 
    169152        // get framerate_idx and check from 
    170153        // frame rate table 
    171154        uint8_t framerate_idx = 0; 
    172         //FINEST(" reading frame rate index "); 
    173155        if (!_mediaFile.ReadUI8(&framerate_idx)) { 
    174156                FATAL("Unable to read framerate idx "); 
    175157                return false; 
    176158        } 
    177         //FINEST(" video framerate idx : %d ", framerate_idx); 
    178159        _framerate = GetFrameRate(framerate_idx); 
    179         //FINEST("framerate: %d", _framerate); 
    180160 
    181161        //10 get syncoffs 
    182162        uint16_t syncoffs = 0; 
    183         //FINEST(" reading frame syncoffs "); 
    184163        if (!_mediaFile.ReadUI16(&syncoffs, false)) { 
    185164                FATAL("Unable to read syncoffs "); 
    186165                return false; 
    187166        } 
    188         // FINEST(" syncoffs : %d ", syncoffs); 
    189167 
    190168        return true; 
     
    198176 
    199177        //13. get the aux plus video len 
    200         //FINEST("reading payload data at offset %llx", _mediaFile.Cursor()); 
    201178        if (!_mediaFile.ReadUI24(&aux_plus_vidlen, false)) { 
    202179                FATAL("Unable to read aux_plus vid len data chuncks "); 
     
    206183        num_aux = aux_plus_vidlen & 0x0f; 
    207184        aux_plus_vidlen = aux_plus_vidlen >> 4; 
    208         //FINEST("num_aux: %d; aux_plus_vidlen: %d ", num_aux, aux_plus_vidlen); 
    209185 
    210186        //14. audio len 
     
    216192        uint32_t auxLength = 0; 
    217193        if (num_aux > 0) { 
    218                 //        Variant Aux; 
    219                 //        uint16_t aux_chunk_len; 
    220                 //        if (!_mediaFile.) 
    221194                NYIA; 
    222195        } 
    223196 
    224197        if (aux_plus_vidlen > 0) { 
    225                 // FINEST("video data offset %llx", _mediaFile.Cursor()); 
    226198                MediaFrame video_frame = {0}; 
    227199                video_frame.type = MEDIAFRAME_TYPE_VIDEO; 
     
    317289 
    318290void NSVDocument::GetAudioFrame() { 
    319         //FINEST("===================="); 
    320291 
    321292        uint8_t firstBytes[4]; 
     
    347318        uint8_t *pBuffer = GETIBPOINTER(_buffer); 
    348319        uint32_t length = GETAVAILABLEBYTESCOUNT(_buffer); 
    349         //    FINEST("audio data offset %x", audio_frame.start); 
    350         //    FINEST("Audio len:%d ", audio_len); 
    351         //    FINEST("Audio len:%d ", length); 
    352320        while (length != 0) { 
    353321                MP3Media mp3; 
     
    384352                                        video_frame.isBinaryHeader = true; 
    385353                                        video_frame.isKeyFrame = false; 
    386                                         //FINEST("GOT SPS video data offset %x, len:%d", video_frame.start, video_frame.length); 
    387354                                        break; 
    388355 
     
    390357                                        video_frame.isBinaryHeader = true; 
    391358                                        video_frame.isKeyFrame = false; 
    392                                         //FINEST("GOT PPS video data offset %x, len:%d", video_frame.start, video_frame.length); 
    393359                                        break; 
    394360 
     
    396362                                        video_frame.isBinaryHeader = false; 
    397363                                        video_frame.isKeyFrame = true; 
    398                                         //FINEST("GOT IDR video data offset %x, len: %d", video_frame.start, video_frame.length); 
    399364                                        break; 
    400365                        } 
     
    418383        *nal_end = 0; 
    419384 
    420         //i = 0; 
    421385        while (//( next_bits( 24 ) != 0x000001 && next_bits( 32 ) != 0x00000001 ) 
    422386                        (buf[i] != 0 || buf[i + 1] != 0 || buf[i + 2] != 0x01) && 
  • trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp

    r188 r410  
    221221        while (_deadIOHandlers.size() > 0) { 
    222222                IOHandler *pIOHandler = MAP_VAL(_deadIOHandlers.begin()); 
    223                 //FINEST("Delete IOH %p", pIOHandler); 
    224223                _deadIOHandlers.erase(pIOHandler->GetId()); 
    225224                delete pIOHandler; 
    226225                result++; 
    227                 //FINEST("Done delete IOH %p", pIOHandler); 
    228226        } 
    229227        return result; 
     
    284282        if (_pAvailableTokens->size() == 0) { 
    285283                pResult = new IOHandlerManagerToken(); 
    286                 //WARN("Token created: %p", pResult); 
    287284        } else { 
    288285                pResult = (*_pAvailableTokens)[0]; 
    289                 //WARN("Token %p served from %p", pResult, _pAvailableTokens); 
    290286                _pAvailableTokens->erase(_pAvailableTokens->begin()); 
    291287        } 
     
    297293void IOHandlerManager::FreeToken(IOHandler *pIOHandler) { 
    298294        IOHandlerManagerToken *pToken = pIOHandler->GetIOHandlerManagerToken(); 
    299         //FATAL("Token %p returned to %p", pToken, _pRecycledTokens); 
    300295        pIOHandler->SetIOHandlerManagerToken(NULL); 
    301296        pToken->pPayload = NULL; 
  • trunk/sources/thelib/src/netio/epoll/iotimer.cpp

    r193 r410  
    3131 
    3232IOTimer::~IOTimer() { 
    33         //FINEST("Disable timer"); 
    3433        IOHandlerManager::DisableTimer(this, true); 
    3534} 
  • trunk/sources/thelib/src/netio/epoll/stdiocarrier.cpp

    r193 r410  
    6767 
    6868bool StdioCarrier::OnEvent(struct epoll_event &event) { 
    69         //FINEST("Event: %d", event.events); 
    7069 
    7170        //1. Read data 
     
    7877                        return false; 
    7978                } 
    80                 //FINEST("recvBytes: %d; _totalRecveivedBytes: %d", recvBytes, _totalRecveivedBytes); 
    8179                if (recvBytes == 0) { 
    8280                        FATAL("Connection closed"); 
  • trunk/sources/thelib/src/netio/epoll/tcpacceptor.cpp

    r245 r410  
    3434: IOHandler(0, 0, IOHT_ACCEPTOR) { 
    3535        _pApplication = NULL; 
    36         //assert((port > 1024 && port < 65535) || (port == 80)); 
    3736        memset(&_address, 0, sizeof (sockaddr_in)); 
    3837 
  • trunk/sources/thelib/src/netio/epoll/tcpcarrier.cpp

    r271 r410  
    5454        _nearIp = ""; 
    5555        _nearPort = 0; 
    56         //socklen_t sz = sizeof (int); 
    5756        _sendBufferSize = 1024; 
    58         //      if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &_sendBufferSize, &sz) != 0) { 
    59         //              ASSERT("Unable to determine the send buffer size"); 
    60         //      } 
    6157        _recvBufferSize = 1024 * 256; 
    62         //      if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &_recvBufferSize, &sz) != 0) { 
    63         //              ASSERT("Unable to determine the recv buffer size"); 
    64         //      } 
    6558        GetEndpointsInfo(); 
    6659        _rx = 0; 
     
    7366 
    7467bool TCPCarrier::OnEvent(struct epoll_event &event) { 
    75         //FINEST("Event: %d", event.events); 
    7668        int32_t readAmount = 0; 
    7769        int32_t writeAmount = 0; 
     
    8880                } 
    8981                _rx += readAmount; 
    90                 //FINEST("recvBytes: %d; _totalRecveivedBytes: %d", recvBytes, _totalRecveivedBytes); 
    9182                if (readAmount == 0) { 
    9283                        FATAL("Connection closed"); 
     
    205196        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    206197        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    207         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    208198        return true; 
    209199} 
  • trunk/sources/thelib/src/netio/epoll/udpcarrier.cpp

    r304 r410  
    4343 
    4444bool UDPCarrier::OnEvent(struct epoll_event &event) { 
    45         //FINEST("Event: %d", event.events); 
    4645 
    4746        //1. Read data 
     
    5453                        return false; 
    5554                } 
    56                 //FINEST("recvBytes: %d;", recvBytes); 
    5755                if (recvBytes == 0) { 
    5856                        FATAL("Connection closed"); 
     
    194192        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    195193        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    196         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    197194        return true; 
    198195} 
  • trunk/sources/thelib/src/netio/kqueue/iohandler.cpp

    r188 r410  
    3636 
    3737IOHandler::~IOHandler() { 
    38         //FINEST("IOHandler %p is in destructor", this); 
    3938        if (_pProtocol != NULL) { 
    4039                _pProtocol->SetIOHandler(NULL); 
  • trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp

    r188 r410  
    4545        if (_pAvailableTokens->size() == 0) { 
    4646                pResult = new IOHandlerManagerToken(); 
    47                 //WARN("Token created: %p", pResult); 
    4847        } else { 
    4948                pResult = (*_pAvailableTokens)[0]; 
    50                 //WARN("Token %p served from %p", pResult, _pAvailableTokens); 
    5149                _pAvailableTokens->erase(_pAvailableTokens->begin()); 
    5250        } 
     
    5856void IOHandlerManager::FreeToken(IOHandler *pIOHandler) { 
    5957        IOHandlerManagerToken *pToken = pIOHandler->GetIOHandlerManagerToken(); 
    60         //FATAL("Token %p returned to %p", pToken, _pRecycledTokens); 
    6158        pIOHandler->SetIOHandlerManagerToken(NULL); 
    6259        pToken->pPayload = NULL; 
     
    187184 
    188185bool IOHandlerManager::EnableAcceptConnections(IOHandler *pIOHandler) { 
    189         //FINEST("EnableAcceptConnections"); 
    190186        return RegisterEvent(pIOHandler->GetInboundFd(), EVFILT_READ, 
    191187                        EV_ADD | EV_ENABLE, 0, 0, 
     
    201197bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 
    202198#ifdef HAS_KQUEUE_TIMERS 
    203         //FINEST("Enable timer: %d", seconds); 
    204199        return RegisterEvent(pIOHandler->GetId(), EVFILT_TIMER, 
    205200                        EV_ADD | EV_ENABLE, NOTE_USECONDS, 
     
    239234        while (_deadIOHandlers.size() > 0) { 
    240235                IOHandler *pIOHandler = MAP_VAL(_deadIOHandlers.begin()); 
    241                 //FINEST("Delete IOH %p", pIOHandler); 
    242236                _deadIOHandlers.erase(pIOHandler->GetId()); 
    243237                delete pIOHandler; 
    244238                result++; 
    245                 //FINEST("Done delete IOH %p", pIOHandler); 
    246239        } 
    247240        return result; 
  • trunk/sources/thelib/src/netio/kqueue/iotimer.cpp

    r193 r410  
    3131 
    3232IOTimer::~IOTimer() { 
    33         //FINEST("Disable timer"); 
    3433        IOHandlerManager::DisableTimer(this, true); 
    3534} 
  • trunk/sources/thelib/src/netio/kqueue/stdiocarrier.cpp

    r193 r410  
    9393 
    9494                        while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    95                                 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer)); 
    9695                                if (!pOutputBuffer->WriteToStdio(event.ident, event.data)) { 
    9796                                        FATAL("Unable to send data"); 
  • trunk/sources/thelib/src/netio/kqueue/tcpacceptor.cpp

    r245 r410  
    3131: IOHandler(0, 0, IOHT_ACCEPTOR) { 
    3232        _pApplication = NULL; 
    33         //assert((port > 1024 && port < 65535) || (port == 80)); 
    3433        memset(&_address, 0, sizeof (sockaddr_in)); 
    3534 
  • trunk/sources/thelib/src/netio/kqueue/tcpcarrier.cpp

    r271 r410  
    5757        _rx = 0; 
    5858        _tx = 0; 
    59         //      uint32_t sendBufferSize = 1024 * 1024; 
    60         //      if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sendBufferSize, sizeof (uint32_t)) != 0) { 
    61         //              ASSERT("Unable to determine the send buffer size"); 
    62         //      } 
    6359} 
    6460 
    6561TCPCarrier::~TCPCarrier() { 
    66         //FINEST("Delete tcp carrier %p", this); 
    6762        close(_inboundFd); 
    68         //FINEST("Done delete tcp carrier %p", this); 
    6963} 
    7064 
     
    9387 
    9488                        if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    95                                 //uint32_t initial = GETAVAILABLEBYTESCOUNT(*pOutputBuffer); 
    96                                 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer)); 
    9789                                if (!pOutputBuffer->WriteToTCPFd(event.ident, event.data, writeAmount)) { 
    9890                                        FATAL("Unable to send data. %s:%d -> %s:%d", 
     
    10698                                        DISABLE_WRITE_DATA; 
    10799                                } 
    108                                 //                              else { 
    109                                 //                                      FINEST("Advertised: %d; sent: %d; initial :%d; leftovers: %d;", 
    110                                 //                                                      event.data, 
    111                                 //                                                      writeAmount, 
    112                                 //                                                      initial, 
    113                                 //                                                      GETAVAILABLEBYTESCOUNT(*pOutputBuffer)); 
    114                                 //                              } 
    115100                        } else { 
    116101                                DISABLE_WRITE_DATA; 
     
    208193        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    209194        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    210         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    211195        return true; 
    212196} 
  • trunk/sources/thelib/src/netio/kqueue/udpcarrier.cpp

    r302 r410  
    187187        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    188188        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    189         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    190189        return true; 
    191190} 
  • trunk/sources/thelib/src/netio/select/iohandler.cpp

    r190 r410  
    3535 
    3636IOHandler::~IOHandler() { 
    37         //FINEST("IOHandler %p is in destructor", this); 
    3837        if (_pProtocol != NULL) { 
    3938                _pProtocol->SetIOHandler(NULL); 
  • trunk/sources/thelib/src/netio/select/iohandlermanager.cpp

    r190 r410  
    211211        uint8_t state = 0; 
    212212 
    213         //    string str = ""; 
    214         //    for (map<int32_t, map<uint32_t, uint8_t> >::iterator i = _fdState.begin(); 
    215         //            i != _fdState.end(); i++) { 
    216         //        str += format("fd: %d\n", MAP_KEY(i)); 
    217         // 
    218         //        FOR_MAP(MAP_VAL(i), uint32_t, uint8_t, j) { 
    219         //            str += format("\thandler: %d; flags: %d\n", MAP_KEY(j), MAP_VAL(j)); 
    220         //        } 
    221         //    } 
    222         //    FINEST("str:\n%s", STR(str)); 
    223  
    224213        FOR_MAP(_fdState[fd], uint32_t, uint8_t, i) { 
    225214                state |= MAP_VAL(i); 
  • trunk/sources/thelib/src/netio/select/iotimer.cpp

    r193 r410  
    3131 
    3232IOTimer::~IOTimer() { 
    33         //FINEST("Disable timer"); 
    3433        IOHandlerManager::DisableTimer(this); 
    3534} 
  • trunk/sources/thelib/src/netio/select/stdiocarrier.cpp

    r193 r410  
    9393 
    9494                        while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    95                                 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer)); 
    9695                                if (!pOutputBuffer->WriteToStdio(_outboundFd, 
    9796                                                FD_WRITE_CHUNK)) { 
  • trunk/sources/thelib/src/netio/select/tcpacceptor.cpp

    r245 r410  
    3131: IOHandler(0, 0, IOHT_ACCEPTOR) { 
    3232        _pApplication = NULL; 
    33         //assert((port > 1024 && port < 65535) || (port == 80)); 
    3433        memset(&_address, 0, sizeof (sockaddr_in)); 
    3534 
  • trunk/sources/thelib/src/netio/select/tcpcarrier.cpp

    r271 r410  
    6969 
    7070TCPCarrier::~TCPCarrier() { 
    71         //FINEST("Delete tcp carrier %p", this); 
    7271        CLOSE_SOCKET(_inboundFd); 
    73         //FINEST("Done delete tcp carrier %p", this); 
    7472} 
    7573 
     
    9997 
    10098                        while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 
    101                                 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer)); 
    10299                                if (!pOutputBuffer->WriteToTCPFd(_outboundFd, 
    103100                                                _sendBufferSize, writeAmount)) { 
     
    208205        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    209206        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    210         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    211207        return true; 
    212208} 
  • trunk/sources/thelib/src/netio/select/udpcarrier.cpp

    r304 r410  
    188188        _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 
    189189        _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 
    190         //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort); 
    191190        return true; 
    192191} 
  • trunk/sources/thelib/src/protocols/baseprotocol.cpp

    r391 r410  
    175175 
    176176BaseProtocol *BaseProtocol::GetFarEndpoint() { 
    177         //FINEST("GetFarEndpoint called from %s", STR(tagToString(_type))); 
    178177        if (_pFarProtocol == NULL) { 
    179                 //FINEST("Hey! we are the far most protocol"); 
    180178                return this; 
    181179        } else { 
    182                 //FINEST("We are not the far most protocol"); 
    183180                return _pFarProtocol->GetFarEndpoint(); 
    184181        } 
     
    386383 
    387384        //6. Trigger log to production 
    388         //      FINEST("********** %s -> %s ********** %s", STR(oldAppName), STR(newAppName), 
    389         //                      STR(*this)); 
    390385} 
    391386 
  • trunk/sources/thelib/src/protocols/cli/inboundjsoncliprotocol.cpp

    r362 r410  
    3333bool InboundJSONCLIProtocol::Initialize(Variant &parameters) { 
    3434        InboundBaseCLIProtocol::Initialize(parameters); 
    35         //      _outputBuffer.ReadFromString("\r\nWelcome to "HTTP_HEADERS_X_POWERED_BY_US"\r\n\r\nType help for a list of commands\r\n\r\nrtmpd>"); 
    36         //      return EnqueueForOutbound(); 
    3735        if (parameters["useLengthPadding"] == V_BOOL) { 
    3836                _useLengthPadding = (bool)parameters["useLengthPadding"]; 
     
    7775 
    7876bool InboundJSONCLIProtocol::SendMessage(Variant &message) { 
    79         //      string output = ""; 
    80         //      output = "\r\nSTATUS: " + (string) message["status"] + "\r\n\r\n"; 
    81         //      output += (string) message["description"] + "\r\n"; 
    82         //      if (message["data"] == V_MAP) { 
    83         //              output += "\r\n"; 
    84         // 
    85         //              string item = ""; 
    86         //              Variant count; 
    87         //              count["count"] = message["data"].MapSize(); 
    88         //              if (!count.SerializeToJSON(item)) { 
    89         //                      FATAL("Unable to serialize to JSON"); 
    90         //                      return false; 
    91         //              } 
    92         //              output += item + "\r\n\r\n"; 
    93         // 
    94         //              FOR_MAP(message["data"], string, Variant, i) { 
    95         //                      item = ""; 
    96         //                      if (!MAP_VAL(i).SerializeToJSON(item)) { 
    97         //                              FATAL("Unable to serialize to JSON"); 
    98         //                              return false; 
    99         //                      } 
    100         //                      output += item + "\r\n"; 
    101         //              } 
    102         //      } 
    103         // 
    104         //      output += "\r\nrtmpd>"; 
    10577        string json; 
    10678        if (!message.SerializeToJSON(json)) { 
  • trunk/sources/thelib/src/protocols/dns/inbounddnsresolverprotocol.cpp

    r387 r410  
    6060        while (true) { 
    6161                if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { 
    62                         //FINEST("Not enough data"); 
    6362                        return true; 
    6463                } 
  • trunk/sources/thelib/src/protocols/dns/outbounddnsresolverprotocol.cpp

    r387 r410  
    146146        while (true) { 
    147147                if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { 
    148                         //FINEST("Not enough data"); 
    149148                        return true; 
    150149                } 
  • trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp

    r313 r410  
    392392                        return false; 
    393393                } 
    394                 //        FINEST("chunkSizeString: %s", STR(chunkSizeString)); 
    395                 //        FINEST("chunkSize: %d", chunkSize); 
    396                 //        FINEST("Bytes count: Wanted: %d. Got: %d.", 
    397                 //                chunkSize + chunkSizeString.size() + 2, 
    398                 //                GETAVAILABLEBYTESCOUNT(buffer)); 
    399                 //        FINEST("buffer:\n%s", STR(buffer)); 
    400394 
    401395                //9. Now, we know the chunk size... do we have enough data? 
     
    407401                                + 2 //the \r\n that follows the data chunk 
    408402                                ) { 
    409                         //            FINEST("Not enough data. Wanted: %d. Got: %d. Wait for more...", 
    410                         //                    chunkSizeString.size() //length of the chunk size string 
    411                         //                    - 2 //substract the 0x particle 
    412                         //                    + 2 //the \r\n that follows the chunk size string 
    413                         //                    + chunkSize //chunk size itself 
    414                         //                    + 2, //the \r\n that follows the data chunk 
    415                         //                    GETAVAILABLEBYTESCOUNT(buffer)); 
    416403                        return true; 
    417404                } 
     
    438425                //13. Ignore the bytes from the input buffer 
    439426                buffer.Ignore(chunkSizeString.size() - 2 + 2 + chunkSize + 2); 
    440                 //FINEST("AFTER buffer:\n%s", STR(buffer)); 
    441427 
    442428                //14. reset the state if necessary 
  • trunk/sources/thelib/src/protocols/http/inboundhttpprotocol.cpp

    r276 r410  
    128128 
    129129bool InboundHTTPProtocol::ParseFirstLine(string &line, Variant &headers) { 
    130         //FINEST("first line: %s", STR(line)); 
    131130 
    132131        vector<string> parts; 
     
    169168        //2. Is realm/uri combination into authentication mode? 
    170169        if (!auth["uris"].HasKey(_headers[HTTP_FIRST_LINE][HTTP_URL])) { 
    171                 //WARN("No auth required"); 
    172170                return true; 
    173171        } 
  • trunk/sources/thelib/src/protocols/http/outboundhttpprotocol.cpp

    r313 r410  
    100100 
    101101bool OutboundHTTPProtocol::Authenticate() { 
    102         //WARN("No auth required"); 
    103102        return true; 
    104103} 
  • trunk/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp

    r314 r410  
    8282                if (!_headerParsed) { 
    8383                        if (GETAVAILABLEBYTESCOUNT(buffer) < 13) { 
    84                                 //FINEST("Not enough data"); 
    8584                                break; 
    8685                        } 
     
    9190                //3. Read the frame header 
    9291                if (GETAVAILABLEBYTESCOUNT(buffer) < 11) { 
    93                         //FINEST("Not enough data"); 
    9492                        break; 
    9593                } 
     
    106104                } 
    107105                timestamp = ENTOHAP((GETIBPOINTER(buffer) + 4)); //----MARKED-LONG--- 
    108                 //        FINEST("type: %d; length: %d(0x%x); timestamp: %d(0x%x)", type, length, 
    109                 //                length, timestamp, timestamp); 
    110106 
    111107                //5. Do we have enough data? 15 bytes are the lead header and the trail length (11+4) 
    112108                if (GETAVAILABLEBYTESCOUNT(buffer) < length + 15) { 
    113                         //FINEST("Not enough data"); 
    114109                        return true; 
    115110                } 
  • trunk/sources/thelib/src/protocols/protocolfactorymanager.cpp

    r188 r410  
    8484 
    8585bool ProtocolFactoryManager::UnRegisterProtocolFactory(BaseProtocolFactory *pFactory) { 
    86         //FINEST("BEFORE:\n%s", STR(Dump())); 
    8786        if (pFactory == NULL) { 
    8887                WARN("pFactory is NULL"); 
     
    108107        _factoriesById.erase(pFactory->GetId()); 
    109108 
    110         //FINEST("AFTER:\n%s", STR(Dump())); 
    111109        return true; 
    112110} 
     
    165163        } 
    166164 
    167         // 
    168165        if (failed) { 
    169166                if (pResult != NULL) 
  • trunk/sources/thelib/src/protocols/rtmfp/basertmfpprotocol.cpp

    r296 r410  
    190190        WARN("OUTPUT: \n%s", STR(IOBuffer::DumpBuffer(_outputBuffer.pCRC, chunkLength + 8 + padLen))); 
    191191        Encrypt(pSession, _outputBuffer.pCRC, chunkLength + 8 + padLen); 
    192         //FINEST("AFTER: \n%s", STR(IOBuffer::DumpBuffer(_outputBuffer.pCRC, chunkLength + 8 + padLen))); 
    193192 
    194193        //5. Compute the xor 
    195194        EHTONLP(_outputBuffer.pXor_1, 
    196195                        ENTOHLP(_outputBuffer.pXor_2)^ENTOHLP(_outputBuffer.pXor_3)^pSession->id); 
    197         //INFO("%08x; \n%s", pSession->client.crc, STR(IOBuffer::DumpBuffer(_outputBuffer.outputBuffer, chunkLength + 8 + padLen + 4))); 
    198196 
    199197        //8. Before actual we do the actual transfer, move the current session where it belongs (if necessary) 
     
    236234                return; 
    237235        } 
    238         //FINEST("crc: %04x", crc); 
    239236 
    240237        //5. Read message type 
  • trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp

    r168 r410  
    123123        } 
    124124 
    125  
    126         //uint16_t length = (GETIBPOINTER(buffer)[0] << 8) | GETIBPOINTER(buffer)[1]; 
    127125        AMF_CHECK_BOUNDARIES(buffer, 4); 
    128126        uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 
     
    185183                buffer.ReadFromRepeat(AMF0_NUMBER, 1); 
    186184 
    187         //uint64_t temp = HTOND(*(uint64_t *) & value); 
    188185        uint64_t temp = 0; 
    189186        EHTOND(value, temp); 
     
    289286bool AMF0Serializer::ReadMixedArray(IOBuffer &buffer, Variant &variant, 
    290287                bool readType) { 
    291         //FINEST("Buffer:\n%s", STR(buffer)); 
    292288        if (readType) { 
    293289                AMF_CHECK_BOUNDARIES(buffer, 1); 
     
    306302        AMF_CHECK_BOUNDARIES(buffer, 4); 
    307303        uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 
    308         //FINEST("Detected mixed array length: %d",length); 
    309304        if (!buffer.Ignore(4)) { 
    310305                FATAL("Unable to ignore 4 bytes"); 
     
    353348        variant.IsArray(true); 
    354349 
    355         //FINEST("Variant:\n%s", STR(variant.ToString())); 
    356350 
    357351        return true; 
     
    405399 
    406400bool AMF0Serializer::ReadArray(IOBuffer &buffer, Variant &variant, bool readType) { 
    407         //FINEST("Buffer:\n%s", STR(buffer)); 
    408401 
    409402        if (readType) { 
     
    423416        AMF_CHECK_BOUNDARIES(buffer, 4); 
    424417        uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 
    425         //FINEST("Detected array length: %d", length); 
    426418        if (!buffer.Ignore(4)) { 
    427419                FATAL("Unable to ignore 4 bytes"); 
     
    440432        variant.IsArray(true); 
    441433 
    442         //FINEST("Variant:\n%s", STR(variant.ToString())); 
    443434 
    444435        return true; 
     
    816807 
    817808bool AMF0Serializer::IsAMF3(Variant &variant) { 
    818         //    if (variant == V_BYTEARRAY) 
    819         //        return true; 
    820         //    if (variant != V_MAP && variant != V_TYPED_MAP) 
    821         //        return false; 
    822         // 
    823         //    FOR_MAP(variant, string, Variant, i) { 
    824         //        if (IsAMF3(MAP_VAL(i))) 
    825         //            return true; 
    826         //    } 
    827809        return false; 
    828810} 
  • trunk/sources/thelib/src/protocols/rtmp/amf3serializer.cpp

    r168 r410  
    148148                case V_INT16: 
    149149                case V_INT32: 
    150                         //        { 
    151                         //            uint32_t temp = (uint32_t) variant; 
    152                         //            temp &= 0x1FFFFFFF; 
    153                         //            return WriteInteger(buffer, temp); 
    154                         //        } 
    155150                case V_UINT8: 
    156151                case V_UINT16: 
    157152                case V_UINT32: 
    158                         //        { 
    159                         //            return WriteInteger(buffer, variant); 
    160                         //        } 
    161153                case V_UINT64: 
    162154                case V_INT64: 
     
    266258        WRITE_AMF3_TYPE(AMF3_DOUBLE); 
    267259 
    268         //uint64_t u64Val = HTOND(*((uint64_t *) & value)); 
    269260        uint64_t u64Val = 0; 
    270261        EHTOND(value, u64Val); 
     
    395386                        return false; 
    396387                } 
    397                 //FINEST("key: %s", STR(key)); 
    398388                if (key == "") 
    399389                        break; 
     
    630620bool AMF3Serializer::WriteObject(IOBuffer &buffer, Variant &variant, bool writeType) { 
    631621        WRITE_AMF3_TYPE(AMF3_OBJECT); 
    632         //(variant.MapSize() << 4) | 
    633622        if (!WriteU29(buffer, 0x0b)) { 
    634623                FATAL("Unable to save the traits count"); 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp

    r389 r410  
    209209bool BaseRTMPAppProtocolHandler::InboundMessageAvailable(BaseRTMPProtocol *pFrom, 
    210210                Variant &request) { 
    211         //FINEST("request:\n%s", STR(request.ToString())); 
    212211 
    213212        //1. Perform authentication 
     
    373372bool BaseRTMPAppProtocolHandler::ProcessPeerBW(BaseRTMPProtocol *pFrom, 
    374373                Variant &request) { 
    375         //WARN("ProcessPeerBW:\n%s", STR(request.ToString())); 
    376374        WARN("ProcessPeerBW"); 
    377375        return true; 
     
    380378bool BaseRTMPAppProtocolHandler::ProcessAck(BaseRTMPProtocol *pFrom, 
    381379                Variant &request) { 
    382         //WARN("ProcessAck:\n%s", STR(request.ToString())); 
    383380        return true; 
    384381} 
     
    408405                case RM_USRCTRL_TYPE_PING_REQUEST: 
    409406                { 
    410                         //FINEST("request:\n%s", STR(request.ToString())); 
    411407                        Variant response = ConnectionMessageFactory::GetPong(); 
    412                         //ASSERT("response:\n%s", STR(response.ToString())); 
    413408                        return SendRTMPMessage(pFrom, response); 
    414409                } 
     
    424419                case RM_USRCTRL_TYPE_UNKNOWN2: 
    425420                { 
    426                         //WARN("User control message type: %s", STR(M_USRCTRL_TYPE_STRING(request))); 
    427421                        return true; 
    428422                } 
     
    437431bool BaseRTMPAppProtocolHandler::ProcessNotify(BaseRTMPProtocol *pFrom, 
    438432                Variant &request) { 
    439         //FINEST("request:\n%s", STR(request.ToString())); 
    440433        //1. Find the corresponding inbound stream 
    441434        InNetRTMPStream *pInNetRTMPStream = NULL; 
     
    478471bool BaseRTMPAppProtocolHandler::ProcessFlexStreamSend(BaseRTMPProtocol *pFrom, 
    479472                Variant &request) { 
    480         //FINEST("request:\n%s", STR(request.ToString())); 
    481473 
    482474        //1. Find the corresponding inbound stream 
     
    525517bool BaseRTMPAppProtocolHandler::ProcessInvoke(BaseRTMPProtocol *pFrom, 
    526518                Variant &request) { 
    527         //FINEST("Request:\n%s", STR(request.ToString())); 
    528519 
    529520        string functionName = request[RM_INVOKE][RM_INVOKE_FUNCTION]; 
     
    567558bool BaseRTMPAppProtocolHandler::ProcessInvokeConnect(BaseRTMPProtocol *pFrom, 
    568559                Variant & request) { 
    569         //FINEST("\n%s", STR(request.ToString())); 
    570560        //1. Send the channel specific messages 
    571561        Variant response = GenericMessageFactory::GetWinAckSize(2500000); 
     
    975965        } 
    976966 
    977         //pProtocol-> 
    978  
    979967        //6. Get our hands on streaming parameters 
    980968        string path = ""; 
     
    10711059bool BaseRTMPAppProtocolHandler::ProcessInvokeGetStreamLength(BaseRTMPProtocol *pFrom, 
    10721060                Variant & request) { 
    1073         //FINEST("Request:\n%s", STR(request.ToString())); 
    10741061        Variant metadata = GetMetaData(M_INVOKE_PARAM(request, 1), true); 
    10751062        Variant params; 
     
    10911078bool BaseRTMPAppProtocolHandler::ProcessInvokeOnBWDone(BaseRTMPProtocol *pFrom, 
    10921079                Variant &request) { 
    1093         //WARN("ProcessInvokeOnBWDone:\n%s", STR(request.ToString())); 
    10941080        WARN("ProcessInvokeOnBWDone"); 
    10951081        return true; 
     
    13211307bool BaseRTMPAppProtocolHandler::AuthenticateInboundAdobe(BaseRTMPProtocol *pFrom, 
    13221308                Variant & request, Variant &authState) { 
    1323  
    1324         //      FINEST("_configuration:\n%s", STR(_configuration.ToString())); 
    1325         //      FINEST("request:\n%s", STR(request.ToString())); 
    1326  
    13271309        if (!authState.HasKey("stage")) 
    13281310                authState["stage"] = "inProgress"; 
    1329         //FINEST("authState:\n%s", STR(authState.ToString())); 
    13301311 
    13311312        if (authState["stage"] == "authenticated") { 
     
    13901371        } 
    13911372        string appUrl = (string) connectParams[RM_INVOKE_PARAMS_CONNECT_APP]; 
    1392         //FINEST("appUrl: %s", STR(appUrl)); 
    13931373 
    13941374        //8. Split the URI into parts 
     
    14071387                                return false; 
    14081388                        } 
    1409                         //FINEST("response:\n%s", STR(response.ToString())); 
    14101389 
    14111390                        response = ConnectionMessageFactory::GetInvokeClose(); 
     
    14141393                                return false; 
    14151394                        } 
    1416                         //FINEST("response:\n%s", STR(response.ToString())); 
    14171395 
    14181396                        pFrom->GracefullyEnqueueForDelete(); 
     
    14291407                                return true; 
    14301408                        } 
    1431  
    1432                         //            FOR_MAP(params, string, string, i) { 
    1433                         //                FINEST("%s: `%s`", STR(MAP_KEY(i)), STR(MAP_VAL(i))); 
    1434                         //            } 
    14351409 
    14361410                        string user = params["user"]; 
     
    14461420                                        WARN("No such user: `%s`", STR(user)); 
    14471421                                        Variant response = ConnectionMessageFactory::GetInvokeConnectError(request, 
    1448                                                         //"[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=nosuchuser&opaque=nQoAAA=="); 
    14491422                                                        "[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed&opaque=vgoAAA=="); 
    14501423                                        if (!pFrom->SendMessage(response)) { 
     
    14521425                                                return false; 
    14531426                                        } 
    1454                                         //FINEST("response:\n%s", STR(response.ToString())); 
    14551427 
    14561428                                        response = ConnectionMessageFactory::GetInvokeClose(); 
     
    14591431                                                return false; 
    14601432                                        } 
    1461                                         //FINEST("response:\n%s", STR(response.ToString())); 
    14621433 
    14631434                                        pFrom->GracefullyEnqueueForDelete(); 
     
    14781449                                } else { 
    14791450                                        WARN("Invalid password for user `%s`", STR(user)); 
    1480                                         //                                      FATAL("Auth failed: s1: `%s`; h1: `%s`; s2: `%s`; h2: `%s`", 
    1481                                         //                                                      STR(str1), STR(hash1), STR(str2), STR(hash2)); 
    14821451                                        Variant response = ConnectionMessageFactory::GetInvokeConnectError(request, 
    14831452                                                        "[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed&opaque=vgoAAA=="); 
     
    14861455                                                return false; 
    14871456                                        } 
    1488                                         //FINEST("response:\n%s", STR(response.ToString())); 
    14891457 
    14901458                                        response = ConnectionMessageFactory::GetInvokeClose(); 
     
    14931461                                                return false; 
    14941462                                        } 
    1495                                         //FINEST("response:\n%s", STR(response.ToString())); 
    14961463 
    14971464                                        pFrom->GracefullyEnqueueForDelete(); 
     
    15111478                                        return false; 
    15121479                                } 
    1513                                 //FINEST("response:\n%s", STR(response.ToString())); 
    15141480 
    15151481                                response = ConnectionMessageFactory::GetInvokeClose(); 
     
    15181484                                        return false; 
    15191485                                } 
    1520                                 //FINEST("response:\n%s", STR(response.ToString())); 
    15211486 
    15221487                                pFrom->GracefullyEnqueueForDelete(); 
     
    16181583 
    16191584        result[META_SERVER_FULL_PATH] = normalizePath(_mediaFolder, searchFor); 
    1620         //ASSERT("result[META_SERVER_FULL_PATH]: %s\n_mediaFolder: %s\nsearchFor: %s", 
    1621         //      STR(result[META_SERVER_FULL_PATH]), 
    1622         //      STR(_mediaFolder), 
    1623         //      STR(searchFor)); 
    1624  
    1625         //FINEST("result[META_SERVER_FULL_PATH]: %s", STR(result[META_SERVER_FULL_PATH])); 
     1585 
    16261586        if (!result.HasKey(META_SERVER_FULL_PATH)) 
    16271587                result[META_SERVER_FULL_PATH] = ""; 
     
    16811641                                } 
    16821642                                M_INVOKE_ID(message) = invokeId; 
    1683                                 //  FINEST("PID: %d; IID: %d", pTo->GetId(), invokeId); 
    16841643                                if (trackResponse) 
    16851644                                        _resultMessageTracking[pTo->GetId()][invokeId] = message; 
     
    17131672        split(streamName, "?", parts); 
    17141673        string shortName = parts[0]; 
    1715         //FINEST("short name: `%s`; long name: `%s`", STR(shortName), STR(streamName)); 
    17161674 
    17171675        //2. Search for the long version first 
     
    18511809bool BaseRTMPAppProtocolHandler::ConnectForPullPush(BaseRTMPProtocol *pFrom, 
    18521810                string uriPath, Variant &streamConfig) { 
    1853         //FINEST("streamConfig:\n%s", STR(streamConfig.ToString())); 
    18541811        URI uri; 
    18551812        if (!URI::FromVariant(streamConfig[uriPath], uri)) { 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp

    r318 r410  
    144144        if (_handshakeCompleted) { 
    145145                result = ProcessBytes(buffer); 
    146                 //FINEST("Bytes were processed in %d clocks", end - start); 
    147146                uint32_t decodedBytes = GetDecodedBytesCount(); 
    148147                if (result && decodedBytes >= _nextReceivedBytesCountReport) { 
    149148                        Variant _bytesReadMessage = GenericMessageFactory::GetAck(decodedBytes); 
    150149                        _nextReceivedBytesCountReport += _winAckSize; 
    151                         //FINEST("BR\n%s", STR(_bytesReadMessage.ToString())); 
    152150                        if (!SendMessage(_bytesReadMessage)) { 
    153151                                FATAL("Unable to send\n%s", STR(_bytesReadMessage.ToString())); 
     
    215213 
    216214bool BaseRTMPProtocol::SendMessage(Variant & message) { 
    217         //    //1. Test the ability to further send data 
    218         //    if (GETAVAILABLEBYTESCOUNT(_outputBuffer) >= MAX_RTMP_OUTPUT_BUFFER) { 
    219         //        FATAL("Too many data left unsent [%d of maximum %d]. Abort!", 
    220         //                GETAVAILABLEBYTESCOUNT(_outputBuffer), MAX_RTMP_OUTPUT_BUFFER); 
    221         //        return false; 
    222         //    } 
    223         //    FINEST("message:\n%s", STR(message.ToString())); 
    224  
    225215        //2. Send the message 
    226216        if (!_rtmpProtocolSerializer.Serialize(_channels[(uint32_t) VH_CI(message)], 
     
    277267 
    278268void BaseRTMPProtocol::TrySetOutboundChunkSize(uint32_t chunkSize) { 
    279         //    WARN("Try to set outbound Chunk size for RTMP connection %p: %d->%d", this, 
    280         //            _outboundChunkSize, chunkSize); 
    281269        if (_outboundChunkSize >= chunkSize) { 
    282                 //        WARN("The chunk size will remain the same."); 
    283270                return; 
    284271        } 
     
    303290 
    304291bool BaseRTMPProtocol::CloseStream(uint32_t streamId, bool createNeutralStream) { 
    305         //FINEST("-----bool BaseRTMPProtocol::CloseStream: %d", streamId); 
    306292        //1. Validate request 
    307293        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
     
    348334                                GetApplication()->GetStreamsManager(), streamId); 
    349335        } 
    350         //FINEST("Stream %d closed", streamId); 
    351336 
    352337        return true; 
     
    354339 
    355340RTMPStream * BaseRTMPProtocol::CreateNeutralStream(uint32_t & streamId) { 
    356         //FINEST("-----bool BaseRTMPProtocol::CreateNeutralStream: %d", streamId); 
    357341        if (streamId == 0) { 
    358342                //Automatic allocation 
     
    387371InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, 
    388372                uint32_t streamId, string streamName) { 
    389         //FINEST("-----bool BaseRTMPProtocol::CreateNIS: %d", streamId); 
    390373        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    391374                FATAL("Invalid stream id: %d", streamId); 
     
    417400BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, 
    418401                string streamName, uint64_t inStreamType) { 
    419         //FINEST("-----bool BaseRTMPProtocol::CreateNOS: %d", streamId); 
    420402        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    421403                FATAL("Invalid stream id: %d", streamId); 
     
    452434 
    453435void BaseRTMPProtocol::SignalONS(BaseOutNetRTMPStream *pONS) { 
    454         //    FINEST("-----Stream %d from protocol %d was marked as signal-able", 
    455         //            GetId(), pNOS->GetId()); 
    456436        LinkedListNode<BaseOutNetRTMPStream *> *pTemp = _pSignaledRTMPOutNetStream; 
    457437        while (pTemp != NULL) { 
    458438                if (pTemp->info == pONS) { 
    459                         //WARN("Already marked for signaling"); 
    460439                        return; 
    461440                } 
     
    467446 
    468447InFileRTMPStream * BaseRTMPProtocol::CreateIFS(Variant &metadata) { 
    469         //FINEST("-----bool BaseRTMPProtocol::CreateFIS:\n%s", STR(metadata.ToString())); 
    470448        InFileRTMPStream *pRTMPInFileStream = InFileRTMPStream::GetInstance( 
    471449                        this, GetApplication()->GetStreamsManager(), metadata); 
     
    485463 
    486464void BaseRTMPProtocol::RemoveIFS(InFileRTMPStream *pIFS) { 
    487         //FINEST("-----Remove FIS: %p", pIFS); 
    488465        _inFileStreams.erase(pIFS); 
    489466        delete pIFS; 
     
    595572                uint32_t availableBytesCount = GETAVAILABLEBYTESCOUNT(buffer); 
    596573                if (_selectedChannel < 0) { 
    597                         //FINEST("availableBytesCount: %d",availableBytesCount); 
    598574                        if (availableBytesCount < 1) { 
    599                                 //FINEST("Not enough data"); 
    600575                                return true; 
    601576                        } else { 
     
    647622                        } else { 
    648623                                if (header.readCompleted) { 
    649                                         //FINEST("Header:%s", STR(header)); 
    650624                                        channel.state = CS_PAYLOAD; 
    651625                                        switch (channel.lastInHeaderType) { 
     
    659633                                                case HT_CONTINUATION: 
    660634                                                        if (channel.lastInProcBytes == 0) { 
    661                                                                 //FINEST("Time adjusted on channel %d", channel.id); 
    662635                                                                channel.lastInAbsTs += H_TS(header); 
    663636                                                        } 
     
    665638                                        } 
    666639                                } else { 
    667                                         //FINEST("Not enough data"); 
    668640                                        return true; 
    669641                                } 
     
    673645                if (channel.state == CS_PAYLOAD) { 
    674646                        uint32_t tempSize = H_ML(header) - channel.lastInProcBytes; 
    675                         //FINEST("Expected: %d", tempSize); 
    676647                        tempSize = (tempSize >= _inboundChunkSize) ? _inboundChunkSize : tempSize; 
    677                         //FINEST("Chunked: %d", tempSize); 
    678648                        uint32_t availableBytes = GETAVAILABLEBYTESCOUNT(buffer); 
    679649                        switch (H_MT(header)) { 
    680650                                case RM_HEADER_MESSAGETYPE_VIDEODATA: 
    681651                                { 
    682                                         //FINEST("V: tempSize: %d; availableBytes: %d; totalRequired: %d", 
    683                                         //        tempSize, availableBytes, header.messageLength); 
    684652                                        if (tempSize <= availableBytes) { 
    685                                                 //FINEST("V: Enough data"); 
    686653                                                channel.state = CS_HEADER; 
    687654                                                _selectedChannel = -1; 
     
    711678 
    712679                                                channel.lastInProcBytes += tempSize; 
    713                                                 //FINEST("V: processedBytes: %d", channel.processedBytes); 
    714680                                                if (H_ML(header) == channel.lastInProcBytes) { 
    715                                                         //FINEST("V: %d Message completed: %d", 
    716                                                         //  GetId(), 
    717                                                         //  header.messageLength); 
    718681                                                        channel.lastInProcBytes = 0; 
    719682                                                } 
     
    724687                                                break; 
    725688                                        } else { 
    726                                                 //FINEST("V: Not enough data. Available: %d; Wanted: %d", 
    727                                                 //  availableBytes, tempSize); 
    728689                                                return true; 
    729690                                        } 
     
    731692                                case RM_HEADER_MESSAGETYPE_AUDIODATA: 
    732693                                { 
    733                                         //FINEST("A: tempSize: %d; availableBytes: %d; totalRequired: %d", 
    734                                         //        tempSize, availableBytes, header.messageLength); 
    735694                                        if (tempSize <= availableBytes) { 
    736                                                 //FINEST("A: Enough data"); 
    737695                                                channel.state = CS_HEADER; 
    738696                                                _selectedChannel = -1; 
     
    760718 
    761719                                                channel.lastInProcBytes += tempSize; 
    762                                                 //FINEST("A: processedBytes: %d", channel.processedBytes); 
    763720                                                if (H_ML(header) == channel.lastInProcBytes) { 
    764                                                         //FINEST("A: %d Message completed: %d", 
    765                                                         //  GetId(), 
    766                                                         //  header.messageLength); 
    767721                                                        channel.lastInProcBytes = 0; 
    768722                                                } 
     
    773727                                                break; 
    774728                                        } else { 
    775                                                 //FINEST("A: Not enough data. Available: %d; Wanted: %d", 
    776                                                 //  availableBytes, tempSize); 
    777729                                                return true; 
    778730                                        } 
     
    795747                                                                return false; 
    796748                                                        } 
    797                                                         //FINEST("Buffer:\n%s", STR(channel.buffer)); 
    798749                                                        if (!_pProtocolHandler->InboundMessageAvailable(this, header, channel.inputData)) { 
    799750                                                                FATAL("Unable to send rtmp message to application"); 
     
    808759                                                        } 
    809760                                                } else { 
    810                                                         //FINEST("Channel buffer length: %d", channel.buffer.GetAvailableBytesCount()); 
    811761                                                } 
    812762                                                break; 
    813763                                        } else { 
    814                                                 //                        FINEST("I: Not enough data. Available: %d; Wanted: %d", 
    815                                                 //                                availableBytes, tempSize); 
    816764                                                return true; 
    817765                                        } 
  • trunk/sources/thelib/src/protocols/rtmp/header_be_ba.cpp

    r278 r410  
    186186 
    187187bool Header::Write(Channel &channel, IOBuffer &buffer) { 
    188         //FINEST("this: %p", this); 
    189188        //1. Compute the header size 
    190189        if (channel.lastOutStreamId == H_SI(*this)) { 
    191                 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id); 
    192190                if (H_IA(*this)) { 
    193                         //FINEST("This is absolute ts."); 
    194191                        if (channel.lastOutProcBytes == 0) { 
    195                                 //FINEST("This is the beginning of a packet"); 
    196192                                H_HT(*this) = HT_FULL; 
    197193                                channel.lastOutAbsTs = H_TS(*this); 
    198194                        } else { 
    199                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    200195                                H_HT(*this) = HT_CONTINUATION; 
    201196                        } 
    202197                } else { 
    203                         //FINEST("This is relative ts."); 
    204198                        if (channel.lastOutProcBytes == 0) { 
    205                                 //FINEST("This is the beginning of a packet"); 
    206199                                H_HT(*this) = HT_SAME_STREAM; 
    207200                                if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 
    208201                                                (H_ML(*this) == H_ML(channel.lastOutHeader))) { 
    209                                         //FINEST("Same stream and same length and type"); 
    210202                                        H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 
    211203                                        if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 
    212                                                 //FINEST("Exactly the same header"); 
    213204                                                H_HT(*this) = HT_CONTINUATION; 
    214205                                        } 
     
    216207                                channel.lastOutAbsTs += H_TS(*this); 
    217208                        } else { 
    218                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    219209                                H_HT(*this) = HT_CONTINUATION; 
    220210                        } 
    221211                } 
    222212        } else { 
    223                 //        FINEST("Different stream on channel %d: channel: %d; header: %d", 
    224                 //                channel.id, channel.lastOutStreamId, H_SI(*this)); 
    225213                H_HT(*this) = HT_FULL; 
    226214                H_IA(*this) = true; 
     
    232220        channel.lastOutHeader = *this; 
    233221 
    234         //    if (H_CI(*this) == 20) 
    235         //        DEBUG("header: %s", STR(*this)); 
    236         //    else if (H_CI(*this) == 21) 
    237         //        FINEST("header: %s", STR(*this)); 
    238  
    239222        //3. do the write 
    240223        return Write(buffer); 
     
    242225 
    243226bool Header::Write(IOBuffer &buffer) { 
    244         //FINEST("header: %s", STR(*this)); 
    245227        if (ci < 64) { 
    246228                buffer.ReadFromByte((ht << 6) | ci); 
     
    268250                                hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 
    269251                                H_SI(*this) = ntosi(H_SI(*this)); 
    270                                 //FINEST("Output buffer: %s", STR(buffer)); 
    271252                                return true; 
    272253                        } else { 
     
    280261                                H_SI(*this) = ntosi(H_SI(*this)); 
    281262                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    282                                 //FINEST("Output buffer: %s", STR(buffer)); 
    283263                                return true; 
    284264                        } 
     
    292272                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    293273                                hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 
    294                                 //FINEST("Output buffer: %s", STR(buffer)); 
    295274                                return true; 
    296275                        } else { 
     
    302281                                hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 
    303282                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    304                                 //FINEST("Output buffer: %s", STR(buffer)); 
    305283                                return true; 
    306284                        } 
     
    312290                                buffer.ReadFromBuffer(&hf.datac[1], 3); 
    313291                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    314                                 //FINEST("Output buffer: %s", STR(buffer)); 
    315292                                return true; 
    316293                        } else { 
     
    320297                                hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 
    321298                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    322                                 //FINEST("Output buffer: %s", STR(buffer)); 
    323299                                return true; 
    324300                        } 
  • trunk/sources/thelib/src/protocols/rtmp/header_le_ba.cpp

    r278 r410  
    178178 
    179179bool Header::Write(Channel &channel, IOBuffer &buffer) { 
    180         //FINEST("this: %p", this); 
    181180        //1. Compute the header size 
    182181        if (channel.lastOutStreamId == H_SI(*this)) { 
    183                 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id); 
    184182                if (H_IA(*this)) { 
    185                         //FINEST("This is absolute ts."); 
    186183                        if (channel.lastOutProcBytes == 0) { 
    187                                 //FINEST("This is the beginning of a packet"); 
    188184                                H_HT(*this) = HT_FULL; 
    189185                                channel.lastOutAbsTs = H_TS(*this); 
    190186                        } else { 
    191                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    192187                                H_HT(*this) = HT_CONTINUATION; 
    193188                        } 
    194189                } else { 
    195                         //FINEST("This is relative ts."); 
    196190                        if (channel.lastOutProcBytes == 0) { 
    197                                 //FINEST("This is the beginning of a packet"); 
    198191                                H_HT(*this) = HT_SAME_STREAM; 
    199192                                if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 
    200193                                                (H_ML(*this) == H_ML(channel.lastOutHeader))) { 
    201                                         //FINEST("Same stream and same length and type"); 
    202194                                        H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 
    203195                                        if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 
    204                                                 //FINEST("Exactly the same header"); 
    205196                                                H_HT(*this) = HT_CONTINUATION; 
    206197                                        } 
     
    208199                                channel.lastOutAbsTs += H_TS(*this); 
    209200                        } else { 
    210                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    211201                                H_HT(*this) = HT_CONTINUATION; 
    212202                        } 
    213203                } 
    214204        } else { 
    215                 //        FINEST("Different stream on channel %d: channel: %d; header: %d", 
    216                 //                channel.id, channel.lastOutStreamId, H_SI(*this)); 
    217205                H_HT(*this) = HT_FULL; 
    218206                H_IA(*this) = true; 
     
    224212        channel.lastOutHeader = *this; 
    225213 
    226         //    if (H_CI(*this) == 20) 
    227         //        DEBUG("header: %s", STR(*this)); 
    228         //    else if (H_CI(*this) == 21) 
    229         //        FINEST("header: %s", STR(*this)); 
    230  
    231214        //3. do the write 
    232215        return Write(buffer); 
     
    234217 
    235218bool Header::Write(IOBuffer &buffer) { 
    236         //FINEST("header: %s", STR(*this)); 
    237219        if (ci < 64) { 
    238220                buffer.ReadFromByte((ht << 6) | ((uint8_t) ci)); 
     
    258240                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    259241                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    260                                 //FINEST("Output buffer: %s", STR(buffer)); 
    261242                                return true; 
    262243                        } else { 
     
    268249                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    269250                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    270                                 //FINEST("Output buffer: %s", STR(buffer)); 
    271251                                return true; 
    272252                        } 
     
    280260                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    281261                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    282                                 //FINEST("Output buffer: %s", STR(buffer)); 
    283262                                return true; 
    284263                        } else { 
     
    290269                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    291270                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    292                                 //FINEST("Output buffer: %s", STR(buffer)); 
    293271                                return true; 
    294272                        } 
     
    300278                                buffer.ReadFromBuffer(&hf.datac[1], 3); 
    301279                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    302                                 //FINEST("Output buffer: %s", STR(buffer)); 
    303280                                return true; 
    304281                        } else { 
     
    308285                                hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 
    309286                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    310                                 //FINEST("Output buffer: %s", STR(buffer)); 
    311287                                return true; 
    312288                        } 
  • trunk/sources/thelib/src/protocols/rtmp/header_le_sa.cpp

    r278 r410  
    178178 
    179179bool Header::Write(Channel &channel, IOBuffer &buffer) { 
    180         //FINEST("this: %p", this); 
    181180        //1. Compute the header size 
    182181        if (channel.lastOutStreamId == H_SI(*this)) { 
    183                 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id); 
    184182                if (H_IA(*this)) { 
    185                         //FINEST("This is absolute ts."); 
    186183                        if (channel.lastOutProcBytes == 0) { 
    187                                 //FINEST("This is the beginning of a packet"); 
    188184                                H_HT(*this) = HT_FULL; 
    189185                                channel.lastOutAbsTs = H_TS(*this); 
    190186                        } else { 
    191                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    192187                                H_HT(*this) = HT_CONTINUATION; 
    193188                        } 
    194189                } else { 
    195                         //FINEST("This is relative ts."); 
    196190                        if (channel.lastOutProcBytes == 0) { 
    197                                 //FINEST("This is the beginning of a packet"); 
    198191                                H_HT(*this) = HT_SAME_STREAM; 
    199192                                if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 
    200193                                                (H_ML(*this) == H_ML(channel.lastOutHeader))) { 
    201                                         //FINEST("Same stream and same length and type"); 
    202194                                        H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 
    203195                                        if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 
    204                                                 //FINEST("Exactly the same header"); 
    205196                                                H_HT(*this) = HT_CONTINUATION; 
    206197                                        } 
     
    208199                                channel.lastOutAbsTs += H_TS(*this); 
    209200                        } else { 
    210                                 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes); 
    211201                                H_HT(*this) = HT_CONTINUATION; 
    212202                        } 
    213203                } 
    214204        } else { 
    215                 //        FINEST("Different stream on channel %d: channel: %d; header: %d", 
    216                 //                channel.id, channel.lastOutStreamId, H_SI(*this)); 
    217205                H_HT(*this) = HT_FULL; 
    218206                H_IA(*this) = true; 
     
    224212        channel.lastOutHeader = *this; 
    225213 
    226         //    if (H_CI(*this) == 20) 
    227         //        DEBUG("header: %s", STR(*this)); 
    228         //    else if (H_CI(*this) == 21) 
    229         //        FINEST("header: %s", STR(*this)); 
    230  
    231214        //3. do the write 
    232215        return Write(buffer); 
     
    234217 
    235218bool Header::Write(IOBuffer &buffer) { 
    236         //FINEST("header: %s", STR(*this)); 
    237219        if (ci < 64) { 
    238220                buffer.ReadFromByte((ht << 6) | ci); 
     
    258240                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    259241                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    260                                 //FINEST("Output buffer: %s", STR(buffer)); 
    261242                                return true; 
    262243                        } else { 
     
    268249                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    269250                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    270                                 //FINEST("Output buffer: %s", STR(buffer)); 
    271251                                return true; 
    272252                        } 
     
    280260                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    281261                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    282                                 //FINEST("Output buffer: %s", STR(buffer)); 
    283262                                return true; 
    284263                        } else { 
     
    290269                                hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 
    291270                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    292                                 //FINEST("Output buffer: %s", STR(buffer)); 
    293271                                return true; 
    294272                        } 
     
    300278                                buffer.ReadFromBuffer(&hf.datac[1], 3); 
    301279                                hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 
    302                                 //FINEST("Output buffer: %s", STR(buffer)); 
    303280                                return true; 
    304281                        } else { 
     
    308285                                hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 
    309286                                buffer.ReadFromBuffer((uint8_t *) & temp, 4); 
    310                                 //FINEST("Output buffer: %s", STR(buffer)); 
    311287                                return true; 
    312288                        } 
  • trunk/sources/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp

    r247 r410  
    9797        //7. Do the dammage 
    9898        bool result; 
    99         //FINEST("Process %s", STR(parts[1])); 
    10099        if (parts[1] == "fcs") { 
    101100                result = ProcessFcs(parts); 
     
    134133void InboundHTTP4RTMP::ReadyForSend() { 
    135134        if (_pNearProtocol != NULL) { 
    136                 //FINEST("InboundHTTP4RTMP::ReadyForSend"); 
    137135                _pNearProtocol->ReadyForSend(); 
    138136        } 
     
    199197        IOBuffer *pBuffer = pProtocol->GetOutputBuffer(); 
    200198        if (pBuffer != NULL) { 
    201                 //FINEST("We have to send %d bytes", GETAVAILABLEBYTESCOUNT(*pBuffer)); 
    202199                _outputBuffer.ReadFromBuffer(GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)); 
    203200                pBuffer->IgnoreAll(); 
     
    214211        } 
    215212 
    216         //FINEST("_inputBuffer:\n%s", STR(_inputBuffer)); 
    217213        if (!pProtocol->SignalInputData(_inputBuffer)) { 
    218214                FATAL("Unable to call upper protocol"); 
     
    223219        IOBuffer *pBuffer = pProtocol->GetOutputBuffer(); 
    224220        if (pBuffer != NULL) { 
    225                 //FINEST("We have to send %d bytes", GETAVAILABLEBYTESCOUNT(*pBuffer)); 
    226221                _outputBuffer.ReadFromBuffer(GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)); 
    227222                pBuffer->IgnoreAll(); 
  • trunk/sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp

    r252 r410  
    5454                { 
    5555                        if (GETAVAILABLEBYTESCOUNT(buffer) < 1537) { 
    56                                 //FINEST("Not enough data"); 
    5756                                return true; 
    5857                        } 
     
    6463 
    6564                        _currentFPVersion = ENTOHL(*((uint32_t *) (GETIBPOINTER(buffer) + 4))); //----MARKED-LONG--- 
    66                         //FINEST("Flash player: %s", STR(_currentFlashPlayerVersion)); 
    6765 
    6866                        switch (handshakeType) { 
     
    8482                case RTMP_STATE_SERVER_RESPONSE_SENT: 
    8583                { 
    86                         //FINEST("I: Player request 2:\n%s", STR(*pInputBuffer)); 
    8784                        if (GETAVAILABLEBYTESCOUNT(buffer) < 1536) { 
    8885                                return true; 
     
    149146                        1536 - clientDigestOffset - 32); 
    150147 
    151         //uint8_t *pTempHash = new uint8_t[mhash_get_hash_pblock(MHASH_SHA256)]; 
    152148        uint8_t *pTempHash = new uint8_t[512]; 
    153149        HMACsha256(pTempBuffer, 1536 - 32, genuineFPKey, 30, pTempHash); 
     
    207203        uint32_t serverDHOffset = GetDHOffset(_pOutputBuffer, _validationScheme); 
    208204        uint32_t clientDHOffset = GetDHOffset(pInputBuffer, _validationScheme); 
    209         //FINEST("serverDHOffset: %u", serverDHOffset); 
    210205 
    211206        //generate DH key 
     
    251246        //generate the digest 
    252247        uint32_t serverDigestOffset = GetDigestOffset(_pOutputBuffer, _validationScheme); 
    253         //FINEST("serverDigestOffset: %u", serverDigestOffset); 
    254248 
    255249        uint8_t *pTempBuffer = new uint8_t[1536 - 32]; 
     
    272266        //Compute the chalange index from the initial client request 
    273267        uint32_t keyChallengeIndex = GetDigestOffset(pInputBuffer, _validationScheme); 
    274         //FINEST("keyChallengeIndex: %u", keyChallengeIndex); 
    275268 
    276269        //compute the key 
  • trunk/sources/thelib/src/protocols/rtmp/inboundrtmpsdiscriminatorprotocol.cpp

    r248 r410  
    9090        } 
    9191 
    92         //**** ---> **** 
    93  
    9492        //3. Destroy the link 
    9593        BaseProtocol *pFar = _pFarProtocol; 
  • trunk/sources/thelib/src/protocols/rtmp/messagefactories/connectionmessagefactory.cpp

    r2 r410  
    4646    connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_APP] = appName; 
    4747    connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_AUDIOCODECS] = audioCodecs; 
    48     //connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_CAPABILITIES] = capabilities; 
    4948    connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_FLASHVER] = flashVer; 
    5049    connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_FPAD] = (bool)fPad; 
  • trunk/sources/thelib/src/protocols/rtmp/outboundrtmpprotocol.cpp

    r269 r410  
    193193        for (uint32_t i = 0; i < 1536; i++) { 
    194194                _pOutputBuffer[i] = rand() % 256; 
    195                 //_pOutputBuffer[i] = 0; 
    196195        } 
    197196 
     
    200199 
    201200        DEBUG_HANDSHAKE("PHS1:  5. Put the flash version. We impersonate with 9.0.124.2"); 
    202         //EHTONLP(_pOutputBuffer + 4, 0); 
    203201        _pOutputBuffer[4] = 9; 
    204202        _pOutputBuffer[5] = 0; 
     
    251249        _outputBuffer.ReadFromBuffer(_pOutputBuffer, 1536); 
    252250        _outputBuffer222.ReadFromBuffer(_pOutputBuffer, 1536); 
    253         //FINEST("InputBuffer:\n%s", STR(_outputBuffer)); 
    254251 
    255252        DEBUG_HANDSHAKE("PHS1: 15. delete the buffer"); 
  • trunk/sources/thelib/src/protocols/rtmp/rtmpeprotocol.cpp

    r56 r410  
    5858 
    5959bool RTMPEProtocol::SignalInputData(IOBuffer &buffer) { 
    60         //FINEST("Encoded:\n%s", STR(*pInputBuffer)); 
    6160        RC4(_pKeyIn, GETAVAILABLEBYTESCOUNT(buffer), 
    6261                        GETIBPOINTER(buffer), 
    6362                        GETIBPOINTER(buffer)); 
    64         //FINEST("pInputBuffer:\n%s", STR(*pInputBuffer)); 
    6563 
    6664        _inputBuffer.ReadFromBuffer(GETIBPOINTER(buffer), 
    6765                        GETAVAILABLEBYTESCOUNT(buffer)); 
    68         //FINEST("Decoded:\n%s", STR(_inputBuffer)); 
    6966        buffer.IgnoreAll(); 
    7067 
     
    8178                return true; 
    8279 
    83         //    FINEST("Before encrypt data:\n%s", STR(*pOutputBuffer)); 
    84         //    InputBuffer tempBuffer; 
    85         //    tempBuffer.Put(_pKeyOut->data, 16); 
    86         //    FINEST("Before encrypt key: x: %d; y: %d\n%s", 
    87         //            _pKeyOut->x, 
    88         //            _pKeyOut->y, 
    89         //            STR(tempBuffer)); 
    9080        RC4(_pKeyOut, GETAVAILABLEBYTESCOUNT(*pOutputBuffer) - _skipBytes, 
    9181                        GETIBPOINTER(*pOutputBuffer) + _skipBytes, 
    9282                        GETIBPOINTER(*pOutputBuffer) + _skipBytes); 
    9383        _skipBytes = 0; 
    94         //    FINEST("After encrypt data:\n%s", STR(*pOutputBuffer)); 
    95         //    tempBuffer.Ignore(16); 
    96         //    tempBuffer.Put(_pKeyOut->data, 16); 
    97         //    FINEST("After encrypt key: x: %d; y: %d\n%s", 
    98         //            _pKeyOut->x, 
    99         //            _pKeyOut->y, 
    100         //            STR(tempBuffer)); 
    10184 
    10285        _outputBuffer.ReadFromInputBuffer(pOutputBuffer, 0, GETAVAILABLEBYTESCOUNT(*pOutputBuffer)); 
  • trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp

    r168 r410  
    150150bool RTMPProtocolSerializer::Serialize(Channel &channel, 
    151151                Variant &message, IOBuffer &buffer, uint32_t chunkSize) { 
    152         //FINEST("message:\n%s", STR(message.ToString())); 
    153152        bool result = false; 
    154153        _internalBuffer.Ignore(GETAVAILABLEBYTESCOUNT(_internalBuffer)); 
     
    252251bool RTMPProtocolSerializer::SerializeInvoke(IOBuffer &buffer, 
    253252                Variant &message) { 
    254         //FINEST("About to serialize invoke: %s", STR(message.ToString())); 
    255253 
    256254        string functionName = message[RM_INVOKE_FUNCTION]; 
     
    310308 
    311309bool RTMPProtocolSerializer::SerializeUsrCtrl(IOBuffer &buffer, Variant message) { 
    312         //    FINEST("message:\n%s", STR(message.ToString())); 
    313  
    314310        if (!_amf0.WriteInt16(buffer, message[RM_USRCTRL_TYPE], false)) { 
    315311                FATAL("Unable to write user control message type value"); 
     
    358354                return false; 
    359355        } 
    360         //FINEST("SerializeServerBW Buffer:\n%s", STR(buffer)); 
    361356        return true; 
    362357} 
     
    367362                return false; 
    368363        } 
    369         //FINEST("SerializeAbortMessage Buffer:\n%s", STR(buffer)); 
    370364        return true; 
    371365} 
     
    382376                return false; 
    383377        } 
    384         //FINEST("SerializeClientBW Buffer:\n%s", STR(buffer)); 
    385378        return true; 
    386379} 
     
    419412 
    420413                Variant primitive = message[RM_SHAREDOBJECT_PRIMITIVES][i]; 
    421                 //FINEST("Primitive:\n%s", STR(primitive.ToString())); 
    422414 
    423415                //type 
     
    502494        } 
    503495 
    504         //FINEST("Buffer:\n%s", STR(buffer)); 
    505496        return true; 
    506497} 
     
    540531 
    541532bool RTMPProtocolSerializer::DeserializeInvoke(IOBuffer &buffer, Variant &message) { 
    542         //FINEST("input:\n%s", STR(message.ToString())); 
    543533        if (message[RM_INVOKE_IS_FLEX]) { 
    544534                if (!buffer.Ignore(1)) { 
     
    571561                Variant &message) { 
    572562        message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 
    573         //FINEST("BR:\n%s", STR(message.ToString())); 
    574563        return buffer.Ignore(4); 
    575564} 
     
    608597                                return false; 
    609598                        } 
    610                         //FINEST("message:\n%s", STR(message.ToString())); 
    611599                        return true; 
    612600                } 
     
    618606                                return false; 
    619607                        } 
    620                         //FINEST("message:\n%s", STR(message.ToString())); 
    621608                        return true; 
    622609                } 
     
    652639                Variant &message) { 
    653640        message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 
    654         //FINEST("CS:\n%s", STR(message.ToString())); 
    655641        return buffer.Ignore(4); 
    656642} 
     
    751737                        case SOT_CS_CONNECT: 
    752738                        { 
    753                                 //FINEST("rawLength: %d", rawLength); 
    754739                                break; 
    755740                        } 
     
    773758                                        afterRead = GETAVAILABLEBYTESCOUNT(buffer); 
    774759                                        read += beforeRead - afterRead; 
    775                                         //                    FINEST("beforeRead: %d; afterRead: %d; read: %d; rawLength: %d", 
    776                                         //                            beforeRead, afterRead, read, rawLength); 
    777760 
    778761                                        beforeRead = GETAVAILABLEBYTESCOUNT(buffer); 
     
    783766                                        afterRead = GETAVAILABLEBYTESCOUNT(buffer); 
    784767                                        read += beforeRead - afterRead; 
    785                                         //                    FINEST("beforeRead: %d; afterRead: %d; read: %d; rawLength: %d", 
    786                                         //                            beforeRead, afterRead, read, rawLength); 
    787768                                        primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD][STR(key)] = value; 
    788769                                } 
     
    845826        } 
    846827 
    847         //FINEST("messaage:\n%s", STR(message.ToString())); 
    848         return true; 
    849         // 
    850         //    //name 
    851         //    if (!_amf0.ReadShortString(buffer, message[RM_SHAREDOBJECT_NAME], false)) { 
    852         //        FATAL("Unable to read %s", STR(RM_SHAREDOBJECT_NAME)); 
    853         //        return false; 
    854         //    } 
    855         // 
    856         //    //version 
    857         //    if (!_amf0.ReadUInt32(buffer, message[RM_SHAREDOBJECT_VERSION], false)) { 
    858         //        FATAL("Unable to read %s", STR(RM_SHAREDOBJECT_VERSION)); 
    859         //        return false; 
    860         //    } 
    861         // 
    862         //    //persistance 
    863         //    Variant persistence; 
    864         //    if (!_amf0.ReadUInt32(buffer, persistence, false)) { 
    865         //        FATAL("Unable to read %s", STR(RM_SHAREDOBJECT_PERSISTENCE)); 
    866         //        return false; 
    867         //    } 
    868         //    message[RM_SHAREDOBJECT_PERSISTENCE] = (uint32_t) persistence == 2; 
    869         // 
    870         //    //unknown bytes 
    871         //    if (!buffer.Ignore(4)) { 
    872         //        FATAL("Unable to ignore 4 bytes"); 
    873         //        return false; 
    874         //    } 
    875         // 
    876         // 
    877         //    //read primitives 
    878         //    uint32_t primitiveIndex = 0; 
    879         // 
    880         //    while (GETAVAILABLEBYTESCOUNT(buffer) > 0) { 
    881         //        Variant primitive; 
    882         // 
    883         //        //type 
    884         //        if (!_amf0.ReadUInt8(buffer, primitive[RM_SHAREDOBJECTPRIMITIVE_TYPE], false)) { 
    885         //            FATAL("Unable to read %s", STR(RM_SHAREDOBJECTPRIMITIVE_TYPE)); 
    886         //            return false; 
    887         //        } 
    888         // 
    889         //        //raw length 
    890         //        if (!_amf0.ReadUInt32(buffer, primitive[RM_SHAREDOBJECTPRIMITIVE_RAWLENGTH], false)) { 
    891         //            FATAL("Unable to read %s", STR(RM_SHAREDOBJECTPRIMITIVE_RAWLENGTH)); 
    892         //            return false; 
    893         //        } 
    894         //        uint32_t rawLength = primitive[RM_SHAREDOBJECTPRIMITIVE_RAWLENGTH]; 
    895         // 
    896         //        uint8_t primitiveType = primitive[RM_SHAREDOBJECTPRIMITIVE_TYPE]; 
    897         //        switch (primitiveType) { 
    898         //            case SOT_SERVER_CONNECT: 
    899         //            { 
    900         //                break; 
    901         //            } 
    902         //            case SOT_SERVER_SET_ATTRIBUTE: 
    903         //            { 
    904         //                uint32_t limit = GETAVAILABLEBYTESCOUNT(buffer) - rawLength; 
    905         //                while (limit < GETAVAILABLEBYTESCOUNT(buffer)) { 
    906         //                    Variant key; 
    907         //                    Variant value; 
    908         //                    if (!_amf0.ReadShortString(buffer, key, false)) { 
    909         //                        FATAL("Unable to read key"); 
    910         //                        return false; 
    911         //                    } 
    912         //                    if (!_amf0.Read(buffer, value)) { 
    913         //                        FATAL("Unable to read value"); 
    914         //                        return false; 
    915         //                    } 
    916         //                    primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD][STR(key)] = value; 
    917         //                } 
    918         //                break; 
    919         //            } 
    920         //            case SOT_SERVER_DELETE_ATTRIBUTE: 
    921         //            { 
    922         //                uint32_t limit = GETAVAILABLEBYTESCOUNT(buffer) - rawLength; 
    923         //                while (limit < GETAVAILABLEBYTESCOUNT(buffer)) { 
    924         //                    Variant key; 
    925         //                    if (!_amf0.ReadShortString(buffer, key, false)) { 
    926         //                        FATAL("Unable to read key"); 
    927         //                        return false; 
    928         //                    } 
    929         //                    primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD].PushToArray(key); 
    930         //                } 
    931         //                break; 
    932         //            } 
    933         //            default: 
    934         //            { 
    935         //                FATAL("Unknown SO primitive type: %d. Buffer:\n%s", 
    936         //                        primitiveType, STR(buffer)); 
    937         //                return false; 
    938         //            } 
    939         //        } 
    940         // 
    941         //        message[RM_SHAREDOBJECT_PRIMITIVES][(uint32_t) primitiveIndex] = primitive; 
    942         //        primitiveIndex++; 
    943         //    } 
    944         // 
    945         //    //FINEST("Message:\n%s",STR(message.ToString())); 
    946         // 
    947         //    return true; 
     828        return true; 
    948829} 
    949830 
     
    954835        chunksCount += (length % chunkSize) == 0 ? 0 : 1; 
    955836        uint32_t copySizeChunk = 0; 
    956  
    957         //DEBUG("length: %d, chunkSize: %d, chunksCount: %d, miniHeader: %02x", 
    958         //      length, chunkSize, chunksCount, miniHeader); 
    959837 
    960838        for (uint32_t i = 0; i < chunksCount - 1; i++) { 
  • trunk/sources/thelib/src/protocols/rtmp/sharedobjects/so.cpp

    r56 r410  
    3939        _payload.RemoveKey("_dummy_"); 
    4040        _versionIncremented = false; 
    41         //FINEST("SO created. _name: %s; _persistent: %d", STR(_name), _persistent); 
    4241} 
    4342 
     
    136135 
    137136void SO::Track() { 
    138         //FINEST("Track:\n%s", STR(DumpTrack())); 
    139137 
    140138        FOR_MAP(_dirtyPropsByProtocol, uint32_t, Dirtyness, i) { 
     
    175173                        M_SO_PRIMITIVE(message, i) = primitives[i]; 
    176174 
    177                 //FINEST("Message:\n%s", STR(message.ToString())); 
    178175 
    179176                if (pTo != NULL) { 
     
    183180                } 
    184181        } 
    185         //    if (_dirtyPropsByProtocol.size() > 0) { 
    186         //        FINEST("SO changed. Name: %s; Ver: %d; Persistent: %d, Payload:\n%s", 
    187         //                STR(_name), 
    188         //                _version, 
    189         //                _persistent, 
    190         //                STR(_payload.ToString())); 
    191         //    } 
    192182        _dirtyPropsByProtocol.clear(); 
    193183        _versionIncremented = false; 
     
    209199                _versionIncremented = true; 
    210200        } 
    211         //FINEST("Set %s key", STR(key)); 
    212201        _payload[key] = value; 
    213202 
  • trunk/sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp

    r2 r410  
    5555bool SOManager::Process(BaseRTMPProtocol *pFrom, Variant &request) { 
    5656        //TODO: This is a hack. We process both kinds of messages with ProcessSharedObject 
    57         //    if ((uint8_t) VH_MT(request) == RM_HEADER_MESSAGETYPE_FLEXSHAREDOBJECT) 
    58         //        return ProcessFlexSharedObject(pFrom, request); 
    59         //    else 
    60         //        return ProcessSharedObject(pFrom, request); 
    6157        return ProcessSharedObject(pFrom, request); 
    6258} 
     
    149145        } 
    150146        return true; 
    151         //    Variant primitive = M_SO_PRIMITIVE(request, primitiveId); 
    152         // 
    153         //    switch ((uint8_t) primitive[RM_SHAREDOBJECTPRIMITIVE_TYPE]) { 
    154         //        case SOT_SERVER_CONNECT: 
    155         //        { 
    156         //            pSO->RegisterProtocol(pFrom->GetId()); 
    157         //            ADD_VECTOR_END(_protocolSos[pFrom->GetId()], pSO); 
    158         //            return true; 
    159         //        } 
    160         //        case SOT_SERVER_SET_ATTRIBUTE: 
    161         //        { 
    162         //            if (pSO == NULL) 
    163         //                return false; 
    164         // 
    165         //            FOR_MAP(primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD], string, Variant, i) { 
    166         //                pSO->Set(MAP_KEY(i), MAP_VAL(i), pFrom->GetId()); 
    167         //            } 
    168         //            return true; 
    169         //        } 
    170         //        case SOT_SERVER_DELETE_ATTRIBUTE: 
    171         //        { 
    172         //            if (pSO == NULL) 
    173         //                return false; 
    174         //            for (uint32_t i = 0; i < primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD].MapSize(); i++) { 
    175         //                pSO->UnSet(primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD][i]); 
    176         //            } 
    177         //            return true; 
    178         //        } 
    179         //        default: 
    180         //        { 
    181         //            FATAL("Sahred object primitive type not yet implemented: %d", 
    182         //                    (uint8_t) primitive[RM_SHAREDOBJECTPRIMITIVE_TYPE]); 
    183         //            return false; 
    184         //        } 
    185         //    } 
    186147} 
    187148 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp

    r379 r410  
    110110 
    111111uint32_t BaseOutNetRTMPStream::GetCommandsChannelId() { 
    112         //      if (_pChannelAudio == NULL) 
    113         //              return 3; 
    114         //      return _pChannelAudio->id; 
    115112        return 3; 
    116113} 
     
    156153                uint32_t processedLength, uint32_t totalLength, 
    157154                double absoluteTimestamp, bool isAudio) { 
    158         //      FINEST("dataLength: % 5d; processedLength: % 5d; totalLength: % 5d; absoluteTimestamp: %.2f; isAudio: %d", 
    159         //                      dataLength, 
    160         //                      processedLength, 
    161         //                      totalLength, 
    162         //                      absoluteTimestamp, 
    163         //                      isAudio); 
    164155        if (_paused) 
    165156                return true; 
     
    194185                } else { 
    195186                        ALLOW_EXECUTION(processedLength, dataLength, isAudio); 
    196                         //        H_IA(_audioHeader) = true; 
    197                         //        H_TS(_audioHeader) = absoluteTime - _deltaTime; 
    198187                        H_IA(_audioHeader) = false; 
    199188                        if (processedLength == 0) 
     
    210199                        _videoPacketsCount++; 
    211200                _videoBytesCount += dataLength; 
    212                 //FINEST("absoluteTime: %f", absoluteTime); 
    213201                if (_isFirstVideoFrame) { 
    214202                        if (dataLength == 0) 
     
    236224 
    237225                        H_IA(_videoHeader) = true; 
    238                         //                      FINEST("absoluteTimestamp: %.2f; _pDeltaVideoTime: %.2f (a: %p; v: %p; c: %p); _seekTime: %.2f; r: %.2f", 
    239                         //                                      absoluteTimestamp, (*_pDeltaVideoTime), 
    240                         //                                      &_deltaAudioTime, &_deltaVideoTime, 
    241                         //                                      _pDeltaVideoTime, _seekTime, 
    242                         //                                      absoluteTimestamp - (*_pDeltaVideoTime) + _seekTime 
    243                         //                                      ); 
    244226                        H_TS(_videoHeader) = (uint32_t) (absoluteTimestamp - (*_pDeltaVideoTime) + _seekTime); 
    245227 
     
    254236                } else { 
    255237                        ALLOW_EXECUTION(processedLength, dataLength, isAudio); 
    256                         //        H_IA(_videoHeader) = true; 
    257                         //        H_TS(_videoHeader) = absoluteTime - _deltaTime; 
    258238                        H_IA(_videoHeader) = false; 
    259239                        if (processedLength == 0) 
     
    264244                H_ML(_videoHeader) = totalLength; 
    265245 
    266                 //FINEST("Start chunk and send"); 
    267246                return ChunkAndSend(pData, dataLength, _videoBucket, 
    268247                                _videoHeader, *_pChannelVideo); 
     
    288267 
    289268void BaseOutNetRTMPStream::SignalAttachedToInStream() { 
    290         //    FINEST("outbound stream %u attached to inbound stream %u", 
    291         //            GetUniqueId(), _pInStream->GetUniqueId()); 
    292269        //1. Store the attached stream type to know how we should proceed on detach 
    293270        _attachedStreamType = _pInStream->GetType(); 
     
    520497 
    521498bool BaseOutNetRTMPStream::SignalSeek(double &absoluteTimestamp) { 
    522         //FINEST("SignalSeek: %.02f", currentTimestamp); 
    523499 
    524500        //1. Stream eof 
     
    633609 
    634610bool BaseOutNetRTMPStream::SignalStop() { 
    635         //FINEST("SignalStop: %.02f", currentTimestamp); 
    636611        return true; 
    637612} 
    638613 
    639614void BaseOutNetRTMPStream::SignalStreamCompleted() { 
    640         //FINEST("SignalStreamCompleted"); 
    641615        //1. notify onPlayStatus code="NetStream.Play.Complete", bytes=xxx, duration=yyy, level status 
    642616        Variant message = StreamMessageFactory::GetNotifyOnPlayStatusPlayComplete( 
     
    676650bool BaseOutNetRTMPStream::ChunkAndSend(uint8_t *pData, uint32_t length, 
    677651                IOBuffer &bucket, Header &header, Channel &channel) { 
    678         //    if (H_ML(header) > _feederChunkSize) { 
    679         //        FATAL("_feederChunkSize: %d; totalLength: %d; _chunkSize: %d", 
    680         //                _feederChunkSize, H_ML(header), _chunkSize); 
    681         //    } else { 
    682         //        FINEST("_feederChunkSize: %d; totalLength: %d _chunkSize: %d", 
    683         //                _feederChunkSize, H_ML(header), _chunkSize); 
    684         //    } 
    685652        if (H_ML(header) == 0) { 
    686653                TRACK_HEADER(header, channel.lastOutProcBytes); 
     
    793760                        if (totalProcessed != 0) { 
    794761                                //we are in the middle of it. Don't allow execution 
    795                                 //FINEST("In the middle of a dropped frame"); 
    796762                                bytesCounter += dataLength; 
    797763                                return false; 
    798764                        } else { 
    799765                                //this is a new frame. We will detect later if it can be sent 
    800                                 //FINEST("Last dropped frame completed."); 
    801766                                _currentFrameDropped = false; 
    802767                        } 
     
    812777                                if (GETAVAILABLEBYTESCOUNT(*_pRTMPProtocol->GetOutputBuffer()) > _maxBufferSize) { 
    813778                                        //we have too many data left unsent. Drop the frame 
    814                                         //FINEST("Too many data left unsent: %d; max: %d", 
    815                                         //        GETAVAILABLEBYTESCOUNT(*_pRTMPProtocol->GetOutputBuffer()), 
    816                                         //        _maxBufferSize); 
    817779                                        packetsCounter++; 
    818780                                        bytesCounter += dataLength; 
     
    821783                                } else { 
    822784                                        //we can still pump data 
    823  
    824785                                        return true; 
    825786                                } 
    826787                        } else { 
    827788                                //no data in the output buffer. Allow to send it 
    828  
    829789                                return true; 
    830790                        } 
    831791                } else { 
    832792                        //we are in the middle of a non-dropped frame. Send it anyway 
    833  
    834793                        return true; 
    835794                } 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp4stream.cpp

    r250 r410  
    5353                if (mediaFrame.type == MEDIAFRAME_TYPE_AUDIO) { 
    5454                        // audio extra data 
    55                         //FINEST("--- AUDIO EXTRA DATA"); 
    5655                        buffer.ReadFromBuffer(_audioCodecHeaderInit, sizeof (_audioCodecHeaderInit)); 
    5756                } else { 
    5857                        // video extra data 
    59                         //FINEST("--- VIDEO EXTRA DATA"); 
    6058                        buffer.ReadFromBuffer(_videoCodecHeaderInit, sizeof (_videoCodecHeaderInit)); 
    6159                } 
     
    6664                        if (mediaFrame.isKeyFrame) { 
    6765                                // video key frame 
    68                                 //FINEST("--- VIDEO KEY FRAME"); 
    6966                                buffer.ReadFromBuffer(_videoCodecHeaderKeyFrame, sizeof (_videoCodecHeaderKeyFrame)); 
    7067                        } else { 
    7168                                //video normal frame 
    72                                 //FINEST("--- VIDEO NORMAL FRAME"); 
    7369                                buffer.ReadFromBuffer(_videoCodecHeader, sizeof (_videoCodecHeader)); 
    7470                        } 
     
    7773 
    7874                        buffer.ReadFromBuffer((uint8_t *) & mediaFrame.compositionOffset, 3); 
    79  
    80                         //            string str = format("%02x %02x %02x %02x %02x", 
    81                         //                    GETIBPOINTER(buffer)[0], 
    82                         //                    GETIBPOINTER(buffer)[1], 
    83                         //                    GETIBPOINTER(buffer)[2], 
    84                         //                    GETIBPOINTER(buffer)[3], 
    85                         //                    GETIBPOINTER(buffer)[4]); 
    86                         //            if (_currentFrame.isKeyFrame) 
    87                         //                WARN("%s", STR(str)); 
    88                         //            else 
    89                         //                FINEST("%s", STR(str)); 
    9075                } 
    9176        } 
  • trunk/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp

    r279 r410  
    138138bool BaseRTSPAppProtocolHandler::HandleRTSPRequest(RTSPProtocol *pFrom, 
    139139                Variant &requestHeaders, string &requestContent) { 
    140         //FINEST("RTSP Request:\n%s", STR(requestHeaders.ToString())); 
    141140        string method = requestHeaders[RTSP_FIRST_LINE][RTSP_METHOD]; 
    142141        string requestSessionId = ""; 
     
    427426bool BaseRTSPAppProtocolHandler::HandleRTSPRequestSetupInbound(RTSPProtocol *pFrom, 
    428427                Variant &requestHeaders, string &requestContent) { 
    429         //      FINEST("--------------------------------------"); 
    430         //      FINEST("requestHeaders:\n%s", STR(requestHeaders.ToString())); 
    431         //      FINEST("pendingTracks:\n%s", STR(pFrom->GetCustomParameters().ToString())); 
    432         //      FINEST("requestContent:\n%s", STR(requestContent)); 
    433  
    434428        //1. get the transport line and split it into parts 
    435429        if (!requestHeaders[RTSP_HEADERS].HasKey(RTSP_HEADERS_TRANSPORT, false)) { 
     
    439433        string transportLine = lowercase(requestHeaders[RTSP_HEADERS].GetValue(RTSP_HEADERS_TRANSPORT, false)); 
    440434        map<string, string> parameters = mapping(transportLine, ";", "=", true); 
    441  
    442         //      FOR_MAP(parameters, string, string, i) { 
    443         //              FINEST("%s: %s", STR(MAP_KEY(i)), STR(MAP_VAL(i))); 
    444         //      } 
    445435 
    446436        //2. Check and see if it has RTP/AVP/TCP,RTP/AVP/UDP or RTP/AVP 
     
    492482                return false; 
    493483        } 
    494         //      FINEST("portsOrChannels: %d-%d; forceTcp: %d", 
    495         //                      portsOrChannels[0], portsOrChannels[1], forceTcp); 
    496484 
    497485        //4. Find the track inside the pendingTracks ccollection and setup the ports or channels 
     
    501489        } 
    502490        string controlUri = requestHeaders[RTSP_FIRST_LINE][RTSP_URL]; 
    503         //FINEST("controlUri: %s", STR(controlUri)); 
    504491 
    505492        bool trackFound = false; 
     
    517504                return false; 
    518505        } 
    519         //FINEST("pendingTracks:\n%s", STR(pFrom->GetCustomParameters()["pendingTracks"].ToString())); 
    520506 
    521507        //5. Create a session 
    522508        if (!pFrom->GetCustomParameters().HasKey(RTSP_HEADERS_SESSION)) { 
    523509                pFrom->GetCustomParameters()[RTSP_HEADERS_SESSION] = generateRandomString(8); 
    524                 //FINEST("Session: %s", STR(pFrom->GetCustomParameters()[RTSP_HEADERS_SESSION])); 
    525510        } 
    526511 
     
    530515 
    531516        //7. Send it 
    532         //FINEST("--------------------------------------"); 
    533517        return pFrom->SendResponseMessage(); 
    534518} 
     
    589573                                pOutboundConnectivity->GetLastVideoSequence(), 
    590574                                0); 
    591                 //pOutboundConnectivity->GetLastVideoRTPTimestamp()); 
    592575        } 
    593576        if (pFrom->GetCustomParameters().HasKey("audioTrackId")) { 
     
    596579                                pOutboundConnectivity->GetLastAudioSequence(), 
    597580                                0); 
    598                 //pOutboundConnectivity->GetLastAudioRTPTimestamp()); 
    599581        } 
    600582        string rtpInfo = rtpInfoVideo; 
     
    606588                rtpInfo = rtpInfoAudio; 
    607589        } 
    608         //pFrom->PushResponseHeader(RTSP_HEADERS_RTP_INFO, rtpInfo); 
    609590 
    610591        //7. Done 
     
    620601bool BaseRTSPAppProtocolHandler::HandleRTSPRequestAnnounce(RTSPProtocol *pFrom, 
    621602                Variant &requestHeaders, string &requestContent) { 
    622         //      FINEST("requestHeaders:\n%s", STR(requestHeaders.ToString())); 
    623         //      FINEST("requestContent:\n%s", STR(requestContent)); 
    624603        //1. Make sure we ONLY handle application/sdp 
    625604        if (!requestHeaders[RTSP_HEADERS].HasKey(RTSP_HEADERS_CONTENT_TYPE, false)) { 
     
    647626        Variant audioTrack = sdp.GetAudioTrack(0, 
    648627                        requestHeaders[RTSP_FIRST_LINE][RTSP_URL]); 
    649         //      FINEST("videoTrack:\n%s", STR(videoTrack.ToString())); 
    650         //      FINEST("audioTrack:\n%s", STR(audioTrack.ToString())); 
    651628 
    652629        //5. Store the tracks inside the session for later use 
     
    721698                Variant &requestHeaders, string &requestContent, Variant &responseHeaders, 
    722699                string &responseContent) { 
    723         //WARN("\n%s\n%s", STR(responseHeaders.ToString()), STR(responseContent)); 
    724700        switch ((uint32_t) responseHeaders[RTSP_FIRST_LINE][RTSP_STATUS_CODE]) { 
    725701                case 200: 
     
    852828        Variant audioTrack = sdp.GetAudioTrack(0, 
    853829                        requestHeaders[RTSP_FIRST_LINE][RTSP_URL]); 
    854         //      FINEST("videoTrack:\n%s", STR(videoTrack.ToString())); 
    855         //      FINEST("audioTrack:\n%s", STR(audioTrack.ToString())); 
    856830 
    857831        //5. Store the tracks inside the session for later use 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp

    r379 r410  
    9999                string streamName, bool forceTcp) { 
    100100        _forceTcp = forceTcp; 
    101         //      FINEST("videoTrack:\n%s", STR(videoTrack.ToString())); 
    102         //      FINEST("audioTrack:\n%s", STR(audioTrack.ToString())); 
    103101 
    104102        //1. get the application 
     
    175173                        if ((_pProtocols[i] != NULL) && (_pProtocols[i]->GetId() == pProtocol->GetId())) { 
    176174                                string result = format("RTP/AVP/TCP;unicast;interleaved=%d-%d", i, i + 1); 
    177                                 //FINEST("%s: %s", isAudio ? "audio" : "video", STR(result)); 
    178175                                return result; 
    179176                        } 
     
    270267        EHTONLP(pBuffer + 28, pRTCP->GetLastSenderReport()); //last SR (LSR) 
    271268 
    272         //WARN("Send RR: %d", isAudio); 
    273269        if (_forceTcp) { 
    274270                return _pRTSP->SendRaw(pBuffer, 60); 
     
    329325        } 
    330326 
    331         //      //4. get the ports if available 
    332         //      uint16_t videoRTPPort = 0; 
    333         //      uint16_t videoRTCPPort = 0; 
    334         //      if (videoTrack.HasKey("portsOrChannels")) { 
    335         //              videoRTPPort = (uint16_t) videoTrack["portsOrChannels"][(uint32_t) 0]; 
    336         //              videoRTCPPort = (uint16_t) videoTrack["portsOrChannels"][(uint32_t) 1]; 
    337         //      } 
    338         // 
    339         //      uint16_t audioRTPPort = 0; 
    340         //      uint16_t audioRTCPPort = 0; 
    341         //      if (audioTrack.HasKey("portsOrChannels")) { 
    342         //              audioRTPPort = (uint16_t) audioTrack["portsOrChannels"][(uint32_t) 0]; 
    343         //              audioRTCPPort = (uint16_t) audioTrack["portsOrChannels"][(uint32_t) 1]; 
    344         //      } 
    345  
    346327        //4. Create the carriers 
    347328        if (!CreateCarriers(_pRTPVideo, _pRTCPVideo)) { 
     
    374355                EHTONLP(_videoRR + 40, _pRTCPVideo->GetSSRC()); //SSRC of packet sender 
    375356                _videoRR[1] = idx + 1; 
    376                 //FINEST("video: %d-%d; RTCP SSRC: %08x", idx, idx + 1, _pRTCPVideo->GetSSRC()); 
    377357        } 
    378358 
     
    384364                EHTONLP(_audioRR + 40, _pRTCPAudio->GetSSRC()); //SSRC of packet sender 
    385365                _audioRR[1] = idx + 1; 
    386                 //FINEST("audio: %d-%d; RTCP SSRC: %08x", idx, idx + 1, _pRTCPAudio->GetSSRC()); 
    387366        } 
    388367 
     
    457436                pCarrier1->SetProtocol(pRTP->GetFarEndpoint()); 
    458437                pRTP->GetFarEndpoint()->SetIOHandler(pCarrier1); 
    459                 //WARN("pRTP: %s", STR(*pRTP)); 
    460438 
    461439                pCarrier2->SetProtocol(pRTCP->GetFarEndpoint()); 
    462440                pRTCP->GetFarEndpoint()->SetIOHandler(pCarrier2); 
    463                 //WARN("pRTCP: %s", STR(*pRTCP)); 
    464  
    465                 //WARN("RTP/RTCP pair: %d-%d", pCarrier1->GetNearEndpointPort(), pCarrier2->GetNearEndpointPort()); 
     441 
    466442 
    467443                return true; 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp

    r279 r410  
    347347        _videoPacketsCount++; 
    348348        COMPUTE_BYTES_COUNT(message, _videoBytesCount); 
    349         //uint16_t seq = ENTOHSP(((uint8_t *) message.msg_iov[0].iov_base) + 2); 
    350         //FINEST("seq: %d", seq); 
    351349        if (((_videoPacketsCount % 300) == 0) || _videoPacketsCount <= 2) { 
    352350                uint8_t buff[28]; 
     
    368366 
    369367bool OutboundConnectivity::FeedVideoDataTCP(msghdr &message) { 
    370         //NYIR; 
    371368        return true; 
    372369} 
     
    376373        _audioPacketsCount++; 
    377374        COMPUTE_BYTES_COUNT(message, _audioBytesCount); 
    378         //uint16_t seq = ENTOHSP(((uint8_t *) message.msg_iov[0].iov_base) + 2); 
    379         //FINEST("seq: %d", seq); 
    380375        if (((_audioPacketsCount % 300) == 0) || (_audioPacketsCount <= 2)) { 
    381376                uint8_t buff[28]; 
     
    397392 
    398393bool OutboundConnectivity::FeedAudioDataTCP(msghdr &message) { 
    399         //NYIR; 
    400394        return true; 
    401395} 
  • trunk/sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp

    r379 r410  
    8989                        _lastSeq = GET_RTP_SEQ(_rtpHeader); 
    9090                } else { 
    91                         //                      WARN("Bogus seq. current seq: %04x; last seq: %04x", 
    92                         //                                      GET_RTP_SEQ(_rtpHeader), _lastSeq); 
    9391                        buffer.IgnoreAll(); 
    9492                        return true; 
     
    111109#ifdef RTP_DETECT_ROLLOVER 
    112110        if (_rtpHeader._timestamp < _lastTimestamp) { 
    113                 //              FINEST("Possible roll over: _rtpHeader._timestamp: %016llx; _lastTimestamp: %016llx", 
    114                 //                              _rtpHeader._timestamp, _lastTimestamp); 
    115111                if ((((_rtpHeader._timestamp & 0x80000000) >> 31) == 0) 
    116112                                && (((_lastTimestamp & 0x80000000) >> 31) == 1)) { 
     
    119115                        WARN("Roll over on %d; _timestampRollover: %d", GetId(), _timestampRollover); 
    120116                } 
    121                 //              else { 
    122                 //                      WARN("Bogus timestamp. current ts: %016llx; last ts: %016llx", 
    123                 //                                      _rtpHeader._timestamp, _lastTimestamp); 
    124                 //                      buffer.IgnoreAll(); 
    125                 //                      return true; 
    126                 //              } 
    127117        } else { 
    128118                _lastTimestamp = _rtpHeader._timestamp; 
    129119        } 
    130         //      string msg = ""; 
    131         //      if ((_lastSeq % 1000) == 0) { 
    132         //              msg = format("%d: %016llx", GetId(), _rtpHeader._timestamp); 
    133         //      } 
    134120        _rtpHeader._timestamp = (_timestampRollover << 32) | _rtpHeader._timestamp; 
    135         //      if ((_lastSeq % 1000) == 0) { 
    136         //              msg += format("(%016llx)", _rtpHeader._timestamp); 
    137         //              FINEST(STR(msg)); 
    138         //      } 
    139121#endif 
    140122 
     
    142124        if (_pInStream != NULL) { 
    143125                if (_isAudio) { 
    144                         //FINEST("AUDIO: %08x", _rtpHeader._ssrc); 
    145126                        if (!_pInStream->FeedAudioData(pBuffer, length, _rtpHeader)) { 
    146127                                FATAL("Unable to stream data"); 
     
    152133                        } 
    153134                } else { 
    154                         //FINEST("VIDEO: %08x", _rtpHeader._ssrc); 
    155135                        if (!_pInStream->FeedVideoData(pBuffer, length, _rtpHeader)) { 
    156136                                FATAL("Unable to stream data"); 
     
    188168 
    189169uint32_t InboundRTPProtocol::GetSSRC() { 
    190         //FINEST("_rtpHeader._ssrc: %08x", _rtpHeader._ssrc); 
    191170        return _rtpHeader._ssrc; 
    192171} 
    193172 
    194173uint32_t InboundRTPProtocol::GetExtendedSeq() { 
    195         //      FINEST("_seqRollOver: %04x", _seqRollOver); 
    196         //      FINEST("_lastSeq: %04x", _lastSeq); 
    197174        return (((uint32_t) _seqRollOver) << 16) | _lastSeq; 
    198175} 
  • trunk/sources/thelib/src/protocols/rtp/rtcpprotocol.cpp

    r380 r410  
    3838        _ssrc ^= GetId(); 
    3939        _validLastAddress = false; 
    40         //      _lastNtpMicroseconds = 0; 
    41         //      _lastRtpTimestamp = 0; 
    4240} 
    4341 
     
    6462 
    6563bool RTCPProtocol::SignalInputData(IOBuffer &buffer, sockaddr_in *pPeerAddress) { 
    66         //WARN("Got SR: %d",_isAudio); 
    6764        //0. Save the last known address 
    6865        if (&_lastAddress != pPeerAddress) { 
     
    7774                return true; 
    7875 
    79         //uint8_t V = pBuffer[0] >> 6; 
    80         //bool P = ((pBuffer[0] >> 5)&0x01) == 1; 
    81         //uint8_t RC = pBuffer[0]&0x1f; 
    8276        uint8_t PT = pBuffer[1]; 
    8377        uint16_t len = ENTOHSP(pBuffer + 2); 
     
    8882                return true; 
    8983        } 
    90         //uint32_t ssrc = ENTOHLP(pBuffer + 4); 
    91         //      FINEST("V: %u; P: %u; RC: %u; PT: %u; len: %u; ssrc: %u; bufferLength: %u", 
    92         //                      V, P, RC, PT, len, ssrc, bufferLength); 
    9384 
    9485        switch (PT) { 
     
    10697                        uint32_t rtpTimestamp = ENTOHLP(pBuffer + 16); 
    10798                        _pConnectivity->ReportSR(ntpMicroseconds, rtpTimestamp, _isAudio); 
    108                         //                      uint32_t senderPacketCount = ENTOHLP(pBuffer + 20); 
    109                         //                      uint32_t senderOctetCount = ENTOHLP(pBuffer + 24); 
    110                         //                      string msg = ""; 
    111                         //                      msg += format("              ntp: %u.%d\n", ntpSec, 
    112                         //                                      (uint32_t) (((double) ntpFrac / (double) (0x100000000LL))*1000000.0)); 
    113                         //                      msg += format("  ntpMicroseconds: %llu\n", ntpMicroseconds); 
    114                         //                      msg += format("     rtpTimestamp: %u\n", rtpTimestamp); 
    115                         //                      msg += format("senderPacketCount: %u\n", senderPacketCount); 
    116                         //                      msg += format(" senderOctetCount: %u\n", senderOctetCount); 
    117                         //                      if (_lastNtpMicroseconds != 0) { 
    118                         //                              uint64_t ntpDiff = ntpMicroseconds - _lastNtpMicroseconds; 
    119                         //                              uint64_t rtpDiff = rtpTimestamp - _lastRtpTimestamp; 
    120                         //                              double r = (double) rtpDiff / (double) ntpDiff * 1000000.0; 
    121                         //                              msg += format("          ntpDiff: %llu (%.2f)\n", ntpDiff, (double) ntpDiff / 1000000.0); 
    122                         //                              msg += format("          rtpDiff: %llu\n", rtpDiff); 
    123                         //                              msg += format("                r: %.4f\n", r); 
    124                         //                      } 
    125                         //                      _lastNtpMicroseconds = ntpMicroseconds; 
    126                         //                      _lastRtpTimestamp = rtpTimestamp; 
    127                         //                      if (_isAudio) { 
    128                         //                              FINEST("\n%s", STR(msg)); 
    129                         //                      } else { 
    130                         //                              WARN("\n%s", STR(msg)); 
    131                         //                      } 
    13299                        break; 
    133                         //uint64_t ntp = ENTOHLLP(pBuffer + 8); 
    134100                } 
    135101                default: 
     
    140106                } 
    141107        } 
    142         // 
    143         //      /* 
    144         //                      0                   1                   2                   3 
    145         //                      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
    146         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    147         //      header |V=2|P|    RC   |   PT=SR=200   |             length            | 
    148         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    149         //                 |                         SSRC of sender                        | 
    150         //                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    151         //      sender |              NTP timestamp, most significant word             | 
    152         //      info   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    153         //                 |             NTP timestamp, least significant word             | 
    154         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    155         //                 |                         RTP timestamp                         | 
    156         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    157         //                 |                     sender's packet count                     | 
    158         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    159         //                 |                      sender's octet count                     | 
    160         //                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    161         //      report |                 SSRC_1 (SSRC of first source)                 | 
    162         //      block  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    163         //        1    | fraction lost |       cumulative number of packets lost       | 
    164         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    165         //                 |           extended highest sequence number received           | 
    166         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    167         //                 |                      interarrival jitter                      | 
    168         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    169         //                 |                         last SR (LSR)                         | 
    170         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    171         //                 |                   delay since last SR (DLSR)                  | 
    172         //                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    173         //      report |                 SSRC_2 (SSRC of second source)                | 
    174         //      block  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    175         //        2    :                               ...                             : 
    176         //                 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 
    177         //                 |                  profile-specific extensions                  | 
    178         //                 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    179         //       */ 
    180         // 
     108 
    181109        if (pBuffer[1] != 200) 
    182110                return true; 
    183111 
    184112        _lsr = ENTOHLP(pBuffer + 10); 
    185         //FINEST("_lsr: %08x\n%s", _lsr, STR(buffer)); 
    186113        buffer.IgnoreAll(); 
    187114 
  • trunk/sources/thelib/src/protocols/rtp/rtspprotocol.cpp

    r407 r410  
    125125                                } 
    126126                                if (_state != RTSP_STATE_PAYLOAD) { 
    127                                         //FINEST("Not enough data to parse the headers"); 
    128127                                        return true; 
    129128                                } 
     
    354353        _outputBuffer.ReadFromString(content); 
    355354 
    356  
    357         //      string aaa = string((char *) GETIBPOINTER(_outputBuffer), GETAVAILABLEBYTESCOUNT(_outputBuffer)); 
    358         //      FINEST("\n`%s`", STR(aaa)); 
    359  
    360355        //5. Enqueue for outbound 
    361356        return EnqueueForOutbound(); 
     
    377372bool RTSPProtocol::ParseInterleavedHeaders(IOBuffer &buffer) { 
    378373        //1. Marl this as a interleaved content 
    379         //FINEST("buffer:\n%s", STR(buffer)); 
    380374        _rtpData = true; 
    381375 
     
    383377        uint32_t bufferLength = GETAVAILABLEBYTESCOUNT(buffer); 
    384378        if (bufferLength < 4) { 
    385                 //WARN("Not enough data"); 
    386379                return true; 
    387380        } 
     
    402395        //6. Do we have enough data? 
    403396        if (_rtpDataLength + 4 > bufferLength) { 
    404                 //WARN("Not enough data. _rtpDataLength: %d; bufferLength: %d", _rtpDataLength, bufferLength); 
    405397                return true; 
    406398        } 
     
    418410        _inboundHeaders.Reset(); 
    419411        _inboundContent = ""; 
    420         //FINEST("buffer:\n%s", STR(buffer)); 
    421412        //1. We have to have at least 4 bytes (double \r\n) 
    422413        if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { 
     
    470461        //5. Consider the rest of the lines as key: value pairs and store them 
    471462        //0. Reset the headers 
    472         //      for (uint32_t i = 1; i < lines.size(); i++) { 
    473         //              FINEST("line %d: `%s`", i, STR(lines[i])); 
    474         //      } 
    475463        _inboundHeaders[RTSP_HEADERS].IsArray(false); 
    476464        for (uint32_t i = 1; i < lines.size(); i++) { 
     
    537525                _inboundHeaders["isRequest"] = false; 
    538526 
    539                 //FINEST("_inboundHeaders:\n%s", STR(_inboundHeaders.ToString())); 
    540527 
    541528                return true; 
  • trunk/sources/thelib/src/protocols/rtp/sdp.cpp

    r394 r410  
    3030 
    3131bool SDP::ParseSDP(SDP &sdp, string &raw) { 
    32         //FINEST("raw:\n%s\n", STR(raw)); 
    3332        //1. Reset 
    3433        sdp.Reset(); 
     
    4241        vector<string> lines; 
    4342        split(raw, "\n", lines); 
    44  
    45         //      FOR_VECTOR(lines, i) { 
    46         //              FINEST("lines[%02d]: %s", i, STR(lines[i])); 
    47         //      } 
    4843 
    4944        //4. Detect the media tracks indexes 
     
    5449                } 
    5550        } 
    56         //      for (uint32_t i = 0; i < trackIndexes.size(); i++) { 
    57         //              FINEST("trackIndexes[%02d]: %02d", i, trackIndexes[i]); 
    58         //      } 
    5951        if (trackIndexes.size() == 0) { 
    6052                FATAL("No tracks found"); 
     
    9183        sdp[SDP_MEDIATRACKS].PushToArray(media); 
    9284 
    93         //FINEST("sdp:\n%s", STR(sdp.ToString())); 
    9485 
    9586        return true; 
     
    10394                return Variant(); 
    10495        } 
    105         //FINEST("track:\n%s", STR(track.ToString())); 
    10696 
    10797        //2. Prepare the info 
     
    138128                return Variant(); 
    139129        } 
    140         //FINEST("track:\n%s", STR(track.ToString())); 
    141130 
    142131        //2. Prepare the info 
     
    361350                value["payloadType"] = (uint8_t) atoi(STR(parts[0])); 
    362351                map<string, string> temp = mapping(parts[1], ";", "=", false); 
    363                 //              FINEST("-----------"); 
    364                 //              FINEST("%s", STR(parts[1])); 
    365352 
    366353                FOR_MAP(temp, string, string, i) { 
    367                         //FINEST("%s: %s", STR(MAP_KEY(i)), STR(MAP_VAL(i))); 
    368354                        value[MAP_KEY(i)] = MAP_VAL(i); 
    369355                } 
    370                 //              FINEST("-----------"); 
     356 
    371357                return true; 
    372358        } else { 
     
    383369        vector<string> parts; 
    384370        split(line, ":", parts); 
    385         //      for (uint32_t i = 0; i < parts.size(); i++) { 
    386         //              FINEST("parts[%d]: %s", i, STR(parts[i])); 
    387         //      } 
    388371        if (parts.size() != 2) 
    389372                return false; 
     
    392375        result["value"] = parts[1]; 
    393376 
    394         //FINEST("result: %s", STR(result.ToString())); 
    395377        return true; 
    396378} 
     
    402384        vector<string> parts; 
    403385        split(line, " ", parts); 
    404         //      for (uint32_t i = 0; i < parts.size(); i++) { 
    405         //              FINEST("parts[%d]: %s", i, STR(parts[i])); 
    406         //      } 
    407386        if (parts.size() != 3) 
    408387                return false; 
     
    412391        result["connectionAddress"] = parts[2]; 
    413392 
    414         //FINEST("result: %s", STR(result.ToString())); 
    415393        return true; 
    416394} 
     
    439417        vector<string> parts; 
    440418        split(line, " ", parts); 
    441         //      for (uint32_t i = 0; i < parts.size(); i++) { 
    442         //              FINEST("parts[%d]: %s", i, STR(parts[i])); 
    443         //      } 
    444419        if (parts.size() != 4) 
    445420                return false; 
     
    449424        result["transport"] = parts[2]; 
    450425        result["payloadType"] = parts[3]; 
    451  
    452         //      FINEST("result: %s", STR(result.ToString())); 
    453426        return true; 
    454427} 
     
    460433        vector<string> parts; 
    461434        split(line, " ", parts); 
    462         //      for (uint32_t i = 0; i < parts.size(); i++) { 
    463         //              FINEST("parts[%d]: %s", i, STR(parts[i])); 
    464         //      } 
    465435        if (parts.size() != 6) 
    466436                return false; 
     
    490460        result["ip_address"] = ip; 
    491461 
    492         //FINEST("result: %s", STR(result.ToString())); 
    493462        return true; 
    494463} 
     
    517486        vector<string> parts; 
    518487        split(line, " ", parts); 
    519         //      for (uint32_t i = 0; i < parts.size(); i++) { 
    520         //              FINEST("parts[%d]: %s", i, STR(parts[i])); 
    521         //      } 
    522488        if (parts.size() != 2) 
    523489                return false; 
     
    526492        result["stopTime"] = parts[1]; 
    527493 
    528         //FINEST("result: %s", STR(result.ToString())); 
    529494        return true; 
    530495} 
  • trunk/sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp

    r399 r410  
    110110 
    111111void InNetRTPStream::SignalOutStreamDetached(BaseOutStream *pOutStream) { 
    112         //NYIA; 
    113112} 
    114113 
     
    147146                double &rtp = isAudio ? _audioRTP : _videoRTP; 
    148147                absoluteTimestamp = ntp + absoluteTimestamp - rtp; 
    149                 //FINEST("%c %.2f", isAudio ? 'A' : 'V', absoluteTimestamp); 
    150148        } 
    151149 
     
    229227        if (naluType <= 23) { 
    230228                //3. Standard NALU 
    231                 //FINEST("Standard NALU"); 
    232229                return FeedData(pData, dataLength, 0, dataLength, ts, false); 
    233230        } else if (naluType == NALU_TYPE_FUA) { 
    234231                if (GETAVAILABLEBYTESCOUNT(_currentNalu) == 0) { 
    235                         //                      FINEST("--------------"); 
    236                         //                      FINEST("First NALU_TYPE_FUA"); 
    237232                        _currentNalu.IgnoreAll(); 
    238233                        //start NAL 
     
    245240                        pData[1] = (pData[0]&0xe0) | (pData[1]&0x1f); 
    246241                        _currentNalu.ReadFromBuffer(pData + 1, dataLength - 1); 
    247                         //                      FINEST("NALU_TYPE_FUA: %s; s: %d", 
    248                         //                                      STR(NALUToString(pData[1])), 
    249                         //                                      GETAVAILABLEBYTESCOUNT(_currentNalu)); 
    250242                        return true; 
    251243                } else { 
    252244                        //middle NAL 
    253245                        _currentNalu.ReadFromBuffer(pData + 2, dataLength - 2); 
    254                         //                      FINEST("MIDDLE NALU_TYPE_FUA: end: %d; s: %d", 
    255                         //                                      ((pData[1] >> 6)&0x01), 
    256                         //                                      GETAVAILABLEBYTESCOUNT(_currentNalu)); 
    257246                        if (((pData[1] >> 6)&0x01) == 1) { 
    258                                 //                              FINEST("NALU_TYPE_FUA feed; s: %d", 
    259                                 //                                              GETAVAILABLEBYTESCOUNT(_currentNalu)); 
    260                                 //                              FINEST("--------------"); 
    261247                                _videoPacketsCount++; 
    262248                                _videoBytesCount += GETAVAILABLEBYTESCOUNT(_currentNalu); 
     
    275261        } else if (naluType == NALU_TYPE_STAPA) { 
    276262                uint32_t index = 1; 
    277                 //FINEST("ts: %.2f; delta: %.2f", ts, ts - _lastTs); 
    278263                while (index + 3 < dataLength) { 
    279264                        uint16_t length = ENTOHSP(pData + index); 
     
    338323        //3. Feed the buffer chunk by chunk 
    339324        uint32_t cursor = 2 + 2 * chunksCount; 
    340         //      string msg = ""; 
    341         //      for (uint32_t i = 0; i < cursor; i++) { 
    342         //              msg += format("%02x ", pData[i]); 
    343         //      } 
    344         //      FINEST("%s", STR(msg)); 
    345325        uint16_t chunkSize = 0; 
    346326        double ts = 0; 
     
    351331                        chunkSize = (uint16_t) (dataLength - cursor); 
    352332                } 
    353                 //              FINEST("chunkSize: %d; dataLength: %d; diff: %d", chunkSize, dataLength, 
    354                 //                              dataLength - chunkSize); 
    355                 //FINEST("rtpHeader._timestamp: %llu", rtpHeader._timestamp); 
    356333                ts = (double) (rtpHeader._timestamp + i * 1024) / (double) _capabilities.aac._sampleRate * 1000.00; 
    357334                if ((cursor + chunkSize) > dataLength) { 
     
    392369                _audioNTP = (double) ntpMicroseconds / 1000.0; 
    393370                _audioRTP = (double) rtpTimestamp / (double) _capabilities.aac._sampleRate * 1000.0; 
    394                 //WARN("Audio resync"); 
    395371        } else { 
    396372                _videoNTP = (double) ntpMicroseconds / 1000.0; 
    397373                _videoRTP = (double) rtpTimestamp / (double) _capabilities.avc._rate * 1000.0; 
    398                 //WARN("Video resync"); 
    399374        } 
    400375} 
  • trunk/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp

    r279 r410  
    109109                                        return false; 
    110110                                } 
    111                                 //tsIncrement++; 
    112111                                pData += chunkSize; 
    113112                                dataLength -= chunkSize; 
     
    152151                double absoluteTimestamp) { 
    153152        if ( 
    154                         //                              (NALU_TYPE(pData[0]) != NALU_TYPE_SPS) 
    155                         //                              && (NALU_TYPE(pData[0]) != NALU_TYPE_PPS) 
    156153                        (NALU_TYPE(pData[0]) != NALU_TYPE_SLICE) 
    157154                        && (NALU_TYPE(pData[0]) != NALU_TYPE_IDR)) { 
    158                 //FINEST("ignoring absoluteTimestamp: %.2f; %s", absoluteTimestamp, STR(NALUToString(pData[0]))); 
    159155                return true; 
    160156        } 
    161  
    162         //      if (processedLength == 0 && NALU_TYPE(pData[0]) == NALU_TYPE_IDR) { 
    163         //              EHTONSP(_pSPS + 2, _videoCounter); 
    164         //              _videoCounter++; 
    165         //              EHTONLP(_pSPS + 4, (uint32_t) (absoluteTimestamp * 90.0)); 
    166         //              EHTONSP(_pPPS + 2, _videoCounter); 
    167         //              _videoCounter++; 
    168         //              EHTONLP(_pPPS + 4, (uint32_t) (absoluteTimestamp * 90.0)); 
    169         // 
    170         //              _pConnectivity->FeedVideoData(_pSPS, _SPSLen); 
    171         //              _pConnectivity->FeedVideoData(_pPPS, _PPSLen); 
    172         //      } 
    173157 
    174158        uint32_t sentAmount = 0; 
     
    240224 
    241225        //2. Test if we need to send what we have so far 
    242         //      FINEST("_audioData.msg_iov[0].iov_len: %d", _audioData.msg_iov[0].iov_len); 
    243         //      FINEST("_audioData.msg_iov[1].iov_len: %d", _audioData.msg_iov[1].iov_len); 
    244         //      FINEST("GETAVAILABLEBYTESCOUNT(_audioBuffer): %d", GETAVAILABLEBYTESCOUNT(_audioBuffer)); 
    245         //      FINEST("dataLength: %d", dataLength); 
    246         //      FINEST("all: %d", 14 + _audioData.msg_iov[1].iov_len + GETAVAILABLEBYTESCOUNT(_audioBuffer) + 2 + dataLength - 7); 
    247226        if (((14 + _audioData.msg_iov[1].iov_len + GETAVAILABLEBYTESCOUNT(_audioBuffer) + 2 + dataLength - 7) > MAX_RTP_PACKET_SIZE) 
    248227                        || (_audioData.msg_iov[1].iov_len == 16)) { 
    249                 //              string message = ""; 
    250                 //              for (uint32_t i = 0; i < _audioData.msg_iov[1].iov_len; i++) { 
    251                 //                      message += format("%02x ", ((uint8_t *) _audioData.msg_iov[1].iov_base)[i]); 
    252                 //              } 
    253                 //              message += "\n"; 
    254                 //              for (uint32_t i = 0; i < _audioData.msg_iov[1].iov_len; i += 2) { 
    255                 //                      uint16_t val = ENTOHS((*((uint16_t *) _audioData.msg_iov[1].iov_base + i / 2))); 
    256                 //                      message += format("i: %d; val: %04x; len: %d; index: %d\n", i, 
    257                 //                                      val, 
    258                 //                                      (val >> 3), 
    259                 //                                      (val & 0x07)); 
    260                 //              } 
    261                 //              WARN("Flush here\n%s", STR(message)); 
    262  
    263228                //3. counter 
    264229                EHTONSP(((uint8_t *) _audioData.msg_iov[0].iov_base) + 2, _audioCounter); 
     
    286251        uint16_t auHeader = (uint16_t) ((dataLength - 7) << 3); 
    287252        auHeader = auHeader | ((uint8_t) (_audioData.msg_iov[1].iov_len / 2)); 
    288         //FINEST("auHeader: %04x", auHeader); 
    289253        EHTONSP(((uint8_t *) _audioData.msg_iov[1].iov_base) + _audioData.msg_iov[1].iov_len, auHeader); 
    290254        _audioData.msg_iov[1].iov_len += 2; 
     
    358322                } 
    359323 
    360                 //ASSERT("sdfsdfds"); 
    361324                dataLength -= 2; 
    362325                pData += 2; 
     
    389352         */ 
    390353 
    391         //      _audioData.msg_iov[0].iov_base[00] V,P,X,CC 
    392         //      _audioData.msg_iov[0].iov_base[01] M,PT 
    393         //      _audioData.msg_iov[0].iov_base[02] sequence number 
    394         //      _audioData.msg_iov[0].iov_base[03] sequence number 
    395         //      _audioData.msg_iov[0].iov_base[04] timestamp 
    396         //      _audioData.msg_iov[0].iov_base[05] timestamp 
    397         //      _audioData.msg_iov[0].iov_base[06] timestamp 
    398         //      _audioData.msg_iov[0].iov_base[07] timestamp 
    399         //      _audioData.msg_iov[0].iov_base[08] SSRC 
    400         //      _audioData.msg_iov[0].iov_base[09] SSRC 
    401         //      _audioData.msg_iov[0].iov_base[10] SSRC 
    402         //      _audioData.msg_iov[0].iov_base[11] SSRC 
    403         //      _audioData.msg_iov[0].iov_base[12] AU-headers-length 
    404         //      _audioData.msg_iov[0].iov_base[13] AU-headers-length 
    405  
    406354        //5. counter 
    407355        EHTONSP(((uint8_t *) _audioData.msg_iov[0].iov_base) + 2, _audioCounter); 
     
    419367        _audioData.msg_iov[1].iov_len = 2; 
    420368 
    421         //      FINEST("%02x%02x %02x%02x %02x%02x%02x%02x %02x%02x%02x%02x - %02x%02x %02x%02x %08x %.2f", 
    422         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[0], 
    423         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[1], 
    424         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[2], 
    425         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[3], 
    426         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[4], 
    427         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[5], 
    428         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[6], 
    429         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[7], 
    430         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[8], 
    431         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[9], 
    432         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[10], 
    433         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[11], 
    434         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[12], 
    435         //                      ((uint8_t *) _audioData.msg_iov[0].iov_base)[13], 
    436         //                      ((uint8_t *) _audioData.msg_iov[1].iov_base)[0], 
    437         //                      ((uint8_t *) _audioData.msg_iov[1].iov_base)[1], 
    438         //                      dataLength - 7, 
    439         //                      absoluteTimestamp); 
    440  
    441369        //7. put the actual buffer 
    442370        _audioData.msg_iov[2].iov_len = dataLength - adtsHeaderLength; 
  • trunk/sources/thelib/src/protocols/ssl/basesslprotocol.cpp

    r247 r410  
    146146                } 
    147147                if (!_sslHandshakeCompleted) { 
    148                         //WARN("SSL handshake not completed yet"); 
    149148                        return true; 
    150149                } 
  • trunk/sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp

    r87 r410  
    5252        int32_t errorCode = SSL_ERROR_NONE; 
    5353        errorCode = SSL_connect(_pSSL); 
    54         //FINEST("errorCode: %d", errorCode); 
    5554        if (errorCode < 0) { 
    5655                int32_t error = SSL_get_error(_pSSL, errorCode); 
    57                 //FINEST("error: %d", error); 
    5856                if (error != SSL_ERROR_WANT_READ && 
    5957                                error != SSL_ERROR_WANT_WRITE) { 
     
    6462 
    6563        _sslHandshakeCompleted = SSL_is_init_finished(_pSSL); 
    66         //FINEST("_sslHandshakeCompleted: %d", _sslHandshakeCompleted); 
    6764 
    6865        if (!PerformIO()) { 
  • trunk/sources/thelib/src/protocols/tcpprotocol.cpp

    r193 r410  
    6161 
    6262bool TCPProtocol::AllowNearProtocol(uint64_t type) { 
    63         //    if ( 
    64         //            type == PT_INBOUNDRTMP || 
    65         //            type == PT_OUTBOUNDRTMP || 
    66         //            type == PT_RTMPE || 
    67         //            type == PT_SSL || 
    68         //            type == PT_INBOUNDDNS || 
    69         //            type == PT_OUTBOUNDDNS || 
    70         //            type == PT_INBOUNDTS || 
    71         //            type == PT_INBOUNDHTTP || 
    72         //            type == PT_OUTBOUNDHTTP || 
    73         //            false 
    74         //            ) 
    75         //        return true; 
    76         //    WARN("Near protocol %s not accepted by %s", 
    77         //            STR(tagToString(type)), 
    78         //            STR(tagToString(_type))); 
    79         //    return false; 
    8063        return true; 
    8164} 
     
    8770bool TCPProtocol::SignalInputData(int32_t recvAmount) { 
    8871        _decodedBytesCount += recvAmount; 
    89         //FINEST("_decodedBytesCount: %d", _decodedBytesCount); 
    9072        return _pNearProtocol->SignalInputData(_inputBuffer); 
    9173} 
  • trunk/sources/thelib/src/protocols/ts/basetsappprotocolhandler.cpp

    r56 r410  
    3333 
    3434void BaseTSAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 
    35         //FINEST("Register TS protocol %p to handler %p", pProtocol, this); 
    3635        if (MAP_HAS1(_connections, pProtocol->GetId())) { 
    3736                ASSERT("Protocol already registered"); 
     
    4140 
    4241void BaseTSAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 
    43         //FINEST("Unregister TS protocol %p from handler %p", pProtocol, this); 
    4442        _connections.erase(pProtocol->GetId()); 
    4543} 
  • trunk/sources/thelib/src/protocols/ts/inboundtsprotocol.cpp

    r317 r410  
    2525#include "protocols/ts/tspacketpat.h" 
    2626#include "protocols/ts/tspacketpmt.h" 
    27 #include "protocols/ts/tsadaptationfield.h" 
    2827#include "protocols/ts/basetsappprotocolhandler.h" 
    2928#include "protocols/ts/innettsstream.h" 
     
    9998 
    10099bool InboundTSProtocol::AllowFarProtocol(uint64_t type) { 
    101         //    if (type == PT_TCP || 
    102         //            type == PT_OUTBOUNDHTTP) 
    103         //        return true; 
    104         //    FATAL("Far protocol %d not accepted", type); 
    105         //    return false; 
    106100        return true; 
    107101} 
     
    247241        } 
    248242        if (!TS_TRANSPORT_PACKET_HAS_PAYLOAD(packetHeader)) { 
    249                 //WARN("No payload here!"); 
    250243                return true; 
    251244        } 
     
    324317                return false; 
    325318        } 
    326         //FINEST("packetPAT:\n%s", STR(packetPAT)); 
    327319 
    328320        //3. Store the crc 
     
    382374                return false; 
    383375        } 
    384         //FINEST("packetPMT:\n%s", STR(packetPMT)); 
    385376 
    386377        //3. Store the CRC 
  • trunk/sources/thelib/src/protocols/ts/innettsstream.cpp

    r317 r410  
    145145                        absoluteTime = (ptsTime - deltaTime); 
    146146                        _feedTime = _feedTime < absoluteTime ? absoluteTime : _feedTime; 
    147                         //FINEST("%c: absoluteTime: %.2f;", isAudio ? 'A' : 'V', absoluteTime); 
    148147 
    149148                        pData += 9 + pesHeaderLength; 
     
    225224        //iso13818-7 page 26/206 
    226225 
    227         //      FINEST("rawBufferLength: %d; GETAVAILABLEBYTESCOUNT(_audioBuffer): %d", 
    228         //                      rawBufferLength, GETAVAILABLEBYTESCOUNT(_audioBuffer)); 
    229  
    230  
    231226        //1. Save the data 
    232227        _audioBuffer.ReadFromBuffer(pRawBuffer, rawBufferLength); 
     
    250245 
    251246                if ((ENTOHSP(pBuffer)&0xfff0) != 0xfff0) { 
    252                         //WARN("Bogus marker %02x %02x. Skip one byte", pBuffer[0], pBuffer[1]); 
    253247                        _audioBuffer.Ignore(1); 
    254248                        continue; 
    255249                } else { 
    256                         //FINEST("OK: %d", pBuffer[1]&0x01); 
    257250                } 
    258251 
     
    268261                } 
    269262                if (bufferLength < frameLength) { 
    270                         //                      FINEST("Not enough data. Wanted: %d; Got: %d", 
    271                         //                                      frameLength, 
    272                         //                                      GETAVAILABLEBYTESCOUNT(_audioBuffer)); 
    273263                        break; 
    274264                } 
     
    280270                } 
    281271                _lastSentAudioTimestamp = ts; 
    282                 //FINEST("timestamp: %.2f; _audioPacketsCount: %d", timestamp, _audioPacketsCount); 
    283272 
    284273                //5. Feed 
     
    416405 
    417406void InNetTSStream::InitializeAudioCapabilities(uint8_t *pData, uint32_t length) { 
    418         //FINEST("_streamCapabilities.audioCodecId: %016llx", _streamCapabilities.audioCodecId); 
    419407        if (_streamCapabilities.audioCodecId == CODEC_AUDIO_UNKNOWN) { 
    420408                uint8_t mpegts2rtmpProfile[] = { 
  • trunk/sources/thelib/src/protocols/ts/pidtypes.cpp

    r317 r410  
    1818 */ 
    1919 
    20  
    21  
    2220#ifdef HAS_PROTOCOL_TS 
    2321#include "protocols/ts/pidtypes.h" 
    2422 
    25 //string GetPIDTypeString(PIDType pidType) { 
    26 //      switch (pidType) { 
    27 //              case PID_TYPE_UNKNOWN: 
    28 //                      return "PID_TYPE_UNKNOWN"; 
    29 //              case PID_TYPE_PAT: 
    30 //                      return "PID_TYPE_PAT"; 
    31 //              case PID_TYPE_PMT: 
    32 //                      return "PID_TYPE_PMT"; 
    33 //              case PID_TYPE_NIT: 
    34 //                      return "PID_TYPE_NIT"; 
    35 //              case PID_TYPE_AUDIOSTREAM: 
    36 //                      return "PID_TYPE_AUDIOSTREAM"; 
    37 //              case PID_TYPE_VIDEOSTREAM: 
    38 //                      return "PID_TYPE_VIDEOSTREAM"; 
    39 //              case PID_TYPE_NULL: 
    40 //                      return "PID_TYPE_NULL"; 
    41 //              default: 
    42 //                      return format("#unknown(%d)#", pidType); 
    43 //      } 
    44 //} 
     23 
    4524#endif  /* HAS_PROTOCOL_TS */ 
    4625 
  • trunk/sources/thelib/src/protocols/ts/streamdescriptors.cpp

    r317 r410  
    3131        cursor += descriptor.length; 
    3232        return true; 
    33         //      switch (descriptor.type) { 
    34         //              case DESCRIPTOR_TYPE_VIDEO: 
    35         //              { 
    36         //                      CHECK_BOUNDS(1); 
    37         //                      uint8_t flags = pBuffer[cursor]; 
    38         //                      descriptor.info.video.multipleFrameFate = (flags & 0x80) != 0; 
    39         //                      descriptor.info.video.frameRateCode = (flags & 0x78) >> 3; 
    40         //                      descriptor.info.video.MPEG1Only = (flags & 0x04) != 0; 
    41         //                      descriptor.info.video.constrainedParameter = (flags & 0x02) != 0; 
    42         //                      descriptor.info.video.stillPicture = flags & 0x01; 
    43         //                      if (descriptor.info.video.MPEG1Only) { 
    44         //                              CHECK_BOUNDS(1); 
    45         //                              descriptor.info.video.profileAndLevelIndication = pBuffer[cursor + 1]; 
    46         //                              CHECK_BOUNDS(1); 
    47         //                              flags = pBuffer[cursor + 2]; 
    48         //                              descriptor.info.video.chromaFormat = flags >> 6; 
    49         //                              descriptor.info.video.frameRateExtension = (flags & 0x20) != 0; 
    50         //                      } 
    51         //                      CHECK_BOUNDS(descriptor.length); 
    52         //                      cursor += descriptor.length; 
    53         //                      return true; 
    54         //              } 
    55         //              case DESCRIPTOR_TYPE_REGISTRATION: 
    56         //              { 
    57         //                      CHECK_BOUNDS(4); 
    58         //                      descriptor.info.registration.formatIdentifier = ENTOHLP((pBuffer + cursor)); //----MARKED-LONG--- 
    59         //                      descriptor.info.registration.additionalInfoLength = descriptor.length - 4; 
    60         //                      memcpy(descriptor.info.registration.additionalInfo, 
    61         //                                      pBuffer + cursor, 
    62         //                                      descriptor.info.registration.additionalInfoLength); 
    63         //                      cursor += descriptor.length; 
    64         //                      return true; 
    65         //              } 
    66         //              case DESCRIPTOR_TYPE_DATA_STREAM_ALIGNMENT: 
    67         //              { 
    68         //                      CHECK_BOUNDS(1); 
    69         //                      descriptor.info.dataStreamAlignment.alignmentType = pBuffer[cursor++]; 
    70         //                      return true; 
    71         //              } 
    72         //              case DESCRIPTOR_TYPE_ISO_639_LANGUAGE: 
    73         //              { 
    74         //                      for (uint8_t i = 0; i < descriptor.length / 4; i++) { 
    75         //                              CHECK_BOUNDS(3); 
    76         //                              memcpy(descriptor.info.iso639Language.definition[i].languageCode, 
    77         //                                              pBuffer + cursor, 3); 
    78         //                              cursor += 3; 
    79         //                              CHECK_BOUNDS(1); 
    80         //                              descriptor.info.iso639Language.definition[i].audioType = pBuffer[cursor++]; 
    81         //                      } 
    82         //                      return true; 
    83         //              } 
    84         //              case DESCRIPTOR_TYPE_IOD_DESCRIPTOR: 
    85         //              { 
    86         //                      WARN("DESCRIPTOR_TYPE_IOD_DESCRIPTOR not yet implemented"); 
    87         //                      CHECK_BOUNDS(descriptor.length); 
    88         //                      cursor += descriptor.length; 
    89         //                      return true; 
    90         //              } 
    91         //              case DESCRIPTOR_TYPE_SMOOTHING_BUFFER: 
    92         //              { 
    93         //                      WARN("DESCRIPTOR_TYPE_SMOOTHING_BUFFER not yet implemented"); 
    94         //                      CHECK_BOUNDS(descriptor.length); 
    95         //                      cursor += descriptor.length; 
    96         //                      return true; 
    97         //              } 
    98         //              case DESCRIPTOR_TYPE_FMC_DESCRIPTOR: 
    99         //              { 
    100         //                      WARN("DESCRIPTOR_TYPE_SMOOTHING_BUFFER not yet implemented"); 
    101         //                      CHECK_BOUNDS(descriptor.length); 
    102         //                      cursor += descriptor.length; 
    103         //                      return true; 
    104         //              } 
    105         //              default: 
    106         //              { 
    107         //                      if (descriptor.type < 36) { 
    108         //                              FATAL("Unknown descriptor type %d ", descriptor.type); 
    109         //                              return false; 
    110         //                      } else { 
    111         //                              WARN("Descriptor type %d defaulted to USER PRIVATE", descriptor.type); 
    112         //                              descriptor.type = DESCRIPTOR_TYPE_USER_PRIVATE; 
    113         //                              CHECK_BOUNDS(descriptor.length); 
    114         //                              cursor += descriptor.length; 
    115         //                              return true; 
    116         //                      } 
    117         //              } 
    118         //      } 
    11933} 
    12034#endif  /* HAS_PROTOCOL_TS */ 
  • trunk/sources/thelib/src/protocols/variant/basevariantappprotocolhandler.cpp

    r197 r410  
    5454 
    5555void BaseVariantAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 
    56         //FINEST("BaseVariantAppProtocolHandler::RegisterProtocol"); 
    5756} 
    5857 
    5958void BaseVariantAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 
    60         //FINEST("BaseVariantAppProtocolHandler::UnRegisterProtocol"); 
    6159} 
    6260 
     
    7371        } 
    7472        parameters["payload"] = variant; 
    75         //FINEST("parameters:\n%s", STR(parameters.ToString())); 
    7673 
    7774        //2. Start the HTTP request 
  • trunk/sources/thelib/src/streaming/baseinfilestream.cpp

    r399 r410  
    212212                return false; 
    213213        } 
    214         //FINEST("_totalFrames: %u", _totalFrames); 
    215214 
    216215        //5. Set the client side buffer length 
     
    229228        absoluteTimestamp = absoluteTimestamp < 0 ? 0 : absoluteTimestamp; 
    230229        //TODO: implement the limit playback 
    231         //length = length < 0 ? _totalDuration : length; 
    232230 
    233231        //1. Seek to the correct point 
     
    384382        //or stay put 
    385383        uint32_t elapsedTime = (uint32_t) (time(NULL) - _startFeedingTime); 
    386         //    FINEST("tst: %d; et: %d; diff: %d", 
    387         //            _totalSentTime, elapsedTime, 
    388         //            (int32_t) _totalSentTime - (int32_t) elapsedTime); 
    389384        if ((int32_t) _totalSentTime - (int32_t) elapsedTime >= _clientSideBufferLength) { 
    390385                return true; 
     
    494489                pResult = _fileCache[filePath].second; 
    495490                _fileCache[filePath].first++; 
    496                 //FINEST("+Count: %d", _fileCache[filePath].first); 
    497491        } 
    498492        return pResult; 
     
    525519                return false; 
    526520        } 
    527         //FINEST("frame1: %s", STR(frame1)); 
    528521 
    529522        //2. Read the second frame 
     
    537530                return false; 
    538531        } 
    539         //FINEST("frame2: %s", STR(frame2)); 
    540532 
    541533        //3. Read the current frame to pickup the timestamp from it 
     
    549541                return false; 
    550542        } 
    551         //FINEST("currentFrame: %s", STR(currentFrame)); 
    552543 
    553544        //4. Is the first frame a codec setup? 
    554545        //If not, the second is not a codec setup for sure 
    555546        if (!frame1.isBinaryHeader) { 
    556                 //FINEST("frame1 is not binary header"); 
    557547                _audioVideoCodecsSent = true; 
    558548                return true; 
     
    565555                return false; 
    566556        } 
    567         //FINEST("frame1 buffer:\n%s", STR(buffer)); 
    568557 
    569558        //6. Do the feedeng with the first frame 
     
    579568                return false; 
    580569        } 
    581         //FINEST("frame1 was fed"); 
    582570 
    583571        //7. Is the second frame a codec setup? 
    584572        if (!frame2.isBinaryHeader) { 
    585                 //FINEST("frame2 is not binary header"); 
    586573                _audioVideoCodecsSent = true; 
    587574                return true; 
     
    594581                return false; 
    595582        } 
    596         //FINEST("frame2 buffer:\n%s", STR(buffer)); 
    597583 
    598584        //9. Do the feedeng with the second frame 
     
    608594                return false; 
    609595        } 
    610         //FINEST("frame2 was fed"); 
    611596 
    612597        //10. Done 
  • trunk/sources/thelib/src/streaming/baseinstream.cpp

    r202 r410  
    6969                return false; 
    7070        } 
    71         //    FINEST("BaseInStream::Link: this: %u; pOutStream: %u; reverseLink: %d", 
    72         //            GetUniqueId(), pOutStream->GetUniqueId(), reverseLink); 
    7371        if (MAP_HAS1(_linkedStreams, pOutStream->GetUniqueId())) { 
    7472                WARN("BaseInStream::Link: This stream is already linked"); 
    7573                return true; 
    7674        } 
    77         //FINEST("BaseInStream::Link: Linking..."); 
    7875        _pOutStreams = AddLinkedList(_pOutStreams, pOutStream, true); 
    7976        _linkedStreams[pOutStream->GetUniqueId()] = pOutStream; 
    8077 
    8178        if (reverseLink) { 
    82                 //FINEST("BaseInStream::Link: Reverse linking..."); 
    8379                if (!pOutStream->Link(this, false)) { 
    8480                        FATAL("BaseInStream::Link: Unable to reverse link"); 
     
    8682                        NYIA; 
    8783                } 
    88                 //FINEST("BaseInStream::Link: Done reverse link"); 
    8984        } 
    90         //FINEST("BaseInStream::Link: Signal OutStreamAttached"); 
    9185        SignalOutStreamAttached(pOutStream); 
    92         //FINEST("BaseInStream::Link: Done"); 
    9386        return true; 
    9487} 
    9588 
    9689bool BaseInStream::UnLink(BaseOutStream *pOutStream, bool reverseUnLink) { 
    97         //    FINEST("BaseInStream::UnLink: this: %u; pOutStream: %u; reverseUnLink: %d", 
    98         //            GetUniqueId(), pOutStream->GetUniqueId(), reverseUnLink); 
    9990        if (!MAP_HAS1(_linkedStreams, pOutStream->GetUniqueId())) { 
    10091                WARN("BaseInStream::UnLink: This stream is not linked"); 
     
    10293        } 
    10394 
    104         //FINEST("BaseInStream::UnLink: UnLinking..."); 
    10595        _linkedStreams.erase(pOutStream->GetUniqueId()); 
    10696        LinkedListNode<BaseOutStream *> *pTemp = _pOutStreams; 
     
    10898                if (pTemp->info->GetUniqueId() == pOutStream->GetUniqueId()) { 
    10999                        _pOutStreams = RemoveLinkedList<BaseOutStream *>(pTemp); 
    110                         //FINEST("BaseInStream::UnLink: Stream unlinked from the list"); 
    111100                        break; 
    112101                } 
     
    115104 
    116105        if (reverseUnLink) { 
    117                 //FINEST("BaseInStream::UnLink: Reverse unLinking..."); 
    118106                if (!pOutStream->UnLink(false)) { 
    119107                        FATAL("BaseInStream::UnLink: Unable to reverse unLink"); 
     
    121109                        NYIA; 
    122110                } 
    123                 //FINEST("BaseInStream::UnLink: Done reverse unLink"); 
    124111        } 
    125         //    FINEST("BaseInStream::UnLink: _canCallOutStreamDetached: %d", 
    126         //            _canCallOutStreamDetached); 
    127112        if (_canCallOutStreamDetached) { 
    128                 //FINEST("BaseInStream::UnLink: Signal OutStreamDetached"); 
    129113                SignalOutStreamDetached(pOutStream); 
    130114        } 
    131         //FINEST("BaseInStream::UnLink: Done"); 
    132115        return true; 
    133116} 
  • trunk/sources/thelib/src/streaming/baseoutstream.cpp

    r202 r410  
    5858                return false; 
    5959        } 
    60         //    FINEST("BaseOutStream::Link: this: %u; pInStream: %u; reverseLink: %d", 
    61         //            GetUniqueId(), pInStream->GetUniqueId(), reverseLink); 
    6260        if (_pInStream != NULL) { 
    6361                if (_pInStream->GetUniqueId() == pInStream->GetUniqueId()) { 
     
    6967                return false; 
    7068        } 
    71         //FINEST("BaseOutStream::Link: Linking..."); 
    7269        _pInStream = pInStream; 
    7370        if (reverseLink) { 
    74                 //FINEST("BaseOutStream::Link: Reverse linking..."); 
    7571                if (!_pInStream->Link(this, false)) { 
    7672                        FATAL("BaseOutStream::Link: Unable to reverse link"); 
     
    7874                        return false; 
    7975                } 
    80                 //FINEST("BaseOutStream::Link: Done reverse link"); 
    8176        } 
    82         //FINEST("BaseOutStream::Link: Signal AttachedToInStream"); 
    8377        SignalAttachedToInStream(); 
    84         //FINEST("BaseOutStream::Link: Done"); 
    8578        return true; 
    8679} 
    8780 
    8881bool BaseOutStream::UnLink(bool reverseUnLink) { 
    89         //    FINEST("BaseOutStream::UnLink: this: %u; _pInStream: %u; reverseUnLink: %d", 
    90         //            GetUniqueId(), _pInStream != NULL ? _pInStream->GetUniqueId() : 0, 
    91         //            reverseUnLink); 
    9282        if (_pInStream == NULL) { 
    9383                WARN("BaseOutStream::UnLink: This stream is not linked"); 
     
    9585        } 
    9686        if (reverseUnLink) { 
    97                 //FINEST("BaseOutStream::UnLink: Reverse unLinking..."); 
    9887                if (!_pInStream->UnLink(this, false)) { 
    9988                        FATAL("BaseOutStream::UnLink: Unable to reverse unLink"); 
     
    10190                        NYIA; 
    10291                } 
    103                 //FINEST("BaseOutStream::UnLink: Done reverse unLink"); 
    10492        } 
    105         //FINEST("BaseOutStream::UnLink: unLinking..."); 
    10693        _pInStream = NULL; 
    107  
    108         //    FINEST("BaseOutStream::UnLink: _canCallDetachedFromInStream: %d", 
    109         //            _canCallDetachedFromInStream); 
    11094        if (_canCallDetachedFromInStream) { 
    111                 //FINEST("BaseOutStream::UnLink: Signal DetachedFromInStream"); 
    11295                SignalDetachedFromInStream(); 
    11396        } 
    114         //FINEST("BaseOutStream::UnLink: Done"); 
    11597        return true; 
    11698} 
  • trunk/sources/thelib/src/streaming/basestream.cpp

    r243 r410  
    3434        _creationTimestamp /= (double) CLOCKS_PER_SECOND; 
    3535        _creationTimestamp *= 1000.00; 
    36         //FINEST("Stream %u created: %s", _uniqueId, STR(tagToString(_type))); 
    3736} 
    3837 
    3938BaseStream::~BaseStream() { 
    4039        _pStreamsManager->UnRegisterStream(this); 
    41         //FINEST("Stream %u deleted: %s", _uniqueId, STR(tagToString(_type))); 
    4240} 
    4341 
  • trunk/sources/thelib/src/streaming/packetqueue.cpp

    r379 r410  
    9191        Packet *pPacket = NULL; 
    9292        if (_free.size() != 0) { 
    93                 //FINEST("cache"); 
    9493                pPacket = _free[0]; 
    9594                _free.erase(_free.begin()); 
    9695        } else { 
    97                 //FINEST("new"); 
    9896                pPacket = new Packet; 
    9997                pPacket->buffer.ReadFromRepeat(0, _initialBuffer); 
  • trunk/sources/thelib/src/streaming/streamcapabilities.cpp

    r399 r410  
    7070        //E.1.2 HRD parameters syntax 
    7171        //14496-10.pdf 268/280 
    72         //FINEST("------BEGIN VUI HRD------"); 
    7372        READ_EG("cpb_cnt_minus1", uint64_t); 
    7473        READ_INT("bit_rate_scale", uint8_t, 4); 
     
    9594        READ_INT("dpb_output_delay_length_minus1", uint8_t, 5); 
    9695        READ_INT("time_offset_length", uint8_t, 5); 
    97         //FINEST("------END VUI HRD------"); 
    9896        return true; 
    9997} 
     
    102100        //E.1.1 VUI parameters syntax 
    103101        //14496-10.pdf 267/280 
    104         //FINEST("------BEGIN VUI------"); 
    105102        READ_BOOL("aspect_ratio_info_present_flag"); 
    106103        if ((bool)v["aspect_ratio_info_present_flag"]) { 
     
    164161                READ_EG("max_dec_frame_buffering", uint64_t); 
    165162        } 
    166         //FINEST("------END VUI------"); 
    167163        return true; 
    168164} 
     
    171167        //7.3.2.1 Sequence parameter set RBSP syntax 
    172168        //14496-10.pdf 43/280 
    173         //FINEST("ba: %d", ba.AvailableBits()); 
    174         //FINEST("------BEGIN SPS------"); 
    175169        READ_INT("profile_idc", uint8_t, 8); 
    176170        READ_BOOL("constraint_set0_flag"); 
     
    220214                } 
    221215        } 
    222         //FINEST("------END SPS------"); 
    223216        return true; 
    224217} 
     
    227220        //7.3.2.2 Picture parameter set RBSP syntax 
    228221        //14496-10.pdf 44/280 
    229         //FINEST("ba: %d", ba.AvailableBits()); 
    230222        READ_EG("pic_parameter_set_id", uint64_t); 
    231223        READ_EG("seq_parameter_set_id", uint64_t); 
     
    318310                _width = ((uint32_t) _SPSInfo["pic_width_in_mbs_minus1"] + 1)*16; 
    319311                _height = ((uint32_t) _SPSInfo["pic_height_in_map_units_minus1"] + 1)*16; 
    320                 //FINEST("_SPSInfo:\n%s", STR(_SPSInfo.ToString())); 
    321312        } 
    322313 
     
    326317                WARN("Unable to read PPS info"); 
    327318        } 
    328         //      else { 
    329         //              FINEST("_PPSInfo:\n%s", STR(_PPSInfo.ToString())); 
    330         //      } 
    331  
    332         //FINEST("\n%s", STR(*this)); 
    333319 
    334320        return true; 
     
    381367 
    382368        //1. Prepare the bit array 
    383         //      uint8_t temp[] = {0x13, 0x10, 0x56, 0xE5, 0x98}; 
    384         //      length = sizeof (temp); 
    385         //      pBuffer = temp; 
    386369        BitArray ba; 
    387370        ba.ReadFromBuffer(pBuffer, length); 
     
    402385                return false; 
    403386        } 
    404         //FINEST("_audioObjectType: %d", _audioObjectType); 
    405387 
    406388        //3. Read the sample rate index 
     
    411393                return false; 
    412394        } 
    413         //FINEST("_sampleRateIndex: %d", _sampleRateIndex); 
    414395        if (_sampleRateIndex == 15) { 
    415396                if (length < 5) { 
     
    425406                _sampleRate = rates[_sampleRateIndex]; 
    426407        } 
    427         //FINEST("_sampleRate: %d", _sampleRate); 
    428408 
    429409        //4. read the channel configuration index 
     
    434414                return false; 
    435415        } 
    436         //FINEST("_channelConfigurationIndex: %d", _channelConfigurationIndex); 
    437416 
    438417        _pAAC = new uint8_t[length]; 
     
    440419        _aacLength = length; 
    441420 
    442         //FINEST("AAC codec:\n%s", STR(*this)); 
    443421 
    444422        return true; 
  • trunk/sources/thelib/src/streaming/streamsmanager.cpp

    r236 r410  
    145145 
    146146map<uint32_t, BaseStream *> StreamsManager::FindByType(uint64_t type, bool partial) { 
    147         //    FINEST("FindByType: type: %s; partial: %d", 
    148         //            STR(tagToString(type)), partial); 
    149147        map<uint32_t, BaseStream * > result; 
    150148 
     
    159157        for (map<uint64_t, map<uint32_t, BaseStream * > >::iterator i = _streamsByType.begin(); 
    160158                        i != _streamsByType.end(); i++) { 
    161                 //        FINEST("FindByType: MAP_KEY(i): %016llx; mask: %016llx; type: %016llx; (MAP_KEY(i) & mask): %016llx", 
    162                 //                MAP_KEY(i), mask, type, (MAP_KEY(i) & mask)); 
    163159                if ((MAP_KEY(i) & mask) == type) { 
    164                         //FINEST("FindByType: matched"); 
    165160 
    166161                        FOR_MAP(MAP_VAL(i), uint32_t, BaseStream *, j) { 
     
    175170map<uint32_t, BaseStream *> StreamsManager::FindByTypeByName(uint64_t type, 
    176171                string name, bool partialType, bool partialName) { 
    177         //    FINEST("FindByTypeByName: type: %s; name: %s; partialType: %d; partialName: %d", 
    178         //            STR(tagToString(type)), STR(name), partialType, partialName); 
    179172        //1. Filter on type 
    180173        map<uint32_t, BaseStream * > possibleResults = FindByType(type, partialType); 
    181  
    182         //    FOR_MAP(possibleResults, uint32_t, BaseStream *, i) { 
    183         //        FINEST("FindByTypeByName: filer on type: UID: %u; type: %s", 
    184         //                MAP_VAL(i)->GetUniqueId(), 
    185         //                STR(tagToString(MAP_VAL(i)->GetType()))); 
    186         //    } 
    187174 
    188175        //2. Filter on name 
Note: See TracChangeset for help on using the changeset viewer.