dxgi

Using Media Foundation to encode Direct X surfaces

六月ゝ 毕业季﹏ 提交于 2019-12-20 11:30:59
问题 I'm trying to use the MediaFoundation API to encode a video but I'm having problems pushing the samples to the SinkWriter. I'm getting the frames to encode through the Desktop Duplication API. What I end up with is an ID3D11Texture2D with the desktop image in it. I'm trying to create an IMFVideoSample containing this surface and then push that video sample to a SinkWriter. I've tried going about this in different ways: I called MFCreateVideoSampleFromSurface(texture, &pSample) where texture

How do I pass a handle of DXGI shared resource to another process?

倾然丶 夕夏残阳落幕 提交于 2019-12-14 03:20:38
问题 https://msdn.microsoft.com/en-us/library/windows/desktop/bb174562(v=vs.85).aspx According to the documentation of IDXGIResource::GetSharedHandle, I should be able to "marshal this handle to another process to share a resource with a device in another process". But it's not clear how to pass this handle. Can I just pass the value of this handle to another process? Or do I need some specific method? Thanks! 回答1: Yes, you can pass this handle directly to another process and access it via

IUnknown pointer reference

独自空忆成欢 提交于 2019-12-13 06:12:18
问题 Why is the Visual Studio compiler happy with void fn(int *&i) { ; } and void fn(IUnknown *const &p) { ; } but not void fn(IUnkown *&p) { ; } where calling it looks like IDXGIFactory *df = nullptr; // init df fn(df); compiler error is 3 IntelliSense: a reference of type "IUnknown *&" (not const-qualified) cannot be initialized with a value of type "IDXGIFactory *" c:\Users\Carl\Documents\Visual Studio 2013\Projects\Project1\Project5\main.cpp 29 10 Project5 The closest thing I've dug up with

DXGI and 2+ full screen displays on Windows 7

ε祈祈猫儿з 提交于 2019-12-13 03:11:12
问题 I am developing a program that needs two full screen Direct3D dispalys. According to the documentation I should create the swap chains in windowed mode and then switch to full screen mode. While this works fine on Windows 8 (currently I'm just using Alt-Enter to do the switch), it does not work on Windows 7. On Windows 7 I get a problem similar to this issue where the screen that has most recently been switched to full screen works fine, but the other screen, which was previously working just

Resizing Texture before sending to SinkWriter SharpDX

心已入冬 提交于 2019-12-11 17:32:06
问题 I'm working on Screen recording application. My problem is I need to resize the Texure2d before making sample using CreateDXGISurfaceBuffer. I'm new with Mediafoundation and upon reading the documentation I couldn't find any sample code from the website. I'm using IDXGIOutput1::DuplicateOutput to get the screen texture. Is there a better way to resize the texture without suffering the performance? 回答1: Video Processor MFT can scale your textures. When you use it in Direct3D 11 enabled mode,

Problems to understand DXGI DirectX 11 Desktop Duplication to get a Buffer or Array

北城以北 提交于 2019-12-10 11:56:06
问题 I want to understand DXGI Desktop Duplication. I have read a lot and this is the code I copied from parts of the DesktopDuplication sample on the Microsoft Website. My plan is to get the Buffer or Array from the DesktopImage because I want to make a new Texture for an other program. I hope somebody can explain me what I can do to get it. void DesktopDublication::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout) { IDXGIResource* DesktopResource = nullptr; DXGI_OUTDUPL_FRAME_INFO FrameInfo;

Directx 11 Front Buffer

我们两清 提交于 2019-12-04 16:57:25
I am hoping this is a easy answer to an easy question which I cannot find an answer to. How do I access the front buffer in Directx 11 / DXGI? I have found in Directx 9 you can use GetFrontBufferData() and you can use GetBuffer() in Directx 11 to get access to the backbuffer but there are problems with this. The backbuffer doesn't have calculations done to it that the front buffer does. So I was wondering if there is something I am missing. I could try using GetDisplaySurfaceData and unless I have mis-understood something then it wouldn't work because I am not always in full-screen mode. Edit:

Resetting window after using DirectX 11

梦想的初衷 提交于 2019-12-04 11:53:48
I've written an application that can switch between OpenGL, DirectX 9 and DirectX 11 for rendering without restarting or recreating the window. Switching between OpenGL and DirectX 9 as well as to DirectX 11 mode works well, however, after using DirectX 11 no other rendering mode works any longer. After releasing all DirectX 11 interfaces, the window still shows the last rendered frame, it is even properly updated when resizing the window. A DirectX 9 device can be created and the Present calls succeed, however, all I see is the last frame drawn by DirectX 11. I’ve used IDXGIDebug:

D3D11: How to draw GDI Text to a GXDI Surface? (Without D2D)

若如初见. 提交于 2019-12-04 10:52:45
问题 I need some help with drawing a text to a texture with GDI and D3D11. I tried using D2D/DirectWrite, but it supports just D3D10 and not D3D11 as I need. Everything I tried failed so far... Now I want to use GDI methodes to write in the texture. So I created a texture with this params: Usage = D3D11_USAGE_DEFAULT; Format = DXGI_FORMAT_B8G8R8A8_UNORM; BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; CPUAccessFlags = 0; MiscFlags = D3D11_RESOURCE_MISC_GDI_COMPATIBLE Then I

How to get current display mode (resolution, refresh rate) of a monitor/output in DXGI?

落花浮王杯 提交于 2019-12-03 11:18:01
I am creating a multi-monitor full screen DXGI/D3D application. I am enumerating through the available outputs and adapters in preparation of creating their swap chains. When creating my swap chain using DXGI's IDXGIFactory::CreateSwapChain method, I need to provide a swap chain description which includes a buffer description of type DXGI_MODE_DESC that details the width, height, refresh rate, etc. How can I find out what the output is currently set to (or how can I find out what the display mode of the output currently is)? I don't want to change the user's resolution or refresh rate when I