ReactOS 0.4.17-dev-934-g091855f
nullrenderer.c File Reference
#include "dshow.h"
#include "wine/strmbase.h"
#include "wine/test.h"
Include dependency graph for nullrenderer.c:

Go to the source code of this file.

Classes

struct  testfilter
 
struct  frame_thread_params
 

Macros

#define COBJMACROS
 
#define check_interface(a, b, c)   check_interface_(__LINE__, a, b, c)
 
#define join_thread(a)   join_thread_(__LINE__, a)
 

Functions

static IBaseFilter * create_null_renderer (void)
 
static IFilterGraph2 * create_graph (void)
 
static ULONG get_refcount (void *iface)
 
static void check_interface_ (unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
 
static void test_interfaces (void)
 
static void test_enum_pins (void)
 
static void test_find_pin (void)
 
static void test_pin_info (void)
 
static HRESULT WINAPI outer_QueryInterface (IUnknown *iface, REFIID iid, void **out)
 
static ULONG WINAPI outer_AddRef (IUnknown *iface)
 
static ULONG WINAPI outer_Release (IUnknown *iface)
 
static void test_aggregation (void)
 
static void test_media_types (void)
 
static void test_enum_media_types (void)
 
static struct testfilter * impl_from_strmbase_filter (struct strmbase_filter *iface)
 
static struct strmbase_pin * testfilter_get_pin (struct strmbase_filter *iface, unsigned int index)
 
static void testfilter_destroy (struct strmbase_filter *iface)
 
static HRESULT WINAPI testsource_DecideAllocator (struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
 
static void testfilter_init (struct testfilter *filter)
 
static void test_allocator (IMemInputPin *input)
 
static DWORD WINAPI frame_thread (void *arg)
 
static HANDLE send_frame_time (IMemInputPin *sink, REFERENCE_TIME start_time, unsigned char color)
 
static HANDLE send_frame (IMemInputPin *sink)
 
static HRESULT join_thread_ (int line, HANDLE thread)
 
static void test_filter_state (IMemInputPin *input, IFilterGraph2 *graph)
 
static void test_flushing (IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
 
static unsigned int check_event_code (IMediaEvent *eventsrc, DWORD timeout, LONG expected_code, LONG_PTR expected1, LONG_PTR expected2)
 
static unsigned int check_ec_complete (IMediaEvent *eventsrc, DWORD timeout)
 
static void test_connect_pin (void)
 
static void test_unconnected_eos (void)
 
 START_TEST (nullrenderer)
 

Variables

static const GUID test_iid = {0x33333333}
 
static LONG outer_ref = 1
 
static const IUnknownVtbl outer_vtbl
 
static IUnknown test_outer = {&outer_vtbl}
 
static const struct strmbase_filter_ops testfilter_ops
 
static const struct strmbase_source_ops testsource_ops
 

Macro Definition Documentation

◆ check_interface

#define check_interface (   a,
  b,
  c 
)    check_interface_(__LINE__, a, b, c)

Definition at line 51 of file nullrenderer.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file nullrenderer.c.

◆ join_thread

#define join_thread (   a)    join_thread_(__LINE__, a)

Definition at line 595 of file nullrenderer.c.

Function Documentation

◆ check_ec_complete()

static unsigned int check_ec_complete ( IMediaEvent *  eventsrc,
DWORD  timeout 
)
static

Definition at line 826 of file nullrenderer.c.

827{
828 return check_event_code(eventsrc, timeout, EC_COMPLETE, S_OK, 0);
829}
#define EC_COMPLETE
Definition: evcode.h:17
#define S_OK
Definition: intsafe.h:52
static unsigned int check_event_code(IMediaEvent *eventsrc, DWORD timeout, LONG expected_code, LONG_PTR expected1, LONG_PTR expected2)
Definition: nullrenderer.c:803
Definition: dhcpd.h:248

Referenced by test_unconnected_eos().

◆ check_event_code()

static unsigned int check_event_code ( IMediaEvent *  eventsrc,
DWORD  timeout,
LONG  expected_code,
LONG_PTR  expected1,
LONG_PTR  expected2 
)
static

Definition at line 803 of file nullrenderer.c.

804{
805 LONG_PTR param1, param2;
806 unsigned int ret = 0;
807 HRESULT hr;
808 LONG code;
809
810 while ((hr = IMediaEvent_GetEvent(eventsrc, &code, &param1, &param2, timeout)) == S_OK)
811 {
812 if (code == expected_code)
813 {
814 ok(param1 == expected1, "Got param1 %#Ix.\n", param1);
815 ok(param2 == expected2, "Got param2 %#Ix.\n", param2);
816 ret++;
817 }
818 IMediaEvent_FreeEventParams(eventsrc, code, param1, param2);
819 timeout = 0;
820 }
821 ok(hr == E_ABORT, "Got hr %#lx.\n", hr);
822
823 return ret;
824}
#define ok(value,...)
Definition: atltest.h:57
HRESULT hr
Definition: delayimp.cpp:582
return ret
Definition: mutex.c:147
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
long LONG
Definition: pedump.c:60
Definition: inflate.c:139
#define E_ABORT
Definition: winerror.h:3481

Referenced by check_ec_complete().

◆ check_interface_()

static void check_interface_ ( unsigned int  line,
void *  iface_ptr,
REFIID  iid,
BOOL  supported 
)
static

Definition at line 52 of file nullrenderer.c.

53{
54 IUnknown *iface = iface_ptr;
56 IUnknown *unk;
57
58 expected_hr = supported ? S_OK : E_NOINTERFACE;
59
60 hr = IUnknown_QueryInterface(iface, iid, (void **)&unk);
61 ok_(__FILE__, line)(hr == expected_hr, "Got hr %#lx, expected %#lx.\n", hr, expected_hr);
62 if (SUCCEEDED(hr))
63 IUnknown_Release(unk);
64}
#define ok_(x1, x2)
Definition: atltest.h:61
HRESULT expected_hr
#define SUCCEEDED(hr)
Definition: intsafe.h:50
Definition: parser.c:49
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ create_graph()

static IFilterGraph2 * create_graph ( void  )
static

Definition at line 35 of file nullrenderer.c.

36{
38 HRESULT hr;
39 hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&ret);
40 ok(hr == S_OK, "Got hr %#lx.\n", hr);
41 return ret;
42}
#define NULL
Definition: types.h:112
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685

Referenced by multimedia_stream_AddMediaStream(), multimedia_stream_Initialize(), multimedia_stream_OpenFile(), and test_unconnected_eos().

◆ create_null_renderer()

static IBaseFilter * create_null_renderer ( void  )
static

Definition at line 26 of file nullrenderer.c.

27{
29 HRESULT hr = CoCreateInstance(&CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
30 &IID_IBaseFilter, (void **)&filter);
31 ok(hr == S_OK, "Got hr %#lx.\n", hr);
32 return filter;
33}
const GUID IID_IBaseFilter
Definition: filter.c:165

Referenced by test_connect_pin(), test_enum_media_types(), test_enum_pins(), test_find_pin(), test_interfaces(), test_media_types(), test_pin_info(), and test_unconnected_eos().

◆ frame_thread()

static DWORD WINAPI frame_thread ( void *  arg)
static

Definition at line 533 of file nullrenderer.c.

534{
536 HRESULT hr;
537
538 if (winetest_debug > 1) trace("%04lx: Sending frame.\n", GetCurrentThreadId());
539 hr = IMemInputPin_Receive(params->sink, params->sample);
540 if (winetest_debug > 1) trace("%04lx: Returned %#lx.\n", GetCurrentThreadId(), hr);
541 IMediaSample_Release(params->sample);
542 free(params);
543 return hr;
544}
#define trace
Definition: atltest.h:70
#define free
Definition: debug_ros.c:5
GLenum const GLfloat * params
Definition: glext.h:5645
int winetest_debug
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
void * arg
Definition: msvc.h:10

Referenced by send_frame_time().

◆ get_refcount()

static ULONG get_refcount ( void *  iface)
static

Definition at line 44 of file nullrenderer.c.

45{
46 IUnknown *unknown = iface;
47 IUnknown_AddRef(unknown);
48 return IUnknown_Release(unknown);
49}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1674

Referenced by test_aggregation(), test_enum_pins(), and test_pin_info().

◆ impl_from_strmbase_filter()

static struct testfilter * impl_from_strmbase_filter ( struct strmbase_filter *  iface)
inlinestatic

Definition at line 439 of file nullrenderer.c.

440{
441 return CONTAINING_RECORD(iface, struct testfilter, filter);
442}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by testfilter_destroy(), and testfilter_get_pin().

◆ join_thread_()

static HRESULT join_thread_ ( int  line,
HANDLE  thread 
)
static

Definition at line 587 of file nullrenderer.c.

588{
589 DWORD ret;
590 ok_(__FILE__, line)(!WaitForSingleObject(thread, 1000), "Wait failed.\n");
593 return ret;
594}
static HANDLE thread
Definition: service.c:33
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
Definition: thread.c:541
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

◆ outer_AddRef()

static ULONG WINAPI outer_AddRef ( IUnknown *  iface)
static

Definition at line 284 of file nullrenderer.c.

285{
287}
#define InterlockedIncrement
Definition: armddk.h:53
static LONG outer_ref
Definition: nullrenderer.c:269

◆ outer_QueryInterface()

static HRESULT WINAPI outer_QueryInterface ( IUnknown *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 271 of file nullrenderer.c.

272{
273 if (IsEqualGUID(iid, &IID_IUnknown)
275 || IsEqualGUID(iid, &test_iid))
276 {
277 *out = (IUnknown *)0xdeadbeef;
278 return S_OK;
279 }
280 ok(0, "unexpected call %s\n", wine_dbgstr_guid(iid));
281 return E_NOINTERFACE;
282}
const GUID IID_IUnknown
static const GUID test_iid
Definition: nullrenderer.c:268
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:181
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

◆ outer_Release()

static ULONG WINAPI outer_Release ( IUnknown *  iface)
static

Definition at line 289 of file nullrenderer.c.

290{
292}
#define InterlockedDecrement
Definition: armddk.h:52

◆ send_frame()

static HANDLE send_frame ( IMemInputPin *  sink)
static

Definition at line 582 of file nullrenderer.c.

583{
584 return send_frame_time(sink, 0, 0x55); /* purple */
585}
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static HANDLE send_frame_time(IMemInputPin *sink, REFERENCE_TIME start_time, unsigned char color)
Definition: nullrenderer.c:546

Referenced by test_filter_state(), and test_flushing().

◆ send_frame_time()

static HANDLE send_frame_time ( IMemInputPin *  sink,
REFERENCE_TIME  start_time,
unsigned char  color 
)
static

Definition at line 546 of file nullrenderer.c.

547{
548 struct frame_thread_params *params = malloc(sizeof(*params));
550 REFERENCE_TIME end_time;
553 HRESULT hr;
554 BYTE *data;
555
556 hr = IMemInputPin_GetAllocator(sink, &allocator);
557 ok(hr == S_OK, "Got hr %#lx.\n", hr);
558
559 hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
560 ok(hr == S_OK, "Got hr %#lx.\n", hr);
561
562 hr = IMediaSample_GetPointer(sample, &data);
563 ok(hr == S_OK, "Got hr %#lx.\n", hr);
564 memset(data, color, 32 * 16 * 2);
565
566 hr = IMediaSample_SetActualDataLength(sample, 32 * 16 * 2);
567 ok(hr == S_OK, "Got hr %#lx.\n", hr);
568
569 start_time *= 10000000;
570 end_time = start_time + 10000000;
571 hr = IMediaSample_SetTime(sample, &start_time, &end_time);
572 ok(hr == S_OK, "Got hr %#lx.\n", hr);
573
574 params->sink = sink;
575 params->sample = sample;
577
578 IMemAllocator_Release(allocator);
579 return thread;
580}
#define malloc
Definition: debug_ros.c:4
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint color
Definition: glext.h:6243
static DWORD WINAPI frame_thread(void *arg)
Definition: nullrenderer.c:533
#define memset(x, y, z)
Definition: compat.h:39
IMediaSample * sample
Definition: nullrenderer.c:530
Definition: wave.c:25
unsigned char BYTE
Definition: xxhash.c:193

Referenced by send_frame().

◆ START_TEST()

START_TEST ( nullrenderer  )

Definition at line 1006 of file nullrenderer.c.

1007{
1009 HRESULT hr;
1010
1012
1013 if (FAILED(hr = CoCreateInstance(&CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
1014 &IID_IBaseFilter, (void **)&filter)))
1015 {
1016 /* qedit.dll does not exist on 2003. */
1017 win_skip("Failed to create null renderer filter, hr %#lx.\n", hr);
1018 return;
1019 }
1020 IBaseFilter_Release(filter);
1021
1024 test_find_pin();
1025 test_pin_info();
1031
1033}
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
#define FAILED(hr)
Definition: intsafe.h:51
#define win_skip
Definition: minitest.h:67
static void test_aggregation(void)
Definition: nullrenderer.c:303
static void test_pin_info(void)
Definition: nullrenderer.c:223
static void test_find_pin(void)
Definition: nullrenderer.c:196
static void test_enum_media_types(void)
Definition: nullrenderer.c:389
static void test_interfaces(void)
Definition: nullrenderer.c:66
static void test_connect_pin(void)
Definition: nullrenderer.c:831
static void test_media_types(void)
Definition: nullrenderer.c:362
static void test_enum_pins(void)
Definition: nullrenderer.c:106
static void test_unconnected_eos(void)
Definition: nullrenderer.c:940

◆ test_aggregation()

static void test_aggregation ( void  )
static

Definition at line 303 of file nullrenderer.c.

304{
305 IBaseFilter *filter, *filter2;
306 IUnknown *unk, *unk2;
307 HRESULT hr;
308 ULONG ref;
309
310 filter = (IBaseFilter *)0xdeadbeef;
311 hr = CoCreateInstance(&CLSID_NullRenderer, &test_outer, CLSCTX_INPROC_SERVER,
312 &IID_IBaseFilter, (void **)&filter);
313 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
314 ok(!filter, "Got interface %p.\n", filter);
315
316 hr = CoCreateInstance(&CLSID_NullRenderer, &test_outer, CLSCTX_INPROC_SERVER,
317 &IID_IUnknown, (void **)&unk);
318 ok(hr == S_OK, "Got hr %#lx.\n", hr);
319 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
320 ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
321 ref = get_refcount(unk);
322 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
323
324 ref = IUnknown_AddRef(unk);
325 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
326 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
327
328 ref = IUnknown_Release(unk);
329 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
330 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
331
332 hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
333 ok(hr == S_OK, "Got hr %#lx.\n", hr);
334 ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
335 IUnknown_Release(unk2);
336
337 hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
338 ok(hr == S_OK, "Got hr %#lx.\n", hr);
339
340 hr = IBaseFilter_QueryInterface(filter, &IID_IUnknown, (void **)&unk2);
341 ok(hr == S_OK, "Got hr %#lx.\n", hr);
342 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
343
344 hr = IBaseFilter_QueryInterface(filter, &IID_IBaseFilter, (void **)&filter2);
345 ok(hr == S_OK, "Got hr %#lx.\n", hr);
346 ok(filter2 == (IBaseFilter *)0xdeadbeef, "Got unexpected IBaseFilter %p.\n", filter2);
347
348 hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
349 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
350 ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
351
352 hr = IBaseFilter_QueryInterface(filter, &test_iid, (void **)&unk2);
353 ok(hr == S_OK, "Got hr %#lx.\n", hr);
354 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
355
356 IBaseFilter_Release(filter);
357 ref = IUnknown_Release(unk);
358 ok(!ref, "Got unexpected refcount %ld.\n", ref);
359 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
360}
static ULONG get_refcount(void *iface)
Definition: nullrenderer.c:44
static IUnknown test_outer
Definition: nullrenderer.c:301
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by START_TEST().

◆ test_allocator()

static void test_allocator ( IMemInputPin *  input)
static

Definition at line 484 of file nullrenderer.c.

485{
486 IMemAllocator *req_allocator, *ret_allocator;
488 HRESULT hr;
489
490 hr = IMemInputPin_GetAllocatorRequirements(input, &props);
491 ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
492
493 hr = IMemInputPin_GetAllocator(input, &ret_allocator);
494 todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
495
496 if (hr == S_OK)
497 {
498 hr = IMemAllocator_GetProperties(ret_allocator, &props);
499 ok(hr == S_OK, "Got hr %#lx.\n", hr);
500 ok(!props.cBuffers, "Got %ld buffers.\n", props.cBuffers);
501 ok(!props.cbBuffer, "Got size %ld.\n", props.cbBuffer);
502 ok(!props.cbAlign, "Got alignment %ld.\n", props.cbAlign);
503 ok(!props.cbPrefix, "Got prefix %ld.\n", props.cbPrefix);
504
505 hr = IMemInputPin_NotifyAllocator(input, ret_allocator, TRUE);
506 ok(hr == S_OK, "Got hr %#lx.\n", hr);
507 IMemAllocator_Release(ret_allocator);
508 }
509
510 hr = IMemInputPin_NotifyAllocator(input, NULL, TRUE);
511 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
512
513 CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER,
514 &IID_IMemAllocator, (void **)&req_allocator);
515
516 hr = IMemInputPin_NotifyAllocator(input, req_allocator, TRUE);
517 ok(hr == S_OK, "Got hr %#lx.\n", hr);
518
519 hr = IMemInputPin_GetAllocator(input, &ret_allocator);
520 ok(hr == S_OK, "Got hr %#lx.\n", hr);
521 ok(ret_allocator == req_allocator, "Allocators didn't match.\n");
522
523 IMemAllocator_Release(req_allocator);
524 IMemAllocator_Release(ret_allocator);
525}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define TRUE
Definition: types.h:120
GLenum GLenum GLenum input
Definition: glext.h:9031
#define todo_wine
Definition: minitest.h:80
static const WCHAR props[]
Definition: wbemdisp.c:288
#define E_POINTER
Definition: winerror.h:3480

Referenced by test_connect_pin().

◆ test_connect_pin()

static void test_connect_pin ( void  )
static

Definition at line 831 of file nullrenderer.c.

832{
833 static const AM_MEDIA_TYPE req_mt =
834 {
835 .majortype = {0x111},
836 .subtype = {0x222},
837 .formattype = {0x333},
838 };
839 ALLOCATOR_PROPERTIES req_props = {1, 32 * 16 * 4, 1, 0}, ret_props;
841 struct testfilter source;
843 IMediaControl *control;
847 IPin *pin, *peer;
848 HRESULT hr;
849 ULONG ref;
850
852
853 CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
854 &IID_IFilterGraph2, (void **)&graph);
855 IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, L"source");
856 IFilterGraph2_AddFilter(graph, filter, L"sink");
857 IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
858
859 IBaseFilter_FindPin(filter, L"In", &pin);
860
861 peer = (IPin *)0xdeadbeef;
862 hr = IPin_ConnectedTo(pin, &peer);
863 ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
864 ok(!peer, "Got peer %p.\n", peer);
865
866 hr = IPin_ConnectionMediaType(pin, &mt);
867 ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
868
869 hr = IMediaControl_Pause(control);
870 ok(hr == S_OK, "Got hr %#lx.\n", hr);
871 hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
872 ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr);
873 hr = IMediaControl_Stop(control);
874 ok(hr == S_OK, "Got hr %#lx.\n", hr);
875
876 hr = IFilterGraph2_ConnectDirect(graph, &source.source.pin.IPin_iface, pin, &req_mt);
877 ok(hr == S_OK, "Got hr %#lx.\n", hr);
878
879 hr = IPin_ConnectedTo(pin, &peer);
880 ok(hr == S_OK, "Got hr %#lx.\n", hr);
881 ok(peer == &source.source.pin.IPin_iface, "Got peer %p.\n", peer);
882 IPin_Release(peer);
883
884 hr = IPin_ConnectionMediaType(pin, &mt);
885 ok(hr == S_OK, "Got hr %#lx.\n", hr);
886 ok(!memcmp(&mt, &req_mt, sizeof(AM_MEDIA_TYPE)), "Media types didn't match.\n");
887
888 hr = IMediaControl_Pause(control);
889 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
890 hr = IFilterGraph2_Disconnect(graph, pin);
891 ok(hr == VFW_E_NOT_STOPPED, "Got hr %#lx.\n", hr);
892 hr = IMediaControl_Stop(control);
893 ok(hr == S_OK, "Got hr %#lx.\n", hr);
894
895 IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&input);
896
898
899 hr = IMemInputPin_GetAllocator(input, &allocator);
900 ok(hr == S_OK, "Got hr %#lx.\n", hr);
901 hr = IMemAllocator_SetProperties(allocator, &req_props, &ret_props);
902 ok(hr == S_OK, "Got hr %#lx.\n", hr);
903 ok(!memcmp(&ret_props, &req_props, sizeof(req_props)), "Properties did not match.\n");
904 hr = IMemAllocator_Commit(allocator);
905 ok(hr == S_OK, "Got hr %#lx.\n", hr);
906 IMemAllocator_Release(allocator);
907
908 hr = IMemInputPin_ReceiveCanBlock(input);
909 ok(hr == S_OK, "Got hr %#lx.\n", hr);
910
913
914 hr = IFilterGraph2_Disconnect(graph, pin);
915 ok(hr == S_OK, "Got hr %#lx.\n", hr);
916 hr = IFilterGraph2_Disconnect(graph, pin);
917 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
918 ok(source.source.pin.peer == pin, "Got peer %p.\n", peer);
919 IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
920
921 peer = (IPin *)0xdeadbeef;
922 hr = IPin_ConnectedTo(pin, &peer);
923 ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
924 ok(!peer, "Got peer %p.\n", peer);
925
926 hr = IPin_ConnectionMediaType(pin, &mt);
927 ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
928
929 IMemInputPin_Release(input);
930 IPin_Release(pin);
931 IMediaControl_Release(control);
932 ref = IFilterGraph2_Release(graph);
933 ok(!ref, "Got outstanding refcount %ld.\n", ref);
934 ref = IBaseFilter_Release(filter);
935 ok(!ref, "Got outstanding refcount %ld.\n", ref);
936 ref = IBaseFilter_Release(&source.filter.IBaseFilter_iface);
937 ok(!ref, "Got outstanding refcount %ld.\n", ref);
938}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
#define L(x)
Definition: resources.c:13
Definition: axcore.idl:92
static void test_flushing(IPin *pin, IMemInputPin *input, IFilterGraph2 *graph)
Definition: nullrenderer.c:741
static IBaseFilter * create_null_renderer(void)
Definition: nullrenderer.c:26
static void test_allocator(IMemInputPin *input)
Definition: nullrenderer.c:484
static void testfilter_init(struct testfilter *filter)
Definition: nullrenderer.c:477
static void test_filter_state(void)
Definition: filtergraph.c:3441
Definition: dialog.c:52
Definition: graph.c:32
const AM_MEDIA_TYPE * mt
Definition: avidec.c:799
IFilterGraph * graph
Definition: filtergraph.c:850
#define VFW_E_NOT_STOPPED
Definition: vfwmsgs.h:75
#define VFW_E_NOT_CONNECTED
Definition: vfwmsgs.h:48
#define S_FALSE
Definition: winerror.h:3451

