After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697868 - d3dvideosink: fix scaling with some drivers
d3dvideosink: fix scaling with some drivers
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Windows
: High critical
: 1.2.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-12 11:44 UTC by Andoni Morales
Modified: 2018-05-04 08:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
d3dvideosink: fix scalling with some drivers (7.72 KB, patch)
2013-04-12 11:44 UTC, Andoni Morales
needs-work Details | Review

Description Andoni Morales 2013-04-12 11:44:25 UTC
Created attachment 241343 [details] [review]
d3dvideosink: fix scalling with some drivers

The back buffer should have the same size as the rendering window so scalling is done in StretchRect from the offscreen surface to the back buffer using the bilinear filter. If not, scalling happens from the backbuffer to the rendering window outside the sink, which is not correctly filtered with some drivers.
Comment 1 Andoni Morales 2013-04-12 12:43:10 UTC
This do not apply in master anymore and won't work after:
d3dvideosink: Implement a buffer pool that shares D3D surfaces with upstream

Resizing requires resetting the device and all the resources allocated to this d3d pool if we use the default pool. I believe that using a managed pool instead allows resources to persists in a device reset:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb147168(v=vs.85).aspx

"Use the D3DPOOL_MANAGED flag at creation time to specify a managed resource. Managed resources persist through transitions between the lost and operational states of the device. These resources exist both in video and system memory. A managed resource will be copied into video memory when it is needed during rendering. The device can be restored with a call to IDirect3DDevice9::Reset, and such resources continue to function normally without being reloaded with data. However, if the device must be destroyed and re-created, all resources must be re-created."

We should also be using the managed for devices lost, and not recreate the device as it's done now but only reset it to reuse the existent resources.
Comment 2 Sebastian Dröge (slomo) 2013-04-14 07:11:38 UTC
Using a managed pool makes D3D provide system memory and then whenever necessary copies between that and GPU memory? In that case we could as well revert my changes to make d3dvideosink provide a buffer pool and work in zerocopy mode, if we do the copy on our side or let D3D do it doesn't really matter.
Comment 3 Sebastian Dröge (slomo) 2013-04-23 07:33:28 UTC
Marking as blocker for 1.2 as it must be fixed or reverted until then.
Comment 4 Sebastian Dröge (slomo) 2013-05-24 07:47:32 UTC
Andoni, did you get more information about what this MANAGED pool is and how it works? Is it really memcpy'ing internally from system memory to hardware memory, and as such useless for us?
Comment 5 Andoni Morales 2013-08-22 09:31:22 UTC
I had didn't have time to investigate in this. The big difference is that using this pool the resources persists across device lost and resets.
Comment 6 Andoni Morales 2013-08-22 09:46:24 UTC
And the problem with the current pool is that resources are not valid anymore after a device lost or reset, meaning you need to invalidate the whole pool.
Comment 7 Sebastian Dröge (slomo) 2013-08-22 09:55:20 UTC
I created #706566 for that. Independent of that, could you update your patches to apply against GIT master?
Comment 8 Andoni Morales 2013-09-02 09:51:52 UTC
My patches do not apply in git master because the 1.0 version was ported before some important refactoring in 0.10 where we moved from a shared d3d device with different swap chains for each instance of the sink to a single d3d device with a single swap chain for each instance.
Comment 9 Sebastian Dröge (slomo) 2013-09-27 12:40:23 UTC
Is this still relevant for git master though? Or can it be closed?
Comment 10 Sebastian Dröge (slomo) 2018-05-04 08:41:23 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!