Documented and nicified AMF parsing. Updated all existing code for this change, except for RTMP connector (which gets a rewrite, like, today).

This commit is contained in:
Thulinma 2011-04-10 22:25:51 +02:00
parent 1b86b9a5ef
commit fab932253d
10 changed files with 404 additions and 341 deletions

View file

@ -1,4 +1,4 @@
SRC = main.cpp
SRC = main.cpp ../util/amf.cpp
OBJ = $(SRC:.cpp=.o)
OUT = AMFtest
INCLUDES =
@ -12,7 +12,7 @@ LIBS = -lssl -lcrypto
default: $(OUT)
.cpp.o:
$(CC) $(INCLUDES) $(CCFLAGS) -c $< -o $@
$(OUT): $(OBJ) amf.cpp
$(OUT): $(OBJ)
$(CC) $(LIBS) -o $(OUT) $(OBJ)
clean:
rm -rf $(OBJ) $(OUT) Makefile.bak *~

View file

@ -1 +0,0 @@
../util/amf.cpp

View file

@ -1,18 +1,16 @@
#define DEBUG 10 //maximum debugging level evah
#define DEBUG 10 //maximum debugging level
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include "amf.cpp"
#include "../util/amf.h"
int main() {
std::string temp;
while( std::cin.good() ) {
temp += std::cin.get();
}
static AMFType amfdata("empty", (unsigned char)AMF0_DDV_CONTAINER);
amfdata = parseAMF( (const unsigned char*)temp.c_str(), temp.length()-1 );
amfdata.Print( );
while (std::cin.good()){temp += std::cin.get();}//read all of std::cin to temp
temp.erase(temp.size()-1, 1);//strip the invalid last character
AMF::Object amfdata = AMF::parse(temp);//parse temp into an AMF::Object
amfdata.Print();//pretty-print the object
return 0;
}