Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8f9db431
Commit
8f9db431
authored
Feb 25, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Use event queue for session event handling.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ce557d19
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
75 deletions
+60
-75
session.c
dlls/mf/session.c
+60
-75
No files found.
dlls/mf/session.c
View file @
8f9db431
...
@@ -24,193 +24,175 @@
...
@@ -24,193 +24,175 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "mfidl.h"
#include "mfidl.h"
#include "mfapi.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
typedef
struct
mf
session
struct
media_
session
{
{
IMFMediaSession
IMFMediaSession_iface
;
IMFMediaSession
IMFMediaSession_iface
;
LONG
ref
;
LONG
refcount
;
}
mfsession
;
IMFMediaEventQueue
*
event_queue
;
};
static
inline
mf
session
*
impl_from_IMFMediaSession
(
IMFMediaSession
*
iface
)
static
inline
struct
media_
session
*
impl_from_IMFMediaSession
(
IMFMediaSession
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
mf
session
,
IMFMediaSession_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
media_
session
,
IMFMediaSession_iface
);
}
}
static
HRESULT
WINAPI
mfsession_QueryInterface
(
IMFMediaSession
*
iface
,
REFIID
riid
,
void
**
out
)
static
HRESULT
WINAPI
mfsession_QueryInterface
(
IMFMediaSession
*
iface
,
REFIID
riid
,
void
**
out
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
out
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualIID
(
riid
,
&
IID_IMFMediaSession
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IMFMediaSession
)
||
IsEqualIID
(
riid
,
&
IID_IMFMediaEventGenerator
)
||
IsEqualIID
(
riid
,
&
IID_IMFMediaEventGenerator
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
{
*
out
=
&
This
->
IMFMediaSession_iface
;
*
out
=
&
session
->
IMFMediaSession_iface
;
}
IMFMediaSession_AddRef
(
iface
);
else
return
S_OK
;
{
FIXME
(
"(%s, %p)
\n
"
,
debugstr_guid
(
riid
),
out
);
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
}
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
return
S_OK
;
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
}
static
ULONG
WINAPI
mfsession_AddRef
(
IMFMediaSession
*
iface
)
static
ULONG
WINAPI
mfsession_AddRef
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
count
=
InterlockedIncrement
(
&
session
->
refcount
);
TRACE
(
"(%p) ref
=%u
\n
"
,
This
,
ref
);
TRACE
(
"(%p) ref
count=%u
\n
"
,
iface
,
refcount
);
return
ref
;
return
ref
count
;
}
}
static
ULONG
WINAPI
mfsession_Release
(
IMFMediaSession
*
iface
)
static
ULONG
WINAPI
mfsession_Release
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
count
=
InterlockedDecrement
(
&
session
->
refcount
);
TRACE
(
"(%p) ref
=%u
\n
"
,
This
,
ref
);
TRACE
(
"(%p) ref
count=%u
\n
"
,
iface
,
refcount
);
if
(
!
ref
)
if
(
!
ref
count
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
session
->
event_queue
)
IMFMediaEventQueue_Release
(
session
->
event_queue
);
heap_free
(
session
);
}
}
return
ref
;
return
ref
count
;
}
}
static
HRESULT
WINAPI
mfsession_GetEvent
(
IMFMediaSession
*
iface
,
DWORD
flags
,
IMFMediaEvent
**
event
)
static
HRESULT
WINAPI
mfsession_GetEvent
(
IMFMediaSession
*
iface
,
DWORD
flags
,
IMFMediaEvent
**
event
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%#x, %p)
\n
"
,
This
,
flags
,
event
);
TRACE
(
"(%p)->(%#x, %p)
\n
"
,
iface
,
flags
,
event
);
return
E_NOTIMPL
;
return
IMFMediaEventQueue_GetEvent
(
session
->
event_queue
,
flags
,
event
)
;
}
}
static
HRESULT
WINAPI
mfsession_BeginGetEvent
(
IMFMediaSession
*
iface
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
)
static
HRESULT
WINAPI
mfsession_BeginGetEvent
(
IMFMediaSession
*
iface
,
IMFAsyncCallback
*
callback
,
IUnknown
*
state
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%p, %p)
\n
"
,
This
,
callback
,
state
);
TRACE
(
"(%p)->(%p, %p)
\n
"
,
iface
,
callback
,
state
);
return
E_NOTIMPL
;
return
IMFMediaEventQueue_BeginGetEvent
(
session
->
event_queue
,
callback
,
state
)
;
}
}
static
HRESULT
WINAPI
mfsession_EndGetEvent
(
IMFMediaSession
*
iface
,
IMFAsyncResult
*
result
,
IMFMediaEvent
**
event
)
static
HRESULT
WINAPI
mfsession_EndGetEvent
(
IMFMediaSession
*
iface
,
IMFAsyncResult
*
result
,
IMFMediaEvent
**
event
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%p, %p)
\n
"
,
This
,
result
,
event
);
TRACE
(
"(%p)->(%p, %p)
\n
"
,
iface
,
result
,
event
);
return
E_NOTIMPL
;
return
IMFMediaEventQueue_EndGetEvent
(
session
->
event_queue
,
result
,
event
)
;
}
}
static
HRESULT
WINAPI
mfsession_QueueEvent
(
IMFMediaSession
*
iface
,
MediaEventType
event_type
,
REFGUID
ext_type
,
static
HRESULT
WINAPI
mfsession_QueueEvent
(
IMFMediaSession
*
iface
,
MediaEventType
event_type
,
REFGUID
ext_type
,
HRESULT
hr
,
const
PROPVARIANT
*
value
)
HRESULT
hr
,
const
PROPVARIANT
*
value
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
struct
media_session
*
session
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%d, %s, %#x, %p)
\n
"
,
This
,
event_type
,
debugstr_guid
(
ext_type
),
hr
,
value
);
TRACE
(
"(%p)->(%d, %s, %#x, %p)
\n
"
,
iface
,
event_type
,
debugstr_guid
(
ext_type
),
hr
,
value
);
return
E_NOTIMPL
;
return
IMFMediaEventQueue_QueueEventParamVar
(
session
->
event_queue
,
event_type
,
ext_type
,
hr
,
value
)
;
}
}
static
HRESULT
WINAPI
mfsession_SetTopology
(
IMFMediaSession
*
iface
,
DWORD
flags
,
IMFTopology
*
topology
)
static
HRESULT
WINAPI
mfsession_SetTopology
(
IMFMediaSession
*
iface
,
DWORD
flags
,
IMFTopology
*
topology
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%#x, %p)
\n
"
,
iface
,
flags
,
topology
);
FIXME
(
"(%p)->(%#x, %p)
\n
"
,
This
,
flags
,
topology
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_ClearTopologies
(
IMFMediaSession
*
iface
)
static
HRESULT
WINAPI
mfsession_ClearTopologies
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)
\n
"
,
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_Start
(
IMFMediaSession
*
iface
,
const
GUID
*
format
,
const
PROPVARIANT
*
start
)
static
HRESULT
WINAPI
mfsession_Start
(
IMFMediaSession
*
iface
,
const
GUID
*
format
,
const
PROPVARIANT
*
start
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%s, %p)
\n
"
,
iface
,
debugstr_guid
(
format
),
start
);
FIXME
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_guid
(
format
),
start
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_Pause
(
IMFMediaSession
*
iface
)
static
HRESULT
WINAPI
mfsession_Pause
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)
\n
"
,
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_Stop
(
IMFMediaSession
*
iface
)
static
HRESULT
WINAPI
mfsession_Stop
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)
\n
"
,
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_Close
(
IMFMediaSession
*
iface
)
static
HRESULT
WINAPI
mfsession_Close
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)
\n
"
,
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
mfsession_Shutdown
(
IMFMediaSession
*
iface
)
static
HRESULT
WINAPI
mfsession_Shutdown
(
IMFMediaSession
*
iface
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)
\n
"
,
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_GetClock
(
IMFMediaSession
*
iface
,
IMFClock
**
clock
)
static
HRESULT
WINAPI
mfsession_GetClock
(
IMFMediaSession
*
iface
,
IMFClock
**
clock
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
clock
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
clock
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_GetSessionCapabilities
(
IMFMediaSession
*
iface
,
DWORD
*
caps
)
static
HRESULT
WINAPI
mfsession_GetSessionCapabilities
(
IMFMediaSession
*
iface
,
DWORD
*
caps
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
caps
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
caps
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
mfsession_GetFullTopology
(
IMFMediaSession
*
iface
,
DWORD
flags
,
TOPOID
id
,
IMFTopology
**
topology
)
static
HRESULT
WINAPI
mfsession_GetFullTopology
(
IMFMediaSession
*
iface
,
DWORD
flags
,
TOPOID
id
,
IMFTopology
**
topology
)
{
{
mfsession
*
This
=
impl_from_IMFMediaSession
(
iface
);
FIXME
(
"(%p)->(%#x, %s, %p)
\n
"
,
iface
,
flags
,
wine_dbgstr_longlong
(
id
),
topology
);
FIXME
(
"(%p)->(%#x, %s, %p)
\n
"
,
This
,
flags
,
wine_dbgstr_longlong
(
id
),
topology
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -237,26 +219,29 @@ static const IMFMediaSessionVtbl mfmediasessionvtbl =
...
@@ -237,26 +219,29 @@ static const IMFMediaSessionVtbl mfmediasessionvtbl =
};
};
/***********************************************************************
/***********************************************************************
* MFCreate
Topology
(mf.@)
* MFCreate
MediaSession
(mf.@)
*/
*/
HRESULT
WINAPI
MFCreateMediaSession
(
IMFAttributes
*
config
,
IMFMediaSession
**
session
)
HRESULT
WINAPI
MFCreateMediaSession
(
IMFAttributes
*
config
,
IMFMediaSession
**
session
)
{
{
mfsession
*
object
;
struct
media_session
*
object
;
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
config
,
session
);
TRACE
(
"(%p, %p)
\n
"
,
config
,
session
);
if
(
!
session
)
return
E_POINTER
;
if
(
config
)
if
(
config
)
FIXME
(
"session configuration ignored
\n
"
);
FIXME
(
"session configuration ignored
\n
"
);
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
));
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
object
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
object
->
IMFMediaSession_iface
.
lpVtbl
=
&
mfmediasessionvtbl
;
object
->
IMFMediaSession_iface
.
lpVtbl
=
&
mfmediasessionvtbl
;
object
->
ref
=
1
;
object
->
refcount
=
1
;
if
(
FAILED
(
hr
=
MFCreateEventQueue
(
&
object
->
event_queue
)))
{
IMFMediaSession_Release
(
&
object
->
IMFMediaSession_iface
);
return
hr
;
}
*
session
=
&
object
->
IMFMediaSession_iface
;
*
session
=
&
object
->
IMFMediaSession_iface
;
...
...
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