Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 357 ++------------------------------------------- 1 file changed, 13 insertions(+), 344 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index bac5905cff..d5a408b5b8 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -2855,341 +2855,6 @@ HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret) return S_OK; }
-typedef struct _mfpresentationdescriptor -{ - struct attributes attributes; - IMFPresentationDescriptor IMFPresentationDescriptor_iface; -} mfpresentationdescriptor; - -static inline mfpresentationdescriptor *impl_from_IMFPresentationDescriptor(IMFPresentationDescriptor *iface) -{ - return CONTAINING_RECORD(iface, mfpresentationdescriptor, IMFPresentationDescriptor_iface); -} - -static HRESULT WINAPI mfpresentationdescriptor_QueryInterface(IMFPresentationDescriptor *iface, REFIID riid, void **out) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out); - - if(IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_IMFAttributes) || - IsEqualGUID(riid, &IID_IMFPresentationDescriptor)) - { - *out = &This->IMFPresentationDescriptor_iface; - } - else - { - FIXME("(%s, %p)\n", debugstr_guid(riid), out); - *out = NULL; - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown*)*out); - return S_OK; -} - -static ULONG WINAPI mfpresentationdescriptor_AddRef(IMFPresentationDescriptor *iface) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - ULONG ref = InterlockedIncrement(&This->attributes.ref); - - TRACE("(%p) ref=%u\n", This, ref); - - return ref; -} - -static ULONG WINAPI mfpresentationdescriptor_Release(IMFPresentationDescriptor *iface) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - ULONG ref = InterlockedDecrement(&This->attributes.ref); - - TRACE("(%p) ref=%u\n", This, ref); - - if (!ref) - { - clear_attributes_object(&This->attributes); - HeapFree(GetProcessHeap(), 0, This); - } - - return ref; -} - -static HRESULT WINAPI mfpresentationdescriptor_GetItem(IMFPresentationDescriptor *iface, REFGUID key, PROPVARIANT *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetItem(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetItemType(IMFPresentationDescriptor *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetItemType(&This->attributes.IMFAttributes_iface, key, type); -} - -static HRESULT WINAPI mfpresentationdescriptor_CompareItem(IMFPresentationDescriptor *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_CompareItem(&This->attributes.IMFAttributes_iface, key, value, result); -} - -static HRESULT WINAPI mfpresentationdescriptor_Compare(IMFPresentationDescriptor *iface, IMFAttributes *attrs, MF_ATTRIBUTES_MATCH_TYPE type, - BOOL *result) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_Compare(&This->attributes.IMFAttributes_iface, attrs, type, result); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetUINT32(IMFPresentationDescriptor *iface, REFGUID key, UINT32 *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetUINT32(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetUINT64(IMFPresentationDescriptor *iface, REFGUID key, UINT64 *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetUINT64(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetDouble(IMFPresentationDescriptor *iface, REFGUID key, double *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetDouble(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetGUID(IMFPresentationDescriptor *iface, REFGUID key, GUID *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetGUID(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetStringLength(IMFPresentationDescriptor *iface, REFGUID key, UINT32 *length) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetStringLength(&This->attributes.IMFAttributes_iface, key, length); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetString(IMFPresentationDescriptor *iface, REFGUID key, WCHAR *value, - UINT32 size, UINT32 *length) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetString(&This->attributes.IMFAttributes_iface, key, value, size, length); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetAllocatedString(IMFPresentationDescriptor *iface, REFGUID key, - WCHAR **value, UINT32 *length) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetAllocatedString(&This->attributes.IMFAttributes_iface, key, value, length); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetBlobSize(IMFPresentationDescriptor *iface, REFGUID key, UINT32 *size) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetBlobSize(&This->attributes.IMFAttributes_iface, key, size); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetBlob(IMFPresentationDescriptor *iface, REFGUID key, UINT8 *buf, - UINT32 bufsize, UINT32 *blobsize) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetBlob(&This->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetAllocatedBlob(IMFPresentationDescriptor *iface, REFGUID key, UINT8 **buf, UINT32 *size) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetAllocatedBlob(&This->attributes.IMFAttributes_iface, key, buf, size); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetUnknown(IMFPresentationDescriptor *iface, REFGUID key, REFIID riid, void **ppv) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetUnknown(&This->attributes.IMFAttributes_iface, key, riid, ppv); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetItem(IMFPresentationDescriptor *iface, REFGUID key, REFPROPVARIANT value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetItem(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_DeleteItem(IMFPresentationDescriptor *iface, REFGUID key) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_DeleteItem(&This->attributes.IMFAttributes_iface, key); -} - -static HRESULT WINAPI mfpresentationdescriptor_DeleteAllItems(IMFPresentationDescriptor *iface) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_DeleteAllItems(&This->attributes.IMFAttributes_iface); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetUINT32(IMFPresentationDescriptor *iface, REFGUID key, UINT32 value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetUINT32(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetUINT64(IMFPresentationDescriptor *iface, REFGUID key, UINT64 value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetUINT64(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetDouble(IMFPresentationDescriptor *iface, REFGUID key, double value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetDouble(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetGUID(IMFPresentationDescriptor *iface, REFGUID key, REFGUID value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetGUID(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetString(IMFPresentationDescriptor *iface, REFGUID key, const WCHAR *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetString(&This->attributes.IMFAttributes_iface, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetBlob(IMFPresentationDescriptor *iface, REFGUID key, const UINT8 *buf, UINT32 size) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetBlob(&This->attributes.IMFAttributes_iface, key, buf, size); -} - -static HRESULT WINAPI mfpresentationdescriptor_SetUnknown(IMFPresentationDescriptor *iface, REFGUID key, IUnknown *unknown) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_SetUnknown(&This->attributes.IMFAttributes_iface, key, unknown); -} - -static HRESULT WINAPI mfpresentationdescriptor_LockStore(IMFPresentationDescriptor *iface) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_LockStore(&This->attributes.IMFAttributes_iface); -} - -static HRESULT WINAPI mfpresentationdescriptor_UnlockStore(IMFPresentationDescriptor *iface) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_UnlockStore(&This->attributes.IMFAttributes_iface); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetCount(IMFPresentationDescriptor *iface, UINT32 *items) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetCount(&This->attributes.IMFAttributes_iface, items); -} - -static HRESULT WINAPI mfpresentationdescriptor_GetItemByIndex(IMFPresentationDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - return IMFAttributes_GetItemByIndex(&This->attributes.IMFAttributes_iface, index, key, value); -} - -static HRESULT WINAPI mfpresentationdescriptor_CopyAllItems(IMFPresentationDescriptor *iface, IMFAttributes *dest) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %p\n", This, dest); - - return E_NOTIMPL; -} - -static HRESULT WINAPI mfpresentationdescriptor_GetStreamDescriptorCount(IMFPresentationDescriptor *iface, DWORD *descriptor_count) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %p\n", This, descriptor_count); - - return E_NOTIMPL; -} - -static HRESULT WINAPI mfpresentationdescriptor_GetStreamDescriptorByIndex(IMFPresentationDescriptor *iface, DWORD index, - BOOL *selected, IMFStreamDescriptor **descriptor) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %#x, %p, %p\n", This, index, selected, descriptor); - - return E_NOTIMPL; -} - -static HRESULT WINAPI mfpresentationdescriptor_SelectStream(IMFPresentationDescriptor *iface, DWORD index) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %#x\n", This, index); - - return E_NOTIMPL; -} - -static HRESULT WINAPI mfpresentationdescriptor_DeselectStream(IMFPresentationDescriptor *iface, DWORD index) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %#x\n", This, index); - - return E_NOTIMPL; -} - -static HRESULT WINAPI mfpresentationdescriptor_Clone(IMFPresentationDescriptor *iface, IMFPresentationDescriptor **descriptor) -{ - mfpresentationdescriptor *This = impl_from_IMFPresentationDescriptor(iface); - - FIXME("%p, %p\n", This, descriptor); - - return E_NOTIMPL; -} - -static const IMFPresentationDescriptorVtbl mfpresentationdescriptor_vtbl = -{ - mfpresentationdescriptor_QueryInterface, - mfpresentationdescriptor_AddRef, - mfpresentationdescriptor_Release, - mfpresentationdescriptor_GetItem, - mfpresentationdescriptor_GetItemType, - mfpresentationdescriptor_CompareItem, - mfpresentationdescriptor_Compare, - mfpresentationdescriptor_GetUINT32, - mfpresentationdescriptor_GetUINT64, - mfpresentationdescriptor_GetDouble, - mfpresentationdescriptor_GetGUID, - mfpresentationdescriptor_GetStringLength, - mfpresentationdescriptor_GetString, - mfpresentationdescriptor_GetAllocatedString, - mfpresentationdescriptor_GetBlobSize, - mfpresentationdescriptor_GetBlob, - mfpresentationdescriptor_GetAllocatedBlob, - mfpresentationdescriptor_GetUnknown, - mfpresentationdescriptor_SetItem, - mfpresentationdescriptor_DeleteItem, - mfpresentationdescriptor_DeleteAllItems, - mfpresentationdescriptor_SetUINT32, - mfpresentationdescriptor_SetUINT64, - mfpresentationdescriptor_SetDouble, - mfpresentationdescriptor_SetGUID, - mfpresentationdescriptor_SetString, - mfpresentationdescriptor_SetBlob, - mfpresentationdescriptor_SetUnknown, - mfpresentationdescriptor_LockStore, - mfpresentationdescriptor_UnlockStore, - mfpresentationdescriptor_GetCount, - mfpresentationdescriptor_GetItemByIndex, - mfpresentationdescriptor_CopyAllItems, - mfpresentationdescriptor_GetStreamDescriptorCount, - mfpresentationdescriptor_GetStreamDescriptorByIndex, - mfpresentationdescriptor_SelectStream, - mfpresentationdescriptor_DeselectStream, - mfpresentationdescriptor_Clone, -}; - typedef struct _mfsource { IMFMediaSource IMFMediaSource_iface; @@ -3298,20 +2963,24 @@ static HRESULT WINAPI mfsource_GetCharacteristics(IMFMediaSource *iface, DWORD * static HRESULT WINAPI mfsource_CreatePresentationDescriptor(IMFMediaSource *iface, IMFPresentationDescriptor **descriptor) { mfsource *This = impl_from_IMFMediaSource(iface); - - mfpresentationdescriptor *object; + IMFStreamDescriptor *sd; + IMFMediaType *mediatype; + HRESULT hr;
FIXME("(%p)->(%p): stub\n", This, descriptor);
- object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) ); - if (!object) - return E_OUTOFMEMORY; + if (FAILED(hr = MFCreateMediaType(&mediatype))) + return hr; + + hr = MFCreateStreamDescriptor(0, 1, &mediatype, &sd); + IMFMediaType_Release(mediatype); + if (FAILED(hr)) + return hr;
- init_attributes_object(&object->attributes, 0); - object->IMFPresentationDescriptor_iface.lpVtbl = &mfpresentationdescriptor_vtbl; + hr = MFCreatePresentationDescriptor(1, &sd, descriptor); + IMFStreamDescriptor_Release(sd);
- *descriptor = &object->IMFPresentationDescriptor_iface; - return S_OK; + return hr; }
static HRESULT WINAPI mfsource_Start(IMFMediaSource *iface, IMFPresentationDescriptor *descriptor,
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 41 ++++++++++++++++++++++++++ include/mfapi.h | 71 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 97 insertions(+), 15 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index d5a408b5b8..61ee51da34 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -557,16 +557,19 @@ static const char *debugstr_attr(const GUID *guid) X(MF_READWRITE_MMCSS_CLASS), X(MF_SINK_WRITER_ENCODER_CONFIG), X(MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS), + X(MF_MT_ALPHA_MODE), X(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS), X(MF_MT_PIXEL_ASPECT_RATIO), X(MF_MT_WRAPPED_TYPE), X(MF_MT_AVG_BITRATE), X(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING), + X(MF_MT_AUDIO_BLOCK_ALIGNMENT), X(MF_PD_PMPHOST_CONTEXT), X(MF_PD_APP_CONTEXT), X(MF_PD_TOTAL_FILE_SIZE), X(MF_PD_AUDIO_ENCODING_BITRATE), X(MF_PD_VIDEO_ENCODING_BITRATE), + X(MFSampleExtension_TargetGlobalLuminance), X(MF_PD_MIME_TYPE), X(MF_PD_LAST_MODIFIED_TIME), X(MF_PD_PLAYBACK_ELEMENT_ID), @@ -577,19 +580,36 @@ static const char *debugstr_attr(const GUID *guid) X(MF_MT_FRAME_SIZE), X(MF_SINK_WRITER_ASYNC_CALLBACK), X(MF_MT_FRAME_RATE_RANGE_MAX), + X(MF_MT_AUDIO_FLOAT_SAMPLES_PER_SECOND), + X(MFSampleExtension_ForwardedDecodeUnits), X(MF_EVENT_SOURCE_TOPOLOGY_CANCELED), + X(MF_MT_VIDEO_ROTATION), X(MF_MT_USER_DATA), X(MF_EVENT_STREAM_METADATA_SYSTEMID), + X(MF_MT_AUDIO_CHANNEL_MASK), X(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN), X(MF_READWRITE_DISABLE_CONVERTERS), X(MFSampleExtension_Token), + X(MF_MT_AUDIO_VALID_BITS_PER_SAMPLE), + X(MF_MT_VIDEO_NO_FRAME_ORDERING), + X(MFSampleExtension_3DVideo_SampleFormat), + X(MF_MT_SAMPLE_SIZE), + X(MF_MT_AAC_PAYLOAD_TIME), X(MF_SOURCE_READER_D3D11_BIND_FLAGS), + X(MF_MT_AUDIO_FOLDDOWN_MATRIX), + X(MF_MT_AUDIO_WMADRC_PEAKREF), + X(MF_MT_AUDIO_WMADRC_PEAKTARGET), X(MF_PD_SAMI_STYLELIST), + X(MF_MT_AUDIO_WMADRC_AVGREF), + X(MF_MT_AUDIO_BITS_PER_SAMPLE), X(MF_SD_LANGUAGE), + X(MF_MT_AUDIO_WMADRC_AVGTARGET), X(MF_SD_PROTECTED), X(MF_READWRITE_MMCSS_PRIORITY_AUDIO), X(MF_BYTESTREAM_ORIGIN_NAME), X(MF_BYTESTREAM_CONTENT_TYPE), + X(MF_MT_DEPTH_MEASUREMENT), + X(MF_MT_VIDEO_3D_NUM_VIEWS), X(MF_BYTESTREAM_DURATION), X(MF_SD_SAMI_LANGUAGE), X(MF_EVENT_OUTPUT_NODE), @@ -601,40 +621,61 @@ static const char *debugstr_attr(const GUID *guid) X(MF_MT_MAJOR_TYPE), X(MF_EVENT_SOURCE_CHARACTERISTICS), X(MF_EVENT_SOURCE_CHARACTERISTICS_OLD), + X(MF_MT_VIDEO_3D_FIRST_IS_LEFT), X(MF_PD_ADAPTIVE_STREAMING), X(MFSampleExtension_Timestamp), X(MF_MT_SUBTYPE), X(MF_SD_MUTUALLY_EXCLUSIVE), X(MF_SD_STREAM_NAME), X(MF_EVENT_STREAM_METADATA_CONTENT_KEYIDS), + X(MF_MT_VIDEO_3D_FORMAT), X(MF_EVENT_STREAM_METADATA_KEYDATA), X(MF_SINK_WRITER_D3D_MANAGER), X(MF_SOURCE_READER_D3D_MANAGER), + X(MFSampleExtension_3DVideo), X(MF_EVENT_SOURCE_FAKE_START), X(MF_EVENT_SOURCE_PROJECTSTART), X(MF_EVENT_SOURCE_ACTUAL_START), + X(MF_MT_AUDIO_SAMPLES_PER_BLOCK), X(MF_SOURCE_READER_ASYNC_CALLBACK), + X(MF_MT_AUDIO_FLAC_MAX_BLOCK_SIZE), + X(MF_MT_FIXED_SIZE_SAMPLES), X(MF_EVENT_SCRUBSAMPLE_TIME), X(MF_MT_INTERLACE_MODE), + X(MF_MT_VIDEO_RENDERER_EXTENSION_PROFILE), + X(MF_MT_AUDIO_PREFER_WAVEFORMATEX), + X(MFSampleExtension_ForwardedDecodeUnitType), + X(MF_MT_AUDIO_AVG_BYTES_PER_SECOND), X(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS), X(MF_EVENT_MFT_INPUT_STREAM_ID), X(MF_READWRITE_MMCSS_PRIORITY), + X(MF_MT_VIDEO_3D), X(MF_EVENT_START_PRESENTATION_TIME), X(MF_EVENT_SESSIONCAPS), X(MF_EVENT_PRESENTATION_TIME_OFFSET), X(MF_EVENT_SESSIONCAPS_DELTA), X(MF_EVENT_START_PRESENTATION_TIME_AT_OUTPUT), X(MFSampleExtension_DecodeTimestamp), + X(MF_MT_VIDEO_H264_NO_FMOASO), X(MF_SINK_WRITER_DISABLE_THROTTLING), X(MF_READWRITE_D3D_OPTIONAL), X(MF_READWRITE_MMCSS_CLASS_AUDIO), X(MF_SOURCE_READER_DISABLE_CAMERA_PLUGINS), X(MF_PD_AUDIO_ISVARIABLEBITRATE), + X(MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION), + X(MF_MT_AUDIO_SAMPLES_PER_SECOND), X(MF_MT_FRAME_RATE), X(MF_SOURCE_READER_MEDIASOURCE_CONFIG), + X(MF_MT_COMPRESSED), X(MF_EVENT_MFT_CONTEXT), + X(MF_MT_FORWARD_CUSTOM_SEI), + X(MF_MT_DEPTH_VALUE_UNIT), + X(MF_MT_AUDIO_NUM_CHANNELS), X(MF_EVENT_DO_THINNING), X(MF_SOURCE_READER_DISABLE_DXVA), + X(MF_MT_FORWARD_CUSTOM_NALU), + X(MF_MT_SECURE), + X(MF_MT_VIDEO_3D_LEFT_IS_BASE), #undef X }; struct guid_def *ret = NULL; diff --git a/include/mfapi.h b/include/mfapi.h index 2d794e49eb..579f7003c5 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -94,18 +94,54 @@ typedef enum _EAllocationType #include <initguid.h> #endif
-DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); -DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); -DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); -DEFINE_GUID(MF_MT_INTERLACE_MODE, 0xe2724bb8, 0xe676, 0x4806, 0xb4, 0xb2, 0xa8, 0xd6, 0xef, 0xb4, 0x4c, 0xcd); -DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f); -DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); -DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); -DEFINE_GUID(MF_MT_ALL_SAMPLES_INDEPENDENT, 0xc9173739, 0x5e56, 0x461c, 0xb7, 0x13, 0x46, 0xfb, 0x99, 0x5c, 0xb9, 0x5f); -DEFINE_GUID(MF_MT_USER_DATA, 0xb6bc765f, 0x4c3b, 0x40a4, 0xbd, 0x51, 0x25, 0x35, 0xb6, 0x6f, 0xe0, 0x9d); -DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MIN, 0xd2e7558c, 0xdc1f, 0x403f, 0x9a, 0x72, 0xd2, 0x8b, 0xb1, 0xeb, 0x3b, 0x5e); -DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MAX, 0xe3371d41, 0xb4cf, 0x4a05, 0xbd, 0x4e, 0x20, 0xb8, 0x8b, 0xb2, 0xc4, 0xd6); -DEFINE_GUID(MF_MT_WRAPPED_TYPE, 0x4d3f7b23, 0xd02f, 0x4e6c, 0x9b, 0xee, 0xe4, 0xbf, 0x2c, 0x6c, 0x69, 0x5d); +DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); +DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); +DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); +DEFINE_GUID(MF_MT_INTERLACE_MODE, 0xe2724bb8, 0xe676, 0x4806, 0xb4, 0xb2, 0xa8, 0xd6, 0xef, 0xb4, 0x4c, 0xcd); +DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f); +DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); +DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); +DEFINE_GUID(MF_MT_ALL_SAMPLES_INDEPENDENT, 0xc9173739, 0x5e56, 0x461c, 0xb7, 0x13, 0x46, 0xfb, 0x99, 0x5c, 0xb9, 0x5f); +DEFINE_GUID(MF_MT_USER_DATA, 0xb6bc765f, 0x4c3b, 0x40a4, 0xbd, 0x51, 0x25, 0x35, 0xb6, 0x6f, 0xe0, 0x9d); +DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MIN, 0xd2e7558c, 0xdc1f, 0x403f, 0x9a, 0x72, 0xd2, 0x8b, 0xb1, 0xeb, 0x3b, 0x5e); +DEFINE_GUID(MF_MT_FRAME_RATE_RANGE_MAX, 0xe3371d41, 0xb4cf, 0x4a05, 0xbd, 0x4e, 0x20, 0xb8, 0x8b, 0xb2, 0xc4, 0xd6); +DEFINE_GUID(MF_MT_WRAPPED_TYPE, 0x4d3f7b23, 0xd02f, 0x4e6c, 0x9b, 0xee, 0xe4, 0xbf, 0x2c, 0x6c, 0x69, 0x5d); +DEFINE_GUID(MF_MT_FIXED_SIZE_SAMPLES, 0xb8ebefaf, 0xb718, 0x4e04, 0xb0, 0xa9, 0x11, 0x67, 0x75, 0xe3, 0x32, 0x1b); +DEFINE_GUID(MF_MT_COMPRESSED, 0x3afd0cee, 0x18f2, 0x4ba5, 0xa1, 0x10, 0x8b, 0xea, 0x50, 0x2e, 0x1f, 0x92); +DEFINE_GUID(MF_MT_SAMPLE_SIZE, 0xdad3ab78, 0x1990, 0x408b, 0xbc, 0xe2, 0xeb, 0xa6, 0x73, 0xda, 0xcc, 0x10); +DEFINE_GUID(MF_MT_VIDEO_3D, 0xcb5e88cf, 0x7b5b, 0x47b6, 0x85, 0xaa, 0x1c, 0xa5, 0xae, 0x18, 0x75, 0x55); +DEFINE_GUID(MF_MT_VIDEO_3D_FORMAT, 0x5315d8a0, 0x87c5, 0x4697, 0xb7, 0x93, 0x66, 0x06, 0xc6, 0x7c, 0x04, 0x9b); +DEFINE_GUID(MF_MT_VIDEO_3D_NUM_VIEWS, 0xbb077e8a, 0xdcbf, 0x42eb, 0xaf, 0x60, 0x41, 0x8d, 0xf9, 0x8a, 0xa4, 0x95); +DEFINE_GUID(MF_MT_VIDEO_3D_LEFT_IS_BASE, 0x6d4b7bff, 0x5629, 0x4404, 0x94, 0x8c, 0xc6, 0x34, 0xf4, 0xce, 0x26, 0xd4); +DEFINE_GUID(MF_MT_VIDEO_3D_FIRST_IS_LEFT, 0xec298493, 0x0ada, 0x4ea1, 0xa4, 0xfe, 0xcb, 0xbd, 0x36, 0xce, 0x93, 0x31); +DEFINE_GUID(MF_MT_VIDEO_ROTATION, 0xc380465d, 0x2271, 0x428c, 0x9b, 0x83, 0xec, 0xea, 0x3b, 0x4a, 0x85, 0xc1); +DEFINE_GUID(MF_MT_VIDEO_RENDERER_EXTENSION_PROFILE, 0x8437d4b9, 0xd448, 0x4fcd, 0x9b, 0x6b, 0x83, 0x9b, 0xf9, 0x6c, 0x77, 0x98); +DEFINE_GUID(MF_MT_VIDEO_NO_FRAME_ORDERING, 0x3f5b106f, 0x6bc2, 0x4ee3, 0xb7, 0xed, 0x89, 0x02, 0xc1, 0x8f, 0x53, 0x51); +DEFINE_GUID(MF_MT_VIDEO_H264_NO_FMOASO, 0xed461cd6, 0xec9f, 0x416a, 0xa8, 0xa3, 0x26, 0xd7, 0xd3, 0x10, 0x18, 0xd7); +DEFINE_GUID(MF_MT_SECURE, 0xc5acc4fd, 0x0304, 0x4ecf, 0x80, 0x9f, 0x47, 0xbc, 0x97, 0xff, 0x63, 0xbd); +DEFINE_GUID(MF_MT_ALPHA_MODE, 0x5d959b0d, 0x4cbf, 0x4d04, 0x91, 0x9f, 0x3f, 0x5f, 0x7f, 0x28, 0x42, 0x11); +DEFINE_GUID(MF_MT_DEPTH_MEASUREMENT, 0xfd5ac489, 0x0917, 0x4bb6, 0x9d, 0x54, 0x31, 0x22, 0xbf, 0x70, 0x14, 0x4b); +DEFINE_GUID(MF_MT_DEPTH_VALUE_UNIT, 0x21a800f5, 0x3189, 0x4797, 0xbe, 0xba, 0xf1, 0x3c, 0xd9, 0xa3, 0x1a, 0x5e); +DEFINE_GUID(MF_MT_FORWARD_CUSTOM_NALU, 0xed336efd, 0x244f, 0x428d, 0x91, 0x53, 0x28, 0xf3, 0x99, 0x45, 0x88, 0x90); +DEFINE_GUID(MF_MT_FORWARD_CUSTOM_SEI, 0xe27362f1, 0xb136, 0x41d1, 0x95, 0x94, 0x3a, 0x7e, 0x4f, 0xeb, 0xf2, 0xd1); +DEFINE_GUID(MF_MT_AUDIO_NUM_CHANNELS, 0x37e48bf5, 0x645e, 0x4c5b, 0x89, 0xde, 0xad, 0xa9, 0xe2, 0x9b, 0x69, 0x6a); +DEFINE_GUID(MF_MT_AUDIO_SAMPLES_PER_SECOND, 0x5faeeae7, 0x0290, 0x4c31, 0x9e, 0x8a, 0xc5, 0x34, 0xf6, 0x8d, 0x9d, 0xba); +DEFINE_GUID(MF_MT_AUDIO_FLOAT_SAMPLES_PER_SECOND, 0xfb3b724a, 0xcfb5, 0x4319, 0xae, 0xfe, 0x6e, 0x42, 0xb2, 0x40, 0x61, 0x32); +DEFINE_GUID(MF_MT_AUDIO_AVG_BYTES_PER_SECOND, 0x1aab75c8, 0xcfef, 0x451c, 0xab, 0x95, 0xac, 0x03, 0x4b, 0x8e, 0x17, 0x31); +DEFINE_GUID(MF_MT_AUDIO_BLOCK_ALIGNMENT, 0x322de230, 0x9eeb, 0x43bd, 0xab, 0x7a, 0xff, 0x41, 0x22, 0x51, 0x54, 0x1d); +DEFINE_GUID(MF_MT_AUDIO_BITS_PER_SAMPLE, 0xf2deb57f, 0x40fa, 0x4764, 0xaa, 0x33, 0xed, 0x4f, 0x2d, 0x1f, 0xf6, 0x69); +DEFINE_GUID(MF_MT_AUDIO_VALID_BITS_PER_SAMPLE, 0xd9bf8d6a, 0x9530, 0x4b7c, 0x9d, 0xdf, 0xff, 0x6f, 0xd5, 0x8b, 0xbd, 0x06); +DEFINE_GUID(MF_MT_AUDIO_SAMPLES_PER_BLOCK, 0xaab15aac, 0xe13a, 0x4995, 0x92, 0x22, 0x50, 0x1e, 0xa1, 0x5c, 0x68, 0x77); +DEFINE_GUID(MF_MT_AUDIO_CHANNEL_MASK, 0x55fb5765, 0x644a, 0x4caf, 0x84, 0x79, 0x93, 0x89, 0x83, 0xbb, 0x15, 0x88); +DEFINE_GUID(MF_MT_AUDIO_FOLDDOWN_MATRIX, 0x9d62927c, 0x36be, 0x4cf1, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); +DEFINE_GUID(MF_MT_AUDIO_WMADRC_PEAKREF, 0x9d62927d, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); +DEFINE_GUID(MF_MT_AUDIO_WMADRC_PEAKTARGET, 0x9d62927e, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); +DEFINE_GUID(MF_MT_AUDIO_WMADRC_AVGREF, 0x9d62927f, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); +DEFINE_GUID(MF_MT_AUDIO_WMADRC_AVGTARGET, 0x9d629280, 0x36be, 0x4cf2, 0xb5, 0xc4, 0xa3, 0x92, 0x6e, 0x3e, 0x87, 0x11); +DEFINE_GUID(MF_MT_AUDIO_PREFER_WAVEFORMATEX, 0xa901aaba, 0xe037, 0x458a, 0xbd, 0xf6, 0x54, 0x5b, 0xe2, 0x07, 0x40, 0x42); +DEFINE_GUID(MF_MT_AUDIO_FLAC_MAX_BLOCK_SIZE, 0x8b81adae, 0x4b5a, 0x4d40, 0x80, 0x22, 0xf3, 0x8d, 0x09, 0xca, 0x3c, 0x5c); +DEFINE_GUID(MF_MT_AAC_PAYLOAD_TIME, 0xbfbabe79, 0x7434, 0x4d1c, 0x94, 0xf0, 0x72, 0xa3, 0xb9, 0xe1, 0x71, 0x88); +DEFINE_GUID(MF_MT_AAC_AUDIO_PROFILE_LEVEL_INDICATION, 0x7632f0e6, 0x9538, 0x4d61, 0xac, 0xda, 0xea, 0x29, 0xc8, 0xc1, 0x44, 0x56);
DEFINE_GUID(MFT_CATEGORY_VIDEO_DECODER, 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91); DEFINE_GUID(MFT_CATEGORY_VIDEO_ENCODER, 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a); @@ -133,9 +169,14 @@ DEFINE_GUID(MFMediaType_Stream, 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x5 DEFINE_GUID(MFMediaType_Subtitle, 0xa6d13581, 0xed50, 0x4e65, 0xae, 0x08, 0x26, 0x06, 0x55, 0x76, 0xaa, 0xcc); DEFINE_GUID(MFMediaType_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
-DEFINE_GUID(MFSampleExtension_DecodeTimestamp, 0x73a954d4, 0x09e2, 0x4861, 0xbe, 0xfc, 0x94, 0xbd, 0x97, 0xc0, 0x8e, 0x6e); -DEFINE_GUID(MFSampleExtension_Timestamp, 0x1e436999, 0x69be, 0x4c7a, 0x93, 0x69, 0x70, 0x06, 0x8c, 0x02, 0x60, 0xcb); -DEFINE_GUID(MFSampleExtension_Token, 0x8294da66, 0xf328, 0x4805, 0xb5, 0x51, 0x00, 0xde, 0xb4, 0xc5, 0x7a, 0x61); +DEFINE_GUID(MFSampleExtension_DecodeTimestamp, 0x73a954d4, 0x09e2, 0x4861, 0xbe, 0xfc, 0x94, 0xbd, 0x97, 0xc0, 0x8e, 0x6e); +DEFINE_GUID(MFSampleExtension_Timestamp, 0x1e436999, 0x69be, 0x4c7a, 0x93, 0x69, 0x70, 0x06, 0x8c, 0x02, 0x60, 0xcb); +DEFINE_GUID(MFSampleExtension_Token, 0x8294da66, 0xf328, 0x4805, 0xb5, 0x51, 0x00, 0xde, 0xb4, 0xc5, 0x7a, 0x61); +DEFINE_GUID(MFSampleExtension_3DVideo, 0xf86f97a4, 0xdd54, 0x4e2e, 0x9a, 0x5e, 0x55, 0xfc, 0x2d, 0x74, 0xa0, 0x05); +DEFINE_GUID(MFSampleExtension_3DVideo_SampleFormat, 0x08671772, 0xe36f, 0x4cff, 0x97, 0xb3, 0xd7, 0x2e, 0x20, 0x98, 0x7a, 0x48); +DEFINE_GUID(MFSampleExtension_TargetGlobalLuminance, 0x3f60ef36, 0x31ef, 0x4daf, 0x83, 0x60, 0x94, 0x03, 0x97, 0xe4, 0x1e, 0xf3); +DEFINE_GUID(MFSampleExtension_ForwardedDecodeUnits, 0x424c754c, 0x97c8, 0x48d6, 0x87, 0x77, 0xfc, 0x41, 0xf7, 0xb6, 0x08, 0x79); +DEFINE_GUID(MFSampleExtension_ForwardedDecodeUnitType, 0x089e57c7, 0x47d3, 0x4a26, 0xbf, 0x9c, 0x4b, 0x64, 0xfa, 0xfb, 0x5d, 0x1e);
DEFINE_GUID(MF_EVENT_DO_THINNING, 0x321ea6fb, 0xdad9, 0x46e4, 0xb3, 0x1d, 0xd2, 0xea, 0xe7, 0x09, 0x0e, 0x30); DEFINE_GUID(MF_EVENT_MFT_CONTEXT, 0xb7cd31f1, 0x899e, 0x4b41, 0x80, 0xc9, 0x26, 0xa8, 0x96, 0xd3, 0x29, 0x77);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 132 ++++++++++++++++++++++++++++++++++++++++++++- include/mfapi.h | 121 ++++++++++++++++++++++++++++++++++++++++- include/mmreg.h | 19 +++++++ 3 files changed, 270 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 61ee51da34..7edf985d03 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -686,6 +686,136 @@ static const char *debugstr_attr(const GUID *guid) return ret ? wine_dbg_sprintf("%s", ret->name) : wine_dbgstr_guid(guid); }
+static const char *debugstr_mf_guid(const GUID *guid) +{ + static const struct guid_def guid_defs[] = + { +#define X(g) { &(g), #g } + X(MFAudioFormat_ADTS), + X(MFAudioFormat_PCM), + X(MFAudioFormat_PCM_HDCP), + X(MFAudioFormat_Float), + X(MFAudioFormat_DTS), + X(MFAudioFormat_DRM), + X(MFAudioFormat_MSP1), + X(MFAudioFormat_Vorbis), + X(MFAudioFormat_AAC), + X(MFVideoFormat_RGB24), + X(MFVideoFormat_ARGB32), + X(MFVideoFormat_RGB32), + X(MFVideoFormat_RGB565), + X(MFVideoFormat_RGB555), + X(MFVideoFormat_A2R10G10B10), + X(MFMediaType_Script), + X(MFMediaType_Image), + X(MFMediaType_HTML), + X(MFMediaType_Binary), + X(MFVideoFormat_MPEG2), + X(MFMediaType_FileTransfer), + X(MFVideoFormat_RGB8), + X(MFAudioFormat_Dolby_AC3), + X(MFVideoFormat_L8), + X(MFAudioFormat_LPCM), + X(MFVideoFormat_420O), + X(MFVideoFormat_AI44), + X(MFVideoFormat_AV1), + X(MFVideoFormat_AYUV), + X(MFVideoFormat_H263), + X(MFVideoFormat_H264), + X(MFVideoFormat_H265), + X(MFVideoFormat_HEVC), + X(MFVideoFormat_HEVC_ES), + X(MFVideoFormat_I420), + X(MFVideoFormat_IYUV), + X(MFVideoFormat_M4S2), + X(MFVideoFormat_MJPG), + X(MFVideoFormat_MP43), + X(MFVideoFormat_MP4S), + X(MFVideoFormat_MP4V), + X(MFVideoFormat_MPG1), + X(MFVideoFormat_MSS1), + X(MFVideoFormat_MSS2), + X(MFVideoFormat_NV11), + X(MFVideoFormat_NV12), + X(MFVideoFormat_ORAW), + X(MFAudioFormat_Opus), + X(MFVideoFormat_D16), + X(MFAudioFormat_MPEG), + X(MFVideoFormat_P010), + X(MFVideoFormat_P016), + X(MFVideoFormat_P210), + X(MFVideoFormat_P216), + X(MFVideoFormat_L16), + X(MFAudioFormat_MP3), + X(MFVideoFormat_UYVY), + X(MFVideoFormat_VP10), + X(MFVideoFormat_VP80), + X(MFVideoFormat_VP90), + X(MFVideoFormat_WMV1), + X(MFVideoFormat_WMV2), + X(MFVideoFormat_WMV3), + X(MFVideoFormat_WVC1), + X(MFVideoFormat_Y210), + X(MFVideoFormat_Y216), + X(MFVideoFormat_Y410), + X(MFVideoFormat_Y416), + X(MFVideoFormat_Y41P), + X(MFVideoFormat_Y41T), + X(MFVideoFormat_Y42T), + X(MFVideoFormat_YUY2), + X(MFVideoFormat_YV12), + X(MFVideoFormat_YVU9), + X(MFVideoFormat_YVYU), + X(MFAudioFormat_WMAudioV8), + X(MFAudioFormat_ALAC), + X(MFAudioFormat_AMR_NB), + X(MFMediaType_Audio), + X(MFAudioFormat_WMAudioV9), + X(MFAudioFormat_AMR_WB), + X(MFAudioFormat_WMAudio_Lossless), + X(MFAudioFormat_AMR_WP), + X(MFAudioFormat_WMASPDIF), + X(MFVideoFormat_DV25), + X(MFVideoFormat_DV50), + X(MFVideoFormat_DVC), + X(MFVideoFormat_DVH1), + X(MFVideoFormat_DVHD), + X(MFVideoFormat_DVSD), + X(MFVideoFormat_DVSL), + X(MFVideoFormat_A16B16G16R16F), + X(MFVideoFormat_v210), + X(MFVideoFormat_v216), + X(MFVideoFormat_v410), + X(MFMediaType_Video), + X(MFAudioFormat_AAC_HDCP), + X(MFAudioFormat_Dolby_AC3_HDCP), + X(MFMediaType_Subtitle), + X(MFMediaType_Stream), + X(MFAudioFormat_Dolby_AC3_SPDIF), + X(MFAudioFormat_Float_SpatialObjects), + X(MFMediaType_SAMI), + X(MFAudioFormat_ADTS_HDCP), + X(MFAudioFormat_FLAC), + X(MFAudioFormat_Dolby_DDPlus), + X(MFMediaType_MultiplexedFrames), + X(MFAudioFormat_Base_HDCP), + X(MFVideoFormat_Base_HDCP), + X(MFVideoFormat_H264_HDCP), + X(MFVideoFormat_HEVC_HDCP), + X(MFMediaType_Default), + X(MFMediaType_Protected), + X(MFVideoFormat_H264_ES), + X(MFMediaType_Perception), +#undef X + }; + struct guid_def *ret = NULL; + + if (guid) + ret = bsearch(guid, guid_defs, ARRAY_SIZE(guid_defs), sizeof(*guid_defs), debug_compare_guid); + + return ret ? wine_dbg_sprintf("%s", ret->name) : wine_dbgstr_guid(guid); +} + static inline struct attributes *impl_from_IMFAttributes(IMFAttributes *iface) { return CONTAINING_RECORD(iface, struct attributes, IMFAttributes_iface); @@ -1311,7 +1441,7 @@ static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, RE struct attributes *attributes = impl_from_IMFAttributes(iface); PROPVARIANT attrval;
- TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_guid(value)); + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_mf_guid(value));
InitPropVariantFromCLSID(value, &attrval); return attributes_set_item(attributes, key, &attrval); diff --git a/include/mfapi.h b/include/mfapi.h index 579f7003c5..775a89f240 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -48,6 +48,7 @@ extern "C" { DEFINE_GUID(name, format, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
#ifndef DIRECT3D_VERSION +#define LOCAL_D3DFMT_DEFINES 1 #define D3DFMT_R8G8B8 20 #define D3DFMT_A8R8G8B8 21 #define D3DFMT_X8R8G8B8 22 @@ -55,10 +56,13 @@ extern "C" { #define D3DFMT_X1R5G5B5 24 #define D3DFMT_A2B10G10R10 31 #define D3DFMT_P8 41 +#define D3DFMT_L8 50 +#define D3DFMT_D16 80 +#define D3DFMT_L16 81 #define D3DFMT_A16B16G16R16F 113 #endif
-DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV3, MAKEFOURCC('W','M','V','3')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Base, 0); DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB8, D3DFMT_P8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB555, D3DFMT_X1R5G5B5); DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB565, D3DFMT_R5G6B5); @@ -67,6 +71,121 @@ DEFINE_MEDIATYPE_GUID(MFVideoFormat_RGB32, D3DFMT_X8R8G8B8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_ARGB32, D3DFMT_A8R8G8B8); DEFINE_MEDIATYPE_GUID(MFVideoFormat_A2R10G10B10, D3DFMT_A2B10G10R10); DEFINE_MEDIATYPE_GUID(MFVideoFormat_A16B16G16R16F, D3DFMT_A16B16G16R16F); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_L8, D3DFMT_L8); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_L16, D3DFMT_L16); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_D16, D3DFMT_D16); + +DEFINE_MEDIATYPE_GUID(MFVideoFormat_420O, MAKEFOURCC('4','2','0','O')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVSL, MAKEFOURCC('d','v','s','l')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVSD, MAKEFOURCC('d','v','s','d')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVHD, MAKEFOURCC('d','v','h','d')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DV25, MAKEFOURCC('d','v','2','5')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DV50, MAKEFOURCC('d','v','5','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVH1, MAKEFOURCC('d','v','h','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_DVC, MAKEFOURCC('d','v','c',' ')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_v210, MAKEFOURCC('v','2','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_v216, MAKEFOURCC('v','2','1','6')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_v410, MAKEFOURCC('v','4','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_AI44, MAKEFOURCC('A','I','4','4')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_AV1, MAKEFOURCC('A','V','0','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_AYUV, MAKEFOURCC('A','Y','U','V')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_H263, MAKEFOURCC('H','2','6','3')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_H264, MAKEFOURCC('H','2','6','4')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_H265, MAKEFOURCC('H','2','6','5')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_HEVC, MAKEFOURCC('H','E','V','C')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_HEVC_ES, MAKEFOURCC('H','E','V','S')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_I420, MAKEFOURCC('I','4','2','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_IYUV, MAKEFOURCC('I','Y','U','V')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_M4S2, MAKEFOURCC('M','4','S','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MJPG, MAKEFOURCC('M','J','P','G')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP43, MAKEFOURCC('M','P','4','3')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP4S, MAKEFOURCC('M','P','4','S')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MP4V, MAKEFOURCC('M','P','4','V')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MPG1, MAKEFOURCC('M','P','G','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS1, MAKEFOURCC('M','S','S','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS2, MAKEFOURCC('M','S','S','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV11, MAKEFOURCC('N','V','1','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV12, MAKEFOURCC('N','V','1','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_ORAW, MAKEFOURCC('O','R','A','W')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_P010, MAKEFOURCC('P','0','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_P016, MAKEFOURCC('P','0','1','6')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_P210, MAKEFOURCC('P','2','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_P216, MAKEFOURCC('P','2','1','6')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_UYVY, MAKEFOURCC('U','Y','V','Y')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP10, MAKEFOURCC('V','P','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP80, MAKEFOURCC('V','P','8','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_VP90, MAKEFOURCC('V','P','9','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y210, MAKEFOURCC('Y','2','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y216, MAKEFOURCC('Y','2','1','6')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y410, MAKEFOURCC('Y','4','1','0')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y416, MAKEFOURCC('Y','4','1','6')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y41P, MAKEFOURCC('Y','4','1','P')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y41T, MAKEFOURCC('Y','4','1','T')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_Y42T, MAKEFOURCC('Y','4','2','T')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_YUY2, MAKEFOURCC('Y','U','Y','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_YV12, MAKEFOURCC('Y','V','1','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_YVYU, MAKEFOURCC('Y','V','Y','U')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_YVU9, MAKEFOURCC('Y','V','U','9')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV1, MAKEFOURCC('W','M','V','1')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV2, MAKEFOURCC('W','M','V','2')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_WMV3, MAKEFOURCC('W','M','V','3')); +DEFINE_MEDIATYPE_GUID(MFVideoFormat_WVC1, MAKEFOURCC('W','V','C','1')); + +DEFINE_GUID(MFVideoFormat_Base_HDCP, 0xeac3b9d5, 0xbd14, 0x4237, 0x8f, 0x1f, 0xba, 0xb4, 0x28, 0xe4, 0x93, 0x12); +DEFINE_GUID(MFVideoFormat_H264_ES, 0x3f40f4f0, 0x5622, 0x4ff8, 0xb6, 0xd8, 0xa1, 0x7a, 0x58, 0x4b, 0xee, 0x5e); +DEFINE_GUID(MFVideoFormat_H264_HDCP, 0x5d0ce9dd, 0x9817, 0x49da, 0xbd, 0xfd, 0xf5, 0xf5, 0xb9, 0x8f, 0x18, 0xa6); +DEFINE_GUID(MFVideoFormat_HEVC_HDCP, 0x3cfe0fe6, 0x05c4, 0x47dc, 0x9d, 0x70, 0x4b, 0xdb, 0x29, 0x59, 0x72, 0x0f); +DEFINE_GUID(MFVideoFormat_MPEG2, 0xe06d8026, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); + +#define MFVideoFormat_MPG2 MFVideoFormat_MPEG2 + +#ifdef LOCAL_D3DFMT_DEFINES +#undef D3DFMT_R8G8B8 +#undef D3DFMT_A8R8G8B8 +#undef D3DFMT_X8R8G8B8 +#undef D3DFMT_R5G6B5 +#undef D3DFMT_X1R5G5B5 +#undef D3DFMT_A2B10G10R10 +#undef D3DFMT_P8 +#undef D3DFMT_L8 +#undef D3DFMT_D16 +#undef D3DFMT_L16 +#undef D3DFMT_A16B16G16R16F +#undef LOCAL_D3DFMT_DEFINES +#endif + +DEFINE_MEDIATYPE_GUID(MFAudioFormat_Base, 0); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_AAC, WAVE_FORMAT_MPEG_HEAAC); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_ADTS, WAVE_FORMAT_MPEG_ADTS_AAC); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_ALAC, WAVE_FORMAT_ALAC); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_NB, WAVE_FORMAT_AMR_NB); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_WB, WAVE_FORMAT_AMR_WB); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_AMR_WP, WAVE_FORMAT_AMR_WP); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_Dolby_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_DRM, WAVE_FORMAT_DRM); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_DTS, WAVE_FORMAT_DTS); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_Float, WAVE_FORMAT_IEEE_FLOAT); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_FLAC, WAVE_FORMAT_FLAC); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_MP3, WAVE_FORMAT_MPEGLAYER3); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_MPEG, WAVE_FORMAT_MPEG); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_MSP1, WAVE_FORMAT_WMAVOICE9); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_Opus, WAVE_FORMAT_OPUS); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_PCM, WAVE_FORMAT_PCM); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudioV8, WAVE_FORMAT_WMAUDIO2); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudioV9, WAVE_FORMAT_WMAUDIO3); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMAudio_Lossless, WAVE_FORMAT_WMAUDIO_LOSSLESS); +DEFINE_MEDIATYPE_GUID(MFAudioFormat_WMASPDIF, WAVE_FORMAT_WMASPDIF); + +DEFINE_GUID(MFAudioFormat_AAC_HDCP, 0x419bce76, 0x8b72, 0x400f, 0xad, 0xeb, 0x84, 0xb5, 0x7d, 0x63, 0x48, 0x4d); +DEFINE_GUID(MFAudioFormat_ADTS_HDCP, 0xda4963a3, 0x14d8, 0x4dcf, 0x92, 0xb7, 0x19, 0x3e, 0xb8, 0x43, 0x63, 0xdb); +DEFINE_GUID(MFAudioFormat_Base_HDCP, 0x3884b5bc, 0xe277, 0x43fd, 0x98, 0x3d, 0x03, 0x8a, 0xa8, 0xd9, 0xb6, 0x05); +DEFINE_GUID(MFAudioFormat_Dolby_AC3, 0xe06d802c, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); +DEFINE_GUID(MFAudioFormat_Dolby_AC3_HDCP, 0x97663a80, 0x8ffb, 0x4445, 0xa6, 0xba, 0x79, 0x2d, 0x90, 0x8f, 0x49, 0x7f); +DEFINE_GUID(MFAudioFormat_Dolby_DDPlus, 0xa7fb87af, 0x2d02, 0x42fb, 0xa4, 0xd4, 0x05, 0xcd, 0x93, 0x84, 0x3b, 0xdd); +DEFINE_GUID(MFAudioFormat_Float_SpatialObjects, 0xfa39cd94, 0xbc64, 0x4ab1, 0x9b, 0x71, 0xdc, 0xd0, 0x9d, 0x5a, 0x7e, 0x7a); +DEFINE_GUID(MFAudioFormat_LPCM, 0xe06d8032, 0xdb46, 0x11cf, 0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea); +DEFINE_GUID(MFAudioFormat_PCM_HDCP, 0xa5e7ff01, 0x8411, 0x4acc, 0xa8, 0x65, 0x5f, 0x49, 0x41, 0x28, 0x8d, 0x80); +DEFINE_GUID(MFAudioFormat_Vorbis, 0x8d2fd10b, 0x5841, 0x4a6b, 0x89, 0x05, 0x58, 0x8f, 0xec, 0x1a, 0xde, 0xd9);
#if defined(__cplusplus) && !defined(CINTERFACE) typedef struct tagMFASYNCRESULT : public IMFAsyncResult { diff --git a/include/mmreg.h b/include/mmreg.h index 8bb581dd79..e7d70bbd63 100644 --- a/include/mmreg.h +++ b/include/mmreg.h @@ -77,11 +77,17 @@ typedef struct _WAVEFORMATEX {
/* WAVE form wFormatTag IDs */ #define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */ +#ifndef WAVE_FORMAT_PCM +#define WAVE_FORMAT_PCM 0x0001 +#endif #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ #define WAVE_FORMAT_IEEE_FLOAT 0x0003 /* Microsoft Corporation */ #define WAVE_FORMAT_IBM_CVSD 0x0005 /* IBM Corporation */ #define WAVE_FORMAT_ALAW 0x0006 /* Microsoft Corporation */ #define WAVE_FORMAT_MULAW 0x0007 /* Microsoft Corporation */ +#define WAVE_FORMAT_DTS 0x0008 +#define WAVE_FORMAT_DRM 0x0009 +#define WAVE_FORMAT_WMAVOICE9 0x000a #define WAVE_FORMAT_OKI_ADPCM 0x0010 /* OKI */ #define WAVE_FORMAT_DVI_ADPCM 0x0011 /* Intel Corporation */ #define WAVE_FORMAT_IMA_ADPCM (WAVE_FORMAT_DVI_ADPCM) /* Intel Corporation */ @@ -110,6 +116,11 @@ typedef struct _WAVEFORMATEX { #define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */ #define WAVE_FORMAT_MPEGLAYER3 0x0055 #define WAVE_FORMAT_MSRT24 0x0082 /* Microsoft Corporation */ +#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092 +#define WAVE_FORMAT_WMAUDIO2 0x0161 +#define WAVE_FORMAT_WMAUDIO3 0x0162 +#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163 +#define WAVE_FORMAT_WMASPDIF 0x0164 #define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 /* Creative Labs, Inc */ #define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202 /* Creative Labs, Inc */ #define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203 /* Creative Labs, Inc */ @@ -119,6 +130,14 @@ typedef struct _WAVEFORMATEX { #define WAVE_FORMAT_OLICELP 0x1002 /* Ing C. Olivetti & C., S.p.A. */ #define WAVE_FORMAT_OLISBC 0x1003 /* Ing C. Olivetti & C., S.p.A. */ #define WAVE_FORMAT_OLIOPR 0x1004 /* Ing C. Olivetti & C., S.p.A. */ +#define WAVE_FORMAT_MPEG_ADTS_AAC 0x1600 +#define WAVE_FORMAT_MPEG_HEAAC 0x1610 +#define WAVE_FORMAT_ALAC 0x6c61 +#define WAVE_FORMAT_OPUS 0x704f +#define WAVE_FORMAT_AMR_NB 0x7361 +#define WAVE_FORMAT_AMR_WB 0x7362 +#define WAVE_FORMAT_AMR_WP 0x7363 +#define WAVE_FORMAT_FLAC 0xf1ac
#ifndef MM_MICROSOFT #define MM_MICROSOFT 0x01
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 1053 +++++++++++++++++++++++++++++++++++++++ dlls/mfplat/mfplat.spec | 1 + include/mfidl.idl | 18 + include/mfobjects.idl | 17 + 4 files changed, 1089 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 7edf985d03..385eb25dc8 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -29,6 +29,7 @@
#include "initguid.h" #include "ole2.h" +#include "propsys.h"
#include "wine/debug.h" #include "wine/unicode.h" @@ -2932,6 +2933,1058 @@ HRESULT WINAPI MFCreateFile(MF_FILE_ACCESSMODE accessmode, MF_FILE_OPENMODE open return S_OK; }
+struct bytestream_wrapper +{ + IMFByteStreamCacheControl IMFByteStreamCacheControl_iface; + IMFByteStreamBuffering IMFByteStreamBuffering_iface; + IMFMediaEventGenerator IMFMediaEventGenerator_iface; + IMFByteStreamTimeSeek IMFByteStreamTimeSeek_iface; + IMFSampleOutputStream IMFSampleOutputStream_iface; + IPropertyStore IPropertyStore_iface; + IMFByteStream IMFByteStream_iface; + IMFAttributes IMFAttributes_iface; + LONG refcount; + + IMFByteStreamCacheControl *cache_control; + IMFByteStreamBuffering *stream_buffering; + IMFMediaEventGenerator *event_generator; + IMFByteStreamTimeSeek *time_seek; + IMFSampleOutputStream *sample_output; + IPropertyStore *propstore; + IMFByteStream *stream; + IMFAttributes *attributes; + BOOL is_closed; +}; + +static struct bytestream_wrapper *impl_wrapper_from_IMFByteStream(IMFByteStream *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFByteStream_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFByteStreamCacheControl(IMFByteStreamCacheControl *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFByteStreamCacheControl_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFByteStreamBuffering(IMFByteStreamBuffering *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFByteStreamBuffering_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFMediaEventGenerator(IMFMediaEventGenerator *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFMediaEventGenerator_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFByteStreamTimeSeek(IMFByteStreamTimeSeek *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFByteStreamTimeSeek_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFSampleOutputStream(IMFSampleOutputStream *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFSampleOutputStream_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IPropertyStore(IPropertyStore *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IPropertyStore_iface); +} + +static struct bytestream_wrapper *impl_wrapper_from_IMFAttributes(IMFAttributes *iface) +{ + return CONTAINING_RECORD(iface, struct bytestream_wrapper, IMFAttributes_iface); +} + +static HRESULT WINAPI bytestream_wrapper_QueryInterface(IMFByteStream *iface, REFIID riid, void **out) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFByteStream) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = &wrapper->IMFByteStream_iface; + } + else if (wrapper->cache_control && IsEqualIID(riid, &IID_IMFByteStreamCacheControl)) + { + *out = &wrapper->IMFByteStreamCacheControl_iface; + } + else if (wrapper->stream_buffering && IsEqualIID(riid, &IID_IMFByteStreamBuffering)) + { + *out = &wrapper->IMFByteStreamBuffering_iface; + } + else if (wrapper->event_generator && IsEqualIID(riid, &IID_IMFMediaEventGenerator)) + { + *out = &wrapper->IMFMediaEventGenerator_iface; + } + else if (wrapper->time_seek && IsEqualIID(riid, &IID_IMFByteStreamTimeSeek)) + { + *out = &wrapper->IMFByteStreamTimeSeek_iface; + } + else if (wrapper->sample_output && IsEqualIID(riid, &IID_IMFSampleOutputStream)) + { + *out = &wrapper->IMFSampleOutputStream_iface; + } + else if (wrapper->propstore && IsEqualIID(riid, &IID_IPropertyStore)) + { + *out = &wrapper->IPropertyStore_iface; + } + else if (wrapper->attributes && IsEqualIID(riid, &IID_IMFAttributes)) + { + *out = &wrapper->IMFAttributes_iface; + } + else + { + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG WINAPI bytestream_wrapper_AddRef(IMFByteStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + ULONG refcount = InterlockedIncrement(&wrapper->refcount); + + TRACE("%p, refcount %d.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI bytestream_wrapper_Release(IMFByteStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + ULONG refcount = InterlockedDecrement(&wrapper->refcount); + + TRACE("%p, refcount %d.\n", iface, refcount); + + if (!refcount) + { + if (wrapper->cache_control) + IMFByteStreamCacheControl_Release(wrapper->cache_control); + if (wrapper->stream_buffering) + IMFByteStreamBuffering_Release(wrapper->stream_buffering); + if (wrapper->event_generator) + IMFMediaEventGenerator_Release(wrapper->event_generator); + if (wrapper->time_seek) + IMFByteStreamTimeSeek_Release(wrapper->time_seek); + if (wrapper->sample_output) + IMFSampleOutputStream_Release(wrapper->sample_output); + if (wrapper->propstore) + IPropertyStore_Release(wrapper->propstore); + if (wrapper->attributes) + IMFAttributes_Release(wrapper->attributes); + IMFByteStream_Release(wrapper->stream); + heap_free(wrapper); + } + + return refcount; +} + +static HRESULT WINAPI bytestream_wrapper_GetCapabilities(IMFByteStream *iface, DWORD *capabilities) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p.\n", iface, capabilities); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_GetCapabilities(wrapper->stream, capabilities); +} + +static HRESULT WINAPI bytestream_wrapper_GetLength(IMFByteStream *iface, QWORD *length) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p.\n", iface, length); + + if (wrapper->is_closed) + return MF_E_INVALIDREQUEST; + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_GetLength(wrapper->stream, length); +} + +static HRESULT WINAPI bytestream_wrapper_SetLength(IMFByteStream *iface, QWORD length) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(length)); + + if (wrapper->is_closed) + return MF_E_INVALIDREQUEST; + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_SetLength(wrapper->stream, length); +} + +static HRESULT WINAPI bytestream_wrapper_GetCurrentPosition(IMFByteStream *iface, QWORD *position) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p.\n", iface, position); + + if (wrapper->is_closed) + return MF_E_INVALIDREQUEST; + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_GetCurrentPosition(wrapper->stream, position); +} + +static HRESULT WINAPI bytestream_wrapper_SetCurrentPosition(IMFByteStream *iface, QWORD position) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(position)); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_SetCurrentPosition(wrapper->stream, position); +} + +static HRESULT WINAPI bytestream_wrapper_IsEndOfStream(IMFByteStream *iface, BOOL *eos) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p.\n", iface, eos); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_IsEndOfStream(wrapper->stream, eos); +} + +static HRESULT WINAPI bytestream_wrapper_Read(IMFByteStream *iface, BYTE *data, ULONG count, ULONG *byte_read) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %u, %p.\n", iface, data, count, byte_read); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_Read(wrapper->stream, data, count, byte_read); +} + +static HRESULT WINAPI bytestream_wrapper_BeginRead(IMFByteStream *iface, BYTE *data, ULONG size, + IMFAsyncCallback *callback, IUnknown *state) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %u, %p, %p.\n", iface, data, size, callback, state); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_BeginRead(wrapper->stream, data, size, callback, state); +} + +static HRESULT WINAPI bytestream_wrapper_EndRead(IMFByteStream *iface, IMFAsyncResult *result, ULONG *byte_read) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %p.\n", iface, result, byte_read); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_EndRead(wrapper->stream, result, byte_read); +} + +static HRESULT WINAPI bytestream_wrapper_Write(IMFByteStream *iface, const BYTE *data, ULONG count, ULONG *written) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %u, %p.\n", iface, data, count, written); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_Write(wrapper->stream, data, count, written); +} + +static HRESULT WINAPI bytestream_wrapper_BeginWrite(IMFByteStream *iface, const BYTE *data, ULONG size, + IMFAsyncCallback *callback, IUnknown *state) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %u, %p, %p.\n", iface, data, size, callback, state); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_BeginWrite(wrapper->stream, data, size, callback, state); +} + +static HRESULT WINAPI bytestream_wrapper_EndWrite(IMFByteStream *iface, IMFAsyncResult *result, ULONG *written) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %p, %p.\n", iface, result, written); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_EndWrite(wrapper->stream, result, written); +} + +static HRESULT WINAPI bytestream_wrapper_Seek(IMFByteStream *iface, MFBYTESTREAM_SEEK_ORIGIN seek, LONGLONG offset, + DWORD flags, QWORD *current) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p, %u, %s, %#x, %p.\n", iface, seek, wine_dbgstr_longlong(offset), flags, current); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : + IMFByteStream_Seek(wrapper->stream, seek, offset, flags, current); +} + +static HRESULT WINAPI bytestream_wrapper_Flush(IMFByteStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p\n", iface); + + return wrapper->is_closed ? MF_E_INVALIDREQUEST : IMFByteStream_Flush(wrapper->stream); +} + +static HRESULT WINAPI bytestream_wrapper_Close(IMFByteStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStream(iface); + + TRACE("%p\n", iface); + + wrapper->is_closed = TRUE; + + return S_OK; +} + +static const IMFByteStreamVtbl bytestream_wrapper_vtbl = +{ + bytestream_wrapper_QueryInterface, + bytestream_wrapper_AddRef, + bytestream_wrapper_Release, + bytestream_wrapper_GetCapabilities, + bytestream_wrapper_GetLength, + bytestream_wrapper_SetLength, + bytestream_wrapper_GetCurrentPosition, + bytestream_wrapper_SetCurrentPosition, + bytestream_wrapper_IsEndOfStream, + bytestream_wrapper_Read, + bytestream_wrapper_BeginRead, + bytestream_wrapper_EndRead, + bytestream_wrapper_Write, + bytestream_wrapper_BeginWrite, + bytestream_wrapper_EndWrite, + bytestream_wrapper_Seek, + bytestream_wrapper_Flush, + bytestream_wrapper_Close, +}; + +static HRESULT WINAPI bytestream_wrapper_cache_control_QueryInterface(IMFByteStreamCacheControl *iface, + REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamCacheControl(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_cache_control_AddRef(IMFByteStreamCacheControl *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamCacheControl(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_cache_control_Release(IMFByteStreamCacheControl *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamCacheControl(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_cache_control_StopBackgroundTransfer(IMFByteStreamCacheControl *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamCacheControl(iface); + + TRACE("%p.\n", iface); + + return IMFByteStreamCacheControl_StopBackgroundTransfer(wrapper->cache_control); +} + +static const IMFByteStreamCacheControlVtbl bytestream_wrapper_cache_control_vtbl = +{ + bytestream_wrapper_cache_control_QueryInterface, + bytestream_wrapper_cache_control_AddRef, + bytestream_wrapper_cache_control_Release, + bytestream_wrapper_cache_control_StopBackgroundTransfer, +}; + +static HRESULT WINAPI bytestream_wrapper_buffering_QueryInterface(IMFByteStreamBuffering *iface, + REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_buffering_AddRef(IMFByteStreamBuffering *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_buffering_Release(IMFByteStreamBuffering *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_buffering_SetBufferingParams(IMFByteStreamBuffering *iface, + MFBYTESTREAM_BUFFERING_PARAMS *params) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + + TRACE("%p, %p.\n", iface, params); + + return IMFByteStreamBuffering_SetBufferingParams(wrapper->stream_buffering, params); +} + +static HRESULT WINAPI bytestream_wrapper_buffering_EnableBuffering(IMFByteStreamBuffering *iface, + BOOL enable) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + + TRACE("%p, %d.\n", iface, enable); + + return IMFByteStreamBuffering_EnableBuffering(wrapper->stream_buffering, enable); +} + +static HRESULT WINAPI bytestream_wrapper_buffering_StopBuffering(IMFByteStreamBuffering *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamBuffering(iface); + + TRACE("%p.\n", iface); + + return IMFByteStreamBuffering_StopBuffering(wrapper->stream_buffering); +} + +static const IMFByteStreamBufferingVtbl bytestream_wrapper_buffering_vtbl = +{ + bytestream_wrapper_buffering_QueryInterface, + bytestream_wrapper_buffering_AddRef, + bytestream_wrapper_buffering_Release, + bytestream_wrapper_buffering_SetBufferingParams, + bytestream_wrapper_buffering_EnableBuffering, + bytestream_wrapper_buffering_StopBuffering, +}; + +static HRESULT WINAPI bytestream_wrapper_timeseek_QueryInterface(IMFByteStreamTimeSeek *iface, + REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_timeseek_AddRef(IMFByteStreamTimeSeek *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_timeseek_Release(IMFByteStreamTimeSeek *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_timeseek_IsTimeSeekSupported(IMFByteStreamTimeSeek *iface, BOOL *result) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + + TRACE("%p, %p.\n", iface, result); + + return IMFByteStreamTimeSeek_IsTimeSeekSupported(wrapper->time_seek, result); +} + +static HRESULT WINAPI bytestream_wrapper_timeseek_TimeSeek(IMFByteStreamTimeSeek *iface, QWORD position) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + + TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(position)); + + return IMFByteStreamTimeSeek_TimeSeek(wrapper->time_seek, position); +} + +static HRESULT WINAPI bytestream_wrapper_timeseek_GetTimeSeekResult(IMFByteStreamTimeSeek *iface, QWORD *start_time, + QWORD *stop_time, QWORD *duration) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFByteStreamTimeSeek(iface); + + TRACE("%p, %p, %p, %p.\n", iface, start_time, stop_time, duration); + + return IMFByteStreamTimeSeek_GetTimeSeekResult(wrapper->time_seek, start_time, stop_time, duration); +} + +static const IMFByteStreamTimeSeekVtbl bytestream_wrapper_timeseek_vtbl = +{ + bytestream_wrapper_timeseek_QueryInterface, + bytestream_wrapper_timeseek_AddRef, + bytestream_wrapper_timeseek_Release, + bytestream_wrapper_timeseek_IsTimeSeekSupported, + bytestream_wrapper_timeseek_TimeSeek, + bytestream_wrapper_timeseek_GetTimeSeekResult, +}; + +static HRESULT WINAPI bytestream_wrapper_events_QueryInterface(IMFMediaEventGenerator *iface, REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_events_AddRef(IMFMediaEventGenerator *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_events_Release(IMFMediaEventGenerator *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_events_GetEvent(IMFMediaEventGenerator *iface, DWORD flags, IMFMediaEvent **event) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + + TRACE("%p, %#x, %p.\n", iface, flags, event); + + return IMFMediaEventGenerator_GetEvent(wrapper->event_generator, flags, event); +} + +static HRESULT WINAPI bytestream_wrapper_events_BeginGetEvent(IMFMediaEventGenerator *iface, IMFAsyncCallback *callback, IUnknown *state) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + + TRACE("%p, %p, %p.\n", iface, callback, state); + + return IMFMediaEventGenerator_BeginGetEvent(wrapper->event_generator, callback, state); +} + +static HRESULT WINAPI bytestream_wrapper_events_EndGetEvent(IMFMediaEventGenerator *iface, IMFAsyncResult *result, IMFMediaEvent **event) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + + TRACE("%p, %p, %p.\n", iface, result, event); + + return IMFMediaEventGenerator_EndGetEvent(wrapper->event_generator, result, event); +} + +static HRESULT WINAPI bytestream_wrapper_events_QueueEvent(IMFMediaEventGenerator *iface, MediaEventType type, REFGUID ext_type, HRESULT hr, const PROPVARIANT *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFMediaEventGenerator(iface); + + TRACE("%p, %d, %s, %#x, %p.\n", iface, type, debugstr_guid(ext_type), hr, value); + + return IMFMediaEventGenerator_QueueEvent(wrapper->event_generator, type, ext_type, hr, value); +} + +static const IMFMediaEventGeneratorVtbl bytestream_wrapper_events_vtbl = +{ + bytestream_wrapper_events_QueryInterface, + bytestream_wrapper_events_AddRef, + bytestream_wrapper_events_Release, + bytestream_wrapper_events_GetEvent, + bytestream_wrapper_events_BeginGetEvent, + bytestream_wrapper_events_EndGetEvent, + bytestream_wrapper_events_QueueEvent, +}; + +static HRESULT WINAPI bytestream_wrapper_sample_output_QueryInterface(IMFSampleOutputStream *iface, REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_sample_output_AddRef(IMFSampleOutputStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_sample_output_Release(IMFSampleOutputStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_sample_output_BeginWriteSample(IMFSampleOutputStream *iface, IMFSample *sample, + IMFAsyncCallback *callback, IUnknown *state) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + + TRACE("%p, %p, %p, %p.\n", iface, sample, callback, state); + + return IMFSampleOutputStream_BeginWriteSample(wrapper->sample_output, sample, callback, state); +} + +static HRESULT WINAPI bytestream_wrapper_sample_output_EndWriteSample(IMFSampleOutputStream *iface, IMFAsyncResult *result) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + + TRACE("%p, %p.\n", iface, result); + + return IMFSampleOutputStream_EndWriteSample(wrapper->sample_output, result); +} + +static HRESULT WINAPI bytestream_wrapper_sample_output_Close(IMFSampleOutputStream *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFSampleOutputStream(iface); + + TRACE("%p.\n", iface); + + return IMFSampleOutputStream_Close(wrapper->sample_output); +} + +static const IMFSampleOutputStreamVtbl bytestream_wrapper_sample_output_vtbl = +{ + bytestream_wrapper_sample_output_QueryInterface, + bytestream_wrapper_sample_output_AddRef, + bytestream_wrapper_sample_output_Release, + bytestream_wrapper_sample_output_BeginWriteSample, + bytestream_wrapper_sample_output_EndWriteSample, + bytestream_wrapper_sample_output_Close, +}; + +static HRESULT WINAPI bytestream_wrapper_propstore_QueryInterface(IPropertyStore *iface, REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_propstore_AddRef(IPropertyStore *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_propstore_Release(IPropertyStore *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_propstore_GetCount(IPropertyStore *iface, DWORD *count) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + + TRACE("%p, %p.\n", iface, count); + + return IPropertyStore_GetCount(wrapper->propstore, count); +} + +static HRESULT WINAPI bytestream_wrapper_propstore_GetAt(IPropertyStore *iface, DWORD prop, PROPERTYKEY *key) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + + TRACE("%p, %u, %p.\n", iface, prop, key); + + return IPropertyStore_GetAt(wrapper->propstore, prop, key); +} + +static HRESULT WINAPI bytestream_wrapper_propstore_GetValue(IPropertyStore *iface, REFPROPERTYKEY key, PROPVARIANT *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + + TRACE("%p, %p, %p.\n", iface, key, value); + + return IPropertyStore_GetValue(wrapper->propstore, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_propstore_SetValue(IPropertyStore *iface, REFPROPERTYKEY key, const PROPVARIANT *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + + TRACE("%p, %p, %p.\n", iface, key, value); + + return IPropertyStore_SetValue(wrapper->propstore, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_propstore_Commit(IPropertyStore *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IPropertyStore(iface); + + TRACE("%p.\n", iface); + + return IPropertyStore_Commit(wrapper->propstore); +} + +static const IPropertyStoreVtbl bytestream_wrapper_propstore_vtbl = +{ + bytestream_wrapper_propstore_QueryInterface, + bytestream_wrapper_propstore_AddRef, + bytestream_wrapper_propstore_Release, + bytestream_wrapper_propstore_GetCount, + bytestream_wrapper_propstore_GetAt, + bytestream_wrapper_propstore_GetValue, + bytestream_wrapper_propstore_SetValue, + bytestream_wrapper_propstore_Commit, +}; + +static HRESULT WINAPI bytestream_wrapper_attributes_QueryInterface(IMFAttributes *iface, REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + return IMFByteStream_QueryInterface(&wrapper->IMFByteStream_iface, riid, obj); +} + +static ULONG WINAPI bytestream_wrapper_attributes_AddRef(IMFAttributes *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + return IMFByteStream_AddRef(&wrapper->IMFByteStream_iface); +} + +static ULONG WINAPI bytestream_wrapper_attributes_Release(IMFAttributes *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + return IMFByteStream_Release(&wrapper->IMFByteStream_iface); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetItem(IMFAttributes *iface, REFGUID key, PROPVARIANT *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_GetItem(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetItemType(IMFAttributes *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), type); + + return IMFAttributes_GetItemType(wrapper->attributes, key, type); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, result); + + return IMFAttributes_CompareItem(wrapper->attributes, key, value, result); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, + MF_ATTRIBUTES_MATCH_TYPE match_type, BOOL *ret) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %p, %d, %p.\n", iface, theirs, match_type, ret); + + return IMFAttributes_Compare(wrapper->attributes, theirs, match_type, ret); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetUINT32(IMFAttributes *iface, REFGUID key, UINT32 *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_GetUINT32(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetUINT64(IMFAttributes *iface, REFGUID key, UINT64 *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_GetUINT64(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetDouble(IMFAttributes *iface, REFGUID key, double *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_GetDouble(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_GetGUID(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), length); + + return IMFAttributes_GetStringLength(wrapper->attributes, key, length); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetString(IMFAttributes *iface, REFGUID key, WCHAR *value, + UINT32 size, UINT32 *length) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), value, size, length); + + return IMFAttributes_GetString(wrapper->attributes, key, value, size, length); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetAllocatedString(IMFAttributes *iface, REFGUID key, WCHAR **value, UINT32 *length) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), value, length); + + return IMFAttributes_GetAllocatedString(wrapper->attributes, key, value, length); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), size); + + return IMFAttributes_GetBlobSize(wrapper->attributes, key, size); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf, + UINT32 bufsize, UINT32 *blobsize) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %d, %p.\n", iface, debugstr_attr(key), buf, bufsize, blobsize); + + return IMFAttributes_GetBlob(wrapper->attributes, key, buf, bufsize, blobsize); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %p.\n", iface, debugstr_attr(key), buf, size); + + return IMFAttributes_GetAllocatedBlob(wrapper->attributes, key, buf, size); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **obj) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %s, %p.\n", iface, debugstr_attr(key), debugstr_guid(riid), obj); + + return IMFAttributes_GetUnknown(wrapper->attributes, key, riid, obj); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_SetItem(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_DeleteItem(IMFAttributes *iface, REFGUID key) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s.\n", iface, debugstr_attr(key)); + + return IMFAttributes_DeleteItem(wrapper->attributes, key); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_DeleteAllItems(IMFAttributes *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return IMFAttributes_DeleteAllItems(wrapper->attributes); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetUINT32(IMFAttributes *iface, REFGUID key, UINT32 value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %d.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_SetUINT32(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetUINT64(IMFAttributes *iface, REFGUID key, UINT64 value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), wine_dbgstr_longlong(value)); + + return IMFAttributes_SetUINT64(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetDouble(IMFAttributes *iface, REFGUID key, double value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %f.\n", iface, debugstr_attr(key), value); + + return IMFAttributes_SetDouble(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_mf_guid(value)); + + return IMFAttributes_SetGUID(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %s.\n", iface, debugstr_attr(key), debugstr_w(value)); + + return IMFAttributes_SetString(wrapper->attributes, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p, %u.\n", iface, debugstr_attr(key), buf, size); + + return IMFAttributes_SetBlob(wrapper->attributes, key, buf, size); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %s, %p.\n", iface, debugstr_attr(key), unknown); + + return IMFAttributes_SetUnknown(wrapper->attributes, key, unknown); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_LockStore(IMFAttributes *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return IMFAttributes_LockStore(wrapper->attributes); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_UnlockStore(IMFAttributes *iface) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p.\n", iface); + + return IMFAttributes_UnlockStore(wrapper->attributes); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetCount(IMFAttributes *iface, UINT32 *count) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %p.\n", iface, count); + + return IMFAttributes_GetCount(wrapper->attributes, count); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_GetItemByIndex(IMFAttributes *iface, UINT32 index, GUID *key, PROPVARIANT *value) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %u, %p, %p.\n", iface, index, key, value); + + return IMFAttributes_GetItemByIndex(wrapper->attributes, index, key, value); +} + +static HRESULT WINAPI bytestream_wrapper_attributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest) +{ + struct bytestream_wrapper *wrapper = impl_wrapper_from_IMFAttributes(iface); + + TRACE("%p, %p.\n", iface, dest); + + return IMFAttributes_CopyAllItems(wrapper->attributes, dest); +} + +static const IMFAttributesVtbl bytestream_wrapper_attributes_vtbl = +{ + bytestream_wrapper_attributes_QueryInterface, + bytestream_wrapper_attributes_AddRef, + bytestream_wrapper_attributes_Release, + bytestream_wrapper_attributes_GetItem, + bytestream_wrapper_attributes_GetItemType, + bytestream_wrapper_attributes_CompareItem, + bytestream_wrapper_attributes_Compare, + bytestream_wrapper_attributes_GetUINT32, + bytestream_wrapper_attributes_GetUINT64, + bytestream_wrapper_attributes_GetDouble, + bytestream_wrapper_attributes_GetGUID, + bytestream_wrapper_attributes_GetStringLength, + bytestream_wrapper_attributes_GetString, + bytestream_wrapper_attributes_GetAllocatedString, + bytestream_wrapper_attributes_GetBlobSize, + bytestream_wrapper_attributes_GetBlob, + bytestream_wrapper_attributes_GetAllocatedBlob, + bytestream_wrapper_attributes_GetUnknown, + bytestream_wrapper_attributes_SetItem, + bytestream_wrapper_attributes_DeleteItem, + bytestream_wrapper_attributes_DeleteAllItems, + bytestream_wrapper_attributes_SetUINT32, + bytestream_wrapper_attributes_SetUINT64, + bytestream_wrapper_attributes_SetDouble, + bytestream_wrapper_attributes_SetGUID, + bytestream_wrapper_attributes_SetString, + bytestream_wrapper_attributes_SetBlob, + bytestream_wrapper_attributes_SetUnknown, + bytestream_wrapper_attributes_LockStore, + bytestream_wrapper_attributes_UnlockStore, + bytestream_wrapper_attributes_GetCount, + bytestream_wrapper_attributes_GetItemByIndex, + bytestream_wrapper_attributes_CopyAllItems +}; + +/*********************************************************************** + * MFCreateMFByteStreamWrapper (mfplat.@) + */ +HRESULT WINAPI MFCreateMFByteStreamWrapper(IMFByteStream *stream, IMFByteStream **wrapper) +{ + struct bytestream_wrapper *object; + + TRACE("%p, %p.\n", stream, wrapper); + + object = heap_alloc_zero(sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IMFByteStreamCacheControl_iface.lpVtbl = &bytestream_wrapper_cache_control_vtbl; + object->IMFByteStreamBuffering_iface.lpVtbl = &bytestream_wrapper_buffering_vtbl; + object->IMFMediaEventGenerator_iface.lpVtbl = &bytestream_wrapper_events_vtbl; + object->IMFByteStreamTimeSeek_iface.lpVtbl = &bytestream_wrapper_timeseek_vtbl; + object->IMFSampleOutputStream_iface.lpVtbl = &bytestream_wrapper_sample_output_vtbl; + object->IMFByteStream_iface.lpVtbl = &bytestream_wrapper_vtbl; + object->IPropertyStore_iface.lpVtbl = &bytestream_wrapper_propstore_vtbl; + object->IMFAttributes_iface.lpVtbl = &bytestream_wrapper_attributes_vtbl; + + IMFByteStream_QueryInterface(stream, &IID_IMFByteStreamCacheControl, (void **)&object->cache_control); + IMFByteStream_QueryInterface(stream, &IID_IMFByteStreamBuffering, (void **)&object->stream_buffering); + IMFByteStream_QueryInterface(stream, &IID_IMFMediaEventGenerator, (void **)&object->event_generator); + IMFByteStream_QueryInterface(stream, &IID_IMFByteStreamTimeSeek, (void **)&object->time_seek); + IMFByteStream_QueryInterface(stream, &IID_IMFSampleOutputStream, (void **)&object->sample_output); + IMFByteStream_QueryInterface(stream, &IID_IPropertyStore, (void **)&object->propstore); + IMFByteStream_QueryInterface(stream, &IID_IMFAttributes, (void **)&object->attributes); + + object->stream = stream; + IMFByteStream_AddRef(object->stream); + + object->refcount = 1; + + *wrapper = &object->IMFByteStream_iface; + + return S_OK; +} + static HRESULT WINAPI MFPluginControl_QueryInterface(IMFPluginControl *iface, REFIID riid, void **ppv) { if(IsEqualGUID(riid, &IID_IUnknown)) { diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec index 79f25f53d5..1d4035c60e 100644 --- a/dlls/mfplat/mfplat.spec +++ b/dlls/mfplat/mfplat.spec @@ -47,6 +47,7 @@ @ stub MFCreateLegacyMediaBufferOnMFMediaBuffer @ stdcall MFCreateMFByteStreamOnStream(ptr ptr) @ stdcall MFCreateMFByteStreamOnStreamEx(ptr ptr) +@ stdcall MFCreateMFByteStreamWrapper(ptr ptr) @ stub MFCreateMFVideoFormatFromMFMediaType @ stub MFCreateMediaBufferWrapper @ stdcall MFCreateMediaEvent(long ptr long ptr ptr) diff --git a/include/mfidl.idl b/include/mfidl.idl index 7f98d0e821..22a22a8535 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -253,6 +253,24 @@ interface IMFByteStreamCacheControl : IUnknown HRESULT StopBackgroundTransfer(); }
+[ + object, + uuid(64976bfa-fb61-4041-9069-8c9a5f659beb), +] +interface IMFByteStreamTimeSeek : IUnknown +{ + HRESULT IsTimeSeekSupported( + [out] BOOL *is_supported); + + HRESULT TimeSeek( + [in] QWORD position); + + HRESULT GetTimeSeekResult( + [out] QWORD *start_time, + [out] QWORD *stop_time, + [out] QWORD *duration); +} + [ object, uuid(6d4c7b74-52a0-4bb7-b0db-55f29f47a668), diff --git a/include/mfobjects.idl b/include/mfobjects.idl index ff30b81755..1f17c82133 100644 --- a/include/mfobjects.idl +++ b/include/mfobjects.idl @@ -644,6 +644,23 @@ typedef enum { MF_FILEFLAGS_ALLOW_WRITE_SHARING = 0x00000002 } MF_FILE_FLAGS;
+[ + object, + uuid(8feed468-6f7e-440d-869a-49bdd283ad0d), +] +interface IMFSampleOutputStream : IUnknown +{ + HRESULT BeginWriteSample( + [in] IMFSample *sample, + [in] IMFAsyncCallback *callback, + [in] IUnknown *state); + + HRESULT EndWriteSample( + [in] IMFAsyncResult *result); + + HRESULT Close(); +} + [ object, uuid(5bc8a76b-869a-46a3-9b03-fa218a66aebe)
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=49879
Your paranoid android.
=== debian9 (32 bit report) ===
mfplat: mfplat.c:2428: Test failed: Unexpected refcount 1. Unhandled exception: page fault on read access to 0x0000000c in 32-bit code (0x7e7de57a).
Report errors: mfplat:mfplat crashed (c0000005)
=== debian9 (32 bit Chinese:China report) ===
mfplat: mfplat.c:2428: Test failed: Unexpected refcount 1. Unhandled exception: page fault on read access to 0x00000009 in 32-bit code (0x7e7df57a).
Report errors: mfplat:mfplat crashed (c0000005)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 385eb25dc8..57bed4ac3e 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -2339,33 +2339,10 @@ static HRESULT WINAPI bytestream_BeginWrite(IMFByteStream *iface, const BYTE *da IMFAsyncCallback *callback, IUnknown *state) { struct bytestream *stream = impl_from_IMFByteStream(iface); - struct async_stream_op *op; - IMFAsyncResult *request; - HRESULT hr;
TRACE("%p, %p, %u, %p, %p.\n", iface, data, size, callback, state);
- op = heap_alloc(sizeof(*op)); - if (!op) - return E_OUTOFMEMORY; - - op->IUnknown_iface.lpVtbl = &async_stream_op_vtbl; - op->refcount = 1; - op->u.src = data; - op->requested_length = size; - op->type = ASYNC_STREAM_OP_WRITE; - if (FAILED(hr = MFCreateAsyncResult((IUnknown *)iface, callback, state, &op->caller))) - goto failed; - - if (FAILED(hr = MFCreateAsyncResult(&op->IUnknown_iface, &stream->write_callback, NULL, &request))) - goto failed; - - MFPutWorkItemEx(MFASYNC_CALLBACK_QUEUE_STANDARD, request); - IMFAsyncResult_Release(request); - -failed: - IUnknown_Release(&op->IUnknown_iface); - return hr; + return bytestream_create_io_request(stream, ASYNC_STREAM_OP_WRITE, data, size, callback, state); }
static HRESULT WINAPI bytestream_EndWrite(IMFByteStream *iface, IMFAsyncResult *result, ULONG *written)