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
5b248546
Commit
5b248546
authored
Jun 20, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
amstream: Get rid of some casts by using proper iface types.
parent
1e97a2db
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
33 deletions
+26
-33
amstream.c
dlls/amstream/amstream.c
+19
-22
amstream_private.h
dlls/amstream/amstream_private.h
+3
-2
audiodata.c
dlls/amstream/audiodata.c
+0
-2
main.c
dlls/amstream/main.c
+0
-1
mediastream.c
dlls/amstream/mediastream.c
+4
-5
mediastreamfilter.c
dlls/amstream/mediastreamfilter.c
+0
-1
No files found.
dlls/amstream/amstream.c
View file @
5b248546
...
@@ -27,7 +27,6 @@
...
@@ -27,7 +27,6 @@
#include "wingdi.h"
#include "wingdi.h"
#include "amstream_private.h"
#include "amstream_private.h"
#include "amstream.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
amstream
);
WINE_DEFAULT_DEBUG_CHANNEL
(
amstream
);
...
@@ -37,10 +36,10 @@ typedef struct {
...
@@ -37,10 +36,10 @@ typedef struct {
IGraphBuilder
*
pFilterGraph
;
IGraphBuilder
*
pFilterGraph
;
IMediaSeeking
*
media_seeking
;
IMediaSeeking
*
media_seeking
;
IMediaControl
*
media_control
;
IMediaControl
*
media_control
;
I
BaseFilter
*
media_stream_filter
;
I
MediaStreamFilter
*
media_stream_filter
;
IPin
*
ipin
;
IPin
*
ipin
;
ULONG
nbStreams
;
ULONG
nbStreams
;
I
MediaStream
**
pStreams
;
I
AMMediaStream
**
pStreams
;
STREAM_TYPE
StreamType
;
STREAM_TYPE
StreamType
;
OAEVENT
event
;
OAEVENT
event
;
}
IAMMultiMediaStreamImpl
;
}
IAMMultiMediaStreamImpl
;
...
@@ -114,11 +113,11 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
...
@@ -114,11 +113,11 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
if
(
!
ref
)
if
(
!
ref
)
{
{
for
(
i
=
0
;
i
<
This
->
nbStreams
;
i
++
)
for
(
i
=
0
;
i
<
This
->
nbStreams
;
i
++
)
IMediaStream_Release
(
This
->
pStreams
[
i
]);
I
AM
MediaStream_Release
(
This
->
pStreams
[
i
]);
if
(
This
->
ipin
)
if
(
This
->
ipin
)
IPin_Release
(
This
->
ipin
);
IPin_Release
(
This
->
ipin
);
if
(
This
->
media_stream_filter
)
if
(
This
->
media_stream_filter
)
I
Base
Filter_Release
(
This
->
media_stream_filter
);
I
MediaStream
Filter_Release
(
This
->
media_stream_filter
);
if
(
This
->
media_seeking
)
if
(
This
->
media_seeking
)
IMediaSeeking_Release
(
This
->
media_seeking
);
IMediaSeeking_Release
(
This
->
media_seeking
);
if
(
This
->
media_control
)
if
(
This
->
media_control
)
...
@@ -151,10 +150,10 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetMediaStream(IAMMultiMediaStream
...
@@ -151,10 +150,10 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetMediaStream(IAMMultiMediaStream
for
(
i
=
0
;
i
<
This
->
nbStreams
;
i
++
)
for
(
i
=
0
;
i
<
This
->
nbStreams
;
i
++
)
{
{
IMediaStream_GetInformation
(
This
->
pStreams
[
i
],
&
PurposeId
,
NULL
);
I
AM
MediaStream_GetInformation
(
This
->
pStreams
[
i
],
&
PurposeId
,
NULL
);
if
(
IsEqualIID
(
&
PurposeId
,
idPurpose
))
if
(
IsEqualIID
(
&
PurposeId
,
idPurpose
))
{
{
*
ppMediaStream
=
This
->
pStreams
[
i
];
*
ppMediaStream
=
(
IMediaStream
*
)
This
->
pStreams
[
i
];
IMediaStream_AddRef
(
*
ppMediaStream
);
IMediaStream_AddRef
(
*
ppMediaStream
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -258,9 +257,9 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
...
@@ -258,9 +257,9 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
IGraphBuilder_QueryInterface
(
This
->
pFilterGraph
,
&
IID_IMediaControl
,
(
void
**
)
&
This
->
media_control
);
hr
=
IGraphBuilder_QueryInterface
(
This
->
pFilterGraph
,
&
IID_IMediaControl
,
(
void
**
)
&
This
->
media_control
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
CoCreateInstance
(
&
CLSID_MediaStreamFilter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_I
BaseFilter
,
(
LPVOID
*
)
&
This
->
media_stream_filter
);
hr
=
CoCreateInstance
(
&
CLSID_MediaStreamFilter
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_I
MediaStreamFilter
,
(
void
*
*
)
&
This
->
media_stream_filter
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
IGraphBuilder_AddFilter
(
This
->
pFilterGraph
,
This
->
media_stream_filter
,
filternameW
);
hr
=
IGraphBuilder_AddFilter
(
This
->
pFilterGraph
,
(
IBaseFilter
*
)
This
->
media_stream_filter
,
filternameW
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
IMediaEventEx
*
media_event
=
NULL
;
IMediaEventEx
*
media_event
=
NULL
;
...
@@ -277,7 +276,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
...
@@ -277,7 +276,7 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
if
(
This
->
media_stream_filter
)
if
(
This
->
media_stream_filter
)
I
Base
Filter_Release
(
This
->
media_stream_filter
);
I
MediaStream
Filter_Release
(
This
->
media_stream_filter
);
This
->
media_stream_filter
=
NULL
;
This
->
media_stream_filter
=
NULL
;
if
(
This
->
media_seeking
)
if
(
This
->
media_seeking
)
IMediaSeeking_Release
(
This
->
media_seeking
);
IMediaSeeking_Release
(
This
->
media_seeking
);
...
@@ -313,19 +312,17 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream
...
@@ -313,19 +312,17 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_GetFilter
(
IAMMultiMediaStream
*
iface
,
IMediaStreamFilter
**
ppFilter
)
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_GetFilter
(
IAMMultiMediaStream
*
iface
,
IMediaStreamFilter
**
ppFilter
)
{
{
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
HRESULT
hr
=
S_OK
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppFilter
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
ppFilter
);
if
(
!
ppFilter
)
if
(
!
ppFilter
)
return
E_POINTER
;
return
E_POINTER
;
*
ppFilter
=
NULL
;
*
ppFilter
=
This
->
media_stream_filter
;
if
(
*
ppFilter
)
if
(
This
->
media_stream_filter
)
IMediaStreamFilter_AddRef
(
*
ppFilter
);
hr
=
IBaseFilter_QueryInterface
(
This
->
media_stream_filter
,
&
IID_IMediaStreamFilter
,
(
LPVOID
*
)
ppFilter
);
return
hr
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_AddMediaStream
(
IAMMultiMediaStream
*
iface
,
IUnknown
*
stream_object
,
const
MSPID
*
PurposeId
,
static
HRESULT
WINAPI
IAMMultiMediaStreamImpl_AddMediaStream
(
IAMMultiMediaStream
*
iface
,
IUnknown
*
stream_object
,
const
MSPID
*
PurposeId
,
...
@@ -333,8 +330,8 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
...
@@ -333,8 +330,8 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
{
{
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
IAMMultiMediaStreamImpl
*
This
=
impl_from_IAMMultiMediaStream
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
IMediaStream
*
pStream
;
I
AM
MediaStream
*
pStream
;
IMediaStream
**
pNewStreams
;
I
AM
MediaStream
**
pNewStreams
;
TRACE
(
"(%p/%p)->(%p,%s,%x,%p)
\n
"
,
This
,
iface
,
stream_object
,
debugstr_guid
(
PurposeId
),
dwFlags
,
ppNewStream
);
TRACE
(
"(%p/%p)->(%p,%s,%x,%p)
\n
"
,
This
,
iface
,
stream_object
,
debugstr_guid
(
PurposeId
),
dwFlags
,
ppNewStream
);
...
@@ -374,10 +371,10 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
...
@@ -374,10 +371,10 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
hr
=
audiomediastream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
This
->
StreamType
,
&
pStream
);
hr
=
audiomediastream_create
((
IMultiMediaStream
*
)
iface
,
PurposeId
,
This
->
StreamType
,
&
pStream
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
pNewStreams
=
CoTaskMemRealloc
(
This
->
pStreams
,
(
This
->
nbStreams
+
1
)
*
sizeof
(
IMediaStream
*
));
pNewStreams
=
CoTaskMemRealloc
(
This
->
pStreams
,
(
This
->
nbStreams
+
1
)
*
sizeof
(
I
AM
MediaStream
*
));
if
(
!
pNewStreams
)
if
(
!
pNewStreams
)
{
{
IMediaStream_Release
(
pStream
);
I
AM
MediaStream_Release
(
pStream
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
This
->
pStreams
=
pNewStreams
;
This
->
pStreams
=
pNewStreams
;
...
@@ -385,13 +382,13 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
...
@@ -385,13 +382,13 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream
This
->
nbStreams
++
;
This
->
nbStreams
++
;
if
(
ppNewStream
)
if
(
ppNewStream
)
*
ppNewStream
=
pStream
;
*
ppNewStream
=
(
IMediaStream
*
)
pStream
;
}
}
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
{
/* Add stream to the media stream filter */
/* Add stream to the media stream filter */
IMediaStreamFilter_AddMediaStream
(
(
IMediaStreamFilter
*
)
This
->
media_stream_filter
,
(
IAMMediaStream
*
)
pStream
);
IMediaStreamFilter_AddMediaStream
(
This
->
media_stream_filter
,
pStream
);
}
}
return
hr
;
return
hr
;
...
...
dlls/amstream/amstream_private.h
View file @
5b248546
...
@@ -31,13 +31,14 @@
...
@@ -31,13 +31,14 @@
#include "dshow.h"
#include "dshow.h"
#include "mmstream.h"
#include "mmstream.h"
#include "austream.h"
#include "austream.h"
#include "amstream.h"
HRESULT
AM_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
AM_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
AMAudioData_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
AMAudioData_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
MediaStreamFilter_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
MediaStreamFilter_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
DECLSPEC_HIDDEN
;
HRESULT
ddrawmediastream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
HRESULT
ddrawmediastream_create
(
IMultiMediaStream
*
Parent
,
const
MSPID
*
pPurposeId
,
STREAM_TYPE
StreamType
,
IMediaStream
**
ppMediaStream
)
DECLSPEC_HIDDEN
;
STREAM_TYPE
StreamType
,
I
AM
MediaStream
**
ppMediaStream
)
DECLSPEC_HIDDEN
;
HRESULT
audiomediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
HRESULT
audiomediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
STREAM_TYPE
stream_type
,
IMediaStream
**
media_stream
)
DECLSPEC_HIDDEN
;
STREAM_TYPE
stream_type
,
I
AM
MediaStream
**
media_stream
)
DECLSPEC_HIDDEN
;
#endif
/* __AMSTREAM_PRIVATE_INCLUDED__ */
#endif
/* __AMSTREAM_PRIVATE_INCLUDED__ */
dlls/amstream/audiodata.c
View file @
5b248546
...
@@ -25,8 +25,6 @@
...
@@ -25,8 +25,6 @@
#include "winbase.h"
#include "winbase.h"
#include "amstream_private.h"
#include "amstream_private.h"
#include "amstream.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
amstream
);
WINE_DEFAULT_DEBUG_CHANNEL
(
amstream
);
typedef
struct
{
typedef
struct
{
...
...
dlls/amstream/main.c
View file @
5b248546
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
#include "rpcproxy.h"
#include "rpcproxy.h"
#include "amstream_private.h"
#include "amstream_private.h"
#include "amstream.h"
#include "wine/debug.h"
#include "wine/debug.h"
...
...
dlls/amstream/mediastream.c
View file @
5b248546
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
#include "wingdi.h"
#include "wingdi.h"
#include "amstream_private.h"
#include "amstream_private.h"
#include "amstream.h"
#include "ddstream.h"
#include "ddstream.h"
...
@@ -428,7 +427,7 @@ static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStreamImpl_IDirect
...
@@ -428,7 +427,7 @@ static const struct IDirectDrawMediaStreamVtbl DirectDrawMediaStreamImpl_IDirect
};
};
HRESULT
ddrawmediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
HRESULT
ddrawmediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
STREAM_TYPE
stream_type
,
IMediaStream
**
media_stream
)
STREAM_TYPE
stream_type
,
I
AM
MediaStream
**
media_stream
)
{
{
DirectDrawMediaStreamImpl
*
object
;
DirectDrawMediaStreamImpl
*
object
;
...
@@ -446,7 +445,7 @@ HRESULT ddrawmediastream_create(IMultiMediaStream *parent, const MSPID *purpose_
...
@@ -446,7 +445,7 @@ HRESULT ddrawmediastream_create(IMultiMediaStream *parent, const MSPID *purpose_
object
->
purpose_id
=
*
purpose_id
;
object
->
purpose_id
=
*
purpose_id
;
object
->
stream_type
=
stream_type
;
object
->
stream_type
=
stream_type
;
*
media_stream
=
(
IMediaStream
*
)
&
object
->
IAMMediaStream_iface
;
*
media_stream
=
&
object
->
IAMMediaStream_iface
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -828,7 +827,7 @@ static const struct IAudioMediaStreamVtbl AudioMediaStreamImpl_IAudioMediaStream
...
@@ -828,7 +827,7 @@ static const struct IAudioMediaStreamVtbl AudioMediaStreamImpl_IAudioMediaStream
};
};
HRESULT
audiomediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
HRESULT
audiomediastream_create
(
IMultiMediaStream
*
parent
,
const
MSPID
*
purpose_id
,
STREAM_TYPE
stream_type
,
IMediaStream
**
media_stream
)
STREAM_TYPE
stream_type
,
I
AM
MediaStream
**
media_stream
)
{
{
AudioMediaStreamImpl
*
object
;
AudioMediaStreamImpl
*
object
;
...
@@ -846,7 +845,7 @@ HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_
...
@@ -846,7 +845,7 @@ HRESULT audiomediastream_create(IMultiMediaStream *parent, const MSPID *purpose_
object
->
purpose_id
=
*
purpose_id
;
object
->
purpose_id
=
*
purpose_id
;
object
->
stream_type
=
stream_type
;
object
->
stream_type
=
stream_type
;
*
media_stream
=
(
IMediaStream
*
)
&
object
->
IAMMediaStream_iface
;
*
media_stream
=
&
object
->
IAMMediaStream_iface
;
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/amstream/mediastreamfilter.c
View file @
5b248546
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#include "wine/strmbase.h"
#include "wine/strmbase.h"
#include "amstream_private.h"
#include "amstream_private.h"
#include "amstream.h"
#include "ddstream.h"
#include "ddstream.h"
...
...
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