Can not using d3d11screencapturesrc with dxgi mode while using Remote Desktop

Under Remote Desktop:

  1. gst-launch-1.0 d3d11screencapturesrc capture-api=wgc ! fakesink work √
  2. gst-launch-1.0 d3d11screencapturesrc capture-api=dxgi ! fakesink
    Error:
    Use Windows high-resolution clock, precision: 1 ms
    Setting pipeline to PAUSED …
    ERROR: from element /GstPipeline:pipeline0/GstD3D11ScreenCaptureSrc:d3d11screencapturesrc0: Failed to prepare capture object with given configuration, monitor-index: -1, monitor-handle: 0000000000000000, window-handle: 0000000000000000
    Additional debug info:
    …/sys/d3d11/gstd3d11screencapturesrc.cpp(1059): gst_d3d11_screen_capture_src_start (): /GstPipeline:pipeline0/GstD3D11ScreenCaptureSrc:d3d11screencapturesrc0
    ERROR: pipeline doesn’t want to preroll.
    ERROR: from element /GstPipeline:pipeline0/GstD3D11ScreenCaptureSrc:d3d11screencapturesrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
    Additional debug info:
    …/libs/gst/base/gstbasesrc.c(3607): gst_base_src_start (): /GstPipeline:pipeline0/GstD3D11ScreenCaptureSrc:d3d11screencapturesrc0:
    Failed to start
    ERROR: pipeline doesn’t want to preroll.
    Failed to set pipeline to PAUSED.
    Setting pipeline to NULL …
    Freeing pipeline …

Actually, I encountered this issue while inheriting the application. I have a separate screencapture implemented using DXGI, and then I enabled d3d11screencapturesrc, and that’s when I found that the DXGI mode no longer works. WGC doesn’t affect it.