Nikolay Sivov : mf: Add stubs to create audio renderer sink.
Alexandre Julliard
julliard at winehq.org
Mon May 13 16:24:16 CDT 2019
Module: wine
Branch: master
Commit: 12a02e98a52f1c7d2c491e91391c8b31cbf5e7ea
URL: https://source.winehq.org/git/wine.git/?a=commit;h=12a02e98a52f1c7d2c491e91391c8b31cbf5e7ea
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri May 10 18:44:33 2019 +0300
mf: Add stubs to create audio renderer sink.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mf/Makefile.in | 1 +
dlls/mf/main.c | 2 +-
dlls/mf/mf.spec | 4 +--
dlls/mf/mf_private.h | 2 +-
dlls/mf/samplegrabber.c | 4 +--
dlls/mf/sar.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 83 insertions(+), 6 deletions(-)
diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in
index 2eb9b34..ecedea6 100644
--- a/dlls/mf/Makefile.in
+++ b/dlls/mf/Makefile.in
@@ -5,6 +5,7 @@ IMPORTS = mfplat mfuuid
C_SRCS = \
main.c \
samplegrabber.c \
+ sar.c \
session.c \
topology.c
diff --git a/dlls/mf/main.c b/dlls/mf/main.c
index c2e5eb4..b5b4b0e 100644
--- a/dlls/mf/main.c
+++ b/dlls/mf/main.c
@@ -392,7 +392,7 @@ static HRESULT WINAPI activate_object_ActivateObject(IMFActivate *iface, REFIID
if (!activate->object)
{
- if (FAILED(hr = activate->funcs->create_object(activate->context, &object)))
+ if (FAILED(hr = activate->funcs->create_object((IMFAttributes *)iface, activate->context, &object)))
return hr;
if (!InterlockedCompareExchangePointer((void **)&activate->object, object, NULL))
diff --git a/dlls/mf/mf.spec b/dlls/mf/mf.spec
index 6131495..6e64404 100644
--- a/dlls/mf/mf.spec
+++ b/dlls/mf/mf.spec
@@ -23,8 +23,8 @@
@ stub MFCreateASFStreamingMediaSinkActivate
@ stub MFCreateAggregateSource
@ stub MFCreateAppSourceProxy
-@ stub MFCreateAudioRenderer
-@ stub MFCreateAudioRendererActivate
+@ stdcall MFCreateAudioRenderer(ptr ptr)
+@ stdcall MFCreateAudioRendererActivate(ptr)
@ stub MFCreateByteCacheFile
@ stub MFCreateCacheManager
@ stub MFCreateCredentialCache
diff --git a/dlls/mf/mf_private.h b/dlls/mf/mf_private.h
index 45a3834..0b7d1c6 100644
--- a/dlls/mf/mf_private.h
+++ b/dlls/mf/mf_private.h
@@ -49,7 +49,7 @@ static inline BOOL mf_array_reserve(void **elements, size_t *capacity, size_t co
struct activate_funcs
{
- HRESULT (*create_object)(void *context, IUnknown **object);
+ HRESULT (*create_object)(IMFAttributes *attributes, void *context, IUnknown **object);
void (*free_private)(void *context);
};
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c
index 1ffa3ba..7b35364 100644
--- a/dlls/mf/samplegrabber.c
+++ b/dlls/mf/samplegrabber.c
@@ -40,9 +40,9 @@ static void sample_grabber_free_private(void *user_context)
heap_free(context);
}
-static HRESULT sample_grabber_create_object(void *user_context, IUnknown **obj)
+static HRESULT sample_grabber_create_object(IMFAttributes *attributes, void *user_context, IUnknown **obj)
{
- FIXME("%p, %p.\n", user_context, obj);
+ FIXME("%p, %p, %p.\n", attributes, user_context, obj);
return E_NOTIMPL;
}
diff --git a/dlls/mf/sar.c b/dlls/mf/sar.c
new file mode 100644
index 0000000..c0c1803
--- /dev/null
+++ b/dlls/mf/sar.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2019 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
+
+#include "mfidl.h"
+#include "mf_private.h"
+
+#include "wine/debug.h"
+#include "wine/heap.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
+
+static HRESULT sar_create_object(IMFAttributes *attributes, void *user_context, IUnknown **obj)
+{
+ FIXME("%p, %p, %p.\n", attributes, user_context, obj);
+
+ return E_NOTIMPL;
+}
+
+static void sar_free_private(void *user_context)
+{
+}
+
+static const struct activate_funcs sar_activate_funcs =
+{
+ sar_create_object,
+ sar_free_private,
+};
+
+/***********************************************************************
+ * MFCreateAudioRendererActivate (mf.@)
+ */
+HRESULT WINAPI MFCreateAudioRendererActivate(IMFActivate **activate)
+{
+ TRACE("%p.\n", activate);
+
+ if (!activate)
+ return E_POINTER;
+
+ return create_activation_object(NULL, &sar_activate_funcs, activate);
+}
+
+/***********************************************************************
+ * MFCreateAudioRenderer (mf.@)
+ */
+HRESULT WINAPI MFCreateAudioRenderer(IMFAttributes *attributes, IMFMediaSink **sink)
+{
+ IUnknown *object;
+ HRESULT hr;
+
+ TRACE("%p, %p.\n", attributes, sink);
+
+ if (SUCCEEDED(hr = sar_create_object(attributes, NULL, &object)))
+ {
+ hr = IUnknown_QueryInterface(object, &IID_IMFMediaSink, (void **)sink);
+ IUnknown_Release(object);
+ }
+
+ return hr;
+}
More information about the wine-cvs
mailing list