Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/quartz/filesource.c | 79 +++++++++++++++++++---------------------
1 file changed, 38 insertions(+), 41 deletions(-)
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index a8a68680659..b1586bc1bb1 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -53,7 +53,7 @@ struct request
OVERLAPPED ovl;
};
-typedef struct AsyncReader
+struct async_reader
{
struct strmbase_filter filter;
IFileSourceFilter IFileSourceFilter_iface;
@@ -70,18 +70,18 @@ typedef struct AsyncReader
struct request *requests;
unsigned int max_requests;
CONDITION_VARIABLE sample_cv;
-} AsyncReader;
+};
static const struct strmbase_source_ops source_ops;
-static inline AsyncReader *impl_from_strmbase_filter(struct strmbase_filter *iface)
+static inline struct async_reader *impl_from_strmbase_filter(struct strmbase_filter *iface)
{
- return CONTAINING_RECORD(iface, AsyncReader, filter);
+ return CONTAINING_RECORD(iface, struct async_reader, filter);
}
-static inline AsyncReader *impl_from_IFileSourceFilter(IFileSourceFilter *iface)
+static inline struct async_reader *impl_from_IFileSourceFilter(IFileSourceFilter *iface)
{
- return CONTAINING_RECORD(iface, AsyncReader, IFileSourceFilter_iface);
+ return CONTAINING_RECORD(iface, struct async_reader, IFileSourceFilter_iface);
}
static const IFileSourceFilterVtbl FileSource_Vtbl;
@@ -311,7 +311,7 @@ BOOL get_media_type(const WCHAR *filename, GUID *majortype, GUID *subtype, GUID
static struct strmbase_pin *async_reader_get_pin(struct strmbase_filter *iface, unsigned int index)
{
- AsyncReader *filter = impl_from_strmbase_filter(iface);
+ struct async_reader *filter = impl_from_strmbase_filter(iface);
if (!index && filter->pszFileName)
return &filter->source.pin;
@@ -320,7 +320,7 @@ static struct strmbase_pin *async_reader_get_pin(struct strmbase_filter *iface,
static void async_reader_destroy(struct strmbase_filter *iface)
{
- AsyncReader *filter = impl_from_strmbase_filter(iface);
+ struct async_reader *filter = impl_from_strmbase_filter(iface);
if (filter->pszFileName)
{
@@ -359,7 +359,7 @@ static void async_reader_destroy(struct strmbase_filter *iface)
static HRESULT async_reader_query_interface(struct strmbase_filter *iface, REFIID iid, void **out)
{
- AsyncReader *filter = impl_from_strmbase_filter(iface);
+ struct async_reader *filter = impl_from_strmbase_filter(iface);
if (IsEqualGUID(iid, &IID_IFileSourceFilter))
{
@@ -380,7 +380,7 @@ static const struct strmbase_filter_ops filter_ops =
static DWORD CALLBACK io_thread(void *arg)
{
- AsyncReader *filter = arg;
+ struct async_reader *filter = arg;
struct request *req;
OVERLAPPED *ovl;
ULONG_PTR key;
@@ -416,7 +416,7 @@ static DWORD CALLBACK io_thread(void *arg)
HRESULT async_reader_create(IUnknown *outer, IUnknown **out)
{
- AsyncReader *object;
+ struct async_reader *object;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
@@ -439,29 +439,26 @@ HRESULT async_reader_create(IUnknown *outer, IUnknown **out)
static HRESULT WINAPI FileSource_QueryInterface(IFileSourceFilter * iface, REFIID riid, LPVOID * ppv)
{
- AsyncReader *This = impl_from_IFileSourceFilter(iface);
-
- return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv);
+ struct async_reader *filter = impl_from_IFileSourceFilter(iface);
+ return IBaseFilter_QueryInterface(&filter->filter.IBaseFilter_iface, riid, ppv);
}
static ULONG WINAPI FileSource_AddRef(IFileSourceFilter * iface)
{
- AsyncReader *This = impl_from_IFileSourceFilter(iface);
-
- return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
+ struct async_reader *filter = impl_from_IFileSourceFilter(iface);
+ return IBaseFilter_AddRef(&filter->filter.IBaseFilter_iface);
}
static ULONG WINAPI FileSource_Release(IFileSourceFilter * iface)
{
- AsyncReader *This = impl_from_IFileSourceFilter(iface);
-
- return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
+ struct async_reader *filter = impl_from_IFileSourceFilter(iface);
+ return IBaseFilter_Release(&filter->filter.IBaseFilter_iface);
}
static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFileName, const AM_MEDIA_TYPE * pmt)
{
+ struct async_reader *This = impl_from_IFileSourceFilter(iface);
HANDLE hFile;
- AsyncReader *This = impl_from_IFileSourceFilter(iface);
TRACE("%p->(%s, %p)\n", This, debugstr_w(pszFileName), pmt);
strmbase_dump_media_type(pmt);
@@ -514,7 +511,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
static HRESULT WINAPI FileSource_GetCurFile(IFileSourceFilter *iface, LPOLESTR *ppszFileName, AM_MEDIA_TYPE *mt)
{
- AsyncReader *This = impl_from_IFileSourceFilter(iface);
+ struct async_reader *This = impl_from_IFileSourceFilter(iface);
TRACE("filter %p, filename %p, mt %p.\n", This, ppszFileName, mt);
@@ -548,19 +545,19 @@ static const IFileSourceFilterVtbl FileSource_Vtbl =
FileSource_GetCurFile
};
-static inline AsyncReader *impl_from_strmbase_pin(struct strmbase_pin *iface)
+static inline struct async_reader *impl_from_strmbase_pin(struct strmbase_pin *iface)
{
- return CONTAINING_RECORD(iface, AsyncReader, source.pin);
+ return CONTAINING_RECORD(iface, struct async_reader, source.pin);
}
-static inline AsyncReader *impl_from_IAsyncReader(IAsyncReader *iface)
+static inline struct async_reader *impl_from_IAsyncReader(IAsyncReader *iface)
{
- return CONTAINING_RECORD(iface, AsyncReader, IAsyncReader_iface);
+ return CONTAINING_RECORD(iface, struct async_reader, IAsyncReader_iface);
}
static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
{
- AsyncReader *filter = impl_from_strmbase_pin(iface);
+ struct async_reader *filter = impl_from_strmbase_pin(iface);
if (IsEqualGUID(&mt->majortype, &filter->mt.majortype)
&& (!IsEqualGUID(&mt->subtype, &GUID_NULL)
@@ -572,7 +569,7 @@ static HRESULT source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TY
static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
{
- AsyncReader *filter = impl_from_strmbase_pin(iface);
+ struct async_reader *filter = impl_from_strmbase_pin(iface);
if (index > 1)
return VFW_S_NO_MORE_ITEMS;
@@ -586,7 +583,7 @@ static HRESULT source_get_media_type(struct strmbase_pin *iface, unsigned int in
static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
{
- AsyncReader *filter = impl_from_strmbase_pin(iface);
+ struct async_reader *filter = impl_from_strmbase_pin(iface);
if (IsEqualGUID(iid, &IID_IAsyncReader))
{
@@ -607,7 +604,7 @@ static HRESULT source_query_interface(struct strmbase_pin *iface, REFIID iid, vo
static HRESULT WINAPI FileAsyncReaderPin_AttemptConnection(struct strmbase_source *This,
IPin *pReceivePin, const AM_MEDIA_TYPE *pmt)
{
- AsyncReader *filter = impl_from_strmbase_pin(&This->pin);
+ struct async_reader *filter = impl_from_strmbase_pin(&This->pin);
HRESULT hr;
TRACE("%p->(%p, %p)\n", This, pReceivePin, pmt);
@@ -649,26 +646,26 @@ static const struct strmbase_source_ops source_ops =
static HRESULT WINAPI FileAsyncReader_QueryInterface(IAsyncReader *iface, REFIID iid, void **out)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out);
}
static ULONG WINAPI FileAsyncReader_AddRef(IAsyncReader * iface)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
return IPin_AddRef(&filter->source.pin.IPin_iface);
}
static ULONG WINAPI FileAsyncReader_Release(IAsyncReader * iface)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
return IPin_Release(&filter->source.pin.IPin_iface);
}
static HRESULT WINAPI FileAsyncReader_RequestAllocator(IAsyncReader *iface,
IMemAllocator *preferred, ALLOCATOR_PROPERTIES *props, IMemAllocator **ret_allocator)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
IMemAllocator *allocator;
unsigned int i;
HRESULT hr;
@@ -716,7 +713,7 @@ static HRESULT WINAPI FileAsyncReader_RequestAllocator(IAsyncReader *iface,
static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader *iface, IMediaSample *sample, DWORD_PTR cookie)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
REFERENCE_TIME start, end;
struct request *req;
unsigned int i;
@@ -770,7 +767,7 @@ static HRESULT WINAPI FileAsyncReader_Request(IAsyncReader *iface, IMediaSample
static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader *iface,
DWORD timeout, IMediaSample **sample, DWORD_PTR *cookie)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
unsigned int i;
TRACE("filter %p, timeout %u, sample %p, cookie %p.\n", filter, timeout, sample, cookie);
@@ -840,7 +837,7 @@ static BOOL sync_read(HANDLE file, LONGLONG offset, LONG length, BYTE *buffer, D
static HRESULT WINAPI FileAsyncReader_SyncReadAligned(IAsyncReader *iface, IMediaSample *sample)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
REFERENCE_TIME start_time, end_time;
DWORD read_len;
BYTE *buffer;
@@ -876,7 +873,7 @@ static HRESULT WINAPI FileAsyncReader_SyncReadAligned(IAsyncReader *iface, IMedi
static HRESULT WINAPI FileAsyncReader_SyncRead(IAsyncReader *iface,
LONGLONG offset, LONG length, BYTE *buffer)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
DWORD read_len;
HRESULT hr;
BOOL ret;
@@ -897,7 +894,7 @@ static HRESULT WINAPI FileAsyncReader_SyncRead(IAsyncReader *iface,
static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader *iface, LONGLONG *total, LONGLONG *available)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
DWORD low, high;
TRACE("iface %p, total %p, available %p.\n", iface, total, available);
@@ -912,7 +909,7 @@ static HRESULT WINAPI FileAsyncReader_Length(IAsyncReader *iface, LONGLONG *tota
static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
unsigned int i;
TRACE("iface %p.\n", iface);
@@ -932,7 +929,7 @@ static HRESULT WINAPI FileAsyncReader_BeginFlush(IAsyncReader * iface)
static HRESULT WINAPI FileAsyncReader_EndFlush(IAsyncReader * iface)
{
- AsyncReader *filter = impl_from_IAsyncReader(iface);
+ struct async_reader *filter = impl_from_IAsyncReader(iface);
TRACE("iface %p.\n", iface);
--
2.26.0