Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
70daeb52
Commit
70daeb52
authored
Jun 18, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Move struct object_context around.
parent
221f110b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
69 deletions
+69
-69
media_source.c
dlls/winegstreamer/media_source.c
+69
-69
No files found.
dlls/winegstreamer/media_source.c
View file @
70daeb52
...
...
@@ -27,6 +27,72 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
struct
object_context
{
IUnknown
IUnknown_iface
;
LONG
refcount
;
IMFAsyncResult
*
result
;
IMFByteStream
*
stream
;
WCHAR
*
url
;
};
static
struct
object_context
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
object_context
,
IUnknown_iface
);
}
static
HRESULT
WINAPI
object_context_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
object_context_AddRef
(
IUnknown
*
iface
)
{
struct
object_context
*
context
=
impl_from_IUnknown
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
context
->
refcount
);
TRACE
(
"%p, refcount %lu.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
object_context_Release
(
IUnknown
*
iface
)
{
struct
object_context
*
context
=
impl_from_IUnknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
context
->
refcount
);
TRACE
(
"%p, refcount %lu.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
IMFAsyncResult_Release
(
context
->
result
);
IMFByteStream_Release
(
context
->
stream
);
free
(
context
->
url
);
free
(
context
);
}
return
refcount
;
}
static
const
IUnknownVtbl
object_context_vtbl
=
{
object_context_QueryInterface
,
object_context_AddRef
,
object_context_Release
,
};
struct
media_stream
{
IMFMediaStream
IMFMediaStream_iface
;
...
...
@@ -1773,77 +1839,11 @@ static ULONG WINAPI stream_handler_Release(IMFByteStreamHandler *iface)
return
refcount
;
}
struct
create_object_context
{
IUnknown
IUnknown_iface
;
LONG
refcount
;
IMFAsyncResult
*
result
;
IMFByteStream
*
stream
;
WCHAR
*
url
;
};
static
struct
create_object_context
*
impl_from_IUnknown
(
IUnknown
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
create_object_context
,
IUnknown_iface
);
}
static
HRESULT
WINAPI
create_object_context_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IUnknown_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
*
obj
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
create_object_context_AddRef
(
IUnknown
*
iface
)
{
struct
create_object_context
*
context
=
impl_from_IUnknown
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
context
->
refcount
);
TRACE
(
"%p, refcount %lu.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
create_object_context_Release
(
IUnknown
*
iface
)
{
struct
create_object_context
*
context
=
impl_from_IUnknown
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
context
->
refcount
);
TRACE
(
"%p, refcount %lu.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
{
IMFAsyncResult_Release
(
context
->
result
);
IMFByteStream_Release
(
context
->
stream
);
free
(
context
->
url
);
free
(
context
);
}
return
refcount
;
}
static
const
IUnknownVtbl
create_object_context_vtbl
=
{
create_object_context_QueryInterface
,
create_object_context_AddRef
,
create_object_context_Release
,
};
static
HRESULT
WINAPI
stream_handler_BeginCreateObject
(
IMFByteStreamHandler
*
iface
,
IMFByteStream
*
stream
,
const
WCHAR
*
url
,
DWORD
flags
,
IPropertyStore
*
props
,
IUnknown
**
cancel_cookie
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
)
{
struct
stream_handler
*
handler
=
impl_from_IMFByteStreamHandler
(
iface
);
struct
create_
object_context
*
context
;
struct
object_context
*
context
;
IMFAsyncResult
*
result
;
HRESULT
hr
;
...
...
@@ -1866,7 +1866,7 @@ static HRESULT WINAPI stream_handler_BeginCreateObject(IMFByteStreamHandler *ifa
return
E_OUTOFMEMORY
;
}
context
->
IUnknown_iface
.
lpVtbl
=
&
create_
object_context_vtbl
;
context
->
IUnknown_iface
.
lpVtbl
=
&
object_context_vtbl
;
context
->
refcount
=
1
;
context
->
stream
=
stream
;
IMFByteStream_AddRef
(
context
->
stream
);
...
...
@@ -1981,7 +1981,7 @@ static HRESULT WINAPI stream_handler_callback_Invoke(IMFAsyncCallback *iface, IM
{
struct
stream_handler
*
handler
=
impl_from_IMFAsyncCallback
(
iface
);
IUnknown
*
object
,
*
state
=
IMFAsyncResult_GetStateNoAddRef
(
result
);
struct
create_
object_context
*
context
;
struct
object_context
*
context
;
struct
result_entry
*
entry
;
HRESULT
hr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment