amstream: Retrieve some interfaces needed to control the stream.

This commit is contained in:
Christian Costa 2012-03-14 21:51:27 +01:00 committed by Alexandre Julliard
parent 4a25010c40
commit 8d9655b819
1 changed files with 22 additions and 0 deletions

View File

@ -35,6 +35,8 @@ typedef struct {
IAMMultiMediaStream IAMMultiMediaStream_iface; IAMMultiMediaStream IAMMultiMediaStream_iface;
LONG ref; LONG ref;
IGraphBuilder* pFilterGraph; IGraphBuilder* pFilterGraph;
IMediaSeeking* media_seeking;
IMediaControl* media_control;
IPin* ipin; IPin* ipin;
ULONG nbStreams; ULONG nbStreams;
IMediaStream** pStreams; IMediaStream** pStreams;
@ -116,6 +118,10 @@ static ULONG WINAPI IAMMultiMediaStreamImpl_Release(IAMMultiMediaStream* iface)
IMediaStream_Release(This->pStreams[i]); IMediaStream_Release(This->pStreams[i]);
if (This->ipin) if (This->ipin)
IPin_Release(This->ipin); IPin_Release(This->ipin);
if (This->media_seeking)
IMediaSeeking_Release(This->media_seeking);
if (This->media_control)
IMediaControl_Release(This->media_control);
if (This->pFilterGraph) if (This->pFilterGraph)
IGraphBuilder_Release(This->pFilterGraph); IGraphBuilder_Release(This->pFilterGraph);
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
@ -240,6 +246,22 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_Initialize(IAMMultiMediaStream* if
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
This->StreamType = StreamType; This->StreamType = StreamType;
hr = IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaSeeking, (void**)&This->media_seeking);
if (SUCCEEDED(hr))
IGraphBuilder_QueryInterface(This->pFilterGraph, &IID_IMediaControl, (void**)&This->media_control);
}
if (FAILED(hr))
{
if (This->media_seeking)
IMediaSeeking_Release(This->media_seeking);
This->media_seeking = NULL;
if (This->media_control)
IMediaControl_Release(This->media_control);
This->media_control = NULL;
if (This->pFilterGraph)
IGraphBuilder_Release(This->pFilterGraph);
This->pFilterGraph = NULL;
} }
return hr; return hr;