diff options
author | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-06-03 13:03:40 +0200 |
---|---|---|
committer | Piotr Srebrny <piotr.srebrny@qt.io> | 2022-06-07 09:11:27 +0200 |
commit | 6315de038d7f2d2ffda465d667323aa2e67c8e2b (patch) | |
tree | 1bb783d8cb65e751c6034d6ef2fc0d8b2b55f561 /src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp | |
parent | c90454e368150f1a10dcab765b765df02968ac40 (diff) |
Remove some of qDebug() and move the remaining to qCDebug()
This patch moves most of the qDebug() messages to qCDebug(). Some
of the messages that seems to be of minor utility are removed.
Still some debug messages that are commented out don't compile anymore.
Change-Id: Ie30f213f41d7f4adce8aa36b15ace0ddbedfe616
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp')
-rw-r--r-- | src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp index 09e06c64a..725498d5a 100644 --- a/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp +++ b/src/plugins/multimedia/ffmpeg/qffmpeghwaccel_vaapi.cpp @@ -94,7 +94,9 @@ extern "C" { #include <unistd.h> -#include <qdebug.h> +#include <qloggingcategory.h> + +Q_LOGGING_CATEGORY(qLHWAccelVAAPI, "qt.multimedia.ffmpeg.hwaccelvaapi"); namespace QFFmpeg { @@ -110,7 +112,7 @@ static const quint32 *fourccFromPixelFormat(const QVideoFrameFormat::PixelFormat const quint32 rg16_fourcc = DRM_FORMAT_RG1616; #endif -// qDebug() << "Getting DRM fourcc for pixel format" << format; +// qCDebug(qLHWAccelVAAPI) << "Getting DRM fourcc for pixel format" << format; switch (format) { case QVideoFrameFormat::Format_Invalid: @@ -201,7 +203,7 @@ public: VAAPITextureConverter::VAAPITextureConverter(QRhi *rhi) : TextureConverterBackend(nullptr) { - qDebug() << ">>>> Creating VAAPI HW accelerator"; + qCDebug(qLHWAccelVAAPI) << ">>>> Creating VAAPI HW accelerator"; if (!rhi || rhi->backend() != QRhi::OpenGLES2) { qWarning() << "VAAPITextureConverter: No rhi or non openGL based RHI"; @@ -212,21 +214,21 @@ VAAPITextureConverter::VAAPITextureConverter(QRhi *rhi) auto *nativeHandles = static_cast<const QRhiGles2NativeHandles *>(rhi->nativeHandles()); glContext = nativeHandles->context; if (!glContext) { - qDebug() << " no GL context, disabling"; + qCDebug(qLHWAccelVAAPI) << " no GL context, disabling"; return; } const QString platform = QGuiApplication::platformName(); QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface(); eglDisplay = pni->nativeResourceForIntegration("egldisplay"); - qDebug() << " platform is" << platform << eglDisplay; + qCDebug(qLHWAccelVAAPI) << " platform is" << platform << eglDisplay; if (!eglDisplay) { - qDebug() << " no egl display, disabling"; + qCDebug(qLHWAccelVAAPI) << " no egl display, disabling"; return; } eglImageTargetTexture2D = eglGetProcAddress("glEGLImageTargetTexture2DOES"); if (!eglDisplay) { - qDebug() << " no eglImageTargetTexture2D, disabling"; + qCDebug(qLHWAccelVAAPI) << " no eglImageTargetTexture2D, disabling"; return; } @@ -241,9 +243,9 @@ VAAPITextureConverter::~VAAPITextureConverter() //#define VA_EXPORT_USE_LAYERS TextureSet *VAAPITextureConverter::getTextures(AVFrame *frame) { -// qDebug() << "VAAPIAccel::getTextures"; +// qCDebug(qLHWAccelVAAPI) << "VAAPIAccel::getTextures"; if (frame->format != AV_PIX_FMT_VAAPI || !eglDisplay) { - qDebug() << "format/egl error" << frame->format << eglDisplay; + qCDebug(qLHWAccelVAAPI) << "format/egl error" << frame->format << eglDisplay; return nullptr; } @@ -258,7 +260,7 @@ TextureSet *VAAPITextureConverter::getTextures(AVFrame *frame) auto *vaCtx = (AVVAAPIDeviceContext *)ctx->hwctx; auto vaDisplay = vaCtx->display; if (!vaDisplay) { - qDebug() << " no VADisplay, disabling"; + qCDebug(qLHWAccelVAAPI) << " no VADisplay, disabling"; return nullptr; } @@ -281,7 +283,7 @@ TextureSet *VAAPITextureConverter::getTextures(AVFrame *frame) // ### Check that prime.fourcc is what we expect vaSyncSurface(vaDisplay, vaSurface); -// qDebug() << "VAAPIAccel: vaSufraceDesc: width/height" << prime.width << prime.height << "num objects" +// qCDebug(qLHWAccelVAAPI) << "VAAPIAccel: vaSufraceDesc: width/height" << prime.width << prime.height << "num objects" // << prime.num_objects << "num layers" << prime.num_layers; QOpenGLFunctions functions(glContext); @@ -303,7 +305,7 @@ TextureSet *VAAPITextureConverter::getTextures(AVFrame *frame) } Q_ASSERT(nPlanes == desc->nplanes); nPlanes = desc->nplanes; -// qDebug() << "VAAPIAccel: nPlanes" << nPlanes; +// qCDebug(qLHWAccelVAAPI) << "VAAPIAccel: nPlanes" << nPlanes; rhi->makeThreadLocalNativeContextCurrent(); @@ -363,7 +365,7 @@ TextureSet *VAAPITextureConverter::getTextures(AVFrame *frame) for (int i = 0; i < 4; ++i) textureSet->textures[i] = glTextures[i]; -// qDebug() << "VAAPIAccel: got textures" << textures[0] << textures[1] << textures[2] << textures[3]; +// qCDebug(qLHWAccelVAAPI) << "VAAPIAccel: got textures" << textures[0] << textures[1] << textures[2] << textures[3]; return textureSet; } |