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
f8156266
Commit
f8156266
authored
Dec 04, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qcap/avico: Use strmbase filter state change methods.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
67d1321c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
56 deletions
+33
-56
avico.c
dlls/qcap/avico.c
+29
-52
avico.c
dlls/qcap/tests/avico.c
+4
-4
No files found.
dlls/qcap/avico.c
View file @
f8156266
...
...
@@ -56,12 +56,6 @@ static inline AVICompressor *impl_from_strmbase_filter(struct strmbase_filter *f
return
CONTAINING_RECORD
(
filter
,
AVICompressor
,
filter
);
}
static
inline
AVICompressor
*
impl_from_IBaseFilter
(
IBaseFilter
*
iface
)
{
struct
strmbase_filter
*
filter
=
CONTAINING_RECORD
(
iface
,
struct
strmbase_filter
,
IBaseFilter_iface
);
return
impl_from_strmbase_filter
(
filter
);
}
static
inline
AVICompressor
*
impl_from_strmbase_pin
(
struct
strmbase_pin
*
pin
)
{
return
impl_from_strmbase_filter
(
pin
->
filter
);
...
...
@@ -117,57 +111,14 @@ static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoi
return
S_OK
;
}
static
HRESULT
WINAPI
AVICompressor_Stop
(
IBaseFilter
*
iface
)
{
AVICompressor
*
This
=
impl_from_IBaseFilter
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
filter
.
state
==
State_Stopped
)
return
S_OK
;
ICCompressEnd
(
This
->
hic
);
This
->
filter
.
state
=
State_Stopped
;
return
S_OK
;
}
static
HRESULT
WINAPI
AVICompressor_Pause
(
IBaseFilter
*
iface
)
{
AVICompressor
*
This
=
impl_from_IBaseFilter
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
AVICompressor_Run
(
IBaseFilter
*
iface
,
REFERENCE_TIME
tStart
)
{
AVICompressor
*
This
=
impl_from_IBaseFilter
(
iface
);
HRESULT
hres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
wine_dbgstr_longlong
(
tStart
));
if
(
This
->
filter
.
state
==
State_Running
)
return
S_OK
;
if
(
This
->
source
.
pAllocator
&&
FAILED
(
hres
=
IMemAllocator_Commit
(
This
->
source
.
pAllocator
)))
{
FIXME
(
"Commit failed: %08x
\n
"
,
hres
);
return
hres
;
}
This
->
frame_cnt
=
0
;
This
->
filter
.
state
=
State_Running
;
return
S_OK
;
}
static
const
IBaseFilterVtbl
AVICompressorVtbl
=
{
BaseFilterImpl_QueryInterface
,
BaseFilterImpl_AddRef
,
BaseFilterImpl_Release
,
BaseFilterImpl_GetClassID
,
AVICompressor
_Stop
,
AVICompressor
_Pause
,
AVICompressor
_Run
,
BaseFilterImpl
_Stop
,
BaseFilterImpl
_Pause
,
BaseFilterImpl
_Run
,
BaseFilterImpl_GetState
,
BaseFilterImpl_SetSyncSource
,
BaseFilterImpl_GetSyncSource
,
...
...
@@ -215,11 +166,37 @@ static HRESULT avi_compressor_query_interface(struct strmbase_filter *iface, REF
return
S_OK
;
}
static
HRESULT
avi_compressor_init_stream
(
struct
strmbase_filter
*
iface
)
{
AVICompressor
*
filter
=
impl_from_strmbase_filter
(
iface
);
HRESULT
hr
;
if
(
filter
->
source
.
pAllocator
&&
FAILED
(
hr
=
IMemAllocator_Commit
(
filter
->
source
.
pAllocator
)))
{
ERR
(
"Failed to commit allocator, hr %#x.
\n
"
,
hr
);
return
hr
;
}
filter
->
frame_cnt
=
0
;
return
S_OK
;
}
static
HRESULT
avi_compressor_cleanup_stream
(
struct
strmbase_filter
*
iface
)
{
AVICompressor
*
filter
=
impl_from_strmbase_filter
(
iface
);
ICCompressEnd
(
filter
->
hic
);
return
S_OK
;
}
static
const
struct
strmbase_filter_ops
filter_ops
=
{
.
filter_get_pin
=
avi_compressor_get_pin
,
.
filter_destroy
=
avi_compressor_destroy
,
.
filter_query_interface
=
avi_compressor_query_interface
,
.
filter_init_stream
=
avi_compressor_init_stream
,
.
filter_cleanup_stream
=
avi_compressor_cleanup_stream
,
};
static
AVICompressor
*
impl_from_IPersistPropertyBag
(
IPersistPropertyBag
*
iface
)
...
...
dlls/qcap/tests/avico.c
View file @
f8156266
...
...
@@ -665,11 +665,11 @@ static void test_unconnected_filter_state(IBaseFilter *filter)
ok
(
state
==
State_Stopped
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Pause
(
filter
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Run
(
filter
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -679,11 +679,11 @@ static void test_unconnected_filter_state(IBaseFilter *filter)
ok
(
state
==
State_Running
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Pause
(
filter
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IBaseFilter_GetState
(
filter
,
0
,
&
state
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
ok
(
state
==
State_Paused
,
"Got state %u.
\n
"
,
state
);
hr
=
IBaseFilter_Stop
(
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
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