mfreadwrite: Use source resolver when creating reader from bytestream.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
61f76829f4
commit
95ab51105b
|
@ -1,6 +1,6 @@
|
||||||
MODULE = mfreadwrite.dll
|
MODULE = mfreadwrite.dll
|
||||||
IMPORTLIB = mfreadwrite
|
IMPORTLIB = mfreadwrite
|
||||||
IMPORTS = mfuuid uuid
|
IMPORTS = mfuuid uuid mfplat
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
main.c
|
main.c
|
||||||
|
|
|
@ -254,9 +254,23 @@ static HRESULT create_source_reader_from_source(IMFMediaSource *source, IMFAttri
|
||||||
static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttributes *attributes,
|
static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttributes *attributes,
|
||||||
REFIID riid, void **out)
|
REFIID riid, void **out)
|
||||||
{
|
{
|
||||||
/* FIXME: resolve bytestream to media source */
|
IMFSourceResolver *resolver;
|
||||||
|
MF_OBJECT_TYPE obj_type;
|
||||||
|
IMFMediaSource *source;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
return create_source_reader_from_source(NULL, attributes, riid, out);
|
if (FAILED(hr = MFCreateSourceResolver(&resolver)))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
hr = IMFSourceResolver_CreateObjectFromByteStream(resolver, stream, NULL, MF_RESOLUTION_MEDIASOURCE, NULL,
|
||||||
|
&obj_type, (IUnknown **)&source);
|
||||||
|
IMFSourceResolver_Release(resolver);
|
||||||
|
if (FAILED(hr))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
hr = create_source_reader_from_source(source, attributes, riid, out);
|
||||||
|
IMFMediaSource_Release(source);
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI sink_writer_QueryInterface(IMFSinkWriter *iface, REFIID riid, void **out)
|
static HRESULT WINAPI sink_writer_QueryInterface(IMFSinkWriter *iface, REFIID riid, void **out)
|
||||||
|
|
Loading…
Reference in New Issue