views:

335

answers:

2

I asked this question on the PyQt mailing list, and didn't get any responses, so I'll try my luck here.

I've encountered a frustrating issue (on Windows only): when trying to create a VideoWidget instance, I'm getting the error message "the video widget could not be initialized correctly". Oddly, this just surfaced in the code after several weeks of perfect operation, on two separate Windows boxes (one Vista, the other an XP image running via Parallels). I'm not aware of anything having changed in the environment that may have caused it.

I'm using Python 2.6 and the PyQt 4.5.4 Windows installer. I notice this issue was raised last November, but no solutions were offered:

http://www.riverbankcomputing.com/pipermail/pyqt/2008-November/021029.html

My Googling hasn't turned up any explanations of what may cause this. Can anyone clue me in?

+3  A: 

The code that generates that message is in 3rdparty/phonon/ds9/videorenderer_vmr9.cpp:

m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter);
if (!m_filter) {
    qWarning("the video widget could not be initialized correctly");
    return;
 }

Filter is type ComPointer<IBaseFilter> and its constructor makes the following failing call (an operator call returns m_t which is assigned to m_filter above):

::CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, iid,
                reinterpret_cast<void**>(&m_t));

Thus, it's failing in a Windows API call. You could modify the source code to find out what the return value of CoCreateInstance is in order to isolate the cause, but it looks like it's related to a change on your system and I don't know how to help further. Good luck.

Kaleb Pederson
A: 

Hate to answer my own question, but if anyone else encounters this:

The solution to this ended up being hardware-specific. Phonon appears to have issues with the video drivers for particular virtual machines - Parallels in my case. Physical hardware doesn't exhibit the issue. There is no workaround I've been able to find.

Daniel