Made HLS and HSS be non-realtime, improved HLS debug messages.
This commit is contained in:
parent
dfd914120e
commit
435633180c
2 changed files with 10 additions and 15 deletions
|
@ -33,9 +33,7 @@ namespace Mist {
|
||||||
result << "/index.m3u8\r\n";
|
result << "/index.m3u8\r\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if DEBUG >= 8
|
DEBUG_MSG(DLVL_HIGH, "Sending this index: %s", result.str().c_str());
|
||||||
std::cerr << "Sending this index:" << std::endl << result.str() << std::endl;
|
|
||||||
#endif
|
|
||||||
return result.str();
|
return result.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +86,9 @@ namespace Mist {
|
||||||
|
|
||||||
OutHLS::OutHLS(Socket::Connection & conn) : Output(conn) {
|
OutHLS::OutHLS(Socket::Connection & conn) : Output(conn) {
|
||||||
haveAvcc = false;
|
haveAvcc = false;
|
||||||
|
realTime = 0;
|
||||||
myConn.setHost(config->getString("ip"));
|
myConn.setHost(config->getString("ip"));
|
||||||
|
myConn.setBlocking(true);
|
||||||
streamName = config->getString("streamname");
|
streamName = config->getString("streamname");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,27 +186,25 @@ namespace Mist {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutHLS::sendNext(){
|
void OutHLS::sendNext(){
|
||||||
bool first = true;
|
bool first = true;
|
||||||
char * ContCounter = 0;
|
char * ContCounter = 0;
|
||||||
char * dataPointer = 0;
|
char * dataPointer = 0;
|
||||||
unsigned int dataLen = 0;
|
unsigned int dataLen = 0;
|
||||||
currentPacket.getString("data", dataPointer, dataLen); //data
|
currentPacket.getString("data", dataPointer, dataLen); //data
|
||||||
|
|
||||||
if (currentPacket.getTime() >= until){
|
if (currentPacket.getTime() >= until){
|
||||||
DEBUG_MSG(DLVL_DEVEL, "(%d) Done sending fragment", getpid() );
|
|
||||||
stop();
|
stop();
|
||||||
wantRequest = true;
|
wantRequest = true;
|
||||||
|
parseData = false;
|
||||||
HTTP_S.Chunkify("", 0, myConn);
|
HTTP_S.Chunkify("", 0, myConn);
|
||||||
HTTP_S.Clean();
|
HTTP_S.Clean();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string bs;
|
||||||
|
|
||||||
std::string bs;
|
|
||||||
//prepare bufferstring
|
//prepare bufferstring
|
||||||
if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){
|
if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){
|
||||||
bs = TS::Packet::getPESVideoLeadIn(0ul, currentPacket.getTime() * 90);
|
bs = TS::Packet::getPESVideoLeadIn(0ul, currentPacket.getTime() * 90);
|
||||||
fillPacket(first, bs.data(), bs.size(), VideoCounter);
|
fillPacket(first, bs.data(), bs.size(), VideoCounter);
|
||||||
|
|
||||||
|
@ -250,9 +248,6 @@ namespace Mist {
|
||||||
fillPacket(first, 0, 0, AudioCounter);
|
fillPacket(first, 0, 0, AudioCounter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int OutHLS::canSeekms(unsigned int ms){
|
int OutHLS::canSeekms(unsigned int ms){
|
||||||
|
@ -276,8 +271,7 @@ namespace Mist {
|
||||||
|
|
||||||
void OutHLS::onRequest(){
|
void OutHLS::onRequest(){
|
||||||
while (HTTP_R.Read(myConn)){
|
while (HTTP_R.Read(myConn)){
|
||||||
DEBUG_MSG(DLVL_DEVEL, "Received request: %s", HTTP_R.getUrl().c_str());
|
DEBUG_MSG(DLVL_MEDIUM, "Received request: %s", HTTP_R.getUrl().c_str());
|
||||||
|
|
||||||
if (HTTP_R.url == "/crossdomain.xml"){
|
if (HTTP_R.url == "/crossdomain.xml"){
|
||||||
HTTP_S.Clean();
|
HTTP_S.Clean();
|
||||||
HTTP_S.SetHeader("Content-Type", "text/xml");
|
HTTP_S.SetHeader("Content-Type", "text/xml");
|
||||||
|
|
|
@ -45,6 +45,7 @@ std::string toUTF16(std::string original) {
|
||||||
|
|
||||||
namespace Mist {
|
namespace Mist {
|
||||||
OutHSS::OutHSS(Socket::Connection & conn) : Output(conn) {
|
OutHSS::OutHSS(Socket::Connection & conn) : Output(conn) {
|
||||||
|
realTime = 0;
|
||||||
myConn.setHost(config->getString("ip"));
|
myConn.setHost(config->getString("ip"));
|
||||||
streamName = config->getString("streamname");
|
streamName = config->getString("streamname");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue