ReactOS 0.4.17-dev-966-gf06eace
mediadet.c File Reference
#include "ole2.h"
#include "vfwmsgs.h"
#include "uuids.h"
#include "wine/strmbase.h"
#include "wine/test.h"
#include "qedit.h"
#include "control.h"
#include "rc.h"
Include dependency graph for mediadet.c:

Go to the source code of this file.

Classes

struct  testfilter
 
struct  test_sample
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 

Functions

static ULONG get_refcount (void *iface)
 
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 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 struct testfilter * impl_from_strmbase_pin (struct strmbase_pin *iface)
 
static HRESULT testsource_get_media_type (struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
 
static HRESULT testsource_query_interface (struct strmbase_pin *iface, REFIID iid, void **out)
 
static HRESULT WINAPI testsource_DecideAllocator (struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
 
static struct testfilter * impl_from_IMediaSeeking (IMediaSeeking *iface)
 
static HRESULT WINAPI testseek_QueryInterface (IMediaSeeking *iface, REFIID iid, void **out)
 
static ULONG WINAPI testseek_AddRef (IMediaSeeking *iface)
 
static ULONG WINAPI testseek_Release (IMediaSeeking *iface)
 
static HRESULT WINAPI testseek_GetCapabilities (IMediaSeeking *iface, DWORD *caps)
 
static HRESULT WINAPI testseek_CheckCapabilities (IMediaSeeking *iface, DWORD *caps)
 
static HRESULT WINAPI testseek_IsFormatSupported (IMediaSeeking *iface, const GUID *format)
 
static HRESULT WINAPI testseek_QueryPreferredFormat (IMediaSeeking *iface, GUID *format)
 
static HRESULT WINAPI testseek_GetTimeFormat (IMediaSeeking *iface, GUID *format)
 
static HRESULT WINAPI testseek_IsUsingTimeFormat (IMediaSeeking *iface, const GUID *format)
 
static HRESULT WINAPI testseek_SetTimeFormat (IMediaSeeking *iface, const GUID *format)
 
static HRESULT WINAPI testseek_GetDuration (IMediaSeeking *iface, LONGLONG *duration)
 
static HRESULT WINAPI testseek_GetStopPosition (IMediaSeeking *iface, LONGLONG *stop)
 
static HRESULT WINAPI testseek_GetCurrentPosition (IMediaSeeking *iface, LONGLONG *current)
 
static HRESULT WINAPI testseek_ConvertTimeFormat (IMediaSeeking *iface, LONGLONG *target, const GUID *target_format, LONGLONG source, const GUID *source_format)
 
static HRESULT WINAPI testseek_SetPositions (IMediaSeeking *iface, LONGLONG *current, DWORD current_flags, LONGLONG *stop, DWORD stop_flags)
 
static HRESULT WINAPI testseek_GetPositions (IMediaSeeking *iface, LONGLONG *current, LONGLONG *stop)
 
static HRESULT WINAPI testseek_GetAvailable (IMediaSeeking *iface, LONGLONG *earliest, LONGLONG *latest)
 
static HRESULT WINAPI testseek_SetRate (IMediaSeeking *iface, double rate)
 
static HRESULT WINAPI testseek_GetRate (IMediaSeeking *iface, double *rate)
 
static HRESULT WINAPI testseek_GetPreroll (IMediaSeeking *iface, LONGLONG *preroll)
 
static void testfilter_init (struct testfilter *filter)
 
static BOOL unpack_avi_file (int id, WCHAR name[MAX_PATH])
 
static BOOL init_tests (void)
 
static void test_mediadet (void)
 
static void test_put_filter (void)
 
static struct test_sample * impl_from_IMediaSample (IMediaSample *iface)
 
static HRESULT WINAPI ms_QueryInterface (IMediaSample *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ms_AddRef (IMediaSample *iface)
 
static ULONG WINAPI ms_Release (IMediaSample *iface)
 
static HRESULT WINAPI ms_GetPointer (IMediaSample *iface, BYTE **ppBuffer)
 
static LONG WINAPI ms_GetSize (IMediaSample *iface)
 
static HRESULT WINAPI ms_GetTime (IMediaSample *iface, REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd)
 
static HRESULT WINAPI ms_SetTime (IMediaSample *iface, REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd)
 
static HRESULT WINAPI ms_IsSyncPoint (IMediaSample *iface)
 
static HRESULT WINAPI ms_SetSyncPoint (IMediaSample *iface, BOOL bIsSyncPoint)
 
static HRESULT WINAPI ms_IsPreroll (IMediaSample *iface)
 
static HRESULT WINAPI ms_SetPreroll (IMediaSample *iface, BOOL bIsPreroll)
 
static LONG WINAPI ms_GetActualDataLength (IMediaSample *iface)
 
static HRESULT WINAPI ms_SetActualDataLength (IMediaSample *iface, LONG length)
 
static HRESULT WINAPI ms_GetMediaType (IMediaSample *iface, AM_MEDIA_TYPE **ppMediaType)
 
static HRESULT WINAPI ms_SetMediaType (IMediaSample *iface, AM_MEDIA_TYPE *pMediaType)
 
static HRESULT WINAPI ms_IsDiscontinuity (IMediaSample *iface)
 
static HRESULT WINAPI ms_SetDiscontinuity (IMediaSample *iface, BOOL bDiscontinuity)
 
static HRESULT WINAPI ms_GetMediaTime (IMediaSample *iface, LONGLONG *pTimeStart, LONGLONG *pTimeEnd)
 
static HRESULT WINAPI ms_SetMediaTime (IMediaSample *iface, LONGLONG *pTimeStart, LONGLONG *pTimeEnd)
 
static HRESULT WINAPI sgcb_QueryInterface (ISampleGrabberCB *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI sgcb_AddRef (ISampleGrabberCB *iface)
 
static ULONG WINAPI sgcb_Release (ISampleGrabberCB *iface)
 
static HRESULT WINAPI sgcb_SampleCB (ISampleGrabberCB *iface, double SampleTime, IMediaSample *pSample)
 
static HRESULT WINAPI sgcb_BufferCB (ISampleGrabberCB *iface, double SampleTime, BYTE *pBuffer, LONG BufferLen)
 
static void test_samplegrabber (void)
 
static void test_COM_sg_enumpins (void)
 
 START_TEST (mediadet)
 

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
 
static const IMediaSeekingVtbl testseek_vtbl
 
static WCHAR test_avi_filename [MAX_PATH]
 
static WCHAR test_sound_avi_filename [MAX_PATH]
 
static const IMediaSampleVtbl my_sample_vt
 
static struct test_sample my_sample = { {&my_sample_vt}, 0 }
 
static BOOL samplecb_called = FALSE
 
static const ISampleGrabberCBVtbl sgcb_vt
 
static ISampleGrabberCB my_sg_cb = { &sgcb_vt }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file mediadet.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 22 of file mediadet.c.

Function Documentation

◆ get_refcount()

static ULONG get_refcount ( void *  iface)
static

Definition at line 33 of file mediadet.c.

34{
35 IUnknown *unknown = iface;
36 IUnknown_AddRef(unknown);
37 return IUnknown_Release(unknown);
38}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1674

Referenced by test_aggregation().

◆ impl_from_IMediaSample()

static struct test_sample * impl_from_IMediaSample ( IMediaSample *  iface)
static

Definition at line 899 of file mediadet.c.

900{
901 return CONTAINING_RECORD(iface, struct test_sample, sample);
902}
Definition: wave.c:25
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by ms_AddRef(), and ms_Release().

◆ impl_from_IMediaSeeking()

static struct testfilter * impl_from_IMediaSeeking ( IMediaSeeking *  iface)
inlinestatic

Definition at line 228 of file mediadet.c.

229{
230 return CONTAINING_RECORD(iface, struct testfilter, IMediaSeeking_iface);
231}

Referenced by testseek_AddRef(), testseek_QueryInterface(), and testseek_Release().

◆ impl_from_strmbase_filter()

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

Definition at line 141 of file mediadet.c.

142{
143 return CONTAINING_RECORD(iface, struct testfilter, filter);
144}
Definition: filter.c:165

Referenced by testfilter_destroy(), and testfilter_get_pin().

◆ impl_from_strmbase_pin()

static struct testfilter * impl_from_strmbase_pin ( struct strmbase_pin *  iface)
inlinestatic

Definition at line 167 of file mediadet.c.

168{
169 return CONTAINING_RECORD(iface, struct testfilter, source.pin);
170}

Referenced by testsource_query_interface().

◆ init_tests()

static BOOL init_tests ( void  )
static

Definition at line 440 of file mediadet.c.

441{
444}
static WCHAR test_sound_avi_filename[MAX_PATH]
Definition: mediadet.c:392
static WCHAR test_avi_filename[MAX_PATH]
Definition: mediadet.c:391
static BOOL unpack_avi_file(int id, WCHAR name[MAX_PATH])
Definition: mediadet.c:394
#define TEST_AVI_RES
Definition: rc.h:24
#define TEST_SOUND_AVI_RES
Definition: rc.h:25

Referenced by START_TEST().

◆ ms_AddRef()

static ULONG WINAPI ms_AddRef ( IMediaSample *  iface)
static

Definition at line 910 of file mediadet.c.

911{
913 return InterlockedIncrement(&sample->refcount);
914}
#define InterlockedIncrement
Definition: armddk.h:53
static struct test_sample * impl_from_IMediaSample(IMediaSample *iface)
Definition: mediadet.c:899

◆ ms_GetActualDataLength()

static LONG WINAPI ms_GetActualDataLength ( IMediaSample *  iface)
static

Definition at line 964 of file mediadet.c.

965{
966 return E_NOTIMPL;
967}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ms_GetMediaTime()

static HRESULT WINAPI ms_GetMediaTime ( IMediaSample *  iface,
LONGLONG *  pTimeStart,
LONGLONG *  pTimeEnd 
)
static

Definition at line 995 of file mediadet.c.

997{
998 return E_NOTIMPL;
999}

◆ ms_GetMediaType()

static HRESULT WINAPI ms_GetMediaType ( IMediaSample *  iface,
AM_MEDIA_TYPE **  ppMediaType 
)
static

Definition at line 974 of file mediadet.c.

976{
977 return E_NOTIMPL;
978}

◆ ms_GetPointer()

static HRESULT WINAPI ms_GetPointer ( IMediaSample *  iface,
BYTE **  ppBuffer 
)
static

Definition at line 922 of file mediadet.c.

923{
924 return E_NOTIMPL;
925}

◆ ms_GetSize()

static LONG WINAPI ms_GetSize ( IMediaSample *  iface)
static

Definition at line 927 of file mediadet.c.

928{
929 return E_NOTIMPL;
930}

◆ ms_GetTime()

static HRESULT WINAPI ms_GetTime ( IMediaSample *  iface,
REFERENCE_TIME *  pTimeStart,
REFERENCE_TIME *  pTimeEnd 
)
static

Definition at line 932 of file mediadet.c.

934{
935 return E_NOTIMPL;
936}

◆ ms_IsDiscontinuity()

static HRESULT WINAPI ms_IsDiscontinuity ( IMediaSample *  iface)
static

Definition at line 985 of file mediadet.c.

986{
987 return E_NOTIMPL;
988}

◆ ms_IsPreroll()

static HRESULT WINAPI ms_IsPreroll ( IMediaSample *  iface)
static

Definition at line 954 of file mediadet.c.

955{
956 return E_NOTIMPL;
957}

◆ ms_IsSyncPoint()

static HRESULT WINAPI ms_IsSyncPoint ( IMediaSample *  iface)
static

Definition at line 944 of file mediadet.c.

945{
946 return E_NOTIMPL;
947}

◆ ms_QueryInterface()

static HRESULT WINAPI ms_QueryInterface ( IMediaSample *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 904 of file mediadet.c.

906{
907 return E_NOTIMPL;
908}

◆ ms_Release()

static ULONG WINAPI ms_Release ( IMediaSample *  iface)
static

Definition at line 916 of file mediadet.c.

917{
919 return InterlockedDecrement(&sample->refcount);
920}
#define InterlockedDecrement
Definition: armddk.h:52

◆ ms_SetActualDataLength()

static HRESULT WINAPI ms_SetActualDataLength ( IMediaSample *  iface,
LONG  length 
)
static

Definition at line 969 of file mediadet.c.

970{
971 return E_NOTIMPL;
972}

◆ ms_SetDiscontinuity()

static HRESULT WINAPI ms_SetDiscontinuity ( IMediaSample *  iface,
BOOL  bDiscontinuity 
)
static

Definition at line 990 of file mediadet.c.

991{
992 return E_NOTIMPL;
993}

◆ ms_SetMediaTime()

static HRESULT WINAPI ms_SetMediaTime ( IMediaSample *  iface,
LONGLONG *  pTimeStart,
LONGLONG *  pTimeEnd 
)
static

Definition at line 1001 of file mediadet.c.

1003{
1004 return E_NOTIMPL;
1005}

◆ ms_SetMediaType()

static HRESULT WINAPI ms_SetMediaType ( IMediaSample *  iface,
AM_MEDIA_TYPE *  pMediaType 
)
static

Definition at line 980 of file mediadet.c.

981{
982 return E_NOTIMPL;
983}

◆ ms_SetPreroll()

static HRESULT WINAPI ms_SetPreroll ( IMediaSample *  iface,
BOOL  bIsPreroll 
)
static

Definition at line 959 of file mediadet.c.

960{
961 return E_NOTIMPL;
962}

◆ ms_SetSyncPoint()

static HRESULT WINAPI ms_SetSyncPoint ( IMediaSample *  iface,
BOOL  bIsSyncPoint 
)
static

Definition at line 949 of file mediadet.c.

950{
951 return E_NOTIMPL;
952}

◆ ms_SetTime()

static HRESULT WINAPI ms_SetTime ( IMediaSample *  iface,
REFERENCE_TIME *  pTimeStart,
REFERENCE_TIME *  pTimeEnd 
)
static

Definition at line 938 of file mediadet.c.

940{
941 return E_NOTIMPL;
942}

◆ outer_AddRef()

static ULONG WINAPI outer_AddRef ( IUnknown *  iface)
static

Definition at line 56 of file mediadet.c.

57{
59}
static LONG outer_ref
Definition: mediadet.c:41

◆ outer_QueryInterface()

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

Definition at line 43 of file mediadet.c.

44{
45 if (IsEqualGUID(iid, &IID_IUnknown)
46 || IsEqualGUID(iid, &IID_IMediaDet)
47 || IsEqualGUID(iid, &test_iid))
48 {
49 *out = (IUnknown *)0xdeadbeef;
50 return S_OK;
51 }
52 ok(0, "unexpected call %s\n", wine_dbgstr_guid(iid));
53 return E_NOINTERFACE;
54}
#define ok(value,...)
Definition: atltest.h:57
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
static const GUID test_iid
Definition: mediadet.c:40
#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
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ outer_Release()

static ULONG WINAPI outer_Release ( IUnknown *  iface)
static

Definition at line 61 of file mediadet.c.

62{
64}

◆ sgcb_AddRef()

static ULONG WINAPI sgcb_AddRef ( ISampleGrabberCB *  iface)
static

Definition at line 1039 of file mediadet.c.

1040{
1041 return E_NOTIMPL;
1042}

◆ sgcb_BufferCB()

static HRESULT WINAPI sgcb_BufferCB ( ISampleGrabberCB *  iface,
double  SampleTime,
BYTE *  pBuffer,
LONG  BufferLen 
)
static

Definition at line 1058 of file mediadet.c.

1060{
1061 ok(0, "BufferCB should not have been called\n");
1062 return E_NOTIMPL;
1063}

◆ sgcb_QueryInterface()

static HRESULT WINAPI sgcb_QueryInterface ( ISampleGrabberCB *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1033 of file mediadet.c.

1035{
1036 return E_NOTIMPL;
1037}

◆ sgcb_Release()

static ULONG WINAPI sgcb_Release ( ISampleGrabberCB *  iface)
static

Definition at line 1044 of file mediadet.c.

1045{
1046 return E_NOTIMPL;
1047}

◆ sgcb_SampleCB()

static HRESULT WINAPI sgcb_SampleCB ( ISampleGrabberCB *  iface,
double  SampleTime,
IMediaSample *  pSample 
)
static

Definition at line 1049 of file mediadet.c.

1051{
1052 ok(pSample == &my_sample.sample, "Got wrong IMediaSample: %p, expected %p\n", pSample, &my_sample);
1054 IMediaSample_AddRef(pSample);
1055 return E_NOTIMPL;
1056}
#define TRUE
Definition: types.h:120
static struct test_sample my_sample
Definition: mediadet.c:1029
static BOOL samplecb_called
Definition: mediadet.c:1031

◆ START_TEST()

START_TEST ( mediadet  )

Definition at line 1161 of file mediadet.c.

1162{
1163 IMediaDet *detector;
1164 HRESULT hr;
1165 BOOL ret;
1166
1167 if (!init_tests())
1168 {
1169 skip("Couldn't initialize tests!\n");
1170 return;
1171 }
1172
1174
1175 if (FAILED(hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
1176 &IID_IMediaDet, (void **)&detector)))
1177 {
1178 /* qedit.dll does not exist on 2003. */
1179 win_skip("Failed to create media detector object, hr %#lx.\n", hr);
1180 return;
1181 }
1182 IMediaDet_Release(detector);
1183
1185 test_mediadet();
1189
1191 ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
1193 ok(ret, "Failed to delete file, error %lu.\n", GetLastError());
1194
1196}
#define skip(...)
Definition: atltest.h:64
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: combase.c:2842
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:531
return ret
Definition: mutex.c:147
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FAILED(hr)
Definition: intsafe.h:51
#define win_skip
Definition: minitest.h:67
static void test_aggregation(void)
Definition: mediadet.c:75
static void test_samplegrabber(void)
Definition: mediadet.c:1075
static void test_mediadet(void)
Definition: mediadet.c:446
static void test_COM_sg_enumpins(void)
Definition: mediadet.c:1129
static BOOL init_tests(void)
Definition: mediadet.c:440
static void test_put_filter(void)
Definition: mediadet.c:755
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ test_aggregation()

static void test_aggregation ( void  )
static

Definition at line 75 of file mediadet.c.

76{
77 IMediaDet *detector, *detector2;
78 IUnknown *unk, *unk2;
79 HRESULT hr;
80 ULONG ref;
81
82 detector = (IMediaDet *)0xdeadbeef;
83 hr = CoCreateInstance(&CLSID_MediaDet, &test_outer, CLSCTX_INPROC_SERVER,
84 &IID_IMediaDet, (void **)&detector);
85 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
86 ok(!detector, "Got interface %p.\n", detector);
87
88 hr = CoCreateInstance(&CLSID_MediaDet, &test_outer, CLSCTX_INPROC_SERVER,
89 &IID_IUnknown, (void **)&unk);
90 ok(hr == S_OK, "Got hr %#lx.\n", hr);
91 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
92 ok(unk != &test_outer, "Returned IUnknown should not be outer IUnknown.\n");
93 ref = get_refcount(unk);
94 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
95
96 ref = IUnknown_AddRef(unk);
97 ok(ref == 2, "Got unexpected refcount %ld.\n", ref);
98 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
99
100 ref = IUnknown_Release(unk);
101 ok(ref == 1, "Got unexpected refcount %ld.\n", ref);
102 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
103
104 hr = IUnknown_QueryInterface(unk, &IID_IUnknown, (void **)&unk2);
105 ok(hr == S_OK, "Got hr %#lx.\n", hr);
106 ok(unk2 == unk, "Got unexpected IUnknown %p.\n", unk2);
107 IUnknown_Release(unk2);
108
109 hr = IUnknown_QueryInterface(unk, &IID_IMediaDet, (void **)&detector);
110 ok(hr == S_OK, "Got hr %#lx.\n", hr);
111
112 hr = IMediaDet_QueryInterface(detector, &IID_IUnknown, (void **)&unk2);
113 ok(hr == S_OK, "Got hr %#lx.\n", hr);
114 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
115
116 hr = IMediaDet_QueryInterface(detector, &IID_IMediaDet, (void **)&detector2);
117 ok(hr == S_OK, "Got hr %#lx.\n", hr);
118 ok(detector2 == (IMediaDet *)0xdeadbeef, "Got unexpected IMediaDet %p.\n", detector2);
119
120 hr = IUnknown_QueryInterface(unk, &test_iid, (void **)&unk2);
121 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
122 ok(!unk2, "Got unexpected IUnknown %p.\n", unk2);
123
124 hr = IMediaDet_QueryInterface(detector, &test_iid, (void **)&unk2);
125 ok(hr == S_OK, "Got hr %#lx.\n", hr);
126 ok(unk2 == (IUnknown *)0xdeadbeef, "Got unexpected IUnknown %p.\n", unk2);
127
128 IMediaDet_Release(detector);
129 ref = IUnknown_Release(unk);
130 ok(!ref, "Got unexpected refcount %ld.\n", ref);
131 ok(outer_ref == 1, "Got unexpected refcount %ld.\n", outer_ref);
132}
static ULONG get_refcount(void *iface)
Definition: mediadet.c:33
static IUnknown test_outer
Definition: mediadet.c:73
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

Referenced by START_TEST().

◆ test_COM_sg_enumpins()

static void test_COM_sg_enumpins ( void  )
static

Definition at line 1129 of file mediadet.c.

1130{
1131 IBaseFilter *bf;
1132 IEnumPins *pins, *pins2;
1133 IUnknown *unk;
1134 ULONG refcount;
1135 HRESULT hr;
1136
1137 hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter,
1138 (void**)&bf);
1139 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1140 hr = IBaseFilter_EnumPins(bf, &pins);
1141 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1142
1143 /* Same refcount for all EnumPins interfaces */
1144 refcount = IEnumPins_AddRef(pins);
1145 ok(refcount == 2, "refcount == %lu, expected 2\n", refcount);
1146 hr = IEnumPins_QueryInterface(pins, &IID_IEnumPins, (void**)&pins2);
1147 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1148 ok(pins == pins2, "QueryInterface for self failed (%p != %p)\n", pins, pins2);
1149 IEnumPins_Release(pins2);
1150
1151 hr = IEnumPins_QueryInterface(pins, &IID_IUnknown, (void**)&unk);
1152 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1153 refcount = IUnknown_AddRef(unk);
1154 ok(refcount == 4, "refcount == %lu, expected 4\n", refcount);
1155 refcount = IUnknown_Release(unk);
1156
1157 while (IEnumPins_Release(pins));
1158 IBaseFilter_Release(bf);
1159}
const GUID IID_IBaseFilter

Referenced by START_TEST().

◆ test_mediadet()

static void test_mediadet ( void  )
static

Definition at line 446 of file mediadet.c.

447{
448 HRESULT hr;
449 FILTER_INFO filter_info;
450 AM_MEDIA_TYPE mt, *pmt;
453 IMediaDet *pM = NULL;
456 IEnumPins *enumpins;
457 IUnknown *unk;
458 IPin *pin;
459 GUID guid;
460 BSTR bstr;
461 double fps;
462 int flags;
463 int i;
464
465 /* test.avi has one video stream. */
466 hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
467 &IID_IMediaDet, (LPVOID*)&pM);
468 ok(hr == S_OK, "Got hr %#lx.\n", hr);
469 ok(pM != NULL, "pM is NULL\n");
470
471 filename = NULL;
472 hr = IMediaDet_get_Filename(pM, &filename);
473 /* Despite what MSDN claims, this returns S_OK. */
474 ok(hr == S_OK, "Got hr %#lx.\n", hr);
475 ok(filename == NULL, "IMediaDet_get_Filename\n");
476
477 filename = (BSTR) -1;
478 hr = IMediaDet_get_Filename(pM, &filename);
479 /* Despite what MSDN claims, this returns S_OK. */
480 ok(hr == S_OK, "Got hr %#lx.\n", hr);
481 ok(filename == NULL, "IMediaDet_get_Filename\n");
482
483 count = -1;
484 hr = IMediaDet_get_OutputStreams(pM, &count);
485 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
486 ok(count == -1, "Got %ld streams.\n", count);
487
488 index = -1;
489 /* The stream defaults to 0, even without a file! */
490 hr = IMediaDet_get_CurrentStream(pM, &index);
491 ok(hr == S_OK, "Got hr %#lx.\n", hr);
492 ok(index == 0, "Got stream index %ld.\n", index);
493
494 hr = IMediaDet_get_CurrentStream(pM, NULL);
495 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
496
497 /* But put_CurrentStream doesn't. */
498 hr = IMediaDet_put_CurrentStream(pM, 0);
499 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
500
501 hr = IMediaDet_put_CurrentStream(pM, -1);
502 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
503
504 hr = IMediaDet_get_StreamMediaType(pM, &mt);
505 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
506
507 hr = IMediaDet_get_StreamMediaType(pM, NULL);
508 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
509
510 hr = IMediaDet_get_StreamType(pM, &guid);
511 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
512
513 hr = IMediaDet_get_StreamType(pM, NULL);
514 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
515
516 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
517 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
518
519 hr = IMediaDet_get_StreamTypeB(pM, NULL);
520 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
521
522 hr = IMediaDet_get_Filter(pM, NULL);
523 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
524
525 unk = (IUnknown*)0xdeadbeef;
526 hr = IMediaDet_get_Filter(pM, &unk);
527 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
528 ok(!unk, "Got filter %p.\n", unk);
529
531 hr = IMediaDet_put_Filename(pM, filename);
532 ok(hr == S_OK, "Got hr %#lx.\n", hr);
534#ifdef __REACTOS__
535 if (FAILED(hr))
536 {
537 skip("Failed to open file, hr %#lx.\n", hr);
538 IMediaDet_Release(pM);
539 return;
540 }
541#endif
542
543 index = -1;
544 /* The stream defaults to 0. */
545 hr = IMediaDet_get_CurrentStream(pM, &index);
546 ok(hr == S_OK, "Got hr %#lx.\n", hr);
547 ok(index == 0, "Got stream index %ld.\n", index);
548
549 ZeroMemory(&mt, sizeof mt);
550 hr = IMediaDet_get_StreamMediaType(pM, &mt);
551 ok(hr == S_OK, "Got hr %#lx.\n", hr);
552 CoTaskMemFree(mt.pbFormat);
553
554 hr = IMediaDet_get_StreamType(pM, &guid);
555 ok(hr == S_OK, "Got hr %#lx.\n", hr);
556 ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
557
558 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
559 ok(hr == S_OK, "Got hr %#lx.\n", hr);
560 ok(!wcscmp(bstr, L"{73646976-0000-0010-8000-00AA00389B71}"),
561 "Got major type %s.\n", debugstr_w(bstr));
562 SysFreeString(bstr);
563
564 /* Even before get_OutputStreams. */
565 hr = IMediaDet_put_CurrentStream(pM, 1);
566 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
567
568 hr = IMediaDet_get_OutputStreams(pM, &count);
569 ok(hr == S_OK, "Got hr %#lx.\n", hr);
570 ok(count == 1, "Got %ld streams.\n", count);
571
572 filename = NULL;
573 hr = IMediaDet_get_Filename(pM, &filename);
574 ok(hr == S_OK, "Got hr %#lx.\n", hr);
575 ok(!wcscmp(filename, test_avi_filename), "Expected filename %s, got %s.\n",
578
579 hr = IMediaDet_get_Filename(pM, NULL);
580 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
581
582 index = -1;
583 hr = IMediaDet_get_CurrentStream(pM, &index);
584 ok(hr == S_OK, "Got hr %#lx.\n", hr);
585 ok(index == 0, "Got stream index %ld.\n", index);
586
587 hr = IMediaDet_get_CurrentStream(pM, NULL);
588 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
589
590 hr = IMediaDet_put_CurrentStream(pM, -1);
591 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
592
593 hr = IMediaDet_put_CurrentStream(pM, 1);
594 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
595
596 /* Try again. */
597 index = -1;
598 hr = IMediaDet_get_CurrentStream(pM, &index);
599 ok(hr == S_OK, "Got hr %#lx.\n", hr);
600 ok(index == 0, "Got stream index %ld.\n", index);
601
602 hr = IMediaDet_put_CurrentStream(pM, 0);
603 ok(hr == S_OK, "Got hr %#lx.\n", hr);
604
605 index = -1;
606 hr = IMediaDet_get_CurrentStream(pM, &index);
607 ok(hr == S_OK, "Got hr %#lx.\n", hr);
608 ok(index == 0, "Got stream index %ld.\n", index);
609
610 ZeroMemory(&mt, sizeof mt);
611 hr = IMediaDet_get_StreamMediaType(pM, &mt);
612 ok(hr == S_OK, "Got hr %#lx.\n", hr);
613 ok(IsEqualGUID(&mt.majortype, &MEDIATYPE_Video),
614 "IMediaDet_get_StreamMediaType\n");
615 CoTaskMemFree(mt.pbFormat);
616
617 hr = IMediaDet_get_StreamType(pM, &guid);
618 ok(hr == S_OK, "Got hr %#lx.\n", hr);
619 ok(IsEqualGUID(&guid, &MEDIATYPE_Video), "Got major type %s.\n", debugstr_guid(&guid));
620
621 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
622 ok(hr == S_OK, "Got hr %#lx.\n", hr);
623 ok(!wcscmp(bstr, L"{73646976-0000-0010-8000-00AA00389B71}"),
624 "Got major type %s.\n", debugstr_w(bstr));
625 SysFreeString(bstr);
626
627 hr = IMediaDet_get_FrameRate(pM, NULL);
628 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
629
630 hr = IMediaDet_get_FrameRate(pM, &fps);
631 ok(hr == S_OK, "Got hr %#lx.\n", hr);
632 ok(fps == 10.0, "IMediaDet_get_FrameRate: fps is %f\n", fps);
633
634 ref = IMediaDet_Release(pM);
635 ok(!ref, "Got outstanding refcount %ld.\n", ref);
636
637 /* test_sound.avi has one video stream and one audio stream. */
638 hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
639 &IID_IMediaDet, (LPVOID*)&pM);
640 ok(hr == S_OK, "Got hr %#lx.\n", hr);
641 ok(pM != NULL, "pM is NULL\n");
642
644 hr = IMediaDet_put_Filename(pM, filename);
645 ok(hr == S_OK, "Got hr %#lx.\n", hr);
647#ifdef __REACTOS__
648 if (FAILED(hr))
649 {
650 skip("Failed to open file, hr %#lx.\n", hr);
651 IMediaDet_Release(pM);
652 return;
653 }
654#endif
655
656 hr = IMediaDet_get_OutputStreams(pM, &count);
657 ok(hr == S_OK, "Got hr %#lx.\n", hr);
658 ok(count == 2, "Got %ld streams.\n", count);
659
660 filename = NULL;
661 hr = IMediaDet_get_Filename(pM, &filename);
662 ok(hr == S_OK, "Got hr %#lx.\n", hr);
663 ok(!wcscmp(filename, test_sound_avi_filename), "Expected filename %s, got %s.\n",
666
667 /* I don't know if the stream order is deterministic. Just check
668 for both an audio and video stream. */
669 flags = 0;
670
671 for (i = 0; i < 2; ++i)
672 {
673 hr = IMediaDet_put_CurrentStream(pM, i);
674 ok(hr == S_OK, "Got hr %#lx.\n", hr);
675
676 index = -1;
677 hr = IMediaDet_get_CurrentStream(pM, &index);
678 ok(hr == S_OK, "Got hr %#lx.\n", hr);
679 ok(index == i, "Got stream index %ld.\n", index);
680
681 ZeroMemory(&mt, sizeof mt);
682 hr = IMediaDet_get_StreamMediaType(pM, &mt);
683 ok(hr == S_OK, "Got hr %#lx.\n", hr);
684 flags += (IsEqualGUID(&mt.majortype, &MEDIATYPE_Video)
685 ? 1
686 : (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio)
687 ? 2
688 : 0));
689
690 if (IsEqualGUID(&mt.majortype, &MEDIATYPE_Audio))
691 {
692 hr = IMediaDet_get_StreamType(pM, &guid);
693 ok(hr == S_OK, "Got hr %#lx.\n", hr);
694 ok(IsEqualGUID(&guid, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&guid));
695
696 hr = IMediaDet_get_StreamTypeB(pM, &bstr);
697 ok(hr == S_OK, "Got hr %#lx.\n", hr);
698 ok(!wcscmp(bstr, L"{73647561-0000-0010-8000-00AA00389B71}"),
699 "Got major type %s.\n", debugstr_w(bstr));
700 SysFreeString(bstr);
701
702 hr = IMediaDet_get_FrameRate(pM, &fps);
703 ok(hr == VFW_E_INVALIDMEDIATYPE, "Got hr %#lx.\n", hr);
704 }
705
706 CoTaskMemFree(mt.pbFormat);
707 }
708 ok(flags == 3, "IMediaDet_get_StreamMediaType: flags are %i\n", flags);
709
710 hr = IMediaDet_put_CurrentStream(pM, 2);
711 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
712
713 index = -1;
714 hr = IMediaDet_get_CurrentStream(pM, &index);
715 ok(hr == S_OK, "Got hr %#lx.\n", hr);
716 ok(index == 1, "Got stream index %ld.\n", index);
717
718 unk = NULL;
719 hr = IMediaDet_get_Filter(pM, &unk);
720 ok(hr == S_OK, "Got hr %#lx.\n", hr);
721 ok(!!unk, "Expected a non-NULL filter.\n");
722 hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void**)&filter);
723 ok(hr == S_OK, "Got hr %#lx.\n", hr);
724 IUnknown_Release(unk);
725
726 hr = IBaseFilter_EnumPins(filter, &enumpins);
727 ok(hr == S_OK, "Got hr %#lx.\n", hr);
728 hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
729 ok(hr == S_OK, "Got hr %#lx.\n", hr);
730 hr = IPin_EnumMediaTypes(pin, &type);
731 ok(hr == S_OK, "Got hr %#lx.\n", hr);
732 hr = IEnumMediaTypes_Next(type, 1, &pmt, NULL);
733 ok(hr == S_OK, "Got hr %#lx.\n", hr);
734 ok(IsEqualGUID(&pmt->majortype, &MEDIATYPE_Stream), "Got major type %s.\n",
735 debugstr_guid(&pmt->majortype));
736 IEnumMediaTypes_Release(type);
737 CoTaskMemFree(pmt->pbFormat);
738 CoTaskMemFree(pmt);
739 IPin_Release(pin);
740
741 hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
742 ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
743 IEnumPins_Release(enumpins);
744
745 hr = IBaseFilter_QueryFilterInfo(filter, &filter_info);
746 ok(hr == S_OK, "Got hr %#lx.\n", hr);
747 ok(!wcscmp(filter_info.achName, L"Source"), "Got name %s.\n", debugstr_w(filter_info.achName));
748 IFilterGraph_Release(filter_info.pGraph);
749 IBaseFilter_Release(filter);
750
751 ref = IMediaDet_Release(pM);
752 ok(!ref, "Got outstanding refcount %ld.\n", ref);
753}
#define index(s, c)
Definition: various.h:29
#define E_INVALIDARG
Definition: ddrawi.h:101
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
OLECHAR * BSTR
Definition: compat.h:2293
GUID guid
Definition: version.c:147
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
#define L(x)
Definition: resources.c:13
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
GLbitfield flags
Definition: glext.h:7161
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: axcore.idl:92
const char * filename
Definition: ioapi.h:137
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define ZeroMemory
Definition: minwinbase.h:31
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
long LONG
Definition: pedump.c:60
#define VFW_E_INVALIDMEDIATYPE
Definition: vfwmsgs.h:39
#define S_FALSE
Definition: winerror.h:3451
#define E_POINTER
Definition: winerror.h:3480

Referenced by START_TEST().

◆ test_put_filter()

static void test_put_filter ( void  )
static

Definition at line 755 of file mediadet.c.

756{
757 struct testfilter testfilter, testfilter2;
760 IMediaDet *detector;
763 double duration;
764 IUnknown *unk;
766 HRESULT hr;
767 ULONG ref;
768
769 hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
770 &IID_IMediaDet, (void **)&detector);
771 ok(hr == S_OK, "Got hr %#lx.\n", hr);
772
773 hr = IMediaDet_put_Filter(detector, NULL);
774 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
775
776 hr = IMediaDet_get_Filter(detector, NULL);
777 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
778
779 hr = IMediaDet_get_StreamLength(detector, NULL);
780 ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
781
782 hr = IMediaDet_get_StreamLength(detector, &duration);
783 ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
784
786 hr = IMediaDet_put_Filter(detector, &testfilter.filter.IUnknown_inner);
787 ok(hr == S_OK, "Got hr %#lx.\n", hr);
788
789 hr = IMediaDet_get_Filter(detector, &unk);
790 ok(hr == S_OK, "Got hr %#lx.\n", hr);
791 ok(!!unk, "Expected a non-NULL interface.\n");
792 hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
793 ok(hr == S_OK, "Got hr %#lx.\n", hr);
794 ok(filter == &testfilter.filter.IBaseFilter_iface, "Expected the same filter.\n");
795 IBaseFilter_Release(filter);
796 IUnknown_Release(unk);
797
798 ok(!wcscmp(testfilter.filter.name, L"Source"), "Got name %s.\n",
800 graph = testfilter.filter.graph;
801 IFilterGraph_AddRef(graph);
802
803 testfilter_init(&testfilter2);
804 hr = IMediaDet_put_Filter(detector, &testfilter2.filter.IUnknown_inner);
805 ok(hr == S_OK, "Got hr %#lx.\n", hr);
806
807 hr = IMediaDet_get_Filter(detector, &unk);
808 ok(hr == S_OK, "Got hr %#lx.\n", hr);
809 ok(!!unk, "Expected a non-NULL interface.\n");
810 hr = IUnknown_QueryInterface(unk, &IID_IBaseFilter, (void **)&filter);
811 ok(hr == S_OK, "Got hr %#lx.\n", hr);
812 ok(filter == &testfilter2.filter.IBaseFilter_iface, "Expected the same filter.\n");
813 IBaseFilter_Release(filter);
814 IUnknown_Release(unk);
815
816 ok(testfilter2.filter.graph != graph, "Expected a different graph.\n");
817
818 ref = IFilterGraph_Release(graph);
819 ok(!ref, "Got outstanding refcount %ld.\n", ref);
820 ref = IBaseFilter_Release(&testfilter.filter.IBaseFilter_iface);
821 ok(!ref, "Got outstanding refcount %ld.\n", ref);
822
823 count = 0xdeadbeef;
824 hr = IMediaDet_get_OutputStreams(detector, &count);
825 ok(hr == S_OK, "Got hr %#lx.\n", hr);
826 ok(count == 1, "Got %ld streams.\n", count);
827
828 index = 0xdeadbeef;
829 hr = IMediaDet_get_CurrentStream(detector, &index);
830 ok(hr == S_OK, "Got hr %#lx.\n", hr);
831 ok(index == 0, "Got stream %ld.\n", index);
832
833 filename = (BSTR)0xdeadbeef;
834 hr = IMediaDet_get_Filename(detector, &filename);
835 ok(hr == S_OK, "Got hr %#lx.\n", hr);
836 ok(!filename, "Got filename %s.\n", debugstr_w(filename));
837
838 hr = IMediaDet_get_StreamLength(detector, &duration);
839 ok(hr == S_OK, "Got hr %#lx.\n", hr);
840 ok(duration == 4.2, "Got duration %.16e.\n", duration);
841
842 ref = IMediaDet_Release(detector);
843 ok(!ref, "Got outstanding refcount %ld.\n", ref);
844 ref = IBaseFilter_Release(&testfilter2.filter.IBaseFilter_iface);
845 ok(!ref, "Got outstanding refcount %ld.\n", ref);
846
847 hr = CoCreateInstance(&CLSID_MediaDet, NULL, CLSCTX_INPROC_SERVER,
848 &IID_IMediaDet, (void **)&detector);
849 ok(hr == S_OK, "Got hr %#lx.\n", hr);
850
852 hr = IMediaDet_put_Filename(detector, filename);
853 ok(hr == S_OK, "Got hr %#lx.\n", hr);
855#ifdef __REACTOS__
856 if (FAILED(hr))
857 {
858 skip("Failed to open file, hr %#lx.\n", hr);
859 IMediaDet_Release(detector);
860 return;
861 }
862#endif
863
864 hr = IMediaDet_get_StreamMediaType(detector, &mt);
865 ok(hr == S_OK, "Got hr %#lx.\n", hr);
867
868 hr = IMediaDet_get_Filter(detector, &unk);
869 ok(hr == S_OK, "Got hr %#lx.\n", hr);
870 hr = IMediaDet_put_Filter(detector, unk);
871 ok(hr == S_OK, "Got hr %#lx.\n", hr);
872 IUnknown_Release(unk);
873
874 filename = (BSTR)0xdeadbeef;
875 hr = IMediaDet_get_Filename(detector, &filename);
876 ok(hr == S_OK, "Got hr %#lx.\n", hr);
877 ok(!filename, "Got filename %s.\n", debugstr_w(filename));
878
879 count = 0xdeadbeef;
880 hr = IMediaDet_get_OutputStreams(detector, &count);
881 ok(hr == S_OK, "Got hr %#lx.\n", hr);
882 ok(count == 2, "Got %ld streams.\n", count);
883
884 index = 0xdeadbeef;
885 hr = IMediaDet_get_CurrentStream(detector, &index);
886 ok(hr == S_OK, "Got hr %#lx.\n", hr);
887 ok(index == 0, "Got stream %ld.\n", index);
888
889 ref = IMediaDet_Release(detector);
890 ok(!ref, "Got outstanding refcount %ld.\n", ref);
891}
static void testfilter_init(struct testfilter *filter)
Definition: mediadet.c:381
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
Definition: mediatype.c:165
IBaseFilter * filter
Definition: filtergraph.c:75
Definition: graph.c:32
const AM_MEDIA_TYPE * mt
Definition: avidec.c:799
IFilterGraph * graph
Definition: filtergraph.c:850
struct strmbase_filter filter
Definition: amstream.c:1019

Referenced by START_TEST().

◆ test_samplegrabber()

static void test_samplegrabber ( void  )
static

Definition at line 1075 of file mediadet.c.

1076{
1077 ISampleGrabber *sg;
1078 IBaseFilter *bf;
1079 IPin *pin;
1080 IMemInputPin *inpin;
1081 IEnumPins *pins;
1082 HRESULT hr;
1083 FILTER_STATE fstate;
1084 ULONG refcount;
1085
1086 /* Invalid RIID */
1087 hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_IClassFactory,
1088 (void**)&sg);
1089 ok(hr == E_NOINTERFACE, "Got hr %#lx.\n", hr);
1090
1091 hr = CoCreateInstance(&CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER, &IID_ISampleGrabber,
1092 (void**)&sg);
1093 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1094
1095 hr = ISampleGrabber_QueryInterface(sg, &IID_IBaseFilter, (void**)&bf);
1096 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1097
1098 hr = ISampleGrabber_SetCallback(sg, &my_sg_cb, 0);
1099 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1100
1101 hr = IBaseFilter_GetState(bf, 100, &fstate);
1102 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1103 ok(fstate == State_Stopped, "Got wrong filter state: %u\n", fstate);
1104
1105 hr = IBaseFilter_EnumPins(bf, &pins);
1106 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1107
1108 hr = IEnumPins_Next(pins, 1, &pin, NULL);
1109 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1110
1111 IEnumPins_Release(pins);
1112
1113 hr = IPin_QueryInterface(pin, &IID_IMemInputPin, (void**)&inpin);
1114 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1115
1116 hr = IMemInputPin_Receive(inpin, &my_sample.sample);
1117 ok(hr == S_OK, "Got hr %#lx.\n", hr);
1118 ok(samplecb_called == TRUE, "SampleCB should have been called\n");
1119
1120 refcount = IUnknown_Release(&my_sample.sample);
1121 ok(!refcount, "Got unexpected refcount %ld.\n", refcount);
1122
1123 IMemInputPin_Release(inpin);
1124 IPin_Release(pin);
1125
1126 while (ISampleGrabber_Release(sg));
1127}
const GUID IID_IClassFactory
static ISampleGrabberCB my_sg_cb
Definition: mediadet.c:1073
fstate
Definition: ms2ps.cpp:80

Referenced by START_TEST().

◆ testfilter_destroy()

static void testfilter_destroy ( struct strmbase_filter *  iface)
static

Definition at line 153 of file mediadet.c.

154{
156
159}
static struct testfilter * impl_from_strmbase_filter(struct strmbase_filter *iface)
Definition: mediadet.c:141
void strmbase_filter_cleanup(struct strmbase_filter *filter)
Definition: filter.c:540
void strmbase_source_cleanup(struct strmbase_source *pin)
Definition: pin.c:778

◆ testfilter_get_pin()

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

Definition at line 146 of file mediadet.c.

147{
149
150 return index ? NULL : &filter->source.pin;
151}

◆ testfilter_init()

static void testfilter_init ( struct testfilter *  filter)
static

Definition at line 381 of file mediadet.c.

382{
383 static const GUID clsid = {0xabacab};
384
385 memset(filter, 0, sizeof(*filter));
389}
static const IMediaSeekingVtbl testseek_vtbl
Definition: mediadet.c:357
static const struct strmbase_source_ops testsource_ops
Definition: mediadet.c:220
static const struct strmbase_filter_ops testfilter_ops
Definition: mediadet.c:161
const CLSID * clsid
Definition: msctf.cpp:50
#define memset(x, y, z)
Definition: compat.h:39
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
IMediaSeeking IMediaSeeking_iface
Definition: filter.c:167

