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
17da8aa9
Commit
17da8aa9
authored
Aug 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite/writer: Implement GetServiceForStream().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
764bcdb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
2 deletions
+50
-2
writer.c
dlls/mfreadwrite/writer.c
+50
-2
No files found.
dlls/mfreadwrite/writer.c
View file @
17da8aa9
...
...
@@ -39,6 +39,7 @@ enum writer_state
struct
stream
{
IMFStreamSink
*
stream_sink
;
IMFTransform
*
encoder
;
};
struct
sink_writer
...
...
@@ -119,6 +120,8 @@ static ULONG WINAPI sink_writer_Release(IMFSinkWriter *iface)
if
(
stream
->
stream_sink
)
IMFStreamSink_Release
(
stream
->
stream_sink
);
if
(
stream
->
encoder
)
IMFTransform_Release
(
stream
->
encoder
);
}
DeleteCriticalSection
(
&
writer
->
cs
);
free
(
writer
);
...
...
@@ -248,6 +251,12 @@ static HRESULT WINAPI sink_writer_BeginWriting(IMFSinkWriter *iface)
return
hr
;
}
static
struct
stream
*
sink_writer_get_stream
(
const
struct
sink_writer
*
writer
,
DWORD
index
)
{
if
(
index
>=
writer
->
streams
.
count
)
return
NULL
;
return
&
writer
->
streams
.
items
[
index
];
}
static
HRESULT
WINAPI
sink_writer_WriteSample
(
IMFSinkWriter
*
iface
,
DWORD
index
,
IMFSample
*
sample
)
{
FIXME
(
"%p, %lu, %p.
\n
"
,
iface
,
index
,
sample
);
...
...
@@ -290,12 +299,51 @@ static HRESULT WINAPI sink_writer_Finalize(IMFSinkWriter *iface)
return
E_NOTIMPL
;
}
static
HRESULT
sink_writer_get_service
(
void
*
object
,
REFGUID
service
,
REFIID
riid
,
void
**
ret
)
{
IUnknown
*
iface
=
object
;
IMFGetService
*
gs
;
HRESULT
hr
;
if
(
!
iface
)
return
MF_E_UNSUPPORTED_SERVICE
;
if
(
IsEqualGUID
(
service
,
&
GUID_NULL
))
return
IUnknown_QueryInterface
(
iface
,
riid
,
ret
);
if
(
FAILED
(
hr
=
IUnknown_QueryInterface
(
iface
,
&
IID_IMFGetService
,
(
void
**
)
&
gs
)))
return
hr
;
hr
=
IMFGetService_GetService
(
gs
,
service
,
riid
,
ret
);
IMFGetService_Release
(
gs
);
return
hr
;
}
static
HRESULT
WINAPI
sink_writer_GetServiceForStream
(
IMFSinkWriter
*
iface
,
DWORD
index
,
REFGUID
service
,
REFIID
riid
,
void
**
object
)
{
FIXME
(
"%p, %lu, %s, %s, %p.
\n
"
,
iface
,
index
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
object
);
struct
sink_writer
*
writer
=
impl_from_IMFSinkWriter
(
iface
);
HRESULT
hr
=
E_UNEXPECTED
;
struct
stream
*
stream
;
return
E_NOTIMPL
;
TRACE
(
"%p, %lu, %s, %s, %p.
\n
"
,
iface
,
index
,
debugstr_guid
(
service
),
debugstr_guid
(
riid
),
object
);
EnterCriticalSection
(
&
writer
->
cs
);
if
(
index
==
MF_SINK_WRITER_MEDIASINK
)
hr
=
sink_writer_get_service
(
writer
->
sink
,
service
,
riid
,
object
);
else
if
((
stream
=
sink_writer_get_stream
(
writer
,
index
)))
{
if
(
stream
->
encoder
)
hr
=
sink_writer_get_service
(
stream
->
encoder
,
service
,
riid
,
object
);
if
(
FAILED
(
hr
))
hr
=
sink_writer_get_service
(
stream
->
stream_sink
,
service
,
riid
,
object
);
}
else
hr
=
MF_E_INVALIDSTREAMNUMBER
;
LeaveCriticalSection
(
&
writer
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
sink_writer_GetStatistics
(
IMFSinkWriter
*
iface
,
DWORD
index
,
MF_SINK_WRITER_STATISTICS
*
stats
)
...
...
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