D3D12VideoRenderer Layered Architecture - Final Design v3

This commit is contained in:
2025-10-06 13:55:43 +09:00
parent 0019f2b106
commit 77b6246c67
25 changed files with 3066 additions and 7273 deletions

View File

@@ -319,30 +319,6 @@ namespace winrt::Vav2Player::implementation
LogMgr::GetInstance().LogInfo(L"VideoPlayerControl2",
L"Video loaded: " + std::to_wstring(videoWidth) + L"x" + std::to_wstring(videoHeight));
// 4. Create the NV12 texture for zero-copy, now that we have the dimensions.
if (m_gpuRenderer) {
HRESULT hr = m_gpuRenderer->CreateNV12TextureR8Layout(videoWidth, videoHeight);
if (SUCCEEDED(hr)) {
LogMgr::GetInstance().LogInfo(L"VideoPlayerControl2", L"NV12 texture created");
} else {
LogMgr::GetInstance().LogError(L"VideoPlayerControl2", L"Failed to create NV12 texture");
}
}
// 5. Get D3D12 fence from VavCore and pass it to SimpleGPURenderer for GPU synchronization
VavCorePlayer* player = m_playbackController->GetVavCorePlayer();
if (player && m_gpuRenderer) {
void* syncFence = vavcore_get_sync_fence(player);
if (syncFence) {
m_gpuRenderer->SetSyncFence(syncFence);
LogMgr::GetInstance().LogInfo(L"VideoPlayerControl2", L"D3D12 fence set for GPU synchronization");
} else {
LogMgr::GetInstance().LogWarning(L"VideoPlayerControl2", L"No sync fence available from VavCore");
}
}
// --- End of Corrected Initialization Order ---
// Update AspectFit
UpdateVideoImageAspectFit(videoWidth, videoHeight);
@@ -354,12 +330,6 @@ namespace winrt::Vav2Player::implementation
}
} else {
LogMgr::GetInstance().LogError(L"VideoPlayerControl2", L"Failed to load video");
// Cleanup partial initialization on failure
if (m_gpuRenderer) {
m_gpuRenderer->ReleaseNV12Texture();
}
UpdateStatus(L"Load failed");
}
}
@@ -453,7 +423,7 @@ namespace winrt::Vav2Player::implementation
LogMgr::GetInstance().LogInfo(L"VideoPlayerControl2", L"Initializing renderer");
m_gpuRenderer = std::make_unique<::Vav2Player::SimpleGPURenderer>();
m_gpuRenderer = std::make_unique<::Vav2Player::D3D12VideoRenderer>();
// Get SwapChainPanel size
auto panelSize = VideoSwapChainPanel().ActualSize();