ReactOS 0.4.16-dev-297-gc569aee
videorenderer.c File Reference
#include "wine/test.h"
#include "dshow.h"
Include dependency graph for videorenderer.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define QI_SUCCEED(iface, riid, ppv)
 
#define RELEASE_EXPECT(iface, num)
 

Functions

static int create_video_renderer (void)
 
static void release_video_renderer (void)
 
static void test_query_interface (void)
 
static void test_pin (IPin *pin)
 
static void test_basefilter (void)
 
 START_TEST (videorenderer)
 

Variables

static IUnknownpVideoRenderer = NULL
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file videorenderer.c.

◆ QI_SUCCEED

#define QI_SUCCEED (   iface,
  riid,
  ppv 
)
Value:
hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \
ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \
ok(ppv != NULL, "Pointer is NULL\n");
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
HRESULT hr
Definition: shlfolder.c:183

Definition at line 26 of file videorenderer.c.

◆ RELEASE_EXPECT

#define RELEASE_EXPECT (   iface,
  num 
)
Value:
if (iface) { \
hr = IUnknown_Release((IUnknown*)iface); \
ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \
}
GLuint GLuint num
Definition: glext.h:9618

Definition at line 30 of file videorenderer.c.

Function Documentation

◆ create_video_renderer()

static int create_video_renderer ( void  )
static

Definition at line 37 of file videorenderer.c.

38{
39 HRESULT hr;
40
41 hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER,
43 return (hr == S_OK && pVideoRenderer != NULL);
44}
const GUID IID_IUnknown
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static IUnknown * pVideoRenderer
Definition: videorenderer.c:35

Referenced by START_TEST().

◆ release_video_renderer()

static void release_video_renderer ( void  )
static

Definition at line 46 of file videorenderer.c.

47{
48 HRESULT hr;
49
50 hr = IUnknown_Release(pVideoRenderer);
51 ok(hr == 0, "IUnknown_Release failed with %x\n", hr);
52}
#define ok(value,...)
Definition: atltest.h:57

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( videorenderer  )

Definition at line 153 of file videorenderer.c.

154{
157 return;
158
161
163
165}
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void test_query_interface(void)
Definition: videorenderer.c:54
static void release_video_renderer(void)
Definition: videorenderer.c:46
static void test_basefilter(void)
static int create_video_renderer(void)
Definition: videorenderer.c:37

◆ test_basefilter()

static void test_basefilter ( void  )
static

Definition at line 105 of file videorenderer.c.

106{
107 IEnumPins *pin_enum = NULL;
109 IPin *pins[2];
110 ULONG ref;
111 HRESULT hr;
112
113 IUnknown_QueryInterface(pVideoRenderer, &IID_IBaseFilter, (void **)&base);
114 if (base == NULL)
115 {
116 /* test_query_interface handles this case */
117 skip("No IBaseFilter\n");
118 return;
119 }
120
121 hr = IBaseFilter_EnumPins(base, NULL);
122 ok(hr == E_POINTER, "hr = %08x and not E_POINTER\n", hr);
123
124 hr= IBaseFilter_EnumPins(base, &pin_enum);
125 ok(hr == S_OK, "hr = %08x and not S_OK\n", hr);
126
127 hr = IEnumPins_Next(pin_enum, 1, NULL, NULL);
128 ok(hr == E_POINTER, "hr = %08x and not E_POINTER\n", hr);
129
130 hr = IEnumPins_Next(pin_enum, 2, pins, NULL);
131 ok(hr == E_INVALIDARG, "hr = %08x and not E_INVALIDARG\n", hr);
132
133 pins[0] = (void *)0xdead;
134 pins[1] = (void *)0xdeed;
135
136 hr = IEnumPins_Next(pin_enum, 2, pins, &ref);
137 ok(hr == S_FALSE, "hr = %08x instead of S_FALSE\n", hr);
138 ok(pins[0] != (void *)0xdead && pins[0] != NULL, "pins[0] = %p\n", pins[0]);
139 if (pins[0] != (void *)0xdead && pins[0] != NULL)
140 {
141 test_pin(pins[0]);
142 IPin_Release(pins[0]);
143 }
144
145 ok(pins[1] == (void *)0xdeed, "pins[1] = %p\n", pins[1]);
146
147 ref = IEnumPins_Release(pin_enum);
148 ok(ref == 0, "ref is %u and not 0!\n", ref);
149
150 IBaseFilter_Release(base);
151}
#define skip(...)
Definition: atltest.h:64
#define E_INVALIDARG
Definition: ddrawi.h:101
const GUID IID_IBaseFilter
Definition: axcore.idl:92
static void test_pin(IPin *pin)
Definition: videorenderer.c:89
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:2357
#define E_POINTER
Definition: winerror.h:2365