Referenced by START_TEST().

◆ test_enum_media_types()

static void test_enum_media_types ( void  )
static

Definition at line 389 of file nullrenderer.c.

390{
392 IEnumMediaTypes *enum1, *enum2;
393 AM_MEDIA_TYPE *mts[2];
394 ULONG ref, count;
395 HRESULT hr;
396 IPin *pin;
397
398 IBaseFilter_FindPin(filter, L"In", &pin);
399
400 hr = IPin_EnumMediaTypes(pin, &enum1);
401 ok(hr == S_OK, "Got hr %#lx.\n", hr);
402
403 hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
404 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
405
406 hr = IEnumMediaTypes_Next(enum1, 1, mts, &count);
407 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
408 ok(!count, "Got count %lu.\n", count);
409
410 hr = IEnumMediaTypes_Reset(enum1);
411 ok(hr == S_OK, "Got hr %#lx.\n", hr);
412
413 hr = IEnumMediaTypes_Next(enum1, 1, mts, NULL);
414 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
415
416 hr = IEnumMediaTypes_Clone(enum1, &enum2);
417 ok(hr == S_OK, "Got hr %#lx.\n", hr);
418
419 hr = IEnumMediaTypes_Skip(enum1, 1);
420 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
421
422 hr = IEnumMediaTypes_Next(enum2, 1, mts, NULL);
423 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
424
425 IEnumMediaTypes_Release(enum1);
426 IEnumMediaTypes_Release(enum2);
427 IPin_Release(pin);
428
429 ref = IBaseFilter_Release(filter);
430 ok(!ref, "Got outstanding refcount %ld.\n", ref);
431}
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by START_TEST().

