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
3c02d5be
Commit
3c02d5be
authored
Jul 03, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfplat: Add tracked sample stub.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ba11eed8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
6 deletions
+122
-6
buffer.c
dlls/mfplat/buffer.c
+83
-6
mfplat.spec
dlls/mfplat/mfplat.spec
+1
-0
mfplat.c
dlls/mfplat/tests/mfplat.c
+37
-0
mfidl.idl
include/mfidl.idl
+1
-0
No files found.
dlls/mfplat/buffer.c
View file @
3c02d5be
...
...
@@ -62,6 +62,7 @@ struct sample
{
struct
attributes
attributes
;
IMFSample
IMFSample_iface
;
IMFTrackedSample
IMFTrackedSample_iface
;
IMFMediaBuffer
**
buffers
;
size_t
buffer_count
;
...
...
@@ -87,6 +88,11 @@ static inline struct sample *impl_from_IMFSample(IMFSample *iface)
return
CONTAINING_RECORD
(
iface
,
struct
sample
,
IMFSample_iface
);
}
static
struct
sample
*
impl_from_IMFTrackedSample
(
IMFTrackedSample
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
sample
,
IMFTrackedSample_iface
);
}
static
HRESULT
WINAPI
memory_buffer_QueryInterface
(
IMFMediaBuffer
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
memory_buffer
*
buffer
=
impl_from_IMFMediaBuffer
(
iface
);
...
...
@@ -711,20 +717,29 @@ HRESULT WINAPI MFCreateMediaBufferFromMediaType(IMFMediaType *media_type, LONGLO
static
HRESULT
WINAPI
sample_QueryInterface
(
IMFSample
*
iface
,
REFIID
riid
,
void
**
out
)
{
struct
sample
*
sample
=
impl_from_IMFSample
(
iface
);
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualIID
(
riid
,
&
IID_IMFSample
)
||
IsEqualIID
(
riid
,
&
IID_IMFAttributes
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
out
=
iface
;
IMFSample_AddRef
(
iface
);
return
S_OK
;
*
out
=
&
sample
->
IMFSample_iface
;
}
else
if
(
sample
->
IMFTrackedSample_iface
.
lpVtbl
&&
IsEqualIID
(
riid
,
&
IID_IMFTrackedSample
))
{
*
out
=
&
sample
->
IMFTrackedSample_iface
;
}
else
{
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
WARN
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
riid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
return
S_OK
;
}
static
ULONG
WINAPI
sample_AddRef
(
IMFSample
*
iface
)
...
...
@@ -1448,6 +1463,40 @@ static const IMFSampleVtbl samplevtbl =
sample_CopyToBuffer
,
};
static
HRESULT
WINAPI
tracked_sample_QueryInterface
(
IMFTrackedSample
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
sample
*
sample
=
impl_from_IMFTrackedSample
(
iface
);
return
IMFSample_QueryInterface
(
&
sample
->
IMFSample_iface
,
riid
,
obj
);
}
static
ULONG
WINAPI
tracked_sample_AddRef
(
IMFTrackedSample
*
iface
)
{
struct
sample
*
sample
=
impl_from_IMFTrackedSample
(
iface
);
return
IMFSample_AddRef
(
&
sample
->
IMFSample_iface
);
}
static
ULONG
WINAPI
tracked_sample_Release
(
IMFTrackedSample
*
iface
)
{
struct
sample
*
sample
=
impl_from_IMFTrackedSample
(
iface
);
return
IMFSample_Release
(
&
sample
->
IMFSample_iface
);
}
static
HRESULT
WINAPI
tracked_sample_SetAllocator
(
IMFTrackedSample
*
iface
,
IMFAsyncCallback
*
sample_allocator
,
IUnknown
*
state
)
{
FIXME
(
"%p, %p, %p.
\n
"
,
iface
,
sample_allocator
,
state
);
return
E_NOTIMPL
;
}
static
const
IMFTrackedSampleVtbl
tracked_sample_vtbl
=
{
tracked_sample_QueryInterface
,
tracked_sample_AddRef
,
tracked_sample_Release
,
tracked_sample_SetAllocator
,
};
/***********************************************************************
* MFCreateSample (mfplat.@)
*/
...
...
@@ -1476,3 +1525,31 @@ HRESULT WINAPI MFCreateSample(IMFSample **sample)
return
S_OK
;
}
/***********************************************************************
* MFCreateTrackedSample (mfplat.@)
*/
HRESULT
WINAPI
MFCreateTrackedSample
(
IMFTrackedSample
**
sample
)
{
struct
sample
*
object
;
HRESULT
hr
;
TRACE
(
"%p.
\n
"
,
sample
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
init_attributes_object
(
&
object
->
attributes
,
0
)))
{
heap_free
(
object
);
return
hr
;
}
object
->
IMFSample_iface
.
lpVtbl
=
&
samplevtbl
;
object
->
IMFTrackedSample_iface
.
lpVtbl
=
&
tracked_sample_vtbl
;
*
sample
=
&
object
->
IMFTrackedSample_iface
;
return
S_OK
;
}
dlls/mfplat/mfplat.spec
View file @
3c02d5be
...
...
@@ -70,6 +70,7 @@
@ stdcall MFCreateSystemTimeSource(ptr)
@ stub MFCreateSystemUnderlyingClock
@ stub MFCreateTempFile
@ stdcall MFCreateTrackedSample(ptr)
@ stdcall MFCreateTransformActivate(ptr)
@ stub MFCreateURLFromPath
@ stub MFCreateUdpSockets
...
...
dlls/mfplat/tests/mfplat.c
View file @
3c02d5be
...
...
@@ -107,6 +107,7 @@ static HRESULT (WINAPI *pMFCreate2DMediaBuffer)(DWORD width, DWORD height, DWORD
static
HRESULT
(
WINAPI
*
pMFCreateMediaBufferFromMediaType
)(
IMFMediaType
*
media_type
,
LONGLONG
duration
,
DWORD
min_length
,
DWORD
min_alignment
,
IMFMediaBuffer
**
buffer
);
static
HRESULT
(
WINAPI
*
pMFCreateDXSurfaceBuffer
)(
REFIID
riid
,
IUnknown
*
surface
,
BOOL
bottom_up
,
IMFMediaBuffer
**
buffer
);
static
HRESULT
(
WINAPI
*
pMFCreateTrackedSample
)(
IMFTrackedSample
**
sample
);
static
HWND
create_window
(
void
)
{
...
...
@@ -715,6 +716,7 @@ static void init_functions(void)
X
(
MFCreateSourceResolver
);
X
(
MFCreateMediaBufferFromMediaType
);
X
(
MFCreateMFByteStreamOnStream
);
X
(
MFCreateTrackedSample
);
X
(
MFCreateTransformActivate
);
X
(
MFGetPlaneSize
);
X
(
MFGetStrideForBitmapInfoHeader
);
...
...
@@ -5465,6 +5467,40 @@ done:
DestroyWindow
(
window
);
}
static
void
test_MFCreateTrackedSample
(
void
)
{
IMFTrackedSample
*
tracked_sample
;
IMFDesiredSample
*
desired_sample
;
IMFSample
*
sample
;
IUnknown
*
unk
;
HRESULT
hr
;
if
(
!
pMFCreateTrackedSample
)
{
win_skip
(
"MFCreateTrackedSample() is not available.
\n
"
);
return
;
}
hr
=
pMFCreateTrackedSample
(
&
tracked_sample
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
/* It's actually a sample. */
hr
=
IMFTrackedSample_QueryInterface
(
tracked_sample
,
&
IID_IMFSample
,
(
void
**
)
&
sample
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
hr
=
IMFTrackedSample_QueryInterface
(
tracked_sample
,
&
IID_IUnknown
,
(
void
**
)
&
unk
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#x.
\n
"
,
hr
);
ok
(
unk
==
(
IUnknown
*
)
sample
,
"Unexpected pointer.
\n
"
);
IUnknown_Release
(
unk
);
IMFSample_Release
(
sample
);
hr
=
IMFTrackedSample_QueryInterface
(
tracked_sample
,
&
IID_IMFDesiredSample
,
(
void
**
)
&
desired_sample
);
ok
(
hr
==
E_NOINTERFACE
,
"Unexpected hr %#x.
\n
"
,
hr
);
IMFTrackedSample_Release
(
tracked_sample
);
}
START_TEST
(
mfplat
)
{
char
**
argv
;
...
...
@@ -5522,6 +5558,7 @@ START_TEST(mfplat)
test_MFInitMediaTypeFromWaveFormatEx
();
test_MFCreateMFVideoFormatFromMFMediaType
();
test_MFCreateDXSurfaceBuffer
();
test_MFCreateTrackedSample
();
CoUninitialize
();
}
include/mfidl.idl
View file @
3c02d5be
...
...
@@ -648,6 +648,7 @@ cpp_quote("HRESULT WINAPI MFGetService(IUnknown *object, REFGUID service, REFIID
cpp_quote
(
"MFTIME WINAPI MFGetSystemTime(void);"
)
cpp_quote
(
"HRESULT WINAPI MFGetTopoNodeCurrentType(IMFTopologyNode *node, DWORD stream, BOOL output, IMFMediaType **type);"
)
cpp_quote
(
"HRESULT WINAPI MFShutdownObject(IUnknown *object);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateTrackedSample(IMFTrackedSample **sample);"
)
typedef
enum
_MFMEDIASOURCE_CHARACTERISTICS
{
...
...
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