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
90fb2c3e
Commit
90fb2c3e
authored
Sep 16, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Oct 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Use IWMSyncReader2_GetNextSample in the async reader.
parent
b2315480
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
64 deletions
+53
-64
gst_private.h
dlls/winegstreamer/gst_private.h
+0
-48
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+7
-9
wm_reader.c
dlls/winegstreamer/wm_reader.c
+46
-7
No files found.
dlls/winegstreamer/gst_private.h
View file @
90fb2c3e
...
...
@@ -143,54 +143,6 @@ HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj);
HRESULT
h264_decoder_create
(
REFIID
riid
,
void
**
ret
);
HRESULT
video_processor_create
(
REFIID
riid
,
void
**
ret
);
struct
wm_stream
{
struct
wm_reader
*
reader
;
struct
wg_parser_stream
*
wg_stream
;
struct
wg_format
format
;
WMT_STREAM_SELECTION
selection
;
WORD
index
;
bool
eos
;
/* Note that we only pretend to read compressed samples, and instead output
* uncompressed samples regardless of whether we are configured to read
* compressed samples. Rather, the behaviour of the reader objects differs
* in nontrivial ways depending on this field. */
bool
read_compressed
;
IWMReaderAllocatorEx
*
output_allocator
;
IWMReaderAllocatorEx
*
stream_allocator
;
};
struct
wm_reader
{
IUnknown
IUnknown_inner
;
IWMSyncReader2
IWMSyncReader2_iface
;
IWMHeaderInfo3
IWMHeaderInfo3_iface
;
IWMLanguageList
IWMLanguageList_iface
;
IWMPacketSize2
IWMPacketSize2_iface
;
IWMProfile3
IWMProfile3_iface
;
IWMReaderPlaylistBurn
IWMReaderPlaylistBurn_iface
;
IWMReaderTimecode
IWMReaderTimecode_iface
;
IUnknown
*
outer
;
LONG
refcount
;
CRITICAL_SECTION
cs
;
QWORD
start_time
;
IStream
*
source_stream
;
HANDLE
file
;
HANDLE
read_thread
;
bool
read_thread_shutdown
;
struct
wg_parser
*
wg_parser
;
struct
wm_stream
*
streams
;
WORD
stream_count
;
};
HRESULT
WINAPI
winegstreamer_create_wm_sync_reader
(
IUnknown
*
outer
,
void
**
out
);
struct
wm_reader
*
wm_reader_from_sync_reader_inner
(
IUnknown
*
inner
);
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
IWMReaderCallbackAdvanced
*
callback_advanced
,
WORD
stream_number
,
INSSBuffer
**
ret_sample
,
QWORD
*
pts
,
QWORD
*
duration
,
DWORD
*
flags
,
WORD
*
ret_stream_number
);
#endif
/* __GST_PRIVATE_INCLUDED__ */
dlls/winegstreamer/wm_asyncreader.c
View file @
90fb2c3e
...
...
@@ -48,7 +48,7 @@ struct sample
{
INSSBuffer
*
buffer
;
QWORD
pts
,
duration
;
DWORD
flags
;
DWORD
flags
,
output
;
WORD
stream
;
};
...
...
@@ -65,7 +65,6 @@ struct async_reader
LONG
refcount
;
IWMSyncReader2
*
reader
;
struct
wm_reader
*
wm_reader
;
CRITICAL_SECTION
cs
;
...
...
@@ -261,9 +260,9 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp
BOOL
read_compressed
;
HRESULT
hr
;
TRACE
(
"reader %p, stream %u, pts %s, duration %s, flags %#lx, buffer %p.
\n
"
,
reader
,
sample
->
stream
,
debugstr_time
(
sample
->
pts
),
debugstr_time
(
sample
->
duration
),
sample
->
flags
,
sample
->
buffer
);
TRACE
(
"reader %p,
output %lu,
stream %u, pts %s, duration %s, flags %#lx, buffer %p.
\n
"
,
reader
,
sample
->
output
,
sample
->
stream
,
debugstr_time
(
sample
->
pts
),
debugstr_time
(
sample
->
duration
),
sample
->
flags
,
sample
->
buffer
);
if
(
FAILED
(
hr
=
IWMSyncReader2_GetReadStreamSamples
(
reader
->
reader
,
sample
->
stream
,
&
read_compressed
)))
...
...
@@ -274,7 +273,7 @@ static void async_reader_deliver_sample(struct async_reader *reader, struct samp
hr
=
IWMReaderCallbackAdvanced_OnStreamSample
(
callback_advanced
,
sample
->
stream
,
sample
->
pts
,
sample
->
duration
,
sample
->
flags
,
sample
->
buffer
,
reader
->
context
);
else
hr
=
IWMReaderCallback_OnSample
(
callback
,
sample
->
stream
-
1
,
sample
->
pts
,
sample
->
duration
,
hr
=
IWMReaderCallback_OnSample
(
callback
,
sample
->
output
,
sample
->
pts
,
sample
->
duration
,
sample
->
flags
,
sample
->
buffer
,
reader
->
context
);
EnterCriticalSection
(
&
reader
->
callback_cs
);
...
...
@@ -295,8 +294,8 @@ static void callback_thread_run(struct async_reader *reader)
struct
sample
sample
;
LeaveCriticalSection
(
&
reader
->
callback_cs
);
hr
=
wm_reader_get_stream_sample
(
reader
->
wm_reader
,
callback_advanced
,
0
,
&
sample
.
buffer
,
&
sample
.
pts
,
&
sample
.
duration
,
&
sample
.
flags
,
&
sample
.
stream
);
hr
=
IWMSyncReader2_GetNextSample
(
reader
->
reader
,
0
,
&
sample
.
buffer
,
&
sample
.
pts
,
&
sample
.
duration
,
&
sample
.
flags
,
&
sample
.
output
,
&
sample
.
stream
);
EnterCriticalSection
(
&
reader
->
callback_cs
);
if
(
hr
!=
S_OK
)
break
;
...
...
@@ -1909,7 +1908,6 @@ HRESULT WINAPI winegstreamer_create_wm_async_reader(IWMReader **reader)
(
void
**
)
&
object
->
reader
)))
goto
failed
;
IWMReader_Release
(
&
object
->
IWMReader_iface
);
object
->
wm_reader
=
wm_reader_from_sync_reader_inner
(
object
->
reader_inner
);
InitializeCriticalSection
(
&
object
->
cs
);
object
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": async_reader.cs"
);
...
...
dlls/winegstreamer/wm_reader.c
View file @
90fb2c3e
...
...
@@ -20,6 +20,50 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wmvcore
);
struct
wm_stream
{
struct
wm_reader
*
reader
;
struct
wg_parser_stream
*
wg_stream
;
struct
wg_format
format
;
WMT_STREAM_SELECTION
selection
;
WORD
index
;
bool
eos
;
/* Note that we only pretend to read compressed samples, and instead output
* uncompressed samples regardless of whether we are configured to read
* compressed samples. Rather, the behaviour of the reader objects differs
* in nontrivial ways depending on this field. */
bool
read_compressed
;
IWMReaderAllocatorEx
*
output_allocator
;
IWMReaderAllocatorEx
*
stream_allocator
;
};
struct
wm_reader
{
IUnknown
IUnknown_inner
;
IWMSyncReader2
IWMSyncReader2_iface
;
IWMHeaderInfo3
IWMHeaderInfo3_iface
;
IWMLanguageList
IWMLanguageList_iface
;
IWMPacketSize2
IWMPacketSize2_iface
;
IWMProfile3
IWMProfile3_iface
;
IWMReaderPlaylistBurn
IWMReaderPlaylistBurn_iface
;
IWMReaderTimecode
IWMReaderTimecode_iface
;
IUnknown
*
outer
;
LONG
refcount
;
CRITICAL_SECTION
cs
;
QWORD
start_time
;
IStream
*
source_stream
;
HANDLE
file
;
HANDLE
read_thread
;
bool
read_thread_shutdown
;
struct
wg_parser
*
wg_parser
;
struct
wm_stream
*
streams
;
WORD
stream_count
;
};
static
struct
wm_stream
*
get_stream_by_output_number
(
struct
wm_reader
*
reader
,
DWORD
output
)
{
if
(
output
<
reader
->
stream_count
)
...
...
@@ -1569,7 +1613,7 @@ static WORD get_earliest_buffer(struct wm_reader *reader, struct wg_parser_buffe
return
stream_number
;
}
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
IWMReaderCallbackAdvanced
*
callback_advanced
,
WORD
stream_number
,
static
HRESULT
wm_reader_get_stream_sample
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
INSSBuffer
**
ret_sample
,
QWORD
*
pts
,
QWORD
*
duration
,
DWORD
*
flags
,
WORD
*
ret_stream_number
)
{
struct
wg_parser_stream
*
wg_stream
;
...
...
@@ -1865,7 +1909,7 @@ static HRESULT WINAPI reader_GetNextSample(IWMSyncReader2 *iface,
EnterCriticalSection
(
&
reader
->
cs
);
hr
=
wm_reader_get_stream_sample
(
reader
,
NULL
,
stream_number
,
sample
,
pts
,
duration
,
flags
,
&
stream_number
);
hr
=
wm_reader_get_stream_sample
(
reader
,
stream_number
,
sample
,
pts
,
duration
,
flags
,
&
stream_number
);
if
(
output_number
&&
hr
==
S_OK
)
*
output_number
=
stream_number
-
1
;
if
(
ret_stream_number
&&
(
hr
==
S_OK
||
stream_number
))
...
...
@@ -2518,11 +2562,6 @@ static const IWMSyncReader2Vtbl reader_vtbl =
reader_GetAllocateForStream
};
struct
wm_reader
*
wm_reader_from_sync_reader_inner
(
IUnknown
*
iface
)
{
return
impl_from_IUnknown
(
iface
);
}
HRESULT
WINAPI
winegstreamer_create_wm_sync_reader
(
IUnknown
*
outer
,
void
**
out
)
{
struct
wm_reader
*
object
;
...
...
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