ReactOS 0.4.17-dev-934-g091855f
passthrough.c
Go to the documentation of this file.
1/*
2 * Seeking passthrough object
3 *
4 * Copyright 2020 Zebediah Figura for CodeWeavers
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "quartz_private.h"
22
24
26{
28
32};
33
35{
37}
38
40{
42
43 TRACE("passthrough %p, iid %s, out %p.\n", passthrough, debugstr_guid(iid), out);
44
45 if (IsEqualGUID(iid, &IID_IUnknown))
46 *out = iface;
47 else if (IsEqualGUID(iid, &IID_IMediaPosition))
48 *out = &passthrough->passthrough.IMediaPosition_iface;
49 else if (IsEqualGUID(iid, &IID_IMediaSeeking))
50 *out = &passthrough->passthrough.IMediaSeeking_iface;
51 else if (IsEqualGUID(iid, &IID_ISeekingPassThru))
52 *out = &passthrough->passthrough.ISeekingPassThru_iface;
53 else
54 {
55 *out = NULL;
56 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
57 return E_NOINTERFACE;
58 }
59
60 IUnknown_AddRef((IUnknown *)*out);
61 return S_OK;
62}
63
65{
68
69 TRACE("%p increasing refcount to %lu.\n", passthrough, refcount);
70 return refcount;
71}
72
74{
77
78 TRACE("%p decreasing refcount to %lu.\n", passthrough, refcount);
79 if (!refcount)
80 {
83 }
84 return refcount;
85}
86
87static const IUnknownVtbl seeking_passthrough_vtbl =
88{
92};
93
95{
97
98 TRACE("outer %p, out %p.\n", outer, out);
99
100 if (!(object = calloc(1, sizeof(*object))))
101 return E_OUTOFMEMORY;
102
103 object->IUnknown_inner.lpVtbl = &seeking_passthrough_vtbl;
104 object->outer_unk = outer ? outer : &object->IUnknown_inner;
105 object->refcount = 1;
106
107 strmbase_passthrough_init(&object->passthrough, object->outer_unk);
108
109 TRACE("Created seeking passthrough %p.\n", object);
110 *out = &object->IUnknown_inner;
111 return S_OK;
112}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
static ULONG WINAPI seeking_passthrough_Release(IUnknown *iface)
Definition: passthrough.c:73
static HRESULT WINAPI seeking_passthrough_QueryInterface(IUnknown *iface, REFIID iid, void **out)
Definition: passthrough.c:39
static const IUnknownVtbl seeking_passthrough_vtbl
Definition: passthrough.c:87
HRESULT seeking_passthrough_create(IUnknown *outer, IUnknown **out)
Definition: passthrough.c:94
static struct seeking_passthrough * impl_from_IUnknown(IUnknown *iface)
Definition: passthrough.c:34
static ULONG WINAPI seeking_passthrough_AddRef(IUnknown *iface)
Definition: passthrough.c:64
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
static IUnknown * outer
Definition: compobj.c:82
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define calloc
Definition: rosglue.h:14
#define TRACE(s)
Definition: solgame.cpp:4
void strmbase_passthrough_cleanup(struct strmbase_passthrough *passthrough)
Definition: pospass.c:738
void strmbase_passthrough_init(struct strmbase_passthrough *passthrough, IUnknown *outer)
Definition: pospass.c:725
IUnknown * outer_unk
Definition: passthrough.c:30
IUnknown IUnknown_inner
Definition: passthrough.c:29
struct strmbase_passthrough passthrough
Definition: passthrough.c:27
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479