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
b3655b5b
Commit
b3655b5b
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::GetOutputFormat().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
95ffc879
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
6 deletions
+72
-6
gst_private.h
dlls/winegstreamer/gst_private.h
+2
-0
wm_reader.c
dlls/winegstreamer/wm_reader.c
+62
-0
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+7
-5
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+1
-1
No files found.
dlls/winegstreamer/gst_private.h
View file @
b3655b5b
...
...
@@ -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_format
(
struct
wm_reader
*
reader
,
DWORD
output
,
DWORD
index
,
IWMOutputMediaProps
**
props
);
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
);
...
...
dlls/winegstreamer/wm_reader.c
View file @
b3655b5b
...
...
@@ -1290,6 +1290,68 @@ HRESULT wm_reader_get_output_props(struct wm_reader *reader, DWORD output, IWMOu
return
*
props
?
S_OK
:
E_OUTOFMEMORY
;
}
static
const
enum
wg_video_format
video_formats
[]
=
{
/* Try to prefer YUV formats over RGB ones. Most decoders output in the
* YUV color space, and it's generally much less expensive for
* videoconvert to do YUV -> YUV transformations. */
WG_VIDEO_FORMAT_NV12
,
WG_VIDEO_FORMAT_YV12
,
WG_VIDEO_FORMAT_YUY2
,
WG_VIDEO_FORMAT_UYVY
,
WG_VIDEO_FORMAT_YVYU
,
WG_VIDEO_FORMAT_BGRx
,
WG_VIDEO_FORMAT_BGR
,
WG_VIDEO_FORMAT_RGB16
,
WG_VIDEO_FORMAT_RGB15
,
};
HRESULT
wm_reader_get_output_format
(
struct
wm_reader
*
reader
,
DWORD
output
,
DWORD
index
,
IWMOutputMediaProps
**
props
)
{
struct
wm_stream
*
stream
;
struct
wg_format
format
;
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
(
stream
=
get_stream_by_output_number
(
reader
,
output
)))
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
E_INVALIDARG
;
}
wg_parser_stream_get_preferred_format
(
stream
->
wg_stream
,
&
format
);
switch
(
format
.
major_type
)
{
case
WG_MAJOR_TYPE_VIDEO
:
if
(
index
>=
ARRAY_SIZE
(
video_formats
))
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
NS_E_INVALID_OUTPUT_FORMAT
;
}
format
.
u
.
video
.
format
=
video_formats
[
index
];
break
;
case
WG_MAJOR_TYPE_AUDIO
:
if
(
index
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
NS_E_INVALID_OUTPUT_FORMAT
;
}
format
.
u
.
audio
.
format
=
WG_AUDIO_FORMAT_S16LE
;
break
;
case
WG_MAJOR_TYPE_UNKNOWN
:
break
;
}
LeaveCriticalSection
(
&
reader
->
cs
);
*
props
=
output_props_create
(
&
format
);
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 @
b3655b5b
...
...
@@ -97,12 +97,14 @@ static HRESULT WINAPI WMSyncReader_GetOutputCount(IWMSyncReader2 *iface, DWORD *
return
S_OK
;
}
static
HRESULT
WINAPI
WMSyncReader_GetOutputFormat
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
DWORD
format_num
,
IWMOutputMediaProps
**
props
)
static
HRESULT
WINAPI
WMSyncReader_GetOutputFormat
(
IWMSyncReader2
*
iface
,
DWORD
output
,
DWORD
index
,
IWMOutputMediaProps
**
props
)
{
struct
sync_reader
*
This
=
impl_from_IWMSyncReader2
(
iface
);
FIXME
(
"(%p)->(%u %u %p): stub!
\n
"
,
This
,
output_num
,
format_num
,
props
);
return
E_NOTIMPL
;
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
TRACE
(
"reader %p, output %u, index %u, props %p.
\n
"
,
reader
,
output
,
index
,
props
);
return
wm_reader_get_output_format
(
&
reader
->
reader
,
output
,
index
,
props
);
}
static
HRESULT
WINAPI
WMSyncReader_GetOutputFormatCount
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
DWORD
*
formats
)
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
b3655b5b
...
...
@@ -856,7 +856,7 @@ static void test_sync_reader_types(void)
output_props
=
(
void
*
)
0xdeadbeef
;
hr
=
IWMSyncReader_GetOutputFormat
(
reader
,
2
,
0
,
&
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
);
IWMProfile_Release
(
profile
);
...
...
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