Referenced by test_put_filter().

◆ testseek_AddRef()

static ULONG WINAPI testseek_AddRef ( IMediaSeeking *  iface)
static

Definition at line 239 of file mediadet.c.

240{
242 return IPin_AddRef(&filter->source.pin.IPin_iface);
243}
static struct testfilter * impl_from_IMediaSeeking(IMediaSeeking *iface)
Definition: mediadet.c:228

◆ testseek_CheckCapabilities()

static HRESULT WINAPI testseek_CheckCapabilities ( IMediaSeeking *  iface,
DWORD *  caps 
)
static

Definition at line 257 of file mediadet.c.

258{
259 ok(0, "Unexpected call.\n");
260 return E_NOTIMPL;
261}

◆ testseek_ConvertTimeFormat()

static HRESULT WINAPI testseek_ConvertTimeFormat ( IMediaSeeking *  iface,
LONGLONG *  target,
const GUID *  target_format,
LONGLONG  source,
const GUID *  source_format 
)
static

Definition at line 313 of file mediadet.c.

315{
316 ok(0, "Unexpected call.\n");
317 return E_NOTIMPL;
318}

◆ testseek_GetAvailable()

static HRESULT WINAPI testseek_GetAvailable ( IMediaSeeking *  iface,
LONGLONG *  earliest,
LONGLONG *  latest 
)
static

