[PATCH 16/17] winegstreamer: Implement Get*Attributes functions for color converter transform.
Derek Lesho
dlesho at codeweavers.com
Thu Dec 3 15:56:04 CST 2020
Signed-off-by: Derek Lesho <dlesho at codeweavers.com>
---
dlls/winegstreamer/colorconvert.c | 37 +++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/winegstreamer/colorconvert.c b/dlls/winegstreamer/colorconvert.c
index 43b8dddeee7..9e6ece796f3 100644
--- a/dlls/winegstreamer/colorconvert.c
+++ b/dlls/winegstreamer/colorconvert.c
@@ -52,6 +52,8 @@ struct color_converter
{
IMFTransform IMFTransform_iface;
LONG refcount;
+ IMFAttributes *attributes;
+ IMFAttributes *output_attributes;
IMFMediaType *input_type;
IMFMediaType *output_type;
CRITICAL_SECTION cs;
@@ -102,6 +104,10 @@ static ULONG WINAPI color_converter_Release(IMFTransform *iface)
{
transform->cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&transform->cs);
+ if (transform->attributes)
+ IMFAttributes_Release(transform->attributes);
+ if (transform->output_attributes)
+ IMFAttributes_Release(transform->output_attributes);
gst_object_unref(transform->container);
heap_free(transform);
}
@@ -167,9 +173,14 @@ static HRESULT WINAPI color_converter_GetOutputStreamInfo(IMFTransform *iface, D
static HRESULT WINAPI color_converter_GetAttributes(IMFTransform *iface, IMFAttributes **attributes)
{
- FIXME("%p, %p.\n", iface, attributes);
+ struct color_converter *converter = impl_color_converter_from_IMFTransform(iface);
- return E_NOTIMPL;
+ TRACE("%p, %p.\n", iface, attributes);
+
+ *attributes = converter->attributes;
+ IMFAttributes_AddRef(*attributes);
+
+ return S_OK;
}
static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *iface, DWORD id,
@@ -183,9 +194,14 @@ static HRESULT WINAPI color_converter_GetInputStreamAttributes(IMFTransform *ifa
static HRESULT WINAPI color_converter_GetOutputStreamAttributes(IMFTransform *iface, DWORD id,
IMFAttributes **attributes)
{
- FIXME("%p, %u, %p.\n", iface, id, attributes);
+ struct color_converter *converter = impl_color_converter_from_IMFTransform(iface);
- return E_NOTIMPL;
+ TRACE("%p, %u, %p.\n", iface, id, attributes);
+
+ *attributes = converter->output_attributes;
+ IMFAttributes_AddRef(*attributes);
+
+ return S_OK;
}
static HRESULT WINAPI color_converter_DeleteInputStream(IMFTransform *iface, DWORD id)
@@ -639,6 +655,7 @@ static const IMFTransformVtbl color_converter_vtbl =
HRESULT color_converter_create(REFIID riid, void **ret)
{
struct color_converter *object;
+ HRESULT hr;
TRACE("%s %p\n", debugstr_guid(riid), ret);
@@ -651,6 +668,18 @@ HRESULT color_converter_create(REFIID riid, void **ret)
InitializeCriticalSection(&object->cs);
object->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": color_converter_lock");
+ if (FAILED(hr = MFCreateAttributes(&object->attributes, 0)))
+ {
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return hr;
+ }
+
+ if (FAILED(hr = MFCreateAttributes(&object->output_attributes, 0)))
+ {
+ IMFTransform_Release(&object->IMFTransform_iface);
+ return hr;
+ }
+
object->container = gst_bin_new(NULL);
if (!(object->appsrc = gst_element_factory_make("appsrc", NULL)))
--
2.29.2
More information about the wine-devel
mailing list