From 9f017112691bd41ed6fbfccc731125ee1636e3de Mon Sep 17 00:00:00 2001 From: Erik Zandvliet Date: Sun, 13 Mar 2011 18:02:50 +0100 Subject: [PATCH] First try on new metadata --- .gitignore | 2 ++ AMF_Creator/output.bin | Bin 584 -> 584 bytes Connector_HTTP/main.cpp | 42 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6dc6fca3..7a6c4c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ Connector_RTSP/Connector_RTSP *~ bin/* gearbox/plugins/001_putserversup.sh +AMF_Tester/AMFtest +AMF_Creator/AMFtest diff --git a/AMF_Creator/output.bin b/AMF_Creator/output.bin index 0c650372a425a4caa74198220cb989458775c7d3..869c1173bc1d16f0211fab6a457fcda9d1b7e9a1 100644 GIT binary patch delta 53 zcmX@Xa)L#PiGeFW&o{Ls(Iv4Yk%NJOL6Cv7q$n{tJ2NjWp9{!mnyBQ<$T+beosn_l HjRHmhcFzs^ delta 53 zcmX@Xa)L#PiGeFW&o{Ls(Iv4Yk%IvQI7^BWle07P((<`L+=)uQj0_VC(is^x-Y8%M E0CbZLdata[7] << 24 ) + (tag->data[4] << 16 ) + (tag->data[5] << 8 ) + (tag->data[6] ) ); } +std::string GetMetaData( ) { + AMFType amfreply("container", (unsigned char)AMF0_DDV_CONTAINER); + amfreply.addContent(AMFType("onMetaData",(unsigned char)AMF0_STRING)); + amfreply.addContent(AMFType("",(unsigned char)AMF0_ECMA_ARRAY)); + amfreply.getContentP(1)->addContent(AMFType("trackinfo", (unsigned char)AMF0_STRICT_ARRAY)); + amfreply.getContentP(1)->getContentP(0)->addContent(AMFType("arrVal")); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->addContent(AMFType("timescale",(double)100000)); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->addContent(AMFType("length",(double)59641700)); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->addContent(AMFType("language","eng")); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->addContent(AMFType("sampledescription", (unsigned char)AMF0_STRICT_ARRAY)); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->getContentP(3)->addContent(AMFType("arrVal")); + amfreply.getContentP(1)->getContentP(0)->getContentP(0)->getContentP(3)->getContentP(0)->addContent(AMFType("sampletype","avc1")); + amfreply.getContentP(1)->getContentP(0)->addContent(AMFType("arrVal")); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->addContent(AMFType("timescale",(double)48000)); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->addContent(AMFType("length",(double)28630000)); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->addContent(AMFType("language","eng")); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->addContent(AMFType("sampledescription", (unsigned char)AMF0_STRICT_ARRAY)); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->getContentP(3)->addContent(AMFType("arrVal")); + amfreply.getContentP(1)->getContentP(0)->getContentP(1)->getContentP(3)->getContentP(0)->addContent(AMFType("sampletype","mp4a")); + amfreply.getContentP(1)->addContent(AMFType("audiochannels",(double)2)); + amfreply.getContentP(1)->addContent(AMFType("audiosamplerate",(double)48000)); + amfreply.getContentP(1)->addContent(AMFType("videoframerate",(double)23.9981)); + amfreply.getContentP(1)->addContent(AMFType("aacaot",(double)2)); + amfreply.getContentP(1)->addContent(AMFType("avclevel",(double)12)); + amfreply.getContentP(1)->addContent(AMFType("avcprofile",(double)77)); + amfreply.getContentP(1)->addContent(AMFType("audiocodecid","mp4a")); + amfreply.getContentP(1)->addContent(AMFType("videocodecid","avc1")); + amfreply.getContentP(1)->addContent(AMFType("width",(double)320)); + amfreply.getContentP(1)->addContent(AMFType("height",(double)180)); + amfreply.getContentP(1)->addContent(AMFType("frameWidth",(double)320)); + amfreply.getContentP(1)->addContent(AMFType("frameHeight",(double)180)); + amfreply.getContentP(1)->addContent(AMFType("displayWidth",(double)320)); + amfreply.getContentP(1)->addContent(AMFType("displayHeight",(double)180)); + amfreply.getContentP(1)->addContent(AMFType("moovposition",(double)35506700)); + amfreply.getContentP(1)->addContent(AMFType("duration",(double)596.458)); + return amfreply.Pack( ); +} + std::string BuildManifest( std::string MetaData, std::string MovieId, int CurrentMediaTime ) { Interface * temp = new Interface; std::string Result="\n\n"; @@ -67,7 +106,7 @@ std::string BuildManifest( std::string MetaData, std::string MovieId, int Curren Result += MovieId; Result += "/\">\n"; Result += ""; - Result += base64_encode(MetaData); + Result += base64_encode(GetMetaData()); Result += "\n"; Result += "\n"; Result += "\n"; @@ -76,6 +115,7 @@ std::string BuildManifest( std::string MetaData, std::string MovieId, int Curren } int mainHandler(int CONN_fd){ +// GetMetaData( ); return 0; int handler = HANDLER_PROGRESSIVE; bool ready4data = false;//set to true when streaming starts bool inited = false;