Definition at line 333 of file mediadet.c.

334{
335 ok(0, "Unexpected call.\n");
336 return E_NOTIMPL;
337}

◆ testseek_GetCapabilities()

static HRESULT WINAPI testseek_GetCapabilities ( IMediaSeeking *  iface,
DWORD *  caps 
)
static

Definition at line 251 of file mediadet.c.

252{
253 ok(0, "Unexpected call.\n");
254 return E_NOTIMPL;
255}

◆ testseek_GetCurrentPosition()

static HRESULT WINAPI testseek_GetCurrentPosition ( IMediaSeeking *  iface,
LONGLONG *  current 
)
static

Definition at line 307 of file mediadet.c.

308{
309 ok(0, "Unexpected call.\n");
310 return E_NOTIMPL;
311}

◆ testseek_GetDuration()

static HRESULT WINAPI testseek_GetDuration ( IMediaSeeking *  iface,
LONGLONG *  duration 
)
static

Definition at line 293 of file mediadet.c.

294{
295 if (winetest_debug > 1) trace("IMediaSeeking_GetDuration()\n");
296
297 *duration = 42000000;
298 return S_OK;
299}
#define trace
Definition: atltest.h:70
int winetest_debug

◆ testseek_GetPositions()

static HRESULT WINAPI testseek_GetPositions ( IMediaSeeking *  iface,
LONGLONG *  current,
LONGLONG *  stop 
)
static

