some code cleanup

Removal of translations around debug messages since these waste cycles and are
likely not useful
This commit is contained in:
itsmattkc
2019-10-31 21:45:53 +11:00
parent e03e0007e4
commit 133dab1666
11 changed files with 49 additions and 48 deletions
+8 -8
View File
@@ -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());
}
}
+1 -1
View File
@@ -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;
}
+1
View File
@@ -35,5 +35,6 @@ set(OLIVE_SOURCES
render/backend/videorendererthreadbase.cpp
render/backend/renderinstance.h
render/backend/renderinstance.cpp
PARENT_SCOPE
)
@@ -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;
}
+20 -20
View File
@@ -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);
}
+7 -7
View File
@@ -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
);
+2 -2
View File
@@ -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<quintptr>(this));
qWarning() << QStringLiteral("Failed to create OpenGL context in thread %1").arg(reinterpret_cast<quintptr>(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<quintptr>(this));
qWarning() << QStringLiteral("Failed to makeCurrent() on offscreen surface in thread %1").arg(reinterpret_cast<quintptr>(this));
return false;
}
+1 -1
View File
@@ -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);
}
@@ -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);
}
}
+5 -5
View File
@@ -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;
}
+1 -1
View File
@@ -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;
};