quartz: Add stub IAMStreamSelect to MPEG-1 Stream Splitter.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Anton Baskanov 2015-10-22 22:54:47 +06:00 committed by Alexandre Julliard
parent 4d5f866d99
commit b75eb2f91e
2 changed files with 137 additions and 1 deletions

View File

@ -55,6 +55,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct MPEGSplitterImpl
{
ParserImpl Parser;
IAMStreamSelect IAMStreamSelect_iface;
LONGLONG EndOfFile;
LONGLONG position;
DWORD begin_offset;
@ -64,11 +65,21 @@ typedef struct MPEGSplitterImpl
BOOL seek;
} MPEGSplitterImpl;
static inline MPEGSplitterImpl *impl_from_IBaseFilter( IBaseFilter *iface )
{
return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.filter.IBaseFilter_iface);
}
static inline MPEGSplitterImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
{
return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.sourceSeeking.IMediaSeeking_iface);
}
static inline MPEGSplitterImpl *impl_from_IAMStreamSelect( IAMStreamSelect *iface )
{
return CONTAINING_RECORD(iface, MPEGSplitterImpl, IAMStreamSelect_iface);
}
static int MPEGSplitter_head_check(const BYTE *header)
{
/* If this is a possible start code, check for a system or video header */
@ -752,9 +763,36 @@ static HRESULT MPEGSplitter_first_request(LPVOID iface)
return hr;
}
static HRESULT WINAPI MPEGSplitter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
{
MPEGSplitterImpl *This = impl_from_IBaseFilter(iface);
TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv);
*ppv = NULL;
if ( IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IPersist)
|| IsEqualIID(riid, &IID_IMediaFilter)
|| IsEqualIID(riid, &IID_IBaseFilter) )
*ppv = iface;
else if ( IsEqualIID(riid, &IID_IAMStreamSelect) )
*ppv = &This->IAMStreamSelect_iface;
if (*ppv)
{
IBaseFilter_AddRef(iface);
return S_OK;
}
if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow))
FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
return E_NOINTERFACE;
}
static const IBaseFilterVtbl MPEGSplitter_Vtbl =
{
Parser_QueryInterface,
MPEGSplitter_QueryInterface,
Parser_AddRef,
Parser_Release,
Parser_GetClassID,
@ -771,6 +809,64 @@ static const IBaseFilterVtbl MPEGSplitter_Vtbl =
Parser_QueryVendorInfo
};
static HRESULT WINAPI AMStreamSelect_QueryInterface(IAMStreamSelect *iface, REFIID riid, void **ppv)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
return IBaseFilter_QueryInterface(&This->Parser.filter.IBaseFilter_iface, riid, ppv);
}
static ULONG WINAPI AMStreamSelect_AddRef(IAMStreamSelect *iface)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
return IBaseFilter_AddRef(&This->Parser.filter.IBaseFilter_iface);
}
static ULONG WINAPI AMStreamSelect_Release(IAMStreamSelect *iface)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
return IBaseFilter_Release(&This->Parser.filter.IBaseFilter_iface);
}
static HRESULT WINAPI AMStreamSelect_Count(IAMStreamSelect *iface, DWORD *streams)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
FIXME("(%p/%p)->(%p) stub!\n", This, iface, streams);
return E_NOTIMPL;
}
static HRESULT WINAPI AMStreamSelect_Info(IAMStreamSelect *iface, LONG index, AM_MEDIA_TYPE **media_type, DWORD *flags, LCID *lcid, DWORD *group, WCHAR **name, IUnknown **object, IUnknown **unknown)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
FIXME("(%p/%p)->(%d,%p,%p,%p,%p,%p,%p,%p) stub!\n", This, iface, index, media_type, flags, lcid, group, name, object, unknown);
return E_NOTIMPL;
}
static HRESULT WINAPI AMStreamSelect_Enable(IAMStreamSelect *iface, LONG index, DWORD flags)
{
MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface);
FIXME("(%p/%p)->(%d,%x) stub!\n", This, iface, index, flags);
return E_NOTIMPL;
}
static const IAMStreamSelectVtbl AMStreamSelectVtbl =
{
AMStreamSelect_QueryInterface,
AMStreamSelect_AddRef,
AMStreamSelect_Release,
AMStreamSelect_Count,
AMStreamSelect_Info,
AMStreamSelect_Enable
};
HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
{
MPEGSplitterImpl *This;
@ -794,6 +890,7 @@ HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv)
CoTaskMemFree(This);
return hr;
}
This->IAMStreamSelect_iface.lpVtbl = &AMStreamSelectVtbl;
This->seek = TRUE;
/* Note: This memory is managed by the parser filter once created */

View File

@ -655,3 +655,42 @@ enum tagAM_MEDIAEVENT_FLAGS
{
AM_MEDIAEVENT_NONOTIFY = 0x01
};
enum _AMSTREAMSELECTINFOFLAGS
{
AMSTREAMSELECTINFO_ENABLED = 0x1,
AMSTREAMSELECTINFO_EXCLUSIVE = 0x2
};
enum _AMSTREAMSELECTENABLEFLAGS
{
AMSTREAMSELECTENABLE_ENABLE = 0x1,
AMSTREAMSELECTENABLE_ENABLEALL = 0x2
};
[
object,
uuid(c1960960-17f5-11d1-abe1-00a0c905f375),
pointer_default(unique)
]
interface IAMStreamSelect : IUnknown
{
HRESULT Count(
[out] DWORD *streams);
HRESULT Info(
[in] long index,
[out] AM_MEDIA_TYPE **media_type,
[out] DWORD *flags,
[out] LCID *lcid,
[out] DWORD *group,
[out] WCHAR **name,
[out] IUnknown **object,
[out] IUnknown **unknown);
HRESULT Enable(
[in] long index,
[in] DWORD flags);
}
typedef IAMStreamSelect *PAMSTREAMSELECT;