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
77d1701b
Commit
77d1701b
authored
Oct 27, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add IMFGetService stub for 2D memory buffer.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8e13b0b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
buffer.c
dlls/mfplat/buffer.c
+44
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+13
-0
No files found.
dlls/mfplat/buffer.c
View file @
77d1701b
...
...
@@ -31,6 +31,7 @@ struct memory_buffer
{
IMFMediaBuffer
IMFMediaBuffer_iface
;
IMF2DBuffer2
IMF2DBuffer2_iface
;
IMFGetService
IMFGetService_iface
;
LONG
refcount
;
BYTE
*
data
;
...
...
@@ -88,6 +89,11 @@ static struct memory_buffer *impl_from_IMF2DBuffer2(IMF2DBuffer2 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
memory_buffer
,
IMF2DBuffer2_iface
);
}
static
struct
memory_buffer
*
impl_from_IMFGetService
(
IMFGetService
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
memory_buffer
,
IMFGetService_iface
);
}
static
inline
struct
sample
*
impl_from_IMFSample
(
IMFSample
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
sample
,
IMFSample_iface
);
...
...
@@ -240,6 +246,10 @@ static HRESULT WINAPI memory_1d_2d_buffer_QueryInterface(IMFMediaBuffer *iface,
{
*
out
=
&
buffer
->
IMF2DBuffer2_iface
;
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IMFGetService
))
{
*
out
=
&
buffer
->
IMFGetService_iface
;
}
else
{
WARN
(
"Unsupported interface %s.
\n
"
,
debugstr_guid
(
riid
));
...
...
@@ -511,6 +521,39 @@ static const IMF2DBuffer2Vtbl memory_2d_buffer_vtbl =
memory_2d_buffer_Copy2DTo
,
};
static
HRESULT
WINAPI
memory_2d_buffer_gs_QueryInterface
(
IMFGetService
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
memory_buffer
*
buffer
=
impl_from_IMFGetService
(
iface
);
return
IMFMediaBuffer_QueryInterface
(
&
buffer
->
IMFMediaBuffer_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
memory_2d_buffer_gs_AddRef
(
IMFGetService
*
iface
)
{
struct
memory_buffer
*
buffer
=
impl_from_IMFGetService
(
iface
);
return
IMFMediaBuffer_AddRef
(
&
buffer
->
IMFMediaBuffer_iface
);
}
static
ULONG
WINAPI
memory_2d_buffer_gs_Release
(
IMFGetService
*
iface
)
{
struct
memory_buffer
*
buffer
=
impl_from_IMFGetService
(
iface
);
return
IMFMediaBuffer_Release
(
&
buffer
->
IMFMediaBuffer_iface
);
}
static
HRESULT
WINAPI
memory_2d_buffer_gs_GetService
(
IMFGetService
*
iface
,
REFGUID
service
,
REFIID
riid
,
void
**
obj
)
{
TRACE
(
"%p, %s, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
obj
);
return
E_NOTIMPL
;
}
static
const
IMFGetServiceVtbl
memory_2d_buffer_gs_vtbl
=
{
memory_2d_buffer_gs_QueryInterface
,
memory_2d_buffer_gs_AddRef
,
memory_2d_buffer_gs_Release
,
memory_2d_buffer_gs_GetService
,
};
static
HRESULT
memory_buffer_init
(
struct
memory_buffer
*
buffer
,
DWORD
max_length
,
DWORD
alignment
,
const
IMFMediaBufferVtbl
*
vtbl
)
{
...
...
@@ -620,6 +663,7 @@ static HRESULT create_2d_buffer(DWORD width, DWORD height, DWORD fourcc, BOOL bo
}
object
->
IMF2DBuffer2_iface
.
lpVtbl
=
&
memory_2d_buffer_vtbl
;
object
->
IMFGetService_iface
.
lpVtbl
=
&
memory_2d_buffer_gs_vtbl
;
object
->
_2d
.
plane_size
=
plane_size
;
object
->
_2d
.
width
=
stride
;
object
->
_2d
.
height
=
height
;
...
...
dlls/mfplat/tests/mfplat.c
View file @
77d1701b
...
...
@@ -1818,6 +1818,7 @@ static void test_system_memory_buffer(void)
HRESULT
hr
;
DWORD
length
,
max
;
BYTE
*
data
,
*
data2
;
IUnknown
*
unk
;
hr
=
MFCreateMemoryBuffer
(
1024
,
NULL
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -1836,6 +1837,9 @@ static void test_system_memory_buffer(void)
hr
=
MFCreateMemoryBuffer
(
1024
,
&
buffer
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMFGetService
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
NULL
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
E_POINTER
,
"got 0x%08x
\n
"
,
hr
);
...
...
@@ -5155,6 +5159,7 @@ static void test_MFCreate2DMediaBuffer(void)
IMF2DBuffer
*
_2dbuffer
;
IMFMediaBuffer
*
buffer
;
int
i
,
pitch
,
pitch2
;
IUnknown
*
unk
;
HRESULT
hr
;
BOOL
ret
;
...
...
@@ -5177,6 +5182,10 @@ static void test_MFCreate2DMediaBuffer(void)
hr
=
pMFCreate2DMediaBuffer
(
2
,
3
,
MAKEFOURCC
(
'N'
,
'V'
,
'1'
,
'2'
),
FALSE
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMFGetService
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
/* Full backing buffer size, with 64 bytes per row alignment. */
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
max_length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#x.
\n
"
,
hr
);
...
...
@@ -5405,6 +5414,7 @@ static void test_MFCreateMediaBufferFromMediaType(void)
HRESULT
hr
;
IMFMediaType
*
media_type
;
unsigned
int
i
;
IUnknown
*
unk
;
if
(
!
pMFCreateMediaBufferFromMediaType
)
{
...
...
@@ -5437,6 +5447,9 @@ static void test_MFCreateMediaBufferFromMediaType(void)
if
(
FAILED
(
hr
))
break
;
hr
=
IMFMediaBuffer_QueryInterface
(
buffer
,
&
IID_IMFGetService
,
(
void
**
)
&
unk
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFMediaBuffer_GetMaxLength
(
buffer
,
&
length
);
ok
(
hr
==
S_OK
,
"Failed to get length, hr %#x.
\n
"
,
hr
);
ok
(
ptr
->
buffer_length
==
length
,
"%d: unexpected buffer length %u, expected %u.
\n
"
,
i
,
length
,
ptr
->
buffer_length
);
...
...
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