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
5d0858ee
Commit
5d0858ee
authored
Nov 10, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMSyncReader::SetStreamsSelected().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c41059bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
7 deletions
+65
-7
gst_private.h
dlls/winegstreamer/gst_private.h
+3
-0
wm_reader.c
dlls/winegstreamer/wm_reader.c
+48
-0
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+14
-7
No files found.
dlls/winegstreamer/gst_private.h
View file @
5d0858ee
...
...
@@ -123,6 +123,7 @@ struct wm_stream
WORD
index
;
bool
eos
;
struct
wg_format
format
;
WMT_STREAM_SELECTION
selection
;
};
struct
wm_reader
...
...
@@ -173,5 +174,7 @@ HRESULT wm_reader_open_stream(struct wm_reader *reader, IStream *stream);
void
wm_reader_seek
(
struct
wm_reader
*
reader
,
QWORD
start
,
LONGLONG
duration
);
HRESULT
wm_reader_set_output_props
(
struct
wm_reader
*
reader
,
DWORD
output
,
IWMOutputMediaProps
*
props
);
HRESULT
wm_reader_set_streams_selected
(
struct
wm_reader
*
reader
,
WORD
count
,
const
WORD
*
stream_numbers
,
const
WMT_STREAM_SELECTION
*
selections
);
#endif
/* __GST_PRIVATE_INCLUDED__ */
dlls/winegstreamer/wm_reader.c
View file @
5d0858ee
...
...
@@ -1413,6 +1413,7 @@ static HRESULT init_stream(struct wm_reader *reader, QWORD file_size)
stream
->
wg_stream
=
wg_parser_get_stream
(
reader
->
wg_parser
,
i
);
stream
->
reader
=
reader
;
stream
->
index
=
i
;
stream
->
selection
=
WMT_ON
;
wg_parser_stream_get_preferred_format
(
stream
->
wg_stream
,
&
stream
->
format
);
if
(
stream
->
format
.
major_type
==
WG_MAJOR_TYPE_AUDIO
)
{
...
...
@@ -1739,6 +1740,9 @@ HRESULT wm_reader_get_stream_sample(struct wm_stream *stream,
struct
wg_parser_event
event
;
struct
buffer
*
object
;
if
(
stream
->
selection
==
WMT_OFF
)
return
NS_E_INVALID_REQUEST
;
if
(
stream
->
eos
)
return
NS_E_NO_MORE_SAMPLES
;
...
...
@@ -1824,6 +1828,50 @@ void wm_reader_seek(struct wm_reader *reader, QWORD start, LONGLONG duration)
LeaveCriticalSection
(
&
reader
->
cs
);
}
HRESULT
wm_reader_set_streams_selected
(
struct
wm_reader
*
reader
,
WORD
count
,
const
WORD
*
stream_numbers
,
const
WMT_STREAM_SELECTION
*
selections
)
{
struct
wm_stream
*
stream
;
WORD
i
;
if
(
!
count
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
reader
->
cs
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
if
(
!
(
stream
=
wm_reader_get_stream_by_stream_number
(
reader
,
stream_numbers
[
i
])))
{
LeaveCriticalSection
(
&
reader
->
cs
);
WARN
(
"Invalid stream number %u; returning NS_E_INVALID_REQUEST.
\n
"
,
stream_numbers
[
i
]);
return
NS_E_INVALID_REQUEST
;
}
}
for
(
i
=
0
;
i
<
count
;
++
i
)
{
stream
=
wm_reader_get_stream_by_stream_number
(
reader
,
stream_numbers
[
i
]);
stream
->
selection
=
selections
[
i
];
if
(
selections
[
i
]
==
WMT_OFF
)
{
TRACE
(
"Disabling stream %u.
\n
"
,
stream_numbers
[
i
]);
wg_parser_stream_disable
(
stream
->
wg_stream
);
}
else
if
(
selections
[
i
]
==
WMT_ON
)
{
if
(
selections
[
i
]
!=
WMT_ON
)
FIXME
(
"Ignoring selection %#x for stream %u; treating as enabled.
\n
"
,
selections
[
i
],
stream_numbers
[
i
]);
TRACE
(
"Enabling stream %u.
\n
"
,
stream_numbers
[
i
]);
wg_parser_stream_enable
(
stream
->
wg_stream
,
&
stream
->
format
);
}
}
LeaveCriticalSection
(
&
reader
->
cs
);
return
S_OK
;
}
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 @
5d0858ee
...
...
@@ -83,8 +83,8 @@ static HRESULT WINAPI WMSyncReader_GetNextSample(IWMSyncReader2 *iface,
DWORD
*
flags
,
DWORD
*
output_number
,
WORD
*
ret_stream_number
)
{
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
HRESULT
hr
=
NS_E_NO_MORE_SAMPLES
;
struct
wm_stream
*
stream
;
HRESULT
hr
;
WORD
i
;
TRACE
(
"reader %p, stream_number %u, sample %p, pts %p, duration %p,"
...
...
@@ -104,8 +104,12 @@ static HRESULT WINAPI WMSyncReader_GetNextSample(IWMSyncReader2 *iface,
for
(
i
=
0
;
i
<
reader
->
reader
.
stream_count
;
++
i
)
{
WORD
index
=
(
i
+
reader
->
last_read_stream
+
1
)
%
reader
->
reader
.
stream_count
;
struct
wm_stream
*
stream
=
&
reader
->
reader
.
streams
[
index
];
hr
=
wm_reader_get_stream_sample
(
&
reader
->
reader
.
streams
[
index
],
sample
,
pts
,
duration
,
flags
);
if
(
stream
->
selection
==
WMT_OFF
)
continue
;
hr
=
wm_reader_get_stream_sample
(
stream
,
sample
,
pts
,
duration
,
flags
);
if
(
hr
==
S_OK
)
{
if
(
output_number
)
...
...
@@ -296,12 +300,15 @@ static HRESULT WINAPI WMSyncReader_SetReadStreamSamples(IWMSyncReader2 *iface, W
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WMSyncReader_SetStreamsSelected
(
IWMSyncReader2
*
iface
,
WORD
stream_count
,
WORD
*
stream_numbers
,
WMT_STREAM_SELECTION
*
selections
)
static
HRESULT
WINAPI
WMSyncReader_SetStreamsSelected
(
IWMSyncReader2
*
iface
,
WORD
count
,
WORD
*
stream_numbers
,
WMT_STREAM_SELECTION
*
selections
)
{
struct
sync_reader
*
This
=
impl_from_IWMSyncReader2
(
iface
);
FIXME
(
"(%p)->(%d %p %p): stub!
\n
"
,
This
,
stream_count
,
stream_numbers
,
selections
);
return
S_OK
;
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
TRACE
(
"reader %p, count %u, stream_numbers %p, selections %p.
\n
"
,
reader
,
count
,
stream_numbers
,
selections
);
return
wm_reader_set_streams_selected
(
&
reader
->
reader
,
count
,
stream_numbers
,
selections
);
}
static
HRESULT
WINAPI
WMSyncReader2_SetRangeByTimecode
(
IWMSyncReader2
*
iface
,
WORD
stream_num
,
...
...
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