diff --git a/app/decoder/ffmpeg/ffmpegdecoder.cpp b/app/decoder/ffmpeg/ffmpegdecoder.cpp index 5c555773b..fc3a6f679 100644 --- a/app/decoder/ffmpeg/ffmpegdecoder.cpp +++ b/app/decoder/ffmpeg/ffmpegdecoder.cpp @@ -91,7 +91,7 @@ bool FFmpegDecoder::Open() // Handle failure to find decoder if (codec == nullptr) { - Error(tr("Failed to find appropriate decoder for this codec (%1 :: %2)") + Error(QStringLiteral("Failed to find appropriate decoder for this codec (%1 :: %2)") .arg(stream()->footage()->filename(), avstream_->codecpar->codec_id)); return false; } @@ -99,7 +99,7 @@ bool FFmpegDecoder::Open() // Allocate context for the decoder codec_ctx_ = avcodec_alloc_context3(codec); if (codec_ctx_ == nullptr) { - Error(tr("Failed to allocate codec context (%1 :: %2)").arg(stream()->footage()->filename(), stream()->index())); + Error(QStringLiteral("Failed to allocate codec context (%1 :: %2)").arg(stream()->footage()->filename(), stream()->index())); return false; } @@ -170,7 +170,7 @@ bool FFmpegDecoder::Open() // Handle failure to create packet if (pkt_ == nullptr) { - Error(tr("Failed to allocate AVPacket")); + Error(QStringLiteral("Failed to allocate AVPacket")); return false; } @@ -179,7 +179,7 @@ bool FFmpegDecoder::Open() // Handle failure to create frame if (frame_ == nullptr) { - Error(tr("Failed to allocate AVFrame")); + Error(QStringLiteral("Failed to allocate AVFrame")); return false; } @@ -199,7 +199,7 @@ FramePtr FFmpegDecoder::Retrieve(const rational &timecode, const rational &lengt int64_t target_ts = GetTimestampFromTime(timecode); if (target_ts < 0) { - Error(tr("Index failed to produce a valid timestamp")); + Error(QStringLiteral("Index failed to produce a valid timestamp")); return nullptr; } @@ -474,7 +474,7 @@ void FFmpegDecoder::FFmpegError(int error_code) char err[1024]; av_strerror(error_code, err, 1024); - Error(tr("Error decoding %1 - %2 %3").arg(stream()->footage()->filename(), + Error(QStringLiteral("Error decoding %1 - %2 %3").arg(stream()->footage()->filename(), QString::number(error_code), err)); } @@ -489,7 +489,7 @@ void FFmpegDecoder::Error(const QString &s) void FFmpegDecoder::Index() { if (!open_) { - qWarning() << tr("Indexing function tried to run while decoder was closed"); + qWarning() << "Indexing function tried to run while decoder was closed"; return; } @@ -649,7 +649,7 @@ void FFmpegDecoder::SaveFrameIndex() index_file.close(); } else { - qWarning() << tr("Failed to save index for %1").arg(stream()->footage()->filename()); + qWarning() << QStringLiteral("Failed to save index for %1").arg(stream()->footage()->filename()); } } diff --git a/app/node/param.cpp b/app/node/param.cpp index 766ed6f59..48fb68514 100644 --- a/app/node/param.cpp +++ b/app/node/param.cpp @@ -100,7 +100,7 @@ NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input) // Ensure both nodes are in the same graph if (output->parent()->parent() != input->parent()->parent()) { - qWarning() << tr("Tried to connect two nodes that aren't part of the same graph"); + qWarning() << "Tried to connect two nodes that aren't part of the same graph"; return nullptr; } diff --git a/app/render/backend/CMakeLists.txt b/app/render/backend/CMakeLists.txt index 3ab2b8854..5a3fcd7e0 100644 --- a/app/render/backend/CMakeLists.txt +++ b/app/render/backend/CMakeLists.txt @@ -35,5 +35,6 @@ set(OLIVE_SOURCES render/backend/videorendererthreadbase.cpp render/backend/renderinstance.h render/backend/renderinstance.cpp + PARENT_SCOPE ) diff --git a/app/render/backend/opengl/openglframebuffer.cpp b/app/render/backend/opengl/openglframebuffer.cpp index ee86e5dd9..426c288b0 100644 --- a/app/render/backend/opengl/openglframebuffer.cpp +++ b/app/render/backend/opengl/openglframebuffer.cpp @@ -39,7 +39,7 @@ OpenGLFramebuffer::~OpenGLFramebuffer() void OpenGLFramebuffer::Create(QOpenGLContext *ctx) { if (ctx == nullptr) { - qWarning() << tr("RenderTexture::Create was passed an invalid context"); + qWarning() << "RenderTexture::Create was passed an invalid context"; return; } diff --git a/app/render/backend/opengl/openglshader.cpp b/app/render/backend/opengl/openglshader.cpp index fb9c0b6d8..97177b411 100644 --- a/app/render/backend/opengl/openglshader.cpp +++ b/app/render/backend/opengl/openglshader.cpp @@ -171,11 +171,11 @@ QString OpenGLShader::CodeDefaultFragment(const QString &function_name, const QS frag_code.append(shader_code); - frag_code.append(QString(QStringLiteral("\n" - "void main() {\n" - " vec4 color = %1(texture2D(texture, v_texcoord));\n" - " gl_FragColor = color;\n" - "}\n")).arg(function_name)); + frag_code.append(QStringLiteral("\n" + "void main() {\n" + " vec4 color = %1(texture2D(texture, v_texcoord));\n" + " gl_FragColor = color;\n" + "}\n").arg(function_name)); } @@ -207,27 +207,27 @@ QString OpenGLShader::CodeDefaultVertex() QString OpenGLShader::CodeAlphaDisassociate(const QString &function_name) { - return QString(QStringLiteral("vec4 %1(vec4 col) {\n" - " if (col.a > 0.0) {\n" - " return vec4(col.rgb / col.a, col.a);" - " }\n" - " return col;\n" - "}\n")).arg(function_name); + return QStringLiteral("vec4 %1(vec4 col) {\n" + " if (col.a > 0.0) {\n" + " return vec4(col.rgb / col.a, col.a);" + " }\n" + " return col;\n" + "}\n").arg(function_name); } QString OpenGLShader::CodeAlphaReassociate(const QString &function_name) { - return QString(QStringLiteral("vec4 %1(vec4 col) {\n" - " if (col.a > 0.0) {\n" - " return vec4(col.rgb * col.a, col.a);" - " }\n" - " return col;\n" - "}\n")).arg(function_name); + return QStringLiteral("vec4 %1(vec4 col) {\n" + " if (col.a > 0.0) {\n" + " return vec4(col.rgb * col.a, col.a);" + " }\n" + " return col;\n" + "}\n").arg(function_name); } QString OpenGLShader::CodeAlphaAssociate(const QString &function_name) { - return QString(QStringLiteral("vec4 %1(vec4 col) {\n" - " return vec4(col.rgb * col.a, col.a);\n" - "}\n")).arg(function_name); + return QStringLiteral("vec4 %1(vec4 col) {\n" + " return vec4(col.rgb * col.a, col.a);\n" + "}\n").arg(function_name); } diff --git a/app/render/backend/opengl/opengltexture.cpp b/app/render/backend/opengl/opengltexture.cpp index 3a7f710ce..413fcb5f8 100644 --- a/app/render/backend/opengl/opengltexture.cpp +++ b/app/render/backend/opengl/opengltexture.cpp @@ -53,7 +53,7 @@ void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const oli void OpenGLTexture::Create(QOpenGLContext *ctx, int width, int height, const olive::PixelFormat &format, const OpenGLTexture::Type &type, void *data) { if (ctx == nullptr) { - qWarning() << tr("RenderTexture::Create was passed an invalid context"); + qWarning() << "RenderTexture::Create was passed an invalid context"; return; } @@ -150,7 +150,7 @@ void OpenGLTexture::SwapFrontAndBack() void OpenGLTexture::Upload(const void *data) { if (!IsCreated()) { - qWarning() << tr("RenderTexture::Upload() called while it wasn't created"); + qWarning() << "RenderTexture::Upload() called while it wasn't created"; return; } @@ -165,7 +165,7 @@ void OpenGLTexture::Upload(const void *data) width_, height_, info.pixel_format, - info.pixel_type, + info.gl_pixel_type, data); Release(); @@ -174,7 +174,7 @@ void OpenGLTexture::Upload(const void *data) uchar *OpenGLTexture::Download() const { if (!IsCreated()) { - qWarning() << tr("RenderTexture::Download() called while it wasn't created"); + qWarning() << "RenderTexture::Download() called while it wasn't created"; return nullptr; } @@ -194,7 +194,7 @@ uchar *OpenGLTexture::Download() const uchar* data = new uchar[PixelService::GetBufferSize(format_, width_, height_)]; - f->glReadPixels(0, 0, width_, height_, format_info.pixel_format, format_info.pixel_type, data); + f->glReadPixels(0, 0, width_, height_, format_info.pixel_format, format_info.gl_pixel_type, data); f->glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); @@ -212,7 +212,7 @@ void OpenGLTexture::CreateInternal(GLuint* tex, void *data) // Verify texture if (texture_ == 0) { - qWarning() << tr("OpenGL texture creation failed"); + qWarning() << "OpenGL texture creation failed"; return; } @@ -230,7 +230,7 @@ void OpenGLTexture::CreateInternal(GLuint* tex, void *data) height_, 0, bit_depth.pixel_format, - bit_depth.pixel_type, + bit_depth.gl_pixel_type, data ); diff --git a/app/render/backend/renderinstance.cpp b/app/render/backend/renderinstance.cpp index d857e2b17..e08fbaa12 100644 --- a/app/render/backend/renderinstance.cpp +++ b/app/render/backend/renderinstance.cpp @@ -61,13 +61,13 @@ bool RenderInstance::Start() // Create OpenGL context (automatically destroys any existing if there is one) if (!ctx_->create()) { - qWarning() << tr("Failed to create OpenGL context in thread %1").arg(reinterpret_cast(this)); + qWarning() << QStringLiteral("Failed to create OpenGL context in thread %1").arg(reinterpret_cast(this)); return false; } // Make context current on that surface if (!ctx_->makeCurrent(&surface_)) { - qWarning() << tr("Failed to makeCurrent() on offscreen surface in thread %1").arg(reinterpret_cast(this)); + qWarning() << QStringLiteral("Failed to makeCurrent() on offscreen surface in thread %1").arg(reinterpret_cast(this)); return false; } diff --git a/app/render/backend/videorenderbackend.cpp b/app/render/backend/videorenderbackend.cpp index 34a16d146..a664a1e6f 100644 --- a/app/render/backend/videorenderbackend.cpp +++ b/app/render/backend/videorenderbackend.cpp @@ -279,7 +279,7 @@ QString VideoRendererProcessor::CachePathName(const QByteArray &hash) QDir this_cache_dir = QDir(GetMediaCacheLocation()).filePath(cache_id_); this_cache_dir.mkpath("."); - QString filename = QString("%1.exr").arg(QString(hash.toHex())); + QString filename = QStringLiteral("%1.exr").arg(QString(hash.toHex())); return this_cache_dir.filePath(filename); } diff --git a/app/render/backend/videorendererdownloadthread.cpp b/app/render/backend/videorendererdownloadthread.cpp index f936495b9..bf1315d44 100644 --- a/app/render/backend/videorendererdownloadthread.cpp +++ b/app/render/backend/videorendererdownloadthread.cpp @@ -94,7 +94,7 @@ void VideoRendererDownloadThread::ProcessLoop() entry.texture->width(), entry.texture->height(), format_info.pixel_format, - format_info.pixel_type, + format_info.gl_pixel_type, data_buffer.data()); xf->glFramebufferTexture2D(GL_READ_FRAMEBUFFER, @@ -116,7 +116,7 @@ void VideoRendererDownloadThread::ProcessLoop() emit Downloaded(entry.hash); } else { - qWarning() << tr("Failed to open output file \"%1\"").arg(entry.filename); + qWarning() << QStringLiteral("Failed to open output file \"%1\"").arg(entry.filename); } } diff --git a/app/render/pixelservice.cpp b/app/render/pixelservice.cpp index 50280863a..6ca6916ae 100644 --- a/app/render/pixelservice.cpp +++ b/app/render/pixelservice.cpp @@ -38,25 +38,25 @@ PixelFormatInfo PixelService::GetPixelFormatInfo(const olive::PixelFormat &forma case olive::PIX_FMT_RGBA8: info.name = tr("8-bit"); info.internal_format = GL_RGBA8; - info.pixel_type = GL_UNSIGNED_BYTE; + info.gl_pixel_type = GL_UNSIGNED_BYTE; info.oiio_desc = OIIO::TypeDesc::UINT8; break; case olive::PIX_FMT_RGBA16U: info.name = tr("16-bit Integer"); info.internal_format = GL_RGBA16; - info.pixel_type = GL_UNSIGNED_SHORT; + info.gl_pixel_type = GL_UNSIGNED_SHORT; info.oiio_desc = OIIO::TypeDesc::UINT16; break; case olive::PIX_FMT_RGBA16F: info.name = tr("Half-Float (16-bit)"); info.internal_format = GL_RGBA16F; - info.pixel_type = GL_HALF_FLOAT; + info.gl_pixel_type = GL_HALF_FLOAT; info.oiio_desc = OIIO::TypeDesc::HALF; break; case olive::PIX_FMT_RGBA32F: info.name = tr("Full-Float (32-bit)"); info.internal_format = GL_RGBA32F; - info.pixel_type = GL_FLOAT; + info.gl_pixel_type = GL_FLOAT; info.oiio_desc = OIIO::TypeDesc::FLOAT; break; case olive::PIX_FMT_INVALID: @@ -273,7 +273,7 @@ FramePtr PixelService::ConvertPixelFormat(FramePtr frame, const olive::PixelForm return converted; } - qWarning() << tr("Invalid parameters called for pixel format conversion"); + qWarning() << "Invalid parameters called for pixel format conversion"; return nullptr; } diff --git a/app/render/pixelservice.h b/app/render/pixelservice.h index b2bcd4773..2cda454eb 100644 --- a/app/render/pixelservice.h +++ b/app/render/pixelservice.h @@ -42,7 +42,7 @@ struct PixelFormatInfo { QString name; GLint internal_format; GLenum pixel_format; - GLenum pixel_type; + GLenum gl_pixel_type; int bytes_per_pixel; OIIO::TypeDesc oiio_desc; };