Giter VIP home page Giter VIP logo

Comments (3)

mattrwoz avatar mattrwoz commented on May 19, 2024

DX12 is supported in some scenarios (primarily: decoding, video processing, SourceReader). It is also supported by the IMFDXGIDeviceManager API, it looks like the documentation has not been properly updated however.

IMFDXGIDeviceManager::GetVideoService specifically will work fine when using a ID3D12Device pointer and IID_ID3D12Device. ResetDevice will also accept a ID3D12Device. Note that LockDevice, UnlockDevice and TestDevice should generally not be used with DX12 (DX12 is fully asynchronous and device removal is not possible).

Note that not all APIs will work if you pass a DX12 device to them. Notably SinkWriter, and MediaEngine both will fail when given a DX12 device. DX12 support for these APIs is still in progress.

from media-foundation.

jmoguillansky-gpsw avatar jmoguillansky-gpsw commented on May 19, 2024

Hi,
So currently it seems we need to use Directx11 as the decoding device (with Media Foundation), and DirectX 12 as the rendering device, and share the resources between DX11 and DX12?

It seems that DirectX 12 requires an "NT Handle".
Is there any API in Media Foundation to create the resource as an "NT Handle" Then we can share it with directx 12?

from media-foundation.

robUx4 avatar robUx4 commented on May 19, 2024

IMFDXGIDeviceManager::GetVideoService specifically will work fine when using a ID3D12Device pointer and IID_ID3D12Device.

There's also ID3D12VideoDevice which is equivalent to ID3D11VideoDevice.

BTW a simple sample would be helpful. I have some code working but when closing everything it seems the underlying D3D12+DXVA decoder is leaking some ID3D12Fence (Win10 with NVIDIA GPU). On Xbox there's IMFD3D12SynchronizationObjectCommands to handle synchronization. But on desktop this interface doesn't exist. It also available in Win10 21H1 (and Win11 I suppose).

In other cases on closing, it complains that there are some pending operations on a ID3D12CommandQueue that are still pending. After analysis it's some pictures that are "decoding" but were never sent to the display. Except there is no way to wait until these pending operations are done without faking use in another command queue and wait until the buffers are ready...

I suppose I'm missing something on the exit. I'm doing all these (in that order):

  • MFT_MESSAGE_COMMAND_FLUSH
  • SetOutputType(nullptr)
  • MFT_MESSAGE_NOTIFY_RELEASE_RESOURCES
  • MFT_MESSAGE_SET_D3D_MANAGER nullptr
  • MFT_MESSAGE_NOTIFY_END_STREAMING

from media-foundation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.