◆ test_enum_pins()

static void test_enum_pins ( void  )
static

Definition at line 106 of file nullrenderer.c.

107{
109 IEnumPins *enum1, *enum2;
110 ULONG count, ref;
111 IPin *pins[2];
112 HRESULT hr;
113
115 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
116
117 hr = IBaseFilter_EnumPins(filter, NULL);
118 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
119
120 hr = IBaseFilter_EnumPins(filter, &enum1);
121 ok(hr == S_OK, "Got hr %#lx.\n", hr);
123 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
124 ref = get_refcount(enum1);
125 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
126
127 hr = IEnumPins_Next(enum1, 1, NULL, NULL);
128 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
129
130 hr = IEnumPins_Next(enum1, 1, pins, NULL);
131 ok(hr == S_OK, "Got hr %#lx.\n", hr);
133 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
134 ref = get_refcount(pins[0]);
135 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
136 ref = get_refcount(enum1);
137 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
138 IPin_Release(pins[0]);
140 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
141
142 hr = IEnumPins_Next(enum1, 1, pins, NULL);
143 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
144
145 hr = IEnumPins_Reset(enum1);
146 ok(hr == S_OK, "Got hr %#lx.\n", hr);
147
148 hr = IEnumPins_Next(enum1, 1, pins, &count);
149 ok(hr == S_OK, "Got hr %#lx.\n", hr);
150 ok(count == 1, "Got count %lu.\n", count);
151 IPin_Release(pins[0]);
152
153 hr = IEnumPins_Next(enum1, 1, pins, &count);
154 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
155 ok(!count, "Got count %lu.\n", count);
156
157 hr = IEnumPins_Reset(enum1);
158 ok(hr == S_OK, "Got hr %#lx.\n", hr);
159
160 hr = IEnumPins_Next(enum1, 2, pins, NULL);
161 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
162
163 hr = IEnumPins_Next(enum1, 2, pins, &count);
164 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
165 ok(count == 1, "Got count %lu.\n", count);
166 IPin_Release(pins[0]);
167
168 hr = IEnumPins_Reset(enum1);
169 ok(hr == S_OK, "Got hr %#lx.\n", hr);
170
171 hr = IEnumPins_Clone(enum1, &enum2);
172 ok(hr == S_OK, "Got hr %#lx.\n", hr);
173
174 hr = IEnumPins_Skip(enum1, 2);
175 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
176
177 hr = IEnumPins_Skip(enum1, 1);
178 ok(hr == S_OK, "Got hr %#lx.\n", hr);
179
180 hr = IEnumPins_Skip(enum1, 1);
181 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
182
183 hr = IEnumPins_Next(enum1, 1, pins, NULL);
184 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
185
186 hr = IEnumPins_Next(enum2, 1, pins, NULL);
187 ok(hr == S_OK, "Got hr %#lx.\n", hr);
188 IPin_Release(pins[0]);
189
190 IEnumPins_Release(enum2);
191 IEnumPins_Release(enum1);
192 ref = IBaseFilter_Release(filter);
193 ok(!ref, "Got outstanding refcount %ld.\n", ref);
194}
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by START_TEST().

