Commit 74dc0c5d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Reimplement COM registration and vending locally.

parent 7bcb8e74
......@@ -5,7 +5,6 @@ EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
PARENTSRC = ../strmbase
C_SRCS = \
dllfunc.c \
filter.c \
gst_cbs.c \
gstdemux.c \
......@@ -16,7 +15,8 @@ C_SRCS = \
qualitycontrol.c \
seeking.c
IDL_SRCS = mfplat.idl
IDL_SRCS = \
winegstreamer_classes.idl
RC_SRCS = \
rsrc.rc
......@@ -22,8 +22,14 @@
#define __GST_PRIVATE_INCLUDED__
#include <stdarg.h>
#include <stdio.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/audio/audio.h>
#define COBJMACROS
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "windef.h"
#include "winbase.h"
#include "wtypes.h"
......@@ -35,16 +41,17 @@
#define MEDIATIME_FROM_BYTES(x) ((LONGLONG)(x) * 10000000)
IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *pUnkOuter, HRESULT *phr);
IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr) DECLSPEC_HIDDEN;
extern LONG object_locks;
HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT gstdemux_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out) DECLSPEC_HIDDEN;
BOOL init_gstreamer(void) DECLSPEC_HIDDEN;
void start_dispatch_thread(void) DECLSPEC_HIDDEN;
extern HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) DECLSPEC_HIDDEN;
extern HRESULT mfplat_can_unload_now(void) DECLSPEC_HIDDEN;
#endif /* __GST_PRIVATE_INCLUDED__ */
......@@ -20,11 +20,6 @@
*/
#include "config.h"
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/audio/audio.h>
#include "gst_private.h"
#include "gst_guids.h"
#include "gst_cbs.h"
......@@ -1719,23 +1714,17 @@ static HRESULT gstdecoder_source_get_media_type(struct gstdemux_source *pin,
return VFW_S_NO_MORE_ITEMS;
}
IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
HRESULT gstdemux_create(IUnknown *outer, IUnknown **out)
{
struct gstdemux *object;
if (!init_gstreamer())
{
*phr = E_FAIL;
return NULL;
}
return E_FAIL;
mark_wine_thread();
if (!(object = heap_alloc_zero(sizeof(*object))))
{
*phr = E_OUTOFMEMORY;
return NULL;
}
return E_OUTOFMEMORY;
strmbase_filter_init(&object->filter, outer, &CLSID_Gstreamer_Splitter, &filter_ops);
strmbase_sink_init(&object->sink, &object->filter, wcsInputPinName, &sink_ops, NULL);
......@@ -1745,10 +1734,10 @@ IUnknown * CALLBACK Gstreamer_Splitter_create(IUnknown *outer, HRESULT *phr)
object->init_gst = gstdecoder_init_gst;
object->source_query_accept = gstdecoder_source_query_accept;
object->source_get_media_type = gstdecoder_source_get_media_type;
*phr = S_OK;
TRACE("Created GStreamer demuxer %p.\n", object);
return &object->filter.IUnknown_inner;
*out = &object->filter.IUnknown_inner;
return S_OK;
}
static struct gstdemux *impl_from_IAMStreamSelect(IAMStreamSelect *iface)
......@@ -2422,24 +2411,18 @@ static HRESULT wave_parser_source_get_media_type(struct gstdemux_source *pin,
return S_OK;
}
IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
HRESULT wave_parser_create(IUnknown *outer, IUnknown **out)
{
static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0};
struct gstdemux *object;
if (!init_gstreamer())
{
*phr = E_FAIL;
return NULL;
}
return E_FAIL;
mark_wine_thread();
if (!(object = heap_alloc_zero(sizeof(*object))))
{
*phr = E_OUTOFMEMORY;
return NULL;
}
return E_OUTOFMEMORY;
strmbase_filter_init(&object->filter, outer, &CLSID_WAVEParser, &filter_ops);
strmbase_sink_init(&object->sink, &object->filter, sink_name, &wave_parser_sink_ops, NULL);
......@@ -2447,10 +2430,10 @@ IUnknown * CALLBACK wave_parser_create(IUnknown *outer, HRESULT *phr)
object->error_event = CreateEventW(NULL, TRUE, FALSE, NULL);
object->source_query_accept = wave_parser_source_query_accept;
object->source_get_media_type = wave_parser_source_get_media_type;
*phr = S_OK;
TRACE("Created WAVE parser %p.\n", object);
return &object->filter.IUnknown_inner;
*out = &object->filter.IUnknown_inner;
return S_OK;
}
static HRESULT avi_splitter_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
......@@ -2543,24 +2526,18 @@ static HRESULT avi_splitter_source_get_media_type(struct gstdemux_source *pin,
return S_OK;
}
IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
HRESULT avi_splitter_create(IUnknown *outer, IUnknown **out)
{
static const WCHAR sink_name[] = {'i','n','p','u','t',' ','p','i','n',0};
struct gstdemux *object;
if (!init_gstreamer())
{
*phr = E_FAIL;
return NULL;
}
return E_FAIL;
mark_wine_thread();
if (!(object = heap_alloc_zero(sizeof(*object))))
{
*phr = E_OUTOFMEMORY;
return NULL;
}
return E_OUTOFMEMORY;
strmbase_filter_init(&object->filter, outer, &CLSID_AviSplitter, &filter_ops);
strmbase_sink_init(&object->sink, &object->filter, sink_name, &avi_splitter_sink_ops, NULL);
......@@ -2569,10 +2546,10 @@ IUnknown * CALLBACK avi_splitter_create(IUnknown *outer, HRESULT *phr)
object->init_gst = avi_splitter_init_gst;
object->source_query_accept = avi_splitter_source_query_accept;
object->source_get_media_type = avi_splitter_source_get_media_type;
*phr = S_OK;
TRACE("Created AVI splitter %p.\n", object);
return &object->filter.IUnknown_inner;
*out = &object->filter.IUnknown_inner;
return S_OK;
}
static HRESULT mpeg_splitter_sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt)
......@@ -2701,24 +2678,18 @@ static const struct strmbase_filter_ops mpeg_splitter_ops =
.filter_wait_state = gstdemux_wait_state,
};
IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
HRESULT mpeg_splitter_create(IUnknown *outer, IUnknown **out)
{
static const WCHAR sink_name[] = {'I','n','p','u','t',0};
struct gstdemux *object;
if (!init_gstreamer())
{
*phr = E_FAIL;
return NULL;
}
return E_FAIL;
mark_wine_thread();
if (!(object = heap_alloc_zero(sizeof(*object))))
{
*phr = E_OUTOFMEMORY;
return NULL;
}
return E_OUTOFMEMORY;
strmbase_filter_init(&object->filter, outer, &CLSID_MPEG1Splitter, &mpeg_splitter_ops);
strmbase_sink_init(&object->sink, &object->filter, sink_name, &mpeg_splitter_sink_ops, NULL);
......@@ -2730,8 +2701,8 @@ IUnknown * CALLBACK mpeg_splitter_create(IUnknown *outer, HRESULT *phr)
object->source_query_accept = mpeg_splitter_source_query_accept;
object->source_get_media_type = mpeg_splitter_source_get_media_type;
object->enum_sink_first = TRUE;
*phr = S_OK;
TRACE("Created MPEG-1 splitter %p.\n", object);
return &object->filter.IUnknown_inner;
*out = &object->filter.IUnknown_inner;
return S_OK;
}
......@@ -18,9 +18,7 @@
#include <stdarg.h>
#define COBJMACROS
#define NONAMELESSUNION
#include "gst_private.h"
#include "mfapi.h"
#include "mfidl.h"
......@@ -29,8 +27,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static LONG object_locks;
struct video_processor
{
IMFTransform IMFTransform_iface;
......@@ -437,8 +433,3 @@ HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj)
return CLASS_E_CLASSNOTAVAILABLE;
}
HRESULT mfplat_can_unload_now(void)
{
return !object_locks ? S_OK : S_FALSE;
}
/*
* Copyright 2019 Nikolay Sivov for CodeWeavers
* COM classes for winegstreamer
*
* Copyright 2019 Nikolay Sivov
* Copyright 2019 Zebediah Figura
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -19,8 +22,35 @@
#pragma makedep register
[
helpstring("AVI Splitter"),
threading(both),
uuid(88753b26-5b24-49bd-b2e7-0c445c78c982)
uuid(1b544c20-fd0b-11ce-8c63-00aa0044b51e)
]
coclass AviSplitter {}
[
helpstring("MPEG-I Stream Splitter"),
threading(both),
uuid(336475d0-942a-11ce-a870-00aa002feab5)
]
coclass MPEG1Splitter {}
[
helpstring("Wave Parser"),
threading(both),
uuid(d51bd5a1-7548-11cf-a520-0080c77ef58a)
]
coclass WAVEParser {}
[
helpstring("GStreamer splitter"),
threading(both),
uuid(f9d8d64e-a144-47dc-8ee0-f53498372c29)
]
coclass Gstreamer_Splitter {}
[
threading(both),
uuid(88753b26-5b24-49bd-b2e7-0c445c78c982)
]
coclass VideoProcessorMFT { }
coclass VideoProcessorMFT {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment