From af8a7d5093e6840893229ec75b1d82a60cec192d Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sun, 22 Sep 2024 20:43:44 +0200 Subject: [PATCH] MoodbarPipeline: Rename variables --- src/moodbar/moodbarpipeline.cpp | 24 ++++++++++++------------ src/moodbar/moodbarpipeline.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/moodbar/moodbarpipeline.cpp b/src/moodbar/moodbarpipeline.cpp index 359294149..eb76e7da0 100644 --- a/src/moodbar/moodbarpipeline.cpp +++ b/src/moodbar/moodbarpipeline.cpp @@ -158,18 +158,18 @@ void MoodbarPipeline::ReportError(GstMessage *msg) { } -void MoodbarPipeline::NewPadCallback(GstElement *element, GstPad *pad, gpointer data) { +void MoodbarPipeline::NewPadCallback(GstElement *element, GstPad *pad, gpointer self) { Q_UNUSED(element) - MoodbarPipeline *self = reinterpret_cast(data); + MoodbarPipeline *instance = reinterpret_cast(self); - if (!self->running_) { + if (!instance->running_) { qLog(Warning) << "Received gstreamer callback after pipeline has stopped."; return; } - GstPad *const audiopad = gst_element_get_static_pad(self->convert_element_, "sink"); + GstPad *const audiopad = gst_element_get_static_pad(instance->convert_element_, "sink"); if (!audiopad) return; if (GST_PAD_IS_LINKED(audiopad)) { @@ -190,8 +190,8 @@ void MoodbarPipeline::NewPadCallback(GstElement *element, GstPad *pad, gpointer gst_caps_unref(caps); } - if (self->builder_) { - self->builder_->Init(kBands, rate); + if (instance->builder_) { + instance->builder_->Init(kBands, rate); } else { qLog(Error) << "Builder does not exist"; @@ -199,20 +199,20 @@ void MoodbarPipeline::NewPadCallback(GstElement *element, GstPad *pad, gpointer } -GstBusSyncReply MoodbarPipeline::BusCallbackSync(GstBus *bus, GstMessage *message, gpointer data) { +GstBusSyncReply MoodbarPipeline::BusCallbackSync(GstBus *bus, GstMessage *message, gpointer self) { Q_UNUSED(bus) - MoodbarPipeline *self = reinterpret_cast(data); + MoodbarPipeline *instance = reinterpret_cast(self); switch (GST_MESSAGE_TYPE(message)) { case GST_MESSAGE_EOS: - self->Stop(true); + instance->Stop(true); break; case GST_MESSAGE_ERROR: - self->ReportError(message); - self->Stop(false); + instance->ReportError(message); + instance->Stop(false); break; default: @@ -227,7 +227,7 @@ void MoodbarPipeline::Stop(const bool success) { success_ = success; running_ = false; - if (builder_ != nullptr) { + if (builder_) { data_ = builder_->Finish(1000); builder_.reset(); } diff --git a/src/moodbar/moodbarpipeline.h b/src/moodbar/moodbarpipeline.h index 5cefb6122..d501077dc 100644 --- a/src/moodbar/moodbarpipeline.h +++ b/src/moodbar/moodbarpipeline.h @@ -61,8 +61,8 @@ class MoodbarPipeline : public QObject { void Stop(const bool success); void Cleanup(); - static void NewPadCallback(GstElement *element, GstPad *pad, gpointer data); - static GstBusSyncReply BusCallbackSync(GstBus *bus, GstMessage *message, gpointer data); + static void NewPadCallback(GstElement *element, GstPad *pad, gpointer self); + static GstBusSyncReply BusCallbackSync(GstBus *bus, GstMessage *message, gpointer self); private: QUrl url_;