Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- include/mfidl.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/mfidl.idl b/include/mfidl.idl index 22a22a8535..ac59e0cb69 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -525,6 +525,26 @@ interface IMFMediaSource : IMFMediaEventGenerator HRESULT Shutdown(); }
+[ + object, + uuid(d182108f-4ec6-443f-aa42-a71106ec825f), +] +interface IMFMediaStream : IMFMediaEventGenerator +{ + HRESULT GetMediaSource( + [out] IMFMediaSource **source); + + HRESULT GetStreamDescriptor( + [out] IMFStreamDescriptor **descriptor); + + [local] + HRESULT RequestSample( + [in] IUnknown *token); + + [call_as(RequestSample)] + HRESULT RemoteRequestSample(); +} + interface IMFStreamSink;
[
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index c6cf4717ec..4444e49d81 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -4259,6 +4259,7 @@ struct resolver_queued_result IUnknown *object; MF_OBJECT_TYPE obj_type; HRESULT hr; + IMFAsyncResult *inner_result; enum resolved_object_origin origin; };
@@ -4313,7 +4314,7 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu IMFSchemeHandler *scheme_handler; } handler;
- queued_result = heap_alloc(sizeof(*queued_result)); + queued_result = heap_alloc_zero(sizeof(*queued_result));
IMFAsyncResult_GetObject(inner_result, &handler.handler);
@@ -4337,6 +4338,12 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu { MFASYNCRESULT *data = (MFASYNCRESULT *)inner_result;
+ if (data->hEvent) + { + queued_result->inner_result = inner_result; + IMFAsyncResult_AddRef(queued_result->inner_result); + } + /* Push resolved object type and created object, so we don't have to guess on End*() call. */ EnterCriticalSection(&resolver->cs); list_add_tail(&resolver->pending, &queued_result->entry); @@ -4687,7 +4694,7 @@ static HRESULT resolver_end_create_object(struct source_resolver *resolver, enum
LIST_FOR_EACH_ENTRY(iter, &resolver->pending, struct resolver_queued_result, entry) { - if (iter->object == object && iter->origin == origin) + if (iter->inner_result == result || (iter->object == object && iter->origin == origin)) { list_remove(&iter->entry); queued_result = iter; @@ -4704,6 +4711,8 @@ static HRESULT resolver_end_create_object(struct source_resolver *resolver, enum *out = queued_result->object; *obj_type = queued_result->obj_type; hr = queued_result->hr; + if (queued_result->inner_result) + IMFAsyncResult_Release(queued_result->inner_result); heap_free(queued_result); } else
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 4444e49d81..d800474331 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -4802,7 +4802,7 @@ static HRESULT WINAPI source_resolver_CreateObjectFromURL(IMFSourceResolver *ifa data = (MFASYNCRESULT *)result; data->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
- hr = IMFSchemeHandler_BeginCreateObject(handler, url, flags, props, NULL, &resolver->stream_callback, + hr = IMFSchemeHandler_BeginCreateObject(handler, url, flags, props, NULL, &resolver->url_callback, (IUnknown *)result); if (FAILED(hr)) {
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
This makes it easier to see what's going on with media types, next step will be to get rid of duplicated traces from inner attributes object, at least for implementations residing in mfplat.dll.
dlls/mfplat/main.c | 2 +- dlls/mfplat/mediatype.c | 101 +++++++++++++++++++++++++++++++++-- dlls/mfplat/mfplat_private.h | 1 + 3 files changed, 98 insertions(+), 6 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index d800474331..03de81cd7b 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -550,7 +550,7 @@ static int debug_compare_guid(const void *a, const void *b) return memcmp(guid, guid_def->guid, sizeof(*guid)); }
-static const char *debugstr_attr(const GUID *guid) +const char *debugstr_attr(const GUID *guid) { static const struct guid_def guid_defs[] = { diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 2c2c83e8de..dddea4ba1b 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -126,18 +126,27 @@ static ULONG WINAPI mediatype_Release(IMFMediaType *iface) static HRESULT WINAPI mediatype_GetItem(IMFMediaType *iface, REFGUID key, PROPVARIANT *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_GetItem(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_GetItemType(IMFMediaType *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type); + return IMFAttributes_GetItemType(&media_type->attributes.IMFAttributes_iface, key, type); }
static HRESULT WINAPI mediatype_CompareItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + return IMFAttributes_CompareItem(&media_type->attributes.IMFAttributes_iface, key, value, result); }
@@ -145,36 +154,54 @@ static HRESULT WINAPI mediatype_Compare(IMFMediaType *iface, IMFAttributes *attr BOOL *result) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %p, %d, %p.\n", iface, attrs, type, result); + return IMFAttributes_Compare(&media_type->attributes.IMFAttributes_iface, attrs, type, result); }
static HRESULT WINAPI mediatype_GetUINT32(IMFMediaType *iface, REFGUID key, UINT32 *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_GetUINT32(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_GetUINT64(IMFMediaType *iface, REFGUID key, UINT64 *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_GetUINT64(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_GetDouble(IMFMediaType *iface, REFGUID key, double *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_GetDouble(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_GetGUID(IMFMediaType *iface, REFGUID key, GUID *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_GetGUID(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_GetStringLength(IMFMediaType *iface, REFGUID key, UINT32 *length) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length); + return IMFAttributes_GetStringLength(&media_type->attributes.IMFAttributes_iface, key, length); }
@@ -182,6 +209,9 @@ static HRESULT WINAPI mediatype_GetString(IMFMediaType *iface, REFGUID key, WCHA UINT32 size, UINT32 *length) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_attr(key), value, size, length); + return IMFAttributes_GetString(&media_type->attributes.IMFAttributes_iface, key, value, size, length); }
@@ -189,12 +219,18 @@ static HRESULT WINAPI mediatype_GetAllocatedString(IMFMediaType *iface, REFGUID WCHAR **value, UINT32 *length) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length); + return IMFAttributes_GetAllocatedString(&media_type->attributes.IMFAttributes_iface, key, value, length); }
static HRESULT WINAPI mediatype_GetBlobSize(IMFMediaType *iface, REFGUID key, UINT32 *size) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); + return IMFAttributes_GetBlobSize(&media_type->attributes.IMFAttributes_iface, key, size); }
@@ -202,108 +238,162 @@ static HRESULT WINAPI mediatype_GetBlob(IMFMediaType *iface, REFGUID key, UINT8 UINT32 bufsize, UINT32 *blobsize) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + return IMFAttributes_GetBlob(&media_type->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize); }
static HRESULT WINAPI mediatype_GetAllocatedBlob(IMFMediaType *iface, REFGUID key, UINT8 **buf, UINT32 *size) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + return IMFAttributes_GetAllocatedBlob(&media_type->attributes.IMFAttributes_iface, key, buf, size); }
-static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REFIID riid, void **ppv) +static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REFIID riid, void **obj) { struct media_type *media_type = impl_from_IMFMediaType(iface); - return IMFAttributes_GetUnknown(&media_type->attributes.IMFAttributes_iface, key, riid, ppv); + + TRACE("%p, %s, %s, %p.\n", iface, debugstr_attr(key), debugstr_guid(riid), obj); + + return IMFAttributes_GetUnknown(&media_type->attributes.IMFAttributes_iface, key, riid, obj); }
static HRESULT WINAPI mediatype_SetItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + return IMFAttributes_SetItem(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_DeleteItem(IMFMediaType *iface, REFGUID key) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s.\n", iface, debugstr_attr(key)); + return IMFAttributes_DeleteItem(&media_type->attributes.IMFAttributes_iface, key); }
static HRESULT WINAPI mediatype_DeleteAllItems(IMFMediaType *iface) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p.\n", iface); + return IMFAttributes_DeleteAllItems(&media_type->attributes.IMFAttributes_iface); }
static HRESULT WINAPI mediatype_SetUINT32(IMFMediaType *iface, REFGUID key, UINT32 value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %u.\n", iface, debugstr_attr(key), value); + return IMFAttributes_SetUINT32(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_SetUINT64(IMFMediaType *iface, REFGUID key, UINT64 value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value)); + return IMFAttributes_SetUINT64(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_SetDouble(IMFMediaType *iface, REFGUID key, double value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value); + return IMFAttributes_SetDouble(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_SetGUID(IMFMediaType *iface, REFGUID key, REFGUID value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value)); + return IMFAttributes_SetGUID(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_SetString(IMFMediaType *iface, REFGUID key, const WCHAR *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value)); + return IMFAttributes_SetString(&media_type->attributes.IMFAttributes_iface, key, value); }
static HRESULT WINAPI mediatype_SetBlob(IMFMediaType *iface, REFGUID key, const UINT8 *buf, UINT32 size) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + return IMFAttributes_SetBlob(&media_type->attributes.IMFAttributes_iface, key, buf, size); }
static HRESULT WINAPI mediatype_SetUnknown(IMFMediaType *iface, REFGUID key, IUnknown *unknown) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown); + return IMFAttributes_SetUnknown(&media_type->attributes.IMFAttributes_iface, key, unknown); }
static HRESULT WINAPI mediatype_LockStore(IMFMediaType *iface) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p.\n", iface); + return IMFAttributes_LockStore(&media_type->attributes.IMFAttributes_iface); }
static HRESULT WINAPI mediatype_UnlockStore(IMFMediaType *iface) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p.\n", iface); + return IMFAttributes_UnlockStore(&media_type->attributes.IMFAttributes_iface); }
-static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *items) +static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *count) { struct media_type *media_type = impl_from_IMFMediaType(iface); - return IMFAttributes_GetCount(&media_type->attributes.IMFAttributes_iface, items); + + TRACE("%p, %p.\n", iface, count); + + return IMFAttributes_GetCount(&media_type->attributes.IMFAttributes_iface, count); }
static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index, GUID *key, PROPVARIANT *value) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %u, %p, %p.\n", iface, index, key, value); + return IMFAttributes_GetItemByIndex(&media_type->attributes.IMFAttributes_iface, index, key, value); }
static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest) { struct media_type *media_type = impl_from_IMFMediaType(iface); + + TRACE("%p, %p.\n", iface, dest); + return IMFAttributes_CopyAllItems(&media_type->attributes.IMFAttributes_iface, dest); }
@@ -518,10 +608,11 @@ HRESULT WINAPI MFCreateMediaType(IMFMediaType **media_type)
*media_type = &object->IMFMediaType_iface;
+ TRACE("Created media type %p.\n", *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); diff --git a/dlls/mfplat/mfplat_private.h b/dlls/mfplat/mfplat_private.h index b3ed1764b2..18c9cc0157 100644 --- a/dlls/mfplat/mfplat_private.h +++ b/dlls/mfplat/mfplat_private.h @@ -42,6 +42,7 @@ struct attributes
extern HRESULT init_attributes_object(struct attributes *object, UINT32 size) DECLSPEC_HIDDEN; extern void clear_attributes_object(struct attributes *object) DECLSPEC_HIDDEN; +extern const char *debugstr_attr(const GUID *guid) DECLSPEC_HIDDEN;
extern void init_system_queues(void) DECLSPEC_HIDDEN; extern void shutdown_system_queues(void) DECLSPEC_HIDDEN;