◆ test_filter_state()

static void test_filter_state ( IMemInputPin *  input,
IFilterGraph2 *  graph 
)
static

Definition at line 597 of file nullrenderer.c.

598{
600 IMediaControl *control;
604 HRESULT hr;
605
606 IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
607
610 todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
611
612 /* The renderer is not fully paused until it receives a sample. The thread
613 * sending the sample blocks in IMemInputPin_Receive() until the filter is
614 * stopped or run. */
615
616 hr = IMediaControl_Pause(control);
617 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
618
619 hr = IMediaControl_GetState(control, 0, &state);
620 ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
621
623
624 hr = IMediaControl_GetState(control, 1000, &state);
625 ok(hr == S_OK, "Got hr %#lx.\n", hr);
626
627 ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
628
629 hr = IMediaControl_Stop(control);
630 ok(hr == S_OK, "Got hr %#lx.\n", hr);
631
633 ok(hr == S_OK, "Got hr %#lx.\n", hr);
634
635 /* The sink will decommit our allocator for us when stopping, and recommit
636 * it when pausing. */
637 hr = IMemInputPin_GetAllocator(input, &allocator);
638 ok(hr == S_OK, "Got hr %#lx.\n", hr);
639 hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0);
640 todo_wine ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#lx.\n", hr);
641 if (hr == S_OK) IMediaSample_Release(sample);
642
643 hr = IMemAllocator_Commit(allocator);
644 ok(hr == S_OK, "Got hr %#lx.\n", hr);
647 todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
648
649 hr = IMediaControl_Pause(control);
650 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
651
652 hr = IMediaControl_GetState(control, 0, &state);
653 ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
654
656
657 hr = IMediaControl_GetState(control, 1000, &state);
658 ok(hr == S_OK, "Got hr %#lx.\n", hr);
659
660 ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
661
662 hr = IMediaControl_Run(control);
663 ok(hr == S_OK, "Got hr %#lx.\n", hr);
664
665 hr = IMediaControl_GetState(control, 0, &state);
666 ok(hr == S_OK, "Got hr %#lx.\n", hr);
667
669 ok(hr == S_OK, "Got hr %#lx.\n", hr);
670
673 ok(hr == S_OK, "Got hr %#lx.\n", hr);
674
675 hr = IMediaControl_Pause(control);
676 todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
677
678 hr = IMediaControl_GetState(control, 0, &state);
679 todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
680
682
683 hr = IMediaControl_GetState(control, 1000, &state);
684 ok(hr == S_OK, "Got hr %#lx.\n", hr);
685
686 ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
687
688 hr = IMediaControl_Run(control);
689 ok(hr == S_OK, "Got hr %#lx.\n", hr);
690
691 hr = IMediaControl_GetState(control, 0, &state);
692 ok(hr == S_OK, "Got hr %#lx.\n", hr);
693
695 ok(hr == S_OK, "Got hr %#lx.\n", hr);
696
697 hr = IMediaControl_Pause(control);
698 todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
699
700 hr = IMediaControl_GetState(control, 0, &state);
701 todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
702 ok(state == State_Paused, "Got state %lu.\n", state);
703
704 hr = IMediaControl_Stop(control);
705 ok(hr == S_OK, "Got hr %#lx.\n", hr);
706
707 hr = IMediaControl_GetState(control, 0, &state);
708 ok(hr == S_OK, "Got hr %#lx.\n", hr);
709
710 hr = IMediaControl_Pause(control);
711 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
712
713 hr = IMediaControl_GetState(control, 0, &state);
714 ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
715 ok(state == State_Paused, "Got state %lu.\n", state);
716
717 hr = IMediaControl_Run(control);
718 todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
719
720 hr = IMediaControl_GetState(control, 0, &state);
721 todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
722 ok(state == State_Running, "Got state %lu.\n", state);
723
726 ok(hr == S_OK, "Got hr %#lx.\n", hr);
727
728 hr = IMediaControl_GetState(control, 0, &state);
729 ok(hr == S_OK, "Got hr %#lx.\n", hr);
730
731 hr = IMediaControl_Stop(control);
732 ok(hr == S_OK, "Got hr %#lx.\n", hr);
733
734 hr = IMediaControl_GetState(control, 0, &state);
735 ok(hr == S_OK, "Got hr %#lx.\n", hr);
736
737 IMemAllocator_Release(allocator);
738 IMediaControl_Release(control);
739}
static int state
Definition: maze.c:121
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define E_FAIL
Definition: ddrawi.h:102
#define join_thread(a)
Definition: nullrenderer.c:595
static HANDLE send_frame(IMemInputPin *sink)
Definition: nullrenderer.c:582
LONG OAFilterState
Definition: control.idl:30
#define VFW_E_NOT_COMMITTED
Definition: vfwmsgs.h:56
#define VFW_S_STATE_INTERMEDIATE
Definition: vfwmsgs.h:21

