Changeset 410
- Timestamp:
- 03/30/11 10:43:22 (14 months ago)
- Location:
- trunk/sources/thelib
- Files:
-
- 3 deleted
- 116 edited
-
include/mediaformats/mp4/atomstsc.h (modified) (1 diff)
-
include/netio/epoll/tcpconnector.h (modified) (1 diff)
-
include/netio/kqueue/tcpconnector.h (modified) (1 diff)
-
include/netio/select/tcpconnector.h (modified) (2 diffs)
-
include/protocols/rtmfp/basertmfpprotocol.h (modified) (2 diffs)
-
include/protocols/rtp/rtcpprotocol.h (modified) (2 diffs)
-
include/protocols/rtp/rtpheader.h (modified) (1 diff)
-
include/protocols/ts/inboundtsprotocol.h (modified) (1 diff)
-
include/protocols/ts/pidtypes.h (modified) (1 diff)
-
include/protocols/ts/streamdescriptors.h (modified) (1 diff)
-
include/protocols/ts/tsadaptationfield.h (deleted)
-
src/application/clientapplicationmanager.cpp (modified) (1 diff)
-
src/configuration/configfile.cpp (modified) (3 diffs)
-
src/mediaformats/basemediadocument.cpp (modified) (5 diffs)
-
src/mediaformats/flv/flvdocument.cpp (modified) (2 diffs)
-
src/mediaformats/mp3/id3parser.cpp (modified) (3 diffs)
-
src/mediaformats/mp3/mp3document.cpp (modified) (5 diffs)
-
src/mediaformats/mp4/atomavc1.cpp (modified) (16 diffs)
-
src/mediaformats/mp4/atomavcc.cpp (modified) (9 diffs)
-
src/mediaformats/mp4/atomco64.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/atomctts.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/atomdata.cpp (modified) (4 diffs)
-
src/mediaformats/mp4/atomesds.cpp (modified) (1 diff)
-
src/mediaformats/mp4/atomftyp.cpp (modified) (3 diffs)
-
src/mediaformats/mp4/atomhdlr.cpp (modified) (6 diffs)
-
src/mediaformats/mp4/atommdhd.cpp (modified) (6 diffs)
-
src/mediaformats/mp4/atommp4a.cpp (modified) (13 diffs)
-
src/mediaformats/mp4/atommvhd.cpp (modified) (14 diffs)
-
src/mediaformats/mp4/atomsmhd.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/atomstco.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/atomstsc.cpp (modified) (4 diffs)
-
src/mediaformats/mp4/atomstss.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/atomstsz.cpp (modified) (3 diffs)
-
src/mediaformats/mp4/atomstts.cpp (modified) (3 diffs)
-
src/mediaformats/mp4/atomtkhd.cpp (modified) (9 diffs)
-
src/mediaformats/mp4/atomvmhd.cpp (modified) (1 diff)
-
src/mediaformats/mp4/atomwave.cpp (modified) (1 diff)
-
src/mediaformats/mp4/baseatom.cpp (modified) (1 diff)
-
src/mediaformats/mp4/boxatom.cpp (modified) (5 diffs)
-
src/mediaformats/mp4/mp4document.cpp (modified) (7 diffs)
-
src/mediaformats/mp4/versionedatom.cpp (modified) (2 diffs)
-
src/mediaformats/mp4/versionedboxatom.cpp (modified) (2 diffs)
-
src/mediaformats/nsv/mp3media.cpp (modified) (1 diff)
-
src/mediaformats/nsv/nsvdocument.cpp (modified) (15 diffs)
-
src/netio/epoll/iohandlermanager.cpp (modified) (3 diffs)
-
src/netio/epoll/iotimer.cpp (modified) (1 diff)
-
src/netio/epoll/stdiocarrier.cpp (modified) (2 diffs)
-
src/netio/epoll/tcpacceptor.cpp (modified) (1 diff)
-
src/netio/epoll/tcpcarrier.cpp (modified) (4 diffs)
-
src/netio/epoll/udpcarrier.cpp (modified) (3 diffs)
-
src/netio/kqueue/iohandler.cpp (modified) (1 diff)
-
src/netio/kqueue/iohandlermanager.cpp (modified) (5 diffs)
-
src/netio/kqueue/iotimer.cpp (modified) (1 diff)
-
src/netio/kqueue/stdiocarrier.cpp (modified) (1 diff)
-
src/netio/kqueue/tcpacceptor.cpp (modified) (1 diff)
-
src/netio/kqueue/tcpcarrier.cpp (modified) (4 diffs)
-
src/netio/kqueue/udpcarrier.cpp (modified) (1 diff)
-
src/netio/select/iohandler.cpp (modified) (1 diff)
-
src/netio/select/iohandlermanager.cpp (modified) (1 diff)
-
src/netio/select/iotimer.cpp (modified) (1 diff)
-
src/netio/select/stdiocarrier.cpp (modified) (1 diff)
-
src/netio/select/tcpacceptor.cpp (modified) (1 diff)
-
src/netio/select/tcpcarrier.cpp (modified) (3 diffs)
-
src/netio/select/udpcarrier.cpp (modified) (1 diff)
-
src/protocols/baseprotocol.cpp (modified) (2 diffs)
-
src/protocols/cli/inboundjsoncliprotocol.cpp (modified) (2 diffs)
-
src/protocols/dns/inbounddnsresolverprotocol.cpp (modified) (1 diff)
-
src/protocols/dns/outbounddnsresolverprotocol.cpp (modified) (1 diff)
-
src/protocols/http/basehttpprotocol.cpp (modified) (3 diffs)
-
src/protocols/http/inboundhttpprotocol.cpp (modified) (2 diffs)
-
src/protocols/http/outboundhttpprotocol.cpp (modified) (1 diff)
-
src/protocols/liveflv/inboundliveflvprotocol.cpp (modified) (3 diffs)
-
src/protocols/protocolfactorymanager.cpp (modified) (3 diffs)
-
src/protocols/rtmfp/basertmfpprotocol.cpp (modified) (2 diffs)
-
src/protocols/rtmp/amf0serializer.cpp (modified) (9 diffs)
-
src/protocols/rtmp/amf3serializer.cpp (modified) (4 diffs)
-
src/protocols/rtmp/basertmpappprotocolhandler.cpp (modified) (29 diffs)
-
src/protocols/rtmp/basertmpprotocol.cpp (modified) (23 diffs)
-
src/protocols/rtmp/header_be_ba.cpp (modified) (10 diffs)
-
src/protocols/rtmp/header_le_ba.cpp (modified) (10 diffs)
-
src/protocols/rtmp/header_le_sa.cpp (modified) (10 diffs)
-
src/protocols/rtmp/inboundhttp4rtmp.cpp (modified) (5 diffs)
-
src/protocols/rtmp/inboundrtmpprotocol.cpp (modified) (7 diffs)
-
src/protocols/rtmp/inboundrtmpsdiscriminatorprotocol.cpp (modified) (1 diff)
-
src/protocols/rtmp/messagefactories/connectionmessagefactory.cpp (modified) (1 diff)
-
src/protocols/rtmp/outboundrtmpprotocol.cpp (modified) (3 diffs)
-
src/protocols/rtmp/rtmpeprotocol.cpp (modified) (2 diffs)
-
src/protocols/rtmp/rtmpprotocolserializer.cpp (modified) (18 diffs)
-
src/protocols/rtmp/sharedobjects/so.cpp (modified) (5 diffs)
-
src/protocols/rtmp/sharedobjects/somanager.cpp (modified) (2 diffs)
-
src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp (modified) (14 diffs)
-
src/protocols/rtmp/streaming/infilertmpmp4stream.cpp (modified) (3 diffs)
-
src/protocols/rtp/basertspappprotocolhandler.cpp (modified) (14 diffs)
-
src/protocols/rtp/connectivity/inboundconnectivity.cpp (modified) (7 diffs)
-
src/protocols/rtp/connectivity/outboundconnectivity.cpp (modified) (4 diffs)
-
src/protocols/rtp/inboundrtpprotocol.cpp (modified) (6 diffs)
-
src/protocols/rtp/rtcpprotocol.cpp (modified) (6 diffs)
-
src/protocols/rtp/rtspprotocol.cpp (modified) (8 diffs)
-
src/protocols/rtp/sdp.cpp (modified) (17 diffs)
-
src/protocols/rtp/streaming/innetrtpstream.cpp (modified) (8 diffs)
-
src/protocols/rtp/streaming/outnetrtpudph264stream.cpp (modified) (7 diffs)
-
src/protocols/ssl/basesslprotocol.cpp (modified) (1 diff)
-
src/protocols/ssl/outboundsslprotocol.cpp (modified) (2 diffs)
-
src/protocols/tcpprotocol.cpp (modified) (2 diffs)
-
src/protocols/ts/basetsappprotocolhandler.cpp (modified) (2 diffs)
-
src/protocols/ts/inboundtsprotocol.cpp (modified) (5 diffs)
-
src/protocols/ts/innettsstream.cpp (modified) (6 diffs)
-
src/protocols/ts/pidtypes.cpp (modified) (1 diff)
-
src/protocols/ts/streamdescriptors.cpp (modified) (1 diff)
-
src/protocols/ts/tsadaptationfield.cpp (deleted)
-
src/protocols/ts/tspacketheader.cpp (deleted)
-
src/protocols/variant/basevariantappprotocolhandler.cpp (modified) (2 diffs)
-
src/streaming/baseinfilestream.cpp (modified) (11 diffs)
-
src/streaming/baseinstream.cpp (modified) (6 diffs)
-
src/streaming/baseoutstream.cpp (modified) (5 diffs)
-
src/streaming/basestream.cpp (modified) (1 diff)
-
src/streaming/packetqueue.cpp (modified) (1 diff)
-
src/streaming/streamcapabilities.cpp (modified) (15 diffs)
-
src/streaming/streamsmanager.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/thelib/include/mediaformats/mp4/atomstsc.h
r10 r410 34 34 private: 35 35 vector<STSCEntry> _stscEntries; 36 37 //map<sampleId, chunkId>38 36 vector<uint32_t> _normalizedEntries; 39 37 public: -
trunk/sources/thelib/include/netio/epoll/tcpconnector.h
r387 r410 50 50 51 51 virtual ~TCPConnector() { 52 //FINEST("Close socket: %d", _closeSocket);53 52 if (_closeSocket) { 54 53 close(_inboundFd); 55 //FINEST("Socket closed!");56 54 } 57 55 } -
trunk/sources/thelib/include/netio/kqueue/tcpconnector.h
r387 r410 51 51 52 52 virtual ~TCPConnector() { 53 //FINEST("Close socket: %d", _closeSocket);54 53 if (_closeSocket) { 55 54 close(_inboundFd); 56 //FINEST("Socket closed!");57 55 } 58 56 } -
trunk/sources/thelib/include/netio/select/tcpconnector.h
r387 r410 51 51 52 52 virtual ~TCPConnector() { 53 //FINEST("Close socket: %d", _closeSocket);54 53 if (_closeSocket) { 55 54 CLOSE_SOCKET(_inboundFd); 56 //FINEST("Socket closed!");57 55 } 58 56 } … … 66 64 IOHandlerManager::EnqueueForDelete(this); 67 65 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 // }74 66 75 67 BaseProtocol *pProtocol = ProtocolFactoryManager::CreateProtocolChain(_protocolChain, -
trunk/sources/thelib/include/protocols/rtmfp/basertmfpprotocol.h
r296 r410 50 50 uint8_t id[32]; 51 51 sockaddr_in address; 52 // EncDec enc;53 // EncDec dec;54 52 55 53 RTMFPPeer() { 56 54 memset(tag, 0, sizeof (tag)); 57 55 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);60 56 } 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 // }66 57 }; 67 58 … … 100 91 enc.Setup(true, (uint8_t *) sec2, 128); 101 92 dec.Setup(false, (uint8_t *) sec1, 128); 102 // server.SetEncDecKeys(sec1, sec2);103 // client.SetEncDecKeys(sec2, sec1);104 93 } 105 94 }; -
trunk/sources/thelib/include/protocols/rtp/rtcpprotocol.h
r259 r410 36 36 uint32_t _ssrc; 37 37 bool _validLastAddress; 38 // uint64_t _lastNtpMicroseconds;39 // uint32_t _lastRtpTimestamp;40 38 public: 41 39 RTCPProtocol(); … … 49 47 virtual bool SignalInputData(IOBuffer &buffer); 50 48 51 //bool SendRR(sockaddr_in &address);52 49 uint32_t GetLastSenderReport(); 53 50 sockaddr_in *GetLastAddress(); -
trunk/sources/thelib/include/protocols/rtp/rtpheader.h
r379 r410 37 37 uint32_t _timestamp; 38 38 uint32_t _ssrc; 39 //we are not interested in this yet40 //vector<uint32_t> _csrc;41 39 42 40 operator string() { -
trunk/sources/thelib/include/protocols/ts/inboundtsprotocol.h
r317 r410 26 26 #include "protocols/ts/pidtypes.h" 27 27 #include "protocols/ts/tspacketheader.h" 28 #include "protocols/ts/tsadaptationfield.h"29 28 30 29 #define TS_CHUNK_188 188 -
trunk/sources/thelib/include/protocols/ts/pidtypes.h
r317 r410 42 42 } PIDType; 43 43 44 //DLLEXP string GetPIDTypeString(PIDType pidType);45 46 44 #endif /* _PIDTYPES_H */ 47 45 #endif /* HAS_PROTOCOL_TS */ -
trunk/sources/thelib/include/protocols/ts/streamdescriptors.h
r317 r410 69 69 uint8_t length; 70 70 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_VIDEO80 // 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_REGISTRATION93 // 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_ALIGNMENT101 // 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_LANGUAGE107 //108 // struct {109 // uint8_t languageCode[3];110 // uint8_t audioType;111 // } definition[47];112 // } iso639Language;113 // } info;114 115 71 operator string() { 116 72 return format("type: %d; length: %d", type, length); -
trunk/sources/thelib/src/application/clientapplicationmanager.cpp
r188 r410 66 66 if (pClientApplication->IsDefault()) 67 67 _pDefaultApplication = pClientApplication; 68 // FINEST("Application `%s` (%d) registered", STR(pClientApplication->GetName()),69 // pClientApplication->GetId());70 68 return true; 71 69 } -
trunk/sources/thelib/src/configuration/configfile.cpp
r391 r410 872 872 873 873 void ConfigFile::Normalize(Variant &appConfigurationNode) { 874 //FINEST("Before:\n%s", STR(configuration.ToString()));875 874 876 875 appConfigurationNode[CONF_APPLICATION_DIRECTORY] = … … 906 905 //3. Normalize the users db file 907 906 if (appConfigurationNode.HasKey(CONF_APPLICATION_AUTH)) { 908 //FINEST("Before:\n%s", STR(configuration.ToString()));909 907 if (!appConfigurationNode[CONF_APPLICATION_AUTH].HasKey( 910 908 CONF_APPLICATION_AUTH_USERS_FILE)) { … … 926 924 appConfigurationNode[CONF_APPLICATION_AUTH][CONF_APPLICATION_AUTH_ENCODER_AGENTS] = temp; 927 925 928 //FINEST("temp:\n%s", STR(temp.ToString())); 929 } 930 931 //FINEST("After:\n%s", STR(configuration.ToString())); 926 } 927 932 928 } 933 929 -
trunk/sources/thelib/src/mediaformats/basemediadocument.cpp
r398 r410 170 170 if (framesCount >= 1) { 171 171 totalTime = _frames[framesCount - 1].absoluteTime; 172 //FINEST("totalTime: %f", totalTime);173 172 174 173 //5. build the table … … 176 175 uint32_t seekPoint = 0; 177 176 for (double i = 0; i <= totalTime; i += _seekGranularity) { 178 //FINEST("i: %.2f; frameIndex: %d", i, frameIndex);179 177 while (_frames[frameIndex].absoluteTime < i) { 180 //FINEST("frame: %.2f", _frames[frameIndex].absoluteTime);181 178 frameIndex++; 182 179 if (frameIndex >= framesCount) … … 186 183 if ((_frames[frameIndex].type == MEDIAFRAME_TYPE_VIDEO) 187 184 && (_frames[frameIndex].isKeyFrame)) { 188 //WARN("Seek point");189 185 seekPoint = frameIndex; 190 186 } … … 195 191 if (frameIndex >= framesCount) 196 192 break; 197 //FINEST("%.2f -> %.2f", i, _frames[frameIndex].absoluteTime);198 193 if (!seekFile.WriteUI32(seekPoint, false)) { 199 194 FATAL("Unable to write frame index"); … … 228 223 _metadata[META_RTMP_META]["duration"] = (double) _metadata[META_FILE_DURATION] / 1000.00; 229 224 230 //FINEST("metadata:\n%s", STR(metadata.ToString()));231 225 return _metadata.SerializeToBinFile(_metaFilePath + ".tmp"); 232 226 } -
trunk/sources/thelib/src/mediaformats/flv/flvdocument.cpp
r250 r410 156 156 WARN("frame: %s", STR(frame)); 157 157 158 //12. Read the metadata or ignore the data payload159 // 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_RTMP164 // 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 //#endif194 // } else {195 158 if (!_mediaFile.SeekAhead(frame.length)) { 196 159 WARN("Unable to seek in file"); 197 160 break; 198 161 } 199 // }200 162 201 163 //13. We are not interested in the previous tag size … … 214 176 } 215 177 216 // for (uint32_t i = 0; i < 50; i++) {217 // FINEST("Before:%s", STR(_frames[i]));218 // }219 178 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;224 179 225 180 //15. Add the binary headers -
trunk/sources/thelib/src/mediaformats/mp3/id3parser.cpp
r195 r410 94 94 totalSize = (totalSize << 7) | (tempBuffer[2]&0x7f); 95 95 totalSize = (totalSize << 7) | (tempBuffer[3]&0x7f); 96 //FINEST("_totalSize: 0x%08x (%d)", _totalSize, _totalSize);97 96 98 97 //3. See if we go to the end of the ID3 we have a valid media frame … … 180 179 size = ENTOHLP(GETIBPOINTER(buffer)); 181 180 } 182 //FINEST("name: %s; size: %d", STR(name), size);183 181 buffer.Ignore(4); 184 182 185 183 CHECK_BUFFER_SIZE(buffer, 2); 186 //uint16_t flags = ENTOHSP(GETIBPOINTER(buffer));187 184 buffer.Ignore(2); 188 185 if (size == 0 || GETAVAILABLEBYTESCOUNT(buffer) < size) { … … 190 187 return false; 191 188 } 192 //FINEST("id: %08x; name: %s; size: %d; flags: %d", id, STR(name), size, flags);193 189 194 190 //3. Get a copy of data -
trunk/sources/thelib/src/mediaformats/mp3/mp3document.cpp
r10 r410 165 165 uint8_t version = (firstBytes[1] >> 3)&0x03; 166 166 uint8_t layer = (firstBytes[1] >> 1)&0x03; 167 //uint8_t protectBit = firstBytes[1]&0x01;168 167 uint8_t bitRateIndex = firstBytes[2] >> 4; 169 168 uint8_t sampleRateIndex = (firstBytes[2] >> 2)&0x03; … … 180 179 return false; 181 180 } 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]));185 181 186 182 //6. Compute the frame duration and save the frame start … … 203 199 ADD_VECTOR_END(_frames, frame); 204 200 } else { 205 // WARN("Invalid bytes: %02x %02x %02x %02x",206 // firstBytes[0], firstBytes[1], firstBytes[2], firstBytes[3]);207 201 break; 208 202 } 209 203 } 210 204 211 //FINEST("totalTime: %f", totalDuration);212 205 213 206 return true; … … 239 232 uint8_t version = (firstBytes[1] >> 3)&0x03; 240 233 uint8_t layer = (firstBytes[1] >> 1)&0x03; 241 //uint8_t protectBit = firstBytes[1]&0x01;242 234 uint8_t bitRateIndex = firstBytes[2] >> 4; 243 235 uint8_t sampleRateIndex = (firstBytes[2] >> 2)&0x03; … … 297 289 return false; 298 290 } 299 //FINEST("We have an ID3v%d.%d", majorVersion, minorVersion);300 291 301 292 //3. Instantiate the proper parser -
trunk/sources/thelib/src/mediaformats/mp4/atomavc1.cpp
r10 r410 51 51 return false; 52 52 } 53 //FINEST("_reserved: %u", _reserved);54 53 55 54 if (!ReadUInt16(_referenceIndex)) { … … 57 56 return false; 58 57 } 59 //FINEST("_referenceIndex: %u", _referenceIndex);60 58 61 59 if (!ReadUInt16(_qtVideoEncodingVersion)) { … … 63 61 return false; 64 62 } 65 //FINEST("_qtVideoEncodingVersion: %u", _qtVideoEncodingVersion);66 63 67 64 if (!ReadUInt16(_qtVideoEncodingRevisionLevel)) { … … 69 66 return false; 70 67 } 71 //FINEST("_qtVideoEncodingRevisionLevel: %u", _qtVideoEncodingRevisionLevel);72 68 73 69 if (!ReadUInt32(_qtVideoEncodingVendor)) { … … 75 71 return false; 76 72 } 77 //FINEST("_qtVideoEncodingVendor: %u", _qtVideoEncodingVendor);78 73 79 74 if (!ReadUInt32(_qtVideoTemporalQuality)) { … … 81 76 return false; 82 77 } 83 //FINEST("_qtVideoTemporalQuality: %u", _qtVideoTemporalQuality);84 78 85 79 if (!ReadUInt32(_qtVideoSpatialQuality)) { … … 87 81 return false; 88 82 } 89 //FINEST("_qtVideoSpatialQuality: %u", _qtVideoSpatialQuality);90 83 91 84 if (!ReadUInt32(_videoFramePixelSize)) { … … 93 86 return false; 94 87 } 95 //FINEST("_videoFramePixelSize: %u", _videoFramePixelSize);96 88 97 89 if (!ReadUInt32(_horizontalDpi)) { … … 99 91 return false; 100 92 } 101 //FINEST("_horizontalDpi: %u", _horizontalDpi);102 93 103 94 if (!ReadUInt32(_verticalDpi)) { … … 105 96 return false; 106 97 } 107 //FINEST("_verticalDpi: %u", _verticalDpi);108 98 109 99 if (!ReadUInt32(_qtVideoDataSize)) { … … 111 101 return false; 112 102 } 113 //FINEST("_qtVideoDataSize: %u", _qtVideoDataSize);114 103 115 104 if (!ReadUInt16(_videoFrameCount)) { … … 117 106 return false; 118 107 } 119 //FINEST("_videoFrameCount: %u", _videoFrameCount);120 108 121 109 if (!ReadUInt8(_videoEncoderNameLength)) { … … 123 111 return false; 124 112 } 125 //FINEST("_videoEncoderNameLength: %u", _videoEncoderNameLength);126 113 127 114 if (_videoEncoderNameLength < 31) … … 136 123 _videoEncoderName = string((char *) pTemp, _videoEncoderNameLength); 137 124 delete[] pTemp; 138 //FINEST("_videoEncoderName: %s", STR(_videoEncoderName));139 125 140 126 if (!ReadUInt16(_videoPixelDepth)) { … … 142 128 return false; 143 129 } 144 //FINEST("_videoPixelDepth: %u", _videoPixelDepth);145 130 146 131 if (!ReadUInt16(_qtVideoColorTableId)) { … … 148 133 return false; 149 134 } 150 //FINEST("_qtVideoColorTableId: %u", _qtVideoColorTableId);151 135 if (_qtVideoColorTableId != 0xffff) { 152 136 FATAL("_qtVideoColorTableId not supported yet"); -
trunk/sources/thelib/src/mediaformats/mp4/atomavcc.cpp
r10 r410 59 59 return false; 60 60 } 61 //FINEST("_configurationVersion: %d", _configurationVersion);62 61 63 62 if (!ReadUInt8(_profile)) { … … 65 64 return false; 66 65 } 67 //FINEST("_profile: %d", _profile);68 66 69 67 if (!ReadUInt8(_profileCompatibility)) { … … 71 69 return false; 72 70 } 73 //FINEST("_profileCompatibility: %d", _profileCompatibility);74 71 75 72 if (!ReadUInt8(_level)) { … … 77 74 return false; 78 75 } 79 //FINEST("_level: %d", _level);80 76 81 77 if (!ReadUInt8(_naluLengthSize)) { … … 84 80 } 85 81 _naluLengthSize = 1 + (_naluLengthSize & 0x03); 86 //FINEST("_naluLengthSize: %d", _naluLengthSize);87 82 88 83 if (!ReadUInt8(_seqCount)) { … … 91 86 } 92 87 _seqCount = _seqCount & 0x1f; 93 //FINEST("_seqCount: %d", _seqCount);94 88 95 89 for (uint8_t i = 0; i < _seqCount; i++) { … … 100 94 return false; 101 95 } 102 //FINEST("parameter.size: %d", parameter.size);103 96 104 97 if (parameter.size > 0) { … … 119 112 return false; 120 113 } 121 //FINEST("_picCount: %d", _picCount);122 114 123 115 for (uint8_t i = 0; i < _picCount; i++) { … … 128 120 return false; 129 121 } 130 //FINEST("parameter.size: %d", parameter.size);131 122 132 123 if (parameter.size > 0) { -
trunk/sources/thelib/src/mediaformats/mp4/atomco64.cpp
r10 r410 40 40 return false; 41 41 } 42 //FINEST("count: %u", count);43 42 44 43 for (uint32_t i = 0; i < count; i++) { … … 48 47 return false; 49 48 } 50 //FINEST("offset[%u]: %u", i, offset);51 49 ADD_VECTOR_END(_entries, offset); 52 50 } -
trunk/sources/thelib/src/mediaformats/mp4/atomctts.cpp
r10 r410 47 47 return false; 48 48 } 49 //FINEST("count: %u", count);50 49 51 50 for (uint32_t i = 0; i < count; i++) { … … 60 59 return false; 61 60 } 62 63 // FINEST("sampleCount[%u]: %u; sampleOffset[%u]: %u", i, 64 // entry.sampleCount, i, entry.sampleOffset); 65 61 66 62 ADD_VECTOR_END(_entries, entry); 67 63 } -
trunk/sources/thelib/src/mediaformats/mp4/atomdata.cpp
r10 r410 66 66 return result; 67 67 //TODO: for now, return null 68 //return Variant();69 68 } 70 69 default: … … 82 81 return false; 83 82 } 84 //FINEST("_type: %d", _type);85 83 86 84 //2. Read unknown 4 bytes … … 89 87 return false; 90 88 } 91 //FINEST("_unknown: %d", _unknown);92 89 93 90 switch (_type) { … … 99 96 return false; 100 97 } 101 //FINEST("String: %s", STR(_dataString));102 98 return true; 103 99 } -
trunk/sources/thelib/src/mediaformats/mp4/atomesds.cpp
r56 r410 239 239 #endif /* DEBUG_ESDS_ATOM */ 240 240 241 //NYIA;242 241 return SkipRead(false); 243 242 } -
trunk/sources/thelib/src/mediaformats/mp4/atomftyp.cpp
r10 r410 35 35 return false; 36 36 } 37 //FINEST("_majorBrand: %s(%u)", STR(U32TOS(_majorBrand)), _majorBrand);38 37 39 38 if (!ReadUInt32(_minorVersion, false)) { … … 41 40 return false; 42 41 } 43 //FINEST("_minorVersion: %s(%u)", STR(U32TOS(_minorVersion)), _minorVersion);44 42 45 43 for (uint64_t i = 16; i < _size; i += 4) { … … 50 48 } 51 49 ADD_VECTOR_END(_compatibleBrands, val); 52 //FINEST("_compatibleBrand: %s(%u)", STR(U32TOS(val)), val);53 50 } 54 51 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atomhdlr.cpp
r10 r410 43 43 return false; 44 44 } 45 //FINEST("_componentType: %u", _componentType);46 45 47 46 if (!ReadUInt32(_componentSubType)) { … … 49 48 return false; 50 49 } 51 // FINEST("_componentSubType: %s(%u)", STR(U32TOS(_componentSubType)),52 // _componentSubType);53 50 54 51 if (!ReadUInt32(_componentManufacturer)) { … … 56 53 return false; 57 54 } 58 //FINEST("_componentManufacturer: %u", _componentManufacturer);59 55 60 56 if (!ReadUInt32(_componentFlags)) { … … 62 58 return false; 63 59 } 64 //FINEST("_componentFlags: %u", _componentFlags);65 60 66 61 if (!ReadUInt32(_componentFlagsMask)) { … … 68 63 return false; 69 64 } 70 //FINEST("_componentFlagsMask: %u", _componentFlagsMask);71 65 72 66 if (!ReadString(_componentName, _size - 32)) { … … 74 68 return false; 75 69 } 76 //FINEST("_componentFlagsMask: %s", STR(_componentName));77 70 78 71 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atommdhd.cpp
r10 r410 48 48 return false; 49 49 } 50 //FINEST("_creationTime: %u", _creationTime);51 50 52 51 if (!ReadUInt32(_modificationTime)) { … … 54 53 return false; 55 54 } 56 //FINEST("_modificationTime: %u", _modificationTime);57 55 58 56 if (!ReadUInt32(_timeScale)) { … … 60 58 return false; 61 59 } 62 //FINEST("_timeScale: %u", _timeScale);63 60 64 61 if (!ReadUInt32(_duration)) { … … 66 63 return false; 67 64 } 68 //FINEST("_duration: %u", _duration);69 65 70 66 if (!ReadUInt16(_language)) { … … 72 68 return false; 73 69 } 74 //FINEST("_language: %u", _language);75 70 76 71 if (!ReadUInt16(_quality)) { … … 78 73 return false; 79 74 } 80 //FINEST("_quality: %u", _quality);81 75 82 76 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atommp4a.cpp
r10 r410 66 66 return false; 67 67 } 68 //FINEST("_dataReferenceIndex: %u", _dataReferenceIndex);69 68 70 69 if (!ReadUInt16(_innerVersion)) { … … 72 71 return false; 73 72 } 74 //FINEST("_innerVersion: %u", _innerVersion);75 73 76 74 if (!ReadUInt16(_revisionLevel)) { … … 78 76 return false; 79 77 } 80 //FINEST("_revisionLevel: %u", _revisionLevel);81 78 82 79 if (!ReadUInt32(_vendor)) { … … 84 81 return false; 85 82 } 86 //FINEST("_vendor: %u", _vendor);87 83 88 84 if (!ReadUInt16(_numberOfChannels)) { … … 90 86 return false; 91 87 } 92 //FINEST("_numberOfChannels: %u", _numberOfChannels);93 88 94 89 if (!ReadUInt16(_sampleSizeInBits)) { … … 96 91 return false; 97 92 } 98 //FINEST("_sampleSizeInBits: %u", _sampleSizeInBits);99 93 100 94 if (!ReadInt16(_compressionId)) { … … 102 96 return false; 103 97 } 104 //FINEST("_compressionId: %d", _compressionId);105 98 106 99 if (!ReadUInt16(_packetSize)) { … … 108 101 return false; 109 102 } 110 //FINEST("_packetSize: %u", _packetSize);111 103 112 104 if (!ReadUInt32(_sampleRate)) { … … 114 106 return false; 115 107 } 116 //FINEST("_sampleRate: 0x%08x", _sampleRate);117 108 118 109 if (_innerVersion == 0) { … … 125 116 return false; 126 117 } 127 //FINEST("_samplesPerPacket: %u", _samplesPerPacket);128 118 129 119 if (!ReadUInt32(_bytesPerPacket)) { … … 131 121 return false; 132 122 } 133 //FINEST("_bytesPerPacket: %u", _bytesPerPacket);134 123 135 124 if (!ReadUInt32(_bytesPerFrame)) { … … 137 126 return false; 138 127 } 139 //FINEST("_bytesPerFrame: %u", _bytesPerFrame);140 128 141 129 if (!ReadUInt32(_bytesPerSample)) { … … 143 131 return false; 144 132 } 145 //FINEST("_bytesPerSample: %u", _bytesPerSample);146 133 147 134 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atommvhd.cpp
r10 r410 48 48 return false; 49 49 } 50 //FINEST("_creationTime: %u", _creationTime);51 50 52 51 if (!ReadUInt32(_modificationTime)) { … … 54 53 return false; 55 54 } 56 //FINEST("_modificationTime: %u", _modificationTime);57 55 58 56 if (!ReadUInt32(_timeScale)) { … … 60 58 return false; 61 59 } 62 //FINEST("_timeScale: %u", _timeScale);63 60 64 61 if (!ReadUInt32(_duration)) { … … 66 63 return false; 67 64 } 68 //FINEST("_duration: %u", _duration);69 65 70 66 if (!ReadUInt32(_preferredRate)) { … … 72 68 return false; 73 69 } 74 //FINEST("_preferredRate: %u", _preferredRate);75 70 76 71 if (!ReadUInt16(_preferredVolume)) { … … 78 73 return false; 79 74 } 80 //FINEST("_preferredVolume: %u", _preferredVolume);81 75 82 76 if (!ReadArray(_reserved, 10)) { … … 84 78 return false; 85 79 } 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]);90 80 91 81 if (!ReadArray((uint8_t *) _matrixStructure, 36)) { … … 98 88 return false; 99 89 } 100 //FINEST("_previewTime: %u", _previewTime);101 90 102 91 if (!ReadUInt32(_previewDuration)) { … … 104 93 return false; 105 94 } 106 //FINEST("_previewDuration: %u", _previewDuration);107 95 108 96 if (!ReadUInt32(_posterTime)) { … … 110 98 return false; 111 99 } 112 //FINEST("_posterTime: %u", _posterTime);113 100 114 101 if (!ReadUInt32(_selectionTime)) { … … 116 103 return false; 117 104 } 118 //FINEST("_selectionTime: %u", _selectionTime);119 105 120 106 if (!ReadUInt32(_selectionDuration)) { … … 122 108 return false; 123 109 } 124 //FINEST("_selectionDuration: %u", _selectionDuration);125 110 126 111 if (!ReadUInt32(_currentTime)) { … … 128 113 return false; 129 114 } 130 //FINEST("_currentTime: %u", _currentTime);131 115 132 116 if (!ReadUInt32(_nextTrakId)) { … … 134 118 return false; 135 119 } 136 //FINEST("_nextTrakId: %u", _nextTrakId);137 120 138 121 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atomsmhd.cpp
r10 r410 35 35 return false; 36 36 } 37 //FINEST("_balance: %u", _balance);38 37 39 38 if (!ReadUInt16(_reserved)) { … … 41 40 return false; 42 41 } 43 //FINEST("_reserved: %u", _reserved);44 42 45 43 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atomstco.cpp
r10 r410 40 40 return false; 41 41 } 42 //FINEST("count: %u", count);43 42 44 43 for (uint32_t i = 0; i < count; i++) { … … 48 47 return false; 49 48 } 50 //FINEST("offset[%u]: %u", i, offset);51 49 ADD_VECTOR_END(_entries, offset); 52 50 } -
trunk/sources/thelib/src/mediaformats/mp4/atomstsc.cpp
r10 r410 63 63 return false; 64 64 } 65 //FINEST("count: %u", count);66 65 67 66 if (count == 0) … … 75 74 return false; 76 75 } 77 //FINEST("entry.firstChunk: %u", entry.firstChunk);78 76 79 77 if (!ReadUInt32(entry.samplesPerChunk)) { … … 81 79 return false; 82 80 } 83 //FINEST("entry.samplesPerChunk: %u", entry.samplesPerChunk);84 81 85 82 if (!ReadUInt32(entry.sampleDescriptionIndex)) { … … 87 84 return false; 88 85 } 89 //FINEST("entry.sampleDescriptionIndex: %u", entry.sampleDescriptionIndex);90 86 91 87 ADD_VECTOR_END(_stscEntries, entry); -
trunk/sources/thelib/src/mediaformats/mp4/atomstss.cpp
r10 r410 39 39 return false; 40 40 } 41 //FINEST("count: %u", count);42 41 43 42 for (uint32_t i = 0; i < count; i++) { … … 47 46 return false; 48 47 } 49 //FINEST("sampleNumber[%u]: %u", i, sampleNumber);50 48 51 49 ADD_VECTOR_END(_entries, sampleNumber); -
trunk/sources/thelib/src/mediaformats/mp4/atomstsz.cpp
r10 r410 38 38 return false; 39 39 } 40 //FINEST("_sampleSize: %u", _sampleSize);41 40 42 41 if (!ReadUInt32(_sampleCount)) { … … 44 43 return false; 45 44 } 46 //FINEST("_sampleCount: %u", _sampleCount);47 45 48 46 if (_sampleSize != 0) { … … 58 56 return false; 59 57 } 60 //FINEST("size[%u]: %u", i, size);61 58 ADD_VECTOR_END(_entries, size); 62 59 } -
trunk/sources/thelib/src/mediaformats/mp4/atomstts.cpp
r56 r410 46 46 return false; 47 47 } 48 //FINEST("entryCount: %d", entryCount);49 48 50 49 for (uint32_t i = 0; i < entryCount; i++) { … … 55 54 return false; 56 55 } 57 //FINEST("entry[%d].count: %d", i, entry.count);58 56 59 57 if (!ReadUInt32(entry.delta)) { … … 61 59 return false; 62 60 } 63 //FINEST("entry[%d].delta: %d", i, entry.delta);64 61 65 62 ADD_VECTOR_END(_sttsEntries, entry); -
trunk/sources/thelib/src/mediaformats/mp4/atomtkhd.cpp
r10 r410 54 54 return false; 55 55 } 56 //FINEST("_creationTime: %u", _creationTime);57 56 58 57 if (!ReadUInt32(_modificationTime)) { … … 60 59 return false; 61 60 } 62 //FINEST("_modificationTime: %u", _modificationTime);63 61 64 62 if (!ReadUInt32(_trackId)) { … … 66 64 return false; 67 65 } 68 //FINEST("_trackId: %u", _trackId);69 66 70 67 if (!ReadArray(_reserved1, 4)) { … … 77 74 return false; 78 75 } 79 //FINEST("_duration: %u", _duration);80 76 81 77 if (!ReadArray(_reserved2, 8)) { … … 88 84 return false; 89 85 } 90 //FINEST("_layer: %u", _layer);91 86 92 87 if (!ReadUInt16(_alternateGroup)) { … … 94 89 return false; 95 90 } 96 //FINEST("_alternateGroup: %u", _alternateGroup);97 91 98 92 if (!ReadUInt16(_volume)) { … … 100 94 return false; 101 95 } 102 //FINEST("_volume: %u", _volume);103 96 104 97 if (!ReadArray(_reserved3, 2)) { … … 116 109 return false; 117 110 } 118 //FINEST("_trackWidth: %u", _trackWidth);119 111 120 112 if (!ReadUInt32(_trackHeight)) { … … 122 114 return false; 123 115 } 124 //FINEST("_trackHeight: %u", _trackHeight);125 116 126 117 return true; -
trunk/sources/thelib/src/mediaformats/mp4/atomvmhd.cpp
r10 r410 35 35 return false; 36 36 } 37 //FINEST("_graphicsMode: %u", _graphicsMode);38 37 39 38 if (!ReadArray(_opcolor, 6)) { -
trunk/sources/thelib/src/mediaformats/mp4/atomwave.cpp
r10 r410 40 40 return true; 41 41 case 0://NULL atom 42 //WARN("Ignoring NULL atom");43 42 return true; 44 43 default: -
trunk/sources/thelib/src/mediaformats/mp4/baseatom.cpp
r168 r410 35 35 _size = size; 36 36 _start = start; 37 //FINEST("Atom created: %p", this);38 37 } 39 38 40 39 BaseAtom::~BaseAtom() { 41 //FINEST("Atom deleted: %p", this);42 40 } 43 41 -
trunk/sources/thelib/src/mediaformats/mp4/boxatom.cpp
r10 r410 40 40 } 41 41 if (!pAtom->IsIgnored()) { 42 //FINEST("pAtom: %p (%s)", pAtom, STR(pAtom->GetTypeString()));43 42 if (!AtomCreated(pAtom)) { 44 43 FATAL("Unable to signal AtomCreated for atom %s (%x)", … … 49 48 ADD_VECTOR_END(_subAtoms, pAtom); 50 49 } 51 // FINEST("Atom %s has %d subatoms", STR(GetTypeString()) ,52 // (uint32_t) _subAtoms.size());53 50 return true; 54 51 } … … 56 53 string BoxAtom::Hierarchy(uint32_t indent) { 57 54 string result = string(indent * 4, ' ') + GetTypeString() + "\n"; 58 //FINEST("%d %s", indent, STR(result));59 55 if (_subAtoms.size() == 0) { 60 56 result += string((indent + 1) * 4, ' ') + "[empty]"; … … 73 69 va_list arguments; 74 70 va_start(arguments, depth); 75 //string strPath = "";76 71 for (uint8_t i = 0; i < depth; i++) { 77 72 uint32_t pathElement = va_arg(arguments, uint32_t); 78 //strPath += format("%s->", STR(U32TOS(pathElement)));79 73 ADD_VECTOR_END(path, pathElement); 80 74 } 81 75 va_end(arguments); 82 //FINEST("Path: %s", STR(strPath));83 76 if (path.size() == 0) 84 77 return NULL; … … 93 86 path.erase(path.begin()); 94 87 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());100 88 if (_subAtoms[i]->GetTypeNumeric() == search) { 101 89 if (path.size() == 0) -
trunk/sources/thelib/src/mediaformats/mp4/mp4document.cpp
r391 r410 248 248 default: 249 249 { 250 // FATAL("Atom type %s(%u) not yet implemented. Position: 0x%x",251 // STR(U32TOS(type)), type, (uint32_t) _mediaFile.Cursor());252 // return NULL;253 250 pAtom = new IgnoredAtom(this, type, size, currentPos); 254 251 break; … … 262 259 return NULL; 263 260 } 264 265 // FINEST("END reading atom %s at 0x%x with size 0x%x",266 // STR(U32TOS(type)), currentPos, size);267 261 268 262 if (currentPos + pAtom->GetSize() != _mediaFile.Cursor()) { … … 367 361 audioHeader.start, audioHeader.length, audioHeader.length); 368 362 } 369 //ADD_VECTOR_BEGIN(_frames, audioHeader);370 363 371 364 //add binary video header … … 380 373 videoHeader.deltaTime = 0; 381 374 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);385 375 } 386 376 … … 492 482 INFO("audio: %d; keyFrames: %u; frames: %u; compositionOffsets: %u", 493 483 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 501 485 uint32_t timeScale = pMDHD->GetTimeScale(); 502 486 uint32_t totalTime = 0; … … 510 494 double doubleVal = ((double) compositionOffsets[i] / (double) timeScale)*(double) 1000.00; 511 495 frame.compositionOffset = (int32_t) doubleVal; 512 //FINEST("frame.compositionOffset: %08x", frame.compositionOffset);513 496 } else { 514 497 frame.compositionOffset = 0; … … 548 531 totalTime += sampleDeltaTime[i]; 549 532 550 //FINEST("Frame: %s", STR(frame));551 533 ADD_VECTOR_END(_frames, frame); 552 534 } -
trunk/sources/thelib/src/mediaformats/mp4/versionedatom.cpp
r10 r410 36 36 return false; 37 37 } 38 //FINEST("_version: %d", _version);39 38 40 39 if (!ReadArray(_flags, 3)) { … … 42 41 return false; 43 42 } 44 //FINEST("_flags: %02x %02x %02x", _flags[0], _flags[1], _flags[2]);45 43 46 44 return ReadData(); -
trunk/sources/thelib/src/mediaformats/mp4/versionedboxatom.cpp
r10 r410 36 36 return false; 37 37 } 38 //FINEST("_version: %d", _version);39 38 40 39 if (!ReadArray(_flags, 3)) { … … 42 41 return false; 43 42 } 44 //FINEST("_flags: %02x %02x %02x", _flags[0], _flags[1], _flags[2]);45 43 46 44 if (!ReadData()) { -
trunk/sources/thelib/src/mediaformats/nsv/mp3media.cpp
r372 r410 203 203 audioSamplesCount += samplesCount; 204 204 205 //FINEST("samplesCount : %d", samplesCount);206 //FINEST("sampleRate:%d", (_samplingRates[version][sampleRateIndex]));207 205 208 206 //8. All good. Save the frame 209 //ADD_VECTOR_END(_frames, frame);210 207 } 211 208 return true; -
trunk/sources/thelib/src/mediaformats/nsv/nsvdocument.cpp
r372 r410 74 74 75 75 if (marker_frame == 0x4e53) { 76 //FINEST("we got NS");77 76 if (!_mediaFile.PeekUI16(&marker_frame)) { 78 77 FATAL("Unable to peek byte"); … … 87 86 continue; 88 87 } 89 //FINEST("we got Vs");90 88 if (!_mediaFile.SeekAhead(2)) { 91 89 FATAL("Unable to seek ahead "); … … 100 98 } 101 99 102 // for (uint32_t i = 0; i < 50; i++) {103 // FINEST("Before:%s", STR(_frames[i]));104 // }105 100 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;110 101 111 102 //15. Add the binary headers 112 //FINEST("binary headers size : %d", binaryHeaders.size());113 103 for (uint32_t i = 0; i < binaryHeaders.size(); i++) { 114 104 assert(binaryHeaders[i].absoluteTime == 0); … … 122 112 123 113 bool NSVDocument::ParseNSVs() { 124 //FINEST("we got Vs reading header...");125 114 //6. get video format 126 115 uint32_t vidfmt = 0; 127 //FINEST(" reading video format");128 116 if (!_mediaFile.ReadUI32(&vidfmt)) { 129 117 FATAL("Unable to read video format "); … … 138 126 //7. get audio format 139 127 uint32_t audfmt = 0; 140 //FINEST(" reading audio format");141 128 if (!_mediaFile.ReadUI32(&audfmt)) { 142 129 FATAL("Unable to read audio format "); … … 151 138 //8. get video width 152 139 uint16_t vid_width = 0; 153 //FINEST(" reading video width ");154 140 if (!_mediaFile.ReadUI16(&vid_width, false)) { 155 141 FATAL("Unable to read video width "); 156 142 return false; 157 143 } 158 // FINEST("vid width : %d ", vid_width);159 144 160 145 //9 get video height 161 146 uint16_t vid_height = 0; 162 //FINEST(" reading video height ");163 147 if (!_mediaFile.ReadUI16(&vid_height, false)) { 164 148 FATAL("Unable to read video height "); 165 149 return false; 166 150 } 167 // FINEST("vid height : %d ", vid_height);168 151 169 152 // get framerate_idx and check from 170 153 // frame rate table 171 154 uint8_t framerate_idx = 0; 172 //FINEST(" reading frame rate index ");173 155 if (!_mediaFile.ReadUI8(&framerate_idx)) { 174 156 FATAL("Unable to read framerate idx "); 175 157 return false; 176 158 } 177 //FINEST(" video framerate idx : %d ", framerate_idx);178 159 _framerate = GetFrameRate(framerate_idx); 179 //FINEST("framerate: %d", _framerate);180 160 181 161 //10 get syncoffs 182 162 uint16_t syncoffs = 0; 183 //FINEST(" reading frame syncoffs ");184 163 if (!_mediaFile.ReadUI16(&syncoffs, false)) { 185 164 FATAL("Unable to read syncoffs "); 186 165 return false; 187 166 } 188 // FINEST(" syncoffs : %d ", syncoffs);189 167 190 168 return true; … … 198 176 199 177 //13. get the aux plus video len 200 //FINEST("reading payload data at offset %llx", _mediaFile.Cursor());201 178 if (!_mediaFile.ReadUI24(&aux_plus_vidlen, false)) { 202 179 FATAL("Unable to read aux_plus vid len data chuncks "); … … 206 183 num_aux = aux_plus_vidlen & 0x0f; 207 184 aux_plus_vidlen = aux_plus_vidlen >> 4; 208 //FINEST("num_aux: %d; aux_plus_vidlen: %d ", num_aux, aux_plus_vidlen);209 185 210 186 //14. audio len … … 216 192 uint32_t auxLength = 0; 217 193 if (num_aux > 0) { 218 // Variant Aux;219 // uint16_t aux_chunk_len;220 // if (!_mediaFile.)221 194 NYIA; 222 195 } 223 196 224 197 if (aux_plus_vidlen > 0) { 225 // FINEST("video data offset %llx", _mediaFile.Cursor());226 198 MediaFrame video_frame = {0}; 227 199 video_frame.type = MEDIAFRAME_TYPE_VIDEO; … … 317 289 318 290 void NSVDocument::GetAudioFrame() { 319 //FINEST("====================");320 291 321 292 uint8_t firstBytes[4]; … … 347 318 uint8_t *pBuffer = GETIBPOINTER(_buffer); 348 319 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);352 320 while (length != 0) { 353 321 MP3Media mp3; … … 384 352 video_frame.isBinaryHeader = true; 385 353 video_frame.isKeyFrame = false; 386 //FINEST("GOT SPS video data offset %x, len:%d", video_frame.start, video_frame.length);387 354 break; 388 355 … … 390 357 video_frame.isBinaryHeader = true; 391 358 video_frame.isKeyFrame = false; 392 //FINEST("GOT PPS video data offset %x, len:%d", video_frame.start, video_frame.length);393 359 break; 394 360 … … 396 362 video_frame.isBinaryHeader = false; 397 363 video_frame.isKeyFrame = true; 398 //FINEST("GOT IDR video data offset %x, len: %d", video_frame.start, video_frame.length);399 364 break; 400 365 } … … 418 383 *nal_end = 0; 419 384 420 //i = 0;421 385 while (//( next_bits( 24 ) != 0x000001 && next_bits( 32 ) != 0x00000001 ) 422 386 (buf[i] != 0 || buf[i + 1] != 0 || buf[i + 2] != 0x01) && -
trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp
r188 r410 221 221 while (_deadIOHandlers.size() > 0) { 222 222 IOHandler *pIOHandler = MAP_VAL(_deadIOHandlers.begin()); 223 //FINEST("Delete IOH %p", pIOHandler);224 223 _deadIOHandlers.erase(pIOHandler->GetId()); 225 224 delete pIOHandler; 226 225 result++; 227 //FINEST("Done delete IOH %p", pIOHandler);228 226 } 229 227 return result; … … 284 282 if (_pAvailableTokens->size() == 0) { 285 283 pResult = new IOHandlerManagerToken(); 286 //WARN("Token created: %p", pResult);287 284 } else { 288 285 pResult = (*_pAvailableTokens)[0]; 289 //WARN("Token %p served from %p", pResult, _pAvailableTokens);290 286 _pAvailableTokens->erase(_pAvailableTokens->begin()); 291 287 } … … 297 293 void IOHandlerManager::FreeToken(IOHandler *pIOHandler) { 298 294 IOHandlerManagerToken *pToken = pIOHandler->GetIOHandlerManagerToken(); 299 //FATAL("Token %p returned to %p", pToken, _pRecycledTokens);300 295 pIOHandler->SetIOHandlerManagerToken(NULL); 301 296 pToken->pPayload = NULL; -
trunk/sources/thelib/src/netio/epoll/iotimer.cpp
r193 r410 31 31 32 32 IOTimer::~IOTimer() { 33 //FINEST("Disable timer");34 33 IOHandlerManager::DisableTimer(this, true); 35 34 } -
trunk/sources/thelib/src/netio/epoll/stdiocarrier.cpp
r193 r410 67 67 68 68 bool StdioCarrier::OnEvent(struct epoll_event &event) { 69 //FINEST("Event: %d", event.events);70 69 71 70 //1. Read data … … 78 77 return false; 79 78 } 80 //FINEST("recvBytes: %d; _totalRecveivedBytes: %d", recvBytes, _totalRecveivedBytes);81 79 if (recvBytes == 0) { 82 80 FATAL("Connection closed"); -
trunk/sources/thelib/src/netio/epoll/tcpacceptor.cpp
r245 r410 34 34 : IOHandler(0, 0, IOHT_ACCEPTOR) { 35 35 _pApplication = NULL; 36 //assert((port > 1024 && port < 65535) || (port == 80));37 36 memset(&_address, 0, sizeof (sockaddr_in)); 38 37 -
trunk/sources/thelib/src/netio/epoll/tcpcarrier.cpp
r271 r410 54 54 _nearIp = ""; 55 55 _nearPort = 0; 56 //socklen_t sz = sizeof (int);57 56 _sendBufferSize = 1024; 58 // if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &_sendBufferSize, &sz) != 0) {59 // ASSERT("Unable to determine the send buffer size");60 // }61 57 _recvBufferSize = 1024 * 256; 62 // if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &_recvBufferSize, &sz) != 0) {63 // ASSERT("Unable to determine the recv buffer size");64 // }65 58 GetEndpointsInfo(); 66 59 _rx = 0; … … 73 66 74 67 bool TCPCarrier::OnEvent(struct epoll_event &event) { 75 //FINEST("Event: %d", event.events);76 68 int32_t readAmount = 0; 77 69 int32_t writeAmount = 0; … … 88 80 } 89 81 _rx += readAmount; 90 //FINEST("recvBytes: %d; _totalRecveivedBytes: %d", recvBytes, _totalRecveivedBytes);91 82 if (readAmount == 0) { 92 83 FATAL("Connection closed"); … … 205 196 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 206 197 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 207 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);208 198 return true; 209 199 } -
trunk/sources/thelib/src/netio/epoll/udpcarrier.cpp
r304 r410 43 43 44 44 bool UDPCarrier::OnEvent(struct epoll_event &event) { 45 //FINEST("Event: %d", event.events);46 45 47 46 //1. Read data … … 54 53 return false; 55 54 } 56 //FINEST("recvBytes: %d;", recvBytes);57 55 if (recvBytes == 0) { 58 56 FATAL("Connection closed"); … … 194 192 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 195 193 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 196 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);197 194 return true; 198 195 } -
trunk/sources/thelib/src/netio/kqueue/iohandler.cpp
r188 r410 36 36 37 37 IOHandler::~IOHandler() { 38 //FINEST("IOHandler %p is in destructor", this);39 38 if (_pProtocol != NULL) { 40 39 _pProtocol->SetIOHandler(NULL); -
trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp
r188 r410 45 45 if (_pAvailableTokens->size() == 0) { 46 46 pResult = new IOHandlerManagerToken(); 47 //WARN("Token created: %p", pResult);48 47 } else { 49 48 pResult = (*_pAvailableTokens)[0]; 50 //WARN("Token %p served from %p", pResult, _pAvailableTokens);51 49 _pAvailableTokens->erase(_pAvailableTokens->begin()); 52 50 } … … 58 56 void IOHandlerManager::FreeToken(IOHandler *pIOHandler) { 59 57 IOHandlerManagerToken *pToken = pIOHandler->GetIOHandlerManagerToken(); 60 //FATAL("Token %p returned to %p", pToken, _pRecycledTokens);61 58 pIOHandler->SetIOHandlerManagerToken(NULL); 62 59 pToken->pPayload = NULL; … … 187 184 188 185 bool IOHandlerManager::EnableAcceptConnections(IOHandler *pIOHandler) { 189 //FINEST("EnableAcceptConnections");190 186 return RegisterEvent(pIOHandler->GetInboundFd(), EVFILT_READ, 191 187 EV_ADD | EV_ENABLE, 0, 0, … … 201 197 bool IOHandlerManager::EnableTimer(IOHandler *pIOHandler, uint32_t seconds) { 202 198 #ifdef HAS_KQUEUE_TIMERS 203 //FINEST("Enable timer: %d", seconds);204 199 return RegisterEvent(pIOHandler->GetId(), EVFILT_TIMER, 205 200 EV_ADD | EV_ENABLE, NOTE_USECONDS, … … 239 234 while (_deadIOHandlers.size() > 0) { 240 235 IOHandler *pIOHandler = MAP_VAL(_deadIOHandlers.begin()); 241 //FINEST("Delete IOH %p", pIOHandler);242 236 _deadIOHandlers.erase(pIOHandler->GetId()); 243 237 delete pIOHandler; 244 238 result++; 245 //FINEST("Done delete IOH %p", pIOHandler);246 239 } 247 240 return result; -
trunk/sources/thelib/src/netio/kqueue/iotimer.cpp
r193 r410 31 31 32 32 IOTimer::~IOTimer() { 33 //FINEST("Disable timer");34 33 IOHandlerManager::DisableTimer(this, true); 35 34 } -
trunk/sources/thelib/src/netio/kqueue/stdiocarrier.cpp
r193 r410 93 93 94 94 while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 95 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer));96 95 if (!pOutputBuffer->WriteToStdio(event.ident, event.data)) { 97 96 FATAL("Unable to send data"); -
trunk/sources/thelib/src/netio/kqueue/tcpacceptor.cpp
r245 r410 31 31 : IOHandler(0, 0, IOHT_ACCEPTOR) { 32 32 _pApplication = NULL; 33 //assert((port > 1024 && port < 65535) || (port == 80));34 33 memset(&_address, 0, sizeof (sockaddr_in)); 35 34 -
trunk/sources/thelib/src/netio/kqueue/tcpcarrier.cpp
r271 r410 57 57 _rx = 0; 58 58 _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 // }63 59 } 64 60 65 61 TCPCarrier::~TCPCarrier() { 66 //FINEST("Delete tcp carrier %p", this);67 62 close(_inboundFd); 68 //FINEST("Done delete tcp carrier %p", this);69 63 } 70 64 … … 93 87 94 88 if ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 95 //uint32_t initial = GETAVAILABLEBYTESCOUNT(*pOutputBuffer);96 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer));97 89 if (!pOutputBuffer->WriteToTCPFd(event.ident, event.data, writeAmount)) { 98 90 FATAL("Unable to send data. %s:%d -> %s:%d", … … 106 98 DISABLE_WRITE_DATA; 107 99 } 108 // else {109 // FINEST("Advertised: %d; sent: %d; initial :%d; leftovers: %d;",110 // event.data,111 // writeAmount,112 // initial,113 // GETAVAILABLEBYTESCOUNT(*pOutputBuffer));114 // }115 100 } else { 116 101 DISABLE_WRITE_DATA; … … 208 193 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 209 194 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 210 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);211 195 return true; 212 196 } -
trunk/sources/thelib/src/netio/kqueue/udpcarrier.cpp
r302 r410 187 187 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 188 188 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 189 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);190 189 return true; 191 190 } -
trunk/sources/thelib/src/netio/select/iohandler.cpp
r190 r410 35 35 36 36 IOHandler::~IOHandler() { 37 //FINEST("IOHandler %p is in destructor", this);38 37 if (_pProtocol != NULL) { 39 38 _pProtocol->SetIOHandler(NULL); -
trunk/sources/thelib/src/netio/select/iohandlermanager.cpp
r190 r410 211 211 uint8_t state = 0; 212 212 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 224 213 FOR_MAP(_fdState[fd], uint32_t, uint8_t, i) { 225 214 state |= MAP_VAL(i); -
trunk/sources/thelib/src/netio/select/iotimer.cpp
r193 r410 31 31 32 32 IOTimer::~IOTimer() { 33 //FINEST("Disable timer");34 33 IOHandlerManager::DisableTimer(this); 35 34 } -
trunk/sources/thelib/src/netio/select/stdiocarrier.cpp
r193 r410 93 93 94 94 while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 95 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer));96 95 if (!pOutputBuffer->WriteToStdio(_outboundFd, 97 96 FD_WRITE_CHUNK)) { -
trunk/sources/thelib/src/netio/select/tcpacceptor.cpp
r245 r410 31 31 : IOHandler(0, 0, IOHT_ACCEPTOR) { 32 32 _pApplication = NULL; 33 //assert((port > 1024 && port < 65535) || (port == 80));34 33 memset(&_address, 0, sizeof (sockaddr_in)); 35 34 -
trunk/sources/thelib/src/netio/select/tcpcarrier.cpp
r271 r410 69 69 70 70 TCPCarrier::~TCPCarrier() { 71 //FINEST("Delete tcp carrier %p", this);72 71 CLOSE_SOCKET(_inboundFd); 73 //FINEST("Done delete tcp carrier %p", this);74 72 } 75 73 … … 99 97 100 98 while ((pOutputBuffer = _pProtocol->GetOutputBuffer()) != NULL) { 101 //FINEST("Try to send buffer:\n%s", STR(*pOutputBuffer));102 99 if (!pOutputBuffer->WriteToTCPFd(_outboundFd, 103 100 _sendBufferSize, writeAmount)) { … … 208 205 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 209 206 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 210 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);211 207 return true; 212 208 } -
trunk/sources/thelib/src/netio/select/udpcarrier.cpp
r304 r410 188 188 _nearIp = format("%s", inet_ntoa(((sockaddr_in *) & _nearAddress)->sin_addr)); 189 189 _nearPort = ENTOHS(((sockaddr_in *) & _nearAddress)->sin_port); //----MARKED-SHORT---- 190 //FINEST("_nearAddress: %s; _nearPort: %d", STR(_nearAddress), _nearPort);191 190 return true; 192 191 } -
trunk/sources/thelib/src/protocols/baseprotocol.cpp
r391 r410 175 175 176 176 BaseProtocol *BaseProtocol::GetFarEndpoint() { 177 //FINEST("GetFarEndpoint called from %s", STR(tagToString(_type)));178 177 if (_pFarProtocol == NULL) { 179 //FINEST("Hey! we are the far most protocol");180 178 return this; 181 179 } else { 182 //FINEST("We are not the far most protocol");183 180 return _pFarProtocol->GetFarEndpoint(); 184 181 } … … 386 383 387 384 //6. Trigger log to production 388 // FINEST("********** %s -> %s ********** %s", STR(oldAppName), STR(newAppName),389 // STR(*this));390 385 } 391 386 -
trunk/sources/thelib/src/protocols/cli/inboundjsoncliprotocol.cpp
r362 r410 33 33 bool InboundJSONCLIProtocol::Initialize(Variant ¶meters) { 34 34 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();37 35 if (parameters["useLengthPadding"] == V_BOOL) { 38 36 _useLengthPadding = (bool)parameters["useLengthPadding"]; … … 77 75 78 76 bool 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>";105 77 string json; 106 78 if (!message.SerializeToJSON(json)) { -
trunk/sources/thelib/src/protocols/dns/inbounddnsresolverprotocol.cpp
r387 r410 60 60 while (true) { 61 61 if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { 62 //FINEST("Not enough data");63 62 return true; 64 63 } -
trunk/sources/thelib/src/protocols/dns/outbounddnsresolverprotocol.cpp
r387 r410 146 146 while (true) { 147 147 if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { 148 //FINEST("Not enough data");149 148 return true; 150 149 } -
trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp
r313 r410 392 392 return false; 393 393 } 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));400 394 401 395 //9. Now, we know the chunk size... do we have enough data? … … 407 401 + 2 //the \r\n that follows the data chunk 408 402 ) { 409 // FINEST("Not enough data. Wanted: %d. Got: %d. Wait for more...",410 // chunkSizeString.size() //length of the chunk size string411 // - 2 //substract the 0x particle412 // + 2 //the \r\n that follows the chunk size string413 // + chunkSize //chunk size itself414 // + 2, //the \r\n that follows the data chunk415 // GETAVAILABLEBYTESCOUNT(buffer));416 403 return true; 417 404 } … … 438 425 //13. Ignore the bytes from the input buffer 439 426 buffer.Ignore(chunkSizeString.size() - 2 + 2 + chunkSize + 2); 440 //FINEST("AFTER buffer:\n%s", STR(buffer));441 427 442 428 //14. reset the state if necessary -
trunk/sources/thelib/src/protocols/http/inboundhttpprotocol.cpp
r276 r410 128 128 129 129 bool InboundHTTPProtocol::ParseFirstLine(string &line, Variant &headers) { 130 //FINEST("first line: %s", STR(line));131 130 132 131 vector<string> parts; … … 169 168 //2. Is realm/uri combination into authentication mode? 170 169 if (!auth["uris"].HasKey(_headers[HTTP_FIRST_LINE][HTTP_URL])) { 171 //WARN("No auth required");172 170 return true; 173 171 } -
trunk/sources/thelib/src/protocols/http/outboundhttpprotocol.cpp
r313 r410 100 100 101 101 bool OutboundHTTPProtocol::Authenticate() { 102 //WARN("No auth required");103 102 return true; 104 103 } -
trunk/sources/thelib/src/protocols/liveflv/inboundliveflvprotocol.cpp
r314 r410 82 82 if (!_headerParsed) { 83 83 if (GETAVAILABLEBYTESCOUNT(buffer) < 13) { 84 //FINEST("Not enough data");85 84 break; 86 85 } … … 91 90 //3. Read the frame header 92 91 if (GETAVAILABLEBYTESCOUNT(buffer) < 11) { 93 //FINEST("Not enough data");94 92 break; 95 93 } … … 106 104 } 107 105 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);110 106 111 107 //5. Do we have enough data? 15 bytes are the lead header and the trail length (11+4) 112 108 if (GETAVAILABLEBYTESCOUNT(buffer) < length + 15) { 113 //FINEST("Not enough data");114 109 return true; 115 110 } -
trunk/sources/thelib/src/protocols/protocolfactorymanager.cpp
r188 r410 84 84 85 85 bool ProtocolFactoryManager::UnRegisterProtocolFactory(BaseProtocolFactory *pFactory) { 86 //FINEST("BEFORE:\n%s", STR(Dump()));87 86 if (pFactory == NULL) { 88 87 WARN("pFactory is NULL"); … … 108 107 _factoriesById.erase(pFactory->GetId()); 109 108 110 //FINEST("AFTER:\n%s", STR(Dump()));111 109 return true; 112 110 } … … 165 163 } 166 164 167 //168 165 if (failed) { 169 166 if (pResult != NULL) -
trunk/sources/thelib/src/protocols/rtmfp/basertmfpprotocol.cpp
r296 r410 190 190 WARN("OUTPUT: \n%s", STR(IOBuffer::DumpBuffer(_outputBuffer.pCRC, chunkLength + 8 + padLen))); 191 191 Encrypt(pSession, _outputBuffer.pCRC, chunkLength + 8 + padLen); 192 //FINEST("AFTER: \n%s", STR(IOBuffer::DumpBuffer(_outputBuffer.pCRC, chunkLength + 8 + padLen)));193 192 194 193 //5. Compute the xor 195 194 EHTONLP(_outputBuffer.pXor_1, 196 195 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)));198 196 199 197 //8. Before actual we do the actual transfer, move the current session where it belongs (if necessary) … … 236 234 return; 237 235 } 238 //FINEST("crc: %04x", crc);239 236 240 237 //5. Read message type -
trunk/sources/thelib/src/protocols/rtmp/amf0serializer.cpp
r168 r410 123 123 } 124 124 125 126 //uint16_t length = (GETIBPOINTER(buffer)[0] << 8) | GETIBPOINTER(buffer)[1];127 125 AMF_CHECK_BOUNDARIES(buffer, 4); 128 126 uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- … … 185 183 buffer.ReadFromRepeat(AMF0_NUMBER, 1); 186 184 187 //uint64_t temp = HTOND(*(uint64_t *) & value);188 185 uint64_t temp = 0; 189 186 EHTOND(value, temp); … … 289 286 bool AMF0Serializer::ReadMixedArray(IOBuffer &buffer, Variant &variant, 290 287 bool readType) { 291 //FINEST("Buffer:\n%s", STR(buffer));292 288 if (readType) { 293 289 AMF_CHECK_BOUNDARIES(buffer, 1); … … 306 302 AMF_CHECK_BOUNDARIES(buffer, 4); 307 303 uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 308 //FINEST("Detected mixed array length: %d",length);309 304 if (!buffer.Ignore(4)) { 310 305 FATAL("Unable to ignore 4 bytes"); … … 353 348 variant.IsArray(true); 354 349 355 //FINEST("Variant:\n%s", STR(variant.ToString()));356 350 357 351 return true; … … 405 399 406 400 bool AMF0Serializer::ReadArray(IOBuffer &buffer, Variant &variant, bool readType) { 407 //FINEST("Buffer:\n%s", STR(buffer));408 401 409 402 if (readType) { … … 423 416 AMF_CHECK_BOUNDARIES(buffer, 4); 424 417 uint32_t length = ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 425 //FINEST("Detected array length: %d", length);426 418 if (!buffer.Ignore(4)) { 427 419 FATAL("Unable to ignore 4 bytes"); … … 440 432 variant.IsArray(true); 441 433 442 //FINEST("Variant:\n%s", STR(variant.ToString()));443 434 444 435 return true; … … 816 807 817 808 bool 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 // }827 809 return false; 828 810 } -
trunk/sources/thelib/src/protocols/rtmp/amf3serializer.cpp
r168 r410 148 148 case V_INT16: 149 149 case V_INT32: 150 // {151 // uint32_t temp = (uint32_t) variant;152 // temp &= 0x1FFFFFFF;153 // return WriteInteger(buffer, temp);154 // }155 150 case V_UINT8: 156 151 case V_UINT16: 157 152 case V_UINT32: 158 // {159 // return WriteInteger(buffer, variant);160 // }161 153 case V_UINT64: 162 154 case V_INT64: … … 266 258 WRITE_AMF3_TYPE(AMF3_DOUBLE); 267 259 268 //uint64_t u64Val = HTOND(*((uint64_t *) & value));269 260 uint64_t u64Val = 0; 270 261 EHTOND(value, u64Val); … … 395 386 return false; 396 387 } 397 //FINEST("key: %s", STR(key));398 388 if (key == "") 399 389 break; … … 630 620 bool AMF3Serializer::WriteObject(IOBuffer &buffer, Variant &variant, bool writeType) { 631 621 WRITE_AMF3_TYPE(AMF3_OBJECT); 632 //(variant.MapSize() << 4) |633 622 if (!WriteU29(buffer, 0x0b)) { 634 623 FATAL("Unable to save the traits count"); -
trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp
r389 r410 209 209 bool BaseRTMPAppProtocolHandler::InboundMessageAvailable(BaseRTMPProtocol *pFrom, 210 210 Variant &request) { 211 //FINEST("request:\n%s", STR(request.ToString()));212 211 213 212 //1. Perform authentication … … 373 372 bool BaseRTMPAppProtocolHandler::ProcessPeerBW(BaseRTMPProtocol *pFrom, 374 373 Variant &request) { 375 //WARN("ProcessPeerBW:\n%s", STR(request.ToString()));376 374 WARN("ProcessPeerBW"); 377 375 return true; … … 380 378 bool BaseRTMPAppProtocolHandler::ProcessAck(BaseRTMPProtocol *pFrom, 381 379 Variant &request) { 382 //WARN("ProcessAck:\n%s", STR(request.ToString()));383 380 return true; 384 381 } … … 408 405 case RM_USRCTRL_TYPE_PING_REQUEST: 409 406 { 410 //FINEST("request:\n%s", STR(request.ToString()));411 407 Variant response = ConnectionMessageFactory::GetPong(); 412 //ASSERT("response:\n%s", STR(response.ToString()));413 408 return SendRTMPMessage(pFrom, response); 414 409 } … … 424 419 case RM_USRCTRL_TYPE_UNKNOWN2: 425 420 { 426 //WARN("User control message type: %s", STR(M_USRCTRL_TYPE_STRING(request)));427 421 return true; 428 422 } … … 437 431 bool BaseRTMPAppProtocolHandler::ProcessNotify(BaseRTMPProtocol *pFrom, 438 432 Variant &request) { 439 //FINEST("request:\n%s", STR(request.ToString()));440 433 //1. Find the corresponding inbound stream 441 434 InNetRTMPStream *pInNetRTMPStream = NULL; … … 478 471 bool BaseRTMPAppProtocolHandler::ProcessFlexStreamSend(BaseRTMPProtocol *pFrom, 479 472 Variant &request) { 480 //FINEST("request:\n%s", STR(request.ToString()));481 473 482 474 //1. Find the corresponding inbound stream … … 525 517 bool BaseRTMPAppProtocolHandler::ProcessInvoke(BaseRTMPProtocol *pFrom, 526 518 Variant &request) { 527 //FINEST("Request:\n%s", STR(request.ToString()));528 519 529 520 string functionName = request[RM_INVOKE][RM_INVOKE_FUNCTION]; … … 567 558 bool BaseRTMPAppProtocolHandler::ProcessInvokeConnect(BaseRTMPProtocol *pFrom, 568 559 Variant & request) { 569 //FINEST("\n%s", STR(request.ToString()));570 560 //1. Send the channel specific messages 571 561 Variant response = GenericMessageFactory::GetWinAckSize(2500000); … … 975 965 } 976 966 977 //pProtocol->978 979 967 //6. Get our hands on streaming parameters 980 968 string path = ""; … … 1071 1059 bool BaseRTMPAppProtocolHandler::ProcessInvokeGetStreamLength(BaseRTMPProtocol *pFrom, 1072 1060 Variant & request) { 1073 //FINEST("Request:\n%s", STR(request.ToString()));1074 1061 Variant metadata = GetMetaData(M_INVOKE_PARAM(request, 1), true); 1075 1062 Variant params; … … 1091 1078 bool BaseRTMPAppProtocolHandler::ProcessInvokeOnBWDone(BaseRTMPProtocol *pFrom, 1092 1079 Variant &request) { 1093 //WARN("ProcessInvokeOnBWDone:\n%s", STR(request.ToString()));1094 1080 WARN("ProcessInvokeOnBWDone"); 1095 1081 return true; … … 1321 1307 bool BaseRTMPAppProtocolHandler::AuthenticateInboundAdobe(BaseRTMPProtocol *pFrom, 1322 1308 Variant & request, Variant &authState) { 1323 1324 // FINEST("_configuration:\n%s", STR(_configuration.ToString()));1325 // FINEST("request:\n%s", STR(request.ToString()));1326 1327 1309 if (!authState.HasKey("stage")) 1328 1310 authState["stage"] = "inProgress"; 1329 //FINEST("authState:\n%s", STR(authState.ToString()));1330 1311 1331 1312 if (authState["stage"] == "authenticated") { … … 1390 1371 } 1391 1372 string appUrl = (string) connectParams[RM_INVOKE_PARAMS_CONNECT_APP]; 1392 //FINEST("appUrl: %s", STR(appUrl));1393 1373 1394 1374 //8. Split the URI into parts … … 1407 1387 return false; 1408 1388 } 1409 //FINEST("response:\n%s", STR(response.ToString()));1410 1389 1411 1390 response = ConnectionMessageFactory::GetInvokeClose(); … … 1414 1393 return false; 1415 1394 } 1416 //FINEST("response:\n%s", STR(response.ToString()));1417 1395 1418 1396 pFrom->GracefullyEnqueueForDelete(); … … 1429 1407 return true; 1430 1408 } 1431 1432 // FOR_MAP(params, string, string, i) {1433 // FINEST("%s: `%s`", STR(MAP_KEY(i)), STR(MAP_VAL(i)));1434 // }1435 1409 1436 1410 string user = params["user"]; … … 1446 1420 WARN("No such user: `%s`", STR(user)); 1447 1421 Variant response = ConnectionMessageFactory::GetInvokeConnectError(request, 1448 //"[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=nosuchuser&opaque=nQoAAA==");1449 1422 "[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed&opaque=vgoAAA=="); 1450 1423 if (!pFrom->SendMessage(response)) { … … 1452 1425 return false; 1453 1426 } 1454 //FINEST("response:\n%s", STR(response.ToString()));1455 1427 1456 1428 response = ConnectionMessageFactory::GetInvokeClose(); … … 1459 1431 return false; 1460 1432 } 1461 //FINEST("response:\n%s", STR(response.ToString()));1462 1433 1463 1434 pFrom->GracefullyEnqueueForDelete(); … … 1478 1449 } else { 1479 1450 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));1482 1451 Variant response = ConnectionMessageFactory::GetInvokeConnectError(request, 1483 1452 "[ AccessManager.Reject ] : [ authmod=adobe ] : ?reason=authfailed&opaque=vgoAAA=="); … … 1486 1455 return false; 1487 1456 } 1488 //FINEST("response:\n%s", STR(response.ToString()));1489 1457 1490 1458 response = ConnectionMessageFactory::GetInvokeClose(); … … 1493 1461 return false; 1494 1462 } 1495 //FINEST("response:\n%s", STR(response.ToString()));1496 1463 1497 1464 pFrom->GracefullyEnqueueForDelete(); … … 1511 1478 return false; 1512 1479 } 1513 //FINEST("response:\n%s", STR(response.ToString()));1514 1480 1515 1481 response = ConnectionMessageFactory::GetInvokeClose(); … … 1518 1484 return false; 1519 1485 } 1520 //FINEST("response:\n%s", STR(response.ToString()));1521 1486 1522 1487 pFrom->GracefullyEnqueueForDelete(); … … 1618 1583 1619 1584 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 1626 1586 if (!result.HasKey(META_SERVER_FULL_PATH)) 1627 1587 result[META_SERVER_FULL_PATH] = ""; … … 1681 1641 } 1682 1642 M_INVOKE_ID(message) = invokeId; 1683 // FINEST("PID: %d; IID: %d", pTo->GetId(), invokeId);1684 1643 if (trackResponse) 1685 1644 _resultMessageTracking[pTo->GetId()][invokeId] = message; … … 1713 1672 split(streamName, "?", parts); 1714 1673 string shortName = parts[0]; 1715 //FINEST("short name: `%s`; long name: `%s`", STR(shortName), STR(streamName));1716 1674 1717 1675 //2. Search for the long version first … … 1851 1809 bool BaseRTMPAppProtocolHandler::ConnectForPullPush(BaseRTMPProtocol *pFrom, 1852 1810 string uriPath, Variant &streamConfig) { 1853 //FINEST("streamConfig:\n%s", STR(streamConfig.ToString()));1854 1811 URI uri; 1855 1812 if (!URI::FromVariant(streamConfig[uriPath], uri)) { -
trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp
r318 r410 144 144 if (_handshakeCompleted) { 145 145 result = ProcessBytes(buffer); 146 //FINEST("Bytes were processed in %d clocks", end - start);147 146 uint32_t decodedBytes = GetDecodedBytesCount(); 148 147 if (result && decodedBytes >= _nextReceivedBytesCountReport) { 149 148 Variant _bytesReadMessage = GenericMessageFactory::GetAck(decodedBytes); 150 149 _nextReceivedBytesCountReport += _winAckSize; 151 //FINEST("BR\n%s", STR(_bytesReadMessage.ToString()));152 150 if (!SendMessage(_bytesReadMessage)) { 153 151 FATAL("Unable to send\n%s", STR(_bytesReadMessage.ToString())); … … 215 213 216 214 bool BaseRTMPProtocol::SendMessage(Variant & message) { 217 // //1. Test the ability to further send data218 // 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 225 215 //2. Send the message 226 216 if (!_rtmpProtocolSerializer.Serialize(_channels[(uint32_t) VH_CI(message)], … … 277 267 278 268 void BaseRTMPProtocol::TrySetOutboundChunkSize(uint32_t chunkSize) { 279 // WARN("Try to set outbound Chunk size for RTMP connection %p: %d->%d", this,280 // _outboundChunkSize, chunkSize);281 269 if (_outboundChunkSize >= chunkSize) { 282 // WARN("The chunk size will remain the same.");283 270 return; 284 271 } … … 303 290 304 291 bool BaseRTMPProtocol::CloseStream(uint32_t streamId, bool createNeutralStream) { 305 //FINEST("-----bool BaseRTMPProtocol::CloseStream: %d", streamId);306 292 //1. Validate request 307 293 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { … … 348 334 GetApplication()->GetStreamsManager(), streamId); 349 335 } 350 //FINEST("Stream %d closed", streamId);351 336 352 337 return true; … … 354 339 355 340 RTMPStream * BaseRTMPProtocol::CreateNeutralStream(uint32_t & streamId) { 356 //FINEST("-----bool BaseRTMPProtocol::CreateNeutralStream: %d", streamId);357 341 if (streamId == 0) { 358 342 //Automatic allocation … … 387 371 InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, 388 372 uint32_t streamId, string streamName) { 389 //FINEST("-----bool BaseRTMPProtocol::CreateNIS: %d", streamId);390 373 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 391 374 FATAL("Invalid stream id: %d", streamId); … … 417 400 BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, 418 401 string streamName, uint64_t inStreamType) { 419 //FINEST("-----bool BaseRTMPProtocol::CreateNOS: %d", streamId);420 402 if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 421 403 FATAL("Invalid stream id: %d", streamId); … … 452 434 453 435 void BaseRTMPProtocol::SignalONS(BaseOutNetRTMPStream *pONS) { 454 // FINEST("-----Stream %d from protocol %d was marked as signal-able",455 // GetId(), pNOS->GetId());456 436 LinkedListNode<BaseOutNetRTMPStream *> *pTemp = _pSignaledRTMPOutNetStream; 457 437 while (pTemp != NULL) { 458 438 if (pTemp->info == pONS) { 459 //WARN("Already marked for signaling");460 439 return; 461 440 } … … 467 446 468 447 InFileRTMPStream * BaseRTMPProtocol::CreateIFS(Variant &metadata) { 469 //FINEST("-----bool BaseRTMPProtocol::CreateFIS:\n%s", STR(metadata.ToString()));470 448 InFileRTMPStream *pRTMPInFileStream = InFileRTMPStream::GetInstance( 471 449 this, GetApplication()->GetStreamsManager(), metadata); … … 485 463 486 464 void BaseRTMPProtocol::RemoveIFS(InFileRTMPStream *pIFS) { 487 //FINEST("-----Remove FIS: %p", pIFS);488 465 _inFileStreams.erase(pIFS); 489 466 delete pIFS; … … 595 572 uint32_t availableBytesCount = GETAVAILABLEBYTESCOUNT(buffer); 596 573 if (_selectedChannel < 0) { 597 //FINEST("availableBytesCount: %d",availableBytesCount);598 574 if (availableBytesCount < 1) { 599 //FINEST("Not enough data");600 575 return true; 601 576 } else { … … 647 622 } else { 648 623 if (header.readCompleted) { 649 //FINEST("Header:%s", STR(header));650 624 channel.state = CS_PAYLOAD; 651 625 switch (channel.lastInHeaderType) { … … 659 633 case HT_CONTINUATION: 660 634 if (channel.lastInProcBytes == 0) { 661 //FINEST("Time adjusted on channel %d", channel.id);662 635 channel.lastInAbsTs += H_TS(header); 663 636 } … … 665 638 } 666 639 } else { 667 //FINEST("Not enough data");668 640 return true; 669 641 } … … 673 645 if (channel.state == CS_PAYLOAD) { 674 646 uint32_t tempSize = H_ML(header) - channel.lastInProcBytes; 675 //FINEST("Expected: %d", tempSize);676 647 tempSize = (tempSize >= _inboundChunkSize) ? _inboundChunkSize : tempSize; 677 //FINEST("Chunked: %d", tempSize);678 648 uint32_t availableBytes = GETAVAILABLEBYTESCOUNT(buffer); 679 649 switch (H_MT(header)) { 680 650 case RM_HEADER_MESSAGETYPE_VIDEODATA: 681 651 { 682 //FINEST("V: tempSize: %d; availableBytes: %d; totalRequired: %d",683 // tempSize, availableBytes, header.messageLength);684 652 if (tempSize <= availableBytes) { 685 //FINEST("V: Enough data");686 653 channel.state = CS_HEADER; 687 654 _selectedChannel = -1; … … 711 678 712 679 channel.lastInProcBytes += tempSize; 713 //FINEST("V: processedBytes: %d", channel.processedBytes);714 680 if (H_ML(header) == channel.lastInProcBytes) { 715 //FINEST("V: %d Message completed: %d",716 // GetId(),717 // header.messageLength);718 681 channel.lastInProcBytes = 0; 719 682 } … … 724 687 break; 725 688 } else { 726 //FINEST("V: Not enough data. Available: %d; Wanted: %d",727 // availableBytes, tempSize);728 689 return true; 729 690 } … … 731 692 case RM_HEADER_MESSAGETYPE_AUDIODATA: 732 693 { 733 //FINEST("A: tempSize: %d; availableBytes: %d; totalRequired: %d",734 // tempSize, availableBytes, header.messageLength);735 694 if (tempSize <= availableBytes) { 736 //FINEST("A: Enough data");737 695 channel.state = CS_HEADER; 738 696 _selectedChannel = -1; … … 760 718 761 719 channel.lastInProcBytes += tempSize; 762 //FINEST("A: processedBytes: %d", channel.processedBytes);763 720 if (H_ML(header) == channel.lastInProcBytes) { 764 //FINEST("A: %d Message completed: %d",765 // GetId(),766 // header.messageLength);767 721 channel.lastInProcBytes = 0; 768 722 } … … 773 727 break; 774 728 } else { 775 //FINEST("A: Not enough data. Available: %d; Wanted: %d",776 // availableBytes, tempSize);777 729 return true; 778 730 } … … 795 747 return false; 796 748 } 797 //FINEST("Buffer:\n%s", STR(channel.buffer));798 749 if (!_pProtocolHandler->InboundMessageAvailable(this, header, channel.inputData)) { 799 750 FATAL("Unable to send rtmp message to application"); … … 808 759 } 809 760 } else { 810 //FINEST("Channel buffer length: %d", channel.buffer.GetAvailableBytesCount());811 761 } 812 762 break; 813 763 } else { 814 // FINEST("I: Not enough data. Available: %d; Wanted: %d",815 // availableBytes, tempSize);816 764 return true; 817 765 } -
trunk/sources/thelib/src/protocols/rtmp/header_be_ba.cpp
r278 r410 186 186 187 187 bool Header::Write(Channel &channel, IOBuffer &buffer) { 188 //FINEST("this: %p", this);189 188 //1. Compute the header size 190 189 if (channel.lastOutStreamId == H_SI(*this)) { 191 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id);192 190 if (H_IA(*this)) { 193 //FINEST("This is absolute ts.");194 191 if (channel.lastOutProcBytes == 0) { 195 //FINEST("This is the beginning of a packet");196 192 H_HT(*this) = HT_FULL; 197 193 channel.lastOutAbsTs = H_TS(*this); 198 194 } else { 199 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);200 195 H_HT(*this) = HT_CONTINUATION; 201 196 } 202 197 } else { 203 //FINEST("This is relative ts.");204 198 if (channel.lastOutProcBytes == 0) { 205 //FINEST("This is the beginning of a packet");206 199 H_HT(*this) = HT_SAME_STREAM; 207 200 if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 208 201 (H_ML(*this) == H_ML(channel.lastOutHeader))) { 209 //FINEST("Same stream and same length and type");210 202 H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 211 203 if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 212 //FINEST("Exactly the same header");213 204 H_HT(*this) = HT_CONTINUATION; 214 205 } … … 216 207 channel.lastOutAbsTs += H_TS(*this); 217 208 } else { 218 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);219 209 H_HT(*this) = HT_CONTINUATION; 220 210 } 221 211 } 222 212 } else { 223 // FINEST("Different stream on channel %d: channel: %d; header: %d",224 // channel.id, channel.lastOutStreamId, H_SI(*this));225 213 H_HT(*this) = HT_FULL; 226 214 H_IA(*this) = true; … … 232 220 channel.lastOutHeader = *this; 233 221 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 239 222 //3. do the write 240 223 return Write(buffer); … … 242 225 243 226 bool Header::Write(IOBuffer &buffer) { 244 //FINEST("header: %s", STR(*this));245 227 if (ci < 64) { 246 228 buffer.ReadFromByte((ht << 6) | ci); … … 268 250 hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 269 251 H_SI(*this) = ntosi(H_SI(*this)); 270 //FINEST("Output buffer: %s", STR(buffer));271 252 return true; 272 253 } else { … … 280 261 H_SI(*this) = ntosi(H_SI(*this)); 281 262 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 282 //FINEST("Output buffer: %s", STR(buffer));283 263 return true; 284 264 } … … 292 272 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 293 273 hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 294 //FINEST("Output buffer: %s", STR(buffer));295 274 return true; 296 275 } else { … … 302 281 hf.s.ml = ENTOHL(hf.s.ml); //----MARKED-LONG--- 303 282 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 304 //FINEST("Output buffer: %s", STR(buffer));305 283 return true; 306 284 } … … 312 290 buffer.ReadFromBuffer(&hf.datac[1], 3); 313 291 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 314 //FINEST("Output buffer: %s", STR(buffer));315 292 return true; 316 293 } else { … … 320 297 hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 321 298 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 322 //FINEST("Output buffer: %s", STR(buffer));323 299 return true; 324 300 } -
trunk/sources/thelib/src/protocols/rtmp/header_le_ba.cpp
r278 r410 178 178 179 179 bool Header::Write(Channel &channel, IOBuffer &buffer) { 180 //FINEST("this: %p", this);181 180 //1. Compute the header size 182 181 if (channel.lastOutStreamId == H_SI(*this)) { 183 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id);184 182 if (H_IA(*this)) { 185 //FINEST("This is absolute ts.");186 183 if (channel.lastOutProcBytes == 0) { 187 //FINEST("This is the beginning of a packet");188 184 H_HT(*this) = HT_FULL; 189 185 channel.lastOutAbsTs = H_TS(*this); 190 186 } else { 191 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);192 187 H_HT(*this) = HT_CONTINUATION; 193 188 } 194 189 } else { 195 //FINEST("This is relative ts.");196 190 if (channel.lastOutProcBytes == 0) { 197 //FINEST("This is the beginning of a packet");198 191 H_HT(*this) = HT_SAME_STREAM; 199 192 if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 200 193 (H_ML(*this) == H_ML(channel.lastOutHeader))) { 201 //FINEST("Same stream and same length and type");202 194 H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 203 195 if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 204 //FINEST("Exactly the same header");205 196 H_HT(*this) = HT_CONTINUATION; 206 197 } … … 208 199 channel.lastOutAbsTs += H_TS(*this); 209 200 } else { 210 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);211 201 H_HT(*this) = HT_CONTINUATION; 212 202 } 213 203 } 214 204 } else { 215 // FINEST("Different stream on channel %d: channel: %d; header: %d",216 // channel.id, channel.lastOutStreamId, H_SI(*this));217 205 H_HT(*this) = HT_FULL; 218 206 H_IA(*this) = true; … … 224 212 channel.lastOutHeader = *this; 225 213 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 231 214 //3. do the write 232 215 return Write(buffer); … … 234 217 235 218 bool Header::Write(IOBuffer &buffer) { 236 //FINEST("header: %s", STR(*this));237 219 if (ci < 64) { 238 220 buffer.ReadFromByte((ht << 6) | ((uint8_t) ci)); … … 258 240 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 259 241 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 260 //FINEST("Output buffer: %s", STR(buffer));261 242 return true; 262 243 } else { … … 268 249 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 269 250 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 270 //FINEST("Output buffer: %s", STR(buffer));271 251 return true; 272 252 } … … 280 260 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 281 261 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 282 //FINEST("Output buffer: %s", STR(buffer));283 262 return true; 284 263 } else { … … 290 269 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 291 270 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 292 //FINEST("Output buffer: %s", STR(buffer));293 271 return true; 294 272 } … … 300 278 buffer.ReadFromBuffer(&hf.datac[1], 3); 301 279 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 302 //FINEST("Output buffer: %s", STR(buffer));303 280 return true; 304 281 } else { … … 308 285 hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 309 286 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 310 //FINEST("Output buffer: %s", STR(buffer));311 287 return true; 312 288 } -
trunk/sources/thelib/src/protocols/rtmp/header_le_sa.cpp
r278 r410 178 178 179 179 bool Header::Write(Channel &channel, IOBuffer &buffer) { 180 //FINEST("this: %p", this);181 180 //1. Compute the header size 182 181 if (channel.lastOutStreamId == H_SI(*this)) { 183 //FINEST("Same stream %d on channel %d", channel.lastOutStreamId, channel.id);184 182 if (H_IA(*this)) { 185 //FINEST("This is absolute ts.");186 183 if (channel.lastOutProcBytes == 0) { 187 //FINEST("This is the beginning of a packet");188 184 H_HT(*this) = HT_FULL; 189 185 channel.lastOutAbsTs = H_TS(*this); 190 186 } else { 191 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);192 187 H_HT(*this) = HT_CONTINUATION; 193 188 } 194 189 } else { 195 //FINEST("This is relative ts.");196 190 if (channel.lastOutProcBytes == 0) { 197 //FINEST("This is the beginning of a packet");198 191 H_HT(*this) = HT_SAME_STREAM; 199 192 if ((H_MT(*this) == H_MT(channel.lastOutHeader)) && 200 193 (H_ML(*this) == H_ML(channel.lastOutHeader))) { 201 //FINEST("Same stream and same length and type");202 194 H_HT(*this) = HT_SAME_LENGTH_AND_STREAM; 203 195 if (H_TS(*this) == H_TS(channel.lastOutHeader)) { 204 //FINEST("Exactly the same header");205 196 H_HT(*this) = HT_CONTINUATION; 206 197 } … … 208 199 channel.lastOutAbsTs += H_TS(*this); 209 200 } else { 210 //FINEST("We are in the middle of the packet: %d", channel.lastOutProcBytes);211 201 H_HT(*this) = HT_CONTINUATION; 212 202 } 213 203 } 214 204 } else { 215 // FINEST("Different stream on channel %d: channel: %d; header: %d",216 // channel.id, channel.lastOutStreamId, H_SI(*this));217 205 H_HT(*this) = HT_FULL; 218 206 H_IA(*this) = true; … … 224 212 channel.lastOutHeader = *this; 225 213 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 231 214 //3. do the write 232 215 return Write(buffer); … … 234 217 235 218 bool Header::Write(IOBuffer &buffer) { 236 //FINEST("header: %s", STR(*this));237 219 if (ci < 64) { 238 220 buffer.ReadFromByte((ht << 6) | ci); … … 258 240 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 259 241 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 260 //FINEST("Output buffer: %s", STR(buffer));261 242 return true; 262 243 } else { … … 268 249 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 269 250 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 270 //FINEST("Output buffer: %s", STR(buffer));271 251 return true; 272 252 } … … 280 260 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 281 261 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 282 //FINEST("Output buffer: %s", STR(buffer));283 262 return true; 284 263 } else { … … 290 269 hf.s.ml = ENTOHL(hf.s.ml) >> 8; //----MARKED-LONG--- 291 270 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 292 //FINEST("Output buffer: %s", STR(buffer));293 271 return true; 294 272 } … … 300 278 buffer.ReadFromBuffer(&hf.datac[1], 3); 301 279 hf.s.ts = ENTOHL(hf.s.ts); //----MARKED-LONG--- 302 //FINEST("Output buffer: %s", STR(buffer));303 280 return true; 304 281 } else { … … 308 285 hf.s.ts = ENTOHL(temp); //----MARKED-LONG--- 309 286 buffer.ReadFromBuffer((uint8_t *) & temp, 4); 310 //FINEST("Output buffer: %s", STR(buffer));311 287 return true; 312 288 } -
trunk/sources/thelib/src/protocols/rtmp/inboundhttp4rtmp.cpp
r247 r410 97 97 //7. Do the dammage 98 98 bool result; 99 //FINEST("Process %s", STR(parts[1]));100 99 if (parts[1] == "fcs") { 101 100 result = ProcessFcs(parts); … … 134 133 void InboundHTTP4RTMP::ReadyForSend() { 135 134 if (_pNearProtocol != NULL) { 136 //FINEST("InboundHTTP4RTMP::ReadyForSend");137 135 _pNearProtocol->ReadyForSend(); 138 136 } … … 199 197 IOBuffer *pBuffer = pProtocol->GetOutputBuffer(); 200 198 if (pBuffer != NULL) { 201 //FINEST("We have to send %d bytes", GETAVAILABLEBYTESCOUNT(*pBuffer));202 199 _outputBuffer.ReadFromBuffer(GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)); 203 200 pBuffer->IgnoreAll(); … … 214 211 } 215 212 216 //FINEST("_inputBuffer:\n%s", STR(_inputBuffer));217 213 if (!pProtocol->SignalInputData(_inputBuffer)) { 218 214 FATAL("Unable to call upper protocol"); … … 223 219 IOBuffer *pBuffer = pProtocol->GetOutputBuffer(); 224 220 if (pBuffer != NULL) { 225 //FINEST("We have to send %d bytes", GETAVAILABLEBYTESCOUNT(*pBuffer));226 221 _outputBuffer.ReadFromBuffer(GETIBPOINTER(*pBuffer), GETAVAILABLEBYTESCOUNT(*pBuffer)); 227 222 pBuffer->IgnoreAll(); -
trunk/sources/thelib/src/protocols/rtmp/inboundrtmpprotocol.cpp
r252 r410 54 54 { 55 55 if (GETAVAILABLEBYTESCOUNT(buffer) < 1537) { 56 //FINEST("Not enough data");57 56 return true; 58 57 } … … 64 63 65 64 _currentFPVersion = ENTOHL(*((uint32_t *) (GETIBPOINTER(buffer) + 4))); //----MARKED-LONG--- 66 //FINEST("Flash player: %s", STR(_currentFlashPlayerVersion));67 65 68 66 switch (handshakeType) { … … 84 82 case RTMP_STATE_SERVER_RESPONSE_SENT: 85 83 { 86 //FINEST("I: Player request 2:\n%s", STR(*pInputBuffer));87 84 if (GETAVAILABLEBYTESCOUNT(buffer) < 1536) { 88 85 return true; … … 149 146 1536 - clientDigestOffset - 32); 150 147 151 //uint8_t *pTempHash = new uint8_t[mhash_get_hash_pblock(MHASH_SHA256)];152 148 uint8_t *pTempHash = new uint8_t[512]; 153 149 HMACsha256(pTempBuffer, 1536 - 32, genuineFPKey, 30, pTempHash); … … 207 203 uint32_t serverDHOffset = GetDHOffset(_pOutputBuffer, _validationScheme); 208 204 uint32_t clientDHOffset = GetDHOffset(pInputBuffer, _validationScheme); 209 //FINEST("serverDHOffset: %u", serverDHOffset);210 205 211 206 //generate DH key … … 251 246 //generate the digest 252 247 uint32_t serverDigestOffset = GetDigestOffset(_pOutputBuffer, _validationScheme); 253 //FINEST("serverDigestOffset: %u", serverDigestOffset);254 248 255 249 uint8_t *pTempBuffer = new uint8_t[1536 - 32]; … … 272 266 //Compute the chalange index from the initial client request 273 267 uint32_t keyChallengeIndex = GetDigestOffset(pInputBuffer, _validationScheme); 274 //FINEST("keyChallengeIndex: %u", keyChallengeIndex);275 268 276 269 //compute the key -
trunk/sources/thelib/src/protocols/rtmp/inboundrtmpsdiscriminatorprotocol.cpp
r248 r410 90 90 } 91 91 92 //**** ---> ****93 94 92 //3. Destroy the link 95 93 BaseProtocol *pFar = _pFarProtocol; -
trunk/sources/thelib/src/protocols/rtmp/messagefactories/connectionmessagefactory.cpp
r2 r410 46 46 connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_APP] = appName; 47 47 connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_AUDIOCODECS] = audioCodecs; 48 //connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_CAPABILITIES] = capabilities;49 48 connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_FLASHVER] = flashVer; 50 49 connectRequest[(uint32_t) 0][RM_INVOKE_PARAMS_CONNECT_FPAD] = (bool)fPad; -
trunk/sources/thelib/src/protocols/rtmp/outboundrtmpprotocol.cpp
r269 r410 193 193 for (uint32_t i = 0; i < 1536; i++) { 194 194 _pOutputBuffer[i] = rand() % 256; 195 //_pOutputBuffer[i] = 0;196 195 } 197 196 … … 200 199 201 200 DEBUG_HANDSHAKE("PHS1: 5. Put the flash version. We impersonate with 9.0.124.2"); 202 //EHTONLP(_pOutputBuffer + 4, 0);203 201 _pOutputBuffer[4] = 9; 204 202 _pOutputBuffer[5] = 0; … … 251 249 _outputBuffer.ReadFromBuffer(_pOutputBuffer, 1536); 252 250 _outputBuffer222.ReadFromBuffer(_pOutputBuffer, 1536); 253 //FINEST("InputBuffer:\n%s", STR(_outputBuffer));254 251 255 252 DEBUG_HANDSHAKE("PHS1: 15. delete the buffer"); -
trunk/sources/thelib/src/protocols/rtmp/rtmpeprotocol.cpp
r56 r410 58 58 59 59 bool RTMPEProtocol::SignalInputData(IOBuffer &buffer) { 60 //FINEST("Encoded:\n%s", STR(*pInputBuffer));61 60 RC4(_pKeyIn, GETAVAILABLEBYTESCOUNT(buffer), 62 61 GETIBPOINTER(buffer), 63 62 GETIBPOINTER(buffer)); 64 //FINEST("pInputBuffer:\n%s", STR(*pInputBuffer));65 63 66 64 _inputBuffer.ReadFromBuffer(GETIBPOINTER(buffer), 67 65 GETAVAILABLEBYTESCOUNT(buffer)); 68 //FINEST("Decoded:\n%s", STR(_inputBuffer));69 66 buffer.IgnoreAll(); 70 67 … … 81 78 return true; 82 79 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));90 80 RC4(_pKeyOut, GETAVAILABLEBYTESCOUNT(*pOutputBuffer) - _skipBytes, 91 81 GETIBPOINTER(*pOutputBuffer) + _skipBytes, 92 82 GETIBPOINTER(*pOutputBuffer) + _skipBytes); 93 83 _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));101 84 102 85 _outputBuffer.ReadFromInputBuffer(pOutputBuffer, 0, GETAVAILABLEBYTESCOUNT(*pOutputBuffer)); -
trunk/sources/thelib/src/protocols/rtmp/rtmpprotocolserializer.cpp
r168 r410 150 150 bool RTMPProtocolSerializer::Serialize(Channel &channel, 151 151 Variant &message, IOBuffer &buffer, uint32_t chunkSize) { 152 //FINEST("message:\n%s", STR(message.ToString()));153 152 bool result = false; 154 153 _internalBuffer.Ignore(GETAVAILABLEBYTESCOUNT(_internalBuffer)); … … 252 251 bool RTMPProtocolSerializer::SerializeInvoke(IOBuffer &buffer, 253 252 Variant &message) { 254 //FINEST("About to serialize invoke: %s", STR(message.ToString()));255 253 256 254 string functionName = message[RM_INVOKE_FUNCTION]; … … 310 308 311 309 bool RTMPProtocolSerializer::SerializeUsrCtrl(IOBuffer &buffer, Variant message) { 312 // FINEST("message:\n%s", STR(message.ToString()));313 314 310 if (!_amf0.WriteInt16(buffer, message[RM_USRCTRL_TYPE], false)) { 315 311 FATAL("Unable to write user control message type value"); … … 358 354 return false; 359 355 } 360 //FINEST("SerializeServerBW Buffer:\n%s", STR(buffer));361 356 return true; 362 357 } … … 367 362 return false; 368 363 } 369 //FINEST("SerializeAbortMessage Buffer:\n%s", STR(buffer));370 364 return true; 371 365 } … … 382 376 return false; 383 377 } 384 //FINEST("SerializeClientBW Buffer:\n%s", STR(buffer));385 378 return true; 386 379 } … … 419 412 420 413 Variant primitive = message[RM_SHAREDOBJECT_PRIMITIVES][i]; 421 //FINEST("Primitive:\n%s", STR(primitive.ToString()));422 414 423 415 //type … … 502 494 } 503 495 504 //FINEST("Buffer:\n%s", STR(buffer));505 496 return true; 506 497 } … … 540 531 541 532 bool RTMPProtocolSerializer::DeserializeInvoke(IOBuffer &buffer, Variant &message) { 542 //FINEST("input:\n%s", STR(message.ToString()));543 533 if (message[RM_INVOKE_IS_FLEX]) { 544 534 if (!buffer.Ignore(1)) { … … 571 561 Variant &message) { 572 562 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 573 //FINEST("BR:\n%s", STR(message.ToString()));574 563 return buffer.Ignore(4); 575 564 } … … 608 597 return false; 609 598 } 610 //FINEST("message:\n%s", STR(message.ToString()));611 599 return true; 612 600 } … … 618 606 return false; 619 607 } 620 //FINEST("message:\n%s", STR(message.ToString()));621 608 return true; 622 609 } … … 652 639 Variant &message) { 653 640 message = (uint32_t) ENTOHLP(GETIBPOINTER(buffer)); //----MARKED-LONG--- 654 //FINEST("CS:\n%s", STR(message.ToString()));655 641 return buffer.Ignore(4); 656 642 } … … 751 737 case SOT_CS_CONNECT: 752 738 { 753 //FINEST("rawLength: %d", rawLength);754 739 break; 755 740 } … … 773 758 afterRead = GETAVAILABLEBYTESCOUNT(buffer); 774 759 read += beforeRead - afterRead; 775 // FINEST("beforeRead: %d; afterRead: %d; read: %d; rawLength: %d",776 // beforeRead, afterRead, read, rawLength);777 760 778 761 beforeRead = GETAVAILABLEBYTESCOUNT(buffer); … … 783 766 afterRead = GETAVAILABLEBYTESCOUNT(buffer); 784 767 read += beforeRead - afterRead; 785 // FINEST("beforeRead: %d; afterRead: %d; read: %d; rawLength: %d",786 // beforeRead, afterRead, read, rawLength);787 768 primitive[RM_SHAREDOBJECTPRIMITIVE_PAYLOAD][STR(key)] = value; 788 769 } … … 845 826 } 846 827 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; 948 829 } 949 830 … … 954 835 chunksCount += (length % chunkSize) == 0 ? 0 : 1; 955 836 uint32_t copySizeChunk = 0; 956 957 //DEBUG("length: %d, chunkSize: %d, chunksCount: %d, miniHeader: %02x",958 // length, chunkSize, chunksCount, miniHeader);959 837 960 838 for (uint32_t i = 0; i < chunksCount - 1; i++) { -
trunk/sources/thelib/src/protocols/rtmp/sharedobjects/so.cpp
r56 r410 39 39 _payload.RemoveKey("_dummy_"); 40 40 _versionIncremented = false; 41 //FINEST("SO created. _name: %s; _persistent: %d", STR(_name), _persistent);42 41 } 43 42 … … 136 135 137 136 void SO::Track() { 138 //FINEST("Track:\n%s", STR(DumpTrack()));139 137 140 138 FOR_MAP(_dirtyPropsByProtocol, uint32_t, Dirtyness, i) { … … 175 173 M_SO_PRIMITIVE(message, i) = primitives[i]; 176 174 177 //FINEST("Message:\n%s", STR(message.ToString()));178 175 179 176 if (pTo != NULL) { … … 183 180 } 184 181 } 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 // }192 182 _dirtyPropsByProtocol.clear(); 193 183 _versionIncremented = false; … … 209 199 _versionIncremented = true; 210 200 } 211 //FINEST("Set %s key", STR(key));212 201 _payload[key] = value; 213 202 -
trunk/sources/thelib/src/protocols/rtmp/sharedobjects/somanager.cpp
r2 r410 55 55 bool SOManager::Process(BaseRTMPProtocol *pFrom, Variant &request) { 56 56 //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 // else60 // return ProcessSharedObject(pFrom, request);61 57 return ProcessSharedObject(pFrom, request); 62 58 } … … 149 145 } 150 146 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 // }186 147 } 187 148 -
trunk/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp
r379 r410 110 110 111 111 uint32_t BaseOutNetRTMPStream::GetCommandsChannelId() { 112 // if (_pChannelAudio == NULL)113 // return 3;114 // return _pChannelAudio->id;115 112 return 3; 116 113 } … … 156 153 uint32_t processedLength, uint32_t totalLength, 157 154 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);164 155 if (_paused) 165 156 return true; … … 194 185 } else { 195 186 ALLOW_EXECUTION(processedLength, dataLength, isAudio); 196 // H_IA(_audioHeader) = true;197 // H_TS(_audioHeader) = absoluteTime - _deltaTime;198 187 H_IA(_audioHeader) = false; 199 188 if (processedLength == 0) … … 210 199 _videoPacketsCount++; 211 200 _videoBytesCount += dataLength; 212 //FINEST("absoluteTime: %f", absoluteTime);213 201 if (_isFirstVideoFrame) { 214 202 if (dataLength == 0) … … 236 224 237 225 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) + _seekTime243 // );244 226 H_TS(_videoHeader) = (uint32_t) (absoluteTimestamp - (*_pDeltaVideoTime) + _seekTime); 245 227 … … 254 236 } else { 255 237 ALLOW_EXECUTION(processedLength, dataLength, isAudio); 256 // H_IA(_videoHeader) = true;257 // H_TS(_videoHeader) = absoluteTime - _deltaTime;258 238 H_IA(_videoHeader) = false; 259 239 if (processedLength == 0) … … 264 244 H_ML(_videoHeader) = totalLength; 265 245 266 //FINEST("Start chunk and send");267 246 return ChunkAndSend(pData, dataLength, _videoBucket, 268 247 _videoHeader, *_pChannelVideo); … … 288 267 289 268 void BaseOutNetRTMPStream::SignalAttachedToInStream() { 290 // FINEST("outbound stream %u attached to inbound stream %u",291 // GetUniqueId(), _pInStream->GetUniqueId());292 269 //1. Store the attached stream type to know how we should proceed on detach 293 270 _attachedStreamType = _pInStream->GetType(); … … 520 497 521 498 bool BaseOutNetRTMPStream::SignalSeek(double &absoluteTimestamp) { 522 //FINEST("SignalSeek: %.02f", currentTimestamp);523 499 524 500 //1. Stream eof … … 633 609 634 610 bool BaseOutNetRTMPStream::SignalStop() { 635 //FINEST("SignalStop: %.02f", currentTimestamp);636 611 return true; 637 612 } 638 613 639 614 void BaseOutNetRTMPStream::SignalStreamCompleted() { 640 //FINEST("SignalStreamCompleted");641 615 //1. notify onPlayStatus code="NetStream.Play.Complete", bytes=xxx, duration=yyy, level status 642 616 Variant message = StreamMessageFactory::GetNotifyOnPlayStatusPlayComplete( … … 676 650 bool BaseOutNetRTMPStream::ChunkAndSend(uint8_t *pData, uint32_t length, 677 651 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 // }685 652 if (H_ML(header) == 0) { 686 653 TRACK_HEADER(header, channel.lastOutProcBytes); … … 793 760 if (totalProcessed != 0) { 794 761 //we are in the middle of it. Don't allow execution 795 //FINEST("In the middle of a dropped frame");796 762 bytesCounter += dataLength; 797 763 return false; 798 764 } else { 799 765 //this is a new frame. We will detect later if it can be sent 800 //FINEST("Last dropped frame completed.");801 766 _currentFrameDropped = false; 802 767 } … … 812 777 if (GETAVAILABLEBYTESCOUNT(*_pRTMPProtocol->GetOutputBuffer()) > _maxBufferSize) { 813 778 //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);817 779 packetsCounter++; 818 780 bytesCounter += dataLength; … … 821 783 } else { 822 784 //we can still pump data 823 824 785 return true; 825 786 } 826 787 } else { 827 788 //no data in the output buffer. Allow to send it 828 829 789 return true; 830 790 } 831 791 } else { 832 792 //we are in the middle of a non-dropped frame. Send it anyway 833 834 793 return true; 835 794 } -
trunk/sources/thelib/src/protocols/rtmp/streaming/infilertmpmp4stream.cpp
r250 r410 53 53 if (mediaFrame.type == MEDIAFRAME_TYPE_AUDIO) { 54 54 // audio extra data 55 //FINEST("--- AUDIO EXTRA DATA");56 55 buffer.ReadFromBuffer(_audioCodecHeaderInit, sizeof (_audioCodecHeaderInit)); 57 56 } else { 58 57 // video extra data 59 //FINEST("--- VIDEO EXTRA DATA");60 58 buffer.ReadFromBuffer(_videoCodecHeaderInit, sizeof (_videoCodecHeaderInit)); 61 59 } … … 66 64 if (mediaFrame.isKeyFrame) { 67 65 // video key frame 68 //FINEST("--- VIDEO KEY FRAME");69 66 buffer.ReadFromBuffer(_videoCodecHeaderKeyFrame, sizeof (_videoCodecHeaderKeyFrame)); 70 67 } else { 71 68 //video normal frame 72 //FINEST("--- VIDEO NORMAL FRAME");73 69 buffer.ReadFromBuffer(_videoCodecHeader, sizeof (_videoCodecHeader)); 74 70 } … … 77 73 78 74 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 // else89 // FINEST("%s", STR(str));90 75 } 91 76 } -
trunk/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
r279 r410 138 138 bool BaseRTSPAppProtocolHandler::HandleRTSPRequest(RTSPProtocol *pFrom, 139 139 Variant &requestHeaders, string &requestContent) { 140 //FINEST("RTSP Request:\n%s", STR(requestHeaders.ToString()));141 140 string method = requestHeaders[RTSP_FIRST_LINE][RTSP_METHOD]; 142 141 string requestSessionId = ""; … … 427 426 bool BaseRTSPAppProtocolHandler::HandleRTSPRequestSetupInbound(RTSPProtocol *pFrom, 428 427 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 434 428 //1. get the transport line and split it into parts 435 429 if (!requestHeaders[RTSP_HEADERS].HasKey(RTSP_HEADERS_TRANSPORT, false)) { … … 439 433 string transportLine = lowercase(requestHeaders[RTSP_HEADERS].GetValue(RTSP_HEADERS_TRANSPORT, false)); 440 434 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 // }445 435 446 436 //2. Check and see if it has RTP/AVP/TCP,RTP/AVP/UDP or RTP/AVP … … 492 482 return false; 493 483 } 494 // FINEST("portsOrChannels: %d-%d; forceTcp: %d",495 // portsOrChannels[0], portsOrChannels[1], forceTcp);496 484 497 485 //4. Find the track inside the pendingTracks ccollection and setup the ports or channels … … 501 489 } 502 490 string controlUri = requestHeaders[RTSP_FIRST_LINE][RTSP_URL]; 503 //FINEST("controlUri: %s", STR(controlUri));504 491 505 492 bool trackFound = false; … … 517 504 return false; 518 505 } 519 //FINEST("pendingTracks:\n%s", STR(pFrom->GetCustomParameters()["pendingTracks"].ToString()));520 506 521 507 //5. Create a session 522 508 if (!pFrom->GetCustomParameters().HasKey(RTSP_HEADERS_SESSION)) { 523 509 pFrom->GetCustomParameters()[RTSP_HEADERS_SESSION] = generateRandomString(8); 524 //FINEST("Session: %s", STR(pFrom->GetCustomParameters()[RTSP_HEADERS_SESSION]));525 510 } 526 511 … … 530 515 531 516 //7. Send it 532 //FINEST("--------------------------------------");533 517 return pFrom->SendResponseMessage(); 534 518 } … … 589 573 pOutboundConnectivity->GetLastVideoSequence(), 590 574 0); 591 //pOutboundConnectivity->GetLastVideoRTPTimestamp());592 575 } 593 576 if (pFrom->GetCustomParameters().HasKey("audioTrackId")) { … … 596 579 pOutboundConnectivity->GetLastAudioSequence(), 597 580 0); 598 //pOutboundConnectivity->GetLastAudioRTPTimestamp());599 581 } 600 582 string rtpInfo = rtpInfoVideo; … … 606 588 rtpInfo = rtpInfoAudio; 607 589 } 608 //pFrom->PushResponseHeader(RTSP_HEADERS_RTP_INFO, rtpInfo);609 590 610 591 //7. Done … … 620 601 bool BaseRTSPAppProtocolHandler::HandleRTSPRequestAnnounce(RTSPProtocol *pFrom, 621 602 Variant &requestHeaders, string &requestContent) { 622 // FINEST("requestHeaders:\n%s", STR(requestHeaders.ToString()));623 // FINEST("requestContent:\n%s", STR(requestContent));624 603 //1. Make sure we ONLY handle application/sdp 625 604 if (!requestHeaders[RTSP_HEADERS].HasKey(RTSP_HEADERS_CONTENT_TYPE, false)) { … … 647 626 Variant audioTrack = sdp.GetAudioTrack(0, 648 627 requestHeaders[RTSP_FIRST_LINE][RTSP_URL]); 649 // FINEST("videoTrack:\n%s", STR(videoTrack.ToString()));650 // FINEST("audioTrack:\n%s", STR(audioTrack.ToString()));651 628 652 629 //5. Store the tracks inside the session for later use … … 721 698 Variant &requestHeaders, string &requestContent, Variant &responseHeaders, 722 699 string &responseContent) { 723 //WARN("\n%s\n%s", STR(responseHeaders.ToString()), STR(responseContent));724 700 switch ((uint32_t) responseHeaders[RTSP_FIRST_LINE][RTSP_STATUS_CODE]) { 725 701 case 200: … … 852 828 Variant audioTrack = sdp.GetAudioTrack(0, 853 829 requestHeaders[RTSP_FIRST_LINE][RTSP_URL]); 854 // FINEST("videoTrack:\n%s", STR(videoTrack.ToString()));855 // FINEST("audioTrack:\n%s", STR(audioTrack.ToString()));856 830 857 831 //5. Store the tracks inside the session for later use -
trunk/sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp
r379 r410 99 99 string streamName, bool forceTcp) { 100 100 _forceTcp = forceTcp; 101 // FINEST("videoTrack:\n%s", STR(videoTrack.ToString()));102 // FINEST("audioTrack:\n%s", STR(audioTrack.ToString()));103 101 104 102 //1. get the application … … 175 173 if ((_pProtocols[i] != NULL) && (_pProtocols[i]->GetId() == pProtocol->GetId())) { 176 174 string result = format("RTP/AVP/TCP;unicast;interleaved=%d-%d", i, i + 1); 177 //FINEST("%s: %s", isAudio ? "audio" : "video", STR(result));178 175 return result; 179 176 } … … 270 267 EHTONLP(pBuffer + 28, pRTCP->GetLastSenderReport()); //last SR (LSR) 271 268 272 //WARN("Send RR: %d", isAudio);273 269 if (_forceTcp) { 274 270 return _pRTSP->SendRaw(pBuffer, 60); … … 329 325 } 330 326 331 // //4. get the ports if available332 // 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 346 327 //4. Create the carriers 347 328 if (!CreateCarriers(_pRTPVideo, _pRTCPVideo)) { … … 374 355 EHTONLP(_videoRR + 40, _pRTCPVideo->GetSSRC()); //SSRC of packet sender 375 356 _videoRR[1] = idx + 1; 376 //FINEST("video: %d-%d; RTCP SSRC: %08x", idx, idx + 1, _pRTCPVideo->GetSSRC());377 357 } 378 358 … … 384 364 EHTONLP(_audioRR + 40, _pRTCPAudio->GetSSRC()); //SSRC of packet sender 385 365 _audioRR[1] = idx + 1; 386 //FINEST("audio: %d-%d; RTCP SSRC: %08x", idx, idx + 1, _pRTCPAudio->GetSSRC());387 366 } 388 367 … … 457 436 pCarrier1->SetProtocol(pRTP->GetFarEndpoint()); 458 437 pRTP->GetFarEndpoint()->SetIOHandler(pCarrier1); 459 //WARN("pRTP: %s", STR(*pRTP));460 438 461 439 pCarrier2->SetProtocol(pRTCP->GetFarEndpoint()); 462 440 pRTCP->GetFarEndpoint()->SetIOHandler(pCarrier2); 463 //WARN("pRTCP: %s", STR(*pRTCP)); 464 465 //WARN("RTP/RTCP pair: %d-%d", pCarrier1->GetNearEndpointPort(), pCarrier2->GetNearEndpointPort()); 441 466 442 467 443 return true; -
trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp
r279 r410 347 347 _videoPacketsCount++; 348 348 COMPUTE_BYTES_COUNT(message, _videoBytesCount); 349 //uint16_t seq = ENTOHSP(((uint8_t *) message.msg_iov[0].iov_base) + 2);350 //FINEST("seq: %d", seq);351 349 if (((_videoPacketsCount % 300) == 0) || _videoPacketsCount <= 2) { 352 350 uint8_t buff[28]; … … 368 366 369 367 bool OutboundConnectivity::FeedVideoDataTCP(msghdr &message) { 370 //NYIR;371 368 return true; 372 369 } … … 376 373 _audioPacketsCount++; 377 374 COMPUTE_BYTES_COUNT(message, _audioBytesCount); 378 //uint16_t seq = ENTOHSP(((uint8_t *) message.msg_iov[0].iov_base) + 2);379 //FINEST("seq: %d", seq);380 375 if (((_audioPacketsCount % 300) == 0) || (_audioPacketsCount <= 2)) { 381 376 uint8_t buff[28]; … … 397 392 398 393 bool OutboundConnectivity::FeedAudioDataTCP(msghdr &message) { 399 //NYIR;400 394 return true; 401 395 } -
trunk/sources/thelib/src/protocols/rtp/inboundrtpprotocol.cpp
r379 r410 89 89 _lastSeq = GET_RTP_SEQ(_rtpHeader); 90 90 } else { 91 // WARN("Bogus seq. current seq: %04x; last seq: %04x",92 // GET_RTP_SEQ(_rtpHeader), _lastSeq);93 91 buffer.IgnoreAll(); 94 92 return true; … … 111 109 #ifdef RTP_DETECT_ROLLOVER 112 110 if (_rtpHeader._timestamp < _lastTimestamp) { 113 // FINEST("Possible roll over: _rtpHeader._timestamp: %016llx; _lastTimestamp: %016llx",114 // _rtpHeader._timestamp, _lastTimestamp);115 111 if ((((_rtpHeader._timestamp & 0x80000000) >> 31) == 0) 116 112 && (((_lastTimestamp & 0x80000000) >> 31) == 1)) { … … 119 115 WARN("Roll over on %d; _timestampRollover: %d", GetId(), _timestampRollover); 120 116 } 121 // else {122 // WARN("Bogus timestamp. current ts: %016llx; last ts: %016llx",123 // _rtpHeader._timestamp, _lastTimestamp);124 // buffer.IgnoreAll();125 // return true;126 // }127 117 } else { 128 118 _lastTimestamp = _rtpHeader._timestamp; 129 119 } 130 // string msg = "";131 // if ((_lastSeq % 1000) == 0) {132 // msg = format("%d: %016llx", GetId(), _rtpHeader._timestamp);133 // }134 120 _rtpHeader._timestamp = (_timestampRollover << 32) | _rtpHeader._timestamp; 135 // if ((_lastSeq % 1000) == 0) {136 // msg += format("(%016llx)", _rtpHeader._timestamp);137 // FINEST(STR(msg));138 // }139 121 #endif 140 122 … … 142 124 if (_pInStream != NULL) { 143 125 if (_isAudio) { 144 //FINEST("AUDIO: %08x", _rtpHeader._ssrc);145 126 if (!_pInStream->FeedAudioData(pBuffer, length, _rtpHeader)) { 146 127 FATAL("Unable to stream data"); … … 152 133 } 153 134 } else { 154 //FINEST("VIDEO: %08x", _rtpHeader._ssrc);155 135 if (!_pInStream->FeedVideoData(pBuffer, length, _rtpHeader)) { 156 136 FATAL("Unable to stream data"); … … 188 168 189 169 uint32_t InboundRTPProtocol::GetSSRC() { 190 //FINEST("_rtpHeader._ssrc: %08x", _rtpHeader._ssrc);191 170 return _rtpHeader._ssrc; 192 171 } 193 172 194 173 uint32_t InboundRTPProtocol::GetExtendedSeq() { 195 // FINEST("_seqRollOver: %04x", _seqRollOver);196 // FINEST("_lastSeq: %04x", _lastSeq);197 174 return (((uint32_t) _seqRollOver) << 16) | _lastSeq; 198 175 } -
trunk/sources/thelib/src/protocols/rtp/rtcpprotocol.cpp
r380 r410 38 38 _ssrc ^= GetId(); 39 39 _validLastAddress = false; 40 // _lastNtpMicroseconds = 0;41 // _lastRtpTimestamp = 0;42 40 } 43 41 … … 64 62 65 63 bool RTCPProtocol::SignalInputData(IOBuffer &buffer, sockaddr_in *pPeerAddress) { 66 //WARN("Got SR: %d",_isAudio);67 64 //0. Save the last known address 68 65 if (&_lastAddress != pPeerAddress) { … … 77 74 return true; 78 75 79 //uint8_t V = pBuffer[0] >> 6;80 //bool P = ((pBuffer[0] >> 5)&0x01) == 1;81 //uint8_t RC = pBuffer[0]&0x1f;82 76 uint8_t PT = pBuffer[1]; 83 77 uint16_t len = ENTOHSP(pBuffer + 2); … … 88 82 return true; 89 83 } 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);93 84 94 85 switch (PT) { … … 106 97 uint32_t rtpTimestamp = ENTOHLP(pBuffer + 16); 107 98 _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 // }132 99 break; 133 //uint64_t ntp = ENTOHLLP(pBuffer + 8);134 100 } 135 101 default: … … 140 106 } 141 107 } 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 181 109 if (pBuffer[1] != 200) 182 110 return true; 183 111 184 112 _lsr = ENTOHLP(pBuffer + 10); 185 //FINEST("_lsr: %08x\n%s", _lsr, STR(buffer));186 113 buffer.IgnoreAll(); 187 114 -
trunk/sources/thelib/src/protocols/rtp/rtspprotocol.cpp
r407 r410 125 125 } 126 126 if (_state != RTSP_STATE_PAYLOAD) { 127 //FINEST("Not enough data to parse the headers");128 127 return true; 129 128 } … … 354 353 _outputBuffer.ReadFromString(content); 355 354 356 357 // string aaa = string((char *) GETIBPOINTER(_outputBuffer), GETAVAILABLEBYTESCOUNT(_outputBuffer));358 // FINEST("\n`%s`", STR(aaa));359 360 355 //5. Enqueue for outbound 361 356 return EnqueueForOutbound(); … … 377 372 bool RTSPProtocol::ParseInterleavedHeaders(IOBuffer &buffer) { 378 373 //1. Marl this as a interleaved content 379 //FINEST("buffer:\n%s", STR(buffer));380 374 _rtpData = true; 381 375 … … 383 377 uint32_t bufferLength = GETAVAILABLEBYTESCOUNT(buffer); 384 378 if (bufferLength < 4) { 385 //WARN("Not enough data");386 379 return true; 387 380 } … … 402 395 //6. Do we have enough data? 403 396 if (_rtpDataLength + 4 > bufferLength) { 404 //WARN("Not enough data. _rtpDataLength: %d; bufferLength: %d", _rtpDataLength, bufferLength);405 397 return true; 406 398 } … … 418 410 _inboundHeaders.Reset(); 419 411 _inboundContent = ""; 420 //FINEST("buffer:\n%s", STR(buffer));421 412 //1. We have to have at least 4 bytes (double \r\n) 422 413 if (GETAVAILABLEBYTESCOUNT(buffer) < 4) { … … 470 461 //5. Consider the rest of the lines as key: value pairs and store them 471 462 //0. Reset the headers 472 // for (uint32_t i = 1; i < lines.size(); i++) {473 // FINEST("line %d: `%s`", i, STR(lines[i]));474 // }475 463 _inboundHeaders[RTSP_HEADERS].IsArray(false); 476 464 for (uint32_t i = 1; i < lines.size(); i++) { … … 537 525 _inboundHeaders["isRequest"] = false; 538 526 539 //FINEST("_inboundHeaders:\n%s", STR(_inboundHeaders.ToString()));540 527 541 528 return true; -
trunk/sources/thelib/src/protocols/rtp/sdp.cpp
r394 r410 30 30 31 31 bool SDP::ParseSDP(SDP &sdp, string &raw) { 32 //FINEST("raw:\n%s\n", STR(raw));33 32 //1. Reset 34 33 sdp.Reset(); … … 42 41 vector<string> lines; 43 42 split(raw, "\n", lines); 44 45 // FOR_VECTOR(lines, i) {46 // FINEST("lines[%02d]: %s", i, STR(lines[i]));47 // }48 43 49 44 //4. Detect the media tracks indexes … … 54 49 } 55 50 } 56 // for (uint32_t i = 0; i < trackIndexes.size(); i++) {57 // FINEST("trackIndexes[%02d]: %02d", i, trackIndexes[i]);58 // }59 51 if (trackIndexes.size() == 0) { 60 52 FATAL("No tracks found"); … … 91 83 sdp[SDP_MEDIATRACKS].PushToArray(media); 92 84 93 //FINEST("sdp:\n%s", STR(sdp.ToString()));94 85 95 86 return true; … … 103 94 return Variant(); 104 95 } 105 //FINEST("track:\n%s", STR(track.ToString()));106 96 107 97 //2. Prepare the info … … 138 128 return Variant(); 139 129 } 140 //FINEST("track:\n%s", STR(track.ToString()));141 130 142 131 //2. Prepare the info … … 361 350 value["payloadType"] = (uint8_t) atoi(STR(parts[0])); 362 351 map<string, string> temp = mapping(parts[1], ";", "=", false); 363 // FINEST("-----------");364 // FINEST("%s", STR(parts[1]));365 352 366 353 FOR_MAP(temp, string, string, i) { 367 //FINEST("%s: %s", STR(MAP_KEY(i)), STR(MAP_VAL(i)));368 354 value[MAP_KEY(i)] = MAP_VAL(i); 369 355 } 370 // FINEST("-----------"); 356 371 357 return true; 372 358 } else { … … 383 369 vector<string> parts; 384 370 split(line, ":", parts); 385 // for (uint32_t i = 0; i < parts.size(); i++) {386 // FINEST("parts[%d]: %s", i, STR(parts[i]));387 // }388 371 if (parts.size() != 2) 389 372 return false; … … 392 375 result["value"] = parts[1]; 393 376 394 //FINEST("result: %s", STR(result.ToString()));395 377 return true; 396 378 } … … 402 384 vector<string> parts; 403 385 split(line, " ", parts); 404 // for (uint32_t i = 0; i < parts.size(); i++) {405 // FINEST("parts[%d]: %s", i, STR(parts[i]));406 // }407 386 if (parts.size() != 3) 408 387 return false; … … 412 391 result["connectionAddress"] = parts[2]; 413 392 414 //FINEST("result: %s", STR(result.ToString()));415 393 return true; 416 394 } … … 439 417 vector<string> parts; 440 418 split(line, " ", parts); 441 // for (uint32_t i = 0; i < parts.size(); i++) {442 // FINEST("parts[%d]: %s", i, STR(parts[i]));443 // }444 419 if (parts.size() != 4) 445 420 return false; … … 449 424 result["transport"] = parts[2]; 450 425 result["payloadType"] = parts[3]; 451 452 // FINEST("result: %s", STR(result.ToString()));453 426 return true; 454 427 } … … 460 433 vector<string> parts; 461 434 split(line, " ", parts); 462 // for (uint32_t i = 0; i < parts.size(); i++) {463 // FINEST("parts[%d]: %s", i, STR(parts[i]));464 // }465 435 if (parts.size() != 6) 466 436 return false; … … 490 460 result["ip_address"] = ip; 491 461 492 //FINEST("result: %s", STR(result.ToString()));493 462 return true; 494 463 } … … 517 486 vector<string> parts; 518 487 split(line, " ", parts); 519 // for (uint32_t i = 0; i < parts.size(); i++) {520 // FINEST("parts[%d]: %s", i, STR(parts[i]));521 // }522 488 if (parts.size() != 2) 523 489 return false; … … 526 492 result["stopTime"] = parts[1]; 527 493 528 //FINEST("result: %s", STR(result.ToString()));529 494 return true; 530 495 } -
trunk/sources/thelib/src/protocols/rtp/streaming/innetrtpstream.cpp
r399 r410 110 110 111 111 void InNetRTPStream::SignalOutStreamDetached(BaseOutStream *pOutStream) { 112 //NYIA;113 112 } 114 113 … … 147 146 double &rtp = isAudio ? _audioRTP : _videoRTP; 148 147 absoluteTimestamp = ntp + absoluteTimestamp - rtp; 149 //FINEST("%c %.2f", isAudio ? 'A' : 'V', absoluteTimestamp);150 148 } 151 149 … … 229 227 if (naluType <= 23) { 230 228 //3. Standard NALU 231 //FINEST("Standard NALU");232 229 return FeedData(pData, dataLength, 0, dataLength, ts, false); 233 230 } else if (naluType == NALU_TYPE_FUA) { 234 231 if (GETAVAILABLEBYTESCOUNT(_currentNalu) == 0) { 235 // FINEST("--------------");236 // FINEST("First NALU_TYPE_FUA");237 232 _currentNalu.IgnoreAll(); 238 233 //start NAL … … 245 240 pData[1] = (pData[0]&0xe0) | (pData[1]&0x1f); 246 241 _currentNalu.ReadFromBuffer(pData + 1, dataLength - 1); 247 // FINEST("NALU_TYPE_FUA: %s; s: %d",248 // STR(NALUToString(pData[1])),249 // GETAVAILABLEBYTESCOUNT(_currentNalu));250 242 return true; 251 243 } else { 252 244 //middle NAL 253 245 _currentNalu.ReadFromBuffer(pData + 2, dataLength - 2); 254 // FINEST("MIDDLE NALU_TYPE_FUA: end: %d; s: %d",255 // ((pData[1] >> 6)&0x01),256 // GETAVAILABLEBYTESCOUNT(_currentNalu));257 246 if (((pData[1] >> 6)&0x01) == 1) { 258 // FINEST("NALU_TYPE_FUA feed; s: %d",259 // GETAVAILABLEBYTESCOUNT(_currentNalu));260 // FINEST("--------------");261 247 _videoPacketsCount++; 262 248 _videoBytesCount += GETAVAILABLEBYTESCOUNT(_currentNalu); … … 275 261 } else if (naluType == NALU_TYPE_STAPA) { 276 262 uint32_t index = 1; 277 //FINEST("ts: %.2f; delta: %.2f", ts, ts - _lastTs);278 263 while (index + 3 < dataLength) { 279 264 uint16_t length = ENTOHSP(pData + index); … … 338 323 //3. Feed the buffer chunk by chunk 339 324 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));345 325 uint16_t chunkSize = 0; 346 326 double ts = 0; … … 351 331 chunkSize = (uint16_t) (dataLength - cursor); 352 332 } 353 // FINEST("chunkSize: %d; dataLength: %d; diff: %d", chunkSize, dataLength,354 // dataLength - chunkSize);355 //FINEST("rtpHeader._timestamp: %llu", rtpHeader._timestamp);356 333 ts = (double) (rtpHeader._timestamp + i * 1024) / (double) _capabilities.aac._sampleRate * 1000.00; 357 334 if ((cursor + chunkSize) > dataLength) { … … 392 369 _audioNTP = (double) ntpMicroseconds / 1000.0; 393 370 _audioRTP = (double) rtpTimestamp / (double) _capabilities.aac._sampleRate * 1000.0; 394 //WARN("Audio resync");395 371 } else { 396 372 _videoNTP = (double) ntpMicroseconds / 1000.0; 397 373 _videoRTP = (double) rtpTimestamp / (double) _capabilities.avc._rate * 1000.0; 398 //WARN("Video resync");399 374 } 400 375 } -
trunk/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp
r279 r410 109 109 return false; 110 110 } 111 //tsIncrement++;112 111 pData += chunkSize; 113 112 dataLength -= chunkSize; … … 152 151 double absoluteTimestamp) { 153 152 if ( 154 // (NALU_TYPE(pData[0]) != NALU_TYPE_SPS)155 // && (NALU_TYPE(pData[0]) != NALU_TYPE_PPS)156 153 (NALU_TYPE(pData[0]) != NALU_TYPE_SLICE) 157 154 && (NALU_TYPE(pData[0]) != NALU_TYPE_IDR)) { 158 //FINEST("ignoring absoluteTimestamp: %.2f; %s", absoluteTimestamp, STR(NALUToString(pData[0])));159 155 return true; 160 156 } 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 // }173 157 174 158 uint32_t sentAmount = 0; … … 240 224 241 225 //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);247 226 if (((14 + _audioData.msg_iov[1].iov_len + GETAVAILABLEBYTESCOUNT(_audioBuffer) + 2 + dataLength - 7) > MAX_RTP_PACKET_SIZE) 248 227 || (_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 263 228 //3. counter 264 229 EHTONSP(((uint8_t *) _audioData.msg_iov[0].iov_base) + 2, _audioCounter); … … 286 251 uint16_t auHeader = (uint16_t) ((dataLength - 7) << 3); 287 252 auHeader = auHeader | ((uint8_t) (_audioData.msg_iov[1].iov_len / 2)); 288 //FINEST("auHeader: %04x", auHeader);289 253 EHTONSP(((uint8_t *) _audioData.msg_iov[1].iov_base) + _audioData.msg_iov[1].iov_len, auHeader); 290 254 _audioData.msg_iov[1].iov_len += 2; … … 358 322 } 359 323 360 //ASSERT("sdfsdfds");361 324 dataLength -= 2; 362 325 pData += 2; … … 389 352 */ 390 353 391 // _audioData.msg_iov[0].iov_base[00] V,P,X,CC392 // _audioData.msg_iov[0].iov_base[01] M,PT393 // _audioData.msg_iov[0].iov_base[02] sequence number394 // _audioData.msg_iov[0].iov_base[03] sequence number395 // _audioData.msg_iov[0].iov_base[04] timestamp396 // _audioData.msg_iov[0].iov_base[05] timestamp397 // _audioData.msg_iov[0].iov_base[06] timestamp398 // _audioData.msg_iov[0].iov_base[07] timestamp399 // _audioData.msg_iov[0].iov_base[08] SSRC400 // _audioData.msg_iov[0].iov_base[09] SSRC401 // _audioData.msg_iov[0].iov_base[10] SSRC402 // _audioData.msg_iov[0].iov_base[11] SSRC403 // _audioData.msg_iov[0].iov_base[12] AU-headers-length404 // _audioData.msg_iov[0].iov_base[13] AU-headers-length405 406 354 //5. counter 407 355 EHTONSP(((uint8_t *) _audioData.msg_iov[0].iov_base) + 2, _audioCounter); … … 419 367 _audioData.msg_iov[1].iov_len = 2; 420 368 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 441 369 //7. put the actual buffer 442 370 _audioData.msg_iov[2].iov_len = dataLength - adtsHeaderLength; -
trunk/sources/thelib/src/protocols/ssl/basesslprotocol.cpp
r247 r410 146 146 } 147 147 if (!_sslHandshakeCompleted) { 148 //WARN("SSL handshake not completed yet");149 148 return true; 150 149 } -
trunk/sources/thelib/src/protocols/ssl/outboundsslprotocol.cpp
r87 r410 52 52 int32_t errorCode = SSL_ERROR_NONE; 53 53 errorCode = SSL_connect(_pSSL); 54 //FINEST("errorCode: %d", errorCode);55 54 if (errorCode < 0) { 56 55 int32_t error = SSL_get_error(_pSSL, errorCode); 57 //FINEST("error: %d", error);58 56 if (error != SSL_ERROR_WANT_READ && 59 57 error != SSL_ERROR_WANT_WRITE) { … … 64 62 65 63 _sslHandshakeCompleted = SSL_is_init_finished(_pSSL); 66 //FINEST("_sslHandshakeCompleted: %d", _sslHandshakeCompleted);67 64 68 65 if (!PerformIO()) { -
trunk/sources/thelib/src/protocols/tcpprotocol.cpp
r193 r410 61 61 62 62 bool 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 // false74 // )75 // return true;76 // WARN("Near protocol %s not accepted by %s",77 // STR(tagToString(type)),78 // STR(tagToString(_type)));79 // return false;80 63 return true; 81 64 } … … 87 70 bool TCPProtocol::SignalInputData(int32_t recvAmount) { 88 71 _decodedBytesCount += recvAmount; 89 //FINEST("_decodedBytesCount: %d", _decodedBytesCount);90 72 return _pNearProtocol->SignalInputData(_inputBuffer); 91 73 } -
trunk/sources/thelib/src/protocols/ts/basetsappprotocolhandler.cpp
r56 r410 33 33 34 34 void BaseTSAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 35 //FINEST("Register TS protocol %p to handler %p", pProtocol, this);36 35 if (MAP_HAS1(_connections, pProtocol->GetId())) { 37 36 ASSERT("Protocol already registered"); … … 41 40 42 41 void BaseTSAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 43 //FINEST("Unregister TS protocol %p from handler %p", pProtocol, this);44 42 _connections.erase(pProtocol->GetId()); 45 43 } -
trunk/sources/thelib/src/protocols/ts/inboundtsprotocol.cpp
r317 r410 25 25 #include "protocols/ts/tspacketpat.h" 26 26 #include "protocols/ts/tspacketpmt.h" 27 #include "protocols/ts/tsadaptationfield.h"28 27 #include "protocols/ts/basetsappprotocolhandler.h" 29 28 #include "protocols/ts/innettsstream.h" … … 99 98 100 99 bool 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;106 100 return true; 107 101 } … … 247 241 } 248 242 if (!TS_TRANSPORT_PACKET_HAS_PAYLOAD(packetHeader)) { 249 //WARN("No payload here!");250 243 return true; 251 244 } … … 324 317 return false; 325 318 } 326 //FINEST("packetPAT:\n%s", STR(packetPAT));327 319 328 320 //3. Store the crc … … 382 374 return false; 383 375 } 384 //FINEST("packetPMT:\n%s", STR(packetPMT));385 376 386 377 //3. Store the CRC -
trunk/sources/thelib/src/protocols/ts/innettsstream.cpp
r317 r410 145 145 absoluteTime = (ptsTime - deltaTime); 146 146 _feedTime = _feedTime < absoluteTime ? absoluteTime : _feedTime; 147 //FINEST("%c: absoluteTime: %.2f;", isAudio ? 'A' : 'V', absoluteTime);148 147 149 148 pData += 9 + pesHeaderLength; … … 225 224 //iso13818-7 page 26/206 226 225 227 // FINEST("rawBufferLength: %d; GETAVAILABLEBYTESCOUNT(_audioBuffer): %d",228 // rawBufferLength, GETAVAILABLEBYTESCOUNT(_audioBuffer));229 230 231 226 //1. Save the data 232 227 _audioBuffer.ReadFromBuffer(pRawBuffer, rawBufferLength); … … 250 245 251 246 if ((ENTOHSP(pBuffer)&0xfff0) != 0xfff0) { 252 //WARN("Bogus marker %02x %02x. Skip one byte", pBuffer[0], pBuffer[1]);253 247 _audioBuffer.Ignore(1); 254 248 continue; 255 249 } else { 256 //FINEST("OK: %d", pBuffer[1]&0x01);257 250 } 258 251 … … 268 261 } 269 262 if (bufferLength < frameLength) { 270 // FINEST("Not enough data. Wanted: %d; Got: %d",271 // frameLength,272 // GETAVAILABLEBYTESCOUNT(_audioBuffer));273 263 break; 274 264 } … … 280 270 } 281 271 _lastSentAudioTimestamp = ts; 282 //FINEST("timestamp: %.2f; _audioPacketsCount: %d", timestamp, _audioPacketsCount);283 272 284 273 //5. Feed … … 416 405 417 406 void InNetTSStream::InitializeAudioCapabilities(uint8_t *pData, uint32_t length) { 418 //FINEST("_streamCapabilities.audioCodecId: %016llx", _streamCapabilities.audioCodecId);419 407 if (_streamCapabilities.audioCodecId == CODEC_AUDIO_UNKNOWN) { 420 408 uint8_t mpegts2rtmpProfile[] = { -
trunk/sources/thelib/src/protocols/ts/pidtypes.cpp
r317 r410 18 18 */ 19 19 20 21 22 20 #ifdef HAS_PROTOCOL_TS 23 21 #include "protocols/ts/pidtypes.h" 24 22 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 45 24 #endif /* HAS_PROTOCOL_TS */ 46 25 -
trunk/sources/thelib/src/protocols/ts/streamdescriptors.cpp
r317 r410 31 31 cursor += descriptor.length; 32 32 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 // }119 33 } 120 34 #endif /* HAS_PROTOCOL_TS */ -
trunk/sources/thelib/src/protocols/variant/basevariantappprotocolhandler.cpp
r197 r410 54 54 55 55 void BaseVariantAppProtocolHandler::RegisterProtocol(BaseProtocol *pProtocol) { 56 //FINEST("BaseVariantAppProtocolHandler::RegisterProtocol");57 56 } 58 57 59 58 void BaseVariantAppProtocolHandler::UnRegisterProtocol(BaseProtocol *pProtocol) { 60 //FINEST("BaseVariantAppProtocolHandler::UnRegisterProtocol");61 59 } 62 60 … … 73 71 } 74 72 parameters["payload"] = variant; 75 //FINEST("parameters:\n%s", STR(parameters.ToString()));76 73 77 74 //2. Start the HTTP request -
trunk/sources/thelib/src/streaming/baseinfilestream.cpp
r399 r410 212 212 return false; 213 213 } 214 //FINEST("_totalFrames: %u", _totalFrames);215 214 216 215 //5. Set the client side buffer length … … 229 228 absoluteTimestamp = absoluteTimestamp < 0 ? 0 : absoluteTimestamp; 230 229 //TODO: implement the limit playback 231 //length = length < 0 ? _totalDuration : length;232 230 233 231 //1. Seek to the correct point … … 384 382 //or stay put 385 383 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);389 384 if ((int32_t) _totalSentTime - (int32_t) elapsedTime >= _clientSideBufferLength) { 390 385 return true; … … 494 489 pResult = _fileCache[filePath].second; 495 490 _fileCache[filePath].first++; 496 //FINEST("+Count: %d", _fileCache[filePath].first);497 491 } 498 492 return pResult; … … 525 519 return false; 526 520 } 527 //FINEST("frame1: %s", STR(frame1));528 521 529 522 //2. Read the second frame … … 537 530 return false; 538 531 } 539 //FINEST("frame2: %s", STR(frame2));540 532 541 533 //3. Read the current frame to pickup the timestamp from it … … 549 541 return false; 550 542 } 551 //FINEST("currentFrame: %s", STR(currentFrame));552 543 553 544 //4. Is the first frame a codec setup? 554 545 //If not, the second is not a codec setup for sure 555 546 if (!frame1.isBinaryHeader) { 556 //FINEST("frame1 is not binary header");557 547 _audioVideoCodecsSent = true; 558 548 return true; … … 565 555 return false; 566 556 } 567 //FINEST("frame1 buffer:\n%s", STR(buffer));568 557 569 558 //6. Do the feedeng with the first frame … … 579 568 return false; 580 569 } 581 //FINEST("frame1 was fed");582 570 583 571 //7. Is the second frame a codec setup? 584 572 if (!frame2.isBinaryHeader) { 585 //FINEST("frame2 is not binary header");586 573 _audioVideoCodecsSent = true; 587 574 return true; … … 594 581 return false; 595 582 } 596 //FINEST("frame2 buffer:\n%s", STR(buffer));597 583 598 584 //9. Do the feedeng with the second frame … … 608 594 return false; 609 595 } 610 //FINEST("frame2 was fed");611 596 612 597 //10. Done -
trunk/sources/thelib/src/streaming/baseinstream.cpp
r202 r410 69 69 return false; 70 70 } 71 // FINEST("BaseInStream::Link: this: %u; pOutStream: %u; reverseLink: %d",72 // GetUniqueId(), pOutStream->GetUniqueId(), reverseLink);73 71 if (MAP_HAS1(_linkedStreams, pOutStream->GetUniqueId())) { 74 72 WARN("BaseInStream::Link: This stream is already linked"); 75 73 return true; 76 74 } 77 //FINEST("BaseInStream::Link: Linking...");78 75 _pOutStreams = AddLinkedList(_pOutStreams, pOutStream, true); 79 76 _linkedStreams[pOutStream->GetUniqueId()] = pOutStream; 80 77 81 78 if (reverseLink) { 82 //FINEST("BaseInStream::Link: Reverse linking...");83 79 if (!pOutStream->Link(this, false)) { 84 80 FATAL("BaseInStream::Link: Unable to reverse link"); … … 86 82 NYIA; 87 83 } 88 //FINEST("BaseInStream::Link: Done reverse link");89 84 } 90 //FINEST("BaseInStream::Link: Signal OutStreamAttached");91 85 SignalOutStreamAttached(pOutStream); 92 //FINEST("BaseInStream::Link: Done");93 86 return true; 94 87 } 95 88 96 89 bool BaseInStream::UnLink(BaseOutStream *pOutStream, bool reverseUnLink) { 97 // FINEST("BaseInStream::UnLink: this: %u; pOutStream: %u; reverseUnLink: %d",98 // GetUniqueId(), pOutStream->GetUniqueId(), reverseUnLink);99 90 if (!MAP_HAS1(_linkedStreams, pOutStream->GetUniqueId())) { 100 91 WARN("BaseInStream::UnLink: This stream is not linked"); … … 102 93 } 103 94 104 //FINEST("BaseInStream::UnLink: UnLinking...");105 95 _linkedStreams.erase(pOutStream->GetUniqueId()); 106 96 LinkedListNode<BaseOutStream *> *pTemp = _pOutStreams; … … 108 98 if (pTemp->info->GetUniqueId() == pOutStream->GetUniqueId()) { 109 99 _pOutStreams = RemoveLinkedList<BaseOutStream *>(pTemp); 110 //FINEST("BaseInStream::UnLink: Stream unlinked from the list");111 100 break; 112 101 } … … 115 104 116 105 if (reverseUnLink) { 117 //FINEST("BaseInStream::UnLink: Reverse unLinking...");118 106 if (!pOutStream->UnLink(false)) { 119 107 FATAL("BaseInStream::UnLink: Unable to reverse unLink"); … … 121 109 NYIA; 122 110 } 123 //FINEST("BaseInStream::UnLink: Done reverse unLink");124 111 } 125 // FINEST("BaseInStream::UnLink: _canCallOutStreamDetached: %d",126 // _canCallOutStreamDetached);127 112 if (_canCallOutStreamDetached) { 128 //FINEST("BaseInStream::UnLink: Signal OutStreamDetached");129 113 SignalOutStreamDetached(pOutStream); 130 114 } 131 //FINEST("BaseInStream::UnLink: Done");132 115 return true; 133 116 } -
trunk/sources/thelib/src/streaming/baseoutstream.cpp
r202 r410 58 58 return false; 59 59 } 60 // FINEST("BaseOutStream::Link: this: %u; pInStream: %u; reverseLink: %d",61 // GetUniqueId(), pInStream->GetUniqueId(), reverseLink);62 60 if (_pInStream != NULL) { 63 61 if (_pInStream->GetUniqueId() == pInStream->GetUniqueId()) { … … 69 67 return false; 70 68 } 71 //FINEST("BaseOutStream::Link: Linking...");72 69 _pInStream = pInStream; 73 70 if (reverseLink) { 74 //FINEST("BaseOutStream::Link: Reverse linking...");75 71 if (!_pInStream->Link(this, false)) { 76 72 FATAL("BaseOutStream::Link: Unable to reverse link"); … … 78 74 return false; 79 75 } 80 //FINEST("BaseOutStream::Link: Done reverse link");81 76 } 82 //FINEST("BaseOutStream::Link: Signal AttachedToInStream");83 77 SignalAttachedToInStream(); 84 //FINEST("BaseOutStream::Link: Done");85 78 return true; 86 79 } 87 80 88 81 bool BaseOutStream::UnLink(bool reverseUnLink) { 89 // FINEST("BaseOutStream::UnLink: this: %u; _pInStream: %u; reverseUnLink: %d",90 // GetUniqueId(), _pInStream != NULL ? _pInStream->GetUniqueId() : 0,91 // reverseUnLink);92 82 if (_pInStream == NULL) { 93 83 WARN("BaseOutStream::UnLink: This stream is not linked"); … … 95 85 } 96 86 if (reverseUnLink) { 97 //FINEST("BaseOutStream::UnLink: Reverse unLinking...");98 87 if (!_pInStream->UnLink(this, false)) { 99 88 FATAL("BaseOutStream::UnLink: Unable to reverse unLink"); … … 101 90 NYIA; 102 91 } 103 //FINEST("BaseOutStream::UnLink: Done reverse unLink");104 92 } 105 //FINEST("BaseOutStream::UnLink: unLinking...");106 93 _pInStream = NULL; 107 108 // FINEST("BaseOutStream::UnLink: _canCallDetachedFromInStream: %d",109 // _canCallDetachedFromInStream);110 94 if (_canCallDetachedFromInStream) { 111 //FINEST("BaseOutStream::UnLink: Signal DetachedFromInStream");112 95 SignalDetachedFromInStream(); 113 96 } 114 //FINEST("BaseOutStream::UnLink: Done");115 97 return true; 116 98 } -
trunk/sources/thelib/src/streaming/basestream.cpp
r243 r410 34 34 _creationTimestamp /= (double) CLOCKS_PER_SECOND; 35 35 _creationTimestamp *= 1000.00; 36 //FINEST("Stream %u created: %s", _uniqueId, STR(tagToString(_type)));37 36 } 38 37 39 38 BaseStream::~BaseStream() { 40 39 _pStreamsManager->UnRegisterStream(this); 41 //FINEST("Stream %u deleted: %s", _uniqueId, STR(tagToString(_type)));42 40 } 43 41 -
trunk/sources/thelib/src/streaming/packetqueue.cpp
r379 r410 91 91 Packet *pPacket = NULL; 92 92 if (_free.size() != 0) { 93 //FINEST("cache");94 93 pPacket = _free[0]; 95 94 _free.erase(_free.begin()); 96 95 } else { 97 //FINEST("new");98 96 pPacket = new Packet; 99 97 pPacket->buffer.ReadFromRepeat(0, _initialBuffer); -
trunk/sources/thelib/src/streaming/streamcapabilities.cpp
r399 r410 70 70 //E.1.2 HRD parameters syntax 71 71 //14496-10.pdf 268/280 72 //FINEST("------BEGIN VUI HRD------");73 72 READ_EG("cpb_cnt_minus1", uint64_t); 74 73 READ_INT("bit_rate_scale", uint8_t, 4); … … 95 94 READ_INT("dpb_output_delay_length_minus1", uint8_t, 5); 96 95 READ_INT("time_offset_length", uint8_t, 5); 97 //FINEST("------END VUI HRD------");98 96 return true; 99 97 } … … 102 100 //E.1.1 VUI parameters syntax 103 101 //14496-10.pdf 267/280 104 //FINEST("------BEGIN VUI------");105 102 READ_BOOL("aspect_ratio_info_present_flag"); 106 103 if ((bool)v["aspect_ratio_info_present_flag"]) { … … 164 161 READ_EG("max_dec_frame_buffering", uint64_t); 165 162 } 166 //FINEST("------END VUI------");167 163 return true; 168 164 } … … 171 167 //7.3.2.1 Sequence parameter set RBSP syntax 172 168 //14496-10.pdf 43/280 173 //FINEST("ba: %d", ba.AvailableBits());174 //FINEST("------BEGIN SPS------");175 169 READ_INT("profile_idc", uint8_t, 8); 176 170 READ_BOOL("constraint_set0_flag"); … … 220 214 } 221 215 } 222 //FINEST("------END SPS------");223 216 return true; 224 217 } … … 227 220 //7.3.2.2 Picture parameter set RBSP syntax 228 221 //14496-10.pdf 44/280 229 //FINEST("ba: %d", ba.AvailableBits());230 222 READ_EG("pic_parameter_set_id", uint64_t); 231 223 READ_EG("seq_parameter_set_id", uint64_t); … … 318 310 _width = ((uint32_t) _SPSInfo["pic_width_in_mbs_minus1"] + 1)*16; 319 311 _height = ((uint32_t) _SPSInfo["pic_height_in_map_units_minus1"] + 1)*16; 320 //FINEST("_SPSInfo:\n%s", STR(_SPSInfo.ToString()));321 312 } 322 313 … … 326 317 WARN("Unable to read PPS info"); 327 318 } 328 // else {329 // FINEST("_PPSInfo:\n%s", STR(_PPSInfo.ToString()));330 // }331 332 //FINEST("\n%s", STR(*this));333 319 334 320 return true; … … 381 367 382 368 //1. Prepare the bit array 383 // uint8_t temp[] = {0x13, 0x10, 0x56, 0xE5, 0x98};384 // length = sizeof (temp);385 // pBuffer = temp;386 369 BitArray ba; 387 370 ba.ReadFromBuffer(pBuffer, length); … … 402 385 return false; 403 386 } 404 //FINEST("_audioObjectType: %d", _audioObjectType);405 387 406 388 //3. Read the sample rate index … … 411 393 return false; 412 394 } 413 //FINEST("_sampleRateIndex: %d", _sampleRateIndex);414 395 if (_sampleRateIndex == 15) { 415 396 if (length < 5) { … … 425 406 _sampleRate = rates[_sampleRateIndex]; 426 407 } 427 //FINEST("_sampleRate: %d", _sampleRate);428 408 429 409 //4. read the channel configuration index … … 434 414 return false; 435 415 } 436 //FINEST("_channelConfigurationIndex: %d", _channelConfigurationIndex);437 416 438 417 _pAAC = new uint8_t[length]; … … 440 419 _aacLength = length; 441 420 442 //FINEST("AAC codec:\n%s", STR(*this));443 421 444 422 return true; -
trunk/sources/thelib/src/streaming/streamsmanager.cpp
r236 r410 145 145 146 146 map<uint32_t, BaseStream *> StreamsManager::FindByType(uint64_t type, bool partial) { 147 // FINEST("FindByType: type: %s; partial: %d",148 // STR(tagToString(type)), partial);149 147 map<uint32_t, BaseStream * > result; 150 148 … … 159 157 for (map<uint64_t, map<uint32_t, BaseStream * > >::iterator i = _streamsByType.begin(); 160 158 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));163 159 if ((MAP_KEY(i) & mask) == type) { 164 //FINEST("FindByType: matched");165 160 166 161 FOR_MAP(MAP_VAL(i), uint32_t, BaseStream *, j) { … … 175 170 map<uint32_t, BaseStream *> StreamsManager::FindByTypeByName(uint64_t type, 176 171 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);179 172 //1. Filter on type 180 173 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 // }187 174 188 175 //2. Filter on name
Note: See TracChangeset
for help on using the changeset viewer.
