Commit 2d0dc2d4 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Move the IWMProfile3 implementation to a separate object.

parent c4d5010f
MODULE = winegstreamer.dll
UNIXLIB = winegstreamer.so
IMPORTLIB = winegstreamer
IMPORTS = strmbase strmiids uuid ole32 mfuuid
IMPORTS = strmbase ole32
DELAYIMPORTS = mfplat
EXTRAINCL = $(GSTREAMER_CFLAGS)
EXTRALIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS)
......@@ -14,6 +14,7 @@ C_SRCS = \
quartz_parser.c \
wg_parser.c \
wm_asyncreader.c \
wm_reader.c \
wm_syncreader.c
IDL_SRCS = \
......
......@@ -33,6 +33,7 @@
#define NONAMELESSUNION
#include "dshow.h"
#include "mfidl.h"
#include "wmsdk.h"
#include "wine/debug.h"
#include "wine/strmbase.h"
......@@ -112,4 +113,20 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj) DECLSPEC_HI
HRESULT audio_converter_create(REFIID riid, void **ret) DECLSPEC_HIDDEN;
struct wm_reader
{
IWMProfile3 IWMProfile3_iface;
LONG refcount;
const struct wm_reader_ops *ops;
};
struct wm_reader_ops
{
void *(*query_interface)(struct wm_reader *reader, REFIID iid);
void (*destroy)(struct wm_reader *reader);
};
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops);
#endif /* __GST_PRIVATE_INCLUDED__ */
......@@ -20,17 +20,19 @@
#define WINE_NO_NAMELESS_EXTENSION
#define EXTERN_GUID DEFINE_GUID
#include "initguid.h"
#include "gst_private.h"
#include "winternl.h"
#include "rpcproxy.h"
#include "initguid.h"
#include "gst_guids.h"
static unixlib_handle_t unix_handle;
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
DEFINE_GUID(GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
bool array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
{
unsigned int new_capacity, max_capacity;
......
......@@ -19,9 +19,10 @@
#include "gst_private.h"
#include "mfapi.h"
#include "ks.h"
#include "ksmedia.h"
#include "initguid.h"
#include "mfapi.h"
#include "wine/debug.h"
......
/*
* Copyright 2012 Austin English
*
* 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
*/
#include "gst_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
static struct wm_reader *impl_from_IWMProfile3(IWMProfile3 *iface)
{
return CONTAINING_RECORD(iface, struct wm_reader, IWMProfile3_iface);
}
static HRESULT WINAPI profile_QueryInterface(IWMProfile3 *iface, REFIID iid, void **out)
{
struct wm_reader *reader = impl_from_IWMProfile3(iface);
TRACE("reader %p, iid %s, out %p.\n", reader, debugstr_guid(iid), out);
if (IsEqualIID(iid, &IID_IUnknown)
|| IsEqualIID(iid, &IID_IWMProfile)
|| IsEqualIID(iid, &IID_IWMProfile2)
|| IsEqualIID(iid, &IID_IWMProfile3))
{
*out = &reader->IWMProfile3_iface;
}
else if (!(*out = reader->ops->query_interface(reader, iid)))
{
WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
return E_NOINTERFACE;
}
IUnknown_AddRef((IUnknown *)*out);
return S_OK;
}
static ULONG WINAPI profile_AddRef(IWMProfile3 *iface)
{
struct wm_reader *reader = impl_from_IWMProfile3(iface);
ULONG refcount = InterlockedIncrement(&reader->refcount);
TRACE("%p increasing refcount to %u.\n", reader, refcount);
return refcount;
}
static ULONG WINAPI profile_Release(IWMProfile3 *iface)
{
struct wm_reader *reader = impl_from_IWMProfile3(iface);
ULONG refcount = InterlockedDecrement(&reader->refcount);
TRACE("%p decreasing refcount to %u.\n", reader, refcount);
if (!refcount)
reader->ops->destroy(reader);
return refcount;
}
static HRESULT WINAPI profile_GetVersion(IWMProfile3 *iface, WMT_VERSION *version)
{
FIXME("iface %p, version %p, stub!\n", iface, version);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetName(IWMProfile3 *iface, WCHAR *name, DWORD *length)
{
FIXME("iface %p, name %p, length %p, stub!\n", iface, name, length);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_SetName(IWMProfile3 *iface, const WCHAR *name)
{
FIXME("iface %p, name %s, stub!\n", iface, debugstr_w(name));
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetDescription(IWMProfile3 *iface, WCHAR *description, DWORD *length)
{
FIXME("iface %p, description %p, length %p, stub!\n", iface, description, length);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_SetDescription(IWMProfile3 *iface, const WCHAR *description)
{
FIXME("iface %p, description %s, stub!\n", iface, debugstr_w(description));
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetStreamCount(IWMProfile3 *iface, DWORD *count)
{
FIXME("iface %p, count %p, stub!\n", iface, count);
if (!count)
return E_INVALIDARG;
*count = 0;
return S_OK;
}
static HRESULT WINAPI profile_GetStream(IWMProfile3 *iface, DWORD index, IWMStreamConfig **config)
{
FIXME("iface %p, index %d, config %p, stub!\n", iface, index, config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetStreamByNumber(IWMProfile3 *iface, WORD stream_number, IWMStreamConfig **config)
{
FIXME("iface %p, stream_number %u, config %p, stub!\n", iface, stream_number, config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_RemoveStream(IWMProfile3 *iface, IWMStreamConfig *config)
{
FIXME("iface %p, config %p, stub!\n", iface, config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_RemoveStreamByNumber(IWMProfile3 *iface, WORD stream_number)
{
FIXME("iface %p, stream_number %u, stub!\n", iface, stream_number);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_AddStream(IWMProfile3 *iface, IWMStreamConfig *config)
{
FIXME("iface %p, config %p, stub!\n", iface, config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_ReconfigStream(IWMProfile3 *iface, IWMStreamConfig *config)
{
FIXME("iface %p, config %p, stub!\n", iface, config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_CreateNewStream(IWMProfile3 *iface, REFGUID type, IWMStreamConfig **config)
{
FIXME("iface %p, type %s, config %p, stub!\n", iface, debugstr_guid(type), config);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetMutualExclusionCount(IWMProfile3 *iface, DWORD *count)
{
FIXME("iface %p, count %p, stub!\n", iface, count);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetMutualExclusion(IWMProfile3 *iface, DWORD index, IWMMutualExclusion **excl)
{
FIXME("iface %p, index %u, excl %p, stub!\n", iface, index, excl);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_RemoveMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *excl)
{
FIXME("iface %p, excl %p, stub!\n", iface, excl);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_AddMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion *excl)
{
FIXME("iface %p, excl %p, stub!\n", iface, excl);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_CreateNewMutualExclusion(IWMProfile3 *iface, IWMMutualExclusion **excl)
{
FIXME("iface %p, excl %p, stub!\n", iface, excl);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetProfileID(IWMProfile3 *iface, GUID *id)
{
FIXME("iface %p, id %p, stub!\n", iface, id);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT *format)
{
FIXME("iface %p, format %p, stub!\n", iface, format);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_SetStorageFormat(IWMProfile3 *iface, WMT_STORAGE_FORMAT format)
{
FIXME("iface %p, format %#x, stub!\n", iface, format);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetBandwidthSharingCount(IWMProfile3 *iface, DWORD *count)
{
FIXME("iface %p, count %p, stub!\n", iface, count);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetBandwidthSharing(IWMProfile3 *iface, DWORD index, IWMBandwidthSharing **sharing)
{
FIXME("iface %p, index %d, sharing %p, stub!\n", iface, index, sharing);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_RemoveBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing *sharing)
{
FIXME("iface %p, sharing %p, stub!\n", iface, sharing);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_AddBandwidthSharing(IWMProfile3 *iface, IWMBandwidthSharing *sharing)
{
FIXME("iface %p, sharing %p, stub!\n", iface, sharing);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_CreateNewBandwidthSharing( IWMProfile3 *iface, IWMBandwidthSharing **sharing)
{
FIXME("iface %p, sharing %p, stub!\n", iface, sharing);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream)
{
FIXME("iface %p, stream %p, stub!\n", iface, stream);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_SetStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization *stream)
{
FIXME("iface %p, stream %p, stub!\n", iface, stream);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_RemoveStreamPrioritization(IWMProfile3 *iface)
{
FIXME("iface %p, stub!\n", iface);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_CreateNewStreamPrioritization(IWMProfile3 *iface, IWMStreamPrioritization **stream)
{
FIXME("iface %p, stream %p, stub!\n", iface, stream);
return E_NOTIMPL;
}
static HRESULT WINAPI profile_GetExpectedPacketCount(IWMProfile3 *iface, QWORD duration, QWORD *count)
{
FIXME("iface %p, duration %s, count %p, stub!\n", iface, debugstr_time(duration), count);
return E_NOTIMPL;
}
static const IWMProfile3Vtbl profile_vtbl =
{
profile_QueryInterface,
profile_AddRef,
profile_Release,
profile_GetVersion,
profile_GetName,
profile_SetName,
profile_GetDescription,
profile_SetDescription,
profile_GetStreamCount,
profile_GetStream,
profile_GetStreamByNumber,
profile_RemoveStream,
profile_RemoveStreamByNumber,
profile_AddStream,
profile_ReconfigStream,
profile_CreateNewStream,
profile_GetMutualExclusionCount,
profile_GetMutualExclusion,
profile_RemoveMutualExclusion,
profile_AddMutualExclusion,
profile_CreateNewMutualExclusion,
profile_GetProfileID,
profile_GetStorageFormat,
profile_SetStorageFormat,
profile_GetBandwidthSharingCount,
profile_GetBandwidthSharing,
profile_RemoveBandwidthSharing,
profile_AddBandwidthSharing,
profile_CreateNewBandwidthSharing,
profile_GetStreamPrioritization,
profile_SetStreamPrioritization,
profile_RemoveStreamPrioritization,
profile_CreateNewStreamPrioritization,
profile_GetExpectedPacketCount,
};
void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
{
reader->IWMProfile3_iface.lpVtbl = &profile_vtbl;
reader->refcount = 1;
reader->ops = ops;
}
......@@ -17,8 +17,6 @@
*/
#include "gst_private.h"
#include "initguid.h"
#include "wmsdk.h"
WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
......
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