◆ test_find_pin()

static void test_find_pin ( void  )
static

Definition at line 196 of file nullrenderer.c.

197{
200 IPin *pin, *pin2;
201 HRESULT hr;
202 ULONG ref;
203
204 hr = IBaseFilter_FindPin(filter, L"input pin", &pin);
205 ok(hr == VFW_E_NOT_FOUND, "Got hr %#lx.\n", hr);
206
207 hr = IBaseFilter_EnumPins(filter, &enum_pins);
208 ok(hr == S_OK, "Got hr %#lx.\n", hr);
209
210 hr = IBaseFilter_FindPin(filter, L"In", &pin);
211 ok(hr == S_OK, "Got hr %#lx.\n", hr);
212 hr = IEnumPins_Next(enum_pins, 1, &pin2, NULL);
213 ok(hr == S_OK, "Got hr %#lx.\n", hr);
214 ok(pin2 == pin, "Expected pin %p, got %p.\n", pin, pin2);
215 IPin_Release(pin2);
216 IPin_Release(pin);
217
218 IEnumPins_Release(enum_pins);
219 ref = IBaseFilter_Release(filter);
220 ok(!ref, "Got outstanding refcount %ld.\n", ref);
221}
#define VFW_E_NOT_FOUND
Definition: vfwmsgs.h:61

