Added TS support to controller, updated TS-related coding style for merge.
This commit is contained in:
parent
3b70789e27
commit
49849e9d59
3 changed files with 200 additions and 182 deletions
|
@ -20,7 +20,6 @@
|
|||
#include <mist/ts_packet.h> //TS support
|
||||
#include <mist/dtsc.h> //DTSC support
|
||||
#include <mist/mp4.h> //For initdata conversion
|
||||
|
||||
/// The main function of the connector
|
||||
/// \param conn A connection with the client
|
||||
/// \param streamname The name of the stream
|
||||
|
@ -81,8 +80,7 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
|
|||
int TSType;
|
||||
bool FirstPic = true;
|
||||
while (DTMIData.size()){
|
||||
ThisNaluSize = (DTMIData[0] << 24) + (DTMIData[1] << 16) +
|
||||
(DTMIData[2] << 8) + DTMIData[3];
|
||||
ThisNaluSize = (DTMIData[0] << 24) + (DTMIData[1] << 16) + (DTMIData[2] << 8) + DTMIData[3];
|
||||
DTMIData.erase(0, 4); //Erase the first four characters;
|
||||
TSType = (int)DTMIData[0] & 0x1F;
|
||||
if (TSType == 0x05){
|
||||
|
@ -185,11 +183,14 @@ int TS_Handler( Socket::Connection conn, std::string streamname ) {
|
|||
|
||||
int main(int argc, char ** argv){
|
||||
Util::Config conf(argv[0], PACKAGE_VERSION);
|
||||
conf.addOption("streamname",JSON::fromString("{\"arg\":\"string\",\"arg_num\":1,\"help\":\"The name of the stream that this connector will transmit.\"}"));
|
||||
conf.addOption("streamname",
|
||||
JSON::fromString("{\"arg\":\"string\",\"arg_num\":1,\"help\":\"The name of the stream that this connector will transmit.\"}"));
|
||||
conf.addConnectorOptions(8888);
|
||||
conf.parseArgs(argc, argv);
|
||||
Socket::Server server_socket = Socket::Server(conf.getInteger("listen_port"), conf.getString("listen_interface"));
|
||||
if (!server_socket.connected()){return 1;}
|
||||
if ( !server_socket.connected()){
|
||||
return 1;
|
||||
}
|
||||
conf.activate();
|
||||
|
||||
while (server_socket.connected() && conf.is_active){
|
||||
|
|
|
@ -159,9 +159,25 @@ namespace Controller {
|
|||
capa["connectors"]["RTMP"]["optional"]["interface"]["help"] = "Address of the interface to listen on - default if unprovided is all interfaces";
|
||||
capa["connectors"]["RTMP"]["optional"]["interface"]["type"] = "str";
|
||||
capa["connectors"]["RTMP"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["RTMP"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["RTMP"]["optional"]["username"]["help"] =
|
||||
"Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["RTMP"]["optional"]["username"]["type"] = "str";
|
||||
capa["connectors"]["HTTP"]["desc"] = "Enables the generic HTTP listener, required by all other HTTP protocols. Needs other HTTP protocols enabled to do much of anything.";
|
||||
capa["connectors"]["TS"]["desc"] = "Enables the raw MPEG Transport Stream protocol over TCP.";
|
||||
capa["connectors"]["TS"]["deps"] = "";
|
||||
capa["connectors"]["TS"]["required"]["port"]["name"] = "TCP port";
|
||||
capa["connectors"]["TS"]["required"]["port"]["help"] = "TCP port to listen on";
|
||||
capa["connectors"]["TS"]["required"]["port"]["type"] = "uint";
|
||||
capa["connectors"]["TS"]["required"]["args"]["name"] = "Stream";
|
||||
capa["connectors"]["TS"]["required"]["args"]["help"] = "What streamname to serve - for multiple streams, add this protocol multiple times.";
|
||||
capa["connectors"]["TS"]["required"]["args"]["type"] = "str";
|
||||
capa["connectors"]["TS"]["optional"]["interface"]["name"] = "Interface";
|
||||
capa["connectors"]["TS"]["optional"]["interface"]["help"] = "Address of the interface to listen on - default if unprovided is all interfaces";
|
||||
capa["connectors"]["TS"]["optional"]["interface"]["type"] = "str";
|
||||
capa["connectors"]["TS"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["TS"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["TS"]["optional"]["username"]["type"] = "str";
|
||||
capa["connectors"]["HTTP"]["desc"] =
|
||||
"Enables the generic HTTP listener, required by all other HTTP protocols. Needs other HTTP protocols enabled to do much of anything.";
|
||||
capa["connectors"]["HTTP"]["deps"] = "";
|
||||
capa["connectors"]["HTTP"]["optional"]["port"]["name"] = "TCP port";
|
||||
capa["connectors"]["HTTP"]["optional"]["port"]["help"] = "TCP port to listen on - default if unprovided is 8080";
|
||||
|
@ -170,22 +186,26 @@ namespace Controller {
|
|||
capa["connectors"]["HTTP"]["optional"]["interface"]["help"] = "Address of the interface to listen on - default if unprovided is all interfaces";
|
||||
capa["connectors"]["HTTP"]["optional"]["interface"]["type"] = "str";
|
||||
capa["connectors"]["HTTP"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["HTTP"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTP"]["optional"]["username"]["help"] =
|
||||
"Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTP"]["optional"]["username"]["type"] = "str";
|
||||
capa["connectors"]["HTTPProgressive"]["desc"] = "Enables HTTP protocol progressive streaming.";
|
||||
capa["connectors"]["HTTPProgressive"]["deps"] = "HTTP";
|
||||
capa["connectors"]["HTTPProgressive"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["HTTPProgressive"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPProgressive"]["optional"]["username"]["help"] =
|
||||
"Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPProgressive"]["optional"]["username"]["type"] = "str";
|
||||
capa["connectors"]["HTTPDynamic"]["desc"] = "Enables HTTP protocol Adobe-specific dynamic streaming (aka HDS).";
|
||||
capa["connectors"]["HTTPDynamic"]["deps"] = "HTTP";
|
||||
capa["connectors"]["HTTPDynamic"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["HTTPDynamic"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPDynamic"]["optional"]["username"]["help"] =
|
||||
"Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPDynamic"]["optional"]["username"]["type"] = "str";
|
||||
capa["connectors"]["HTTPSmooth"]["desc"] = "Enables HTTP protocol MicroSoft-specific smooth streaming through silverlight.";
|
||||
capa["connectors"]["HTTPSmooth"]["deps"] = "HTTP";
|
||||
capa["connectors"]["HTTPSmooth"]["optional"]["username"]["name"] = "Username";
|
||||
capa["connectors"]["HTTPSmooth"]["optional"]["username"]["help"] = "Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPSmooth"]["optional"]["username"]["help"] =
|
||||
"Username to drop privileges to - default if unprovided means do not drop privileges";
|
||||
capa["connectors"]["HTTPSmooth"]["optional"]["username"]["type"] = "str";
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <mist/ts_packet.h> //TS support
|
||||
#include <mist/dtsc.h> //DTSC support
|
||||
#include <mist/mp4.h> //For initdata conversion
|
||||
|
||||
int main(){
|
||||
char charBuffer[1024 * 10];
|
||||
unsigned int charCount;
|
||||
|
@ -31,7 +30,6 @@ int main( ) {
|
|||
MP4::AVCC avccbox;
|
||||
bool haveAvcc = false;
|
||||
|
||||
|
||||
while (std::cin.good()){
|
||||
if (DTSCStream.parsePacket(StrData)){
|
||||
if ( !haveAvcc){
|
||||
|
@ -53,8 +51,7 @@ int main( ) {
|
|||
int TSType;
|
||||
bool FirstPic = true;
|
||||
while (DTMIData.size()){
|
||||
ThisNaluSize = (DTMIData[0] << 24) + (DTMIData[1] << 16) +
|
||||
(DTMIData[2] << 8) + DTMIData[3];
|
||||
ThisNaluSize = (DTMIData[0] << 24) + (DTMIData[1] << 16) + (DTMIData[2] << 8) + DTMIData[3];
|
||||
DTMIData.erase(0, 4); //Erase the first four characters;
|
||||
TSType = (int)DTMIData[0] & 0x1F;
|
||||
if (TSType == 0x05){
|
||||
|
|
Loading…
Add table
Reference in a new issue