[vlc-devel] commit: Saved the informations returned by IDirect3D9_GetAdapterIdentifier (dxva2). (Laurent Aimar )
git version control
git at videolan.org
Wed Jan 20 01:19:13 CET 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan 17 19:33:45 2010 +0100| [ebf225d043c7684143bfd4c58b8c4985822ae3bb] | committer: Laurent Aimar
Saved the informations returned by IDirect3D9_GetAdapterIdentifier (dxva2).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ebf225d043c7684143bfd4c58b8c4985822ae3bb
---
modules/codec/avcodec/dxva2.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 8ca7942..cf51f0d 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -219,9 +219,10 @@ typedef struct
HINSTANCE hdxva2_dll;
/* Direct3D */
- D3DPRESENT_PARAMETERS d3dpp;
- LPDIRECT3D9 d3dobj;
- LPDIRECT3DDEVICE9 d3ddev;
+ D3DPRESENT_PARAMETERS d3dpp;
+ LPDIRECT3D9 d3dobj;
+ D3DADAPTER_IDENTIFIER9 d3dai;
+ LPDIRECT3DDEVICE9 d3ddev;
/* Device manager */
UINT token;
@@ -533,6 +534,14 @@ static int D3dCreateDevice(vlc_va_dxva2_t *va)
va->d3dobj = d3dobj;
/* */
+ D3DADAPTER_IDENTIFIER9 *d3dai = &va->d3dai;
+ if (FAILED(IDirect3D9_GetAdapterIdentifier(va->d3dobj,
+ D3DADAPTER_DEFAULT, 0, d3dai))) {
+ msg_Warn(va->log, "IDirect3D9_GetAdapterIdentifier failed");
+ ZeroMemory(d3dai, sizeof(*d3dai));
+ }
+
+ /* */
D3DPRESENT_PARAMETERS *d3dpp = &va->d3dpp;
ZeroMemory(d3dpp, sizeof(*d3dpp));
d3dpp->Flags = D3DPRESENTFLAG_VIDEO;
@@ -578,17 +587,11 @@ static void D3dDestroyDevice(vlc_va_dxva2_t *va)
*/
static char *DxDescribe(vlc_va_dxva2_t *va)
{
- D3DADAPTER_IDENTIFIER9 id;
- ZeroMemory(&id, sizeof(id));
-
- if (FAILED(IDirect3D9_GetAdapterIdentifier(va->d3dobj,
- D3DADAPTER_DEFAULT, 0, &id)))
- return strdup("DXVA2 (unknown)");
-
+ D3DADAPTER_IDENTIFIER9 *id = &va->d3dai;
char *description;
if (asprintf(&description, "DXVA2 (%.*s, vendor %d, device %d, revision %d)",
- sizeof(id.Description), id.Description,
- id.VendorId, id.DeviceId, id.Revision) < 0)
+ sizeof(id->Description), id->Description,
+ id->VendorId, id->DeviceId, id->Revision) < 0)
return NULL;
return description;
}
More information about the vlc-devel
mailing list