Verify 50 fps backends and decode all frames during display catch-up
This commit is contained in:
1 parent
52d9a347c3
commit
3037c5fa87
3 files changed
+38
-15
No files matched your search
@@ -16,8 +16,8 @@ extern "C" {
|
||||
}
|
||||
namespace {
|
||||
// Отдельная проверка для 720p и Full HD: CPU-резерв 1080p не отключает GPU на 720p.
|
||||
std::atomic<unsigned> gpuProfiles[2][2][2]{};
|
||||
std::atomic<unsigned> gpuPipeline[2][2][2]{};
|
||||
std::atomic<unsigned> gpuProfiles[2][2][3]{};
|
||||
std::atomic<unsigned> gpuPipeline[2][2][3]{};
|
||||
QString ffError(int value) { char text[AV_ERROR_MAX_STRING_SIZE]; av_strerror(value, text, sizeof(text)); return text; }
|
||||
#ifdef _WIN32
|
||||
constexpr AVHWDeviceType DeviceType = AV_HWDEVICE_TYPE_D3D11VA;
|
||||
@@ -59,7 +59,7 @@ struct CallVideoDecoder::Impl {
|
||||
if (!codec) { failed("allocation", AVERROR(ENOMEM)); return false; }
|
||||
unsigned verifiedPipeline = 0; bool verifiedGpu = false;
|
||||
for (unsigned tier = 0; tier < 2; ++tier) {
|
||||
const unsigned rate = f.fps > 30 ? 1 : 0;
|
||||
const unsigned rate = f.fps > 50 ? 2 : (f.fps > 30 ? 1 : 0);
|
||||
const unsigned width = tier ? 1920 : 1280, height = tier ? 1080 : 720;
|
||||
if (std::max(f.width, f.height) <= width && uint64_t(f.width) * f.height <= width * height
|
||||
&& (gpuProfiles[f.codec - 1][tier][rate].load() & f.profile)) {
|
||||
@@ -247,8 +247,8 @@ call_video_caps CallVideoDecoder::capabilities(const std::atomic<bool>* running)
|
||||
call_video_limit limit{};
|
||||
for (unsigned profile = 1; profile <= 2; ++profile) {
|
||||
for (unsigned tier = 0; tier < 2; ++tier) {
|
||||
for (unsigned rate = 0; rate < 2; ++rate) {
|
||||
const unsigned fps = rate ? 60 : 30;
|
||||
for (unsigned rate = 0; rate < 3; ++rate) {
|
||||
const unsigned fps = rate == 2 ? 60 : (rate ? 50 : 30);
|
||||
const unsigned width = tier ? 1920 : 1280, height = tier ? 1080 : 720;
|
||||
const uint8_t level = codec == 1 ? (tier ? (rate ? 42 : 40) : (rate ? 32 : 31))
|
||||
: (tier ? (rate ? 123 : 120) : (rate || profile == 2 ? 120 : 93));
|
||||
@@ -259,7 +259,7 @@ call_video_caps CallVideoDecoder::capabilities(const std::atomic<bool>* running)
|
||||
for (int portrait = 0; portrait <= 1 && bothOrientations; ++portrait) {
|
||||
if (cancelled()) return {};
|
||||
const unsigned w = portrait ? height : width, h = portrait ? width : height;
|
||||
uint8_t bytes[8192]; int size = call_video_probe_key(codec, profile, w, h, fps, bytes, sizeof(bytes));
|
||||
uint8_t bytes[8192]; int size = call_video_probe_key(codec, profile, w, h, rate ? 60 : 30, bytes, sizeof(bytes));
|
||||
if (size < 0) { bothOrientations = false; break; }
|
||||
CallVideoDecoder decoder(backend);
|
||||
call_video_frame input{}; input.call_id = 1; input.flags = CALL_VIDEO_KEY;
|
||||
|
||||
Reference in new issue
Block a user