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
42c82012
Commit
42c82012
authored
Nov 02, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMReaderAdvanced2::OpenStream().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4398e8ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
19 deletions
+60
-19
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+50
-8
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+10
-11
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
42c82012
...
...
@@ -31,8 +31,20 @@ struct async_reader
IWMReaderStreamClock
IWMReaderStreamClock_iface
;
IWMReaderTypeNegotiation
IWMReaderTypeNegotiation_iface
;
IReferenceClock
IReferenceClock_iface
;
IWMReaderCallback
*
callback
;
void
*
context
;
};
static
void
open_stream
(
struct
async_reader
*
reader
,
IWMReaderCallback
*
callback
,
void
*
context
)
{
static
const
DWORD
zero
;
IWMReaderCallback_AddRef
(
reader
->
callback
=
callback
);
reader
->
context
=
context
;
IWMReaderCallback_OnStatus
(
callback
,
WMT_OPENED
,
S_OK
,
WMT_TYPE_DWORD
,
(
BYTE
*
)
&
zero
,
context
);
}
static
struct
async_reader
*
impl_from_IWMReader
(
IWMReader
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
async_reader
,
IWMReader_iface
);
...
...
@@ -68,9 +80,26 @@ static HRESULT WINAPI WMReader_Open(IWMReader *iface, const WCHAR *url, IWMReade
static
HRESULT
WINAPI
WMReader_Close
(
IWMReader
*
iface
)
{
struct
async_reader
*
This
=
impl_from_IWMReader
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
struct
async_reader
*
reader
=
impl_from_IWMReader
(
iface
);
static
const
DWORD
zero
;
HRESULT
hr
;
TRACE
(
"reader %p.
\n
"
,
reader
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
hr
=
wm_reader_close
(
&
reader
->
reader
);
if
(
reader
->
callback
)
{
IWMReaderCallback_OnStatus
(
reader
->
callback
,
WMT_CLOSED
,
S_OK
,
WMT_TYPE_DWORD
,
(
BYTE
*
)
&
zero
,
reader
->
context
);
IWMReaderCallback_Release
(
reader
->
callback
);
}
reader
->
callback
=
NULL
;
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
return
hr
;
}
static
HRESULT
WINAPI
WMReader_GetOutputCount
(
IWMReader
*
iface
,
DWORD
*
outputs
)
...
...
@@ -427,12 +456,21 @@ static HRESULT WINAPI WMReaderAdvanced2_StopBuffering(IWMReaderAdvanced6 *iface)
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
WMReaderAdvanced2_OpenStream
(
IWMReaderAdvanced6
*
iface
,
IStream
*
stream
,
IWMReaderCallback
*
callback
,
void
*
context
)
static
HRESULT
WINAPI
WMReaderAdvanced2_OpenStream
(
IWMReaderAdvanced6
*
iface
,
I
Stream
*
stream
,
I
WMReaderCallback
*
callback
,
void
*
context
)
{
struct
async_reader
*
This
=
impl_from_IWMReaderAdvanced6
(
iface
);
FIXME
(
"(%p)->(%p %p %p)
\n
"
,
This
,
stream
,
callback
,
context
);
return
E_NOTIMPL
;
struct
async_reader
*
reader
=
impl_from_IWMReaderAdvanced6
(
iface
);
HRESULT
hr
;
TRACE
(
"reader %p, stream %p, callback %p, context %p.
\n
"
,
reader
,
stream
,
callback
,
context
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
if
(
SUCCEEDED
(
hr
=
wm_reader_open_stream
(
&
reader
->
reader
,
stream
)))
open_stream
(
reader
,
callback
,
context
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
return
hr
;
}
static
HRESULT
WINAPI
WMReaderAdvanced3_StopNetStreaming
(
IWMReaderAdvanced6
*
iface
)
...
...
@@ -1256,6 +1294,10 @@ static void async_reader_destroy(struct wm_reader *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
wm_reader_close
(
&
reader
->
reader
);
if
(
reader
->
callback
)
IWMReaderCallback_Release
(
reader
->
callback
);
wm_reader_cleanup
(
&
reader
->
reader
);
free
(
reader
);
}
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
42c82012
...
...
@@ -1255,9 +1255,7 @@ static void test_async_reader_streaming(void)
IWMReader_QueryInterface
(
reader
,
&
IID_IWMReaderAdvanced2
,
(
void
**
)
&
advanced
);
hr
=
IWMReaderAdvanced2_OpenStream
(
advanced
,
&
stream
.
IStream_iface
,
&
callback
.
IWMReaderCallback_iface
,
(
void
**
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
out
;
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
callback
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
callback
.
refcount
);
ret
=
WaitForSingleObject
(
callback
.
got_opened
,
1000
);
...
...
@@ -1315,19 +1313,18 @@ static void test_async_reader_streaming(void)
test_reader_attributes
(
profile
);
hr
=
IWMReader_Close
(
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
callback
.
got_closed
==
1
,
"Got %u WMT_CLOSED callbacks.
\n
"
,
callback
.
got_closed
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
callback
.
got_closed
==
1
,
"Got %u WMT_CLOSED callbacks.
\n
"
,
callback
.
got_closed
);
ok
(
callback
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
callback
.
refcount
);
callback_cleanup
(
&
callback
);
out:
ok
(
stream
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
stream
.
refcount
);
CloseHandle
(
stream
.
file
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete %s, error %u.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
hr
=
IWMReader_Close
(
reader
);
todo_wine
ok
(
hr
==
NS_E_INVALID_REQUEST
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
NS_E_INVALID_REQUEST
,
"Got hr %#x.
\n
"
,
hr
);
IWMReaderAdvanced2_Release
(
advanced
);
IWMProfile_Release
(
profile
);
...
...
@@ -1368,9 +1365,7 @@ static void test_async_reader_types(void)
IWMReader_QueryInterface
(
reader
,
&
IID_IWMReaderAdvanced2
,
(
void
**
)
&
advanced
);
hr
=
IWMReaderAdvanced2_OpenStream
(
advanced
,
&
stream
.
IStream_iface
,
&
callback
.
IWMReaderCallback_iface
,
(
void
**
)
0xdeadbeef
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
out
;
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
callback
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
callback
.
refcount
);
ret
=
WaitForSingleObject
(
callback
.
got_opened
,
1000
);
...
...
@@ -1403,6 +1398,11 @@ static void test_async_reader_types(void)
hr
=
IWMReader_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
;
}
ret_size
=
sizeof
(
mt_buffer
);
hr
=
IWMOutputMediaProps_GetMediaType
(
output_props
,
mt
,
&
ret_size
);
...
...
@@ -1564,7 +1564,6 @@ static void test_async_reader_types(void)
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
output_props
==
(
void
*
)
0xdeadbeef
,
"Got output props %p.
\n
"
,
output_props
);
out:
IWMReaderAdvanced2_Release
(
advanced
);
IWMProfile_Release
(
profile
);
ref
=
IWMReader_Release
(
reader
);
...
...
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