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
9bf4db13
Commit
9bf4db13
authored
Mar 12, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Implement MFCreateSourceReaderFromURL().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
95ab5110
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
2 deletions
+61
-2
main.c
dlls/mfreadwrite/main.c
+59
-1
mfreadwrite.spec
dlls/mfreadwrite/mfreadwrite.spec
+1
-1
mfreadwrite.idl
include/mfreadwrite.idl
+1
-0
No files found.
dlls/mfreadwrite/main.c
View file @
9bf4db13
...
...
@@ -273,6 +273,47 @@ static HRESULT create_source_reader_from_stream(IMFByteStream *stream, IMFAttrib
return
hr
;
}
static
HRESULT
create_source_reader_from_url
(
const
WCHAR
*
url
,
IMFAttributes
*
attributes
,
REFIID
riid
,
void
**
out
)
{
IMFSourceResolver
*
resolver
;
IUnknown
*
object
=
NULL
;
MF_OBJECT_TYPE
obj_type
;
IMFMediaSource
*
source
;
HRESULT
hr
;
if
(
FAILED
(
hr
=
MFCreateSourceResolver
(
&
resolver
)))
return
hr
;
hr
=
IMFSourceResolver_CreateObjectFromURL
(
resolver
,
url
,
MF_RESOLUTION_MEDIASOURCE
,
NULL
,
&
obj_type
,
(
IUnknown
**
)
&
object
);
if
(
SUCCEEDED
(
hr
))
{
switch
(
obj_type
)
{
case
MF_OBJECT_BYTESTREAM
:
hr
=
IMFSourceResolver_CreateObjectFromByteStream
(
resolver
,
(
IMFByteStream
*
)
object
,
NULL
,
MF_RESOLUTION_MEDIASOURCE
,
NULL
,
&
obj_type
,
(
IUnknown
**
)
&
source
);
break
;
case
MF_OBJECT_MEDIASOURCE
:
source
=
(
IMFMediaSource
*
)
object
;
IMFMediaSource_AddRef
(
source
);
break
;
default:
WARN
(
"Unknown object type %d.
\n
"
,
obj_type
);
hr
=
E_UNEXPECTED
;
}
IUnknown_Release
(
object
);
}
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
)
{
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
...
...
@@ -480,6 +521,16 @@ HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAt
return
create_source_reader_from_source
(
source
,
attributes
,
&
IID_IMFSourceReader
,
(
void
**
)
reader
);
}
/***********************************************************************
* MFCreateSourceReaderFromURL (mfreadwrite.@)
*/
HRESULT
WINAPI
MFCreateSourceReaderFromURL
(
const
WCHAR
*
url
,
IMFAttributes
*
attributes
,
IMFSourceReader
**
reader
)
{
TRACE
(
"%s, %p, %p.
\n
"
,
debugstr_w
(
url
),
attributes
,
reader
);
return
create_source_reader_from_url
(
url
,
attributes
,
&
IID_IMFSourceReader
,
(
void
**
)
reader
);
}
static
HRESULT
WINAPI
readwrite_factory_QueryInterface
(
IMFReadWriteClassFactory
*
iface
,
REFIID
riid
,
void
**
out
)
{
if
(
IsEqualIID
(
riid
,
&
IID_IMFReadWriteClassFactory
)
||
...
...
@@ -508,7 +559,14 @@ static ULONG WINAPI readwrite_factory_Release(IMFReadWriteClassFactory *iface)
static
HRESULT
WINAPI
readwrite_factory_CreateInstanceFromURL
(
IMFReadWriteClassFactory
*
iface
,
REFCLSID
clsid
,
const
WCHAR
*
url
,
IMFAttributes
*
attributes
,
REFIID
riid
,
void
**
out
)
{
FIXME
(
"%s, %s, %p, %s, %p.
\n
"
,
debugstr_guid
(
clsid
),
debugstr_w
(
url
),
attributes
,
debugstr_guid
(
riid
),
out
);
TRACE
(
"%s, %s, %p, %s, %p.
\n
"
,
debugstr_guid
(
clsid
),
debugstr_w
(
url
),
attributes
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
clsid
,
&
CLSID_MFSourceReader
))
{
return
create_source_reader_from_url
(
url
,
attributes
,
&
IID_IMFSourceReader
,
out
);
}
FIXME
(
"Unsupported %s.
\n
"
,
debugstr_guid
(
clsid
));
return
E_NOTIMPL
;
}
...
...
dlls/mfreadwrite/mfreadwrite.spec
View file @
9bf4db13
...
...
@@ -6,4 +6,4 @@
@ stub MFCreateSinkWriterFromURL
@ stdcall MFCreateSourceReaderFromByteStream(ptr ptr ptr)
@ stdcall MFCreateSourceReaderFromMediaSource(ptr ptr ptr)
@ st
ub MFCreateSourceReaderFromURL
@ st
dcall MFCreateSourceReaderFromURL(wstr ptr ptr)
include/mfreadwrite.idl
View file @
9bf4db13
...
...
@@ -151,3 +151,4 @@ cpp_quote( "HRESULT WINAPI MFCreateSourceReaderFromByteStream(IMFByteStream *str
cpp_quote
(
" IMFSourceReader **reader);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAttributes *attributes,"
)
cpp_quote
(
" IMFSourceReader **reader);"
)
cpp_quote
(
"HRESULT WINAPI MFCreateSourceReaderFromURL(const WCHAR *url, IMFAttributes *attributes, IMFSourceReader **reader);"
)
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