2012-05-15 10:15:32 +02:00
|
|
|
/* GStreamer Base Functions
|
2010-10-20 20:55:16 +02:00
|
|
|
*
|
|
|
|
* Copyright 2002 Lionel Ulmer
|
|
|
|
* Copyright 2010 Aric Stewart, 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
|
|
|
|
*/
|
|
|
|
|
2021-03-24 19:34:13 +01:00
|
|
|
#define WINE_NO_NAMELESS_EXTENSION
|
|
|
|
|
2021-10-20 18:09:45 +02:00
|
|
|
#define EXTERN_GUID DEFINE_GUID
|
|
|
|
#include "initguid.h"
|
2019-04-23 04:13:01 +02:00
|
|
|
#include "gst_private.h"
|
2021-02-20 03:34:59 +01:00
|
|
|
#include "winternl.h"
|
2019-04-23 04:13:01 +02:00
|
|
|
#include "rpcproxy.h"
|
2010-10-20 20:55:16 +02:00
|
|
|
#include "gst_guids.h"
|
|
|
|
|
2021-10-05 02:20:51 +02:00
|
|
|
static unixlib_handle_t unix_handle;
|
|
|
|
|
2021-07-11 02:22:21 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
|
2010-10-20 20:55:16 +02:00
|
|
|
|
2021-10-20 18:09:45 +02:00
|
|
|
DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
|
|
|
2021-10-06 18:46:33 +02:00
|
|
|
bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
|
|
|
|
{
|
|
|
|
unsigned int new_capacity, max_capacity;
|
|
|
|
void *new_elements;
|
|
|
|
|
|
|
|
if (count <= *capacity)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
max_capacity = ~(SIZE_T)0 / size;
|
|
|
|
if (count > max_capacity)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
new_capacity = max(4, *capacity);
|
|
|
|
while (new_capacity < count && new_capacity <= max_capacity / 2)
|
|
|
|
new_capacity *= 2;
|
|
|
|
if (new_capacity < count)
|
|
|
|
new_capacity = max_capacity;
|
|
|
|
|
|
|
|
if (!(new_elements = realloc(*elements, new_capacity * size)))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
*elements = new_elements;
|
|
|
|
*capacity = new_capacity;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-10-05 02:20:51 +02:00
|
|
|
struct wg_parser *wg_parser_create(enum wg_parser_type type, bool unlimited_buffering)
|
|
|
|
{
|
|
|
|
struct wg_parser_create_params params =
|
|
|
|
{
|
|
|
|
.type = type,
|
|
|
|
.unlimited_buffering = unlimited_buffering,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (__wine_unix_call(unix_handle, unix_wg_parser_create, ¶ms))
|
|
|
|
return NULL;
|
|
|
|
return params.parser;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_destroy(struct wg_parser *parser)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_destroy, parser);
|
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT wg_parser_connect(struct wg_parser *parser, uint64_t file_size)
|
|
|
|
{
|
|
|
|
struct wg_parser_connect_params params =
|
|
|
|
{
|
|
|
|
.parser = parser,
|
|
|
|
.file_size = file_size,
|
|
|
|
};
|
|
|
|
|
|
|
|
return __wine_unix_call(unix_handle, unix_wg_parser_connect, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_disconnect(struct wg_parser *parser)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_disconnect, parser);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_begin_flush(struct wg_parser *parser)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_begin_flush, parser);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_end_flush(struct wg_parser *parser)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_end_flush, parser);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wg_parser_get_next_read_offset(struct wg_parser *parser, uint64_t *offset, uint32_t *size)
|
|
|
|
{
|
|
|
|
struct wg_parser_get_next_read_offset_params params =
|
|
|
|
{
|
|
|
|
.parser = parser,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (__wine_unix_call(unix_handle, unix_wg_parser_get_next_read_offset, ¶ms))
|
|
|
|
return false;
|
|
|
|
*offset = params.offset;
|
|
|
|
*size = params.size;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_push_data(struct wg_parser *parser, const void *data, uint32_t size)
|
|
|
|
{
|
|
|
|
struct wg_parser_push_data_params params =
|
|
|
|
{
|
|
|
|
.parser = parser,
|
|
|
|
.data = data,
|
|
|
|
.size = size,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_push_data, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint32_t wg_parser_get_stream_count(struct wg_parser *parser)
|
|
|
|
{
|
|
|
|
struct wg_parser_get_stream_count_params params =
|
|
|
|
{
|
|
|
|
.parser = parser,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_get_stream_count, ¶ms);
|
|
|
|
return params.count;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct wg_parser_stream *wg_parser_get_stream(struct wg_parser *parser, uint32_t index)
|
|
|
|
{
|
|
|
|
struct wg_parser_get_stream_params params =
|
|
|
|
{
|
|
|
|
.parser = parser,
|
|
|
|
.index = index,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_get_stream, ¶ms);
|
|
|
|
return params.stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_get_preferred_format(struct wg_parser_stream *stream, struct wg_format *format)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_get_preferred_format_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.format = format,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_get_preferred_format, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_enable(struct wg_parser_stream *stream, const struct wg_format *format)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_enable_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.format = format,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_enable, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_disable(struct wg_parser_stream *stream)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_disable, stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wg_parser_stream_get_event(struct wg_parser_stream *stream, struct wg_parser_event *event)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_get_event_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.event = event,
|
|
|
|
};
|
|
|
|
|
|
|
|
return !__wine_unix_call(unix_handle, unix_wg_parser_stream_get_event, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wg_parser_stream_copy_buffer(struct wg_parser_stream *stream,
|
|
|
|
void *data, uint32_t offset, uint32_t size)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_copy_buffer_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.data = data,
|
|
|
|
.offset = offset,
|
|
|
|
.size = size,
|
|
|
|
};
|
|
|
|
|
|
|
|
return !__wine_unix_call(unix_handle, unix_wg_parser_stream_copy_buffer, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_release_buffer(struct wg_parser_stream *stream)
|
|
|
|
{
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_release_buffer, stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_notify_qos(struct wg_parser_stream *stream,
|
|
|
|
bool underflow, double proportion, int64_t diff, uint64_t timestamp)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_notify_qos_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.underflow = underflow,
|
|
|
|
.proportion = proportion,
|
|
|
|
.diff = diff,
|
|
|
|
.timestamp = timestamp,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_notify_qos, ¶ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint64_t wg_parser_stream_get_duration(struct wg_parser_stream *stream)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_get_duration_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_get_duration, ¶ms);
|
|
|
|
return params.duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wg_parser_stream_seek(struct wg_parser_stream *stream, double rate,
|
|
|
|
uint64_t start_pos, uint64_t stop_pos, DWORD start_flags, DWORD stop_flags)
|
|
|
|
{
|
|
|
|
struct wg_parser_stream_seek_params params =
|
|
|
|
{
|
|
|
|
.stream = stream,
|
|
|
|
.rate = rate,
|
|
|
|
.start_pos = start_pos,
|
|
|
|
.stop_pos = stop_pos,
|
|
|
|
.start_flags = start_flags,
|
|
|
|
.stop_flags = stop_flags,
|
|
|
|
};
|
|
|
|
|
|
|
|
__wine_unix_call(unix_handle, unix_wg_parser_stream_seek, ¶ms);
|
|
|
|
}
|
2021-02-11 23:18:56 +01:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
|
|
|
|
{
|
|
|
|
if (reason == DLL_PROCESS_ATTACH)
|
2010-10-26 18:39:15 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
DisableThreadLibraryCalls(instance);
|
2021-10-05 02:20:51 +02:00
|
|
|
NtQueryVirtualMemory(GetCurrentProcess(), instance, MemoryWineUnixFuncs,
|
|
|
|
&unix_handle, sizeof(unix_handle), NULL);
|
2010-10-26 18:39:15 +02:00
|
|
|
}
|
2020-03-08 20:05:09 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
2010-10-26 18:39:15 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
struct class_factory
|
2019-09-19 04:37:03 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
IClassFactory IClassFactory_iface;
|
|
|
|
HRESULT (*create_instance)(IUnknown *outer, IUnknown **out);
|
2019-09-19 04:37:03 +02:00
|
|
|
};
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static inline struct class_factory *impl_from_IClassFactory(IClassFactory *iface)
|
2019-09-19 04:37:03 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
return CONTAINING_RECORD(iface, struct class_factory, IClassFactory_iface);
|
|
|
|
}
|
2019-09-19 04:37:03 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID iid, void **out)
|
2019-09-20 01:59:38 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out);
|
2019-09-20 01:59:38 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IClassFactory))
|
2019-09-20 01:59:38 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
*out = iface;
|
|
|
|
IClassFactory_AddRef(iface);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2019-09-20 01:59:38 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
*out = NULL;
|
|
|
|
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
2019-09-20 01:59:38 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static ULONG WINAPI class_factory_AddRef(IClassFactory *iface)
|
2019-09-21 00:35:05 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
return 2;
|
|
|
|
}
|
2019-09-21 00:35:05 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static ULONG WINAPI class_factory_Release(IClassFactory *iface)
|
2019-09-21 00:35:05 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
return 1;
|
|
|
|
}
|
2019-09-21 00:35:05 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static HRESULT WINAPI class_factory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **out)
|
2019-09-21 00:35:05 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
struct class_factory *factory = impl_from_IClassFactory(iface);
|
|
|
|
IUnknown *unk;
|
|
|
|
HRESULT hr;
|
2019-09-21 00:35:05 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out);
|
2019-09-21 00:35:05 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
if (outer && !IsEqualGUID(iid, &IID_IUnknown))
|
|
|
|
return E_NOINTERFACE;
|
2019-09-21 00:35:05 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
*out = NULL;
|
|
|
|
if (SUCCEEDED(hr = factory->create_instance(outer, &unk)))
|
2019-09-19 04:37:03 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
hr = IUnknown_QueryInterface(unk, iid, out);
|
|
|
|
IUnknown_Release(unk);
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|
2010-10-20 20:55:16 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL lock)
|
2010-10-20 20:55:16 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE("iface %p, lock %d.\n", iface, lock);
|
|
|
|
return S_OK;
|
2010-10-20 20:55:16 +02:00
|
|
|
}
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static const IClassFactoryVtbl class_factory_vtbl =
|
2010-10-28 11:42:52 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
class_factory_QueryInterface,
|
|
|
|
class_factory_AddRef,
|
|
|
|
class_factory_Release,
|
|
|
|
class_factory_CreateInstance,
|
|
|
|
class_factory_LockServer,
|
|
|
|
};
|
2019-07-05 15:23:21 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static struct class_factory avi_splitter_cf = {{&class_factory_vtbl}, avi_splitter_create};
|
2021-01-16 00:59:17 +01:00
|
|
|
static struct class_factory decodebin_parser_cf = {{&class_factory_vtbl}, decodebin_parser_create};
|
2020-03-08 20:05:09 +01:00
|
|
|
static struct class_factory mpeg_splitter_cf = {{&class_factory_vtbl}, mpeg_splitter_create};
|
|
|
|
static struct class_factory wave_parser_cf = {{&class_factory_vtbl}, wave_parser_create};
|
2019-07-05 15:23:21 +02:00
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
|
2010-10-28 11:42:52 +02:00
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
struct class_factory *factory;
|
2019-07-05 15:23:21 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE("clsid %s, iid %s, out %p.\n", debugstr_guid(clsid), debugstr_guid(iid), out);
|
2019-07-05 15:23:21 +02:00
|
|
|
|
2020-09-28 22:59:52 +02:00
|
|
|
if (!init_gstreamer())
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
if (SUCCEEDED(hr = mfplat_get_class_object(clsid, iid, out)))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
if (IsEqualGUID(clsid, &CLSID_AviSplitter))
|
|
|
|
factory = &avi_splitter_cf;
|
2021-01-16 00:59:17 +01:00
|
|
|
else if (IsEqualGUID(clsid, &CLSID_decodebin_parser))
|
|
|
|
factory = &decodebin_parser_cf;
|
2020-03-08 20:05:09 +01:00
|
|
|
else if (IsEqualGUID(clsid, &CLSID_MPEG1Splitter))
|
|
|
|
factory = &mpeg_splitter_cf;
|
|
|
|
else if (IsEqualGUID(clsid, &CLSID_WAVEParser))
|
|
|
|
factory = &wave_parser_cf;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
|
|
|
|
return CLASS_E_CLASSNOTAVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return IClassFactory_QueryInterface(&factory->IClassFactory_iface, iid, out);
|
2010-10-28 11:42:52 +02:00
|
|
|
}
|
|
|
|
|
2019-03-26 06:57:33 +01:00
|
|
|
static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ctx)
|
2016-01-14 20:22:11 +01:00
|
|
|
{
|
2021-02-11 23:18:57 +01:00
|
|
|
HINSTANCE handle;
|
2019-03-26 06:57:35 +01:00
|
|
|
|
2021-02-11 23:18:57 +01:00
|
|
|
/* Unloading glib is a bad idea.. it installs atexit handlers,
|
|
|
|
* so never unload the dll after loading */
|
|
|
|
GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN,
|
2021-04-30 13:40:11 +02:00
|
|
|
(LPCWSTR)init_gstreamer_proc, &handle);
|
2021-02-11 23:18:57 +01:00
|
|
|
if (!handle)
|
2021-04-30 13:40:11 +02:00
|
|
|
ERR("Failed to pin module.\n");
|
2019-03-26 06:57:33 +01:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL init_gstreamer(void)
|
|
|
|
{
|
|
|
|
static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
|
|
|
|
|
2021-02-11 23:18:57 +01:00
|
|
|
InitOnceExecuteOnce(&once, init_gstreamer_proc, NULL, NULL);
|
2019-03-26 06:57:33 +01:00
|
|
|
|
2021-02-11 23:18:57 +01:00
|
|
|
return TRUE;
|
2010-10-25 15:44:41 +02:00
|
|
|
}
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
static const REGPINTYPES reg_audio_mt = {&MEDIATYPE_Audio, &GUID_NULL};
|
|
|
|
static const REGPINTYPES reg_stream_mt = {&MEDIATYPE_Stream, &GUID_NULL};
|
|
|
|
static const REGPINTYPES reg_video_mt = {&MEDIATYPE_Video, &GUID_NULL};
|
|
|
|
|
|
|
|
static const REGPINTYPES reg_avi_splitter_sink_mt = {&MEDIATYPE_Stream, &MEDIASUBTYPE_Avi};
|
|
|
|
|
|
|
|
static const REGFILTERPINS2 reg_avi_splitter_pins[2] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_avi_splitter_sink_mt,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_video_mt,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGFILTER2 reg_avi_splitter =
|
|
|
|
{
|
|
|
|
.dwVersion = 2,
|
|
|
|
.dwMerit = MERIT_NORMAL,
|
|
|
|
.u.s2.cPins2 = 2,
|
|
|
|
.u.s2.rgPins2 = reg_avi_splitter_pins,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGPINTYPES reg_mpeg_splitter_sink_mts[4] =
|
|
|
|
{
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Audio},
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1Video},
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1System},
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_MPEG1VideoCD},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGPINTYPES reg_mpeg_splitter_audio_mts[2] =
|
|
|
|
{
|
|
|
|
{&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1Packet},
|
|
|
|
{&MEDIATYPE_Audio, &MEDIASUBTYPE_MPEG1AudioPayload},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGPINTYPES reg_mpeg_splitter_video_mts[2] =
|
|
|
|
{
|
|
|
|
{&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Packet},
|
|
|
|
{&MEDIATYPE_Video, &MEDIASUBTYPE_MPEG1Payload},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGFILTERPINS2 reg_mpeg_splitter_pins[3] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.nMediaTypes = 4,
|
|
|
|
.lpMediaType = reg_mpeg_splitter_sink_mts,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 2,
|
|
|
|
.lpMediaType = reg_mpeg_splitter_audio_mts,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_ZERO | REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 2,
|
|
|
|
.lpMediaType = reg_mpeg_splitter_video_mts,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGFILTER2 reg_mpeg_splitter =
|
|
|
|
{
|
|
|
|
.dwVersion = 2,
|
|
|
|
.dwMerit = MERIT_NORMAL,
|
|
|
|
.u.s2.cPins2 = 3,
|
|
|
|
.u.s2.rgPins2 = reg_mpeg_splitter_pins,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGPINTYPES reg_wave_parser_sink_mts[3] =
|
|
|
|
{
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_WAVE},
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_AU},
|
|
|
|
{&MEDIATYPE_Stream, &MEDIASUBTYPE_AIFF},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGFILTERPINS2 reg_wave_parser_pins[2] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
.nMediaTypes = 3,
|
|
|
|
.lpMediaType = reg_wave_parser_sink_mts,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_audio_mt,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static const REGFILTER2 reg_wave_parser =
|
|
|
|
{
|
|
|
|
.dwVersion = 2,
|
|
|
|
.dwMerit = MERIT_UNLIKELY,
|
|
|
|
.u.s2.cPins2 = 2,
|
|
|
|
.u.s2.rgPins2 = reg_wave_parser_pins,
|
|
|
|
};
|
|
|
|
|
2021-01-16 00:59:17 +01:00
|
|
|
static const REGFILTERPINS2 reg_decodebin_parser_pins[3] =
|
2020-03-08 20:05:09 +01:00
|
|
|
{
|
|
|
|
{
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_stream_mt,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_audio_mt,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
.dwFlags = REG_PINFLAG_B_OUTPUT,
|
|
|
|
.nMediaTypes = 1,
|
|
|
|
.lpMediaType = ®_video_mt,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2021-01-16 00:59:17 +01:00
|
|
|
static const REGFILTER2 reg_decodebin_parser =
|
2020-03-08 20:05:09 +01:00
|
|
|
{
|
|
|
|
.dwVersion = 2,
|
|
|
|
.dwMerit = MERIT_PREFERRED,
|
|
|
|
.u.s2.cPins2 = 3,
|
2021-01-16 00:59:17 +01:00
|
|
|
.u.s2.rgPins2 = reg_decodebin_parser_pins,
|
2020-03-08 20:05:09 +01:00
|
|
|
};
|
|
|
|
|
2010-10-20 20:55:16 +02:00
|
|
|
HRESULT WINAPI DllRegisterServer(void)
|
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
IFilterMapper2 *mapper;
|
2010-10-20 20:55:16 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE(".\n");
|
2010-10-20 20:55:16 +02:00
|
|
|
|
2021-04-30 13:40:11 +02:00
|
|
|
if (FAILED(hr = __wine_register_resources()))
|
2020-03-08 20:05:09 +01:00
|
|
|
return hr;
|
|
|
|
|
|
|
|
if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IFilterMapper2, (void **)&mapper)))
|
|
|
|
return hr;
|
|
|
|
|
2021-02-22 23:53:45 +01:00
|
|
|
IFilterMapper2_RegisterFilter(mapper, &CLSID_AviSplitter, L"AVI Splitter", NULL, NULL, NULL, ®_avi_splitter);
|
2021-01-16 00:59:17 +01:00
|
|
|
IFilterMapper2_RegisterFilter(mapper, &CLSID_decodebin_parser,
|
2021-02-22 23:53:45 +01:00
|
|
|
L"GStreamer splitter filter", NULL, NULL, NULL, ®_decodebin_parser);
|
|
|
|
IFilterMapper2_RegisterFilter(mapper, &CLSID_MPEG1Splitter,
|
|
|
|
L"MPEG-I Stream Splitter", NULL, NULL, NULL, ®_mpeg_splitter);
|
|
|
|
IFilterMapper2_RegisterFilter(mapper, &CLSID_WAVEParser, L"Wave Parser", NULL, NULL, NULL, ®_wave_parser);
|
2020-03-08 20:05:09 +01:00
|
|
|
|
|
|
|
IFilterMapper2_Release(mapper);
|
2020-12-03 17:42:19 +01:00
|
|
|
|
|
|
|
return mfplat_DllRegisterServer();
|
2010-10-20 20:55:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
HRESULT WINAPI DllUnregisterServer(void)
|
|
|
|
{
|
2020-03-08 20:05:09 +01:00
|
|
|
IFilterMapper2 *mapper;
|
2010-10-20 20:55:16 +02:00
|
|
|
HRESULT hr;
|
|
|
|
|
2020-03-08 20:05:09 +01:00
|
|
|
TRACE(".\n");
|
2010-10-20 20:55:16 +02:00
|
|
|
|
2021-04-30 13:40:11 +02:00
|
|
|
if (FAILED(hr = __wine_unregister_resources()))
|
2020-03-08 20:05:09 +01:00
|
|
|
return hr;
|
|
|
|
|
|
|
|
if (FAILED(hr = CoCreateInstance(&CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
|
|
|
|
&IID_IFilterMapper2, (void **)&mapper)))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_AviSplitter);
|
2021-01-16 00:59:17 +01:00
|
|
|
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_decodebin_parser);
|
2020-03-08 20:05:09 +01:00
|
|
|
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_MPEG1Splitter);
|
|
|
|
IFilterMapper2_UnregisterFilter(mapper, NULL, NULL, &CLSID_WAVEParser);
|
|
|
|
|
|
|
|
IFilterMapper2_Release(mapper);
|
|
|
|
return S_OK;
|
2010-10-20 20:55:16 +02:00
|
|
|
}
|