From 4e10d67ae9f3fc7cb8f431a6c18e57aca8b74c57 Mon Sep 17 00:00:00 2001 From: Oswald Auguste de Bruin Date: Thu, 22 Aug 2013 16:32:23 +0200 Subject: [PATCH] MP4 progressive now bleeding edge! --- src/connectors/conn_http_progressive_mp4.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/connectors/conn_http_progressive_mp4.cpp b/src/connectors/conn_http_progressive_mp4.cpp index 80dd3cfd..460fb910 100644 --- a/src/connectors/conn_http_progressive_mp4.cpp +++ b/src/connectors/conn_http_progressive_mp4.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,13 +36,7 @@ namespace Connector_HTTP { std::string streamname;//Will contain the name of the stream. //MP4 specific variables - - //OGG specific variables - /*OGG::headerPages oggMeta; - OGG::Page curOggPage; - std::map > DTSCBuffer; - std::map prevGran;*/ - + MP4::DTSC2MP4Converter Conv; unsigned int lastStats = 0;//Indicates the last time that we have sent stats to the server socket. unsigned int seek_sec = 0;//Seek position in ms @@ -158,20 +152,25 @@ namespace Connector_HTTP { unsigned int now = Util::epoch(); if (now != lastStats){ lastStats = now; - ss.SendNow(conn.getStats("HTTP_Progressive_Ogg").c_str()); + ss.SendNow(conn.getStats("HTTP_Progressive_MP4").c_str()); } if (ss.spool()){ while (Strm.parsePacket(ss.Received())){ if ( !progressive_has_sent_header){ HTTP_S.Clean(); //make sure no parts of old requests are left in any buffers - HTTP_S.SetHeader("Content-Type", "video/ogg"); //Send the correct content-type for FLV files + HTTP_S.SetHeader("Content-Type", "video/MP4"); //Send the correct content-type for FLV files HTTP_S.protocol = "HTTP/1.0"; conn.SendNow(HTTP_S.BuildResponse("200", "OK")); //no SetBody = unknown length - this is intentional, we will stream the entire file //Fill in header here + ss.SendNow(Conv.DTSCMeta2MP4Header(Strm.metadata));//SENDING MP4HADER progressive_has_sent_header = true; } //parse DTSC to MP4 here + Conv.parseDTSC(Strm.getPacket());//parse 1 file DTSC packet + if(Conv.sendReady()){//if the converter has a part to send out + ss.SendNow(Conv.sendString());//send out and clear Convverter buffer + } } }else{ Util::sleep(1);