15,910,877 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by GrizzlyJames (Top 6 by date)
GrizzlyJames
7-May-13 11:54am
View
Turns out I can't get to the silverlightControlHost div. Everytime I try to get the contentWindow or contentDocument of the iframe I create I get an "Access is denied" error. I would imagine that's because I'm going to a different domain.
GrizzlyJames
6-May-13 19:02pm
View
It appears to be inside of a div. My DOM Tree is as follows (the relevant parts anyways):
<html>
<head>...</head>
<body>
<div id="mainContentBorder>
<div id="mainContent"> <!-- This is what _targetNode is from the code above -->
<iframe> <!-- This is the iframe I create, from here on, I have no control -->
<html>
<head>...</head>
<body>
<form>
<div id="silverlightControlHost">
<object>...</object>
<iframe>...</iframe>
</div>
</form>
</body>
</html>
</iframe>
</div>
</div>
</body>
</html>
GrizzlyJames
12-Sep-12 2:17am
View
Using GraphEdit I found out that the AVI file that I was using had a format that was unsupported by the machine. I did some conversions, and it now runs on the test machine as well!
Thank you very much Maxim Kartavenkov! You will be listed in our games credits for your help. I'll be sure to send you a link to our game once we finish it next month.
GrizzlyJames
11-Sep-12 0:31am
View
Holy crap! I did not know this thing existed! I will definitely try running this tool tomorrow and see what's up.
GrizzlyJames
10-Sep-12 13:07pm
View
Unfortunately, it still does not work on the test machine. For now I'm going to just use AVIFile to get videos to work.
Here is my new code for InitializeDevice if you or anyone else would like to take a look at it:
HRESULT VideoAllocator::InitializeDevice (DWORD_PTR dwUserID, VMR9AllocationInfo* lpAllocInfo, DWORD* lpNumBuffers)
{
EnterCriticalSection(&m_CriticalSection);
if (lpAllocInfo == NULL)
{
#ifndef _RELEASEBUILD
printf("Invalid Allocation pointer in InitializeDevice().\n");
#endif
LeaveCriticalSection(&m_CriticalSection);
return E_POINTER;
}
if (lpNumBuffers == NULL)
{
#ifndef _RELEASEBUILD
printf("Invalid Number of Buffers pointer in InitializeDevice().\n");
#endif
LeaveCriticalSection(&m_CriticalSection);
return E_POINTER;
}
D3DCAPS9 d3dcaps;
DWORD dwWidth = 1;
DWORD dwHeight = 1;
m_pDevice->GetDeviceCaps(&d3dcaps);
if (d3dcaps.TextureCaps & D3DPTEXTURECAPS_POW2)
{
while (dwWidth < lpAllocInfo->dwWidth)
dwWidth <<= 1;
while (dwHeight < lpAllocInfo->dwHeight)
dwHeight <<= 1;
lpAllocInfo->dwWidth = dwWidth;
lpAllocInfo->dwHeight = dwHeight;
}
// Try creating textures first, if the machine can handle it.
lpAllocInfo->dwFlags |= VMR9AllocFlag_TextureSurface;
ReleaseSurfaces();
m_dwSurfaces = *lpNumBuffers;
m_pSurfaces = new IDirect3DSurface9* [m_dwSurfaces];
HRESULT hr = m_pNotify->AllocateSurfaceHelper(lpAllocInfo, lpNumBuffers, m_pSurfaces);
// If we failed, and the format is not an alpha format, then we need to render
// to an off-screen surface, and copy decode the images onto a private texture.
if (FAILED(hr) && !(lpAllocInfo->dwFlags & VMR9AllocFlag_3DRenderTarget))
{
// Is the surface a YUV?
if (lpAllocInfo->Format > '0000')
{
D3DDISPLAYMODE dm;
hr = m_pDevice->GetDisplayMode(NULL, &dm);
if (FAILED(hr))
{
#ifndef _RELEASEBUILD
printf("Failed to get the Display Mode in InitializeDevice().\n");
#endif
LeaveCriticalSection(&m_CriticalSection);
return hr;
}
hr = m_pDevice->CreateTexture(lpAllocInfo->dwWidth, lpAllocInfo->dwHeight,
1, D3DUSAGE_RENDERTARGET, dm.Format, D3DPOOL_DEFAULT, &m_pPrivateTexture, NULL);
if (FAILED(hr))
{
#ifndef _RELEASEBUILD
printf("Failed to create a private texture in InitializeDevice().\n");
#endif
LeaveCriticalSection(&m_CriticalSection);
return hr;
}
}
lpAllocInfo->dwFlags &= ~VMR9AllocFlag_TextureSurface;
lpAllocInfo->dwFlags |= VMR9AllocFlag_OffscreenSurface;
hr = m_pNotify->AllocateSurfaceHelper(lpAllocInfo, lpNumBuffers, m_pSurfaces);
if (FAILED(hr))
{
#ifndef _RELEASEBUILD
printf("Failed to work around this machine, VMR-9 ain't gonna happen.\n");
#endif
LeaveCriticalSection(&m_CriticalSection);
return hr;
}
}
LeaveCriticalSection(&m_CriticalSection);
return hr;
}
GrizzlyJames
8-Sep-12 12:54pm
View
Thank you very much for taking a look at this. I have implemented the solution on my machine (the Windows 7 one), and it works. Unfortunately, I have to wait until Monday before I can test to see if this works on the target machine (the Windows XP one).
I will inform you of the results, and if it works, I will be hitting that green button above, and a very big special thanks in the game's credits!
Show More