Enable debug logging for GstEnginePipeline by default.

Use qLogCat to put verbose GStreamer callback messages into a new
GstEnginePipelineCallbacks category. Filter that category instead of
the entire class by default.
This commit is contained in:
Jim Broadus 2020-01-29 21:56:55 -08:00 committed by John Maguire
parent 66f354f815
commit d45a9f5c53
2 changed files with 7 additions and 5 deletions

View File

@ -42,7 +42,7 @@ static Level sDefaultLevel = Level_Debug;
static QMap<QString, Level>* sClassLevels = nullptr;
static QIODevice* sNullDevice = nullptr;
const char* kDefaultLogLevels = "GstEnginePipeline:2,*:3";
const char* kDefaultLogLevels = "GstEnginePipelineCallbacks:2,*:3";
static const char* kMessageHandlerMagic = "__logging_message__";
static const int kMessageHandlerMagicLength = strlen(kMessageHandlerMagic);

View File

@ -549,7 +549,8 @@ gboolean GstEnginePipeline::BusCallback(GstBus*, GstMessage* msg,
gpointer self) {
GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self);
qLog(Debug) << instance->id() << "bus message" << GST_MESSAGE_TYPE_NAME(msg);
qLogCat(Debug, "GstEnginePipelineCallbacks")
<< instance->id() << "bus message" << GST_MESSAGE_TYPE_NAME(msg);
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_ERROR:
@ -575,8 +576,8 @@ GstBusSyncReply GstEnginePipeline::BusCallbackSync(GstBus*, GstMessage* msg,
gpointer self) {
GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self);
qLog(Debug) << instance->id() << "sync bus message"
<< GST_MESSAGE_TYPE_NAME(msg);
qLogCat(Debug, "GstEnginePipelineCallbacks")
<< instance->id() << "sync bus message" << GST_MESSAGE_TYPE_NAME(msg);
switch (GST_MESSAGE_TYPE(msg)) {
case GST_MESSAGE_EOS:
@ -959,7 +960,8 @@ GstPadProbeReturn GstEnginePipeline::EventHandoffCallback(GstPad*,
GstEnginePipeline* instance = reinterpret_cast<GstEnginePipeline*>(self);
GstEvent* e = gst_pad_probe_info_get_event(info);
qLog(Debug) << instance->id() << "event" << GST_EVENT_TYPE_NAME(e);
qLogCat(Debug, "GstEnginePipelineCallbacks")
<< instance->id() << "event" << GST_EVENT_TYPE_NAME(e);
switch (GST_EVENT_TYPE(e)) {
case GST_EVENT_SEGMENT: