Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

Validate drained deinterlacer output independently of decoder EOF

Veyra Goal Agent669cfb93b23d
diff --git a/src/source/MediaFileSource.cpp b/src/source/MediaFileSource.cpp
index 36f49c35..e501eb84 100644
--- a/src/source/MediaFileSource.cpp
+++ b/src/source/MediaFileSource.cpp
@@ -14,6 +14,7 @@ extern "C" {
#include <libavutil/pixdesc.h>
#include <libavutil/dovi_meta.h>
#include <libavutil/mastering_display_metadata.h>
+#include <libavutil/hwcontext_d3d12va.h>
}
#include <thread>
@@ -368,7 +369,19 @@ SourceReadStatus MediaFileSource::read(pipeline::FramePacket& out, const AVFrame
}
}
- if (decoder_.hardwareActive() && !decoder_.hardwareFrameImportable()) {
+ // A drained filter owns its output independently of the decoder's latest
+ // frame, which is cleared at decoder EOF. Validate the actual output.
+ if (deinterlacer_.active() && frame->format == AV_PIX_FMT_D3D12) {
+ const auto* surface = reinterpret_cast<const AVD3D12VAFrame*>(frame->data[0]);
+ const auto desc = surface && surface->texture ? surface->texture->GetDesc() : D3D12_RESOURCE_DESC{};
+ if (desc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || desc.MipLevels != 1 ||
+ desc.SampleDesc.Count != 1 || desc.DepthOrArraySize != 1 ||
+ (desc.Format != DXGI_FORMAT_NV12 && desc.Format != DXGI_FORMAT_P010) ||
+ desc.Width < UINT64(frame->width) || desc.Height < UINT(frame->height)) {
+ errorMessage_ = L"去隔行输出格式无法导入,已停止处理";
+ return SourceReadStatus::Error;
+ }
+ } else if (!deinterlacer_.active() && decoder_.hardwareActive() && !decoder_.hardwareFrameImportable()) {
if (fallbackToSoftware("unsupported-d3d12-surface")) {
return read(out, decodedFrame);
}
diff --git a/tests/integration/NetworkInterlaceTests.cpp b/tests/integration/NetworkInterlaceTests.cpp
index e9dd1089..a6238efb 100644
--- a/tests/integration/NetworkInterlaceTests.cpp
+++ b/tests/integration/NetworkInterlaceTests.cpp
@@ -29,7 +29,7 @@ int enginePlayback(const wchar_t* path,const wchar_t* directory,const wchar_t* e
while(std::chrono::steady_clock::now()<deadline){
MSG msg;while(PeekMessageW(&msg,nullptr,0,0,PM_REMOVE)){TranslateMessage(&msg);DispatchMessageW(&msg);}
const auto s=player.snapshot();failed|=s.failed;audio|=s.audioAvailable;nr|=s.nrActive;fg|=s.fgActive;
- frames=std::max(frames,s.metrics.flow.counters.realPresented);generated=std::max(generated,s.metrics.flow.counters.generatedPresented);
+ frames=std::max(frames,s.metrics.flow.counters.realPresented);generated=std::max({generated,s.metrics.flow.counters.generatedPresented,s.metrics.flow.counters.xessSdkGenerated});
playing|=s.transport==engine::TransportState::Playing;
if(failed||s.transport==engine::TransportState::Ended||frames>=100)break;
std::this_thread::sleep_for(std::chrono::milliseconds(5));