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
c76418fb
Commit
c76418fb
authored
Oct 25, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Add a basic implementation of IWMSyncReader::OpenStream().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b51bfccd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
11 deletions
+62
-11
gst_private.h
dlls/winegstreamer/gst_private.h
+6
-0
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+2
-0
wm_reader.c
dlls/winegstreamer/wm_reader.c
+37
-0
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+12
-6
wmvcore.c
dlls/wmvcore/tests/wmvcore.c
+5
-5
No files found.
dlls/winegstreamer/gst_private.h
View file @
c76418fb
...
@@ -122,6 +122,9 @@ struct wm_reader
...
@@ -122,6 +122,9 @@ struct wm_reader
IWMReaderPlaylistBurn
IWMReaderPlaylistBurn_iface
;
IWMReaderPlaylistBurn
IWMReaderPlaylistBurn_iface
;
IWMReaderTimecode
IWMReaderTimecode_iface
;
IWMReaderTimecode
IWMReaderTimecode_iface
;
LONG
refcount
;
LONG
refcount
;
CRITICAL_SECTION
cs
;
IStream
*
source_stream
;
const
struct
wm_reader_ops
*
ops
;
const
struct
wm_reader_ops
*
ops
;
};
};
...
@@ -132,6 +135,9 @@ struct wm_reader_ops
...
@@ -132,6 +135,9 @@ struct wm_reader_ops
void
(
*
destroy
)(
struct
wm_reader
*
reader
);
void
(
*
destroy
)(
struct
wm_reader
*
reader
);
};
};
void
wm_reader_cleanup
(
struct
wm_reader
*
reader
);
HRESULT
wm_reader_close
(
struct
wm_reader
*
reader
);
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
);
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
);
HRESULT
wm_reader_open_stream
(
struct
wm_reader
*
reader
,
IStream
*
stream
);
#endif
/* __GST_PRIVATE_INCLUDED__ */
#endif
/* __GST_PRIVATE_INCLUDED__ */
dlls/winegstreamer/wm_asyncreader.c
View file @
c76418fb
...
@@ -1255,6 +1255,8 @@ static void async_reader_destroy(struct wm_reader *iface)
...
@@ -1255,6 +1255,8 @@ static void async_reader_destroy(struct wm_reader *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
TRACE
(
"reader %p.
\n
"
,
reader
);
wm_reader_close
(
&
reader
->
reader
);
wm_reader_cleanup
(
&
reader
->
reader
);
free
(
reader
);
free
(
reader
);
}
}
...
...
dlls/winegstreamer/wm_reader.c
View file @
c76418fb
...
@@ -759,6 +759,34 @@ static const IWMReaderTimecodeVtbl timecode_vtbl =
...
@@ -759,6 +759,34 @@ static const IWMReaderTimecodeVtbl timecode_vtbl =
timecode_GetTimecodeRangeBounds
,
timecode_GetTimecodeRangeBounds
,
};
};
HRESULT
wm_reader_open_stream
(
struct
wm_reader
*
reader
,
IStream
*
stream
)
{
EnterCriticalSection
(
&
reader
->
cs
);
IStream_AddRef
(
reader
->
source_stream
=
stream
);
LeaveCriticalSection
(
&
reader
->
cs
);
return
S_OK
;
}
HRESULT
wm_reader_close
(
struct
wm_reader
*
reader
)
{
EnterCriticalSection
(
&
reader
->
cs
);
if
(
!
reader
->
source_stream
)
{
LeaveCriticalSection
(
&
reader
->
cs
);
return
NS_E_INVALID_REQUEST
;
}
IStream_Release
(
reader
->
source_stream
);
reader
->
source_stream
=
NULL
;
LeaveCriticalSection
(
&
reader
->
cs
);
return
S_OK
;
}
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
)
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
)
{
{
reader
->
IWMHeaderInfo3_iface
.
lpVtbl
=
&
header_info_vtbl
;
reader
->
IWMHeaderInfo3_iface
.
lpVtbl
=
&
header_info_vtbl
;
...
@@ -769,4 +797,13 @@ void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
...
@@ -769,4 +797,13 @@ void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
reader
->
IWMReaderTimecode_iface
.
lpVtbl
=
&
timecode_vtbl
;
reader
->
IWMReaderTimecode_iface
.
lpVtbl
=
&
timecode_vtbl
;
reader
->
refcount
=
1
;
reader
->
refcount
=
1
;
reader
->
ops
=
ops
;
reader
->
ops
=
ops
;
InitializeCriticalSection
(
&
reader
->
cs
);
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": wm_reader.cs"
);
}
void
wm_reader_cleanup
(
struct
wm_reader
*
reader
)
{
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
reader
->
cs
);
}
}
dlls/winegstreamer/wm_syncreader.c
View file @
c76418fb
...
@@ -55,9 +55,11 @@ static ULONG WINAPI WMSyncReader_Release(IWMSyncReader2 *iface)
...
@@ -55,9 +55,11 @@ static ULONG WINAPI WMSyncReader_Release(IWMSyncReader2 *iface)
static
HRESULT
WINAPI
WMSyncReader_Close
(
IWMSyncReader2
*
iface
)
static
HRESULT
WINAPI
WMSyncReader_Close
(
IWMSyncReader2
*
iface
)
{
{
struct
sync_reader
*
This
=
impl_from_IWMSyncReader2
(
iface
);
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
FIXME
(
"(%p): stub!
\n
"
,
This
);
return
E_NOTIMPL
;
TRACE
(
"reader %p.
\n
"
,
reader
);
return
wm_reader_close
(
&
reader
->
reader
);
}
}
static
HRESULT
WINAPI
WMSyncReader_GetMaxOutputSampleSize
(
IWMSyncReader2
*
iface
,
DWORD
output
,
DWORD
*
max
)
static
HRESULT
WINAPI
WMSyncReader_GetMaxOutputSampleSize
(
IWMSyncReader2
*
iface
,
DWORD
output
,
DWORD
*
max
)
...
@@ -157,9 +159,11 @@ static HRESULT WINAPI WMSyncReader_Open(IWMSyncReader2 *iface, const WCHAR *file
...
@@ -157,9 +159,11 @@ static HRESULT WINAPI WMSyncReader_Open(IWMSyncReader2 *iface, const WCHAR *file
static
HRESULT
WINAPI
WMSyncReader_OpenStream
(
IWMSyncReader2
*
iface
,
IStream
*
stream
)
static
HRESULT
WINAPI
WMSyncReader_OpenStream
(
IWMSyncReader2
*
iface
,
IStream
*
stream
)
{
{
struct
sync_reader
*
This
=
impl_from_IWMSyncReader2
(
iface
);
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
FIXME
(
"(%p)->(%p): stub!
\n
"
,
This
,
stream
);
return
S_OK
;
TRACE
(
"reader %p, stream %p.
\n
"
,
reader
,
stream
);
return
wm_reader_open_stream
(
&
reader
->
reader
,
stream
);
}
}
static
HRESULT
WINAPI
WMSyncReader_SetOutputProps
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
IWMOutputMediaProps
*
output
)
static
HRESULT
WINAPI
WMSyncReader_SetOutputProps
(
IWMSyncReader2
*
iface
,
DWORD
output_num
,
IWMOutputMediaProps
*
output
)
...
@@ -309,6 +313,8 @@ static void sync_reader_destroy(struct wm_reader *iface)
...
@@ -309,6 +313,8 @@ static void sync_reader_destroy(struct wm_reader *iface)
TRACE
(
"reader %p.
\n
"
,
reader
);
TRACE
(
"reader %p.
\n
"
,
reader
);
wm_reader_close
(
&
reader
->
reader
);
wm_reader_cleanup
(
&
reader
->
reader
);
free
(
reader
);
free
(
reader
);
}
}
...
...
dlls/wmvcore/tests/wmvcore.c
View file @
c76418fb
...
@@ -451,7 +451,7 @@ static void test_sync_reader_streaming(void)
...
@@ -451,7 +451,7 @@ static void test_sync_reader_streaming(void)
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
hr
=
IWMProfile_GetStreamCount
(
profile
,
NULL
);
hr
=
IWMProfile_GetStreamCount
(
profile
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
...
@@ -603,17 +603,17 @@ static void test_sync_reader_streaming(void)
...
@@ -603,17 +603,17 @@ static void test_sync_reader_streaming(void)
todo_wine
ok
(
hr
==
NS_E_NO_MORE_SAMPLES
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
hr
==
NS_E_NO_MORE_SAMPLES
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMSyncReader_Close
(
reader
);
hr
=
IWMSyncReader_Close
(
reader
);
todo_wine
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IWMSyncReader_Close
(
reader
);
hr
=
IWMSyncReader_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
);
ok
(
stream
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
stream
.
refcount
==
1
,
"Got outstanding refcount %d.
\n
"
,
stream
.
refcount
);
SetFilePointer
(
stream
.
file
,
0
,
NULL
,
FILE_BEGIN
);
SetFilePointer
(
stream
.
file
,
0
,
NULL
,
FILE_BEGIN
);
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
IWMProfile_Release
(
profile
);
IWMProfile_Release
(
profile
);
ref
=
IWMSyncReader_Release
(
reader
);
ref
=
IWMSyncReader_Release
(
reader
);
...
@@ -692,7 +692,7 @@ static void test_sync_reader_types(void)
...
@@ -692,7 +692,7 @@ static void test_sync_reader_types(void)
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
hr
=
IWMSyncReader_OpenStream
(
reader
,
&
stream
.
IStream_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
ok
(
stream
.
refcount
>
1
,
"Got refcount %d.
\n
"
,
stream
.
refcount
);
for
(
i
=
0
;
i
<
2
;
++
i
)
for
(
i
=
0
;
i
<
2
;
++
i
)
{
{
...
...
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