2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Replaced some qstr with u""_q literal.

This commit is contained in:
23rd
2022-11-27 00:20:17 +03:00
parent 22dc7023fc
commit 2acedca6b7
99 changed files with 477 additions and 480 deletions

View File

@@ -96,7 +96,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
nullptr,
0);
if (error || !hwDeviceContext) {
LogError(qstr("av_hwdevice_ctx_create"), error);
LogError(u"av_hwdevice_ctx_create"_q, error);
return false;
}
DEBUG_LOG(("Video Info: "
@@ -195,7 +195,7 @@ IOPointer MakeIOPointer(
int64_t(*seek)(void *opaque, int64_t offset, int whence)) {
auto buffer = reinterpret_cast<uchar*>(av_malloc(kAvioBlockSize));
if (!buffer) {
LogError(qstr("av_malloc"));
LogError(u"av_malloc"_q);
return {};
}
auto result = IOPointer(avio_alloc_context(
@@ -208,7 +208,7 @@ IOPointer MakeIOPointer(
seek));
if (!result) {
av_freep(&buffer);
LogError(qstr("avio_alloc_context"));
LogError(u"avio_alloc_context"_q);
return {};
}
return result;
@@ -232,7 +232,7 @@ FormatPointer MakeFormatPointer(
}
auto result = avformat_alloc_context();
if (!result) {
LogError(qstr("avformat_alloc_context"));
LogError(u"avformat_alloc_context"_q);
return {};
}
result->pb = io.get();
@@ -247,7 +247,7 @@ FormatPointer MakeFormatPointer(
&options));
if (error) {
// avformat_open_input freed 'result' in case an error happened.
LogError(qstr("avformat_open_input"), error);
LogError(u"avformat_open_input"_q, error);
return {};
}
result->flags |= AVFMT_FLAG_FAST_SEEK;
@@ -277,13 +277,13 @@ CodecPointer MakeCodecPointer(CodecDescriptor descriptor) {
auto result = CodecPointer(avcodec_alloc_context3(nullptr));
const auto context = result.get();
if (!context) {
LogError(qstr("avcodec_alloc_context3"));
LogError(u"avcodec_alloc_context3"_q);
return {};
}
const auto stream = descriptor.stream;
error = avcodec_parameters_to_context(context, stream->codecpar);
if (error) {
LogError(qstr("avcodec_parameters_to_context"), error);
LogError(u"avcodec_parameters_to_context"_q, error);
return {};
}
context->pkt_timebase = stream->time_base;
@@ -292,7 +292,7 @@ CodecPointer MakeCodecPointer(CodecDescriptor descriptor) {
const auto codec = FindDecoder(context);
if (!codec) {
LogError(qstr("avcodec_find_decoder"), context->codec_id);
LogError(u"avcodec_find_decoder"_q, context->codec_id);
return {};
}
@@ -305,7 +305,7 @@ CodecPointer MakeCodecPointer(CodecDescriptor descriptor) {
}
if ((error = avcodec_open2(context, codec, nullptr))) {
LogError(qstr("avcodec_open2"), error);
LogError(u"avcodec_open2"_q, error);
return {};
}
return result;
@@ -356,7 +356,7 @@ SwscalePointer MakeSwscalePointer(
}
}
if (srcFormat <= AV_PIX_FMT_NONE || srcFormat >= AV_PIX_FMT_NB) {
LogError(qstr("frame->format"));
LogError(u"frame->format"_q);
return SwscalePointer();
}
@@ -373,7 +373,7 @@ SwscalePointer MakeSwscalePointer(
nullptr,
nullptr);
if (!result) {
LogError(qstr("sws_getCachedContext"));
LogError(u"sws_getCachedContext"_q);
}
return SwscalePointer(
result,
@@ -398,11 +398,11 @@ void SwscaleDeleter::operator()(SwsContext *value) {
}
}
void LogError(QLatin1String method) {
void LogError(const QString &method) {
LOG(("Streaming Error: Error in %1.").arg(method));
}
void LogError(QLatin1String method, AvErrorWrap error) {
void LogError(const QString &method, AvErrorWrap error) {
LOG(("Streaming Error: Error in %1 (code: %2, text: %3)."
).arg(method
).arg(error.code()

View File

@@ -160,8 +160,8 @@ using SwscalePointer = std::unique_ptr<SwsContext, SwscaleDeleter>;
QSize resize,
SwscalePointer *existing = nullptr);
void LogError(QLatin1String method);
void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
void LogError(const QString &method);
void LogError(const QString &method, FFmpeg::AvErrorWrap error);
[[nodiscard]] const AVCodec *FindDecoder(not_null<AVCodecContext*> context);
[[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);