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
50cef896
Commit
50cef896
authored
Feb 22, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mfreadwrite: Add CreateInstanceFromObject() stub for source reader.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e16cf4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
19 deletions
+79
-19
main.c
dlls/mfreadwrite/main.c
+79
-19
No files found.
dlls/mfreadwrite/main.c
View file @
50cef896
...
...
@@ -28,10 +28,14 @@
#include "ole2.h"
#include "rpcproxy.h"
#include "mfreadwrite.h"
#include "mfidl.h"
#include "wine/debug.h"
#include "wine/heap.h"
DEFINE_GUID
(
CLSID_MFReadWriteClassFactory
,
0x48e2ed0f
,
0x98c2
,
0x4a37
,
0xbe
,
0xd5
,
0x16
,
0x63
,
0x12
,
0xdd
,
0xd8
,
0x3f
);
DEFINE_GUID
(
CLSID_MFSourceReader
,
0x1777133c
,
0x0881
,
0x411b
,
0xa5
,
0x77
,
0xad
,
0x54
,
0x5f
,
0x07
,
0x14
,
0xc4
);
DEFINE_GUID
(
CLSID_MFSinkWriter
,
0xa3bbfb17
,
0x8273
,
0x4e52
,
0x9e
,
0x0e
,
0x97
,
0x39
,
0xdc
,
0x88
,
0x79
,
0x90
);
WINE_DEFAULT_DEBUG_CHANNEL
(
mfplat
);
...
...
@@ -52,15 +56,6 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
return
TRUE
;
}
HRESULT
WINAPI
MFCreateSourceReaderFromMediaSource
(
IMFMediaSource
*
source
,
IMFAttributes
*
attributes
,
IMFSourceReader
**
reader
)
{
FIXME
(
"%p %p %p stub.
\n
"
,
source
,
attributes
,
reader
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
DllCanUnloadNow
(
void
)
{
return
S_FALSE
;
...
...
@@ -228,21 +223,52 @@ struct IMFSourceReaderVtbl srcreader_vtbl =
src_reader_GetPresentationAttribute
};
HRESULT
WINAPI
MFCreateSourceReaderFromByteStream
(
IMFByteStream
*
stream
,
IMFAttributes
*
attributes
,
IMFSourceReader
**
reader
)
static
HRESULT
create_source_reader_from_source
(
IMFMediaSource
*
source
,
IMFAttributes
*
attributes
,
REFIID
riid
,
void
**
out
)
{
srcreader
*
object
;
HRESULT
hr
;
TRACE
(
"%p, %p, %p
\n
"
,
stream
,
attributes
,
reader
);
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
object
)
);
if
(
!
object
)
object
=
heap_alloc
(
sizeof
(
*
object
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
ref
=
1
;
object
->
IMFSourceReader_iface
.
lpVtbl
=
&
srcreader_vtbl
;
object
->
ref
=
1
;
*
reader
=
&
object
->
IMFSourceReader_iface
;
return
S_OK
;
hr
=
IMFSourceReader_QueryInterface
(
&
object
->
IMFSourceReader_iface
,
riid
,
out
);
IMFSourceReader_Release
(
&
object
->
IMFSourceReader_iface
);
return
hr
;
}
static
HRESULT
create_source_reader_from_stream
(
IMFByteStream
*
stream
,
IMFAttributes
*
attributes
,
REFIID
riid
,
void
**
out
)
{
/* FIXME: resolve bytestream to media source */
return
create_source_reader_from_source
(
NULL
,
attributes
,
riid
,
out
);
}
/***********************************************************************
* MFCreateSourceReaderFromByteStream (mfreadwrite.@)
*/
HRESULT
WINAPI
MFCreateSourceReaderFromByteStream
(
IMFByteStream
*
stream
,
IMFAttributes
*
attributes
,
IMFSourceReader
**
reader
)
{
TRACE
(
"%p, %p, %p.
\n
"
,
stream
,
attributes
,
reader
);
return
create_source_reader_from_stream
(
stream
,
attributes
,
&
IID_IMFSourceReader
,
(
void
**
)
reader
);
}
/***********************************************************************
* MFCreateSourceReaderFromMediaSource (mfreadwrite.@)
*/
HRESULT
WINAPI
MFCreateSourceReaderFromMediaSource
(
IMFMediaSource
*
source
,
IMFAttributes
*
attributes
,
IMFSourceReader
**
reader
)
{
TRACE
(
"%p, %p, %p.
\n
"
,
source
,
attributes
,
reader
);
return
create_source_reader_from_source
(
source
,
attributes
,
&
IID_IMFSourceReader
,
(
void
**
)
reader
);
}
static
HRESULT
WINAPI
readwrite_factory_QueryInterface
(
IMFReadWriteClassFactory
*
iface
,
REFIID
riid
,
void
**
out
)
...
...
@@ -281,9 +307,43 @@ static HRESULT WINAPI readwrite_factory_CreateInstanceFromURL(IMFReadWriteClassF
static
HRESULT
WINAPI
readwrite_factory_CreateInstanceFromObject
(
IMFReadWriteClassFactory
*
iface
,
REFCLSID
clsid
,
IUnknown
*
unk
,
IMFAttributes
*
attributes
,
REFIID
riid
,
void
**
out
)
{
FIXME
(
"%s, %p, %p, %s, %p.
\n
"
,
debugstr_guid
(
clsid
),
unk
,
attributes
,
debugstr_guid
(
riid
),
out
)
;
HRESULT
hr
;
return
E_NOTIMPL
;
TRACE
(
"%s, %p, %p, %s, %p.
\n
"
,
debugstr_guid
(
clsid
),
unk
,
attributes
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
clsid
,
&
CLSID_MFSourceReader
))
{
IMFMediaSource
*
source
=
NULL
;
IMFByteStream
*
stream
=
NULL
;
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IMFByteStream
,
(
void
**
)
&
stream
);
if
(
FAILED
(
hr
))
hr
=
IUnknown_QueryInterface
(
unk
,
&
IID_IMFMediaSource
,
(
void
**
)
&
source
);
if
(
stream
)
hr
=
create_source_reader_from_stream
(
stream
,
attributes
,
riid
,
out
);
else
if
(
source
)
hr
=
create_source_reader_from_source
(
source
,
attributes
,
riid
,
out
);
if
(
source
)
IMFMediaSource_Release
(
source
);
if
(
stream
)
IMFByteStream_Release
(
stream
);
return
hr
;
}
else
if
(
IsEqualGUID
(
clsid
,
&
CLSID_MFSinkWriter
))
{
FIXME
(
"MFSinkWriter is not supported.
\n
"
);
*
out
=
NULL
;
return
E_NOTIMPL
;
}
else
{
WARN
(
"Unsupported class %s.
\n
"
,
debugstr_guid
(
clsid
));
*
out
=
NULL
;
return
E_FAIL
;
}
}
static
const
IMFReadWriteClassFactoryVtbl
readwrite_factory_vtbl
=
...
...
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