48 return &
filter->capture.pin;
50 return &
filter->preview.pin;
80 TRACE(
"(%p, AM_MEDIA_TYPE(%p))\n",
This, pmt);
93 TRACE(
"(%p)->(%d, %p)\n",
This, iPosition, amt);
97 if (
This->sink.pin.peer)
126 BYTE *ptrIn, *ptrOut;
130 hr = IMediaSample_GetTime(inputSample, &
startTime, &endTime);
136 haveStartTime = haveEndTime =
FALSE;
140 hr = IMemAllocator_GetBuffer(
allocator, &outputSample,
143 if (IMediaSample_GetSize(outputSample) < IMediaSample_GetActualDataLength(inputSample)) {
144 ERR(
"insufficient space in sample\n");
149 hr = IMediaSample_SetTime(outputSample, haveStartTime ? &
startTime :
NULL, haveEndTime ? &endTime :
NULL);
152 hr = IMediaSample_GetPointer(inputSample, &ptrIn);
154 hr = IMediaSample_GetPointer(outputSample, &ptrOut);
156 memcpy(ptrOut, ptrIn, IMediaSample_GetActualDataLength(inputSample));
157 IMediaSample_SetActualDataLength(outputSample, IMediaSample_GetActualDataLength(inputSample));
159 hr = IMediaSample_SetDiscontinuity(outputSample, IMediaSample_IsDiscontinuity(inputSample) ==
S_OK);
162 haveStartTime = haveEndTime =
TRUE;
163 hr = IMediaSample_GetMediaTime(inputSample, &
startTime, &endTime);
169 haveStartTime = haveEndTime =
FALSE;
172 hr = IMediaSample_SetMediaTime(outputSample, haveStartTime ? &
startTime :
NULL, haveEndTime ? &endTime :
NULL);
175 hr = IMediaSample_GetMediaType(inputSample, &mediaType);
178 hr = IMediaSample_SetMediaType(outputSample, mediaType);
182 hr = IMediaSample_SetPreroll(outputSample, IMediaSample_IsPreroll(inputSample) ==
S_OK);
185 hr = IMediaSample_SetSyncPoint(outputSample, IMediaSample_IsSyncPoint(inputSample) ==
S_OK);
192 IMediaSample_Release(outputSample);
195 *pOutputSample = outputSample;
206 TRACE(
"(%p)->(%p)\n",
This, inputSample);
215 if (
This->capture.pin.peer)
216 hrCapture =
copy_sample(inputSample,
This->capture.pAllocator, &captureSample);
219 hrCapture = IMemInputPin_Receive(
This->capture.pMemInputPin, captureSample);
221 IMediaSample_Release(captureSample);
224 if (
This->preview.pin.peer)
225 hrPreview =
copy_sample(inputSample,
This->preview.pAllocator, &previewSample);
229 hrPreview = IMediaSample_SetTime(previewSample,
NULL,
NULL);
231 hrPreview = IMemInputPin_Receive(
This->preview.pMemInputPin, previewSample);
233 IMediaSample_Release(previewSample);
264 if (!
filter->sink.pin.peer)
279 TRACE(
"(%p, %p, %p)\n",
This, pPin, pAlloc);
280 *pAlloc =
This->sink.pAllocator;
281 IMemAllocator_AddRef(
This->sink.pAllocator);
282 return IMemInputPin_NotifyAllocator(pPin,
This->sink.pAllocator,
TRUE);
303 TRACE(
"(%p, %p, %p)\n",
This, pPin, pAlloc);
304 *pAlloc =
This->sink.pAllocator;
305 IMemAllocator_AddRef(
This->sink.pAllocator);
306 return IMemInputPin_NotifyAllocator(pPin,
This->sink.pAllocator,
TRUE);
322 if (!(
object =
calloc(1,
sizeof(*
object))))
328 &IID_IMemAllocator, (
void **)&
object->sink.pAllocator);
339 TRACE(
"Created smart tee %p.\n",
object);
340 *
out = &
object->filter.IUnknown_inner;
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static previewinfo preview
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
static ULONGLONG startTime
GLsizei GLenum GLboolean sink
#define memcpy(s1, s2, n)
#define IsEqualGUID(rguid1, rguid2)
static HRESULT sink_get_media_type(struct strmbase_pin *base, unsigned int iPosition, AM_MEDIA_TYPE *amt)
static SmartTeeFilter * impl_from_strmbase_filter(struct strmbase_filter *filter)
static void smart_tee_destroy(struct strmbase_filter *iface)
static SmartTeeFilter * impl_from_strmbase_pin(struct strmbase_pin *pin)
static struct strmbase_pin * smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index)
static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc)
static HRESULT WINAPI SmartTeeFilterInput_Receive(struct strmbase_sink *base, IMediaSample *inputSample)
static const struct strmbase_source_ops preview_ops
static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_source *base, IMemInputPin *pPin, IMemAllocator **pAlloc)
static const struct strmbase_sink_ops sink_ops
static HRESULT capture_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt)
static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *pmt)
static const struct strmbase_filter_ops filter_ops
static HRESULT smart_tee_wait_state(struct strmbase_filter *iface, DWORD timeout)
static HRESULT copy_sample(IMediaSample *inputSample, IMemAllocator *allocator, IMediaSample **pOutputSample)
HRESULT smart_tee_create(IUnknown *outer, IUnknown **out)
static HRESULT preview_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE *amt)
static const struct strmbase_source_ops capture_ops
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_sink_cleanup(struct strmbase_sink *pin)
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
void strmbase_filter_cleanup(struct strmbase_filter *filter)
void strmbase_source_cleanup(struct strmbase_source *pin)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
void WINAPI DeleteMediaType(AM_MEDIA_TYPE *pMediaType)
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_SAMPLE_TIME_NOT_SET
#define VFW_E_MEDIA_TIME_NOT_SET
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_S_NO_STOP_TIME
#define VFW_E_BUFFER_OVERFLOW
#define VFW_S_NO_MORE_ITEMS
#define VFW_E_NOT_CONNECTED
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)