2004-03-09 01:29:56 +00:00
|
|
|
/*
|
|
|
|
* Implementation of IAMMultiMediaStream Interface
|
|
|
|
*
|
|
|
|
* Copyright 2004 Christian Costa
|
|
|
|
*
|
|
|
|
* This file contains the (internal) driver registration functions,
|
|
|
|
* driver enumeration APIs and DirectDraw creation functions.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2004-10-07 03:06:48 +00:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2004-03-09 01:29:56 +00:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "wingdi.h"
|
|
|
|
|
|
|
|
#include "amstream_private.h"
|
|
|
|
#include "amstream.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(amstream);
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
IAMMultiMediaStream lpVtbl;
|
2005-07-11 13:21:17 +00:00
|
|
|
LONG ref;
|
2004-03-09 01:29:56 +00:00
|
|
|
} IAMMultiMediaStreamImpl;
|
|
|
|
|
2005-05-27 20:17:35 +00:00
|
|
|
static const struct IAMMultiMediaStreamVtbl AM_Vtbl;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj)
|
|
|
|
{
|
|
|
|
IAMMultiMediaStreamImpl* object;
|
|
|
|
|
|
|
|
FIXME("(%p,%p)\n", pUnkOuter, ppObj);
|
2004-10-18 21:21:19 +00:00
|
|
|
|
|
|
|
if( pUnkOuter )
|
|
|
|
return CLASS_E_NOAGGREGATION;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAMMultiMediaStreamImpl));
|
|
|
|
|
|
|
|
object->lpVtbl.lpVtbl = &AM_Vtbl;
|
|
|
|
object->ref = 1;
|
|
|
|
|
|
|
|
*ppObj = object;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_QueryInterface(IAMMultiMediaStream* iface, REFIID riid, void** ppvObject)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
|
|
|
|
|
|
|
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
|
|
|
|| IsEqualGUID(riid, &IID_IAMMultiMediaStream))
|
|
|
|
{
|
|
|
|
IClassFactory_AddRef(iface);
|
|
|
|
*ppvObject = This;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI IAMMultiMediaStreamImpl_AddRef(IAMMultiMediaStream* iface)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
2005-01-10 12:25:29 +00:00
|
|
|
TRACE("(%p/%p)\n", iface, This);
|
|
|
|
return InterlockedIncrement(&This->ref);
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2005-01-10 12:25:29 +00:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
2004-03-09 01:29:56 +00:00
|
|
|
|
2005-01-10 12:25:29 +00:00
|
|
|
TRACE("(%p/%p)\n", iface, This);
|
2004-03-09 01:29:56 +00:00
|
|
|
|
2005-01-10 12:25:29 +00:00
|
|
|
if (!ref)
|
2004-03-09 01:29:56 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
|
2005-01-10 12:25:29 +00:00
|
|
|
return ref;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMultiMediaStream methods ***/
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetInformation(IAMMultiMediaStream* iface, char* pdwFlags, STREAM_TYPE* pStreamType)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, pdwFlags, pStreamType);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetMediaStream(IAMMultiMediaStream* iface, REFMSPID idPurpose, IMediaStream** ppMediaStream)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p,%p) stub!\n", This, iface, idPurpose, ppMediaStream);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_EnumMediaStreams(IAMMultiMediaStream* iface, long Index, IMediaStream** ppMediaStream)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%ld,%p) stub!\n", This, iface, Index, ppMediaStream);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetState(IAMMultiMediaStream* iface, STREAM_STATE* pCurrentState)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentState);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_SetState(IAMMultiMediaStream* iface, STREAM_STATE NewState)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->() stub!\n", This, iface);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetTime(IAMMultiMediaStream* iface, STREAM_TIME* pCurrentTime)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, pCurrentTime);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetDuration(IAMMultiMediaStream* iface, STREAM_TIME* pDuration)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, pDuration);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_Seek(IAMMultiMediaStream* iface, STREAM_TIME SeekTime)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->() stub!\n", This, iface);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetEndOfStream(IAMMultiMediaStream* iface, HANDLE* phEOS)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, phEOS);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** IAMMultiMediaStream methods ***/
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* iface, STREAM_TYPE StreamType, DWORD dwFlags, IGraphBuilder* pFilterGraph)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%lx,%lx,%p) stub!\n", This, iface, (DWORD)StreamType, dwFlags, pFilterGraph);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream* iface, IGraphBuilder** ppGraphBuilder)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppGraphBuilder);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilter(IAMMultiMediaStream* iface, IMediaStreamFilter** ppFilter)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppFilter);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* pStreamObject, const MSPID* PurposeId,
|
|
|
|
DWORD dwFlags, IMediaStream** ppNewStream)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p,%p,%lx,%p) stub!\n", This, iface, pStreamObject, PurposeId, dwFlags, ppNewStream);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenFile(IAMMultiMediaStream* iface, LPCWSTR pszFileName, DWORD dwFlags)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p,%lx) stub!\n", This, iface, pszFileName, dwFlags);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_OpenMoniker(IAMMultiMediaStream* iface, IBindCtx* pCtx, IMoniker* pMoniker, DWORD dwFlags)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%p,%p,%lx) stub!\n", This, iface, pCtx, pMoniker, dwFlags);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI IAMMultiMediaStreamImpl_Render(IAMMultiMediaStream* iface, DWORD dwFlags)
|
|
|
|
{
|
2004-09-06 20:34:29 +00:00
|
|
|
IAMMultiMediaStreamImpl *This = (IAMMultiMediaStreamImpl *)iface;
|
2004-03-09 01:29:56 +00:00
|
|
|
|
|
|
|
FIXME("(%p/%p)->(%lx) stub!\n", This, iface, dwFlags);
|
|
|
|
|
2005-05-27 09:10:05 +00:00
|
|
|
return E_NOTIMPL;
|
2004-03-09 01:29:56 +00:00
|
|
|
}
|
|
|
|
|
2005-05-27 20:17:35 +00:00
|
|
|
static const IAMMultiMediaStreamVtbl AM_Vtbl =
|
2004-03-09 01:29:56 +00:00
|
|
|
{
|
|
|
|
IAMMultiMediaStreamImpl_QueryInterface,
|
|
|
|
IAMMultiMediaStreamImpl_AddRef,
|
|
|
|
IAMMultiMediaStreamImpl_Release,
|
|
|
|
IAMMultiMediaStreamImpl_GetInformation,
|
|
|
|
IAMMultiMediaStreamImpl_GetMediaStream,
|
|
|
|
IAMMultiMediaStreamImpl_EnumMediaStreams,
|
|
|
|
IAMMultiMediaStreamImpl_GetState,
|
|
|
|
IAMMultiMediaStreamImpl_SetState,
|
|
|
|
IAMMultiMediaStreamImpl_GetTime,
|
|
|
|
IAMMultiMediaStreamImpl_GetDuration,
|
|
|
|
IAMMultiMediaStreamImpl_Seek,
|
|
|
|
IAMMultiMediaStreamImpl_GetEndOfStream,
|
|
|
|
IAMMultiMediaStreamImpl_Initialize,
|
|
|
|
IAMMultiMediaStreamImpl_GetFilterGraph,
|
|
|
|
IAMMultiMediaStreamImpl_GetFilter,
|
|
|
|
IAMMultiMediaStreamImpl_AddMediaStream,
|
|
|
|
IAMMultiMediaStreamImpl_OpenFile,
|
|
|
|
IAMMultiMediaStreamImpl_OpenMoniker,
|
|
|
|
IAMMultiMediaStreamImpl_Render
|
|
|
|
};
|