Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0dc309ef
Commit
0dc309ef
authored
Oct 28, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMSyncReader::GetOutputProps().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25948222
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
165 additions
and
32 deletions
+165
-32
gst_private.h
dlls/winegstreamer/gst_private.h
+2
-0
wm_reader.c
dlls/winegstreamer/wm_reader.c
+133
-0
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+7
-4
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+23
-28
No files found.
dlls/winegstreamer/gst_private.h
View file @
0dc309ef
...
...
@@ -153,6 +153,8 @@ struct wm_reader_ops
void
wm_reader_cleanup
(
struct
wm_reader
*
reader
);
HRESULT
wm_reader_close
(
struct
wm_reader
*
reader
);
HRESULT
wm_reader_get_output_props
(
struct
wm_reader
*
reader
,
DWORD
output
,
IWMOutputMediaProps
**
props
);
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
);
HRESULT
wm_reader_open_stream
(
struct
wm_reader
*
reader
,
IStream
*
stream
);
...
...
dlls/winegstreamer/wm_reader.c
View file @
0dc309ef
...
...
@@ -20,6 +20,122 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wmvcore
);
static
struct
wm_stream
*
get_stream_by_output_number
(
struct
wm_reader
*
reader
,
DWORD
output
)
{
if
(
output
<
reader
->
stream_count
)
return
&
reader
->
streams
[
output
];
WARN
(
"Invalid output number %u.
\n
"
,
output
);
return
NULL
;
}
struct
output_props
{
IWMOutputMediaProps
IWMOutputMediaProps_iface
;
LONG
refcount
;
};
static
inline
struct
output_props
*
impl_from_IWMOutputMediaProps
(
IWMOutputMediaProps
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
output_props
,
IWMOutputMediaProps_iface
);
}
static
HRESULT
WINAPI
output_props_QueryInterface
(
IWMOutputMediaProps
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
output_props
*
props
=
impl_from_IWMOutputMediaProps
(
iface
);
TRACE
(
"props %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
iid
,
&
IID_IWMOutputMediaProps
))
*
out
=
&
props
->
IWMOutputMediaProps_iface
;
else
{
*
out
=
NULL
;
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
return
S_OK
;
}
static
ULONG
WINAPI
output_props_AddRef
(
IWMOutputMediaProps
*
iface
)
{
struct
output_props
*
props
=
impl_from_IWMOutputMediaProps
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
props
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
props
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
output_props_Release
(
IWMOutputMediaProps
*
iface
)
{
struct
output_props
*
props
=
impl_from_IWMOutputMediaProps
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
props
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
props
,
refcount
);
if
(
!
refcount
)
free
(
props
);
return
refcount
;
}
static
HRESULT
WINAPI
output_props_GetType
(
IWMOutputMediaProps
*
iface
,
GUID
*
major_type
)
{
FIXME
(
"iface %p, major_type %p, stub!
\n
"
,
iface
,
major_type
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
output_props_GetMediaType
(
IWMOutputMediaProps
*
iface
,
WM_MEDIA_TYPE
*
mt
,
DWORD
*
size
)
{
FIXME
(
"iface %p, mt %p, size %p, stub!
\n
"
,
iface
,
mt
,
size
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
output_props_SetMediaType
(
IWMOutputMediaProps
*
iface
,
WM_MEDIA_TYPE
*
mt
)
{
FIXME
(
"iface %p, mt %p, stub!
\n
"
,
iface
,
mt
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
output_props_GetStreamGroupName
(
IWMOutputMediaProps
*
iface
,
WCHAR
*
name
,
WORD
*
len
)
{
FIXME
(
"iface %p, name %p, len %p, stub!
\n
"
,
iface
,
name
,
len
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
output_props_GetConnectionName
(
IWMOutputMediaProps
*
iface
,
WCHAR
*
name
,
WORD
*
len
)
{
FIXME
(
"iface %p, name %p, len %p, stub!
\n
"
,
iface
,
name
,
len
);
return
E_NOTIMPL
;
}
static
const
struct
IWMOutputMediaPropsVtbl
output_props_vtbl
=
{
output_props_QueryInterface
,
output_props_AddRef
,
output_props_Release
,
output_props_GetType
,
output_props_GetMediaType
,
output_props_SetMediaType
,
output_props_GetStreamGroupName
,
output_props_GetConnectionName
,
};
static
IWMOutputMediaProps
*
output_props_create
(
void
)
{
struct
output_props
*
object
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
NULL
;
object
->
IWMOutputMediaProps_iface
.
lpVtbl
=
&
output_props_vtbl
;
object
->
refcount
=
1
;
TRACE
(
"Created output properties %p.
\n
"
,
object
);
return
&
object
->
IWMOutputMediaProps_iface
;
}
struct
stream_config
{
IWMStreamConfig
IWMStreamConfig_iface
;
...
...
@@ -1116,6 +1232,23 @@ HRESULT wm_reader_close(struct wm_reader *reader)
return
S_OK
;
}
HRESULT
wm_reader_get_output_props
(
struct
wm_reader
*
reader
,
DWORD
output
,
IWMOutputMediaProps
**
props
)
{
struct
wm_stream
*
stream
;
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
(
stream
=
get_stream_by_output_number
(
reader
,
output
)))
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
E_INVALIDARG
;
}
*
props
=
output_props_create
();
LeaveCriticalSection
(
&
reader
->
cs
);
return
*
props
?
S_OK
:
E_OUTOFMEMORY
;
}
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
)
{
reader
->
IWMHeaderInfo3_iface
.
lpVtbl
=
&
header_info_vtbl
;
...
...
dlls/winegstreamer/wm_syncreader.c
View file @
0dc309ef
...
...
@@ -123,11 +123,14 @@ static HRESULT WINAPI WMSyncReader_GetOutputNumberForStream(IWMSyncReader2 *ifac
return
S_OK
;
}
static
HRESULT
WINAPI
WMSyncReader_GetOutputProps
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
IWMOutputMediaProps
**
output
)
static
HRESULT
WINAPI
WMSyncReader_GetOutputProps
(
IWMSyncReader2
*
iface
,
DWORD
output
,
IWMOutputMediaProps
**
props
)
{
struct
sync_reader
*
This
=
impl_from_IWMSyncReader2
(
iface
);
FIXME
(
"(%p)->(%u %p): stub!
\n
"
,
This
,
output_num
,
output
);
return
E_NOTIMPL
;
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
TRACE
(
"reader %p, output %u, props %p.
\n
"
,
reader
,
output
,
props
);
return
wm_reader_get_output_props
(
&
reader
->
reader
,
output
,
props
);
}
static
HRESULT
WINAPI
WMSyncReader_GetOutputSetting
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
const
WCHAR
*
name
,
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
0dc309ef
...
...
@@ -724,30 +724,28 @@ static void test_sync_reader_types(void)
ok
(
stream_number2
==
stream_number
,
"Expected stream number %u, got %u.
\n
"
,
stream_number
,
stream_number2
);
hr
=
IWMSyncReader_GetOutputProps
(
reader
,
output_number
,
&
output_props
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
{
winetest_pop_context
();
continue
;
}
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ret_size
=
sizeof
(
mt_buffer
);
hr
=
IWMOutputMediaProps_GetMediaType
(
output_props
,
mt
,
&
ret_size
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
IWMOutputMediaProps_Release
(
output_props
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
if
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Audio
))
{
got_audio
=
true
;
check_audio_type
(
mt
);
}
else
if
(
hr
==
S_OK
)
{
ok
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Video
),
"Got major type %s.
\n
"
,
debugstr_guid
(
&
majortype
));
got_video
=
true
;
check_video_type
(
mt
);
if
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Audio
))
{
got_audio
=
true
;
check_audio_type
(
mt
);
}
else
{
ok
(
IsEqualGUID
(
&
majortype
,
&
MEDIATYPE_Video
),
"Got major type %s.
\n
"
,
debugstr_guid
(
&
majortype
));
got_video
=
true
;
check_video_type
(
mt
);
}
}
count
=
0
;
...
...
@@ -832,19 +830,16 @@ static void test_sync_reader_types(void)
todo_wine
ok
(
hr
==
NS_E_INVALID_OUTPUT_FORMAT
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMSyncReader_GetOutputProps
(
reader
,
output_number
,
&
output_props
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
hr
=
IWMSyncReader_GetOutputProps
(
reader
,
output_number
,
&
output_props2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
output_props2
!=
output_props
,
"Expected different objects.
\n
"
);
hr
=
IWMSyncReader_GetOutputProps
(
reader
,
output_number
,
&
output_props2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
output_props2
!=
output_props
,
"Expected different objects.
\n
"
);
ref
=
IWMOutputMediaProps_Release
(
output_props2
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IWMOutputMediaProps_Release
(
output_props
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
}
ref
=
IWMOutputMediaProps_Release
(
output_props2
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
ref
=
IWMOutputMediaProps_Release
(
output_props
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
winetest_pop_context
();
}
...
...
@@ -859,7 +854,7 @@ static void test_sync_reader_types(void)
output_props
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader_GetOutputProps
(
reader
,
2
,
&
output_props
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
output_props
==
(
void
*
)
0xdeadbeef
,
"Got output props %p.
\n
"
,
output_props
);
output_props
=
(
void
*
)
0xdeadbeef
;
...
...
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