Merge branch 'development' into LTS_development
# Conflicts: # src/output/output_httpts.cpp # src/output/output_ts_base.h
This commit is contained in:
commit
aebeeabd2b
27 changed files with 41179 additions and 385 deletions
|
@ -435,12 +435,12 @@ namespace Mist {
|
|||
uint32_t fragIndice = Trk.timeToFragnum(from);
|
||||
contPAT = Trk.missedFrags + fragIndice; //PAT continuity counter
|
||||
contPMT = Trk.missedFrags + fragIndice; //PMT continuity counter
|
||||
contSDT = Trk.missedFrags + fragIndice; //SDT continuity counter
|
||||
packCounter = 0;
|
||||
parseData = true;
|
||||
wantRequest = false;
|
||||
seek(from);
|
||||
ts_from = from;
|
||||
lastVid = from * 90;
|
||||
} else {
|
||||
initialize();
|
||||
std::string request = H.url.substr(H.url.find("/", 5) + 1);
|
||||
|
|
|
@ -79,6 +79,7 @@ namespace Mist {
|
|||
/*capa["optional"]["wrappers"]["allowed"].append("theoplayer");
|
||||
capa["optional"]["wrappers"]["allowed"].append("jwplayer");*/
|
||||
capa["optional"]["wrappers"]["allowed"].append("html5");
|
||||
capa["optional"]["wrappers"]["allowed"].append("videojs");
|
||||
capa["optional"]["wrappers"]["allowed"].append("dashjs");
|
||||
//capa["optional"]["wrappers"]["allowed"].append("polytrope"); //currently borked
|
||||
capa["optional"]["wrappers"]["allowed"].append("flash_strobe");
|
||||
|
@ -605,6 +606,13 @@ namespace Mist {
|
|||
response.append((char*)dash_js, (size_t)dash_js_len);
|
||||
used = true;
|
||||
}
|
||||
if (it->asStringRef() == "videojs"){
|
||||
#include "playervideo.js.h"
|
||||
response.append((char*)playervideo_js, (size_t)playervideo_js_len);
|
||||
#include "videojs.js.h"
|
||||
response.append((char*)video_js, (size_t)video_js_len);
|
||||
used = true;
|
||||
}
|
||||
if (!used) {
|
||||
WARN_MSG("Unknown player type: %s",it->asStringRef().c_str());
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
namespace Mist {
|
||||
OutHTTPTS::OutHTTPTS(Socket::Connection & conn) : TSOutput(conn){
|
||||
sendRepeatingHeaders = 500;//PAT/PMT every 500ms (DVB spec)
|
||||
if (config->getString("target").size()){
|
||||
if (!streamName.size()){
|
||||
WARN_MSG("Recording unconnected TS output to file! Cancelled.");
|
||||
|
@ -43,7 +44,7 @@ namespace Mist {
|
|||
capa["codecs"][0u][1u].append("MP3");
|
||||
capa["codecs"][0u][1u].append("AC3");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/video/mp2t";
|
||||
capa["methods"][0u]["type"] = "html5/video/mpeg";
|
||||
capa["methods"][0u]["priority"] = 1ll;
|
||||
capa["push_urls"].append("/*.ts");
|
||||
|
||||
|
@ -65,6 +66,9 @@ namespace Mist {
|
|||
H.clearHeader("Range");
|
||||
H.clearHeader("Icy-MetaData");
|
||||
H.clearHeader("User-Agent");
|
||||
H.clearHeader("Host");
|
||||
H.clearHeader("Accept-Ranges");
|
||||
H.clearHeader("transferMode.dlna.org");
|
||||
H.SetHeader("Content-Type", "video/mpeg");
|
||||
H.setCORSHeaders();
|
||||
if(method == "OPTIONS" || method == "HEAD"){
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
namespace Mist {
|
||||
OutTS::OutTS(Socket::Connection & conn) : TSOutput(conn){
|
||||
sendRepeatingHeaders = 500;//PAT/PMT every 500ms (DVB spec)
|
||||
streamName = config->getString("streamname");
|
||||
parseData = true;
|
||||
wantRequest = false;
|
||||
|
|
|
@ -7,20 +7,23 @@ namespace Mist {
|
|||
haveHvcc = false;
|
||||
ts_from = 0;
|
||||
setBlocking(true);
|
||||
sendRepeatingHeaders = false;
|
||||
sendRepeatingHeaders = 0;
|
||||
appleCompat=false;
|
||||
lastHeaderTime = 0;
|
||||
}
|
||||
|
||||
void TSOutput::fillPacket(char const * data, size_t dataLen, bool & firstPack, bool video, bool keyframe, uint32_t pkgPid, int & contPkg){
|
||||
do {
|
||||
if (!packData.getBytesFree()){
|
||||
if ( (sendRepeatingHeaders && packCounter % 42 == 0) || !packCounter){
|
||||
if ( (sendRepeatingHeaders && thisPacket.getTime() - lastHeaderTime > sendRepeatingHeaders) || !packCounter){
|
||||
lastHeaderTime = thisPacket.getTime();
|
||||
TS::Packet tmpPack;
|
||||
tmpPack.FromPointer(TS::PAT);
|
||||
tmpPack.setContinuityCounter(++contPAT);
|
||||
sendTS(tmpPack.checkAndGetBuffer());
|
||||
sendTS(TS::createPMT(selectedTracks, myMeta, ++contPMT));
|
||||
packCounter += 2;
|
||||
sendTS(TS::createSDT(streamName, ++contSDT));
|
||||
packCounter += 3;
|
||||
}
|
||||
sendTS(packData.checkAndGetBuffer());
|
||||
packCounter ++;
|
||||
|
@ -114,7 +117,7 @@ namespace Mist {
|
|||
|
||||
while (currPack <= splitCount){
|
||||
unsigned int alreadySent = 0;
|
||||
bs = TS::Packet::getPESVideoLeadIn((currPack != splitCount ? watKunnenWeIn1Ding : dataLen+extraSize - currPack*watKunnenWeIn1Ding), packTime, offset, !currPack);
|
||||
bs = TS::Packet::getPESVideoLeadIn((currPack != splitCount ? watKunnenWeIn1Ding : dataLen+extraSize - currPack*watKunnenWeIn1Ding), packTime, offset, !currPack, Trk.bps);
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
if (!currPack){
|
||||
if (Trk.codec == "H264" && (dataPointer[4] & 0x1f) != 0x09){
|
||||
|
@ -186,7 +189,7 @@ namespace Mist {
|
|||
if (Trk.codec == "AAC"){
|
||||
tempLen += 7;
|
||||
}
|
||||
bs = TS::Packet::getPESAudioLeadIn(tempLen, packTime);// myMeta.tracks[thisPacket.getTrackId()].rate / 1000 );
|
||||
bs = TS::Packet::getPESAudioLeadIn(tempLen, packTime, Trk.bps);// myMeta.tracks[thisPacket.getTrackId()].rate / 1000 );
|
||||
fillPacket(bs.data(), bs.size(), firstPack, video, keyframe, pkgPid, contPkg);
|
||||
if (Trk.codec == "AAC"){
|
||||
bs = TS::getAudioHeader(dataLen, Trk.init);
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace Mist {
|
|||
std::map<unsigned int, int> contCounters;
|
||||
int contPAT;
|
||||
int contPMT;
|
||||
int contSDT;
|
||||
unsigned int packCounter; ///\todo update constructors?
|
||||
TS::Packet packData;
|
||||
bool haveAvcc;
|
||||
|
@ -31,8 +32,8 @@ namespace Mist {
|
|||
bool haveHvcc;
|
||||
MP4::HVCC hvccbox;
|
||||
/*LTS-END*/
|
||||
bool sendRepeatingHeaders;
|
||||
long long unsigned int ts_from;
|
||||
long long unsigned int lastVid;
|
||||
uint64_t sendRepeatingHeaders; ///< Amount of ms between PAT/PMT. Zero means do not repeat.
|
||||
uint64_t lastHeaderTime; ///< Timestamp last PAT/PMT were sent.
|
||||
uint64_t ts_from; ///< Starting time to subtract from timestamps
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue