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
fca2f6c1
Commit
fca2f6c1
authored
Nov 08, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Implement IWMReader::Open().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
63fb4d82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
4 deletions
+64
-4
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+15
-4
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+49
-0
No files found.
dlls/winegstreamer/wm_asyncreader.c
View file @
fca2f6c1
...
...
@@ -188,11 +188,22 @@ static ULONG WINAPI WMReader_Release(IWMReader *iface)
return
IWMProfile3_Release
(
&
reader
->
reader
.
IWMProfile3_iface
);
}
static
HRESULT
WINAPI
WMReader_Open
(
IWMReader
*
iface
,
const
WCHAR
*
url
,
IWMReaderCallback
*
callback
,
void
*
context
)
static
HRESULT
WINAPI
WMReader_Open
(
IWMReader
*
iface
,
const
WCHAR
*
url
,
IWMReaderCallback
*
callback
,
void
*
context
)
{
struct
async_reader
*
This
=
impl_from_IWMReader
(
iface
);
FIXME
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
url
),
callback
,
context
);
return
E_NOTIMPL
;
struct
async_reader
*
reader
=
impl_from_IWMReader
(
iface
);
HRESULT
hr
;
TRACE
(
"reader %p, url %s, callback %p, context %p.
\n
"
,
reader
,
debugstr_w
(
url
),
callback
,
context
);
EnterCriticalSection
(
&
reader
->
reader
.
cs
);
if
(
SUCCEEDED
(
hr
=
wm_reader_open_file
(
&
reader
->
reader
,
url
)))
open_stream
(
reader
,
callback
,
context
);
LeaveCriticalSection
(
&
reader
->
reader
.
cs
);
return
hr
;
}
static
HRESULT
WINAPI
WMReader_Close
(
IWMReader
*
iface
)
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
fca2f6c1
...
...
@@ -1613,6 +1613,54 @@ static void test_async_reader_types(void)
ok
(
ret
,
"Failed to delete %s, error %u.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
}
static
void
test_async_reader_file
(
void
)
{
const
WCHAR
*
filename
=
load_resource
(
L"test.wmv"
);
struct
callback
callback
;
IWMReader
*
reader
;
DWORD
count
;
HRESULT
hr
;
ULONG
ref
;
BOOL
ret
;
callback_init
(
&
callback
);
hr
=
WMCreateReader
(
NULL
,
0
,
&
reader
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMReader_Open
(
reader
,
filename
,
&
callback
.
IWMReaderCallback_iface
,
(
void
**
)
0xdeadbeef
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
callback
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
callback
.
refcount
);
ret
=
WaitForSingleObject
(
callback
.
got_opened
,
1000
);
ok
(
!
ret
,
"Wait timed out.
\n
"
);
count
=
0xdeadbeef
;
hr
=
IWMReader_GetOutputCount
(
reader
,
&
count
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
count
==
2
,
"Got count %u.
\n
"
,
count
);
hr
=
IWMReader_Start
(
reader
,
0
,
0
,
1
.
0
f
,
(
void
*
)
0xfacade
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMReader_Close
(
reader
);
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
);
hr
=
IWMReader_Close
(
reader
);
ok
(
hr
==
NS_E_INVALID_REQUEST
,
"Got hr %#x.
\n
"
,
hr
);
ref
=
IWMReader_Release
(
reader
);
ok
(
!
ref
,
"Got outstanding refcount %d.
\n
"
,
ref
);
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
);
ret
=
DeleteFileW
(
filename
);
ok
(
ret
,
"Failed to delete %s, error %u.
\n
"
,
debugstr_w
(
filename
),
GetLastError
());
}
START_TEST
(
wmvcore
)
{
HRESULT
hr
;
...
...
@@ -1634,6 +1682,7 @@ START_TEST(wmvcore)
test_sync_reader_file
();
test_async_reader_streaming
();
test_async_reader_types
();
test_async_reader_file
();
CoUninitialize
();
}
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