Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IVideoWindow on WM5

0 views
Skip to first unread message

Brian Burgess

unread,
Feb 8, 2006, 12:58:23 AM2/8/06
to
Hi all,

Does anyone here know if the IVideoWindow is supported in WM5? The docs
included with the SDK seem to be in conflict with the docs on the MSDN site.
Combining this with the fact that I cant get the video to display .. I'm
wondering if it is just an empty implementation.

Many thx

-B


Gary Daniels [MS]

unread,
Feb 8, 2006, 2:20:35 PM2/8/06
to
IVideoWindow is implemented in the video renderer filter and is supported.
WM5 is the first release supporting DirectShow, which may be the reason for
the documentation inconsistencies. Some background on what you're doing may
help with determining why the video doesn't display.

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.

"Brian Burgess" <bburg...@hotmail.com> wrote in message
news:OPqbwSHL...@tk2msftngp13.phx.gbl...

Brian Burgess

unread,
Feb 9, 2006, 9:06:26 AM2/9/06
to
Sure Gary thx .. I have a function called PlayFile in a couple apps: 1 on
WinXP and the same ported to WM5. This function is taken from the 'Video
Window' sample in MSDN for Direct Show as follows:
**********************************
void PlayFile ()

{

HRESULT hr;

// Create the filter graph manager and render the file.

CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder,
(LPVOID*)&m_pGraph);

hr = m_pGraph->RenderFile(m_pStreamName, NULL);

if(hr != S_OK)

MessageBox(NULL,"Video filters could not connect","DSVideo",MB_OK)


// Specify the owner window.

IVideoWindow *pVidWin = NULL;

m_pGraph->QueryInterface(IID_IVideoWindow, (LPVOID*)&pVidWin);

pVidWin->put_Owner((OAHWND)m_hWnd); //m_hWnd is in the ATL control in this
case

pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);

SIZEL Size;

AtlHiMetricToPixel(&m_sizeExtent, &Size);

pVidWin->SetWindowPosition(2,2,Size.cx-2,Size.cy-2);

// Set the owner window to receive event notices.

m_pGraph->QueryInterface(IID_IMediaEventEx, (LPVOID*)&m_pEvent);

m_pEvent->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0);

// Run the graph.

m_pGraph->QueryInterface(IID_IMediaControl, (LPVOID*)&m_pMediaControl);

m_pMediaControl->Run();

}

**********************************

This function works flawlessly in WinXP, but fails everytime in WM5 with the
following error code in 'hr' after running 'hr = m_pGraph->RenderFile':
0x80040218

The video files being tested in WM5 are identical to the ones in WinXP.
Also the same files do play in Windows Media Player on the WM5.

This HRESULT error code being returned is: VFW_E_CANNOT_RENDER No
combination of filters could be found to render the stream.

so what I would like to know is: Do I merely need to make the filter graph
manually? And, if so, how?.. like what filter names to use, what CLSIDs ,
Pins , etc .. etc .. or at least how to find out .. I am more than happy
to do homework .. just need to know where to look.

Many thx for the insights..

-BB

"Gary Daniels [MS]" <gar...@online.microsoft.com> wrote in message
news:OK1r9SOL...@TK2MSFTNGP09.phx.gbl...

Gary Daniels [MS]

unread,
Feb 9, 2006, 1:57:55 PM2/9/06
to
Windows Media Player on Windows Mobile does not use DirectShow to render
some types of media, primarily the windows media formats of video and audio
but there may be others. Because of this the DirectShow filters are not
available, which is the cause for the error you're seeing.

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.


"Brian Burgess" <bburg...@hotmail.com> wrote in message

news:uG9oJIYL...@TK2MSFTNGP10.phx.gbl...

Brian Burgess

unread,
Feb 10, 2006, 9:49:49 AM2/10/06
to
oh .. crap .. well what should I do then? I had assumed before that
Windows Media Player uses the same filters as DirectShow to render. If
this is not the case, is WMPlayer.ocx a similar avenue I can pursue?

In the end I need to render a RGB565 stream. The file was intended only as
a proof of concept to a client. Thankfully I did this proof-of-concept on
'big-windows'. But still I need to render a file as proof enough to
continue on my current plan of development. What type of file then do you
suggest I use?

thx again

-BB


"Gary Daniels [MS]" <gar...@online.microsoft.com> wrote in message

news:eyB9%23qaLG...@TK2MSFTNGP12.phx.gbl...

Gary Daniels [MS]

unread,
Feb 10, 2006, 1:58:23 PM2/10/06
to
I'm not very familiar with the Windows Media Player Mobile, there's an FAQ
available here:
http://www.microsoft.com/windows/windowsmedia/player/windowsmobile/faq.aspx

