Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
131ada05
Commit
131ada05
authored
Sep 16, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winegstreamer: Get rid of the wm_reader_ops callbacks.
Controlling lifetime from the sync / async reader side.
parent
0f25fadb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
141 deletions
+72
-141
gst_private.h
dlls/winegstreamer/gst_private.h
+3
-11
wm_asyncreader.c
dlls/winegstreamer/wm_asyncreader.c
+0
-0
wm_reader.c
dlls/winegstreamer/wm_reader.c
+20
-87
wm_syncreader.c
dlls/winegstreamer/wm_syncreader.c
+49
-43
No files found.
dlls/winegstreamer/gst_private.h
View file @
131ada05
...
...
@@ -168,9 +168,9 @@ struct wm_reader
IWMProfile3
IWMProfile3_iface
;
IWMReaderPlaylistBurn
IWMReaderPlaylistBurn_iface
;
IWMReaderTimecode
IWMReaderTimecode_iface
;
LONG
refcount
;
CRITICAL_SECTION
cs
;
IUnknown
*
outer
;
CRITICAL_SECTION
cs
;
QWORD
start_time
;
IStream
*
source_stream
;
...
...
@@ -181,14 +181,6 @@ struct wm_reader
struct
wm_stream
*
streams
;
WORD
stream_count
;
const
struct
wm_reader_ops
*
ops
;
};
struct
wm_reader_ops
{
void
*
(
*
query_interface
)(
struct
wm_reader
*
reader
,
REFIID
iid
);
void
(
*
destroy
)(
struct
wm_reader
*
reader
);
};
void
wm_reader_cleanup
(
struct
wm_reader
*
reader
);
...
...
@@ -205,7 +197,7 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA
INSSBuffer
**
ret_sample
,
QWORD
*
pts
,
QWORD
*
duration
,
DWORD
*
flags
,
WORD
*
ret_stream_number
);
HRESULT
wm_reader_get_stream_selection
(
struct
wm_reader
*
reader
,
WORD
stream_number
,
WMT_STREAM_SELECTION
*
selection
);
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
);
void
wm_reader_init
(
IUnknown
*
outer
,
struct
wm_reader
*
reader
);
HRESULT
wm_reader_open_file
(
struct
wm_reader
*
reader
,
const
WCHAR
*
filename
);
HRESULT
wm_reader_open_stream
(
struct
wm_reader
*
reader
,
IStream
*
stream
);
void
wm_reader_seek
(
struct
wm_reader
*
reader
,
QWORD
start
,
LONGLONG
duration
);
...
...
dlls/winegstreamer/wm_asyncreader.c
View file @
131ada05
This diff is collapsed.
Click to expand it.
dlls/winegstreamer/wm_reader.c
View file @
131ada05
...
...
@@ -636,70 +636,19 @@ static struct wm_reader *impl_from_IWMProfile3(IWMProfile3 *iface)
static
HRESULT
WINAPI
profile_QueryInterface
(
IWMProfile3
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMProfile3
(
iface
);
TRACE
(
"reader %p, iid %s, out %p.
\n
"
,
reader
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo
)
||
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo2
)
||
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo3
))
{
*
out
=
&
reader
->
IWMHeaderInfo3_iface
;
}
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMLanguageList
))
{
*
out
=
&
reader
->
IWMLanguageList_iface
;
}
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMPacketSize
)
||
IsEqualIID
(
iid
,
&
IID_IWMPacketSize2
))
{
*
out
=
&
reader
->
IWMPacketSize2_iface
;
}
else
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
IsEqualIID
(
iid
,
&
IID_IWMProfile
)
||
IsEqualIID
(
iid
,
&
IID_IWMProfile2
)
||
IsEqualIID
(
iid
,
&
IID_IWMProfile3
))
{
*
out
=
&
reader
->
IWMProfile3_iface
;
}
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMReaderPlaylistBurn
))
{
*
out
=
&
reader
->
IWMReaderPlaylistBurn_iface
;
}
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMReaderTimecode
))
{
*
out
=
&
reader
->
IWMReaderTimecode_iface
;
}
else
if
(
!
(
*
out
=
reader
->
ops
->
query_interface
(
reader
,
iid
)))
{
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
return
S_OK
;
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
profile_AddRef
(
IWMProfile3
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMProfile3
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
reader
->
refcount
);
TRACE
(
"%p increasing refcount to %lu.
\n
"
,
reader
,
refcount
);
return
refcount
;
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
profile_Release
(
IWMProfile3
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMProfile3
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
reader
->
refcount
);
TRACE
(
"%p decreasing refcount to %lu.
\n
"
,
reader
,
refcount
);
if
(
!
refcount
)
reader
->
ops
->
destroy
(
reader
);
return
refcount
;
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
profile_GetVersion
(
IWMProfile3
*
iface
,
WMT_VERSION
*
version
)
...
...
@@ -972,22 +921,19 @@ static struct wm_reader *impl_from_IWMHeaderInfo3(IWMHeaderInfo3 *iface)
static
HRESULT
WINAPI
header_info_QueryInterface
(
IWMHeaderInfo3
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMHeaderInfo3
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
IWMProfile3_iface
,
iid
,
out
);
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
header_info_AddRef
(
IWMHeaderInfo3
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMHeaderInfo3
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
header_info_Release
(
IWMHeaderInfo3
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMHeaderInfo3
(
iface
);
return
IWMProfile3_Release
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
header_info_GetAttributeCount
(
IWMHeaderInfo3
*
iface
,
WORD
stream_number
,
WORD
*
count
)
...
...
@@ -1237,22 +1183,19 @@ static struct wm_reader *impl_from_IWMLanguageList(IWMLanguageList *iface)
static
HRESULT
WINAPI
language_list_QueryInterface
(
IWMLanguageList
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMLanguageList
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
IWMProfile3_iface
,
iid
,
out
);
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
language_list_AddRef
(
IWMLanguageList
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMLanguageList
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
language_list_Release
(
IWMLanguageList
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMLanguageList
(
iface
);
return
IWMProfile3_Release
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
language_list_GetLanguageCount
(
IWMLanguageList
*
iface
,
WORD
*
count
)
...
...
@@ -1293,22 +1236,19 @@ static struct wm_reader *impl_from_IWMPacketSize2(IWMPacketSize2 *iface)
static
HRESULT
WINAPI
packet_size_QueryInterface
(
IWMPacketSize2
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMPacketSize2
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
IWMProfile3_iface
,
iid
,
out
);
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
packet_size_AddRef
(
IWMPacketSize2
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMPacketSize2
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
packet_size_Release
(
IWMPacketSize2
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMPacketSize2
(
iface
);
return
IWMProfile3_Release
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
packet_size_GetMaxPacketSize
(
IWMPacketSize2
*
iface
,
DWORD
*
size
)
...
...
@@ -1354,22 +1294,19 @@ static struct wm_reader *impl_from_IWMReaderPlaylistBurn(IWMReaderPlaylistBurn *
static
HRESULT
WINAPI
playlist_QueryInterface
(
IWMReaderPlaylistBurn
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderPlaylistBurn
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
IWMProfile3_iface
,
iid
,
out
);
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
playlist_AddRef
(
IWMReaderPlaylistBurn
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderPlaylistBurn
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
playlist_Release
(
IWMReaderPlaylistBurn
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderPlaylistBurn
(
iface
);
return
IWMProfile3_Release
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
playlist_InitPlaylistBurn
(
IWMReaderPlaylistBurn
*
iface
,
DWORD
count
,
...
...
@@ -1417,22 +1354,19 @@ static struct wm_reader *impl_from_IWMReaderTimecode(IWMReaderTimecode *iface)
static
HRESULT
WINAPI
timecode_QueryInterface
(
IWMReaderTimecode
*
iface
,
REFIID
iid
,
void
**
out
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderTimecode
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
IWMProfile3_iface
,
iid
,
out
);
return
IUnknown_QueryInterface
(
reader
->
outer
,
iid
,
out
);
}
static
ULONG
WINAPI
timecode_AddRef
(
IWMReaderTimecode
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderTimecode
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_AddRef
(
reader
->
outer
);
}
static
ULONG
WINAPI
timecode_Release
(
IWMReaderTimecode
*
iface
)
{
struct
wm_reader
*
reader
=
impl_from_IWMReaderTimecode
(
iface
);
return
IWMProfile3_Release
(
&
reader
->
IWMProfile3_iface
);
return
IUnknown_Release
(
reader
->
outer
);
}
static
HRESULT
WINAPI
timecode_GetTimecodeRangeCount
(
IWMReaderTimecode
*
iface
,
...
...
@@ -2205,7 +2139,7 @@ HRESULT wm_reader_get_max_stream_size(struct wm_reader *reader, WORD stream_numb
return
S_OK
;
}
void
wm_reader_init
(
struct
wm_reader
*
reader
,
const
struct
wm_reader_ops
*
ops
)
void
wm_reader_init
(
IUnknown
*
outer
,
struct
wm_reader
*
reader
)
{
reader
->
IWMHeaderInfo3_iface
.
lpVtbl
=
&
header_info_vtbl
;
reader
->
IWMLanguageList_iface
.
lpVtbl
=
&
language_list_vtbl
;
...
...
@@ -2213,8 +2147,7 @@ void wm_reader_init(struct wm_reader *reader, const struct wm_reader_ops *ops)
reader
->
IWMProfile3_iface
.
lpVtbl
=
&
profile_vtbl
;
reader
->
IWMReaderPlaylistBurn_iface
.
lpVtbl
=
&
playlist_vtbl
;
reader
->
IWMReaderTimecode_iface
.
lpVtbl
=
&
timecode_vtbl
;
reader
->
refcount
=
1
;
reader
->
ops
=
ops
;
reader
->
outer
=
outer
;
InitializeCriticalSection
(
&
reader
->
cs
);
reader
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": wm_reader.cs"
);
...
...
dlls/winegstreamer/wm_syncreader.c
View file @
131ada05
...
...
@@ -22,9 +22,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore);
struct
sync_reader
{
struct
wm_reader
reader
;
IWMSyncReader2
IWMSyncReader2_iface
;
struct
wm_reader
reader
;
LONG
refcount
;
};
static
struct
sync_reader
*
impl_from_IWMSyncReader2
(
IWMSyncReader2
*
iface
)
...
...
@@ -36,21 +36,62 @@ static HRESULT WINAPI WMSyncReader_QueryInterface(IWMSyncReader2 *iface, REFIID
{
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
return
IWMProfile3_QueryInterface
(
&
reader
->
reader
.
IWMProfile3_iface
,
iid
,
out
);
TRACE
(
"reader %p, iid %s, out %p.
\n
"
,
reader
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualIID
(
iid
,
&
IID_IUnknown
)
||
IsEqualIID
(
iid
,
&
IID_IWMSyncReader
)
||
IsEqualIID
(
iid
,
&
IID_IWMSyncReader2
))
*
out
=
&
reader
->
IWMSyncReader2_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo
)
||
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo2
)
||
IsEqualIID
(
iid
,
&
IID_IWMHeaderInfo3
))
*
out
=
&
reader
->
reader
.
IWMHeaderInfo3_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMLanguageList
))
*
out
=
&
reader
->
reader
.
IWMLanguageList_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMPacketSize
)
||
IsEqualIID
(
iid
,
&
IID_IWMPacketSize2
))
*
out
=
&
reader
->
reader
.
IWMPacketSize2_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMProfile
)
||
IsEqualIID
(
iid
,
&
IID_IWMProfile2
)
||
IsEqualIID
(
iid
,
&
IID_IWMProfile3
))
*
out
=
&
reader
->
reader
.
IWMProfile3_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMReaderPlaylistBurn
))
*
out
=
&
reader
->
reader
.
IWMReaderPlaylistBurn_iface
;
else
if
(
IsEqualIID
(
iid
,
&
IID_IWMReaderTimecode
))
*
out
=
&
reader
->
reader
.
IWMReaderTimecode_iface
;
else
{
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
iid
));
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
out
);
return
S_OK
;
}
static
ULONG
WINAPI
WMSyncReader_AddRef
(
IWMSyncReader2
*
iface
)
{
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
return
IWMProfile3_AddRef
(
&
reader
->
reader
.
IWMProfile3_iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
reader
->
refcount
);
TRACE
(
"%p increasing refcount to %lu.
\n
"
,
reader
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
WMSyncReader_Release
(
IWMSyncReader2
*
iface
)
{
struct
sync_reader
*
reader
=
impl_from_IWMSyncReader2
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
reader
->
refcount
);
TRACE
(
"%p decreasing refcount to %lu.
\n
"
,
reader
,
refcount
);
return
IWMProfile3_Release
(
&
reader
->
reader
.
IWMProfile3_iface
);
if
(
!
refcount
)
{
wm_reader_close
(
&
reader
->
reader
);
wm_reader_cleanup
(
&
reader
->
reader
);
free
(
reader
);
}
return
refcount
;
}
static
HRESULT
WINAPI
WMSyncReader_Close
(
IWMSyncReader2
*
iface
)
...
...
@@ -363,41 +404,6 @@ static const IWMSyncReader2Vtbl WMSyncReader2Vtbl = {
WMSyncReader2_GetAllocateForStream
};
static
struct
sync_reader
*
impl_from_wm_reader
(
struct
wm_reader
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
sync_reader
,
reader
);
}
static
void
*
sync_reader_query_interface
(
struct
wm_reader
*
iface
,
REFIID
iid
)
{
struct
sync_reader
*
reader
=
impl_from_wm_reader
(
iface
);
TRACE
(
"reader %p, iid %s.
\n
"
,
reader
,
debugstr_guid
(
iid
));
if
(
IsEqualIID
(
iid
,
&
IID_IWMSyncReader
)
||
IsEqualIID
(
iid
,
&
IID_IWMSyncReader2
))
return
&
reader
->
IWMSyncReader2_iface
;
return
NULL
;
}
static
void
sync_reader_destroy
(
struct
wm_reader
*
iface
)
{
struct
sync_reader
*
reader
=
impl_from_wm_reader
(
iface
);
TRACE
(
"reader %p.
\n
"
,
reader
);
wm_reader_close
(
&
reader
->
reader
);
wm_reader_cleanup
(
&
reader
->
reader
);
free
(
reader
);
}
static
const
struct
wm_reader_ops
sync_reader_ops
=
{
.
query_interface
=
sync_reader_query_interface
,
.
destroy
=
sync_reader_destroy
,
};
HRESULT
WINAPI
winegstreamer_create_wm_sync_reader
(
IWMSyncReader
**
reader
)
{
struct
sync_reader
*
object
;
...
...
@@ -407,9 +413,9 @@ HRESULT WINAPI winegstreamer_create_wm_sync_reader(IWMSyncReader **reader)
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
wm_reader_init
(
&
object
->
reader
,
&
sync_reader_ops
);
object
->
IWMSyncReader2_iface
.
lpVtbl
=
&
WMSyncReader2Vtbl
;
wm_reader_init
((
IUnknown
*
)
&
object
->
IWMSyncReader2_iface
,
&
object
->
reader
);
object
->
refcount
=
1
;
TRACE
(
"Created sync reader %p.
\n
"
,
object
);
*
reader
=
(
IWMSyncReader
*
)
&
object
->
IWMSyncReader2_iface
;
...
...
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