summaryrefslogtreecommitdiff
path: root/wrappers
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-05-19 15:10:03 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-05-19 15:55:42 +0100
commit91403b6268d37cfdc6148171082457bedfa01bca (patch)
treeaf8cbe799d2d9aeec7a5ea537d6bafbd92fe6a03 /wrappers
parent8a4c9af839e466e927aa92654d8815dadaa7d37e (diff)
dxgitrace: Handle ID3D11VideoContext::Get/ReleaseDecoderBuffer properly.
Essentially do the same thing done for DXVA's IDirectXVideoDecoder::Get/ReleaseBuffer methods. Untested, but it should fare no worse than it does now.
Diffstat (limited to 'wrappers')
-rw-r--r--wrappers/dxgitrace.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/wrappers/dxgitrace.py b/wrappers/dxgitrace.py
index f3ea82d2..476d0a38 100644
--- a/wrappers/dxgitrace.py
+++ b/wrappers/dxgitrace.py
@@ -106,6 +106,10 @@ class D3DCommonTracer(DllTracer):
('std::map< std::pair<ID3D11Resource *, UINT>, _MAP_DESC >', 'm_MapDescs', None),
('std::map< std::pair<ID3D11Resource *, UINT>, MemoryShadow >', 'm_MapShadows', None),
]
+ if interface.hasBase(d3d11.ID3D11VideoContext):
+ variables += [
+ ('std::map<UINT, std::pair<void *, UINT> >', 'm_MapDesc', None),
+ ]
return variables
@@ -136,6 +140,14 @@ class D3DCommonTracer(DllTracer):
print ' }'
print ' }'
+ if interface.hasBase(d3d11.ID3D11VideoContext) and \
+ method.name == 'ReleaseDecoderBuffer':
+ print ' std::map<UINT, std::pair<void *, UINT> >::iterator it = m_MapDesc.find(Type);'
+ print ' if (it != m_MapDesc.end()) {'
+ self.emit_memcpy('it->second.first', 'it->second.second')
+ print ' m_MapDesc.erase(it);'
+ print ' }'
+
DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
if method.name == 'Map':
@@ -154,6 +166,14 @@ class D3DCommonTracer(DllTracer):
print ' _MapDesc.Size = 0;'
print ' }'
+ if interface.hasBase(d3d11.ID3D11VideoContext) and \
+ method.name == 'GetDecoderBuffer':
+ print ' if (SUCCEEDED(_result)) {'
+ print ' m_MapDesc[Type] = std::make_pair(*ppBuffer, *pBufferSize);'
+ print ' } else {'
+ print ' m_MapDesc[Type] = std::make_pair(nullptr, 0);'
+ print ' }'
+
def invokeMethod(self, interface, base, method):
DllTracer.invokeMethod(self, interface, base, method)