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
5007c2bd
Commit
5007c2bd
authored
May 28, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Add shut down state.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a8ee0575
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
main.c
dlls/mfmediaengine/main.c
+29
-9
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+0
-2
No files found.
dlls/mfmediaengine/main.c
View file @
5007c2bd
...
...
@@ -54,16 +54,24 @@ enum media_engine_mode
MEDIA_ENGINE_FRAME_SERVER_MODE
,
};
/* Used with create flags. */
enum
media_engine_flags
{
/* MF_MEDIA_ENGINE_CREATEFLAGS_MASK is 0x1f. */
FLAGS_ENGINE_SHUT_DOWN
=
0x20
,
};
struct
media_engine
{
IMFMediaEngine
IMFMediaEngine_iface
;
LONG
refcount
;
DWORD
flags
;
IMFMediaEngineNotify
*
callback
;
UINT64
playback_hwnd
;
DXGI_FORMAT
output_format
;
IMFDXGIDeviceManager
*
dxgi_manager
;
enum
media_engine_mode
mode
;
unsigned
int
flags
;
CRITICAL_SECTION
cs
;
};
static
inline
struct
media_engine
*
impl_from_IMFMediaEngine
(
IMFMediaEngine
*
iface
)
...
...
@@ -104,6 +112,7 @@ static void free_media_engine(struct media_engine *engine)
IMFMediaEngineNotify_Release
(
engine
->
callback
);
if
(
engine
->
dxgi_manager
)
IMFDXGIDeviceManager_Release
(
engine
->
dxgi_manager
);
DeleteCriticalSection
(
&
engine
->
cs
);
heap_free
(
engine
);
}
...
...
@@ -395,9 +404,19 @@ static HRESULT WINAPI media_engine_GetVideoAspectRatio(IMFMediaEngine *iface, DW
static
HRESULT
WINAPI
media_engine_Shutdown
(
IMFMediaEngine
*
iface
)
{
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
HRESULT
hr
=
S_OK
;
FIXME
(
"(%p): stub.
\n
"
,
iface
);
return
E_NOTIMPL
;
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
engine
->
flags
|=
FLAGS_ENGINE_SHUT_DOWN
;
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_TransferVideoFrame
(
IMFMediaEngine
*
iface
,
IUnknown
*
surface
,
...
...
@@ -490,10 +509,15 @@ static ULONG WINAPI media_engine_factory_Release(IMFMediaEngineClassFactory *ifa
return
1
;
}
static
HRESULT
init_media_engine
(
IMFAttributes
*
attributes
,
struct
media_engine
*
engine
)
static
HRESULT
init_media_engine
(
DWORD
flags
,
IMFAttributes
*
attributes
,
struct
media_engine
*
engine
)
{
HRESULT
hr
;
engine
->
IMFMediaEngine_iface
.
lpVtbl
=
&
media_engine_vtbl
;
engine
->
refcount
=
1
;
engine
->
flags
=
flags
&
MF_MEDIA_ENGINE_CREATEFLAGS_MASK
;
InitializeCriticalSection
(
&
engine
->
cs
);
hr
=
IMFAttributes_GetUnknown
(
attributes
,
&
MF_MEDIA_ENGINE_CALLBACK
,
&
IID_IMFMediaEngineNotify
,
(
void
**
)
&
engine
->
callback
);
if
(
FAILED
(
hr
))
...
...
@@ -522,7 +546,7 @@ static HRESULT WINAPI media_engine_factory_CreateInstance(IMFMediaEngineClassFac
struct
media_engine
*
object
;
HRESULT
hr
;
TRACE
(
"
(%p, %#x, %p, %p)
.
\n
"
,
iface
,
flags
,
attributes
,
engine
);
TRACE
(
"
%p, %#x, %p, %p
.
\n
"
,
iface
,
flags
,
attributes
,
engine
);
if
(
!
attributes
||
!
engine
)
return
E_POINTER
;
...
...
@@ -531,17 +555,13 @@ static HRESULT WINAPI media_engine_factory_CreateInstance(IMFMediaEngineClassFac
if
(
!
object
)
return
E_OUTOFMEMORY
;
hr
=
init_media_engine
(
attributes
,
object
);
hr
=
init_media_engine
(
flags
,
attributes
,
object
);
if
(
FAILED
(
hr
))
{
free_media_engine
(
object
);
return
hr
;
}
object
->
IMFMediaEngine_iface
.
lpVtbl
=
&
media_engine_vtbl
;
object
->
refcount
=
1
;
object
->
flags
=
flags
;
*
engine
=
&
object
->
IMFMediaEngine_iface
;
return
S_OK
;
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
5007c2bd
...
...
@@ -247,11 +247,9 @@ static void test_Shutdown(void)
media_engine
=
create_media_engine
(
callback
);
hr
=
IMFMediaEngine_Shutdown
(
media_engine
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngine_Shutdown
(
media_engine
);
todo_wine
ok
(
hr
==
MF_E_SHUTDOWN
||
broken
(
hr
==
S_OK
)
/* before win10 */
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngine_SetSource
(
media_engine
,
NULL
);
...
...
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