Referenced by START_TEST().

◆ test_flushing()

static void test_flushing ( IPin *  pin,
IMemInputPin *  input,
IFilterGraph2 *  graph 
)
static

Definition at line 741 of file nullrenderer.c.

742{
743 IMediaControl *control;
746 HRESULT hr;
747
748 IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
749
750 hr = IMediaControl_Pause(control);
751 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
752
754 ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
755
756 hr = IMediaControl_GetState(control, 0, &state);
757 ok(hr == S_OK, "Got hr %#lx.\n", hr);
758
759 hr = IPin_BeginFlush(pin);
760 ok(hr == S_OK, "Got hr %#lx.\n", hr);
761
763 ok(hr == S_OK, "Got hr %#lx.\n", hr);
764
767 todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
768
769 hr = IPin_EndFlush(pin);
770 ok(hr == S_OK, "Got hr %#lx.\n", hr);
771
772 /* We dropped the sample we were holding, so now we need a new one... */
773
774 hr = IMediaControl_GetState(control, 0, &state);
775 todo_wine ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#lx.\n", hr);
776
778 ok(WaitForSingleObject(thread, 100) == WAIT_TIMEOUT, "Thread should block in Receive().\n");
779
780 hr = IMediaControl_Run(control);
781 ok(hr == S_OK, "Got hr %#lx.\n", hr);
783 ok(hr == S_OK, "Got hr %#lx.\n", hr);
784
785 hr = IPin_BeginFlush(pin);
786 ok(hr == S_OK, "Got hr %#lx.\n", hr);
787
789 todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
790
791 hr = IPin_EndFlush(pin);
792 ok(hr == S_OK, "Got hr %#lx.\n", hr);
793
795 ok(hr == S_OK, "Got hr %#lx.\n", hr);
796
797 hr = IMediaControl_Stop(control);
798 ok(hr == S_OK, "Got hr %#lx.\n", hr);
799
800 IMediaControl_Release(control);
801}

