Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/mediatype.c | 77 ++++++++++++++++++++++++++++++++++++++ dlls/mfplat/mfplat.spec | 2 +- dlls/mfplat/tests/mfplat.c | 67 +++++++++++++++++++++++++++++++++ include/mfapi.h | 7 ++++ 4 files changed, 152 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index dddea4ba1b..6a8bd97557 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -20,6 +20,10 @@
#include "mfplat_private.h"
+#include "initguid.h" +#include "ks.h" +#include "ksmedia.h" + #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mfplat); @@ -1679,3 +1683,76 @@ HRESULT WINAPI MFUnwrapMediaType(IMFMediaType *wrapper, IMFMediaType **ret)
return S_OK; } + +/*********************************************************************** + * MFCreateWaveFormatExFromMFMediaType (mfplat.@) + */ +HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *mediatype, WAVEFORMATEX **ret_format, + UINT32 *size, UINT32 flags) +{ + WAVEFORMATEXTENSIBLE *format_ext = NULL; + WAVEFORMATEX *format; + GUID major, subtype; + UINT32 value; + HRESULT hr; + + TRACE("%p, %p, %p, %#x.\n", mediatype, ret_format, size, flags); + + if (FAILED(hr = IMFMediaType_GetGUID(mediatype, &MF_MT_MAJOR_TYPE, &major))) + return hr; + + if (FAILED(hr = IMFMediaType_GetGUID(mediatype, &MF_MT_SUBTYPE, &subtype))) + return hr; + + if (!IsEqualGUID(&major, &MFMediaType_Audio)) + return E_INVALIDARG; + + if (!IsEqualGUID(&subtype, &MFAudioFormat_PCM)) + { + FIXME("Unsupported audio format %s.\n", debugstr_guid(&subtype)); + return E_NOTIMPL; + } + + /* FIXME: probably WAVE_FORMAT_MPEG/WAVE_FORMAT_MPEGLAYER3 should be handled separately. */ + if (flags == MFWaveFormatExConvertFlag_ForceExtensible) + { + format_ext = CoTaskMemAlloc(sizeof(*format_ext)); + *size = sizeof(*format_ext); + format = (WAVEFORMATEX *)format_ext; + } + else + { + format = CoTaskMemAlloc(sizeof(*format)); + *size = sizeof(*format); + } + + if (!format) + return E_OUTOFMEMORY; + + memset(format, 0, *size); + + format->wFormatTag = format_ext ? WAVE_FORMAT_EXTENSIBLE : WAVE_FORMAT_PCM; + + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_NUM_CHANNELS, &value))) + format->nChannels = value; + IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_SAMPLES_PER_SECOND, &format->nSamplesPerSec); + IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &format->nAvgBytesPerSec); + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &value))) + format->nBlockAlign = value; + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_BITS_PER_SAMPLE, &value))) + format->wBitsPerSample = value; + if (format_ext) + { + format->cbSize = sizeof(*format_ext) - sizeof(*format); + + if (SUCCEEDED(IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, &value))) + format_ext->Samples.wSamplesPerBlock = value; + + IMFMediaType_GetUINT32(mediatype, &MF_MT_AUDIO_CHANNEL_MASK, &format_ext->dwChannelMask); + memcpy(&format_ext->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM, sizeof(format_ext->SubFormat)); + } + + *ret_format = format; + + return S_OK; +} diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec index 1d4035c60e..7823ac0d9e 100644 --- a/dlls/mfplat/mfplat.spec +++ b/dlls/mfplat/mfplat.spec @@ -74,7 +74,7 @@ @ stub MFCreateVideoMediaTypeFromSubtype @ stub MFCreateVideoMediaTypeFromVideoInfoHeader2 @ stub MFCreateVideoMediaTypeFromVideoInfoHeader -@ stub MFCreateWaveFormatExFromMFMediaType +@ stdcall MFCreateWaveFormatExFromMFMediaType(ptr ptr ptr long) @ stub MFDeserializeAttributesFromStream @ stub MFDeserializeEvent @ stub MFDeserializeMediaTypeFromStream diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f62136f4ad..f081d976d7 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -2744,6 +2744,72 @@ static void test_wrapped_media_type(void) IMFMediaType_Release(mediatype2); }
+static void test_MFCreateWaveFormatExFromMFMediaType(void) +{ + WAVEFORMATEXTENSIBLE *format_ext; + IMFMediaType *mediatype; + WAVEFORMATEX *format; + UINT32 size; + HRESULT hr; + + hr = MFCreateMediaType(&mediatype); + ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Video); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); + ok(hr == MF_E_ATTRIBUTENOTFOUND, "Unexpected hr %#x.\n", hr); + + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFMediaType_Video); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + /* Audio/PCM */ + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + hr = IMFMediaType_SetGUID(mediatype, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_Normal); + ok(hr == S_OK, "Failed to create format, hr %#x.\n", hr); + ok(format != NULL, "Expected format structure.\n"); + ok(size == sizeof(*format), "Unexpected size %u.\n", size); + ok(format->wFormatTag == WAVE_FORMAT_PCM, "Unexpected tag.\n"); + ok(format->nChannels == 0, "Unexpected number of channels, %u.\n", format->nChannels); + ok(format->nSamplesPerSec == 0, "Unexpected sample rate, %u.\n", format->nSamplesPerSec); + ok(format->nAvgBytesPerSec == 0, "Unexpected average data rate rate, %u.\n", format->nAvgBytesPerSec); + ok(format->nBlockAlign == 0, "Unexpected alignment, %u.\n", format->nBlockAlign); + ok(format->wBitsPerSample == 0, "Unexpected sample size, %u.\n", format->wBitsPerSample); + ok(format->cbSize == 0, "Unexpected size field, %u.\n", format->cbSize); + CoTaskMemFree(format); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, (WAVEFORMATEX **)&format_ext, &size, + MFWaveFormatExConvertFlag_ForceExtensible); + ok(hr == S_OK, "Failed to create format, hr %#x.\n", hr); + ok(format_ext != NULL, "Expected format structure.\n"); + ok(size == sizeof(*format_ext), "Unexpected size %u.\n", size); + ok(format_ext->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE, "Unexpected tag.\n"); + ok(format_ext->Format.nChannels == 0, "Unexpected number of channels, %u.\n", format_ext->Format.nChannels); + ok(format_ext->Format.nSamplesPerSec == 0, "Unexpected sample rate, %u.\n", format_ext->Format.nSamplesPerSec); + ok(format_ext->Format.nAvgBytesPerSec == 0, "Unexpected average data rate rate, %u.\n", + format_ext->Format.nAvgBytesPerSec); + ok(format_ext->Format.nBlockAlign == 0, "Unexpected alignment, %u.\n", format_ext->Format.nBlockAlign); + ok(format_ext->Format.wBitsPerSample == 0, "Unexpected sample size, %u.\n", format_ext->Format.wBitsPerSample); + ok(format_ext->Format.cbSize == sizeof(*format_ext) - sizeof(format_ext->Format), "Unexpected size field, %u.\n", + format_ext->Format.cbSize); + CoTaskMemFree(format_ext); + + hr = MFCreateWaveFormatExFromMFMediaType(mediatype, &format, &size, MFWaveFormatExConvertFlag_ForceExtensible + 1); + ok(hr == S_OK, "Failed to create format, hr %#x.\n", hr); + ok(size == sizeof(*format), "Unexpected size %u.\n", size); + CoTaskMemFree(format); + + IMFMediaType_Release(mediatype); +} + START_TEST(mfplat) { CoInitialize(NULL); @@ -2777,6 +2843,7 @@ START_TEST(mfplat) test_MFCompareFullToPartialMediaType(); test_attributes_serialization(); test_wrapped_media_type(); + test_MFCreateWaveFormatExFromMFMediaType();
CoUninitialize(); } diff --git a/include/mfapi.h b/include/mfapi.h index 775a89f240..cee9d403c4 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -344,6 +344,12 @@ typedef void (CALLBACK *MFPERIODICCALLBACK)(IUnknown *context); #define MF_4096_BYTE_ALIGNMENT 0x00000fff #define MF_8192_BYTE_ALIGNMENT 0x00001fff
+typedef enum _MFWaveFormatExConvertFlags +{ + MFWaveFormatExConvertFlag_Normal = 0, + MFWaveFormatExConvertFlag_ForceExtensible = 1, +} MFWaveFormatExConvertFlags; + HRESULT WINAPI MFAddPeriodicCallback(MFPERIODICCALLBACK callback, IUnknown *context, DWORD *key); HRESULT WINAPI MFAllocateWorkQueue(DWORD *queue); HRESULT WINAPI MFAllocateWorkQueueEx(MFASYNC_WORKQUEUE_TYPE queue_type, DWORD *queue); @@ -363,6 +369,7 @@ HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HR HRESULT WINAPI MFCreateMediaType(IMFMediaType **type); HRESULT WINAPI MFCreateSample(IMFSample **sample); HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer); +HRESULT WINAPI MFCreateWaveFormatExFromMFMediaType(IMFMediaType *type, WAVEFORMATEX **format, UINT32 *size, UINT32 flags); void * WINAPI MFHeapAlloc(SIZE_T size, ULONG flags, char *file, int line, EAllocationType type); void WINAPI MFHeapFree(void *ptr); HRESULT WINAPI MFGetAttributesAsBlob(IMFAttributes *attributes, UINT8 *buffer, UINT size);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mferror/mferror.mc | 84 +++++++++++++++++++++++++++++++++++++++++ include/mferror.h | 12 ++++++ 2 files changed, 96 insertions(+)
diff --git a/dlls/mferror/mferror.mc b/dlls/mferror/mferror.mc index 89672c9c31..f0299b0986 100644 --- a/dlls/mferror/mferror.mc +++ b/dlls/mferror/mferror.mc @@ -435,6 +435,20 @@ SymbolicName=MF_E_NO_EVENTS_AVAILABLE Language=ENU No events available. . +MessageId=16002 +Severity=Error +Facility=MF +SymbolicName=MF_E_INVALID_STATE_TRANSITION +Language=ENU +Invalid media source state transition +. +MessageId=16004 +Severity=Error +Facility=MF +SymbolicName=MF_E_END_OF_STREAM +Language=ENU +End of media stream has been reached +. MessageId=16005 Severity=Error Facility=MF @@ -442,6 +456,76 @@ SymbolicName=MF_E_SHUTDOWN Language=ENU Shutdown() was called. . +MessageId=16010 +Severity=Error +Facility=MF +SymbolicName=MF_E_NO_DURATION +Language=ENU +Media stream has no duration set +. +MessageId=16012 +Severity=Error +Facility=MF +SymbolicName=MF_E_INVALID_FORMAT +Language=ENU +Media format was recognized but is invalid +. +MessageId=16013 +Severity=Error +Facility=MF +SymbolicName=MF_E_PROPERTY_NOT_FOUND +Language=ENU +Property wasn't found +. +MessageId=16014 +Severity=Error +Facility=MF +SymbolicName=MF_E_PROPERTY_READ_ONLY +Language=ENU +Property is read-only +. +MessageId=16015 +Severity=Error +Facility=MF +SymbolicName=MF_E_PROPERTY_NOT_ALLOWED +Language=ENU +Property is not allowed +. +MessageId=16017 +Severity=Error +Facility=MF +SymbolicName=MF_E_MEDIA_SOURCE_NOT_STARTED +Language=ENU +Media source is not started +. +MessageId=16024 +Severity=Error +Facility=MF +SymbolicName=MF_E_UNSUPPORTED_FORMAT +Language=ENU +Unsupported media format +. +MessageId=16027 +Severity=Error +Facility=MF +SymbolicName=MF_E_MEDIA_SOURCE_WRONGSTATE +Language=ENU +Media source is in wrong state +. +MessageId=16028 +Severity=Error +Facility=MF +SymbolicName=MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED +Language=ENU +No media streams were selected +. +MessageId=16030 +Severity=Error +Facility=MF +SymbolicName=MF_E_UNSUPPORTED_CHARACTERISTICS +Language=ENU +Unsupported media source characteristics +. MessageId=21006 Severity=Error Facility=MF diff --git a/include/mferror.h b/include/mferror.h index 46d25b6a31..a0acf90f8b 100644 --- a/include/mferror.h +++ b/include/mferror.h @@ -80,7 +80,19 @@ #define MF_E_BYTESTREAM_UNKNOWN_LENGTH _HRESULT_TYPEDEF_(0xc00d36fb) #define MF_E_INVALID_WORKQUEUE _HRESULT_TYPEDEF_(0xc00d36ff) #define MF_E_NO_EVENTS_AVAILABLE _HRESULT_TYPEDEF_(0xc00d3e80) +#define MF_E_INVALID_STATE_TRANSITION _HRESULT_TYPEDEF_(0xc00d3e82) +#define MF_E_END_OF_STREAM _HRESULT_TYPEDEF_(0xc00d3e84) #define MF_E_SHUTDOWN _HRESULT_TYPEDEF_(0xc00d3e85) +#define MF_E_NO_DURATION _HRESULT_TYPEDEF_(0xc00d3e8a) +#define MF_E_INVALID_FORMAT _HRESULT_TYPEDEF_(0xc00d3e8c) +#define MF_E_PROPERTY_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d3e8d) +#define MF_E_PROPERTY_READ_ONLY _HRESULT_TYPEDEF_(0xc00d3e8e) +#define MF_E_PROPERTY_NOT_ALLOWED _HRESULT_TYPEDEF_(0xc00d3e8f) +#define MF_E_MEDIA_SOURCE_NOT_STARTED _HRESULT_TYPEDEF_(0xc00d3e91) +#define MF_E_UNSUPPORTED_FORMAT _HRESULT_TYPEDEF_(0xc00d3e98) +#define MF_E_MEDIA_SOURCE_WRONGSTATE _HRESULT_TYPEDEF_(0xc00d3e9b) +#define MF_E_MEDIA_SOURCE_NO_STREAMS_SELECTED _HRESULT_TYPEDEF_(0xc00d3e9c) +#define MF_E_UNSUPPORTED_CHARACTERISTICS _HRESULT_TYPEDEF_(0xc00d3e9e)
#define MF_E_TOPO_INVALID_OPTIONAL_NODE _HRESULT_TYPEDEF_(0xc00d520e) #define MF_E_TOPO_CANNOT_FIND_DECRYPTOR _HRESULT_TYPEDEF_(0xc00d5211)
Hi,
On 2019-04-01 13:24, Nikolay Sivov wrote:
Shutdown() was called. +Invalid media source state transition
All previous messages end with period but none of these new ones do. Is this intentional?
On 4/4/19 10:38 AM, Lauri Kenttä wrote:
Hi,
On 2019-04-01 13:24, Nikolay Sivov wrote:
Shutdown() was called. +Invalid media source state transition
All previous messages end with period but none of these new ones do. Is this intentional?
Not really, thanks for paying attention. I'll send a patch.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 131 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 128 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 03de81cd7b..e52aeeb458 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -817,6 +817,129 @@ static const char *debugstr_mf_guid(const GUID *guid) return ret ? wine_dbg_sprintf("%s", ret->name) : wine_dbgstr_guid(guid); }
+struct event_id +{ + DWORD id; + const char *name; +}; + +static int debug_event_id(const void *a, const void *b) +{ + const DWORD *id = a; + const struct event_id *event_id = b; + return *id - event_id->id; +} + +static const char *debugstr_eventid(DWORD event) +{ + static const struct event_id + { + DWORD id; + const char *name; + } + event_ids[] = + { +#define X(e) { e, #e } + X(MEUnknown), + X(MEError), + X(MEExtendedType), + X(MENonFatalError), + X(MESessionUnknown), + X(MESessionTopologySet), + X(MESessionTopologiesCleared), + X(MESessionStarted), + X(MESessionPaused), + X(MESessionStopped), + X(MESessionClosed), + X(MESessionEnded), + X(MESessionRateChanged), + X(MESessionScrubSampleComplete), + X(MESessionCapabilitiesChanged), + X(MESessionTopologyStatus), + X(MESessionNotifyPresentationTime), + X(MENewPresentation), + X(MELicenseAcquisitionStart), + X(MELicenseAcquisitionCompleted), + X(MEIndividualizationStart), + X(MEIndividualizationCompleted), + X(MEEnablerProgress), + X(MEEnablerCompleted), + X(MEPolicyError), + X(MEPolicyReport), + X(MEBufferingStarted), + X(MEBufferingStopped), + X(MEConnectStart), + X(MEConnectEnd), + X(MEReconnectStart), + X(MEReconnectEnd), + X(MERendererEvent), + X(MESessionStreamSinkFormatChanged), + X(MESourceUnknown), + X(MESourceStarted), + X(MEStreamStarted), + X(MESourceSeeked), + X(MEStreamSeeked), + X(MENewStream), + X(MEUpdatedStream), + X(MESourceStopped), + X(MEStreamStopped), + X(MESourcePaused), + X(MEStreamPaused), + X(MEEndOfPresentation), + X(MEEndOfStream), + X(MEMediaSample), + X(MEStreamTick), + X(MEStreamThinMode), + X(MEStreamFormatChanged), + X(MESourceRateChanged), + X(MEEndOfPresentationSegment), + X(MESourceCharacteristicsChanged), + X(MESourceRateChangeRequested), + X(MESourceMetadataChanged), + X(MESequencerSourceTopologyUpdated), + X(MESinkUnknown), + X(MEStreamSinkStarted), + X(MEStreamSinkStopped), + X(MEStreamSinkPaused), + X(MEStreamSinkRateChanged), + X(MEStreamSinkRequestSample), + X(MEStreamSinkMarker), + X(MEStreamSinkPrerolled), + X(MEStreamSinkScrubSampleComplete), + X(MEStreamSinkFormatChanged), + X(MEStreamSinkDeviceChanged), + X(MEQualityNotify), + X(MESinkInvalidated), + X(MEAudioSessionNameChanged), + X(MEAudioSessionVolumeChanged), + X(MEAudioSessionDeviceRemoved), + X(MEAudioSessionServerShutdown), + X(MEAudioSessionGroupingParamChanged), + X(MEAudioSessionIconChanged), + X(MEAudioSessionFormatChanged), + X(MEAudioSessionDisconnected), + X(MEAudioSessionExclusiveModeOverride), + X(METrustUnknown), + X(MEPolicyChanged), + X(MEContentProtectionMessage), + X(MEPolicySet), + X(MEWMDRMLicenseBackupCompleted), + X(MEWMDRMLicenseBackupProgress), + X(MEWMDRMLicenseRestoreCompleted), + X(MEWMDRMLicenseRestoreProgress), + X(MEWMDRMLicenseAcquisitionCompleted), + X(MEWMDRMIndividualizationCompleted), + X(MEWMDRMIndividualizationProgress), + X(MEWMDRMProximityCompleted), + X(MEWMDRMLicenseStoreCleaned), + X(MEWMDRMRevocationDownloadCompleted), +#undef X + }; + + struct event_id *ret = bsearch(&event, event_ids, ARRAY_SIZE(event_ids), sizeof(*event_ids), debug_event_id); + return ret ? wine_dbg_sprintf("%s", ret->name) : wine_dbg_sprintf("%u", event); +} + static inline struct attributes *impl_from_IMFAttributes(IMFAttributes *iface) { return CONTAINING_RECORD(iface, struct attributes, IMFAttributes_iface); @@ -5378,7 +5501,7 @@ HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HR mfmediaevent *object; HRESULT hr;
- TRACE("%#x, %s, %08x, %p, %p\n", type, debugstr_guid(extended_type), status, value, event); + TRACE("%s, %s, %08x, %p, %p\n", debugstr_eventid(type), debugstr_guid(extended_type), status, value, event);
object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) ); if(!object) @@ -5401,6 +5524,8 @@ HRESULT WINAPI MFCreateMediaEvent(MediaEventType type, REFGUID extended_type, HR
*event = &object->IMFMediaEvent_iface;
+ TRACE("Created event %p.\n", *event); + return S_OK; }
@@ -5650,7 +5775,7 @@ static HRESULT WINAPI eventqueue_QueueEventParamVar(IMFMediaEventQueue *iface, M IMFMediaEvent *event; HRESULT hr;
- TRACE("%p, %d, %s, %#x, %p\n", iface, event_type, debugstr_guid(extended_type), status, value); + TRACE("%p, %s, %s, %#x, %p\n", iface, debugstr_eventid(event_type), debugstr_guid(extended_type), status, value);
if (FAILED(hr = MFCreateMediaEvent(event_type, extended_type, status, value, &event))) return hr; @@ -5668,7 +5793,7 @@ static HRESULT WINAPI eventqueue_QueueEventParamUnk(IMFMediaEventQueue *iface, M PROPVARIANT value; HRESULT hr;
- TRACE("%p, %d, %s, %#x, %p.\n", iface, event_type, debugstr_guid(extended_type), status, unk); + TRACE("%p, %s, %s, %#x, %p.\n", iface, debugstr_eventid(event_type), debugstr_guid(extended_type), status, unk);
value.vt = VT_UNKNOWN; value.u.punkVal = unk;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 128 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 121 insertions(+), 7 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 9bed20144f..2e1d24c21c 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -72,6 +72,11 @@ HRESULT WINAPI DllUnregisterServer(void) return __wine_unregister_resources( mfinstance ); }
+struct media_stream +{ + IMFMediaType *current; +}; + typedef struct source_reader { IMFSourceReader IMFSourceReader_iface; @@ -83,6 +88,9 @@ typedef struct source_reader DWORD first_video_stream_index; IMFSourceReaderCallback *async_callback; BOOL shutdown_on_release; + struct media_stream *streams; + DWORD stream_count; + CRITICAL_SECTION cs; } srcreader;
struct sink_writer @@ -214,6 +222,7 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface) { struct source_reader *reader = impl_from_IMFSourceReader(iface); ULONG refcount = InterlockedDecrement(&reader->refcount); + unsigned int i;
TRACE("%p, refcount %d.\n", iface, refcount);
@@ -226,6 +235,14 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface) if (reader->descriptor) IMFPresentationDescriptor_Release(reader->descriptor); IMFMediaSource_Release(reader->source); + + for (i = 0; i < reader->stream_count; ++i) + { + if (reader->streams[i].current) + IMFMediaType_Release(reader->streams[i].current); + } + heap_free(reader->streams); + DeleteCriticalSection(&reader->cs); heap_free(reader); }
@@ -344,17 +361,70 @@ static HRESULT WINAPI src_reader_GetNativeMediaType(IMFSourceReader *iface, DWOR
static HRESULT WINAPI src_reader_GetCurrentMediaType(IMFSourceReader *iface, DWORD index, IMFMediaType **type) { - srcreader *This = impl_from_IMFSourceReader(iface); - FIXME("%p, 0x%08x, %p\n", This, index, type); - return E_NOTIMPL; + struct source_reader *reader = impl_from_IMFSourceReader(iface); + HRESULT hr; + + TRACE("%p, %#x, %p.\n", iface, index, type); + + switch (index) + { + case MF_SOURCE_READER_FIRST_VIDEO_STREAM: + index = reader->first_video_stream_index; + break; + case MF_SOURCE_READER_FIRST_AUDIO_STREAM: + index = reader->first_audio_stream_index; + break; + default: + ; + } + + if (index >= reader->stream_count) + return MF_E_INVALIDSTREAMNUMBER; + + if (FAILED(hr = MFCreateMediaType(type))) + return hr; + + EnterCriticalSection(&reader->cs); + + hr = IMFMediaType_CopyAllItems(reader->streams[index].current, (IMFAttributes *)*type); + + LeaveCriticalSection(&reader->cs); + + return hr; }
static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWORD index, DWORD *reserved, IMFMediaType *type) { - srcreader *This = impl_from_IMFSourceReader(iface); - FIXME("%p, 0x%08x, %p, %p\n", This, index, reserved, type); - return E_NOTIMPL; + struct source_reader *reader = impl_from_IMFSourceReader(iface); + HRESULT hr; + + TRACE("%p, %#x, %p, %p.\n", iface, index, reserved, type); + + switch (index) + { + case MF_SOURCE_READER_FIRST_VIDEO_STREAM: + index = reader->first_video_stream_index; + break; + case MF_SOURCE_READER_FIRST_AUDIO_STREAM: + index = reader->first_audio_stream_index; + break; + default: + ; + } + + if (index >= reader->stream_count) + return MF_E_INVALIDSTREAMNUMBER; + + /* FIXME: validate passed type and current presentation state. */ + + EnterCriticalSection(&reader->cs); + + hr = IMFMediaType_CopyAllItems(type, (IMFAttributes *)reader->streams[index].current); + + LeaveCriticalSection(&reader->cs); + + return hr; }
static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReader *iface, REFGUID format, REFPROPVARIANT position) @@ -533,7 +603,8 @@ static DWORD reader_get_first_stream_index(IMFPresentationDescriptor *descriptor static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttributes *attributes, BOOL shutdown_on_release, REFIID riid, void **out) { - srcreader *object; + struct source_reader *object; + unsigned int i; HRESULT hr;
object = heap_alloc_zero(sizeof(*object)); @@ -545,10 +616,53 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri object->refcount = 1; object->source = source; IMFMediaSource_AddRef(object->source); + InitializeCriticalSection(&object->cs);
if (FAILED(hr = IMFMediaSource_CreatePresentationDescriptor(object->source, &object->descriptor))) goto failed;
+ if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorCount(object->descriptor, &object->stream_count))) + goto failed; + + if (!(object->streams = heap_alloc_zero(object->stream_count * sizeof(*object->streams)))) + { + hr = E_OUTOFMEMORY; + goto failed; + } + + /* Set initial current media types. */ + for (i = 0; i < object->stream_count; ++i) + { + IMFMediaTypeHandler *handler; + IMFStreamDescriptor *sd; + IMFMediaType *src_type; + BOOL selected; + + if (FAILED(hr = MFCreateMediaType(&object->streams[i].current))) + break; + + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(object->descriptor, i, &selected, &sd))) + break; + + hr = IMFStreamDescriptor_GetMediaTypeHandler(sd, &handler); + IMFStreamDescriptor_Release(sd); + if (FAILED(hr)) + break; + + hr = IMFMediaTypeHandler_GetMediaTypeByIndex(handler, 0, &src_type); + IMFMediaTypeHandler_Release(handler); + if (FAILED(hr)) + break; + + hr = IMFMediaType_CopyAllItems(src_type, (IMFAttributes *)object->streams[i].current); + IMFMediaType_Release(src_type); + if (FAILED(hr)) + break; + } + + if (FAILED(hr)) + goto failed; + /* At least one major type has to be set. */ object->first_audio_stream_index = reader_get_first_stream_index(object->descriptor, &MFMediaType_Audio); object->first_video_stream_index = reader_get_first_stream_index(object->descriptor, &MFMediaType_Video);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 2e1d24c21c..78d96e4f8c 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -680,8 +680,12 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri }
if (attributes) + { IMFAttributes_GetUnknown(attributes, &MF_SOURCE_READER_ASYNC_CALLBACK, &IID_IMFSourceReaderCallback, (void **)&object->async_callback); + if (object->async_callback) + TRACE("Using async callback %p.\n", object->async_callback); + }
hr = IMFSourceReader_QueryInterface(&object->IMFSourceReader_iface, riid, out);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 438 ++++++++++++++++++++++++----------- dlls/mfplat/mediatype.c | 67 +++--- dlls/mfplat/mfplat_private.h | 39 ++++ 3 files changed, 381 insertions(+), 163 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index e52aeeb458..be3a78d4c3 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -1028,14 +1028,11 @@ static HRESULT attributes_get_item(struct attributes *attributes, const GUID *ke return hr; }
-static HRESULT WINAPI mfattributes_GetItem(IMFAttributes *iface, REFGUID key, PROPVARIANT *value) +HRESULT attributes_GetItem(struct attributes *attributes, REFGUID key, PROPVARIANT *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - EnterCriticalSection(&attributes->cs);
if ((attribute = attributes_find_item(attributes, key, NULL))) @@ -1048,14 +1045,11 @@ static HRESULT WINAPI mfattributes_GetItem(IMFAttributes *iface, REFGUID key, PR return hr; }
-static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) +HRESULT attributes_GetItemType(struct attributes *attributes, REFGUID key, MF_ATTRIBUTE_TYPE *type) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr = S_OK;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type); - EnterCriticalSection(&attributes->cs);
if ((attribute = attributes_find_item(attributes, key, NULL))) @@ -1070,13 +1064,10 @@ static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key return hr; }
-static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) +HRESULT attributes_CompareItem(struct attributes *attributes, REFGUID key, REFPROPVARIANT value, BOOL *result) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute;
- TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); - *result = FALSE;
EnterCriticalSection(&attributes->cs); @@ -1092,10 +1083,9 @@ static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key return S_OK; }
-static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, +HRESULT attributes_Compare(struct attributes *attributes, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE match_type, BOOL *ret) { - struct attributes *attributes = impl_from_IMFAttributes(iface); IMFAttributes *smaller, *other; MF_ATTRIBUTE_TYPE type; HRESULT hr = S_OK; @@ -1103,8 +1093,6 @@ static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes * BOOL result; size_t i;
- TRACE("%p, %p, %d, %p.\n", iface, theirs, match_type, ret); - if (FAILED(hr = IMFAttributes_GetCount(theirs, &count))) return hr;
@@ -1125,7 +1113,7 @@ static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes * } break; case MF_ATTRIBUTES_MATCH_THEIR_ITEMS: - hr = IMFAttributes_Compare(theirs, iface, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &result); + hr = IMFAttributes_Compare(theirs, &attributes->IMFAttributes_iface, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &result); break; case MF_ATTRIBUTES_MATCH_ALL_ITEMS: if (count != attributes->count) @@ -1157,8 +1145,8 @@ static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes * } break; case MF_ATTRIBUTES_MATCH_SMALLER: - smaller = attributes->count > count ? theirs : iface; - other = attributes->count > count ? iface : theirs; + smaller = attributes->count > count ? theirs : &attributes->IMFAttributes_iface; + other = attributes->count > count ? &attributes->IMFAttributes_iface : theirs; hr = IMFAttributes_Compare(smaller, other, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &result); break; default: @@ -1174,14 +1162,11 @@ static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes * return hr; }
-static HRESULT WINAPI mfattributes_GetUINT32(IMFAttributes *iface, REFGUID key, UINT32 *value) +HRESULT attributes_GetUINT32(struct attributes *attributes, REFGUID key, UINT32 *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - PropVariantInit(&attrval); attrval.vt = VT_UI4; hr = attributes_get_item(attributes, key, &attrval); @@ -1191,14 +1176,11 @@ static HRESULT WINAPI mfattributes_GetUINT32(IMFAttributes *iface, REFGUID key, return hr; }
-static HRESULT WINAPI mfattributes_GetUINT64(IMFAttributes *iface, REFGUID key, UINT64 *value) +HRESULT attributes_GetUINT64(struct attributes *attributes, REFGUID key, UINT64 *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - PropVariantInit(&attrval); attrval.vt = VT_UI8; hr = attributes_get_item(attributes, key, &attrval); @@ -1208,14 +1190,11 @@ static HRESULT WINAPI mfattributes_GetUINT64(IMFAttributes *iface, REFGUID key, return hr; }
-static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key, double *value) +HRESULT attributes_GetDouble(struct attributes *attributes, REFGUID key, double *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - PropVariantInit(&attrval); attrval.vt = VT_R8; hr = attributes_get_item(attributes, key, &attrval); @@ -1225,14 +1204,11 @@ static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key, return hr; }
-static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value) +HRESULT attributes_GetGUID(struct attributes *attributes, REFGUID key, GUID *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - PropVariantInit(&attrval); attrval.vt = VT_CLSID; hr = attributes_get_item(attributes, key, &attrval); @@ -1242,14 +1218,11 @@ static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GU return hr; }
-static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length) +HRESULT attributes_GetStringLength(struct attributes *attributes, REFGUID key, UINT32 *length) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr = S_OK;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length); - EnterCriticalSection(&attributes->cs);
attribute = attributes_find_item(attributes, key, NULL); @@ -1268,15 +1241,12 @@ static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID return hr; }
-static HRESULT WINAPI mfattributes_GetString(IMFAttributes *iface, REFGUID key, WCHAR *value, +HRESULT attributes_GetString(struct attributes *attributes, REFGUID key, WCHAR *value, UINT32 size, UINT32 *length) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr = S_OK;
- TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), value, size, length); - EnterCriticalSection(&attributes->cs);
attribute = attributes_find_item(attributes, key, NULL); @@ -1305,14 +1275,11 @@ static HRESULT WINAPI mfattributes_GetString(IMFAttributes *iface, REFGUID key, return hr; }
-static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFGUID key, WCHAR **value, UINT32 *length) +HRESULT attributes_GetAllocatedString(struct attributes *attributes, REFGUID key, WCHAR **value, UINT32 *length) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length); - PropVariantInit(&attrval); attrval.vt = VT_LPWSTR; hr = attributes_get_item(attributes, key, &attrval); @@ -1325,14 +1292,11 @@ static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFG return hr; }
-static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size) +HRESULT attributes_GetBlobSize(struct attributes *attributes, REFGUID key, UINT32 *size) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr = S_OK;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); - EnterCriticalSection(&attributes->cs);
attribute = attributes_find_item(attributes, key, NULL); @@ -1351,15 +1315,11 @@ static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key return hr; }
-static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf, - UINT32 bufsize, UINT32 *blobsize) +HRESULT attributes_GetBlob(struct attributes *attributes, REFGUID key, UINT8 *buf, UINT32 bufsize, UINT32 *blobsize) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; HRESULT hr;
- TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); - EnterCriticalSection(&attributes->cs);
attribute = attributes_find_item(attributes, key, NULL); @@ -1388,14 +1348,11 @@ static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UI return hr; }
-static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size) +HRESULT attributes_GetAllocatedBlob(struct attributes *attributes, REFGUID key, UINT8 **buf, UINT32 *size) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); - attrval.vt = VT_VECTOR | VT_UI1; hr = attributes_get_item(attributes, key, &attrval); if (SUCCEEDED(hr)) @@ -1407,19 +1364,16 @@ static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUI return hr; }
-static HRESULT WINAPI mfattributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **ppv) +HRESULT attributes_GetUnknown(struct attributes *attributes, REFGUID key, REFIID riid, void **out) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval; HRESULT hr;
- TRACE("%p, %s, %s, %p.\n", iface, debugstr_attr(key), debugstr_guid(riid), ppv); - PropVariantInit(&attrval); attrval.vt = VT_UNKNOWN; hr = attributes_get_item(attributes, key, &attrval); if (SUCCEEDED(hr)) - hr = IUnknown_QueryInterface(attrval.u.punkVal, riid, ppv); + hr = IUnknown_QueryInterface(attrval.u.punkVal, riid, out); PropVariantClear(&attrval); return hr; } @@ -1452,13 +1406,10 @@ static HRESULT attributes_set_item(struct attributes *attributes, REFGUID key, R return S_OK; }
-static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value) +HRESULT attributes_SetItem(struct attributes *attributes, REFGUID key, REFPROPVARIANT value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT empty;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); - switch (value->vt) { case MF_ATTRIBUTE_UINT32: @@ -1476,14 +1427,11 @@ static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, RE } }
-static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key) +HRESULT attributes_DeleteItem(struct attributes *attributes, REFGUID key) { - struct attributes *attributes = impl_from_IMFAttributes(iface); struct attribute *attribute; size_t index = 0;
- TRACE("%p, %s.\n", iface, debugstr_attr(key)); - EnterCriticalSection(&attributes->cs);
if ((attribute = attributes_find_item(attributes, key, &index))) @@ -1503,12 +1451,8 @@ static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key) return S_OK; }
-static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface) +HRESULT attributes_DeleteAllItems(struct attributes *attributes) { - struct attributes *attributes = impl_from_IMFAttributes(iface); - - TRACE("%p.\n", iface); - EnterCriticalSection(&attributes->cs);
while (attributes->count) @@ -1524,132 +1468,96 @@ static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface) return S_OK; }
-static HRESULT WINAPI mfattributes_SetUINT32(IMFAttributes *iface, REFGUID key, UINT32 value) +HRESULT attributes_SetUINT32(struct attributes *attributes, REFGUID key, UINT32 value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %d.\n", iface, debugstr_attr(key), value); - attrval.vt = VT_UI4; attrval.u.ulVal = value; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetUINT64(IMFAttributes *iface, REFGUID key, UINT64 value) +HRESULT attributes_SetUINT64(struct attributes *attributes, REFGUID key, UINT64 value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value)); - attrval.vt = VT_UI8; attrval.u.uhVal.QuadPart = value; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetDouble(IMFAttributes *iface, REFGUID key, double value) +HRESULT attributes_SetDouble(struct attributes *attributes, REFGUID key, double value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value); - attrval.vt = VT_R8; attrval.u.dblVal = value; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value) +HRESULT attributes_SetGUID(struct attributes *attributes, REFGUID key, REFGUID value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_mf_guid(value)); - InitPropVariantFromCLSID(value, &attrval); return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value) +HRESULT attributes_SetString(struct attributes *attributes, REFGUID key, const WCHAR *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value)); - attrval.vt = VT_LPWSTR; attrval.u.pwszVal = (WCHAR *)value; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size) +HRESULT attributes_SetBlob(struct attributes *attributes, REFGUID key, const UINT8 *buf, UINT32 size) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); - attrval.vt = VT_VECTOR | VT_UI1; attrval.u.caub.cElems = size; attrval.u.caub.pElems = (UINT8 *)buf; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown) +HRESULT attributes_SetUnknown(struct attributes *attributes, REFGUID key, IUnknown *unknown) { - struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown); - attrval.vt = VT_UNKNOWN; attrval.u.punkVal = unknown; return attributes_set_item(attributes, key, &attrval); }
-static HRESULT WINAPI mfattributes_LockStore(IMFAttributes *iface) +HRESULT attributes_LockStore(struct attributes *attributes) { - struct attributes *attributes = impl_from_IMFAttributes(iface); - - TRACE("%p.\n", iface); - EnterCriticalSection(&attributes->cs);
return S_OK; }
-static HRESULT WINAPI mfattributes_UnlockStore(IMFAttributes *iface) +HRESULT attributes_UnlockStore(struct attributes *attributes) { - struct attributes *attributes = impl_from_IMFAttributes(iface); - - TRACE("%p.\n", iface); - LeaveCriticalSection(&attributes->cs);
return S_OK; }
-static HRESULT WINAPI mfattributes_GetCount(IMFAttributes *iface, UINT32 *items) +HRESULT attributes_GetCount(struct attributes *attributes, UINT32 *count) { - struct attributes *attributes = impl_from_IMFAttributes(iface); - - TRACE("%p, %p.\n", iface, items); - EnterCriticalSection(&attributes->cs); - *items = attributes->count; + *count = attributes->count; LeaveCriticalSection(&attributes->cs);
return S_OK; }
-static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 index, GUID *key, PROPVARIANT *value) +HRESULT attributes_GetItemByIndex(struct attributes *attributes, UINT32 index, GUID *key, PROPVARIANT *value) { - struct attributes *attributes = impl_from_IMFAttributes(iface); HRESULT hr = S_OK;
- TRACE("%p, %u, %p, %p.\n", iface, index, key, value); - EnterCriticalSection(&attributes->cs);
if (index < attributes->count) @@ -1666,14 +1574,11 @@ static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 i return hr; }
-static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest) +HRESULT attributes_CopyAllItems(struct attributes *attributes, IMFAttributes *dest) { - struct attributes *attributes = impl_from_IMFAttributes(iface); HRESULT hr = S_OK; size_t i;
- TRACE("%p, %p.\n", iface, dest); - EnterCriticalSection(&attributes->cs);
IMFAttributes_LockStore(dest); @@ -1694,6 +1599,279 @@ static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttribu return hr; }
+static HRESULT WINAPI mfattributes_GetItem(IMFAttributes *iface, REFGUID key, PROPVARIANT *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetItem(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type); + + return attributes_GetItemType(attributes, key, type); +} + +static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + + return attributes_CompareItem(attributes, key, value, result); +} + +static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, + MF_ATTRIBUTES_MATCH_TYPE match_type, BOOL *ret) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %p, %d, %p.\n", iface, theirs, match_type, ret); + + return attributes_Compare(attributes, theirs, match_type, ret); +} + +static HRESULT WINAPI mfattributes_GetUINT32(IMFAttributes *iface, REFGUID key, UINT32 *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetUINT32(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_GetUINT64(IMFAttributes *iface, REFGUID key, UINT64 *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetUINT64(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key, double *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetDouble(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetGUID(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length); + + return attributes_GetStringLength(attributes, key, length); +} + +static HRESULT WINAPI mfattributes_GetString(IMFAttributes *iface, REFGUID key, WCHAR *value, + UINT32 size, UINT32 *length) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), value, size, length); + + return attributes_GetString(attributes, key, value, size, length); +} + +static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFGUID key, WCHAR **value, UINT32 *length) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length); + + return attributes_GetAllocatedString(attributes, key, value, length); +} + +static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); + + return attributes_GetBlobSize(attributes, key, size); +} + +static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf, + UINT32 bufsize, UINT32 *blobsize) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + + return attributes_GetBlob(attributes, key, buf, bufsize, blobsize); +} + +static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + + return attributes_GetAllocatedBlob(attributes, key, buf, size); +} + +static HRESULT WINAPI mfattributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **out) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %s, %p.\n", iface, debugstr_attr(key), debugstr_guid(riid), out); + + return attributes_GetUnknown(attributes, key, riid, out); +} + +static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_SetItem(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s.\n", iface, debugstr_attr(key)); + + return attributes_DeleteItem(attributes, key); +} + +static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return attributes_DeleteAllItems(attributes); +} + +static HRESULT WINAPI mfattributes_SetUINT32(IMFAttributes *iface, REFGUID key, UINT32 value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %u.\n", iface, debugstr_attr(key), value); + + return attributes_SetUINT32(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_SetUINT64(IMFAttributes *iface, REFGUID key, UINT64 value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value)); + + return attributes_SetUINT64(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_SetDouble(IMFAttributes *iface, REFGUID key, double value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value); + + return attributes_SetDouble(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_mf_guid(value)); + + return attributes_SetGUID(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value)); + + return attributes_SetString(attributes, key, value); +} + +static HRESULT WINAPI mfattributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + + return attributes_SetBlob(attributes, key, buf, size); +} + +static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown); + + return attributes_SetUnknown(attributes, key, unknown); +} + +static HRESULT WINAPI mfattributes_LockStore(IMFAttributes *iface) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return attributes_LockStore(attributes); +} + +static HRESULT WINAPI mfattributes_UnlockStore(IMFAttributes *iface) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return attributes_UnlockStore(attributes); +} + +static HRESULT WINAPI mfattributes_GetCount(IMFAttributes *iface, UINT32 *count) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %p.\n", iface, count); + + return attributes_GetCount(attributes, count); +} + +static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 index, GUID *key, PROPVARIANT *value) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %u, %p, %p.\n", iface, index, key, value); + + return attributes_GetItemByIndex(attributes, index, key, value); +} + +static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest) +{ + struct attributes *attributes = impl_from_IMFAttributes(iface); + + TRACE("%p, %p.\n", iface, dest); + + return attributes_CopyAllItems(attributes, dest); +} + static const IMFAttributesVtbl mfattributes_vtbl = { mfattributes_QueryInterface, diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 6a8bd97557..8ef6da9cf8 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -133,7 +133,7 @@ static HRESULT WINAPI mediatype_GetItem(IMFMediaType *iface, REFGUID key, PROPVA
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_GetItem(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_GetItem(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_GetItemType(IMFMediaType *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) @@ -142,7 +142,7 @@ static HRESULT WINAPI mediatype_GetItemType(IMFMediaType *iface, REFGUID key, MF
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type);
- return IMFAttributes_GetItemType(&media_type->attributes.IMFAttributes_iface, key, type); + return attributes_GetItemType(&media_type->attributes, key, type); }
static HRESULT WINAPI mediatype_CompareItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) @@ -151,7 +151,7 @@ static HRESULT WINAPI mediatype_CompareItem(IMFMediaType *iface, REFGUID key, RE
TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result);
- return IMFAttributes_CompareItem(&media_type->attributes.IMFAttributes_iface, key, value, result); + return attributes_CompareItem(&media_type->attributes, key, value, result); }
static HRESULT WINAPI mediatype_Compare(IMFMediaType *iface, IMFAttributes *attrs, MF_ATTRIBUTES_MATCH_TYPE type, @@ -161,7 +161,7 @@ static HRESULT WINAPI mediatype_Compare(IMFMediaType *iface, IMFAttributes *attr
TRACE("%p, %p, %d, %p.\n", iface, attrs, type, result);
- return IMFAttributes_Compare(&media_type->attributes.IMFAttributes_iface, attrs, type, result); + return attributes_Compare(&media_type->attributes, attrs, type, result); }
static HRESULT WINAPI mediatype_GetUINT32(IMFMediaType *iface, REFGUID key, UINT32 *value) @@ -170,7 +170,7 @@ static HRESULT WINAPI mediatype_GetUINT32(IMFMediaType *iface, REFGUID key, UINT
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_GetUINT32(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_GetUINT32(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_GetUINT64(IMFMediaType *iface, REFGUID key, UINT64 *value) @@ -179,7 +179,7 @@ static HRESULT WINAPI mediatype_GetUINT64(IMFMediaType *iface, REFGUID key, UINT
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_GetUINT64(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_GetUINT64(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_GetDouble(IMFMediaType *iface, REFGUID key, double *value) @@ -188,7 +188,7 @@ static HRESULT WINAPI mediatype_GetDouble(IMFMediaType *iface, REFGUID key, doub
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_GetDouble(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_GetDouble(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_GetGUID(IMFMediaType *iface, REFGUID key, GUID *value) @@ -197,7 +197,7 @@ static HRESULT WINAPI mediatype_GetGUID(IMFMediaType *iface, REFGUID key, GUID *
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_GetGUID(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_GetGUID(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_GetStringLength(IMFMediaType *iface, REFGUID key, UINT32 *length) @@ -206,7 +206,7 @@ static HRESULT WINAPI mediatype_GetStringLength(IMFMediaType *iface, REFGUID key
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length);
- return IMFAttributes_GetStringLength(&media_type->attributes.IMFAttributes_iface, key, length); + return attributes_GetStringLength(&media_type->attributes, key, length); }
static HRESULT WINAPI mediatype_GetString(IMFMediaType *iface, REFGUID key, WCHAR *value, @@ -216,7 +216,7 @@ static HRESULT WINAPI mediatype_GetString(IMFMediaType *iface, REFGUID key, WCHA
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); + return attributes_GetString(&media_type->attributes, key, value, size, length); }
static HRESULT WINAPI mediatype_GetAllocatedString(IMFMediaType *iface, REFGUID key, @@ -226,7 +226,7 @@ static HRESULT WINAPI mediatype_GetAllocatedString(IMFMediaType *iface, REFGUID
TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length);
- return IMFAttributes_GetAllocatedString(&media_type->attributes.IMFAttributes_iface, key, value, length); + return attributes_GetAllocatedString(&media_type->attributes, key, value, length); }
static HRESULT WINAPI mediatype_GetBlobSize(IMFMediaType *iface, REFGUID key, UINT32 *size) @@ -235,7 +235,7 @@ static HRESULT WINAPI mediatype_GetBlobSize(IMFMediaType *iface, REFGUID key, UI
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size);
- return IMFAttributes_GetBlobSize(&media_type->attributes.IMFAttributes_iface, key, size); + return attributes_GetBlobSize(&media_type->attributes, key, size); }
static HRESULT WINAPI mediatype_GetBlob(IMFMediaType *iface, REFGUID key, UINT8 *buf, @@ -245,7 +245,7 @@ static HRESULT WINAPI mediatype_GetBlob(IMFMediaType *iface, REFGUID key, UINT8
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); + return attributes_GetBlob(&media_type->attributes, key, buf, bufsize, blobsize); }
static HRESULT WINAPI mediatype_GetAllocatedBlob(IMFMediaType *iface, REFGUID key, UINT8 **buf, UINT32 *size) @@ -254,7 +254,7 @@ static HRESULT WINAPI mediatype_GetAllocatedBlob(IMFMediaType *iface, REFGUID ke
TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size);
- return IMFAttributes_GetAllocatedBlob(&media_type->attributes.IMFAttributes_iface, key, buf, size); + return attributes_GetAllocatedBlob(&media_type->attributes, key, buf, size); }
static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REFIID riid, void **obj) @@ -263,7 +263,7 @@ static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REF
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); + return attributes_GetUnknown(&media_type->attributes, key, riid, obj); }
static HRESULT WINAPI mediatype_SetItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value) @@ -272,7 +272,7 @@ static HRESULT WINAPI mediatype_SetItem(IMFMediaType *iface, REFGUID key, REFPRO
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_SetItem(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetItem(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_DeleteItem(IMFMediaType *iface, REFGUID key) @@ -281,7 +281,7 @@ static HRESULT WINAPI mediatype_DeleteItem(IMFMediaType *iface, REFGUID key)
TRACE("%p, %s.\n", iface, debugstr_attr(key));
- return IMFAttributes_DeleteItem(&media_type->attributes.IMFAttributes_iface, key); + return attributes_DeleteItem(&media_type->attributes, key); }
static HRESULT WINAPI mediatype_DeleteAllItems(IMFMediaType *iface) @@ -290,7 +290,7 @@ static HRESULT WINAPI mediatype_DeleteAllItems(IMFMediaType *iface)
TRACE("%p.\n", iface);
- return IMFAttributes_DeleteAllItems(&media_type->attributes.IMFAttributes_iface); + return attributes_DeleteAllItems(&media_type->attributes); }
static HRESULT WINAPI mediatype_SetUINT32(IMFMediaType *iface, REFGUID key, UINT32 value) @@ -299,7 +299,7 @@ static HRESULT WINAPI mediatype_SetUINT32(IMFMediaType *iface, REFGUID key, UINT
TRACE("%p, %s, %u.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_SetUINT32(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetUINT32(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_SetUINT64(IMFMediaType *iface, REFGUID key, UINT64 value) @@ -308,7 +308,7 @@ static HRESULT WINAPI mediatype_SetUINT64(IMFMediaType *iface, REFGUID key, UINT
TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value));
- return IMFAttributes_SetUINT64(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetUINT64(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_SetDouble(IMFMediaType *iface, REFGUID key, double value) @@ -317,7 +317,7 @@ static HRESULT WINAPI mediatype_SetDouble(IMFMediaType *iface, REFGUID key, doub
TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value);
- return IMFAttributes_SetDouble(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetDouble(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_SetGUID(IMFMediaType *iface, REFGUID key, REFGUID value) @@ -326,7 +326,7 @@ static HRESULT WINAPI mediatype_SetGUID(IMFMediaType *iface, REFGUID key, REFGUI
TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value));
- return IMFAttributes_SetGUID(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetGUID(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_SetString(IMFMediaType *iface, REFGUID key, const WCHAR *value) @@ -335,7 +335,7 @@ static HRESULT WINAPI mediatype_SetString(IMFMediaType *iface, REFGUID key, cons
TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value));
- return IMFAttributes_SetString(&media_type->attributes.IMFAttributes_iface, key, value); + return attributes_SetString(&media_type->attributes, key, value); }
static HRESULT WINAPI mediatype_SetBlob(IMFMediaType *iface, REFGUID key, const UINT8 *buf, UINT32 size) @@ -344,7 +344,7 @@ static HRESULT WINAPI mediatype_SetBlob(IMFMediaType *iface, REFGUID key, const
TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size);
- return IMFAttributes_SetBlob(&media_type->attributes.IMFAttributes_iface, key, buf, size); + return attributes_SetBlob(&media_type->attributes, key, buf, size); }
static HRESULT WINAPI mediatype_SetUnknown(IMFMediaType *iface, REFGUID key, IUnknown *unknown) @@ -353,7 +353,7 @@ static HRESULT WINAPI mediatype_SetUnknown(IMFMediaType *iface, REFGUID key, IUn
TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown);
- return IMFAttributes_SetUnknown(&media_type->attributes.IMFAttributes_iface, key, unknown); + return attributes_SetUnknown(&media_type->attributes, key, unknown); }
static HRESULT WINAPI mediatype_LockStore(IMFMediaType *iface) @@ -362,7 +362,7 @@ static HRESULT WINAPI mediatype_LockStore(IMFMediaType *iface)
TRACE("%p.\n", iface);
- return IMFAttributes_LockStore(&media_type->attributes.IMFAttributes_iface); + return attributes_LockStore(&media_type->attributes); }
static HRESULT WINAPI mediatype_UnlockStore(IMFMediaType *iface) @@ -371,7 +371,7 @@ static HRESULT WINAPI mediatype_UnlockStore(IMFMediaType *iface)
TRACE("%p.\n", iface);
- return IMFAttributes_UnlockStore(&media_type->attributes.IMFAttributes_iface); + return attributes_UnlockStore(&media_type->attributes); }
static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *count) @@ -380,7 +380,7 @@ static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *count)
TRACE("%p, %p.\n", iface, count);
- return IMFAttributes_GetCount(&media_type->attributes.IMFAttributes_iface, count); + return attributes_GetCount(&media_type->attributes, count); }
static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index, GUID *key, PROPVARIANT *value) @@ -389,7 +389,7 @@ static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index
TRACE("%p, %u, %p, %p.\n", iface, index, key, value);
- return IMFAttributes_GetItemByIndex(&media_type->attributes.IMFAttributes_iface, index, key, value); + return attributes_GetItemByIndex(&media_type->attributes, index, key, value); }
static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest) @@ -398,14 +398,16 @@ static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes
TRACE("%p, %p.\n", iface, dest);
- return IMFAttributes_CopyAllItems(&media_type->attributes.IMFAttributes_iface, dest); + return attributes_CopyAllItems(&media_type->attributes, dest); }
static HRESULT WINAPI mediatype_GetMajorType(IMFMediaType *iface, GUID *guid) { struct media_type *media_type = impl_from_IMFMediaType(iface); + TRACE("%p, %p.\n", iface, guid); - return IMFAttributes_GetGUID(&media_type->attributes.IMFAttributes_iface, &MF_MT_MAJOR_TYPE, guid); + + return attributes_GetGUID(&media_type->attributes, &MF_MT_MAJOR_TYPE, guid); }
static HRESULT WINAPI mediatype_IsCompressedFormat(IMFMediaType *iface, BOOL *compressed) @@ -415,8 +417,7 @@ static HRESULT WINAPI mediatype_IsCompressedFormat(IMFMediaType *iface, BOOL *co
TRACE("%p, %p.\n", iface, compressed);
- if (FAILED(IMFAttributes_GetUINT32(&media_type->attributes.IMFAttributes_iface, - &MF_MT_ALL_SAMPLES_INDEPENDENT, &value))) + if (FAILED(attributes_GetUINT32(&media_type->attributes, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value))) { value = 0; } diff --git a/dlls/mfplat/mfplat_private.h b/dlls/mfplat/mfplat_private.h index 18c9cc0157..5b183d41ee 100644 --- a/dlls/mfplat/mfplat_private.h +++ b/dlls/mfplat/mfplat_private.h @@ -44,6 +44,45 @@ extern HRESULT init_attributes_object(struct attributes *object, UINT32 size) DE extern void clear_attributes_object(struct attributes *object) DECLSPEC_HIDDEN; extern const char *debugstr_attr(const GUID *guid) DECLSPEC_HIDDEN;
+extern HRESULT attributes_GetItem(struct attributes *object, REFGUID key, PROPVARIANT *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetItemType(struct attributes *object, REFGUID key, MF_ATTRIBUTE_TYPE *type) DECLSPEC_HIDDEN; +extern HRESULT attributes_CompareItem(struct attributes *object, REFGUID key, REFPROPVARIANT value, + BOOL *result) DECLSPEC_HIDDEN; +extern HRESULT attributes_Compare(struct attributes *object, IMFAttributes *theirs, + MF_ATTRIBUTES_MATCH_TYPE match_type, BOOL *ret) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetUINT32(struct attributes *object, REFGUID key, UINT32 *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetUINT64(struct attributes *object, REFGUID key, UINT64 *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetDouble(struct attributes *object, REFGUID key, double *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetGUID(struct attributes *object, REFGUID key, GUID *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetStringLength(struct attributes *object, REFGUID key, UINT32 *length) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetString(struct attributes *object, REFGUID key, WCHAR *value, UINT32 size, + UINT32 *length) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetAllocatedString(struct attributes *object, REFGUID key, WCHAR **value, + UINT32 *length) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetBlobSize(struct attributes *object, REFGUID key, UINT32 *size) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetBlob(struct attributes *object, REFGUID key, UINT8 *buf, UINT32 bufsize, + UINT32 *blobsize) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetAllocatedBlob(struct attributes *object, REFGUID key, UINT8 **buf, + UINT32 *size) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetUnknown(struct attributes *object, REFGUID key, REFIID riid, void **out) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetItem(struct attributes *object, REFGUID key, REFPROPVARIANT value) DECLSPEC_HIDDEN; +extern HRESULT attributes_DeleteItem(struct attributes *object, REFGUID key) DECLSPEC_HIDDEN; +extern HRESULT attributes_DeleteAllItems(struct attributes *object) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetUINT32(struct attributes *object, REFGUID key, UINT32 value) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetUINT64(struct attributes *object, REFGUID key, UINT64 value) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetDouble(struct attributes *object, REFGUID key, double value) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetGUID(struct attributes *object, REFGUID key, REFGUID value) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetString(struct attributes *object, REFGUID key, const WCHAR *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetBlob(struct attributes *object, REFGUID key, const UINT8 *buf, + UINT32 size) DECLSPEC_HIDDEN; +extern HRESULT attributes_SetUnknown(struct attributes *object, REFGUID key, IUnknown *unknown) DECLSPEC_HIDDEN; +extern HRESULT attributes_LockStore(struct attributes *object) DECLSPEC_HIDDEN; +extern HRESULT attributes_UnlockStore(struct attributes *object) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetCount(struct attributes *object, UINT32 *items) DECLSPEC_HIDDEN; +extern HRESULT attributes_GetItemByIndex(struct attributes *object, UINT32 index, GUID *key, + PROPVARIANT *value) DECLSPEC_HIDDEN; +extern HRESULT attributes_CopyAllItems(struct attributes *object, IMFAttributes *dest) DECLSPEC_HIDDEN; + extern void init_system_queues(void) DECLSPEC_HIDDEN; extern void shutdown_system_queues(void) DECLSPEC_HIDDEN; extern BOOL is_platform_locked(void) DECLSPEC_HIDDEN;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50245
Your paranoid android.
=== debian9 (32 bit Chinese:China report) ===
mfplat: mfplat.c:2417: Test failed: Unexpected refcount 1. Unhandled exception: page fault on execute access to 0x6567206f in 32-bit code (0x6567206f).
Report errors: mfplat:mfplat crashed (c0000005)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/mediatype.c | 157 +++++++++++++++++++++++++++++++--------- 1 file changed, 124 insertions(+), 33 deletions(-)
diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 8ef6da9cf8..7cebc34e0b 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -675,187 +675,278 @@ static ULONG WINAPI stream_descriptor_Release(IMFStreamDescriptor *iface) 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetItem(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type); + + return attributes_GetItemType(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + + return attributes_CompareItem(&stream_desc->attributes, 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); + + TRACE("%p, %p, %d, %p.\n", iface, theirs, type, result); + + return attributes_Compare(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetUINT32(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetUINT64(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetDouble(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_GetGUID(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length); + + return attributes_GetStringLength(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_attr(key), value, size, length); + + return attributes_GetString(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length); + + return attributes_GetAllocatedString(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); + + return attributes_GetBlobSize(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + + return attributes_GetBlob(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + + return attributes_GetAllocatedBlob(&stream_desc->attributes, key, buf, size); }
-static HRESULT WINAPI stream_descriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **ppv) +static HRESULT WINAPI stream_descriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **out) { struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface); - return IMFAttributes_GetUnknown(&stream_desc->attributes.IMFAttributes_iface, key, riid, ppv); + + TRACE("%p, %s, %s, %p.\n", iface, debugstr_attr(key), debugstr_guid(riid), out); + + return attributes_GetUnknown(&stream_desc->attributes, key, riid, out); }
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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return attributes_SetItem(&stream_desc->attributes, 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); + + TRACE("%p, %s.\n", iface, debugstr_attr(key)); + + return attributes_DeleteItem(&stream_desc->attributes, 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); + + TRACE("%p.\n", iface); + + return attributes_DeleteAllItems(&stream_desc->attributes); }
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); + + TRACE("%p, %s, %u.\n", iface, debugstr_attr(key), value); + + return attributes_SetUINT32(&stream_desc->attributes, 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); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value)); + + return attributes_SetUINT64(&stream_desc->attributes, 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); + + TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value); + + return attributes_SetDouble(&stream_desc->attributes, 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); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value)); + + return attributes_SetGUID(&stream_desc->attributes, 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); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value)); + + return attributes_SetString(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + + return attributes_SetBlob(&stream_desc->attributes, 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); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown); + + return attributes_SetUnknown(&stream_desc->attributes, 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); + + TRACE("%p.\n", iface); + + return attributes_LockStore(&stream_desc->attributes); }
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); + + TRACE("%p.\n", iface); + + return attributes_UnlockStore(&stream_desc->attributes); }
-static HRESULT WINAPI stream_descriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *items) +static HRESULT WINAPI stream_descriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *count) { struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface); - return IMFAttributes_GetCount(&stream_desc->attributes.IMFAttributes_iface, items); + + TRACE("%p, %p.\n", iface, count); + + return attributes_GetCount(&stream_desc->attributes, count); }
-static HRESULT WINAPI stream_descriptor_GetItemByIndex(IMFStreamDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value) +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); + + TRACE("%p, %u, %p, %p.\n", iface, index, key, value); + + return attributes_GetItemByIndex(&stream_desc->attributes, index, key, value); }
static HRESULT WINAPI stream_descriptor_CopyAllItems(IMFStreamDescriptor *iface, IMFAttributes *dest) { struct stream_desc *stream_desc = impl_from_IMFStreamDescriptor(iface); - return IMFAttributes_CopyAllItems(&stream_desc->attributes.IMFAttributes_iface, dest); + + TRACE("%p, %p.\n", iface, dest); + + return attributes_CopyAllItems(&stream_desc->attributes, dest); }
static HRESULT WINAPI stream_descriptor_GetStreamIdentifier(IMFStreamDescriptor *iface, DWORD *identifier)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=50240
Your paranoid android.
=== debian9 (64 bit WoW report) ===
mfplat: mfplat.c:2417: Test failed: Unexpected refcount 1. Unhandled exception: page fault on read access to 0x00000011 in 64-bit code (0x00007ff3e033a155).
Report errors: mfplat:mfplat crashed (c0000005)