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
3256484a
Commit
3256484a
authored
Aug 28, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Create the stream filter when the multimedia stream is created.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c8b94b63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
36 deletions
+21
-36
amstream.c
dlls/amstream/amstream.c
+19
-18
amstream.c
dlls/amstream/tests/amstream.c
+2
-18
No files found.
dlls/amstream/amstream.c
View file @
3256484a
...
...
@@ -36,7 +36,7 @@ typedef struct {
IGraphBuilder
*
pFilterGraph
;
IMediaSeeking
*
media_seeking
;
IMediaControl
*
media_control
;
IMediaStreamFilter
*
media_stream_
filter
;
IMediaStreamFilter
*
filter
;
IPin
*
ipin
;
ULONG
nbStreams
;
IAMMediaStream
**
pStreams
;
...
...
@@ -53,7 +53,8 @@ static const struct IAMMultiMediaStreamVtbl AM_Vtbl;
HRESULT
AM_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
{
IAMMultiMediaStreamImpl
*
object
;
IAMMultiMediaStreamImpl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p,%p)
\n
"
,
pUnkOuter
,
ppObj
);
...
...
@@ -67,6 +68,14 @@ HRESULT AM_create(IUnknown *pUnkOuter, LPVOID *ppObj)
object
->
IAMMultiMediaStream_iface
.
lpVtbl
=
&
AM_Vtbl
;
object
->
ref
=
1
;
if
(
FAILED
(
hr
=
CoCreateInstance
(
&
CLSID_MediaStreamFilter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMediaStreamFilter
,
(
void
**
)
&
object
->
filter
)))
{
ERR
(
"Failed to create stream filter, hr %#x.
\n
"
,
hr
);
heap_free
(
object
);
return
hr
;
}
*
ppObj
=
&
object
->
IAMMultiMediaStream_iface
;
return
S_OK
;
...
...
@@ -117,8 +126,7 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
CoTaskMemFree
(
This
->
pStreams
);
if
(
This
->
ipin
)
IPin_Release
(
This
->
ipin
);
if
(
This
->
media_stream_filter
)
IMediaStreamFilter_Release
(
This
->
media_stream_filter
);
IMediaStreamFilter_Release
(
This
->
filter
);
if
(
This
->
media_seeking
)
IMediaSeeking_Release
(
This
->
media_seeking
);
if
(
This
->
media_control
)
...
...
@@ -258,9 +266,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
if
(
SUCCEEDED
(
hr
))
hr
=
IGraphBuilder_QueryInterface
(
This
->
pFilterGraph
,
&
IID_IMediaControl
,
(
void
**
)
&
This
->
media_control
);
if
(
SUCCEEDED
(
hr
))
hr
=
CoCreateInstance
(
&
CLSID_MediaStreamFilter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMediaStreamFilter
,
(
void
**
)
&
This
->
media_stream_filter
);
if
(
SUCCEEDED
(
hr
))
hr
=
IGraphBuilder_AddFilter
(
This
->
pFilterGraph
,
(
IBaseFilter
*
)
This
->
media_stream_filter
,
filternameW
);
hr
=
IGraphBuilder_AddFilter
(
This
->
pFilterGraph
,
(
IBaseFilter
*
)
This
->
filter
,
filternameW
);
if
(
SUCCEEDED
(
hr
))
{
IMediaEventEx
*
media_event
=
NULL
;
...
...
@@ -276,9 +282,6 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
if
(
FAILED
(
hr
))
{
if
(
This
->
media_stream_filter
)
IMediaStreamFilter_Release
(
This
->
media_stream_filter
);
This
->
media_stream_filter
=
NULL
;
if
(
This
->
media_seeking
)
IMediaSeeking_Release
(
This
->
media_seeking
);
This
->
media_seeking
=
NULL
;
...
...
@@ -310,18 +313,16 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream
return
S_OK
;
}
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_GetFilter
(
IAMMultiMediaStream
*
iface
,
IMediaStreamFilter
**
ppF
ilter
)
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_GetFilter
(
IAMMultiMediaStream
*
iface
,
IMediaStreamFilter
**
f
ilter
)
{
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IAMMultiMediaStreamImpl
*
mmstream
=
impl_from_IAMMultiMediaStream
(
iface
);
TRACE
(
"
(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppF
ilter
);
TRACE
(
"
mmstream %p, filter %p.
\n
"
,
mmstream
,
f
ilter
);
if
(
!
ppF
ilter
)
if
(
!
f
ilter
)
return
E_POINTER
;
*
ppFilter
=
This
->
media_stream_filter
;
if
(
*
ppFilter
)
IMediaStreamFilter_AddRef
(
*
ppFilter
);
IMediaStreamFilter_AddRef
(
*
filter
=
mmstream
->
filter
);
return
S_OK
;
}
...
...
@@ -388,7 +389,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
if
(
SUCCEEDED
(
hr
))
{
/* Add stream to the media stream filter */
IMediaStreamFilter_AddMediaStream
(
This
->
media_stream_
filter
,
pStream
);
IMediaStreamFilter_AddMediaStream
(
This
->
filter
,
pStream
);
}
return
hr
;
...
...
dlls/amstream/tests/amstream.c
View file @
3256484a
...
...
@@ -130,10 +130,6 @@ static void test_interfaces(void)
HRESULT
hr
;
ULONG
ref
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_interface
(
mmstream
,
&
IID_IAMMultiMediaStream
,
TRUE
);
check_interface
(
mmstream
,
&
IID_IMultiMediaStream
,
TRUE
);
check_interface
(
mmstream
,
&
IID_IUnknown
,
TRUE
);
...
...
@@ -636,15 +632,11 @@ static void test_enum_pins(void)
ULONG
ref
,
count
;
HRESULT
hr
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetFilter
(
mmstream
,
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
hr
=
IMediaStreamFilter_EnumPins
(
filter
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -652,7 +644,7 @@ static void test_enum_pins(void)
hr
=
IMediaStreamFilter_EnumPins
(
filter
,
&
enum1
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
get_refcount
(
filter
);
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
todo_wine
ok
(
ref
==
3
,
"Got unexpected refcount %d.
\n
"
,
ref
);
ref
=
get_refcount
(
enum1
);
ok
(
ref
==
1
,
"Got unexpected refcount %d.
\n
"
,
ref
);
...
...
@@ -771,10 +763,6 @@ static void test_find_pin(void)
HRESULT
hr
;
ULONG
ref
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetFilter
(
mmstream
,
&
filter
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
...
...
@@ -809,10 +797,6 @@ static void test_pin_info(void)
WCHAR
*
id
;
IPin
*
pin
;
/* FIXME: This call should not be necessary. */
hr
=
IAMMultiMediaStream_Initialize
(
mmstream
,
STREAMTYPE_READ
,
0
,
NULL
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IAMMultiMediaStream_GetFilter
(
mmstream
,
&
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