Definition at line 327 of file mediadet.c.

328{
329 ok(0, "Unexpected call.\n");
330 return E_NOTIMPL;
331}

◆ testseek_GetPreroll()

static HRESULT WINAPI testseek_GetPreroll ( IMediaSeeking *  iface,
LONGLONG *  preroll 
)
static

Definition at line 351 of file mediadet.c.

352{
353 ok(0, "Unexpected call.\n");
354 return E_NOTIMPL;
355}

◆ testseek_GetRate()

static HRESULT WINAPI testseek_GetRate ( IMediaSeeking *  iface,
double *  rate 
)
static

Definition at line 345 of file mediadet.c.

346{
347 ok(0, "Unexpected call.\n");
348 return E_NOTIMPL;
349}

◆ testseek_GetStopPosition()

static HRESULT WINAPI testseek_GetStopPosition ( IMediaSeeking *  iface,
LONGLONG *  stop 
)
static

Definition at line 301 of file mediadet.c.

302{
303 ok(0, "Unexpected call.\n");
304 return E_NOTIMPL;
305}

◆ testseek_GetTimeFormat()

static HRESULT WINAPI testseek_GetTimeFormat ( IMediaSeeking *  iface,
GUID *  format 
)
static

Definition at line 275 of file mediadet.c.

