Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 11 +++++++++++ include/mfreadwrite.idl | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index ccd0a03b0b..c459e0aae9 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -556,9 +556,11 @@ static const char *debugstr_attr(const GUID *guid) #define X(g) { &(g), #g } X(MF_READWRITE_MMCSS_CLASS), X(MF_SINK_WRITER_ENCODER_CONFIG), + X(MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS), X(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS), X(MF_MT_PIXEL_ASPECT_RATIO), X(MF_MT_AVG_BITRATE), + X(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING), X(MF_PD_PMPHOST_CONTEXT), X(MF_PD_APP_CONTEXT), X(MF_PD_TOTAL_FILE_SIZE), @@ -570,12 +572,15 @@ static const char *debugstr_attr(const GUID *guid) X(MF_MT_ALL_SAMPLES_INDEPENDENT), X(MF_PD_PREFERRED_LANGUAGE), X(MF_PD_PLAYBACK_BOUNDARY_TIME), + X(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING), X(MF_MT_FRAME_SIZE), X(MF_SINK_WRITER_ASYNC_CALLBACK), X(MF_MT_FRAME_RATE_RANGE_MAX), X(MF_MT_USER_DATA), + X(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN), X(MF_READWRITE_DISABLE_CONVERTERS), X(MFSampleExtension_Token), + X(MF_SOURCE_READER_D3D11_BIND_FLAGS), X(MF_PD_SAMI_STYLELIST), X(MF_SD_LANGUAGE), X(MF_SD_PROTECTED), @@ -595,14 +600,20 @@ static const char *debugstr_attr(const GUID *guid) X(MF_SD_MUTUALLY_EXCLUSIVE), X(MF_SD_STREAM_NAME), X(MF_SINK_WRITER_D3D_MANAGER), + X(MF_SOURCE_READER_D3D_MANAGER), + X(MF_SOURCE_READER_ASYNC_CALLBACK), X(MF_MT_INTERLACE_MODE), + X(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS), X(MF_READWRITE_MMCSS_PRIORITY), X(MFSampleExtension_DecodeTimestamp), 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_FRAME_RATE), + X(MF_SOURCE_READER_MEDIASOURCE_CONFIG), + X(MF_SOURCE_READER_DISABLE_DXVA), #undef X }; struct guid_def *ret = NULL; diff --git a/include/mfreadwrite.idl b/include/mfreadwrite.idl index 9097b5a548..86e6eeaca5 100644 --- a/include/mfreadwrite.idl +++ b/include/mfreadwrite.idl @@ -78,7 +78,17 @@ cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x08 cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61);") cpp_quote("EXTERN_GUID(MF_READWRITE_D3D_OPTIONAL, 0x216479d9, 0x3071, 0x42ca, 0xbb, 0x6c, 0x4c, 0x22, 0x10, 0x2e, 0x1d, 0x18);")
-cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ASYNC_CALLBACK, 0x1e3dbeac, 0xbb43, 0x4c35, 0xb5, 0x07, 0xcd, 0x64, 0x44, 0x64, 0xc9, 0x65);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_D3D_MANAGER, 0xec822da2, 0xe1e9, 0x4b29, 0xa0, 0xd8, 0x56, 0x3c, 0x71, 0x9f, 0x52, 0x69);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_D3D11_BIND_FLAGS, 0x33f3197b, 0xf73a, 0x4e14, 0x8d, 0x85, 0x0e, 0x4c, 0x43, 0x68, 0x78, 0x8d);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISABLE_CAMERA_PLUGINS, 0x9d3365dd, 0x058f, 0x4cfb, 0x9f, 0x97, 0xb3, 0x14, 0xcc, 0x99, 0xc8, 0xad);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISABLE_DXVA, 0xaa456cfd, 0x3943, 0x4a1e, 0xa7, 0x7d, 0x18, 0x38, 0xc0, 0xea, 0x2e, 0x35);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, 0x56b67165, 0x219e, 0x456d, 0xa2, 0x2e, 0x2d, 0x30, 0x04, 0xc7, 0xfe, 0x56);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, 0x0f81da2c, 0xb537, 0x4672, 0xa8, 0xb2, 0xa6, 0x81, 0xb1, 0x73, 0x07, 0xa3);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS, 0xdfd4f008, 0xb5fd, 0x4e78, 0xae, 0x44, 0x62, 0xa1, 0xe6, 0x7b, 0xbe, 0x27);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, 0xfb394f3d, 0xccf1, 0x42ee, 0xbb, 0xb3, 0xf9, 0xb8, 0x45, 0xd5, 0x68, 0x1d);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);") +cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CONFIG, 0x9085abeb, 0x0354, 0x48f9, 0xab, 0xb5, 0x20, 0x0d, 0xf8, 0x38, 0xc6, 0x8e);")
interface IMFMediaSource;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index cbaad1619a..a6e0c10b5d 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -545,6 +545,7 @@ failed: static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttributes *attributes, REFIID riid, void **out) { + IPropertyStore *props = NULL; IMFSourceResolver *resolver; MF_OBJECT_TYPE obj_type; IMFMediaSource *source; @@ -553,9 +554,15 @@ static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttrib if (FAILED(hr = MFCreateSourceResolver(&resolver))) return hr;
- hr = IMFSourceResolver_CreateObjectFromByteStream(resolver, stream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL, + if (attributes) + IMFAttributes_GetUnknown(attributes, &MF_SOURCE_READER_MEDIASOURCE_CONFIG, &IID_IPropertyStore, + (void **)&props); + + hr = IMFSourceResolver_CreateObjectFromByteStream(resolver, stream, NULL, MF_RESOLUTION_MEDIASOURCE, props, &obj_type, (IUnknown **)&source); IMFSourceResolver_Release(resolver); + if (props) + IPropertyStore_Release(props); if (FAILED(hr)) return hr;
@@ -566,6 +573,7 @@ static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttrib
static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *attributes, REFIID riid, void **out) { + IPropertyStore *props = NULL; IMFSourceResolver *resolver; IUnknown *object = NULL; MF_OBJECT_TYPE obj_type; @@ -575,7 +583,11 @@ static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *at if (FAILED(hr = MFCreateSourceResolver(&resolver))) return hr;
- hr = IMFSourceResolver_CreateObjectFromURL(resolver, url, MF_RESOLUTION_MEDIASOURCE, NULL, &obj_type, + if (attributes) + IMFAttributes_GetUnknown(attributes, &MF_SOURCE_READER_MEDIASOURCE_CONFIG, &IID_IPropertyStore, + (void **)&props); + + hr = IMFSourceResolver_CreateObjectFromURL(resolver, url, MF_RESOLUTION_MEDIASOURCE, props, &obj_type, &object); if (SUCCEEDED(hr)) { @@ -583,7 +595,7 @@ static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *at { case MF_OBJECT_BYTESTREAM: hr = IMFSourceResolver_CreateObjectFromByteStream(resolver, (IMFByteStream *)object, NULL, - MF_RESOLUTION_MEDIASOURCE, NULL, &obj_type, (IUnknown **)&source); + MF_RESOLUTION_MEDIASOURCE, props, &obj_type, (IUnknown **)&source); break; case MF_OBJECT_MEDIASOURCE: source = (IMFMediaSource *)object; @@ -597,6 +609,8 @@ static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *at }
IMFSourceResolver_Release(resolver); + if (props) + IPropertyStore_Release(props); if (FAILED(hr)) return hr;
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 7 +++++++ include/mfreadwrite.idl | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index a6e0c10b5d..15c5dbf6c6 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -81,6 +81,7 @@ typedef struct source_reader IMFPresentationDescriptor *descriptor; DWORD first_audio_stream_index; DWORD first_video_stream_index; + IMFSourceReaderCallback *async_callback; } srcreader;
struct sink_writer @@ -217,6 +218,8 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface)
if (!refcount) { + if (reader->async_callback) + IMFSourceReaderCallback_Release(reader->async_callback); IMFMediaSource_Shutdown(reader->source); if (reader->descriptor) IMFPresentationDescriptor_Release(reader->descriptor); @@ -535,6 +538,10 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri goto failed; }
+ if (attributes) + IMFAttributes_GetUnknown(attributes, &MF_SOURCE_READER_ASYNC_CALLBACK, &IID_IMFSourceReaderCallback, + (void **)&object->async_callback); + hr = IMFSourceReader_QueryInterface(&object->IMFSourceReader_iface, riid, out);
failed: diff --git a/include/mfreadwrite.idl b/include/mfreadwrite.idl index 86e6eeaca5..0eea43b08b 100644 --- a/include/mfreadwrite.idl +++ b/include/mfreadwrite.idl @@ -90,6 +90,27 @@ cpp_quote("EXTERN_GUID(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, 0xfb cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);") cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CONFIG, 0x9085abeb, 0x0354, 0x48f9, 0xab, 0xb5, 0x20, 0x0d, 0xf8, 0x38, 0xc6, 0x8e);")
+[ + object, + uuid(deec8d99-fa1d-4d82-84c2-2c8969944867), + local +] +interface IMFSourceReaderCallback : IUnknown +{ + HRESULT OnReadSample( + [in] HRESULT hr, + [in] DWORD stream_index, + [in] DWORD stream_flags, + [in] LONGLONG timestamp, + [in] IMFSample *sample); + + HRESULT OnFlush([in] DWORD stream_index); + + HRESULT OnEvent( + [in] DWORD stream_index, + [in] IMFMediaEvent *event); +} + interface IMFMediaSource;
[
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 15c5dbf6c6..6b8989ca96 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -82,6 +82,7 @@ typedef struct source_reader DWORD first_audio_stream_index; DWORD first_video_stream_index; IMFSourceReaderCallback *async_callback; + BOOL shutdown_on_release; } srcreader;
struct sink_writer @@ -220,7 +221,8 @@ static ULONG WINAPI src_reader_Release(IMFSourceReader *iface) { if (reader->async_callback) IMFSourceReaderCallback_Release(reader->async_callback); - IMFMediaSource_Shutdown(reader->source); + if (reader->shutdown_on_release) + IMFMediaSource_Shutdown(reader->source); if (reader->descriptor) IMFPresentationDescriptor_Release(reader->descriptor); IMFMediaSource_Release(reader->source); @@ -504,7 +506,7 @@ static DWORD reader_get_first_stream_index(IMFPresentationDescriptor *descriptor }
static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttributes *attributes, - REFIID riid, void **out) + BOOL shutdown_on_release, REFIID riid, void **out) { srcreader *object; HRESULT hr; @@ -573,7 +575,7 @@ static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttrib if (FAILED(hr)) return hr;
- hr = create_source_reader_from_source(source, attributes, riid, out); + hr = create_source_reader_from_source(source, attributes, TRUE, riid, out); IMFMediaSource_Release(source); return hr; } @@ -621,7 +623,7 @@ static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *at if (FAILED(hr)) return hr;
- hr = create_source_reader_from_source(source, attributes, riid, out); + hr = create_source_reader_from_source(source, attributes, TRUE, riid, out); IMFMediaSource_Release(source); return hr; } @@ -828,9 +830,14 @@ HRESULT WINAPI MFCreateSourceReaderFromByteStream(IMFByteStream *stream, IMFAttr HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAttributes *attributes, IMFSourceReader **reader) { + UINT32 disconnect = 0; + TRACE("%p, %p, %p.\n", source, attributes, reader);
- return create_source_reader_from_source(source, attributes, &IID_IMFSourceReader, (void **)reader); + if (attributes) + IMFAttributes_GetUINT32(attributes, &MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, &disconnect); + + return create_source_reader_from_source(source, attributes, !disconnect, &IID_IMFSourceReader, (void **)reader); }
/*********************************************************************** @@ -902,7 +909,13 @@ static HRESULT WINAPI readwrite_factory_CreateInstanceFromObject(IMFReadWriteCla if (stream) hr = create_source_reader_from_stream(stream, attributes, riid, out); else if (source) - hr = create_source_reader_from_source(source, attributes, riid, out); + { + UINT32 disconnect = 0; + + if (attributes) + IMFAttributes_GetUINT32(attributes, &MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, &disconnect); + hr = create_source_reader_from_source(source, attributes, !disconnect, riid, out); + }
if (source) IMFMediaSource_Release(source);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 20 ++++++++++++++++++++ include/mfapi.h | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index c459e0aae9..ae94645ef1 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -576,7 +576,9 @@ 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_EVENT_SOURCE_TOPOLOGY_CANCELED), X(MF_MT_USER_DATA), + X(MF_EVENT_STREAM_METADATA_SYSTEMID), X(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN), X(MF_READWRITE_DISABLE_CONVERTERS), X(MFSampleExtension_Token), @@ -589,22 +591,38 @@ static const char *debugstr_attr(const GUID *guid) X(MF_BYTESTREAM_CONTENT_TYPE), X(MF_BYTESTREAM_DURATION), X(MF_SD_SAMI_LANGUAGE), + X(MF_EVENT_OUTPUT_NODE), X(MF_BYTESTREAM_LAST_MODIFIED_TIME), X(MF_MT_FRAME_RATE_RANGE_MIN), X(MF_BYTESTREAM_IFO_FILE_URI), + X(MF_EVENT_TOPOLOGY_STATUS), X(MF_BYTESTREAM_DLNA_PROFILE_ID), X(MF_MT_MAJOR_TYPE), + X(MF_EVENT_SOURCE_CHARACTERISTICS), + X(MF_EVENT_SOURCE_CHARACTERISTICS_OLD), 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_EVENT_STREAM_METADATA_KEYDATA), X(MF_SINK_WRITER_D3D_MANAGER), X(MF_SOURCE_READER_D3D_MANAGER), + X(MF_EVENT_SOURCE_FAKE_START), + X(MF_EVENT_SOURCE_PROJECTSTART), + X(MF_EVENT_SOURCE_ACTUAL_START), X(MF_SOURCE_READER_ASYNC_CALLBACK), + X(MF_EVENT_SCRUBSAMPLE_TIME), X(MF_MT_INTERLACE_MODE), X(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS), + X(MF_EVENT_MFT_INPUT_STREAM_ID), X(MF_READWRITE_MMCSS_PRIORITY), + 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_SINK_WRITER_DISABLE_THROTTLING), X(MF_READWRITE_D3D_OPTIONAL), @@ -613,6 +631,8 @@ static const char *debugstr_attr(const GUID *guid) X(MF_PD_AUDIO_ISVARIABLEBITRATE), X(MF_MT_FRAME_RATE), X(MF_SOURCE_READER_MEDIASOURCE_CONFIG), + X(MF_EVENT_MFT_CONTEXT), + X(MF_EVENT_DO_THINNING), X(MF_SOURCE_READER_DISABLE_DXVA), #undef X }; diff --git a/include/mfapi.h b/include/mfapi.h index a58699179e..b38953c855 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -122,6 +122,27 @@ DEFINE_GUID(MFSampleExtension_DecodeTimestamp, 0x73a954d4, 0x09e2, 0x4861, 0xbe, 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(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); +DEFINE_GUID(MF_EVENT_MFT_INPUT_STREAM_ID, 0xf29c2cca, 0x7ae6, 0x42d2, 0xb2, 0x84, 0xbf, 0x83, 0x7c, 0xc8, 0x74, 0xe2); +DEFINE_GUID(MF_EVENT_PRESENTATION_TIME_OFFSET, 0x5ad914d1, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); +DEFINE_GUID(MF_EVENT_SCRUBSAMPLE_TIME, 0x9ac712b3, 0xdcb8, 0x44d5, 0x8d, 0x0c, 0x37, 0x45, 0x5a, 0x27, 0x82, 0xe3); +DEFINE_GUID(MF_EVENT_SESSIONCAPS, 0x7e5ebcd0, 0x11b8, 0x4abe, 0xaf, 0xad, 0x10, 0xf6, 0x59, 0x9a, 0x7f, 0x42); +DEFINE_GUID(MF_EVENT_SESSIONCAPS_DELTA, 0x7e5ebcd1, 0x11b8, 0x4abe, 0xaf, 0xad, 0x10, 0xf6, 0x59, 0x9a, 0x7f, 0x42); +DEFINE_GUID(MF_EVENT_SOURCE_ACTUAL_START, 0xa8cc55a9, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); +DEFINE_GUID(MF_EVENT_SOURCE_CHARACTERISTICS, 0x47db8490, 0x8b22, 0x4f52, 0xaf, 0xda, 0x9c, 0xe1, 0xb2, 0xd3, 0xcf, 0xa8); +DEFINE_GUID(MF_EVENT_SOURCE_CHARACTERISTICS_OLD, 0x47db8491, 0x8b22, 0x4f52, 0xaf, 0xda, 0x9c, 0xe1, 0xb2, 0xd3, 0xcf, 0xa8); +DEFINE_GUID(MF_EVENT_SOURCE_FAKE_START, 0xa8cc55a7, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); +DEFINE_GUID(MF_EVENT_SOURCE_PROJECTSTART, 0xa8cc55a8, 0x6b31, 0x419f, 0x84, 0x5d, 0xff, 0xb3, 0x51, 0xa2, 0x43, 0x4b); +DEFINE_GUID(MF_EVENT_SOURCE_TOPOLOGY_CANCELED, 0xdb62f650, 0x9a5e, 0x4704, 0xac, 0xf3, 0x56, 0x3b, 0xc6, 0xa7, 0x33, 0x64); +DEFINE_GUID(MF_EVENT_START_PRESENTATION_TIME, 0x5ad914d0, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); +DEFINE_GUID(MF_EVENT_START_PRESENTATION_TIME_AT_OUTPUT, 0x5ad914d2, 0x9b45, 0x4a8d, 0xa2, 0xc0, 0x81, 0xd1, 0xe5, 0x0b, 0xfb, 0x07); +DEFINE_GUID(MF_EVENT_STREAM_METADATA_CONTENT_KEYIDS, 0x5063449d, 0xcc29, 0x4fc6, 0xa7, 0x5a, 0xd2, 0x47, 0xb3, 0x5a, 0xf8, 0x5c); +DEFINE_GUID(MF_EVENT_STREAM_METADATA_KEYDATA, 0xcd59a4a1, 0x4a3b, 0x4bbd, 0x86, 0x65, 0x72, 0xa4, 0x0f, 0xbe, 0xa7, 0x76); +DEFINE_GUID(MF_EVENT_STREAM_METADATA_SYSTEMID, 0x1ea2ef64, 0xba16, 0x4a36, 0x87, 0x19, 0xfe, 0x75, 0x60, 0xba, 0x32, 0xad); +DEFINE_GUID(MF_EVENT_TOPOLOGY_STATUS, 0x30c5018d, 0x9a53, 0x454b, 0xad, 0x9e, 0x6d, 0x5f, 0x8f, 0xa7, 0xc4, 0x3b); +DEFINE_GUID(MF_EVENT_OUTPUT_NODE, 0x830f1a8b, 0xc060, 0x46dd, 0xa8, 0x01, 0x1c, 0x95, 0xde, 0xc9, 0xb1, 0x07); + typedef unsigned __int64 MFWORKITEM_KEY;
typedef enum
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 6b8989ca96..ef9e06e851 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -423,6 +423,8 @@ static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface REFGUID guid, PROPVARIANT *value) { struct source_reader *reader = impl_from_IMFSourceReader(iface); + IMFStreamDescriptor *sd; + BOOL selected; HRESULT hr;
TRACE("%p, %#x, %s, %p.\n", iface, index, debugstr_guid(guid), value); @@ -446,12 +448,23 @@ static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface return IMFPresentationDescriptor_GetItem(reader->descriptor, guid, value); } break; + 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: - FIXME("Unsupported index %#x.\n", index); - return E_NOTIMPL; + ; }
- return E_NOTIMPL; + if (FAILED(hr = IMFPresentationDescriptor_GetStreamDescriptorByIndex(reader->descriptor, index, &selected, &sd))) + return hr; + + hr = IMFStreamDescriptor_GetItem(sd, guid, value); + IMFStreamDescriptor_Release(sd); + + return hr; }
struct IMFSourceReaderVtbl srcreader_vtbl =
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=49613
Your paranoid android.
=== debian9 (32 bit report) ===
mfplat: mfplat.c:2344: Test failed: Unexpected refcount 1. Unhandled exception: page fault on read access to 0x00000008 in 32-bit code (0x7e7e60aa).
Report errors: mfplat:mfplat crashed (c0000005)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 18 +++++++++++++++--- include/mfidl.idl | 12 ++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index ef9e06e851..516b5928b1 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -359,9 +359,21 @@ static HRESULT WINAPI src_reader_SetCurrentMediaType(IMFSourceReader *iface, DWO
static HRESULT WINAPI src_reader_SetCurrentPosition(IMFSourceReader *iface, REFGUID format, REFPROPVARIANT position) { - srcreader *This = impl_from_IMFSourceReader(iface); - FIXME("%p, %s, %p\n", This, debugstr_guid(format), position); - return E_NOTIMPL; + struct source_reader *reader = impl_from_IMFSourceReader(iface); + DWORD flags; + HRESULT hr; + + TRACE("%p, %s, %p.\n", iface, debugstr_guid(format), position); + + /* FIXME: fail if we got pending samples. */ + + if (FAILED(hr = IMFMediaSource_GetCharacteristics(reader->source, &flags))) + return hr; + + if (!(flags & MFMEDIASOURCE_CAN_SEEK)) + return MF_E_INVALIDREQUEST; + + return IMFMediaSource_Start(reader->source, reader->descriptor, format, position); }
static HRESULT WINAPI src_reader_ReadSample(IMFSourceReader *iface, DWORD index, diff --git a/include/mfidl.idl b/include/mfidl.idl index 6a958a9e6a..944f8f95ba 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -425,6 +425,18 @@ cpp_quote("HRESULT WINAPI MFGetService(IUnknown *object, REFGUID service, REFIID cpp_quote("MFTIME WINAPI MFGetSystemTime(void);") cpp_quote("HRESULT WINAPI MFShutdownObject(IUnknown *object);")
+typedef enum _MFMEDIASOURCE_CHARACTERISTICS +{ + MFMEDIASOURCE_IS_LIVE = 0x1, + MFMEDIASOURCE_CAN_SEEK = 0x2, + MFMEDIASOURCE_CAN_PAUSE = 0x4, + MFMEDIASOURCE_HAS_SLOW_SEEK = 0x8, + MFMEDIASOURCE_HAS_MULTIPLE_PRESENTATIONS = 0x10, + MFMEDIASOURCE_CAN_SKIPFORWARD = 0x20, + MFMEDIASOURCE_CAN_SKIPBACKWARD = 0x40, + MFMEDIASOURCE_DOES_NOT_USE_NETWORK = 0x80, +} MFMEDIASOURCE_CHARACTERISTICS; + [ object, uuid(279a808d-aec7-40c8-9c6b-a6b492c78a66),