Referenced by test_connect_pin().

◆ test_interfaces()

static void test_interfaces ( void  )
static

Definition at line 66 of file nullrenderer.c.

67{
69 ULONG ref;
70 IPin *pin;
71
73 check_interface(filter, &IID_IMediaFilter, TRUE);
74 check_interface(filter, &IID_IMediaPosition, TRUE);
75 check_interface(filter, &IID_IMediaSeeking, TRUE);
78
79 check_interface(filter, &IID_IAMFilterMiscFlags, FALSE);
80 check_interface(filter, &IID_IBasicAudio, FALSE);
81 check_interface(filter, &IID_IBasicVideo, FALSE);
85 todo_wine check_interface(filter, &IID_IQualityControl, FALSE);
86 check_interface(filter, &IID_IQualProp, FALSE);
87 check_interface(filter, &IID_IReferenceClock, FALSE);
88 check_interface(filter, &IID_IVideoWindow, FALSE);
89
90 IBaseFilter_FindPin(filter, L"In", &pin);
91
92 check_interface(pin, &IID_IMemInputPin, TRUE);
94 todo_wine check_interface(pin, &IID_IQualityControl, TRUE);
96
98 check_interface(pin, &IID_IMediaPosition, FALSE);
99 check_interface(pin, &IID_IMediaSeeking, FALSE);
100
101 IPin_Release(pin);
102 ref = IBaseFilter_Release(filter);
103 ok(!ref, "Got unexpected refcount %ld.\n", ref);
104}
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
#define FALSE
Definition: types.h:117
#define check_interface(a, b, c)
Definition: nullrenderer.c:51
const GUID IID_IPin
Definition: pincontrol.cpp:15
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11

Referenced by START_TEST().

◆ test_media_types()

static void test_media_types ( void  )
static

Definition at line 362 of file nullrenderer.c.

363{
365 AM_MEDIA_TYPE mt = {0}, *pmt;
366 IEnumMediaTypes *enummt;
367 HRESULT hr;
368 ULONG ref;
369 IPin *pin;
370
371 IBaseFilter_FindPin(filter, L"In", &pin);
372
373 hr = IPin_EnumMediaTypes(pin, &enummt);
374 ok(hr == S_OK, "Got hr %#lx.\n", hr);
375
376 hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL);
377 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
378
379 IEnumMediaTypes_Release(enummt);
380
381 hr = IPin_QueryAccept(pin, &mt);
382 ok(hr == S_OK, "Got hr %#lx.\n", hr);
383
384 IPin_Release(pin);
385 ref = IBaseFilter_Release(filter);
386 ok(!ref, "Got outstanding refcount %ld.\n", ref);
387}

Referenced by START_TEST().

◆ test_pin_info()

static void test_pin_info ( void  )
static

Definition at line 223 of file nullrenderer.c.

224{
228 HRESULT hr;
229 WCHAR *id;
230 ULONG ref;
231 IPin *pin;
232
233 hr = IBaseFilter_FindPin(filter, L"In", &pin);
234 ok(hr == S_OK, "Got hr %#lx.\n", hr);
236 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
237 ref = get_refcount(pin);
238 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
239
240 hr = IPin_QueryPinInfo(pin, &info);
241 ok(hr == S_OK, "Got hr %#lx.\n", hr);
242 ok(info.pFilter == filter, "Expected filter %p, got %p.\n", filter, info.pFilter);
243 ok(info.dir == PINDIR_INPUT, "Got direction %d.\n", info.dir);
244 ok(!wcscmp(info.achName, L"In"), "Got name %s.\n", wine_dbgstr_w(info.achName));
246 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
247 ref = get_refcount(pin);
248 ok(ref == 3, "Got unexpected refcount %ld.\n", ref);
249 IBaseFilter_Release(info.pFilter);
250
251 hr = IPin_QueryDirection(pin, &dir);
252 ok(hr == S_OK, "Got hr %#lx.\n", hr);
253 ok(dir == PINDIR_INPUT, "Got direction %d.\n", dir);
254
255 hr = IPin_QueryId(pin, &id);
256 ok(hr == S_OK, "Got hr %#lx.\n", hr);
257 ok(!wcscmp(id, L"In"), "Got id %s.\n", wine_dbgstr_w(id));
258 CoTaskMemFree(id);
259
260 hr = IPin_QueryInternalConnections(pin, NULL, NULL);
261 ok(hr == E_NOTIMPL, "Got hr %#lx.\n", hr);
262
263 IPin_Release(pin);
264 ref = IBaseFilter_Release(filter);
265 ok(!ref, "Got outstanding refcount %ld.\n", ref);
266}
unsigned int dir
Definition: maze.c:112
enum _PinDirection PIN_DIRECTION
@ PINDIR_INPUT
Definition: axcore.idl:41
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
GLuint id
Definition: glext.h:5910
#define wine_dbgstr_w
Definition: kernel32.h:34
short WCHAR
Definition: pedump.c:58

Referenced by START_TEST().

◆ test_unconnected_eos()

static void test_unconnected_eos ( void  )
static

Definition at line 940 of file nullrenderer.c.

