strmbase: Add support for IQualityControl.
This commit is contained in:
parent
120dd66ed2
commit
0a4ee68168
|
@ -6,6 +6,7 @@ C_SRCS = \
|
|||
filter.c \
|
||||
mediatype.c \
|
||||
pin.c \
|
||||
qualitycontrol.c \
|
||||
seeking.c \
|
||||
transform.c
|
||||
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Quality Control Interfaces
|
||||
*
|
||||
* Copyright 2010 Maarten Lankhorst for Codeweavers
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "dshow.h"
|
||||
#include "wine/strmbase.h"
|
||||
|
||||
#include "uuids.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
|
||||
|
||||
void QualityControlImpl_init(QualityControlImpl *This, IPin *input, IBaseFilter *self) {
|
||||
This->input = input;
|
||||
This->self = self;
|
||||
This->tonotify = NULL;
|
||||
}
|
||||
|
||||
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) {
|
||||
QualityControlImpl *This = (QualityControlImpl*)iface;
|
||||
return IUnknown_QueryInterface(This->self, riid, ppv);
|
||||
}
|
||||
|
||||
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface) {
|
||||
QualityControlImpl *This = (QualityControlImpl*)iface;
|
||||
return IUnknown_AddRef(This->self);
|
||||
}
|
||||
|
||||
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface) {
|
||||
QualityControlImpl *This = (QualityControlImpl*)iface;
|
||||
return IUnknown_Release(This->self);
|
||||
}
|
||||
|
||||
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm) {
|
||||
HRESULT hr = S_FALSE;
|
||||
QualityControlImpl *This = (QualityControlImpl*)iface;
|
||||
if (This->tonotify)
|
||||
return IQualityControl_Notify(This->tonotify, This->self, qm);
|
||||
if (This->input) {
|
||||
IPin *to = NULL;
|
||||
IPin_ConnectedTo(This->input, &to);
|
||||
if (to) {
|
||||
IQualityControl *qc = NULL;
|
||||
IUnknown_QueryInterface(to, &IID_IQualityControl, (void**)&qc);
|
||||
if (qc) {
|
||||
hr = IQualityControl_Notify(qc, This->self, qm);
|
||||
IQualityControl_Release(qc);
|
||||
}
|
||||
IPin_Release(to);
|
||||
}
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify) {
|
||||
QualityControlImpl *This = (QualityControlImpl*)iface;
|
||||
This->tonotify = tonotify;
|
||||
return S_OK;
|
||||
}
|
|
@ -194,6 +194,21 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enu
|
|||
|
||||
HRESULT WINAPI EnumPins_Construct(BaseFilter *base, BaseFilter_GetPin receive_pin, BaseFilter_GetPinCount receive_pincount, BaseFilter_GetPinVersion receive_version, IEnumPins ** ppEnum);
|
||||
|
||||
/* Quality Control */
|
||||
typedef struct QualityControlImpl {
|
||||
const IQualityControlVtbl *lpVtbl;
|
||||
IPin *input;
|
||||
IBaseFilter *self;
|
||||
IQualityControl *tonotify;
|
||||
} QualityControlImpl;
|
||||
|
||||
void QualityControlImpl_init(QualityControlImpl *This, IPin *input, IBaseFilter *self);
|
||||
HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv);
|
||||
ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface);
|
||||
ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface);
|
||||
HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm);
|
||||
HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify);
|
||||
|
||||
/* Transform Filter */
|
||||
typedef struct TransformFilter
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue