You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Moved AppendDebugMessage to ZmqLogger, and updated 100+ references to use this new function. Removed debug var from readers/writers, and moved it to ZmqLogger.Enable(true/false). This allows debug output from all classes and functions, without any duplicate code. Also added some additional debug output for video playback and audio readers.
This commit is contained in:
@@ -58,55 +58,6 @@ ReaderBase::ReaderBase()
|
||||
info.channel_layout = LAYOUT_MONO;
|
||||
info.audio_stream_index = -1;
|
||||
info.audio_timebase = Fraction();
|
||||
|
||||
// Initialize debug mode
|
||||
debug = false;
|
||||
}
|
||||
|
||||
// Append debug information as JSON
|
||||
void ReaderBase::AppendDebugMethod(string method_name, string arg1_name, float arg1_value,
|
||||
string arg2_name, float arg2_value,
|
||||
string arg3_name, float arg3_value,
|
||||
string arg4_name, float arg4_value,
|
||||
string arg5_name, float arg5_value,
|
||||
string arg6_name, float arg6_value)
|
||||
{
|
||||
if (!debug)
|
||||
// Don't do anything
|
||||
return;
|
||||
|
||||
// Output to standard output
|
||||
#pragma omp critical (debug_output)
|
||||
{
|
||||
stringstream message;
|
||||
message << fixed << setprecision(4);
|
||||
message << method_name << " (";
|
||||
|
||||
// Add attributes to method JSON
|
||||
if (arg1_name.length() > 0)
|
||||
message << arg1_name << "=" << arg1_value;
|
||||
|
||||
if (arg2_name.length() > 0)
|
||||
message << ", " << arg2_name << "=" << arg2_value;
|
||||
|
||||
if (arg3_name.length() > 0)
|
||||
message << ", " << arg3_name << "=" << arg3_value;
|
||||
|
||||
if (arg4_name.length() > 0)
|
||||
message << ", " << arg4_name << "=" << arg4_value;
|
||||
|
||||
if (arg5_name.length() > 0)
|
||||
message << ", " << arg5_name << "=" << arg5_value;
|
||||
|
||||
if (arg6_name.length() > 0)
|
||||
message << ", " << arg6_name << "=" << arg6_value;
|
||||
|
||||
// Output to standard output
|
||||
message << ")" << endl;
|
||||
|
||||
// Send message through ZMQ
|
||||
ZmqLogger::Instance()->Log(message.str());
|
||||
}
|
||||
}
|
||||
|
||||
// Display file information
|
||||
|
||||
Reference in New Issue
Block a user