941{
944 IMediaControl *control;
945 IMediaEvent *eventsrc;
946 unsigned int ret;
947 HRESULT hr;
948 ULONG ref;
949
950 hr = IFilterGraph2_AddFilter(graph, filter, L"renderer");
951 ok(hr == S_OK, "Got hr %#lx.\n", hr);
952
953 hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control);
954 ok(hr == S_OK, "Got hr %#lx.\n", hr);
955
956 hr = IFilterGraph2_QueryInterface(graph, &IID_IMediaEvent, (void **)&eventsrc);
957 ok(hr == S_OK, "Got hr %#lx.\n", hr);
958
959 ret = check_ec_complete(eventsrc, 0);
960 ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
961
962 hr = IMediaControl_Pause(control);
963 ok(hr == S_OK, "Got hr %#lx.\n", hr);
964
965 ret = check_ec_complete(eventsrc, 0);
966 ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
967
968 hr = IMediaControl_Run(control);
969 ok(hr == S_OK, "Got hr %#lx.\n", hr);
970
971 ret = check_ec_complete(eventsrc, 0);
972 ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
973
974 hr = IMediaControl_Pause(control);
975 ok(hr == S_OK, "Got hr %#lx.\n", hr);
976
977 ret = check_ec_complete(eventsrc, 0);
978 ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
979
980 hr = IMediaControl_Run(control);
981 ok(hr == S_OK, "Got hr %#lx.\n", hr);
982
983 ret = check_ec_complete(eventsrc, 0);
984 ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
985
986 hr = IMediaControl_Stop(control);
987 ok(hr == S_OK, "Got hr %#lx.\n", hr);
988
989 ret = check_ec_complete(eventsrc, 0);
990 ok(!ret, "Got %u EC_COMPLETE events.\n", ret);
991
992 hr = IMediaControl_Run(control);
993 ok(hr == S_OK, "Got hr %#lx.\n", hr);
994
995 ret = check_ec_complete(eventsrc, 0);
996 ok(ret == 1, "Got %u EC_COMPLETE events.\n", ret);
997
998 IMediaControl_Release(control);
999 IMediaEvent_Release(eventsrc);
1000 ref = IFilterGraph2_Release(graph);
1001 ok(!ref, "Got outstanding refcount %ld.\n", ref);
1002 ref = IBaseFilter_Release(filter);
1003 ok(!ref, "Got outstanding refcount %ld.\n", ref);
1004}
static IFilterGraph2 * create_graph(void)
Definition: nullrenderer.c:35
static unsigned int check_ec_complete(IMediaEvent *eventsrc, DWORD timeout)
Definition: nullrenderer.c:826

Referenced by START_TEST().

◆ testfilter_destroy()

static void testfilter_destroy ( struct strmbase_filter *  iface)
static

Definition at line 452 of file nullrenderer.c.

453{
457}
static struct testfilter * impl_from_strmbase_filter(struct strmbase_filter *iface)
Definition: nullrenderer.c:439
void strmbase_filter_cleanup(struct strmbase_filter *filter)
Definition: filter.c:540
void strmbase_source_cleanup(struct strmbase_source *pin)
Definition: pin.c:778
IBaseFilter * filter
Definition: filtergraph.c:75

◆ testfilter_get_pin()

static struct strmbase_pin * testfilter_get_pin ( struct strmbase_filter *  iface,
unsigned int  index 
)
static

Definition at line 444 of file nullrenderer.c.

445{
447 if (!index)
448 return &filter->source.pin;
449 return NULL;
450}
GLuint index
Definition: glext.h:6031

◆ testfilter_init()

static void testfilter_init ( struct testfilter *  filter)
static

Definition at line 477 of file nullrenderer.c.

478{
479 static const GUID clsid = {0xabacab};
482}
static const struct strmbase_source_ops testsource_ops
Definition: nullrenderer.c:471
static const struct strmbase_filter_ops testfilter_ops
Definition: nullrenderer.c:459
const CLSID * clsid
Definition: msctf.cpp:50
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
Definition: pin.c:765
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
Definition: filter.c:517

Referenced by test_connect_pin().

◆ testsource_DecideAllocator()

static HRESULT WINAPI testsource_DecideAllocator ( struct strmbase_source *  iface,
IMemInputPin *  peer,
IMemAllocator **  allocator 
)
static

Definition at line 465 of file nullrenderer.c.

467{
468 return S_OK;
469}

Variable Documentation

◆ outer_ref

LONG outer_ref = 1
static

Definition at line 269 of file nullrenderer.c.

Referenced by outer_AddRef(), outer_Release(), and test_aggregation().

◆ outer_vtbl

const IUnknownVtbl outer_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI outer_AddRef(IUnknown *iface)
Definition: nullrenderer.c:284
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
Definition: nullrenderer.c:271
static ULONG WINAPI outer_Release(IUnknown *iface)
Definition: nullrenderer.c:289

Definition at line 294 of file nullrenderer.c.

◆ test_iid

const GUID test_iid = {0x33333333}
static

Definition at line 268 of file nullrenderer.c.

Referenced by outer_QueryInterface(), and test_aggregation().

◆ test_outer

IUnknown test_outer = {&outer_vtbl}
static

Definition at line 301 of file nullrenderer.c.

Referenced by test_aggregation().

◆ testfilter_ops

const struct strmbase_filter_ops testfilter_ops
static
Initial value:
=
{
.filter_get_pin = testfilter_get_pin,
.filter_destroy = testfilter_destroy,
}
static void testfilter_destroy(struct strmbase_filter *iface)
Definition: nullrenderer.c:452
static struct strmbase_pin * testfilter_get_pin(struct strmbase_filter *iface, unsigned int index)
Definition: nullrenderer.c:444

Definition at line 459 of file nullrenderer.c.

Referenced by testfilter_init().

◆ testsource_ops

const struct strmbase_source_ops testsource_ops
static
Initial value:
=
{
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
.pfnDecideAllocator = testsource_DecideAllocator,
}
static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
Definition: nullrenderer.c:465
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
Definition: pin.c:710

Definition at line 471 of file nullrenderer.c.

Referenced by testfilter_init().