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
f49d6df1
Commit
f49d6df1
authored
Aug 16, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Get rid of the explicit implementation of IMediaStream.
parent
2b55b5b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
120 deletions
+46
-120
amstream.c
dlls/amstream/amstream.c
+1
-5
amstream_private.h
dlls/amstream/amstream_private.h
+2
-2
mediastream.c
dlls/amstream/mediastream.c
+43
-113
No files found.
dlls/amstream/amstream.c
View file @
f49d6df1
...
...
@@ -276,11 +276,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
FIXME
(
"(%p/%p)->(%p,%s,%x,%p) partial stub!
\n
"
,
This
,
iface
,
pStreamObject
,
debugstr_guid
(
PurposeId
),
dwFlags
,
ppNewStream
);
if
(
IsEqualGUID
(
PurposeId
,
&
MSPID_PrimaryVideo
))
hr
=
DirectDrawMediaStream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
This
->
StreamType
,
&
pStream
);
else
hr
=
MediaStream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
This
->
StreamType
,
&
pStream
);
hr
=
mediastream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
This
->
StreamType
,
&
pStream
);
if
(
SUCCEEDED
(
hr
))
{
pNewStreams
=
CoTaskMemAlloc
((
This
->
nbStreams
+
1
)
*
sizeof
(
IMediaStream
*
));
...
...
dlls/amstream/amstream_private.h
View file @
f49d6df1
...
...
@@ -36,7 +36,7 @@
HRESULT
AM_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
MediaStreamFilter_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
MediaStream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
DECLSPEC_HIDDEN
;
HRESULT
DirectDrawMediaStream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
DECLSPEC_HIDDEN
;
HRESULT
mediastream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
DECLSPEC_HIDDEN
;
#endif
/* __AMSTREAM_PRIVATE_INCLUDED__ */
dlls/amstream/mediastream.c
View file @
f49d6df1
...
...
@@ -36,14 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
amstream
);
typedef
struct
{
const
IMediaStreamVtbl
*
lpVtbl
;
LONG
ref
;
IMultiMediaStream
*
Parent
;
MSPID
PurposeId
;
STREAM_TYPE
StreamType
;
}
IMediaStreamImpl
;
typedef
struct
{
IDirectDrawMediaStream
IDirectDrawMediaStream_iface
;
LONG
ref
;
IMultiMediaStream
*
Parent
;
...
...
@@ -51,88 +43,68 @@ typedef struct {
STREAM_TYPE
StreamType
;
}
IDirectDrawMediaStreamImpl
;
static
const
struct
IMediaStreamVtbl
MediaStream_Vtbl
;
HRESULT
MediaStream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
static
inline
IDirectDrawMediaStreamImpl
*
impl_from_IDirectDrawMediaStream
(
IDirectDrawMediaStream
*
iface
)
{
IMediaStreamImpl
*
object
;
TRACE
(
"(%p,%s,%p)
\n
"
,
Parent
,
debugstr_guid
(
pPurposeId
),
ppMediaStream
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IMediaStreamImpl
));
if
(
!
object
)
{
ERR
(
"Out of memory
\n
"
);
return
E_OUTOFMEMORY
;
}
object
->
lpVtbl
=
&
MediaStream_Vtbl
;
object
->
ref
=
1
;
object
->
Parent
=
Parent
;
object
->
PurposeId
=
*
pPurposeId
;
object
->
StreamType
=
StreamType
;
*
ppMediaStream
=
(
IMediaStream
*
)
object
;
return
S_OK
;
return
CONTAINING_RECORD
(
iface
,
IDirectDrawMediaStreamImpl
,
IDirectDrawMediaStream_iface
);
}
/*** IUnknown methods ***/
static
HRESULT
WINAPI
IMediaStreamImpl_QueryInterface
(
IMediaStream
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_QueryInterface
(
IDirectDrawMediaStream
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
TRACE
(
"(%p/%p)->(%s,%p)
\n
"
,
iface
,
This
,
debugstr_guid
(
riid
),
ppv
Object
);
TRACE
(
"(%p/%p)->(%s,%p)
\n
"
,
iface
,
This
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IMediaStream
))
IsEqualGUID
(
riid
,
&
IID_IMediaStream
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawMediaStream
))
{
IUnknown_AddRef
(
iface
);
*
ppv
Object
=
This
;
*
ppv
=
This
;
return
S_OK
;
}
ERR
(
"(%p)->(%s,%p),not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
ERR
(
"(%p)->(%s,%p),not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
I
MediaStreamImpl_AddRef
(
IMediaStream
*
iface
)
static
ULONG
WINAPI
I
DirectDrawMediaStreamImpl_AddRef
(
IDirectDrawMediaStream
*
iface
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
I
MediaStreamImpl_Release
(
IMediaStream
*
iface
)
static
ULONG
WINAPI
I
DirectDrawMediaStreamImpl_Release
(
IDirectDrawMediaStream
*
iface
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p/%p)
\n
"
,
iface
,
This
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
ref
;
}
/*** IMediaStream methods ***/
static
HRESULT
WINAPI
IMediaStreamImpl_GetMultiMediaStream
(
IMediaStream
*
iface
,
IMultiMediaStream
**
ppMultiMediaStream
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_GetMultiMediaStream
(
IDirectDrawMediaStream
*
iface
,
IMultiMediaStream
**
ppMultiMediaStream
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
FIXME
(
"(%p/%p)->(%p) stub!
\n
"
,
This
,
iface
,
ppMultiMediaStream
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaStreamImpl_GetInformation
(
IMediaStream
*
iface
,
MSPID
*
pPurposeId
,
STREAM_TYPE
*
pType
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_GetInformation
(
IDirectDrawMediaStream
*
iface
,
MSPID
*
pPurposeId
,
STREAM_TYPE
*
pType
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
TRACE
(
"(%p/%p)->(%p,%p)
\n
"
,
This
,
iface
,
pPurposeId
,
pType
);
...
...
@@ -144,80 +116,46 @@ static HRESULT WINAPI IMediaStreamImpl_GetInformation(IMediaStream* iface, MSPID
return
S_OK
;
}
static
HRESULT
WINAPI
IMediaStreamImpl_SetSameFormat
(
IMediaStream
*
iface
,
IMediaStream
*
pStreamThatHasDesiredFormat
,
DWORD
dwFlags
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_SetSameFormat
(
IDirectDrawMediaStream
*
iface
,
IMediaStream
*
pStreamThatHasDesiredFormat
,
DWORD
dwFlags
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
FIXME
(
"(%p/%p)->(%p,%x) stub!
\n
"
,
This
,
iface
,
pStreamThatHasDesiredFormat
,
dwFlags
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaStreamImpl_AllocateSample
(
IMediaStream
*
iface
,
DWORD
dwFlags
,
IStreamSample
**
ppSample
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_AllocateSample
(
IDirectDrawMediaStream
*
iface
,
DWORD
dwFlags
,
IStreamSample
**
ppSample
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
FIXME
(
"(%p/%p)->(%x,%p) stub!
\n
"
,
This
,
iface
,
dwFlags
,
ppSample
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaStreamImpl_CreateSharedSample
(
IMediaStream
*
iface
,
IStreamSample
*
pExistingSample
,
DWORD
dwFlags
,
IStreamSample
**
ppSample
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_CreateSharedSample
(
IDirectDrawMediaStream
*
iface
,
IStreamSample
*
pExistingSample
,
DWORD
dwFlags
,
IStreamSample
**
ppSample
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
FIXME
(
"(%p/%p)->(%p,%x,%p) stub!
\n
"
,
This
,
iface
,
pExistingSample
,
dwFlags
,
ppSample
);
return
S_FALSE
;
}
static
HRESULT
WINAPI
IMediaStreamImpl_SendEndOfStream
(
IMediaStream
*
iface
,
DWORD
dwFlags
)
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_SendEndOfStream
(
IDirectDrawMediaStream
*
iface
,
DWORD
dwFlags
)
{
I
MediaStreamImpl
*
This
=
(
IMediaStreamImpl
*
)
iface
;
I
DirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
)
;
FIXME
(
"(%p/%p)->(%x) stub!
\n
"
,
This
,
iface
,
dwFlags
);
return
S_FALSE
;
}
static
const
struct
IMediaStreamVtbl
MediaStream_Vtbl
=
{
IMediaStreamImpl_QueryInterface
,
IMediaStreamImpl_AddRef
,
IMediaStreamImpl_Release
,
IMediaStreamImpl_GetMultiMediaStream
,
IMediaStreamImpl_GetInformation
,
IMediaStreamImpl_SetSameFormat
,
IMediaStreamImpl_AllocateSample
,
IMediaStreamImpl_CreateSharedSample
,
IMediaStreamImpl_SendEndOfStream
};
static
inline
IDirectDrawMediaStreamImpl
*
impl_from_IDirectDrawMediaStream
(
IDirectDrawMediaStream
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectDrawMediaStreamImpl
,
IDirectDrawMediaStream_iface
);
}
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_QueryInterface
(
IDirectDrawMediaStream
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
IDirectDrawMediaStreamImpl
*
This
=
impl_from_IDirectDrawMediaStream
(
iface
);
TRACE
(
"(%p/%p)->(%s,%p)
\n
"
,
iface
,
This
,
debugstr_guid
(
riid
),
ppv
);
if
(
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
||
IsEqualGUID
(
riid
,
&
IID_IMediaStream
)
||
IsEqualGUID
(
riid
,
&
IID_IDirectDrawMediaStream
))
{
IUnknown_AddRef
(
iface
);
*
ppv
=
This
;
return
S_OK
;
}
ERR
(
"(%p)->(%s,%p),not found
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
}
static
HRESULT
WINAPI
IDirectDrawMediaStreamImpl_GetFormat
(
IDirectDrawMediaStream
*
iface
,
DDSURFACEDESC
*
pDDSDCurrent
,
IDirectDrawPalette
**
ppDirectDrawPalette
,
DDSURFACEDESC
*
pDDSDDesired
,
DWORD
*
pdwFlags
)
...
...
@@ -270,24 +208,17 @@ static HRESULT WINAPI IDirectDrawMediaStreamImpl_GetTimePerFrame(IDirectDrawMedi
return
E_NOTIMPL
;
}
/* Note: Hack so we can reuse the old functions without compiler warnings */
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun) (typeof(DirectDrawMediaStream_Vtbl.fun))
#else
# define XCAST(fun) (void*)
#endif
static
const
struct
IDirectDrawMediaStreamVtbl
DirectDrawMediaStream_Vtbl
=
{
IDirectDrawMediaStreamImpl_QueryInterface
,
XCAST
(
AddRef
)
I
MediaStreamImpl_AddRef
,
XCAST
(
Release
)
I
MediaStreamImpl_Release
,
XCAST
(
GetMultiMediaStream
)
I
MediaStreamImpl_GetMultiMediaStream
,
XCAST
(
GetInformation
)
I
MediaStreamImpl_GetInformation
,
XCAST
(
SetSameFormat
)
I
MediaStreamImpl_SetSameFormat
,
XCAST
(
AllocateSample
)
I
MediaStreamImpl_AllocateSample
,
XCAST
(
CreateSharedSample
)
I
MediaStreamImpl_CreateSharedSample
,
XCAST
(
SendEndOfStream
)
I
MediaStreamImpl_SendEndOfStream
,
IDirectDraw
MediaStreamImpl_AddRef
,
IDirectDraw
MediaStreamImpl_Release
,
IDirectDraw
MediaStreamImpl_GetMultiMediaStream
,
IDirectDraw
MediaStreamImpl_GetInformation
,
IDirectDraw
MediaStreamImpl_SetSameFormat
,
IDirectDraw
MediaStreamImpl_AllocateSample
,
IDirectDraw
MediaStreamImpl_CreateSharedSample
,
IDirectDraw
MediaStreamImpl_SendEndOfStream
,
IDirectDrawMediaStreamImpl_GetFormat
,
IDirectDrawMediaStreamImpl_SetFormat
,
IDirectDrawMediaStreamImpl_GetDirectDraw
,
...
...
@@ -295,16 +226,15 @@ static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStream_Vtbl =
IDirectDrawMediaStreamImpl_CreateSample
,
IDirectDrawMediaStreamImpl_GetTimePerFrame
};
#undef XCAST
HRESULT
DirectDrawMediaS
tream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
HRESULT
medias
tream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
{
IDirectDrawMediaStreamImpl
*
object
;
TRACE
(
"(%p,%s,%p)
\n
"
,
Parent
,
debugstr_guid
(
pPurposeId
),
ppMediaStream
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IMediaStreamImpl
));
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
I
DirectDraw
MediaStreamImpl
));
if
(
!
object
)
{
ERR
(
"Out of memory
\n
"
);
...
...
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