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
c8a68f2a
Commit
c8a68f2a
authored
Jan 03, 2023
by
Bernhard Kölbl
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.speech: Allow the recognition session worker to be paused.
Signed-off-by:
Bernhard Kölbl
<
besentv@gmail.com
>
parent
e1c4035e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
+38
-7
recognizer.c
dlls/windows.media.speech/recognizer.c
+36
-5
speech.c
dlls/windows.media.speech/tests/speech.c
+2
-2
No files found.
dlls/windows.media.speech/recognizer.c
View file @
c8a68f2a
...
...
@@ -162,7 +162,7 @@ struct session
struct
list
result_handlers
;
HANDLE
worker_thread
,
worker_control_event
;
BOOLEAN
worker_running
;
BOOLEAN
worker_running
,
worker_paused
;
CRITICAL_SECTION
cs
;
};
...
...
@@ -362,6 +362,7 @@ static HRESULT WINAPI session_StopAsync( ISpeechContinuousRecognitionSession *if
thread
=
impl
->
worker_thread
;
impl
->
worker_thread
=
INVALID_HANDLE_VALUE
;
impl
->
worker_running
=
FALSE
;
impl
->
worker_paused
=
FALSE
;
}
else
{
...
...
@@ -401,14 +402,44 @@ static HRESULT session_pause_async( IInspectable *invoker )
static
HRESULT
WINAPI
session_PauseAsync
(
ISpeechContinuousRecognitionSession
*
iface
,
IAsyncAction
**
action
)
{
FIXME
(
"iface %p, action %p stub!
\n
"
,
iface
,
action
);
return
async_action_create
(
NULL
,
session_pause_async
,
action
);
struct
session
*
impl
=
impl_from_ISpeechContinuousRecognitionSession
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"iface %p, action %p.
\n
"
,
iface
,
action
);
*
action
=
NULL
;
if
(
FAILED
(
hr
=
async_action_create
(
NULL
,
session_pause_async
,
action
)))
return
hr
;
EnterCriticalSection
(
&
impl
->
cs
);
if
(
impl
->
worker_running
)
{
impl
->
worker_paused
=
TRUE
;
}
LeaveCriticalSection
(
&
impl
->
cs
);
SetEvent
(
impl
->
worker_control_event
);
return
hr
;
}
static
HRESULT
WINAPI
session_Resume
(
ISpeechContinuousRecognitionSession
*
iface
)
{
FIXME
(
"iface %p stub!
\n
"
,
iface
);
return
E_NOTIMPL
;
struct
session
*
impl
=
impl_from_ISpeechContinuousRecognitionSession
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
EnterCriticalSection
(
&
impl
->
cs
);
if
(
impl
->
worker_running
)
{
impl
->
worker_paused
=
FALSE
;
}
LeaveCriticalSection
(
&
impl
->
cs
);
SetEvent
(
impl
->
worker_control_event
);
return
S_OK
;
}
static
HRESULT
WINAPI
session_add_Completed
(
ISpeechContinuousRecognitionSession
*
iface
,
...
...
dlls/windows.media.speech/tests/speech.c
View file @
c8a68f2a
...
...
@@ -1798,11 +1798,11 @@ static void test_Recognition(void)
IAsyncAction_Release
(
action2
);
hr
=
ISpeechContinuousRecognitionSession_Resume
(
session
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_Resume failed, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_Resume failed, hr %#lx.
\n
"
,
hr
);
/* Resume when already resumed. */
hr
=
ISpeechContinuousRecognitionSession_Resume
(
session
);
todo_wine
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_Resume failed, hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"ISpeechContinuousRecognitionSession_Resume failed, hr %#lx.
\n
"
,
hr
);
recog_state
=
0xdeadbeef
;
hr
=
ISpeechRecognizer2_get_State
(
recognizer2
,
&
recog_state
);
...
...
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