[v2 PATCH 6/9] mfplat: Move stream descriptor implementation to separate file.
Nikolay Sivov
nsivov at codeweavers.com
Mon Mar 4 04:33:46 CST 2019
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/mfplat/main.c | 323 -----------------------------------
dlls/mfplat/mediatype.c | 316 ++++++++++++++++++++++++++++++++++
dlls/mfplat/mfplat_private.h | 1 +
3 files changed, 317 insertions(+), 323 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 7d90c69418..743d5bdacd 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -28,7 +28,6 @@
#include "winreg.h"
#include "initguid.h"
-#include "mfidl.h"
#include "mferror.h"
#include "wine/heap.h"
@@ -2800,328 +2799,6 @@ HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue)
return S_OK;
}
-typedef struct _mfdescriptor
-{
- mfattributes attributes;
- IMFStreamDescriptor IMFStreamDescriptor_iface;
-} mfdescriptor;
-
-static inline mfdescriptor *impl_from_IMFStreamDescriptor(IMFStreamDescriptor *iface)
-{
- return CONTAINING_RECORD(iface, mfdescriptor, IMFStreamDescriptor_iface);
-}
-
-static HRESULT WINAPI mfdescriptor_QueryInterface(IMFStreamDescriptor *iface, REFIID riid, void **out)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
-
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
-
- if(IsEqualGUID(riid, &IID_IUnknown) ||
- IsEqualGUID(riid, &IID_IMFAttributes) ||
- IsEqualGUID(riid, &IID_IMFStreamDescriptor))
- {
- *out = &This->IMFStreamDescriptor_iface;
- }
- else
- {
- FIXME("(%s, %p)\n", debugstr_guid(riid), out);
- *out = NULL;
- return E_NOINTERFACE;
- }
-
- IUnknown_AddRef((IUnknown*)*out);
- return S_OK;
-}
-
-static ULONG WINAPI mfdescriptor_AddRef(IMFStreamDescriptor *iface)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- ULONG ref = InterlockedIncrement(&This->attributes.ref);
-
- TRACE("(%p) ref=%u\n", This, ref);
-
- return ref;
-}
-
-static ULONG WINAPI mfdescriptor_Release(IMFStreamDescriptor *iface)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- ULONG ref = InterlockedDecrement(&This->attributes.ref);
-
- TRACE("(%p) ref=%u\n", This, ref);
-
- if (!ref)
- {
- heap_free(This);
- }
-
- return ref;
-}
-
-static HRESULT WINAPI mfdescriptor_GetItem(IMFStreamDescriptor *iface, REFGUID key, PROPVARIANT *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetItem(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_GetItemType(IMFStreamDescriptor *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetItemType(&This->attributes.IMFAttributes_iface, key, type);
-}
-
-static HRESULT WINAPI mfdescriptor_CompareItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_CompareItem(&This->attributes.IMFAttributes_iface, key, value, result);
-}
-
-static HRESULT WINAPI mfdescriptor_Compare(IMFStreamDescriptor *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
- BOOL *result)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_Compare(&This->attributes.IMFAttributes_iface, theirs, type, result);
-}
-
-static HRESULT WINAPI mfdescriptor_GetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetUINT32(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_GetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetUINT64(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_GetDouble(IMFStreamDescriptor *iface, REFGUID key, double *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetDouble(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_GetGUID(IMFStreamDescriptor *iface, REFGUID key, GUID *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetGUID(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_GetStringLength(IMFStreamDescriptor *iface, REFGUID key, UINT32 *length)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetStringLength(&This->attributes.IMFAttributes_iface, key, length);
-}
-
-static HRESULT WINAPI mfdescriptor_GetString(IMFStreamDescriptor *iface, REFGUID key, WCHAR *value,
- UINT32 size, UINT32 *length)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetString(&This->attributes.IMFAttributes_iface, key, value, size, length);
-}
-
-static HRESULT WINAPI mfdescriptor_GetAllocatedString(IMFStreamDescriptor *iface, REFGUID key,
- WCHAR **value, UINT32 *length)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetAllocatedString(&This->attributes.IMFAttributes_iface, key, value, length);
-}
-
-static HRESULT WINAPI mfdescriptor_GetBlobSize(IMFStreamDescriptor *iface, REFGUID key, UINT32 *size)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetBlobSize(&This->attributes.IMFAttributes_iface, key, size);
-}
-
-static HRESULT WINAPI mfdescriptor_GetBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 *buf,
- UINT32 bufsize, UINT32 *blobsize)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetBlob(&This->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize);
-}
-
-static HRESULT WINAPI mfdescriptor_GetAllocatedBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 **buf, UINT32 *size)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetAllocatedBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
-}
-
-static HRESULT WINAPI mfdescriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **ppv)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetUnknown(&This->attributes.IMFAttributes_iface, key, riid, ppv);
-}
-
-static HRESULT WINAPI mfdescriptor_SetItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetItem(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_DeleteItem(IMFStreamDescriptor *iface, REFGUID key)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_DeleteItem(&This->attributes.IMFAttributes_iface, key);
-}
-
-static HRESULT WINAPI mfdescriptor_DeleteAllItems(IMFStreamDescriptor *iface)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_DeleteAllItems(&This->attributes.IMFAttributes_iface);
-}
-
-static HRESULT WINAPI mfdescriptor_SetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetUINT32(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_SetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetUINT64(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_SetDouble(IMFStreamDescriptor *iface, REFGUID key, double value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetDouble(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_SetGUID(IMFStreamDescriptor *iface, REFGUID key, REFGUID value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetGUID(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_SetString(IMFStreamDescriptor *iface, REFGUID key, const WCHAR *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetString(&This->attributes.IMFAttributes_iface, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_SetBlob(IMFStreamDescriptor *iface, REFGUID key, const UINT8 *buf, UINT32 size)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
-}
-
-static HRESULT WINAPI mfdescriptor_SetUnknown(IMFStreamDescriptor *iface, REFGUID key, IUnknown *unknown)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_SetUnknown(&This->attributes.IMFAttributes_iface, key, unknown);
-}
-
-static HRESULT WINAPI mfdescriptor_LockStore(IMFStreamDescriptor *iface)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_LockStore(&This->attributes.IMFAttributes_iface);
-}
-
-static HRESULT WINAPI mfdescriptor_UnlockStore(IMFStreamDescriptor *iface)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_UnlockStore(&This->attributes.IMFAttributes_iface);
-}
-
-static HRESULT WINAPI mfdescriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *items)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetCount(&This->attributes.IMFAttributes_iface, items);
-}
-
-static HRESULT WINAPI mfdescriptor_GetItemByIndex(IMFStreamDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
- return IMFAttributes_GetItemByIndex(&This->attributes.IMFAttributes_iface, index, key, value);
-}
-
-static HRESULT WINAPI mfdescriptor_CopyAllItems(IMFStreamDescriptor *iface, IMFAttributes *dest)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
-
- FIXME("%p, %p\n", This, dest);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI mfdescriptor_GetStreamIdentifier(IMFStreamDescriptor *iface, DWORD *identifier)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
-
- FIXME("%p, %p\n", This, identifier);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI mfdescriptor_GetMediaTypeHandler(IMFStreamDescriptor *iface, IMFMediaTypeHandler **handler)
-{
- mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
-
- FIXME("%p, %p\n", This, handler);
-
- return E_NOTIMPL;
-}
-
-static const IMFStreamDescriptorVtbl mfdescriptor_vtbl =
-{
- mfdescriptor_QueryInterface,
- mfdescriptor_AddRef,
- mfdescriptor_Release,
- mfdescriptor_GetItem,
- mfdescriptor_GetItemType,
- mfdescriptor_CompareItem,
- mfdescriptor_Compare,
- mfdescriptor_GetUINT32,
- mfdescriptor_GetUINT64,
- mfdescriptor_GetDouble,
- mfdescriptor_GetGUID,
- mfdescriptor_GetStringLength,
- mfdescriptor_GetString,
- mfdescriptor_GetAllocatedString,
- mfdescriptor_GetBlobSize,
- mfdescriptor_GetBlob,
- mfdescriptor_GetAllocatedBlob,
- mfdescriptor_GetUnknown,
- mfdescriptor_SetItem,
- mfdescriptor_DeleteItem,
- mfdescriptor_DeleteAllItems,
- mfdescriptor_SetUINT32,
- mfdescriptor_SetUINT64,
- mfdescriptor_SetDouble,
- mfdescriptor_SetGUID,
- mfdescriptor_SetString,
- mfdescriptor_SetBlob,
- mfdescriptor_SetUnknown,
- mfdescriptor_LockStore,
- mfdescriptor_UnlockStore,
- mfdescriptor_GetCount,
- mfdescriptor_GetItemByIndex,
- mfdescriptor_CopyAllItems,
- mfdescriptor_GetStreamIdentifier,
- mfdescriptor_GetMediaTypeHandler
-};
-
-HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD count,
- IMFMediaType **types, IMFStreamDescriptor **descriptor)
-{
- mfdescriptor *object;
-
- TRACE("%d, %d, %p, %p\n", identifier, count, types, descriptor);
-
- object = heap_alloc(sizeof(*object));
- if(!object)
- return E_OUTOFMEMORY;
-
- init_attribute_object(&object->attributes, 0);
- object->IMFStreamDescriptor_iface.lpVtbl = &mfdescriptor_vtbl;
- *descriptor = &object->IMFStreamDescriptor_iface;
-
- return S_OK;
-}
-
-
typedef struct _mfbuffer
{
IMFMediaBuffer IMFMediaBuffer_iface;
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c
index b3292a61fe..11f5eab8d4 100644
--- a/dlls/mfplat/mediatype.c
+++ b/dlls/mfplat/mediatype.c
@@ -31,11 +31,22 @@ struct media_type
IMFMediaType IMFMediaType_iface;
};
+struct stream_desc
+{
+ struct attributes attributes;
+ IMFStreamDescriptor IMFStreamDescriptor_iface;
+};
+
static inline struct media_type *impl_from_IMFMediaType(IMFMediaType *iface)
{
return CONTAINING_RECORD(iface, struct media_type, IMFMediaType_iface);
}
+static inline struct stream_desc *impl_from_IMFStreamDescriptor(IMFStreamDescriptor *iface)
+{
+ return CONTAINING_RECORD(iface, struct stream_desc, IMFStreamDescriptor_iface);
+}
+
static HRESULT WINAPI mediatype_QueryInterface(IMFMediaType *iface, REFIID riid, void **out)
{
TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
@@ -364,3 +375,308 @@ HRESULT WINAPI MFCreateMediaType(IMFMediaType **media_type)
return S_OK;
}
+
+
+static HRESULT WINAPI stream_descriptor_QueryInterface(IMFStreamDescriptor *iface, REFIID riid, void **out)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
+
+ if (IsEqualIID(riid, &IID_IMFStreamDescriptor) ||
+ IsEqualIID(riid, &IID_IMFAttributes) ||
+ IsEqualIID(riid, &IID_IUnknown))
+ {
+ *out = iface;
+ IMFStreamDescriptor_AddRef(iface);
+ return S_OK;
+ }
+
+ WARN("Unsupported %s.\n", debugstr_guid(riid));
+ *out = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI stream_descriptor_AddRef(IMFStreamDescriptor *iface)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ ULONG refcount = InterlockedIncrement(&stream_desc->attributes.ref);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI stream_descriptor_Release(IMFStreamDescriptor *iface)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ ULONG refcount = InterlockedDecrement(&stream_desc->attributes.ref);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ if (!refcount)
+ {
+ heap_free(stream_desc);
+ }
+
+ return refcount;
+}
+
+static HRESULT WINAPI stream_descriptor_GetItem(IMFStreamDescriptor *iface, REFGUID key, PROPVARIANT *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetItem(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_GetItemType(IMFStreamDescriptor *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetItemType(&stream_desc->attributes.IMFAttributes_iface, key, type);
+}
+
+static HRESULT WINAPI stream_descriptor_CompareItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value,
+ BOOL *result)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_CompareItem(&stream_desc->attributes.IMFAttributes_iface, key, value, result);
+}
+
+static HRESULT WINAPI stream_descriptor_Compare(IMFStreamDescriptor *iface, IMFAttributes *theirs,
+ MF_ATTRIBUTES_MATCH_TYPE type, BOOL *result)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_Compare(&stream_desc->attributes.IMFAttributes_iface, theirs, type, result);
+}
+
+static HRESULT WINAPI stream_descriptor_GetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetUINT32(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_GetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetUINT64(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_GetDouble(IMFStreamDescriptor *iface, REFGUID key, double *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetDouble(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_GetGUID(IMFStreamDescriptor *iface, REFGUID key, GUID *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetGUID(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_GetStringLength(IMFStreamDescriptor *iface, REFGUID key, UINT32 *length)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetStringLength(&stream_desc->attributes.IMFAttributes_iface, key, length);
+}
+
+static HRESULT WINAPI stream_descriptor_GetString(IMFStreamDescriptor *iface, REFGUID key, WCHAR *value,
+ UINT32 size, UINT32 *length)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetString(&stream_desc->attributes.IMFAttributes_iface, key, value, size, length);
+}
+
+static HRESULT WINAPI stream_descriptor_GetAllocatedString(IMFStreamDescriptor *iface, REFGUID key,
+ WCHAR **value, UINT32 *length)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetAllocatedString(&stream_desc->attributes.IMFAttributes_iface, key, value, length);
+}
+
+static HRESULT WINAPI stream_descriptor_GetBlobSize(IMFStreamDescriptor *iface, REFGUID key, UINT32 *size)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetBlobSize(&stream_desc->attributes.IMFAttributes_iface, key, size);
+}
+
+static HRESULT WINAPI stream_descriptor_GetBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 *buf,
+ UINT32 bufsize, UINT32 *blobsize)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetBlob(&stream_desc->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize);
+}
+
+static HRESULT WINAPI stream_descriptor_GetAllocatedBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 **buf,
+ UINT32 *size)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetAllocatedBlob(&stream_desc->attributes.IMFAttributes_iface, key, buf, size);
+}
+
+static HRESULT WINAPI stream_descriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **ppv)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetUnknown(&stream_desc->attributes.IMFAttributes_iface, key, riid, ppv);
+}
+
+static HRESULT WINAPI stream_descriptor_SetItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetItem(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_DeleteItem(IMFStreamDescriptor *iface, REFGUID key)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_DeleteItem(&stream_desc->attributes.IMFAttributes_iface, key);
+}
+
+static HRESULT WINAPI stream_descriptor_DeleteAllItems(IMFStreamDescriptor *iface)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_DeleteAllItems(&stream_desc->attributes.IMFAttributes_iface);
+}
+
+static HRESULT WINAPI stream_descriptor_SetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetUINT32(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_SetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetUINT64(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_SetDouble(IMFStreamDescriptor *iface, REFGUID key, double value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetDouble(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_SetGUID(IMFStreamDescriptor *iface, REFGUID key, REFGUID value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetGUID(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_SetString(IMFStreamDescriptor *iface, REFGUID key, const WCHAR *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetString(&stream_desc->attributes.IMFAttributes_iface, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_SetBlob(IMFStreamDescriptor *iface, REFGUID key, const UINT8 *buf, UINT32 size)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetBlob(&stream_desc->attributes.IMFAttributes_iface, key, buf, size);
+}
+
+static HRESULT WINAPI stream_descriptor_SetUnknown(IMFStreamDescriptor *iface, REFGUID key, IUnknown *unknown)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_SetUnknown(&stream_desc->attributes.IMFAttributes_iface, key, unknown);
+}
+
+static HRESULT WINAPI stream_descriptor_LockStore(IMFStreamDescriptor *iface)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_LockStore(&stream_desc->attributes.IMFAttributes_iface);
+}
+
+static HRESULT WINAPI stream_descriptor_UnlockStore(IMFStreamDescriptor *iface)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_UnlockStore(&stream_desc->attributes.IMFAttributes_iface);
+}
+
+static HRESULT WINAPI stream_descriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *items)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetCount(&stream_desc->attributes.IMFAttributes_iface, items);
+}
+
+static HRESULT WINAPI stream_descriptor_GetItemByIndex(IMFStreamDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value)
+{
+ struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface);
+ return IMFAttributes_GetItemByIndex(&stream_desc->attributes.IMFAttributes_iface, index, key, value);
+}
+
+static HRESULT WINAPI stream_descriptor_CopyAllItems(IMFStreamDescriptor *iface, IMFAttributes *dest)
+{
+ FIXME("%p, %p.\n", iface, dest);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI stream_descriptor_GetStreamIdentifier(IMFStreamDescriptor *iface, DWORD *identifier)
+{
+ FIXME("%p, %p.\n", iface, identifier);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI stream_descriptor_GetMediaTypeHandler(IMFStreamDescriptor *iface, IMFMediaTypeHandler **handler)
+{
+ FIXME("%p, %p.\n", iface, handler);
+
+ return E_NOTIMPL;
+}
+
+static const IMFStreamDescriptorVtbl streamdescriptorvtbl =
+{
+ stream_descriptor_QueryInterface,
+ stream_descriptor_AddRef,
+ stream_descriptor_Release,
+ stream_descriptor_GetItem,
+ stream_descriptor_GetItemType,
+ stream_descriptor_CompareItem,
+ stream_descriptor_Compare,
+ stream_descriptor_GetUINT32,
+ stream_descriptor_GetUINT64,
+ stream_descriptor_GetDouble,
+ stream_descriptor_GetGUID,
+ stream_descriptor_GetStringLength,
+ stream_descriptor_GetString,
+ stream_descriptor_GetAllocatedString,
+ stream_descriptor_GetBlobSize,
+ stream_descriptor_GetBlob,
+ stream_descriptor_GetAllocatedBlob,
+ stream_descriptor_GetUnknown,
+ stream_descriptor_SetItem,
+ stream_descriptor_DeleteItem,
+ stream_descriptor_DeleteAllItems,
+ stream_descriptor_SetUINT32,
+ stream_descriptor_SetUINT64,
+ stream_descriptor_SetDouble,
+ stream_descriptor_SetGUID,
+ stream_descriptor_SetString,
+ stream_descriptor_SetBlob,
+ stream_descriptor_SetUnknown,
+ stream_descriptor_LockStore,
+ stream_descriptor_UnlockStore,
+ stream_descriptor_GetCount,
+ stream_descriptor_GetItemByIndex,
+ stream_descriptor_CopyAllItems,
+ stream_descriptor_GetStreamIdentifier,
+ stream_descriptor_GetMediaTypeHandler
+};
+
+/***********************************************************************
+ * MFCreateStreamDescriptor (mfplat.@)
+ */
+HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD count,
+ IMFMediaType **types, IMFStreamDescriptor **descriptor)
+{
+ struct stream_desc *object;
+
+ TRACE("%d, %d, %p, %p.\n", identifier, count, types, descriptor);
+
+ object = heap_alloc(sizeof(*object));
+ if (!object)
+ return E_OUTOFMEMORY;
+
+ init_attribute_object(&object->attributes, 0);
+ object->IMFStreamDescriptor_iface.lpVtbl = &streamdescriptorvtbl;
+ *descriptor = &object->IMFStreamDescriptor_iface;
+
+ return S_OK;
+}
diff --git a/dlls/mfplat/mfplat_private.h b/dlls/mfplat/mfplat_private.h
index 02bc2d9287..46320bbb50 100644
--- a/dlls/mfplat/mfplat_private.h
+++ b/dlls/mfplat/mfplat_private.h
@@ -17,6 +17,7 @@
*/
#include "mfapi.h"
+#include "mfidl.h"
typedef struct attributes
{
--
2.20.1
More information about the wine-devel
mailing list