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
859809be
Commit
859809be
authored
Feb 06, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/vfwcapture: Allow changing state while unconnected.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2552a484
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
videocapture.c
dlls/qcap/tests/videocapture.c
+53
-0
vfwcapture.c
dlls/qcap/vfwcapture.c
+17
-1
No files found.
dlls/qcap/tests/videocapture.c
View file @
859809be
...
...
@@ -296,6 +296,58 @@ static void test_misc_flags(IBaseFilter *filter)
IAMFilterMiscFlags_Release
(
misc_flags
);
}
static
void
test_unconnected_filter_state
(
IBaseFilter
*
filter
)
{
FILTER_STATE
state
;
HRESULT
hr
;
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Pause
(
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Run
(
filter
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Pause
(
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Stop
(
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Run
(
filter
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Stop
(
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
}
struct
testfilter
{
struct
strmbase_filter
filter
;
...
...
@@ -615,6 +667,7 @@ START_TEST(videocapture)
test_filter_interfaces
(
filter
);
test_pins
(
filter
);
test_misc_flags
(
filter
);
test_unconnected_filter_state
(
filter
);
ref
=
IBaseFilter_Release
(
filter
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
...
...
dlls/qcap/vfwcapture.c
View file @
859809be
...
...
@@ -199,6 +199,9 @@ static HRESULT vfw_capture_init_stream(struct strmbase_filter *iface)
struct
vfw_capture
*
filter
=
impl_from_strmbase_filter
(
iface
);
HRESULT
hr
;
if
(
!
filter
->
source
.
pin
.
peer
)
return
S_OK
;
if
(
FAILED
(
hr
=
IMemAllocator_Commit
(
filter
->
source
.
pAllocator
)))
ERR
(
"Failed to commit allocator, hr %#x.
\n
"
,
hr
);
...
...
@@ -215,6 +218,9 @@ static HRESULT vfw_capture_start_stream(struct strmbase_filter *iface, REFERENCE
{
struct
vfw_capture
*
filter
=
impl_from_strmbase_filter
(
iface
);
if
(
!
filter
->
source
.
pin
.
peer
)
return
S_OK
;
EnterCriticalSection
(
&
filter
->
state_cs
);
filter
->
state
=
State_Running
;
LeaveCriticalSection
(
&
filter
->
state_cs
);
...
...
@@ -226,6 +232,9 @@ static HRESULT vfw_capture_stop_stream(struct strmbase_filter *iface)
{
struct
vfw_capture
*
filter
=
impl_from_strmbase_filter
(
iface
);
if
(
!
filter
->
source
.
pin
.
peer
)
return
S_OK
;
EnterCriticalSection
(
&
filter
->
state_cs
);
filter
->
state
=
State_Paused
;
LeaveCriticalSection
(
&
filter
->
state_cs
);
...
...
@@ -237,6 +246,9 @@ static HRESULT vfw_capture_cleanup_stream(struct strmbase_filter *iface)
struct
vfw_capture
*
filter
=
impl_from_strmbase_filter
(
iface
);
HRESULT
hr
;
if
(
!
filter
->
source
.
pin
.
peer
)
return
S_OK
;
EnterCriticalSection
(
&
filter
->
state_cs
);
filter
->
state
=
State_Stopped
;
LeaveCriticalSection
(
&
filter
->
state_cs
);
...
...
@@ -255,7 +267,11 @@ static HRESULT vfw_capture_cleanup_stream(struct strmbase_filter *iface)
static
HRESULT
vfw_capture_wait_state
(
struct
strmbase_filter
*
iface
,
DWORD
timeout
)
{
return
iface
->
state
==
State_Paused
?
VFW_S_CANT_CUE
:
S_OK
;
struct
vfw_capture
*
filter
=
impl_from_strmbase_filter
(
iface
);
if
(
filter
->
source
.
pin
.
peer
&&
filter
->
filter
.
state
==
State_Paused
)
return
VFW_S_CANT_CUE
;
return
S_OK
;
}
static
const
struct
strmbase_filter_ops
filter_ops
=
...
...
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