FLAC support:
- FLAC container input and output support - FLAC container analyser - FLAC codec support in EBML input and output
This commit is contained in:
parent
0f692233e8
commit
a7183aedc5
17 changed files with 948 additions and 1 deletions
|
@ -6,6 +6,7 @@ outputs = [
|
|||
{'name' : 'HTTPMinimalServer', 'format' : 'http_minimalserver', 'extra': ['http']},
|
||||
{'name' : 'MP4', 'format' : 'mp4', 'extra': ['http']},
|
||||
{'name' : 'AAC', 'format' : 'aac', 'extra': ['http']},
|
||||
{'name' : 'FLAC', 'format' : 'flac', 'extra': ['http']},
|
||||
{'name' : 'MP3', 'format' : 'mp3', 'extra': ['http']},
|
||||
{'name' : 'H264', 'format' : 'h264', 'extra': ['http']},
|
||||
{'name' : 'HDS', 'format' : 'hds', 'extra': ['http']},
|
||||
|
|
|
@ -67,6 +67,7 @@ namespace Mist{
|
|||
capa["codecs"][0u][0u].append("MPEG2");
|
||||
capa["codecs"][0u][0u].append("AV1");
|
||||
capa["codecs"][0u][1u].append("AAC");
|
||||
capa["codecs"][0u][1u].append("FLAC");
|
||||
capa["codecs"][0u][1u].append("vorbis");
|
||||
capa["codecs"][0u][1u].append("opus");
|
||||
capa["codecs"][0u][1u].append("PCM");
|
||||
|
@ -194,6 +195,7 @@ namespace Mist{
|
|||
if (codec == "PCM"){return "A_PCM/INT/BIG";}
|
||||
if (codec == "MP2"){return "A_MPEG/L2";}
|
||||
if (codec == "MP3"){return "A_MPEG/L3";}
|
||||
if (codec == "FLAC"){return "A_FLAC";}
|
||||
if (codec == "AC3"){return "A_AC3";}
|
||||
if (codec == "ALAW"){return "A_MS/ACM";}
|
||||
if (codec == "ULAW"){return "A_MS/ACM";}
|
||||
|
|
50
src/output/output_flac.cpp
Normal file
50
src/output/output_flac.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
#include "output_flac.h"
|
||||
|
||||
namespace Mist{
|
||||
|
||||
OutFLAC::OutFLAC(Socket::Connection &conn) : HTTPOutput(conn){}
|
||||
|
||||
void OutFLAC::init(Util::Config *cfg){
|
||||
HTTPOutput::init(cfg);
|
||||
capa["name"] = "FLAC";
|
||||
capa["friendly"] = "Free Lossless Audio Codec";
|
||||
capa["desc"] = "Pseudostreaming in FLAC format over HTTP";
|
||||
capa["url_rel"] = "/$.flac";
|
||||
capa["url_match"] = "/$.flac";
|
||||
capa["codecs"][0u][0u].append("FLAC");
|
||||
capa["methods"][0u]["handler"] = "http";
|
||||
capa["methods"][0u]["type"] = "html5/audio/flac";
|
||||
capa["methods"][0u]["hrn"] = "FLAC progressive";
|
||||
capa["methods"][0u]["priority"] = 8;
|
||||
|
||||
JSON::Value opt;
|
||||
opt["arg"] = "string";
|
||||
opt["default"] = "";
|
||||
opt["arg_num"] = 1;
|
||||
opt["help"] = "Target filename to store FLAC file as, or - for stdout.";
|
||||
cfg->addOption("target", opt);
|
||||
}
|
||||
|
||||
void OutFLAC::sendNext(){
|
||||
char *dataPointer = 0;
|
||||
size_t len = 0;
|
||||
thisPacket.getString("data", dataPointer, len);
|
||||
myConn.SendNow(dataPointer, len);
|
||||
}
|
||||
|
||||
void OutFLAC::sendHeader(){
|
||||
myConn.SendNow(M.getInit(M.mainTrack()));
|
||||
sentHeader = true;
|
||||
}
|
||||
|
||||
void OutFLAC::respondHTTP(const HTTP::Parser &req, bool headersOnly){
|
||||
// Set global defaults
|
||||
HTTPOutput::respondHTTP(req, headersOnly);
|
||||
|
||||
H.StartResponse("200", "OK", req, myConn);
|
||||
if (headersOnly){return;}
|
||||
parseData = true;
|
||||
wantRequest = false;
|
||||
}
|
||||
|
||||
}// namespace Mist
|
17
src/output/output_flac.h
Normal file
17
src/output/output_flac.h
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include "output_http.h"
|
||||
|
||||
namespace Mist{
|
||||
class OutFLAC : public HTTPOutput{
|
||||
public:
|
||||
OutFLAC(Socket::Connection &conn);
|
||||
static void init(Util::Config *cfg);
|
||||
virtual void respondHTTP(const HTTP::Parser &req, bool headersOnly);
|
||||
void sendNext();
|
||||
void sendHeader();
|
||||
|
||||
private:
|
||||
bool isFileTarget(){return isRecording();}
|
||||
};
|
||||
}// namespace Mist
|
||||
|
||||
typedef Mist::OutFLAC mistOut;
|
Loading…
Add table
Add a link
Reference in a new issue