Debugging sessie uit de hel, contd
This commit is contained in:
		
							parent
							
								
									71efc65684
								
							
						
					
					
						commit
						9102b09b9c
					
				
					 2 changed files with 22 additions and 1 deletions
				
			
		|  | @ -4,7 +4,7 @@ | ||||||
| //debugging level 3 = status information
 | //debugging level 3 = status information
 | ||||||
| //debugging level 4 = extremely verbose status information
 | //debugging level 4 = extremely verbose status information
 | ||||||
| //debugging level 5 = save all streams to FLV files
 | //debugging level 5 = save all streams to FLV files
 | ||||||
| #define DEBUG 3 | #define DEBUG 4 | ||||||
| 
 | 
 | ||||||
| #include <iostream> | #include <iostream> | ||||||
| #include <cstdlib> | #include <cstdlib> | ||||||
|  |  | ||||||
|  | @ -101,6 +101,9 @@ void parseChunk(){ | ||||||
|     case 20:{//AMF0 command message
 |     case 20:{//AMF0 command message
 | ||||||
|       bool parsed = false; |       bool parsed = false; | ||||||
|       amfdata = parseAMF(next.data, next.real_len); |       amfdata = parseAMF(next.data, next.real_len); | ||||||
|  |       #if DEBUG >= 4 | ||||||
|  |       amfdata.Print(); | ||||||
|  |       #endif | ||||||
|       if (amfdata.getContentP(0)->StrValue() == "connect"){ |       if (amfdata.getContentP(0)->StrValue() == "connect"){ | ||||||
|         #if DEBUG >= 4 |         #if DEBUG >= 4 | ||||||
|         int tmpint; |         int tmpint; | ||||||
|  | @ -128,6 +131,9 @@ void parseChunk(){ | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("description", "Connection succeeded.")); |         amfreply.getContentP(3)->addContent(AMFType("description", "Connection succeeded.")); | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("capabilities", (double)33));//from red5 server
 |         amfreply.getContentP(3)->addContent(AMFType("capabilities", (double)33));//from red5 server
 | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("fmsVer", "PLS/1,0,0,0"));//from red5 server
 |         amfreply.getContentP(3)->addContent(AMFType("fmsVer", "PLS/1,0,0,0"));//from red5 server
 | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); |         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); | ||||||
|         //send onBWDone packet
 |         //send onBWDone packet
 | ||||||
|         //amfreply = AMFType("container", (unsigned char)0xFF);
 |         //amfreply = AMFType("container", (unsigned char)0xFF);
 | ||||||
|  | @ -144,6 +150,9 @@ void parseChunk(){ | ||||||
|         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 |         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 | ||||||
|         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 |         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 | ||||||
|         amfreply.addContent(AMFType("", (double)1));//stream ID - we use 1
 |         amfreply.addContent(AMFType("", (double)1));//stream ID - we use 1
 | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); |         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); | ||||||
|         SendUSR(0, 0);//send UCM StreamBegin (0), stream 0
 |         SendUSR(0, 0);//send UCM StreamBegin (0), stream 0
 | ||||||
|         parsed = true; |         parsed = true; | ||||||
|  | @ -155,6 +164,9 @@ void parseChunk(){ | ||||||
|         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 |         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 | ||||||
|         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 |         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 | ||||||
|         amfreply.addContent(AMFType("", (double)0));//zero length
 |         amfreply.addContent(AMFType("", (double)0));//zero length
 | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); |         SendChunk(3, 20, next.msg_stream_id, amfreply.Pack()); | ||||||
|         parsed = true; |         parsed = true; | ||||||
|       }//getStreamLength
 |       }//getStreamLength
 | ||||||
|  | @ -165,6 +177,9 @@ void parseChunk(){ | ||||||
|         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 |         amfreply.addContent(amfdata.getContent(1));//same transaction ID
 | ||||||
|         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 |         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 | ||||||
|         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 |         amfreply.addContent(AMFType("", (double)0, 0x05));//null - command info
 | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(3, 20, 1, amfreply.Pack()); |         SendChunk(3, 20, 1, amfreply.Pack()); | ||||||
|         parsed = true; |         parsed = true; | ||||||
|       }//checkBandwidth
 |       }//checkBandwidth
 | ||||||
|  | @ -187,6 +202,9 @@ void parseChunk(){ | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("description", "Playing and resetting...")); |         amfreply.getContentP(3)->addContent(AMFType("description", "Playing and resetting...")); | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("details", "PLS")); |         amfreply.getContentP(3)->addContent(AMFType("details", "PLS")); | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("clientid", (double)1)); |         amfreply.getContentP(3)->addContent(AMFType("clientid", (double)1)); | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(4, 20, next.msg_stream_id, amfreply.Pack()); |         SendChunk(4, 20, next.msg_stream_id, amfreply.Pack()); | ||||||
|         amfreply = AMFType("container", (unsigned char)0xFF); |         amfreply = AMFType("container", (unsigned char)0xFF); | ||||||
|         amfreply.addContent(AMFType("", "onStatus"));//status reply
 |         amfreply.addContent(AMFType("", "onStatus"));//status reply
 | ||||||
|  | @ -198,6 +216,9 @@ void parseChunk(){ | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("description", "Playing!")); |         amfreply.getContentP(3)->addContent(AMFType("description", "Playing!")); | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("details", "PLS")); |         amfreply.getContentP(3)->addContent(AMFType("details", "PLS")); | ||||||
|         amfreply.getContentP(3)->addContent(AMFType("clientid", (double)1)); |         amfreply.getContentP(3)->addContent(AMFType("clientid", (double)1)); | ||||||
|  |         #if DEBUG >= 4 | ||||||
|  |         amfreply.Print(); | ||||||
|  |         #endif | ||||||
|         SendChunk(4, 20, 1, amfreply.Pack()); |         SendChunk(4, 20, 1, amfreply.Pack()); | ||||||
| //No clue what this does. Most real servers send it, though...
 | //No clue what this does. Most real servers send it, though...
 | ||||||
| //        amfreply = AMFType("container", (unsigned char)0xFF);
 | //        amfreply = AMFType("container", (unsigned char)0xFF);
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma