mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Minimize amount of code to rebuild when switching options
This commit is contained in:
@@ -10,10 +10,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/algorithm.h"
|
||||
#include "logs.h"
|
||||
|
||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
#include "base/platform/linux/base_linux_library.h"
|
||||
#include <deque>
|
||||
#endif // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
#endif // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
|
||||
#include <QImage>
|
||||
|
||||
@@ -90,7 +90,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||
#endif // LIB_FFMPEG_USE_QT_PRIVATE_API
|
||||
}
|
||||
|
||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
[[nodiscard]] auto CheckHwLibs() {
|
||||
auto list = std::deque{
|
||||
AV_PIX_FMT_CUDA,
|
||||
@@ -116,7 +116,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
#endif // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
#endif // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
|
||||
[[nodiscard]] bool InitHw(AVCodecContext *context, AVHWDeviceType type) {
|
||||
AVCodecContext *parent = static_cast<AVCodecContext*>(context->opaque);
|
||||
@@ -158,9 +158,9 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||
static const auto list = CheckHwLibs();
|
||||
#else // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
#else // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||
const auto list = std::array{
|
||||
#ifdef Q_OS_WIN
|
||||
AV_PIX_FMT_D3D11,
|
||||
@@ -174,7 +174,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||
AV_PIX_FMT_CUDA,
|
||||
#endif // Q_OS_WIN || Q_OS_MAC
|
||||
};
|
||||
#endif // DESKTOP_APP_USE_PACKAGED || Q_OS_WIN || Q_OS_MAC
|
||||
#endif // TDESKTOP_USE_PACKAGED || Q_OS_WIN || Q_OS_MAC
|
||||
for (const auto format : list) {
|
||||
if (!has(format)) {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user