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
ee880095
Commit
ee880095
authored
Sep 03, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Sep 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Reimplement IMemInputPin locally for the DirectDraw stream.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f3ea8b85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
1 deletion
+102
-1
ddrawstream.c
dlls/amstream/ddrawstream.c
+101
-1
amstream.c
dlls/amstream/tests/amstream.c
+1
-0
No files found.
dlls/amstream/ddrawstream.c
View file @
ee880095
...
...
@@ -40,13 +40,17 @@ struct ddraw_stream
{
IAMMediaStream
IAMMediaStream_iface
;
IDirectDrawMediaStream
IDirectDrawMediaStream_iface
;
IMemInputPin
IMemInputPin_iface
;
LONG
ref
;
IMultiMediaStream
*
parent
;
MSPID
purpose_id
;
STREAM_TYPE
stream_type
;
IDirectDraw7
*
ddraw
;
DirectDrawMediaStreamInputPin
*
input_pin
;
CRITICAL_SECTION
critical_section
;
IMemAllocator
*
allocator
;
};
static
inline
struct
ddraw_stream
*
impl_from_IAMMediaStream
(
IAMMediaStream
*
iface
)
...
...
@@ -85,7 +89,7 @@ static HRESULT WINAPI DirectDrawMediaStreamImpl_IAMMediaStream_QueryInterface(IA
else
if
(
IsEqualGUID
(
riid
,
&
IID_IMemInputPin
))
{
IAMMediaStream_AddRef
(
iface
);
*
ret_iface
=
&
This
->
input_pin
->
pin
.
IMemInputPin_iface
;
*
ret_iface
=
&
This
->
IMemInputPin_iface
;
return
S_OK
;
}
...
...
@@ -725,6 +729,101 @@ static const BaseInputPinFuncTable DirectDrawMediaStreamInputPin_FuncTable =
DirectDrawMediaStreamInputPin_Receive
,
};
static
inline
struct
ddraw_stream
*
impl_from_IMemInputPin
(
IMemInputPin
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
ddraw_stream
,
IMemInputPin_iface
);
}
static
HRESULT
WINAPI
ddraw_meminput_QueryInterface
(
IMemInputPin
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
ddraw_stream
*
stream
=
impl_from_IMemInputPin
(
iface
);
return
IAMMediaStream_QueryInterface
(
&
stream
->
IAMMediaStream_iface
,
iid
,
out
);
}
static
ULONG
WINAPI
ddraw_meminput_AddRef
(
IMemInputPin
*
iface
)
{
struct
ddraw_stream
*
stream
=
impl_from_IMemInputPin
(
iface
);
return
IAMMediaStream_AddRef
(
&
stream
->
IAMMediaStream_iface
);
}
static
ULONG
WINAPI
ddraw_meminput_Release
(
IMemInputPin
*
iface
)
{
struct
ddraw_stream
*
stream
=
impl_from_IMemInputPin
(
iface
);
return
IAMMediaStream_Release
(
&
stream
->
IAMMediaStream_iface
);
}
static
HRESULT
WINAPI
ddraw_meminput_GetAllocator
(
IMemInputPin
*
iface
,
IMemAllocator
**
allocator
)
{
struct
ddraw_stream
*
stream
=
impl_from_IMemInputPin
(
iface
);
TRACE
(
"stream %p, allocator %p.
\n
"
,
stream
,
allocator
);
if
(
stream
->
allocator
)
{
IMemAllocator_AddRef
(
*
allocator
=
stream
->
allocator
);
return
S_OK
;
}
*
allocator
=
NULL
;
return
VFW_E_NO_ALLOCATOR
;
}
static
HRESULT
WINAPI
ddraw_meminput_NotifyAllocator
(
IMemInputPin
*
iface
,
IMemAllocator
*
allocator
,
BOOL
readonly
)
{
struct
ddraw_stream
*
stream
=
impl_from_IMemInputPin
(
iface
);
TRACE
(
"stream %p, allocator %p, readonly %d.
\n
"
,
stream
,
allocator
,
readonly
);
if
(
!
allocator
)
return
E_POINTER
;
if
(
allocator
)
IMemAllocator_AddRef
(
allocator
);
if
(
stream
->
allocator
)
IMemAllocator_Release
(
stream
->
allocator
);
stream
->
allocator
=
allocator
;
return
S_OK
;
}
static
HRESULT
WINAPI
ddraw_meminput_GetAllocatorRequirements
(
IMemInputPin
*
iface
,
ALLOCATOR_PROPERTIES
*
props
)
{
TRACE
(
"iface %p, props %p.
\n
"
,
iface
,
props
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ddraw_meminput_Receive
(
IMemInputPin
*
iface
,
IMediaSample
*
sample
)
{
FIXME
(
"iface %p, sample %p, stub!
\n
"
,
iface
,
sample
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ddraw_meminput_ReceiveMultiple
(
IMemInputPin
*
iface
,
IMediaSample
**
samples
,
LONG
count
,
LONG
*
processed
)
{
FIXME
(
"iface %p, samples %p, count %u, processed %p, stub!
\n
"
,
iface
,
samples
,
count
,
processed
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ddraw_meminput_ReceiveCanBlock
(
IMemInputPin
*
iface
)
{
TRACE
(
"iface %p.
\n
"
,
iface
);
return
S_OK
;
}
static
const
IMemInputPinVtbl
ddraw_meminput_vtbl
=
{
ddraw_meminput_QueryInterface
,
ddraw_meminput_AddRef
,
ddraw_meminput_Release
,
ddraw_meminput_GetAllocator
,
ddraw_meminput_NotifyAllocator
,
ddraw_meminput_GetAllocatorRequirements
,
ddraw_meminput_Receive
,
ddraw_meminput_ReceiveMultiple
,
ddraw_meminput_ReceiveCanBlock
,
};
HRESULT
ddrawmediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
IUnknown
*
stream_object
,
STREAM_TYPE
stream_type
,
IAMMediaStream
**
media_stream
)
{
...
...
@@ -740,6 +839,7 @@ HRESULT ddrawmediastream_create(IMultiMediaStream *parent, const MSPID *purpose_
object
->
IAMMediaStream_iface
.
lpVtbl
=
&
DirectDrawMediaStreamImpl_IAMMediaStream_Vtbl
;
object
->
IDirectDrawMediaStream_iface
.
lpVtbl
=
&
DirectDrawMediaStreamImpl_IDirectDrawMediaStream_Vtbl
;
object
->
IMemInputPin_iface
.
lpVtbl
=
&
ddraw_meminput_vtbl
;
object
->
ref
=
1
;
InitializeCriticalSection
(
&
object
->
critical_section
);
...
...
dlls/amstream/tests/amstream.c
View file @
ee880095
...
...
@@ -189,6 +189,7 @@ static void test_interfaces(void)
check_interface
(
stream
,
&
IID_IAMMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IDirectDrawMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IMediaStream
,
TRUE
);
check_interface
(
stream
,
&
IID_IMemInputPin
,
TRUE
);
check_interface
(
stream
,
&
IID_IPin
,
TRUE
);
check_interface
(
stream
,
&
IID_IUnknown
,
TRUE
);
...
...
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