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
4d56ed9d
Commit
4d56ed9d
authored
Jun 04, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfmediaengine: Implement error property.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9aec1ef3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
20 deletions
+51
-20
main.c
dlls/mfmediaengine/main.c
+34
-5
mfmediaengine.c
dlls/mfmediaengine/tests/mfmediaengine.c
+17
-15
No files found.
dlls/mfmediaengine/main.c
View file @
4d56ed9d
...
...
@@ -84,6 +84,7 @@ struct media_engine
double
default_playback_rate
;
double
volume
;
double
duration
;
MF_MEDIA_ENGINE_ERR
error_code
;
IMFMediaSession
*
session
;
IMFSourceResolver
*
resolver
;
CRITICAL_SECTION
cs
;
...
...
@@ -512,16 +513,44 @@ static ULONG WINAPI media_engine_Release(IMFMediaEngine *iface)
static
HRESULT
WINAPI
media_engine_GetError
(
IMFMediaEngine
*
iface
,
IMFMediaError
**
error
)
{
FIXME
(
"(%p, %p): stub.
\n
"
,
iface
,
error
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
error
);
*
error
=
NULL
;
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
if
(
engine
->
error_code
)
{
if
(
SUCCEEDED
(
hr
=
create_media_error
(
error
)))
IMFMediaError_SetErrorCode
(
*
error
,
engine
->
error_code
);
}
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetErrorCode
(
IMFMediaEngine
*
iface
,
MF_MEDIA_ENGINE_ERR
error
)
static
HRESULT
WINAPI
media_engine_SetErrorCode
(
IMFMediaEngine
*
iface
,
MF_MEDIA_ENGINE_ERR
code
)
{
FIXME
(
"(%p, %d): stub.
\n
"
,
iface
,
error
);
struct
media_engine
*
engine
=
impl_from_IMFMediaEngine
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %u.
\n
"
,
iface
,
code
);
if
((
unsigned
int
)
code
>
MF_MEDIA_ENGINE_ERR_ENCRYPTED
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
engine
->
cs
);
if
(
engine
->
flags
&
FLAGS_ENGINE_SHUT_DOWN
)
hr
=
MF_E_SHUTDOWN
;
else
engine
->
error_code
=
code
;
LeaveCriticalSection
(
&
engine
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
media_engine_SetSourceElements
(
IMFMediaEngine
*
iface
,
IMFMediaEngineSrcElements
*
elements
)
...
...
dlls/mfmediaengine/tests/mfmediaengine.c
View file @
4d56ed9d
...
...
@@ -503,45 +503,47 @@ static void test_error(void)
eo
=
(
void
*
)
0xdeadbeef
;
hr
=
IMFMediaEngine_GetError
(
media_engine
,
&
eo
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
eo
,
"Unexpected instance.
\n
"
);
}
hr
=
IMFMediaEngine_SetErrorCode
(
media_engine
,
MF_MEDIA_ENGINE_ERR_ENCRYPTED
+
1
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaEngine_SetErrorCode
(
media_engine
,
MF_MEDIA_ENGINE_ERR_ABORTED
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
eo
=
NULL
;
hr
=
IMFMediaEngine_GetError
(
media_engine
,
&
eo
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!!
eo
,
"Unexpected instance.
\n
"
);
}
eo2
=
NULL
;
hr
=
IMFMediaEngine_GetError
(
media_engine
,
&
eo2
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
eo2
!=
eo
,
"Unexpected instance.
\n
"
);
}
if
(
eo2
)
IMFMediaError_Release
(
eo2
);
if
(
eo
)
IMFMediaError_Release
(
eo
);
IMFMediaError_Release
(
eo2
);
IMFMediaError_Release
(
eo
);
hr
=
IMFMediaEngine_SetErrorCode
(
media_engine
,
MF_MEDIA_ENGINE_ERR_NOERROR
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
eo
=
(
void
*
)
0xdeadbeef
;
hr
=
IMFMediaEngine_GetError
(
media_engine
,
&
eo
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
eo
,
"Unexpected instance.
\n
"
);
}
hr
=
IMFMediaEngine_Shutdown
(
media_engine
);
ok
(
hr
==
S_OK
,
"Failed to shut down, hr %#x.
\n
"
,
hr
);
eo
=
(
void
*
)
0xdeadbeef
;
hr
=
IMFMediaEngine_GetError
(
media_engine
,
&
eo
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
eo
,
"Unexpected instance.
\n
"
);
hr
=
IMFMediaEngine_SetErrorCode
(
media_engine
,
MF_MEDIA_ENGINE_ERR_NOERROR
);
ok
(
hr
==
MF_E_SHUTDOWN
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFMediaEngine_Release
(
media_engine
);
/* Error object. */
...
...
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