276{
277 ok(0, "Unexpected call.\n");
278 return E_NOTIMPL;
279}

◆ testseek_IsFormatSupported()

static HRESULT WINAPI testseek_IsFormatSupported ( IMediaSeeking *  iface,
const GUID *  format 
)
static

Definition at line 263 of file mediadet.c.

264{
265 ok(0, "Unexpected call.\n");
266 return E_NOTIMPL;
267}

◆ testseek_IsUsingTimeFormat()

static HRESULT WINAPI testseek_IsUsingTimeFormat ( IMediaSeeking *  iface,
const GUID *  format 
)
static

Definition at line 281 of file mediadet.c.

282{
283 ok(0, "Unexpected call.\n");
284 return E_NOTIMPL;
285}

◆ testseek_QueryInterface()

static HRESULT WINAPI testseek_QueryInterface ( IMediaSeeking *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 233 of file mediadet.c.

234{
236 return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
237}

◆ testseek_QueryPreferredFormat()

static HRESULT WINAPI testseek_QueryPreferredFormat ( IMediaSeeking *  iface,
GUID *  format 
)
static

Definition at line 269 of file mediadet.c.

270{
271 ok(0, "Unexpected call.\n");
272 return E_NOTIMPL;
273}

◆ testseek_Release()

static ULONG WINAPI testseek_Release ( IMediaSeeking *  iface)
static

Definition at line 245 of file mediadet.c.

246{
248 return IPin_Release(&filter->source.pin.IPin_iface);
249}

◆ testseek_SetPositions()

static HRESULT WINAPI testseek_SetPositions ( IMediaSeeking *  iface,
LONGLONG *  current,
DWORD  current_flags,
LONGLONG *  stop,
DWORD  stop_flags 
)
static

Definition at line 320 of file mediadet.c.

322{
323 ok(0, "Unexpected call.\n");
324 return E_NOTIMPL;
325}

◆ testseek_SetRate()

static HRESULT WINAPI testseek_SetRate ( IMediaSeeking *  iface,
double  rate 
)
static

Definition at line 339 of file mediadet.c.

340{
341 ok(0, "Unexpected call.\n");
342 return E_NOTIMPL;
343}

◆ testseek_SetTimeFormat()

static HRESULT WINAPI testseek_SetTimeFormat ( IMediaSeeking *  iface,
const GUID *  format 
)
static

Definition at line 287 of file mediadet.c.

288{
289 ok(0, "Unexpected call.\n");
290 return E_NOTIMPL;
291}

◆ testsource_DecideAllocator()

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

Definition at line 214 of file mediadet.c.

216{
217 return S_OK;
218}

◆ testsource_get_media_type()

static HRESULT testsource_get_media_type ( struct strmbase_pin *  iface,
unsigned int  index,
AM_MEDIA_TYPE *  mt 
)
static

Definition at line 172 of file mediadet.c.

173{
174 static const VIDEOINFOHEADER source_format =
175 {
177 .bmiHeader.biWidth = 640,
178 .bmiHeader.biHeight = 480,
179 .bmiHeader.biPlanes = 1,
180 .bmiHeader.biBitCount = 24,
181 .bmiHeader.biCompression = BI_RGB,
182 .bmiHeader.biSizeImage = 640 * 480 * 3
183 };
184
185 if (index)
186 return S_FALSE;
187
188 mt->majortype = MEDIATYPE_Video;
189 mt->subtype = MEDIASUBTYPE_RGB24;
190 mt->bFixedSizeSamples = TRUE;
191 mt->bTemporalCompression = FALSE;
192 mt->lSampleSize = source_format.bmiHeader.biSizeImage;
193 mt->formattype = FORMAT_VideoInfo;
194 mt->pUnk = NULL;
195 mt->cbFormat = sizeof(source_format);
196 mt->pbFormat = CoTaskMemAlloc(mt->cbFormat);
197 memcpy(mt->pbFormat, &source_format, mt->cbFormat);
198 return S_OK;
199}
#define FALSE
Definition: types.h:117
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
DWORD biSizeImage
Definition: amvideo.idl:36
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189
#define BI_RGB
Definition: uefivid.c:46

◆ testsource_query_interface()

static HRESULT testsource_query_interface ( struct strmbase_pin *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 201 of file mediadet.c.

202{
204
205 if (IsEqualGUID(iid, &IID_IMediaSeeking))
207 else
208 return E_NOINTERFACE;
209
210 IUnknown_AddRef((IUnknown*)*out);
211 return S_OK;
212}
static struct testfilter * impl_from_strmbase_pin(struct strmbase_pin *iface)
Definition: mediadet.c:167

◆ unpack_avi_file()

static BOOL unpack_avi_file ( int  id,
WCHAR  name[MAX_PATH] 
)
static

Definition at line 394 of file mediadet.c.

395{
396 static WCHAR temp_path[MAX_PATH];
397 HRSRC res;
399 char *mem;
400 DWORD size, written;
401 HANDLE fh;
402 BOOL ret;
403
405 if (!res)
406 return FALSE;
407
409 if (!data)
410 return FALSE;
411
413 if (!mem)
414 return FALSE;
415
417 if (size == 0)
418 return FALSE;
419
421 return FALSE;
422
423 /* We might end up relying on the extension here, so .TMP is no good. */
424 if (!GetTempFileNameW(temp_path, L"DES", 0, name))
425 return FALSE;
426
428 wcscpy(name + wcslen(name) - 3, L"avi");
429
432 if (fh == INVALID_HANDLE_VALUE)
433 return FALSE;
434
435 ret = WriteFile(fh, mem, size, &written, NULL);
436 CloseHandle(fh);
437 return ret && written == size;
438}
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2098
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint res
Definition: glext.h:9613
GLsizeiptr size
Definition: glext.h:5919
#define CREATE_NEW
Definition: disk.h:69
char temp_path[MAX_PATH]
Definition: mspatcha.c:123
#define GENERIC_WRITE
Definition: nt_native.h:90
short WCHAR
Definition: pedump.c:58
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define AVI_RES_TYPE
Definition: rc.h:27
wcscpy
Definition: mem.c:349
Definition: name.c:39

Referenced by init_tests().

Variable Documentation

◆ my_sample

struct test_sample my_sample = { {&my_sample_vt}, 0 }
static

Definition at line 1029 of file mediadet.c.

Referenced by sgcb_SampleCB(), and test_samplegrabber().

◆ my_sample_vt

const IMediaSampleVtbl my_sample_vt
static
Initial value:
= {
}
static HRESULT WINAPI ms_GetMediaTime(IMediaSample *iface, LONGLONG *pTimeStart, LONGLONG *pTimeEnd)
Definition: mediadet.c:995
static HRESULT WINAPI ms_GetPointer(IMediaSample *iface, BYTE **ppBuffer)
Definition: mediadet.c:922
static HRESULT WINAPI ms_SetPreroll(IMediaSample *iface, BOOL bIsPreroll)
Definition: mediadet.c:959
static HRESULT WINAPI ms_IsPreroll(IMediaSample *iface)
Definition: mediadet.c:954
static LONG WINAPI ms_GetActualDataLength(IMediaSample *iface)
Definition: mediadet.c:964
static HRESULT WINAPI ms_SetMediaTime(IMediaSample *iface, LONGLONG *pTimeStart, LONGLONG *pTimeEnd)
Definition: mediadet.c:1001
static ULONG WINAPI ms_AddRef(IMediaSample *iface)
Definition: mediadet.c:910
static HRESULT WINAPI ms_SetTime(IMediaSample *iface, REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd)
Definition: mediadet.c:938
static HRESULT WINAPI ms_QueryInterface(IMediaSample *iface, REFIID riid, void **ppvObject)
Definition: mediadet.c:904
static HRESULT WINAPI ms_SetMediaType(IMediaSample *iface, AM_MEDIA_TYPE *pMediaType)
Definition: mediadet.c:980
static HRESULT WINAPI ms_IsDiscontinuity(IMediaSample *iface)
Definition: mediadet.c:985
static HRESULT WINAPI ms_IsSyncPoint(IMediaSample *iface)
Definition: mediadet.c:944
static HRESULT WINAPI ms_GetTime(IMediaSample *iface, REFERENCE_TIME *pTimeStart, REFERENCE_TIME *pTimeEnd)
Definition: mediadet.c:932
static HRESULT WINAPI ms_SetSyncPoint(IMediaSample *iface, BOOL bIsSyncPoint)
Definition: mediadet.c:949
static HRESULT WINAPI ms_SetActualDataLength(IMediaSample *iface, LONG length)
Definition: mediadet.c:969
static HRESULT WINAPI ms_GetMediaType(IMediaSample *iface, AM_MEDIA_TYPE **ppMediaType)
Definition: mediadet.c:974
static HRESULT WINAPI ms_SetDiscontinuity(IMediaSample *iface, BOOL bDiscontinuity)
Definition: mediadet.c:990
static ULONG WINAPI ms_Release(IMediaSample *iface)
Definition: mediadet.c:916
static LONG WINAPI ms_GetSize(IMediaSample *iface)
Definition: mediadet.c:927

Definition at line 1007 of file mediadet.c.

◆ my_sg_cb

ISampleGrabberCB my_sg_cb = { &sgcb_vt }
static

Definition at line 1073 of file mediadet.c.

Referenced by test_samplegrabber().

◆ outer_ref

LONG outer_ref = 1
static

Definition at line 41 of file mediadet.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: mediadet.c:56
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
Definition: mediadet.c:43
static ULONG WINAPI outer_Release(IUnknown *iface)
Definition: mediadet.c:61

Definition at line 66 of file mediadet.c.

◆ samplecb_called

BOOL samplecb_called = FALSE
static

Definition at line 1031 of file mediadet.c.

Referenced by sgcb_SampleCB(), and test_samplegrabber().

◆ sgcb_vt

const ISampleGrabberCBVtbl sgcb_vt
static
Initial value:
= {
}
static ULONG WINAPI sgcb_AddRef(ISampleGrabberCB *iface)
Definition: mediadet.c:1039
static ULONG WINAPI sgcb_Release(ISampleGrabberCB *iface)
Definition: mediadet.c:1044
static HRESULT WINAPI sgcb_QueryInterface(ISampleGrabberCB *iface, REFIID riid, void **ppvObject)
Definition: mediadet.c:1033
static HRESULT WINAPI sgcb_BufferCB(ISampleGrabberCB *iface, double SampleTime, BYTE *pBuffer, LONG BufferLen)
Definition: mediadet.c:1058
static HRESULT WINAPI sgcb_SampleCB(ISampleGrabberCB *iface, double SampleTime, IMediaSample *pSample)
Definition: mediadet.c:1049

Definition at line 1065 of file mediadet.c.

◆ test_avi_filename

WCHAR test_avi_filename[MAX_PATH]
static

Definition at line 391 of file mediadet.c.

Referenced by init_tests(), START_TEST(), and test_mediadet().

◆ test_iid

const GUID test_iid = {0x33333333}
static

Definition at line 40 of file mediadet.c.

Referenced by outer_QueryInterface(), and test_aggregation().

◆ test_outer

IUnknown test_outer = {&outer_vtbl}
static

Definition at line 73 of file mediadet.c.

Referenced by test_aggregation().

◆ test_sound_avi_filename

WCHAR test_sound_avi_filename[MAX_PATH]
static

Definition at line 392 of file mediadet.c.

Referenced by init_tests(), START_TEST(), test_mediadet(), and test_put_filter().

◆ 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: mediadet.c:153
static struct strmbase_pin * testfilter_get_pin(struct strmbase_filter *iface, unsigned int index)
Definition: mediadet.c:146

Definition at line 161 of file mediadet.c.

Referenced by testfilter_init().

◆ testseek_vtbl

const IMediaSeekingVtbl testseek_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI testseek_CheckCapabilities(IMediaSeeking *iface, DWORD *caps)
Definition: mediadet.c:257
static ULONG WINAPI testseek_Release(IMediaSeeking *iface)
Definition: mediadet.c:245
static ULONG WINAPI testseek_AddRef(IMediaSeeking *iface)
Definition: mediadet.c:239
static HRESULT WINAPI testseek_QueryInterface(IMediaSeeking *iface, REFIID iid, void **out)
Definition: mediadet.c:233
static HRESULT WINAPI testseek_GetStopPosition(IMediaSeeking *iface, LONGLONG *stop)
Definition: mediadet.c:301
static HRESULT WINAPI testseek_IsFormatSupported(IMediaSeeking *iface, const GUID *format)
Definition: mediadet.c:263
static HRESULT WINAPI testseek_SetRate(IMediaSeeking *iface, double rate)
Definition: mediadet.c:339
static HRESULT WINAPI testseek_GetDuration(IMediaSeeking *iface, LONGLONG *duration)
Definition: mediadet.c:293
static HRESULT WINAPI testseek_SetPositions(IMediaSeeking *iface, LONGLONG *current, DWORD current_flags, LONGLONG *stop, DWORD stop_flags)
Definition: mediadet.c:320
static HRESULT WINAPI testseek_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *target, const GUID *target_format, LONGLONG source, const GUID *source_format)
Definition: mediadet.c:313
static HRESULT WINAPI testseek_IsUsingTimeFormat(IMediaSeeking *iface, const GUID *format)
Definition: mediadet.c:281
static HRESULT WINAPI testseek_QueryPreferredFormat(IMediaSeeking *iface, GUID *format)
Definition: mediadet.c:269
static HRESULT WINAPI testseek_GetCapabilities(IMediaSeeking *iface, DWORD *caps)
Definition: mediadet.c:251
static HRESULT WINAPI testseek_GetAvailable(IMediaSeeking *iface, LONGLONG *earliest, LONGLONG *latest)
Definition: mediadet.c:333
static HRESULT WINAPI testseek_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *current)
Definition: mediadet.c:307
static HRESULT WINAPI testseek_SetTimeFormat(IMediaSeeking *iface, const GUID *format)
Definition: mediadet.c:287
static HRESULT WINAPI testseek_GetTimeFormat(IMediaSeeking *iface, GUID *format)
Definition: mediadet.c:275
static HRESULT WINAPI testseek_GetPreroll(IMediaSeeking *iface, LONGLONG *preroll)
Definition: mediadet.c:351
static HRESULT WINAPI testseek_GetRate(IMediaSeeking *iface, double *rate)
Definition: mediadet.c:345
static HRESULT WINAPI testseek_GetPositions(IMediaSeeking *iface, LONGLONG *current, LONGLONG *stop)
Definition: mediadet.c:327

Definition at line 357 of file mediadet.c.

Referenced by testfilter_init().

◆ testsource_ops

const struct strmbase_source_ops testsource_ops
static
Initial value:
=
{
.base.pin_get_media_type = testsource_get_media_type,
.base.pin_query_interface = testsource_query_interface,
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
.pfnDecideAllocator = testsource_DecideAllocator,
}
static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
Definition: mediadet.c:214
static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
Definition: mediadet.c:201
static HRESULT testsource_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
Definition: mediadet.c:172
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
Definition: pin.c:710

Definition at line 220 of file mediadet.c.

Referenced by testfilter_init().