Re: IVideoWindow on WM5
- From: "Brian Burgess" <bburgess66@xxxxxxxxxxx>
- Date: Thu, 16 Feb 2006 02:02:57 +0800
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]" <garydan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:umDV%23PnLGHA.360@xxxxxxxxxxxxxxxxxxxxxxx
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" <bburgess66@xxxxxxxxxxx> wrote in message
news:eAkfJFlLGHA.2668@xxxxxxxxxxxxxxxxxxxxxxx
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]" <garydan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:eyB9%23qaLGHA.2624@xxxxxxxxxxxxxxxxxxxxxxx
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" <bburgess66@xxxxxxxxxxx> wrote in message
news:uG9oJIYLGHA.3060@xxxxxxxxxxxxxxxxxxxxxxx
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]" <garydan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:OK1r9SOLGHA.1312@xxxxxxxxxxxxxxxxxxxxxxx
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" <bburgess66@xxxxxxxxxxx> wrote in message
news:OPqbwSHLGHA.2780@xxxxxxxxxxxxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: IVideoWindow on WM5
- From: Tom Moon
- Re: IVideoWindow on WM5
- References:
- IVideoWindow on WM5
- From: Brian Burgess
- Re: IVideoWindow on WM5
- From: Gary Daniels [MS]
- Re: IVideoWindow on WM5
- From: Brian Burgess
- Re: IVideoWindow on WM5
- From: Gary Daniels [MS]
- Re: IVideoWindow on WM5
- From: Brian Burgess
- Re: IVideoWindow on WM5
- From: Gary Daniels [MS]
- IVideoWindow on WM5
- Prev by Date: Re: Attributes for XML
- Next by Date: Re: MenuBar Disappeared ?
- Previous by thread: Re: IVideoWindow on WM5
- Next by thread: Re: IVideoWindow on WM5
- Index(es):
Relevant Pages
|