Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/main.c | 13 +++++++++++++ include/mfobjects.idl | 13 +++++++++++++ 2 files changed, 26 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 8d9dffe075..e3cb35d866 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -2056,6 +2056,19 @@ static const char *debugstr_eventid(DWORD event) X(MEWMDRMProximityCompleted), X(MEWMDRMLicenseStoreCleaned), X(MEWMDRMRevocationDownloadCompleted), + X(METransformUnknown), + X(METransformNeedInput), + X(METransformHaveOutput), + X(METransformDrainComplete), + X(METransformMarker), + X(METransformInputStreamStateChanged), + X(MEByteStreamCharacteristicsChanged), + X(MEVideoCaptureDeviceRemoved), + X(MEVideoCaptureDevicePreempted), + X(MEStreamSinkFormatInvalidated), + X(MEEncodingParameters), + X(MEContentProtectionMetadata), + X(MEDeviceThermalStateChanged), #undef X };
diff --git a/include/mfobjects.idl b/include/mfobjects.idl index 8e3d65c77c..ee49be35af 100644 --- a/include/mfobjects.idl +++ b/include/mfobjects.idl @@ -567,6 +567,19 @@ enum { MEWMDRMLicenseStoreCleaned = 515, MEWMDRMRevocationDownloadCompleted = 516, MEWMDRMV1Anchor = MEWMDRMRevocationDownloadCompleted, + METransformUnknown = 600, + METransformNeedInput = 601, + METransformHaveOutput = 602, + METransformDrainComplete = 603, + METransformMarker = 604, + METransformInputStreamStateChanged = 605, + MEByteStreamCharacteristicsChanged = 700, + MEVideoCaptureDeviceRemoved = 800, + MEVideoCaptureDevicePreempted = 801, + MEStreamSinkFormatInvalidated = 802, + MEEncodingParameters = 803, + MEContentProtectionMetadata = 900, + MEDeviceThermalStateChanged = 950, MEReservedMax = 10000 };
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index aa7f6855f4..138a5adc28 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -478,6 +478,18 @@ static HRESULT WINAPI source_reader_source_events_callback_Invoke(IMFAsyncCallba case MESourceStopped: hr = source_reader_source_state_handler(reader, event_type); break; + case MEBufferingStarted: + case MEBufferingStopped: + case MEConnectStart: + case MEConnectEnd: + case MEExtendedType: + case MESourceCharacteristicsChanged: + case MESourceMetadataChanged: + case MEContentProtectionMetadata: + case MEDeviceThermalStateChanged: + if (reader->async_callback) + IMFSourceReaderCallback_OnEvent(reader->async_callback, MF_SOURCE_READER_MEDIASOURCE, event); + break; default: ; }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/Makefile.in | 3 +- dlls/mfreadwrite/{main.c => reader.c} | 209 +--------------------- dlls/mfreadwrite/writer.c | 238 ++++++++++++++++++++++++++ 3 files changed, 242 insertions(+), 208 deletions(-) rename dlls/mfreadwrite/{main.c => reader.c} (92%) create mode 100644 dlls/mfreadwrite/writer.c
diff --git a/dlls/mfreadwrite/Makefile.in b/dlls/mfreadwrite/Makefile.in index ce63ad5824..733732b431 100644 --- a/dlls/mfreadwrite/Makefile.in +++ b/dlls/mfreadwrite/Makefile.in @@ -5,6 +5,7 @@ IMPORTS = mfuuid uuid mfplat ole32 EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ - main.c + reader.c \ + writer.c
IDL_SRCS = mf_classes.idl diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/reader.c similarity index 92% rename from dlls/mfreadwrite/main.c rename to dlls/mfreadwrite/reader.c index 138a5adc28..3b024fc80c 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/reader.c @@ -38,6 +38,8 @@ #include "wine/heap.h" #include "wine/list.h"
+#include "mf_private.h" + WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static HINSTANCE mfinstance; @@ -151,12 +153,6 @@ struct source_reader CRITICAL_SECTION cs; };
-struct sink_writer -{ - IMFSinkWriter IMFSinkWriter_iface; - LONG refcount; -}; - static inline struct source_reader *impl_from_IMFSourceReader(IMFSourceReader *iface) { return CONTAINING_RECORD(iface, struct source_reader, IMFSourceReader_iface); @@ -182,11 +178,6 @@ static struct source_reader_async_command *impl_from_async_command_IUnknown(IUnk return CONTAINING_RECORD(iface, struct source_reader_async_command, IUnknown_iface); }
-static inline struct sink_writer *impl_from_IMFSinkWriter(IMFSinkWriter *iface) -{ - return CONTAINING_RECORD(iface, struct sink_writer, IMFSinkWriter_iface); -} - static HRESULT WINAPI source_reader_async_command_QueryInterface(IUnknown *iface, REFIID riid, void **obj) { if (IsEqualIID(riid, &IID_IUnknown)) @@ -2060,202 +2051,6 @@ static HRESULT create_source_reader_from_url(const WCHAR *url, IMFAttributes *at return hr; }
-static HRESULT WINAPI sink_writer_QueryInterface(IMFSinkWriter *iface, REFIID riid, void **out) -{ - TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); - - if (IsEqualIID(riid, &IID_IMFSinkWriter) || - IsEqualIID(riid, &IID_IUnknown)) - { - *out = iface; - IMFSinkWriter_AddRef(iface); - return S_OK; - } - - WARN("Unsupported %s.\n", debugstr_guid(riid)); - *out = NULL; - return E_NOINTERFACE; -} - -static ULONG WINAPI sink_writer_AddRef(IMFSinkWriter *iface) -{ - struct sink_writer *writer = impl_from_IMFSinkWriter(iface); - ULONG refcount = InterlockedIncrement(&writer->refcount); - - TRACE("%p, %u.\n", iface, refcount); - - return refcount; -} - -static ULONG WINAPI sink_writer_Release(IMFSinkWriter *iface) -{ - struct sink_writer *writer = impl_from_IMFSinkWriter(iface); - ULONG refcount = InterlockedDecrement(&writer->refcount); - - TRACE("%p, %u.\n", iface, refcount); - - if (!refcount) - { - heap_free(writer); - } - - return refcount; -} - -static HRESULT WINAPI sink_writer_AddStream(IMFSinkWriter *iface, IMFMediaType *type, DWORD *index) -{ - FIXME("%p, %p, %p.\n", iface, type, index); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_SetInputMediaType(IMFSinkWriter *iface, DWORD index, IMFMediaType *type, - IMFAttributes *parameters) -{ - FIXME("%p, %u, %p, %p.\n", iface, index, type, parameters); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_BeginWriting(IMFSinkWriter *iface) -{ - FIXME("%p.\n", iface); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_WriteSample(IMFSinkWriter *iface, DWORD index, IMFSample *sample) -{ - FIXME("%p, %u, %p.\n", iface, index, sample); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_SendStreamTick(IMFSinkWriter *iface, DWORD index, LONGLONG timestamp) -{ - FIXME("%p, %u, %s.\n", iface, index, wine_dbgstr_longlong(timestamp)); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_PlaceMarker(IMFSinkWriter *iface, DWORD index, void *context) -{ - FIXME("%p, %u, %p.\n", iface, index, context); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_NotifyEndOfSegment(IMFSinkWriter *iface, DWORD index) -{ - FIXME("%p, %u.\n", iface, index); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_Flush(IMFSinkWriter *iface, DWORD index) -{ - FIXME("%p, %u.\n", iface, index); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_Finalize(IMFSinkWriter *iface) -{ - FIXME("%p.\n", iface); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_GetServiceForStream(IMFSinkWriter *iface, DWORD index, REFGUID service, - REFIID riid, void **object) -{ - FIXME("%p, %u, %s, %s, %p.\n", iface, index, debugstr_guid(service), debugstr_guid(riid), object); - - return E_NOTIMPL; -} - -static HRESULT WINAPI sink_writer_GetStatistics(IMFSinkWriter *iface, DWORD index, MF_SINK_WRITER_STATISTICS *stats) -{ - FIXME("%p, %u, %p.\n", iface, index, stats); - - return E_NOTIMPL; -} - -static const IMFSinkWriterVtbl sink_writer_vtbl = -{ - sink_writer_QueryInterface, - sink_writer_AddRef, - sink_writer_Release, - sink_writer_AddStream, - sink_writer_SetInputMediaType, - sink_writer_BeginWriting, - sink_writer_WriteSample, - sink_writer_SendStreamTick, - sink_writer_PlaceMarker, - sink_writer_NotifyEndOfSegment, - sink_writer_Flush, - sink_writer_Finalize, - sink_writer_GetServiceForStream, - sink_writer_GetStatistics, -}; - -static HRESULT create_sink_writer_from_sink(IMFMediaSink *sink, IMFAttributes *attributes, - REFIID riid, void **out) -{ - struct sink_writer *object; - HRESULT hr; - - object = heap_alloc(sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - object->IMFSinkWriter_iface.lpVtbl = &sink_writer_vtbl; - object->refcount = 1; - - hr = IMFSinkWriter_QueryInterface(&object->IMFSinkWriter_iface, riid, out); - IMFSinkWriter_Release(&object->IMFSinkWriter_iface); - return hr; -} - -static HRESULT create_sink_writer_from_stream(IMFByteStream *stream, IMFAttributes *attributes, - REFIID riid, void **out) -{ - struct sink_writer *object; - HRESULT hr; - - object = heap_alloc(sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - object->IMFSinkWriter_iface.lpVtbl = &sink_writer_vtbl; - object->refcount = 1; - - hr = IMFSinkWriter_QueryInterface(&object->IMFSinkWriter_iface, riid, out); - IMFSinkWriter_Release(&object->IMFSinkWriter_iface); - return hr; -} - -/*********************************************************************** - * MFCreateSinkWriterFromMediaSink (mfreadwrite.@) - */ -HRESULT WINAPI MFCreateSinkWriterFromMediaSink(IMFMediaSink *sink, IMFAttributes *attributes, IMFSinkWriter **writer) -{ - TRACE("%p, %p, %p.\n", sink, attributes, writer); - - return create_sink_writer_from_sink(sink, attributes, &IID_IMFSinkWriter, (void **)writer); -} - -/*********************************************************************** - * MFCreateSinkWriterFromURL (mfreadwrite.@) - */ -HRESULT WINAPI MFCreateSinkWriterFromURL(const WCHAR *url, IMFByteStream *bytestream, IMFAttributes *attributes, - IMFSinkWriter **writer) -{ - FIXME("%s, %p, %p, %p.\n", debugstr_w(url), bytestream, attributes, writer); - - return E_NOTIMPL; -} - static HRESULT create_source_reader_from_object(IUnknown *unk, IMFAttributes *attributes, REFIID riid, void **out) { IMFMediaSource *source = NULL; diff --git a/dlls/mfreadwrite/writer.c b/dlls/mfreadwrite/writer.c new file mode 100644 index 0000000000..234ce395b3 --- /dev/null +++ b/dlls/mfreadwrite/writer.c @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#define NONAMELESSUNION + +#include "mfapi.h" +#include "mfidl.h" +#include "mfreadwrite.h" +#include "mf_private.h" + +#include "wine/debug.h" +#include "wine/heap.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mfplat); + +struct sink_writer +{ + IMFSinkWriter IMFSinkWriter_iface; + LONG refcount; +}; + +static struct sink_writer *impl_from_IMFSinkWriter(IMFSinkWriter *iface) +{ + return CONTAINING_RECORD(iface, struct sink_writer, IMFSinkWriter_iface); +} + +static HRESULT WINAPI sink_writer_QueryInterface(IMFSinkWriter *iface, REFIID riid, void **out) +{ + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualIID(riid, &IID_IMFSinkWriter) || + IsEqualIID(riid, &IID_IUnknown)) + { + *out = iface; + IMFSinkWriter_AddRef(iface); + return S_OK; + } + + WARN("Unsupported %s.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI sink_writer_AddRef(IMFSinkWriter *iface) +{ + struct sink_writer *writer = impl_from_IMFSinkWriter(iface); + ULONG refcount = InterlockedIncrement(&writer->refcount); + + TRACE("%p, %u.\n", iface, refcount); + + return refcount; +} + +static ULONG WINAPI sink_writer_Release(IMFSinkWriter *iface) +{ + struct sink_writer *writer = impl_from_IMFSinkWriter(iface); + ULONG refcount = InterlockedDecrement(&writer->refcount); + + TRACE("%p, %u.\n", iface, refcount); + + if (!refcount) + { + heap_free(writer); + } + + return refcount; +} + +static HRESULT WINAPI sink_writer_AddStream(IMFSinkWriter *iface, IMFMediaType *type, DWORD *index) +{ + FIXME("%p, %p, %p.\n", iface, type, index); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_SetInputMediaType(IMFSinkWriter *iface, DWORD index, IMFMediaType *type, + IMFAttributes *parameters) +{ + FIXME("%p, %u, %p, %p.\n", iface, index, type, parameters); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_BeginWriting(IMFSinkWriter *iface) +{ + FIXME("%p.\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_WriteSample(IMFSinkWriter *iface, DWORD index, IMFSample *sample) +{ + FIXME("%p, %u, %p.\n", iface, index, sample); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_SendStreamTick(IMFSinkWriter *iface, DWORD index, LONGLONG timestamp) +{ + FIXME("%p, %u, %s.\n", iface, index, wine_dbgstr_longlong(timestamp)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_PlaceMarker(IMFSinkWriter *iface, DWORD index, void *context) +{ + FIXME("%p, %u, %p.\n", iface, index, context); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_NotifyEndOfSegment(IMFSinkWriter *iface, DWORD index) +{ + FIXME("%p, %u.\n", iface, index); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_Flush(IMFSinkWriter *iface, DWORD index) +{ + FIXME("%p, %u.\n", iface, index); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_Finalize(IMFSinkWriter *iface) +{ + FIXME("%p.\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_GetServiceForStream(IMFSinkWriter *iface, DWORD index, REFGUID service, + REFIID riid, void **object) +{ + FIXME("%p, %u, %s, %s, %p.\n", iface, index, debugstr_guid(service), debugstr_guid(riid), object); + + return E_NOTIMPL; +} + +static HRESULT WINAPI sink_writer_GetStatistics(IMFSinkWriter *iface, DWORD index, MF_SINK_WRITER_STATISTICS *stats) +{ + FIXME("%p, %u, %p.\n", iface, index, stats); + + return E_NOTIMPL; +} + +static const IMFSinkWriterVtbl sink_writer_vtbl = +{ + sink_writer_QueryInterface, + sink_writer_AddRef, + sink_writer_Release, + sink_writer_AddStream, + sink_writer_SetInputMediaType, + sink_writer_BeginWriting, + sink_writer_WriteSample, + sink_writer_SendStreamTick, + sink_writer_PlaceMarker, + sink_writer_NotifyEndOfSegment, + sink_writer_Flush, + sink_writer_Finalize, + sink_writer_GetServiceForStream, + sink_writer_GetStatistics, +}; + +HRESULT create_sink_writer_from_sink(IMFMediaSink *sink, IMFAttributes *attributes, + REFIID riid, void **out) +{ + struct sink_writer *object; + HRESULT hr; + + object = heap_alloc(sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IMFSinkWriter_iface.lpVtbl = &sink_writer_vtbl; + object->refcount = 1; + + hr = IMFSinkWriter_QueryInterface(&object->IMFSinkWriter_iface, riid, out); + IMFSinkWriter_Release(&object->IMFSinkWriter_iface); + return hr; +} + +HRESULT create_sink_writer_from_stream(IMFByteStream *stream, IMFAttributes *attributes, + REFIID riid, void **out) +{ + struct sink_writer *object; + HRESULT hr; + + object = heap_alloc(sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + object->IMFSinkWriter_iface.lpVtbl = &sink_writer_vtbl; + object->refcount = 1; + + hr = IMFSinkWriter_QueryInterface(&object->IMFSinkWriter_iface, riid, out); + IMFSinkWriter_Release(&object->IMFSinkWriter_iface); + return hr; +} + +/*********************************************************************** + * MFCreateSinkWriterFromMediaSink (mfreadwrite.@) + */ +HRESULT WINAPI MFCreateSinkWriterFromMediaSink(IMFMediaSink *sink, IMFAttributes *attributes, IMFSinkWriter **writer) +{ + TRACE("%p, %p, %p.\n", sink, attributes, writer); + + return create_sink_writer_from_sink(sink, attributes, &IID_IMFSinkWriter, (void **)writer); +} + +/*********************************************************************** + * MFCreateSinkWriterFromURL (mfreadwrite.@) + */ +HRESULT WINAPI MFCreateSinkWriterFromURL(const WCHAR *url, IMFByteStream *bytestream, IMFAttributes *attributes, + IMFSinkWriter **writer) +{ + FIXME("%s, %p, %p, %p.\n", debugstr_w(url), bytestream, attributes, writer); + + return E_NOTIMPL; +} +
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=68204
Your paranoid android.
=== debiant (build log) ===
../wine/dlls/mfreadwrite/reader.c:41: error: mf_private.h: No such file or directory config.status: error: could not create Makefile Task: The win32 Wine build failed
=== debiant (build log) ===
../wine/dlls/mfreadwrite/reader.c:41: error: mf_private.h: No such file or directory config.status: error: could not create Makefile Task: The wow64 Wine build failed