It appears that you'll be able to use the media player object model to do
what you need.

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.

"Brian Burgess" <bburg...@hotmail.com> wrote in message

news:eAkfJFlL...@tk2msftngp13.phx.gbl...

Brian Burgess

unread,
Feb 10, 2006, 10:51:32 PM2/10/06
to
Ok thanks .. Will check it out.

Is there any info on what files I can play with DirectShow? I noted that
someone in the Embedded group here said they were able to get the DirectShow
to render a WMV file. Though they didn't show how...

Any thoughts?

thx

-B


"Gary Daniels [MS]" <gar...@online.microsoft.com> wrote in message

news:umDV%23PnLG...@TK2MSFTNGP12.phx.gbl...

Brian Burgess

unread,
Feb 15, 2006, 1:02:57 PM2/15/06
to

Well I still prefer to know which DirectShow filters ARE available and how
to use. but even after that the WMP OCX isn't working out either. I have
the following code in my 'play' function:
*****************************
bool playInWMP(void)
{
HRESULT hr = S_OK;
LPUNKNOWN pUnk = NULL;
LPUNKNOWN pCntrUnk = NULL;
IWMPControls* pControls = NULL;
IWMPPlayer* pPlayer = NULL;

CAxWindow axWnd(m_hWnd); // ActiveX host window class.

hr =
axWnd.CreateControlEx(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")),
NULL, &pCntrUnk, &pUnk, GUID_NULL, NULL);
hr = pUnk->QueryInterface(__uuidof(IWMPPlayer), (LPVOID*)&pPlayer);

if(SUCCEEDED(hr))
{
hr = pPlayer->get_controls(&pControls);
hr = pPlayer->put_URL(CComBSTR(_T("\\My Documents\\Test.avi")));
hr = pControls->play();
}
return true;
}
*****************************

Any thoughts?

Many thx

-B


"Gary Daniels [MS]" <gar...@online.microsoft.com> wrote in message

news:umDV%23PnLG...@TK2MSFTNGP12.phx.gbl...

Tom Moon

unread,
Feb 28, 2006, 12:56:03 AM2/28/06
to
I'm having a similar problem. (FYI, I'm relatively new to DirectShow).
I had a chunk of code that could play .mp3's just fine when compiled
for a Smartphone 2003 project.
The same code transplanted to a Smartphone 5.0 and compiled for the
Windows Mobile 5.0 Smartphone Emulator project always returns
VFW_E_CANNOT_RENDER
after the call to RenderFile.
Here's the code (error checking removed)


<code>
IGraphBuilder *pGraph = NULL;
IMediaControl *pMediaControl = NULL;
IMediaEventEx *pMediaEventEx = NULL;
TCHAR tsFile [] = L"\\Storage Card\\My Music\\Song2.mp3";

CoInitializeEx(NULL,COINIT_MULTITHREADED);
CoCreateInstance(CLSID_FilterGraph, NULL,
CLSCTX_INPROC, IID_IGraphBuilder, (LPVOID*)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (LPVOID*)&pMediaControl);
pGraph->QueryInterface(IID_IMediaEvent, (LPVOID*)&pMediaEventEx);

// (HERE IS THE CALL THAT FAILS ON SP 5.0)
pGraph->RenderFile(tsFile, NULL);// <-returns VFW_E_CANNOT_RENDER!!!

pMediaControl->Run();
//... handleDSEvents ...
</code>


I'm sure the file exists because I check for it. I'm also checking all
return values for the functions called before
pGraph->RenderFile(...)
The return values are okay (according the MSDN docs on expected return
values). I can play the same file with the Windows Media Player on the
SP 5.0 emulator (so the file is intact and accessible). Everything
appears just fine.

Could I add the necessary mp3 filters? Why can't I just use the
Smartphone 2003 mp3 filters?

According to Xiaoma in this post
http://groups.google.com/group/microsoft.public.smartphone.developer/browse_frm/thread/c708510418c1d81/3a79112622047b2b?q=VFW_E_CANNOT_RENDER&rnum=1#3a79112622047b2b
mp3 is not supported.
There's some other good DShow links here:
http://tmhare.mvps.org/links.htm
I couldn't find any websites addressing this Smartphone 5.0 and
DirectShow codec support issue.

-J Tom Moon

Tom Moon

unread,
Feb 28, 2006, 9:41:17 PM2/28/06
to
Small mistake.
I successfully played mp3's using DirectShow on a WinCE 4.2 embedded
project.
Replace all Smartphone 2003 references to DirectShow on WinCE 4.2
emulator.

-Tom

0 new messages