summaryrefslogtreecommitdiff
path: root/wrappers/d3d9trace.py
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/d3d9trace.py')
-rw-r--r--wrappers/d3d9trace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/wrappers/d3d9trace.py b/wrappers/d3d9trace.py
index 5f111979..5b966cb0 100644
--- a/wrappers/d3d9trace.py
+++ b/wrappers/d3d9trace.py
@@ -67,6 +67,11 @@ class D3D9Tracer(DllTracer):
('VOID *', 'm_pbData', '0'),
]
+ if interface.name == 'IDirectXVideoDecoder':
+ variables += [
+ ('std::map<UINT, std::pair<void *, UINT> >', '_MappedData', None),
+ ]
+
return variables
def implementWrapperInterfaceMethodBody(self, interface, base, method):
@@ -84,6 +89,13 @@ class D3D9Tracer(DllTracer):
self.emit_memcpy('(LPBYTE)m_pbData', '_MappedSize')
print ' }'
+ if interface.name == 'IDirectXVideoDecoder' and method.name == 'ReleaseBuffer':
+ print ' std::map<UINT, std::pair<void *, UINT> >::iterator it = _MappedData.find(BufferType);'
+ print ' if (it != _MappedData.end()) {'
+ self.emit_memcpy('it->second.first', 'it->second.second')
+ print ' _MappedData.erase(it);'
+ print ' }'
+
DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
if method.name in ('Lock', 'LockRect', 'LockBox'):
@@ -112,6 +124,13 @@ class D3D9Tracer(DllTracer):
print ' _MappedSize = 0;'
print ' }'
+ if interface.name == 'IDirectXVideoDecoder' and method.name == 'GetBuffer':
+ print ' if (SUCCEEDED(_result)) {'
+ print ' _MappedData[BufferType] = std::make_pair(*ppBuffer, *pBufferSize);'
+ print ' } else {'
+ print ' _MappedData[BufferType] = std::make_pair(nullptr, 0);'
+ print ' }'
+
if __name__ == '__main__':
print '#define INITGUID'