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
2e9a036f
Commit
2e9a036f
authored
Apr 26, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add partial implementation of ConvertToContiguousBuffer().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2295d937
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
2 deletions
+69
-2
buffer.c
dlls/mfplat/buffer.c
+22
-2
mfplat.c
dlls/mfplat/tests/mfplat.c
+47
-0
No files found.
dlls/mfplat/buffer.c
View file @
2e9a036f
...
@@ -686,9 +686,29 @@ static HRESULT WINAPI sample_GetBufferByIndex(IMFSample *iface, DWORD index, IMF
...
@@ -686,9 +686,29 @@ static HRESULT WINAPI sample_GetBufferByIndex(IMFSample *iface, DWORD index, IMF
static
HRESULT
WINAPI
sample_ConvertToContiguousBuffer
(
IMFSample
*
iface
,
IMFMediaBuffer
**
buffer
)
static
HRESULT
WINAPI
sample_ConvertToContiguousBuffer
(
IMFSample
*
iface
,
IMFMediaBuffer
**
buffer
)
{
{
FIXME
(
"%p, %p.
\n
"
,
iface
,
buffer
);
struct
sample
*
sample
=
impl_from_IMFSample
(
iface
);
HRESULT
hr
=
S_OK
;
return
E_NOTIMPL
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
buffer
);
EnterCriticalSection
(
&
sample
->
cs
);
if
(
sample
->
buffer_count
==
0
)
hr
=
E_UNEXPECTED
;
else
if
(
sample
->
buffer_count
==
1
)
{
*
buffer
=
sample
->
buffers
[
0
];
IMFMediaBuffer_AddRef
(
*
buffer
);
}
else
{
FIXME
(
"Samples with multiple buffers are not supported.
\n
"
);
hr
=
E_NOTIMPL
;
}
LeaveCriticalSection
(
&
sample
->
cs
);
return
hr
;
}
}
static
HRESULT
WINAPI
sample_AddBuffer
(
IMFSample
*
iface
,
IMFMediaBuffer
*
buffer
)
static
HRESULT
WINAPI
sample_AddBuffer
(
IMFSample
*
iface
,
IMFMediaBuffer
*
buffer
)
...
...
dlls/mfplat/tests/mfplat.c
View file @
2e9a036f
...
@@ -1475,6 +1475,53 @@ static void test_sample(void)
...
@@ -1475,6 +1475,53 @@ static void test_sample(void)
IMFAttributes_Release
(
attributes
);
IMFAttributes_Release
(
attributes
);
IMFSample_Release
(
sample
);
IMFSample_Release
(
sample
);
/* ConvertToContiguousBuffer() */
hr
=
MFCreateSample
(
&
sample
);
ok
(
hr
==
S_OK
,
"Failed to create a sample, hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_ConvertToContiguousBuffer
(
sample
,
&
buffer
);
ok
(
hr
==
E_UNEXPECTED
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
MFCreateMemoryBuffer
(
16
,
&
buffer
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_AddBuffer
(
sample
,
buffer
);
ok
(
hr
==
S_OK
,
"Failed to add buffer, hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_ConvertToContiguousBuffer
(
sample
,
&
buffer2
);
ok
(
hr
==
S_OK
,
"Failed to convert, hr %#x.
\n
"
,
hr
);
ok
(
buffer2
==
buffer
,
"Unexpected buffer instance.
\n
"
);
IMFMediaBuffer_Release
(
buffer2
);
hr
=
IMFSample_ConvertToContiguousBuffer
(
sample
,
&
buffer2
);
ok
(
hr
==
S_OK
,
"Failed to convert, hr %#x.
\n
"
,
hr
);
ok
(
buffer2
==
buffer
,
"Unexpected buffer instance.
\n
"
);
IMFMediaBuffer_Release
(
buffer2
);
hr
=
MFCreateMemoryBuffer
(
16
,
&
buffer2
);
ok
(
hr
==
S_OK
,
"Failed to create a buffer, hr %#x.
\n
"
,
hr
);
hr
=
IMFSample_AddBuffer
(
sample
,
buffer2
);
ok
(
hr
==
S_OK
,
"Failed to add buffer, hr %#x.
\n
"
,
hr
);
IMFMediaBuffer_Release
(
buffer2
);
hr
=
IMFSample_GetBufferCount
(
sample
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get buffer count, hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Unexpected buffer count %u.
\n
"
,
count
);
hr
=
IMFSample_ConvertToContiguousBuffer
(
sample
,
&
buffer2
);
todo_wine
ok
(
hr
==
S_OK
,
"Failed to convert, hr %#x.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
IMFMediaBuffer_Release
(
buffer2
);
hr
=
IMFSample_GetBufferCount
(
sample
,
&
count
);
ok
(
hr
==
S_OK
,
"Failed to get buffer count, hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
count
==
1
,
"Unexpected buffer count %u.
\n
"
,
count
);
IMFSample_Release
(
sample
);
}
}
struct
test_callback
struct
test_callback
...
...
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