Referenced by START_TEST().

◆ test_pin()

static void test_pin ( IPin pin)
static

Definition at line 89 of file videorenderer.c.

90{
91 IMemInputPin *mpin = NULL;
92
93 IPin_QueryInterface(pin, &IID_IMemInputPin, (void **)&mpin);
94
95 ok(mpin != NULL, "No IMemInputPin found!\n");
96 if (mpin)
97 {
98 ok(IMemInputPin_ReceiveCanBlock(mpin) == S_OK, "Receive can't block for pin!\n");
99 ok(IMemInputPin_NotifyAllocator(mpin, NULL, 0) == E_POINTER, "NotifyAllocator likes a NULL pointer argument\n");
100 IMemInputPin_Release(mpin);
101 }
102 /* TODO */
103}
Definition: regsvr.c:104

Referenced by test_basefilter().

◆ test_query_interface()

static void test_query_interface ( void  )
static

Definition at line 54 of file videorenderer.c.

55{
56 HRESULT hr;
57 IBaseFilter *pBaseFilter = NULL;
58 IBasicVideo *pBasicVideo = NULL;
59 IDirectDrawVideo *pDirectDrawVideo = NULL;
60 IKsPropertySet *pKsPropertySet = NULL;
61 IMediaPosition *pMediaPosition = NULL;
62 IMediaSeeking *pMediaSeeking = NULL;
63 IQualityControl *pQualityControl = NULL;
64 IQualProp *pQualProp = NULL;
65 IVideoWindow *pVideoWindow = NULL;
66
68 RELEASE_EXPECT(pBaseFilter, 1);
69 QI_SUCCEED(pVideoRenderer, IID_IBasicVideo, pBasicVideo);
70 RELEASE_EXPECT(pBasicVideo, 1);
71 QI_SUCCEED(pVideoRenderer, IID_IMediaSeeking, pMediaSeeking);
72 RELEASE_EXPECT(pMediaSeeking, 1);
73 QI_SUCCEED(pVideoRenderer, IID_IQualityControl, pQualityControl);
74 RELEASE_EXPECT(pQualityControl, 1);
75 todo_wine {
76 QI_SUCCEED(pVideoRenderer, IID_IDirectDrawVideo, pDirectDrawVideo);
77 RELEASE_EXPECT(pDirectDrawVideo, 1);
79 RELEASE_EXPECT(pKsPropertySet, 1);
80 QI_SUCCEED(pVideoRenderer, IID_IQualProp, pQualProp);
81 RELEASE_EXPECT(pQualProp, 1);
82 }
83 QI_SUCCEED(pVideoRenderer, IID_IMediaPosition, pMediaPosition);
84 RELEASE_EXPECT(pMediaPosition, 1);
85 QI_SUCCEED(pVideoRenderer, IID_IVideoWindow, pVideoWindow);
86 RELEASE_EXPECT(pVideoWindow, 1);
87}
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
#define todo_wine
Definition: custom.c:89
#define RELEASE_EXPECT(iface, num)
Definition: videorenderer.c:30
#define QI_SUCCEED(iface, riid, ppv)
Definition: videorenderer.c:26

Referenced by START_TEST().

Variable Documentation

◆ pVideoRenderer