Updated FLV library to use DTSC::Meta instead of JSON::Value
This commit is contained in:
parent
9e44dde4a1
commit
5536bf89f9
2 changed files with 9 additions and 11 deletions
|
@ -310,7 +310,7 @@ namespace Connector_RTMP {
|
||||||
///\param inputBuffer A buffer filled with chunk data.
|
///\param inputBuffer A buffer filled with chunk data.
|
||||||
void parseChunk(Socket::Buffer & inputBuffer){
|
void parseChunk(Socket::Buffer & inputBuffer){
|
||||||
//for DTSC conversion
|
//for DTSC conversion
|
||||||
static JSON::Value meta_out;
|
static DTSC::Meta meta_out;
|
||||||
static std::stringstream prebuffer; // Temporary buffer before sending real data
|
static std::stringstream prebuffer; // Temporary buffer before sending real data
|
||||||
static bool sending = false;
|
static bool sending = false;
|
||||||
static unsigned int counter = 0;
|
static unsigned int counter = 0;
|
||||||
|
@ -424,7 +424,7 @@ namespace Connector_RTMP {
|
||||||
if (ss.connected()){
|
if (ss.connected()){
|
||||||
if (streamReset){
|
if (streamReset){
|
||||||
//reset push data to empty, in case stream properties change
|
//reset push data to empty, in case stream properties change
|
||||||
meta_out.null();
|
meta_out.reset();
|
||||||
prebuffer.str("");
|
prebuffer.str("");
|
||||||
sending = false;
|
sending = false;
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
@ -437,15 +437,15 @@ namespace Connector_RTMP {
|
||||||
counter++;
|
counter++;
|
||||||
if (counter > 8){
|
if (counter > 8){
|
||||||
sending = true;
|
sending = true;
|
||||||
ss.SendNow(meta_out.toNetPacked());
|
meta_out.send(ss);
|
||||||
ss.SendNow(prebuffer.str().c_str(), prebuffer.str().size()); //write buffer
|
ss.SendNow(prebuffer.str()); //write buffer
|
||||||
prebuffer.str(""); //clear buffer
|
prebuffer.str(""); //clear buffer
|
||||||
ss.SendNow(pack_out.toNetPacked());
|
pack_out.sendTo(ss);
|
||||||
}else{
|
}else{
|
||||||
prebuffer << pack_out.toNetPacked();
|
prebuffer << pack_out.toNetPacked();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ss.SendNow(pack_out.toNetPacked());
|
pack_out.sendTo(ss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace Converters {
|
||||||
///\return The return code for the converter.
|
///\return The return code for the converter.
|
||||||
int FLV2DTSC(std::ostream & output){
|
int FLV2DTSC(std::ostream & output){
|
||||||
FLV::Tag FLV_in; // Temporary storage for incoming FLV data.
|
FLV::Tag FLV_in; // Temporary storage for incoming FLV data.
|
||||||
JSON::Value meta_out; // Storage for outgoing header data.
|
DTSC::Meta meta_out; // Storage for outgoing header data.
|
||||||
JSON::Value pack_out; // Storage for outgoing data.
|
JSON::Value pack_out; // Storage for outgoing data.
|
||||||
std::stringstream prebuffer; // Temporary buffer before sending real data
|
std::stringstream prebuffer; // Temporary buffer before sending real data
|
||||||
bool sending = false;
|
bool sending = false;
|
||||||
|
@ -40,8 +40,7 @@ namespace Converters {
|
||||||
counter++;
|
counter++;
|
||||||
if (counter > 8){
|
if (counter > 8){
|
||||||
sending = true;
|
sending = true;
|
||||||
meta_out["moreheader"] = 0LL;
|
output << meta_out.toJSON().toNetPacked();
|
||||||
output << meta_out.toNetPacked();
|
|
||||||
output << prebuffer.rdbuf();
|
output << prebuffer.rdbuf();
|
||||||
prebuffer.str("");
|
prebuffer.str("");
|
||||||
std::cerr << "Buffer done, starting real-time output..." << std::endl;
|
std::cerr << "Buffer done, starting real-time output..." << std::endl;
|
||||||
|
@ -58,8 +57,7 @@ namespace Converters {
|
||||||
// if the FLV input is very short, do output it correctly...
|
// if the FLV input is very short, do output it correctly...
|
||||||
if ( !sending){
|
if ( !sending){
|
||||||
std::cerr << "EOF - outputting buffer..." << std::endl;
|
std::cerr << "EOF - outputting buffer..." << std::endl;
|
||||||
meta_out["moreheader"] = 0LL;
|
output << meta_out.toJSON().toNetPacked();
|
||||||
output << meta_out.toNetPacked();
|
|
||||||
output << prebuffer.rdbuf();
|
output << prebuffer.rdbuf();
|
||||||
}
|
}
|
||||||
std::cerr << "Done! If you output this data to a file, don't forget to run MistDTSCFix next." << std::endl;
|
std::cerr << "Done! If you output this data to a file, don't forget to run MistDTSCFix next." << std::endl;
|
||||||
|
|
Loading…
Add table
Reference in a new issue