Skip to content

Commit

Permalink
refactor(Processing): Improve debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsnen committed May 31, 2021
1 parent f51db00 commit 623f80f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/media/processing/displayfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "logger.h"

#include <QImage>
#include <QtDebug>
#include <QDateTime>
#include <QSettings>

Expand Down Expand Up @@ -60,7 +59,7 @@ void DisplayFilter::process()
// without adding too much latency

std::unique_ptr<Data> input = getInput();
while(input)
while (input)
{
QImage::Format format;

Expand All @@ -80,15 +79,15 @@ void DisplayFilter::process()
break;
}

if(input->type == input_)
if (input->type == input_)
{
QImage image(
input->data.get(),
input->width,
input->height,
format);

if(flipEnabled_)
if (flipEnabled_)
{
image = image.mirrored(horizontalMirroring_, verticalMirroring_);
}
Expand Down
16 changes: 14 additions & 2 deletions src/media/processing/filtergraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include "media/processing/audiomixerfilter.h"
#include "media/processing/audiooutputfilter.h"

#include "audioframebuffer.h"

#include "ui/gui/videointerface.h"

#include "speexaec.h"
Expand Down Expand Up @@ -76,6 +78,10 @@ void FilterGraph::init(VideoInterface* selfView, StatisticsInterface* stats)
{
Q_ASSERT(stats);

uninit();

quitting_ = false;

stats_ = stats;
selfviewFilter_ =
std::shared_ptr<DisplayFilter>(new DisplayFilter("Self", stats_, selfView, 1111));
Expand Down Expand Up @@ -198,7 +204,7 @@ void FilterGraph::updateAudioSettings()

void FilterGraph::initSelfView()
{
Logger::getLogger()->printNormal(this, "Iniating camera and selfview");
Logger::getLogger()->printNormal(this, "Iniating camera");

QSettings settings(settingsFile, settingsFileFormat);
videoFormat_ = settings.value(SettingsKey::videoInputFormat).toString();
Expand Down Expand Up @@ -228,6 +234,7 @@ void FilterGraph::initSelfView()

if (selfviewFilter_)
{
Logger::getLogger()->printNormal(this, "Iniating self view");
// connect scaling filter
// TODO: not useful if it does not support YUV. Testing needed to verify
/*
Expand All @@ -252,6 +259,10 @@ void FilterGraph::initSelfView()
addToGraph(selfviewFilter_, cameraGraph_);
addToGraph(selfviewFilter_, screenShareGraph_);
}
else
{
Logger::getLogger()->printProgramError(this, "Self view filter has not been set");
}

selectVideoSource();
}
Expand Down Expand Up @@ -606,7 +617,8 @@ void FilterGraph::camera(bool state)
}
else
{
Logger::getLogger()->printNormal(this, "Starting camera");
Logger::getLogger()->printNormal(this, "Starting camera", "Output Type",
QString::number(cameraGraph_.at(0)->outputType()));
selfviewFilter_->setProperties(true, cameraGraph_.at(0)->outputType() == RGB32VIDEO);
cameraGraph_.at(0)->start();
}
Expand Down

0 comments on commit 623f80f

Please sign in to comment.