2003-06-13 20:06:44 +02:00
|
|
|
/* DirectShow FilterGraph object (QUARTZ.DLL)
|
|
|
|
*
|
|
|
|
* Copyright 2002 Lionel Ulmer
|
2004-03-05 21:42:40 +01:00
|
|
|
* Copyright 2004 Christian Costa
|
2003-06-13 20:06:44 +02:00
|
|
|
*
|
|
|
|
* This file contains the (internal) driver registration functions,
|
|
|
|
* driver enumeration APIs and DirectDraw creation functions.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2004-10-07 05:06:48 +02:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2004-10-05 04:18:08 +02:00
|
|
|
#include "winuser.h"
|
2003-06-13 20:06:44 +02:00
|
|
|
#include "dshow.h"
|
|
|
|
#include "wine/debug.h"
|
2004-11-19 19:17:27 +01:00
|
|
|
#include "quartz_private.h"
|
|
|
|
#define COM_NO_WINDOWS_H
|
|
|
|
#include "ole2.h"
|
|
|
|
#include "olectl.h"
|
2003-08-07 00:04:45 +02:00
|
|
|
#include "strmif.h"
|
2004-03-03 03:18:13 +01:00
|
|
|
#include "vfwmsgs.h"
|
2004-03-05 21:42:40 +01:00
|
|
|
#include "evcode.h"
|
2003-07-03 20:09:28 +02:00
|
|
|
#include "wine/unicode.h"
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
typedef struct {
|
|
|
|
HWND hWnd; /* Target window */
|
|
|
|
long msg; /* User window message */
|
|
|
|
long instance; /* User data */
|
|
|
|
int disabled; /* Disabled messages posting */
|
|
|
|
} WndNotify;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
long lEventCode; /* Event code */
|
|
|
|
LONG_PTR lParam1; /* Param1 */
|
|
|
|
LONG_PTR lParam2; /* Param2 */
|
|
|
|
} Event;
|
|
|
|
|
|
|
|
/* messages ring implementation for queuing events (taken from winmm) */
|
|
|
|
#define EVENTS_RING_BUFFER_INCREMENT 64
|
|
|
|
typedef struct {
|
|
|
|
Event* messages;
|
|
|
|
int ring_buffer_size;
|
|
|
|
int msg_tosave;
|
|
|
|
int msg_toget;
|
|
|
|
CRITICAL_SECTION msg_crst;
|
|
|
|
HANDLE msg_event; /* Signaled for no empty queue */
|
|
|
|
} EventsQueue;
|
|
|
|
|
|
|
|
static int EventsQueue_Init(EventsQueue* omr)
|
|
|
|
{
|
|
|
|
omr->msg_toget = 0;
|
|
|
|
omr->msg_tosave = 0;
|
|
|
|
omr->msg_event = CreateEventW(NULL, TRUE, FALSE, NULL);
|
|
|
|
omr->ring_buffer_size = EVENTS_RING_BUFFER_INCREMENT;
|
|
|
|
omr->messages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,omr->ring_buffer_size * sizeof(Event));
|
|
|
|
|
|
|
|
InitializeCriticalSection(&omr->msg_crst);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int EventsQueue_Destroy(EventsQueue* omr)
|
|
|
|
{
|
|
|
|
CloseHandle(omr->msg_event);
|
|
|
|
HeapFree(GetProcessHeap(),0,omr->messages);
|
|
|
|
DeleteCriticalSection(&omr->msg_crst);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int EventsQueue_PutEvent(EventsQueue* omr, Event* evt)
|
|
|
|
{
|
|
|
|
EnterCriticalSection(&omr->msg_crst);
|
|
|
|
if ((omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size)))
|
|
|
|
{
|
|
|
|
int old_ring_buffer_size = omr->ring_buffer_size;
|
|
|
|
omr->ring_buffer_size += EVENTS_RING_BUFFER_INCREMENT;
|
|
|
|
TRACE("omr->ring_buffer_size=%d\n",omr->ring_buffer_size);
|
|
|
|
omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(Event));
|
|
|
|
/* Now we need to rearrange the ring buffer so that the new
|
|
|
|
buffers just allocated are in between omr->msg_tosave and
|
|
|
|
omr->msg_toget.
|
|
|
|
*/
|
|
|
|
if (omr->msg_tosave < omr->msg_toget)
|
|
|
|
{
|
|
|
|
memmove(&(omr->messages[omr->msg_toget + EVENTS_RING_BUFFER_INCREMENT]),
|
|
|
|
&(omr->messages[omr->msg_toget]),
|
|
|
|
sizeof(Event)*(old_ring_buffer_size - omr->msg_toget)
|
|
|
|
);
|
|
|
|
omr->msg_toget += EVENTS_RING_BUFFER_INCREMENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
omr->messages[omr->msg_tosave] = *evt;
|
|
|
|
SetEvent(omr->msg_event);
|
|
|
|
omr->msg_tosave = (omr->msg_tosave + 1) % omr->ring_buffer_size;
|
|
|
|
LeaveCriticalSection(&omr->msg_crst);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, long msTimeOut)
|
|
|
|
{
|
|
|
|
if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
EnterCriticalSection(&omr->msg_crst);
|
|
|
|
|
|
|
|
if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
|
|
|
|
{
|
|
|
|
LeaveCriticalSection(&omr->msg_crst);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*evt = omr->messages[omr->msg_toget];
|
|
|
|
omr->msg_toget = (omr->msg_toget + 1) % omr->ring_buffer_size;
|
|
|
|
|
|
|
|
/* Mark the buffer as empty if needed */
|
|
|
|
if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
|
|
|
|
ResetEvent(omr->msg_event);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&omr->msg_crst);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
#define MAX_ITF_CACHE_ENTRIES 3
|
|
|
|
typedef struct _ITF_CACHE_ENTRY {
|
|
|
|
IID* riid;
|
|
|
|
IBaseFilter* filter;
|
|
|
|
IUnknown* iface;
|
|
|
|
} ITF_CACHE_ENTRY;
|
|
|
|
|
2003-07-01 06:29:48 +02:00
|
|
|
typedef struct _IFilterGraphImpl {
|
2005-06-06 21:50:35 +02:00
|
|
|
const IGraphBuilderVtbl *IGraphBuilder_vtbl;
|
|
|
|
const IMediaControlVtbl *IMediaControl_vtbl;
|
|
|
|
const IMediaSeekingVtbl *IMediaSeeking_vtbl;
|
|
|
|
const IBasicAudioVtbl *IBasicAudio_vtbl;
|
|
|
|
const IBasicVideoVtbl *IBasicVideo_vtbl;
|
|
|
|
const IVideoWindowVtbl *IVideoWindow_vtbl;
|
|
|
|
const IMediaEventExVtbl *IMediaEventEx_vtbl;
|
|
|
|
const IMediaFilterVtbl *IMediaFilter_vtbl;
|
|
|
|
const IMediaEventSinkVtbl *IMediaEventSink_vtbl;
|
2005-08-17 11:52:15 +02:00
|
|
|
const IGraphConfigVtbl *IGraphConfig_vtbl;
|
2003-07-03 20:09:28 +02:00
|
|
|
/* IAMGraphStreams */
|
|
|
|
/* IAMStats */
|
|
|
|
/* IBasicVideo2 */
|
|
|
|
/* IFilterChain */
|
|
|
|
/* IFilterGraph2 */
|
|
|
|
/* IFilterMapper2 */
|
|
|
|
/* IGraphVersion */
|
|
|
|
/* IMediaPosition */
|
|
|
|
/* IQueueCommand */
|
|
|
|
/* IRegisterServiceProvider */
|
|
|
|
/* IResourceMananger */
|
|
|
|
/* IServiceProvider */
|
2003-08-07 00:04:45 +02:00
|
|
|
/* IVideoFrameStep */
|
2003-07-03 20:09:28 +02:00
|
|
|
|
2005-07-12 21:21:36 +02:00
|
|
|
LONG ref;
|
2004-11-19 19:17:27 +01:00
|
|
|
IFilterMapper2 * pFilterMapper2;
|
2003-07-03 20:09:28 +02:00
|
|
|
IBaseFilter ** ppFiltersInGraph;
|
|
|
|
LPWSTR * pFilterNames;
|
|
|
|
int nFilters;
|
|
|
|
int filterCapacity;
|
2004-03-03 03:18:13 +01:00
|
|
|
long nameIndex;
|
2004-03-05 21:42:40 +01:00
|
|
|
EventsQueue evqueue;
|
|
|
|
HANDLE hEventCompletion;
|
|
|
|
int CompletionStatus;
|
|
|
|
WndNotify notif;
|
|
|
|
int nRenderers;
|
|
|
|
int EcCompleteCount;
|
|
|
|
int HandleEcComplete;
|
|
|
|
int HandleEcRepaint;
|
2005-01-03 21:23:14 +01:00
|
|
|
OAFilterState state;
|
|
|
|
CRITICAL_SECTION cs;
|
2005-09-02 13:20:09 +02:00
|
|
|
ITF_CACHE_ENTRY ItfCacheEntries[MAX_ITF_CACHE_ENTRIES];
|
|
|
|
int nItfCacheEntries;
|
2003-07-01 06:29:48 +02:00
|
|
|
} IFilterGraphImpl;
|
|
|
|
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID *ppvObj) {
|
|
|
|
TRACE("(%p)->(%s (%p), %p)\n", This, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
if (IsEqualGUID(&IID_IUnknown, riid) ||
|
2004-04-30 06:14:19 +02:00
|
|
|
IsEqualGUID(&IID_IFilterGraph, riid) ||
|
2003-06-13 20:06:44 +02:00
|
|
|
IsEqualGUID(&IID_IGraphBuilder, riid)) {
|
|
|
|
*ppvObj = &(This->IGraphBuilder_vtbl);
|
|
|
|
TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj);
|
|
|
|
} else if (IsEqualGUID(&IID_IMediaControl, riid)) {
|
|
|
|
*ppvObj = &(This->IMediaControl_vtbl);
|
|
|
|
TRACE(" returning IMediaControl interface (%p)\n", *ppvObj);
|
|
|
|
} else if (IsEqualGUID(&IID_IMediaSeeking, riid)) {
|
|
|
|
*ppvObj = &(This->IMediaSeeking_vtbl);
|
|
|
|
TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj);
|
|
|
|
} else if (IsEqualGUID(&IID_IBasicAudio, riid)) {
|
|
|
|
*ppvObj = &(This->IBasicAudio_vtbl);
|
|
|
|
TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj);
|
|
|
|
} else if (IsEqualGUID(&IID_IBasicVideo, riid)) {
|
|
|
|
*ppvObj = &(This->IBasicVideo_vtbl);
|
|
|
|
TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj);
|
|
|
|
} else if (IsEqualGUID(&IID_IVideoWindow, riid)) {
|
|
|
|
*ppvObj = &(This->IVideoWindow_vtbl);
|
|
|
|
TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj);
|
2003-07-03 20:09:28 +02:00
|
|
|
} else if (IsEqualGUID(&IID_IMediaEvent, riid) ||
|
2003-08-07 00:04:45 +02:00
|
|
|
IsEqualGUID(&IID_IMediaEventEx, riid)) {
|
2003-06-13 20:06:44 +02:00
|
|
|
*ppvObj = &(This->IMediaEventEx_vtbl);
|
|
|
|
TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj);
|
2003-07-03 20:09:28 +02:00
|
|
|
} else if (IsEqualGUID(&IID_IMediaFilter, riid) ||
|
|
|
|
IsEqualGUID(&IID_IPersist, riid)) {
|
|
|
|
*ppvObj = &(This->IMediaFilter_vtbl);
|
|
|
|
TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj);
|
2004-03-05 21:42:40 +01:00
|
|
|
} else if (IsEqualGUID(&IID_IMediaEventSink, riid)) {
|
|
|
|
*ppvObj = &(This->IMediaEventSink_vtbl);
|
|
|
|
TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj);
|
2005-08-17 11:52:15 +02:00
|
|
|
} else if (IsEqualGUID(&IID_IGraphConfig, riid)) {
|
|
|
|
*ppvObj = &(This->IGraphConfig_vtbl);
|
|
|
|
TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj);
|
2003-06-13 20:06:44 +02:00
|
|
|
} else {
|
|
|
|
*ppvObj = NULL;
|
2003-07-03 20:09:28 +02:00
|
|
|
FIXME("unknown interface %s\n", debugstr_guid(riid));
|
2003-06-13 20:06:44 +02:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2005-01-06 20:36:47 +01:00
|
|
|
InterlockedIncrement(&This->ref);
|
2003-06-13 20:06:44 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) {
|
2005-01-06 20:36:47 +01:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p)->(): new ref = %ld\n", This, ref);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-01-06 20:36:47 +01:00
|
|
|
return ref;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
|
2005-01-06 20:36:47 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-01-06 20:36:47 +01:00
|
|
|
TRACE("(%p)->(): new ref = %ld\n", This, ref);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
if (ref == 0) {
|
2005-05-06 16:34:44 +02:00
|
|
|
int i;
|
|
|
|
for (i = 0; i < This->nFilters; i++)
|
2005-09-02 13:20:09 +02:00
|
|
|
IBaseFilter_Release(This->ppFiltersInGraph[i]);
|
|
|
|
for (i = 0; i < This->nItfCacheEntries; i++)
|
|
|
|
IUnknown_Release(This->ItfCacheEntries[i].iface);
|
2004-11-19 19:17:27 +01:00
|
|
|
IFilterMapper2_Release(This->pFilterMapper2);
|
2004-03-05 21:42:40 +01:00
|
|
|
CloseHandle(This->hEventCompletion);
|
|
|
|
EventsQueue_Destroy(&This->evqueue);
|
2005-01-03 21:23:14 +01:00
|
|
|
DeleteCriticalSection(&This->cs);
|
2004-03-05 21:42:40 +01:00
|
|
|
HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
|
|
|
|
HeapFree(GetProcessHeap(), 0, This->pFilterNames);
|
2003-06-13 20:06:44 +02:00
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IFilterGraph methods ***/
|
|
|
|
static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
|
|
|
|
IBaseFilter *pFilter,
|
|
|
|
LPCWSTR pName) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2003-07-03 20:09:28 +02:00
|
|
|
HRESULT hr;
|
2004-03-03 03:18:13 +01:00
|
|
|
int i,j;
|
|
|
|
WCHAR* wszFilterName = NULL;
|
|
|
|
int duplicate_name = FALSE;
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
|
|
|
|
|
2004-03-03 03:18:13 +01:00
|
|
|
wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
|
|
|
|
|
|
|
|
if (pName)
|
|
|
|
{
|
|
|
|
/* Check if name already exists */
|
|
|
|
for(i = 0; i < This->nFilters; i++)
|
|
|
|
if (!strcmpW(This->pFilterNames[i], pName))
|
|
|
|
{
|
|
|
|
duplicate_name = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If no name given or name already existing, generate one */
|
|
|
|
if (!pName || duplicate_name)
|
|
|
|
{
|
|
|
|
static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
|
|
|
|
static const WCHAR wszFmt2[] = {'%','0','4','d',0};
|
|
|
|
|
|
|
|
for (j = 0; j < 10000 ; j++)
|
|
|
|
{
|
|
|
|
/* Create name */
|
|
|
|
if (pName)
|
|
|
|
sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
|
|
|
|
else
|
|
|
|
sprintfW(wszFilterName, wszFmt2, This->nameIndex);
|
|
|
|
TRACE("Generated name %s\n", debugstr_w(wszFilterName));
|
|
|
|
|
|
|
|
/* Check if the generated name already exists */
|
|
|
|
for(i = 0; i < This->nFilters; i++)
|
2004-11-19 19:17:27 +01:00
|
|
|
if (!strcmpW(This->pFilterNames[i], wszFilterName))
|
2004-03-03 03:18:13 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
/* Compute next index and exit if generated name is suitable */
|
|
|
|
if (This->nameIndex++ == 10000)
|
|
|
|
This->nameIndex = 1;
|
|
|
|
if (i == This->nFilters)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* Unable to find a suitable name */
|
|
|
|
if (j == 10000)
|
|
|
|
{
|
|
|
|
CoTaskMemFree(wszFilterName);
|
|
|
|
return VFW_E_DUPLICATE_NAME;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
if (This->nFilters + 1 > This->filterCapacity)
|
|
|
|
{
|
2005-08-22 11:21:24 +02:00
|
|
|
int newCapacity = This->filterCapacity ? 2 * This->filterCapacity : 1;
|
2003-07-03 20:09:28 +02:00
|
|
|
IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
|
|
|
|
LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
|
|
|
|
memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
|
|
|
|
memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
|
2005-08-22 11:21:24 +02:00
|
|
|
if (!This->filterCapacity)
|
|
|
|
{
|
|
|
|
CoTaskMemFree(This->ppFiltersInGraph);
|
|
|
|
CoTaskMemFree(This->pFilterNames);
|
|
|
|
}
|
2003-07-03 20:09:28 +02:00
|
|
|
This->ppFiltersInGraph = ppNewFilters;
|
|
|
|
This->pFilterNames = pNewNames;
|
|
|
|
This->filterCapacity = newCapacity;
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-03-03 03:18:13 +01:00
|
|
|
hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
IBaseFilter_AddRef(pFilter);
|
|
|
|
This->ppFiltersInGraph[This->nFilters] = pFilter;
|
2004-03-03 03:18:13 +01:00
|
|
|
This->pFilterNames[This->nFilters] = wszFilterName;
|
2003-07-03 20:09:28 +02:00
|
|
|
This->nFilters++;
|
|
|
|
}
|
2004-03-03 03:18:13 +01:00
|
|
|
else
|
|
|
|
CoTaskMemFree(wszFilterName);
|
2003-07-03 20:09:28 +02:00
|
|
|
|
2004-03-03 03:18:13 +01:00
|
|
|
if (SUCCEEDED(hr) && duplicate_name)
|
|
|
|
return VFW_S_DUPLICATE_NAME;
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
|
|
|
|
IBaseFilter *pFilter) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2003-07-03 20:09:28 +02:00
|
|
|
int i;
|
|
|
|
HRESULT hr = E_FAIL;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
|
|
|
|
|
|
|
|
/* FIXME: check graph is stopped */
|
|
|
|
|
|
|
|
for (i = 0; i < This->nFilters; i++)
|
|
|
|
{
|
|
|
|
if (This->ppFiltersInGraph[i] == pFilter)
|
|
|
|
{
|
|
|
|
/* FIXME: disconnect pins */
|
|
|
|
hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
IPin_Release(pFilter);
|
|
|
|
CoTaskMemFree(This->pFilterNames[i]);
|
|
|
|
memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
|
|
|
|
memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
|
|
|
|
This->nFilters--;
|
2005-09-02 13:20:09 +02:00
|
|
|
/* Invalidate interfaces in the cache */
|
|
|
|
for (i = 0; i < This->nItfCacheEntries; i++)
|
|
|
|
if (pFilter == This->ItfCacheEntries[i].filter)
|
|
|
|
{
|
|
|
|
IUnknown_Release(This->ItfCacheEntries[i].iface);
|
|
|
|
This->ItfCacheEntries[i].iface = NULL;
|
|
|
|
This->ItfCacheEntries[i].filter = NULL;
|
|
|
|
}
|
2003-07-03 20:09:28 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
return hr; /* FIXME: check this error code */
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
2004-03-03 03:18:13 +01:00
|
|
|
static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
|
2003-06-13 20:06:44 +02:00
|
|
|
IEnumFilters **ppEnum) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
2004-03-04 07:07:30 +01:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
|
2004-03-05 21:42:40 +01:00
|
|
|
|
2004-03-04 07:07:30 +01:00
|
|
|
return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
|
|
|
|
LPCWSTR pName,
|
|
|
|
IBaseFilter **ppFilter) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2003-07-03 20:09:28 +02:00
|
|
|
int i;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
*ppFilter = NULL;
|
|
|
|
|
|
|
|
for (i = 0; i < This->nFilters; i++)
|
|
|
|
{
|
|
|
|
if (!strcmpW(pName, This->pFilterNames[i]))
|
|
|
|
{
|
|
|
|
*ppFilter = This->ppFiltersInGraph[i];
|
|
|
|
IBaseFilter_AddRef(*ppFilter);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return E_FAIL; /* FIXME: check this error code */
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
2003-12-30 20:13:05 +01:00
|
|
|
/* NOTE: despite the implication, it doesn't matter which
|
|
|
|
* way round you put in the input and output pins */
|
2003-06-13 20:06:44 +02:00
|
|
|
static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
|
|
|
|
IPin *ppinIn,
|
|
|
|
IPin *ppinOut,
|
|
|
|
const AM_MEDIA_TYPE *pmt) {
|
2003-12-30 20:13:05 +01:00
|
|
|
PIN_DIRECTION dir;
|
|
|
|
HRESULT hr;
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-12-30 20:13:05 +01:00
|
|
|
/* FIXME: check pins are in graph */
|
|
|
|
|
2005-08-22 11:21:24 +02:00
|
|
|
if (TRACE_ON(quartz))
|
|
|
|
{
|
|
|
|
PIN_INFO PinInfo;
|
|
|
|
|
|
|
|
hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
TRACE("Filter owning first pin => %p\n", PinInfo.pFilter);
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
|
|
|
|
hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
TRACE("Filter owning second pin => %p\n", PinInfo.pFilter);
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
}
|
|
|
|
|
2003-12-30 20:13:05 +01:00
|
|
|
hr = IPin_QueryDirection(ppinIn, &dir);
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
if (dir == PINDIR_INPUT)
|
|
|
|
hr = IPin_Connect(ppinOut, ppinIn, pmt);
|
|
|
|
else
|
|
|
|
hr = IPin_Connect(ppinIn, ppinOut, pmt);
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
|
|
|
|
IPin *ppin) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2005-05-18 15:25:49 +02:00
|
|
|
IPin *pConnectedTo = NULL;
|
|
|
|
HRESULT hr;
|
|
|
|
PIN_DIRECTION pindir;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-05-18 15:25:49 +02:00
|
|
|
IPin_QueryDirection(ppin, &pindir);
|
|
|
|
hr = IPin_ConnectedTo(ppin, &pConnectedTo);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
TRACE("Querying connected to failed: %lx\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
IPin_Disconnect(ppin);
|
|
|
|
IPin_Disconnect(pConnectedTo);
|
|
|
|
if (pindir == PINDIR_INPUT)
|
|
|
|
hr = IPin_Connect(pConnectedTo, ppin, NULL);
|
|
|
|
else
|
|
|
|
hr = IPin_Connect(ppin, pConnectedTo, NULL);
|
|
|
|
IPin_Release(pConnectedTo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
ERR("Reconnecting pins failed, pins are not connected now..\n");
|
|
|
|
TRACE("(%p->%p) -- %p %p -> %lx\n", iface, This, ppin, pConnectedTo, hr);
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
|
|
|
|
IPin *ppin) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
return IPin_Disconnect(ppin);
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(): stub !!!\n", iface, This);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
|
|
|
|
{
|
|
|
|
static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
|
|
|
|
static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
|
|
|
|
IPropertyBag * pPropBagCat = NULL;
|
|
|
|
HRESULT hr;
|
2004-12-16 15:25:15 +01:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
VariantInit(pvar);
|
|
|
|
V_VT(pvar) = VT_BSTR;
|
|
|
|
|
|
|
|
hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
|
|
|
|
|
|
|
|
if (pPropBagCat)
|
|
|
|
IPropertyBag_Release(pPropBagCat);
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2005-01-03 21:23:14 +01:00
|
|
|
static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* pinputpin, IPin*** pppins, ULONG* pnb)
|
2004-11-19 19:17:27 +01:00
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
ULONG nb = 0;
|
|
|
|
|
2005-01-03 21:23:14 +01:00
|
|
|
TRACE("(%p, %p, %p, %p)\n", pfilter, pinputpin, pppins, pnb);
|
|
|
|
hr = IPin_QueryInternalConnections(pinputpin, NULL, &nb);
|
2004-11-19 19:17:27 +01:00
|
|
|
if (hr == S_OK) {
|
|
|
|
/* Rendered input */
|
|
|
|
} else if (hr == S_FALSE) {
|
|
|
|
*pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
|
2005-01-03 21:23:14 +01:00
|
|
|
hr = IPin_QueryInternalConnections(pinputpin, *pppins, &nb);
|
2004-11-19 19:17:27 +01:00
|
|
|
if (hr != S_OK) {
|
|
|
|
ERR("Error (%lx)\n", hr);
|
|
|
|
}
|
|
|
|
} else if (hr == E_NOTIMPL) {
|
|
|
|
/* Input connected to all outputs */
|
|
|
|
IEnumPins* penumpins;
|
|
|
|
IPin* ppin;
|
|
|
|
int i = 0;
|
|
|
|
TRACE("E_NOTIMPL\n");
|
|
|
|
hr = IBaseFilter_EnumPins(pfilter, &penumpins);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("filter Enumpins failed (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
i = 0;
|
|
|
|
/* Count output pins */
|
|
|
|
while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
|
|
|
|
PIN_DIRECTION pindir;
|
|
|
|
IPin_QueryDirection(ppin, &pindir);
|
|
|
|
if (pindir == PINDIR_OUTPUT)
|
|
|
|
i++;
|
2005-05-06 16:34:44 +02:00
|
|
|
IPin_Release(ppin);
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
|
|
|
*pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
|
2004-12-20 20:27:06 +01:00
|
|
|
/* Retrieve output pins */
|
2004-11-19 19:17:27 +01:00
|
|
|
IEnumPins_Reset(penumpins);
|
|
|
|
i = 0;
|
|
|
|
while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
|
|
|
|
PIN_DIRECTION pindir;
|
|
|
|
IPin_QueryDirection(ppin, &pindir);
|
|
|
|
if (pindir == PINDIR_OUTPUT)
|
|
|
|
(*pppins)[i++] = ppin;
|
|
|
|
else
|
|
|
|
IPin_Release(ppin);
|
|
|
|
}
|
|
|
|
nb = i;
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Next failed (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
IEnumPins_Release(penumpins);
|
|
|
|
} else if (FAILED(hr)) {
|
|
|
|
ERR("Cannot get internal connection (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pnb = nb;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
/*** IGraphBuilder methods ***/
|
|
|
|
static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
|
|
|
|
IPin *ppinOut,
|
|
|
|
IPin *ppinIn) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2004-11-19 19:17:27 +01:00
|
|
|
HRESULT hr;
|
|
|
|
AM_MEDIA_TYPE* mt;
|
|
|
|
IEnumMediaTypes* penummt;
|
|
|
|
ULONG nbmt;
|
|
|
|
IEnumPins* penumpins;
|
|
|
|
IEnumMoniker* pEnumMoniker;
|
|
|
|
GUID tab[2];
|
|
|
|
ULONG nb;
|
|
|
|
IMoniker* pMoniker;
|
|
|
|
ULONG pin;
|
2005-08-22 11:21:24 +02:00
|
|
|
PIN_INFO PinInfo;
|
|
|
|
CLSID FilterCLSID;
|
2004-11-19 19:17:27 +01:00
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
|
|
|
|
|
2005-08-22 11:21:24 +02:00
|
|
|
if (TRACE_ON(quartz))
|
|
|
|
{
|
|
|
|
hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
TRACE("Filter owning first pin => %p\n", PinInfo.pFilter);
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
|
|
|
|
hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
TRACE("Filter owning second pin => %p\n", PinInfo.pFilter);
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
}
|
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
/* Try direct connection first */
|
|
|
|
hr = IPin_Connect(ppinOut, ppinIn, NULL);
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
TRACE("Direct connection failed, trying to insert other filters\n");
|
|
|
|
|
2005-08-22 11:21:24 +02:00
|
|
|
hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
hr = IBaseFilter_GetClassID(PinInfo.pFilter, &FilterCLSID);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
/* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
|
|
|
|
* filter to the minor mediatype of input pin of the renderer */
|
|
|
|
hr = IPin_EnumMediaTypes(ppinOut, &penummt);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("EnumMediaTypes (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("IEnumMediaTypes_Next (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
if (!nbmt) {
|
|
|
|
ERR("No media type found!\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
|
|
|
|
TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
|
|
|
|
|
|
|
|
/* Try to find a suitable filter that can connect to the pin to render */
|
|
|
|
tab[0] = mt->majortype;
|
|
|
|
tab[1] = mt->subtype;
|
|
|
|
hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to enum filters (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
|
|
|
|
{
|
|
|
|
VARIANT var;
|
|
|
|
GUID clsid;
|
|
|
|
IPin** ppins;
|
2005-05-06 16:34:44 +02:00
|
|
|
IPin* ppinfilter = NULL;
|
2004-11-19 19:17:27 +01:00
|
|
|
IBaseFilter* pfilter = NULL;
|
|
|
|
|
|
|
|
hr = GetFilterInfo(pMoniker, &clsid, &var);
|
|
|
|
IMoniker_Release(pMoniker);
|
|
|
|
if (FAILED(hr)) {
|
2005-08-22 11:21:24 +02:00
|
|
|
ERR("Unable to retrieve filter info (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsEqualGUID(&clsid, &FilterCLSID)) {
|
|
|
|
/* Skip filter (same as the one the output pin belongs to) */
|
|
|
|
goto error;
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
|
|
|
|
if (FAILED(hr)) {
|
2005-08-22 11:21:24 +02:00
|
|
|
ERR("Unable to create filter (%lx), trying next one\n", hr);
|
|
|
|
goto error;
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to add filter (%lx)\n", hr);
|
|
|
|
IBaseFilter_Release(pfilter);
|
|
|
|
pfilter = NULL;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IBaseFilter_EnumPins(pfilter, &penumpins);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Enumpins (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
2005-05-06 16:34:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Next (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (pin == 0) {
|
|
|
|
ERR("No Pin\n");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
IEnumPins_Release(penumpins);
|
|
|
|
|
|
|
|
hr = IPin_Connect(ppinOut, ppinfilter, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
TRACE("Successfully connected to filter, follow chain...\n");
|
|
|
|
|
|
|
|
/* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
|
|
|
|
hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
int i;
|
|
|
|
TRACE("pins to consider: %ld\n", nb);
|
|
|
|
for(i = 0; i < nb; i++) {
|
|
|
|
TRACE("Processing pin %d\n", i);
|
2005-05-06 16:34:44 +02:00
|
|
|
hr = IGraphBuilder_Connect(iface, ppins[i], ppinIn);
|
2004-11-19 19:17:27 +01:00
|
|
|
if (FAILED(hr)) {
|
2005-05-06 16:34:44 +02:00
|
|
|
TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
2005-05-06 16:34:44 +02:00
|
|
|
IPin_Release(ppins[i]);
|
|
|
|
if (SUCCEEDED(hr)) break;
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
2005-05-06 16:34:44 +02:00
|
|
|
while (++i < nb) IPin_Release(ppins[i]);
|
2004-11-19 19:17:27 +01:00
|
|
|
CoTaskMemFree(ppins);
|
2005-05-06 16:34:44 +02:00
|
|
|
IBaseFilter_Release(pfilter);
|
|
|
|
IPin_Release(ppinfilter);
|
|
|
|
break;
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
error:
|
2005-05-06 16:34:44 +02:00
|
|
|
if (ppinfilter) IPin_Release(ppinfilter);
|
2004-11-19 19:17:27 +01:00
|
|
|
if (pfilter) {
|
|
|
|
IGraphBuilder_RemoveFilter(iface, pfilter);
|
|
|
|
IBaseFilter_Release(pfilter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumMediaTypes_Release(penummt);
|
|
|
|
DeleteMediaType(mt);
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
|
|
|
|
IPin *ppinOut) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2004-11-19 19:17:27 +01:00
|
|
|
IEnumMediaTypes* penummt;
|
|
|
|
AM_MEDIA_TYPE* mt;
|
|
|
|
ULONG nbmt;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
IEnumMoniker* pEnumMoniker;
|
|
|
|
GUID tab[2];
|
|
|
|
ULONG nb;
|
|
|
|
IMoniker* pMoniker;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
|
|
|
|
|
2005-08-22 11:21:24 +02:00
|
|
|
if (TRACE_ON(quartz))
|
|
|
|
{
|
|
|
|
PIN_INFO PinInfo;
|
|
|
|
|
|
|
|
hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
|
|
|
|
if (FAILED(hr))
|
|
|
|
return hr;
|
|
|
|
|
|
|
|
TRACE("Filter owning pin => %p\n", PinInfo.pFilter);
|
|
|
|
IBaseFilter_Release(PinInfo.pFilter);
|
|
|
|
}
|
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
hr = IPin_EnumMediaTypes(ppinOut, &penummt);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("EnumMediaTypes (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
while(1)
|
|
|
|
{
|
|
|
|
hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("IEnumMediaTypes_Next (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
if (!nbmt)
|
|
|
|
break;
|
|
|
|
TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
|
|
|
|
TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
|
|
|
|
|
|
|
|
/* Try to find a suitable renderer with the same media type */
|
|
|
|
tab[0] = mt->majortype;
|
|
|
|
tab[1] = GUID_NULL;
|
|
|
|
hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to enum filters (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
|
|
|
|
{
|
|
|
|
VARIANT var;
|
|
|
|
GUID clsid;
|
|
|
|
IPin* ppinfilter;
|
|
|
|
IBaseFilter* pfilter = NULL;
|
|
|
|
IEnumPins* penumpins;
|
|
|
|
ULONG pin;
|
|
|
|
|
|
|
|
hr = GetFilterInfo(pMoniker, &clsid, &var);
|
|
|
|
IMoniker_Release(pMoniker);
|
|
|
|
if (FAILED(hr)) {
|
2004-12-20 20:27:06 +01:00
|
|
|
ERR("Unable to retrieve filter info (%lx)\n", hr);
|
2004-11-19 19:17:27 +01:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to create filter (%lx), trying next one\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to add filter (%lx)\n", hr);
|
|
|
|
pfilter = NULL;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IBaseFilter_EnumPins(pfilter, &penumpins);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Splitter Enumpins (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Next (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
if (pin == 0) {
|
|
|
|
ERR("No Pin\n");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
IEnumPins_Release(penumpins);
|
|
|
|
|
|
|
|
/* Connect the pin to render to the renderer */
|
|
|
|
hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
TRACE("Unable to connect to renderer (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
error:
|
|
|
|
if (pfilter) {
|
|
|
|
IGraphBuilder_RemoveFilter(iface, pfilter);
|
|
|
|
IBaseFilter_Release(pfilter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DeleteMediaType(mt);
|
|
|
|
break;
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
IEnumMediaTypes_Release(penummt);
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
|
|
|
|
LPCWSTR lpcwstrFile,
|
|
|
|
LPCWSTR lpcwstrPlayList) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2004-11-19 19:17:27 +01:00
|
|
|
static const WCHAR string[] = {'R','e','a','d','e','r',0};
|
|
|
|
IBaseFilter* preader = NULL;
|
|
|
|
IBaseFilter* psplitter;
|
|
|
|
IPin* ppinreader;
|
|
|
|
IPin* ppinsplitter;
|
|
|
|
IEnumPins* penumpins;
|
|
|
|
ULONG pin;
|
|
|
|
HRESULT hr;
|
|
|
|
IEnumMoniker* pEnumMoniker;
|
|
|
|
GUID tab[2];
|
|
|
|
IPin** ppins;
|
|
|
|
ULONG nb;
|
|
|
|
IMoniker* pMoniker;
|
|
|
|
IFileSourceFilter* pfile = NULL;
|
|
|
|
AM_MEDIA_TYPE mt;
|
|
|
|
WCHAR* filename;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
|
|
|
|
|
2004-12-20 20:27:06 +01:00
|
|
|
/* Retrieve file media type */
|
2004-11-19 19:17:27 +01:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
|
|
|
|
IFileSourceFilter_Release(pfile);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
tab[0] = mt.majortype;
|
|
|
|
tab[1] = mt.subtype;
|
|
|
|
hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
|
2005-01-09 19:24:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (FAILED(hr))
|
|
|
|
{
|
2004-11-19 19:17:27 +01:00
|
|
|
if (preader) {
|
|
|
|
IGraphBuilder_RemoveFilter(iface, preader);
|
|
|
|
IBaseFilter_Release(preader);
|
|
|
|
}
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2005-01-09 19:24:41 +01:00
|
|
|
hr = E_FAIL;
|
2004-11-19 19:17:27 +01:00
|
|
|
while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
|
|
|
|
{
|
|
|
|
VARIANT var;
|
|
|
|
GUID clsid;
|
|
|
|
|
|
|
|
hr = GetFilterInfo(pMoniker, &clsid, &var);
|
|
|
|
IMoniker_Release(pMoniker);
|
|
|
|
if (FAILED(hr)) {
|
2004-12-20 20:27:06 +01:00
|
|
|
ERR("Unable to retrieve filter info (%lx)\n", hr);
|
2004-11-19 19:17:27 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to create filter (%lx), trying next one\n", hr);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable add filter (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Connect file source and splitter filters together */
|
|
|
|
/* Make the splitter analyze incoming data */
|
|
|
|
hr = IBaseFilter_EnumPins(preader, &penumpins);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Enumpins (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Next (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
if (pin == 0) {
|
|
|
|
ERR("No Pin\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
IEnumPins_Release(penumpins);
|
|
|
|
|
|
|
|
hr = IBaseFilter_EnumPins(psplitter, &penumpins);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Splitter Enumpins (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Next (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
if (pin == 0) {
|
|
|
|
ERR("No Pin\n");
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
IEnumPins_Release(penumpins);
|
|
|
|
|
|
|
|
hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
IBaseFilter_Release(ppinsplitter);
|
|
|
|
ppinsplitter = NULL;
|
|
|
|
TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
TRACE("Successfully connected to filter\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
|
2004-12-06 12:47:13 +01:00
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
|
2004-11-19 19:17:27 +01:00
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) {
|
|
|
|
int i;
|
|
|
|
TRACE("pins to consider: %ld\n", nb);
|
|
|
|
for(i = 0; i < nb; i++) {
|
|
|
|
TRACE("Processing pin %d\n", i);
|
|
|
|
hr = IGraphBuilder_Render(iface, ppins[i]);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
|
|
|
|
/* FIXME: We should clean created things properly */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-12-06 12:47:13 +01:00
|
|
|
CoTaskMemFree(ppins);
|
2004-11-19 19:17:27 +01:00
|
|
|
}
|
|
|
|
|
2004-12-06 12:47:13 +01:00
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
|
|
|
|
LPCWSTR lpcwstrFileName,
|
|
|
|
LPCWSTR lpcwstrFilterName,
|
|
|
|
IBaseFilter **ppFilter) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
2004-11-19 19:17:27 +01:00
|
|
|
HRESULT hr;
|
|
|
|
IBaseFilter* preader;
|
|
|
|
IFileSourceFilter* pfile = NULL;
|
|
|
|
AM_MEDIA_TYPE mt;
|
|
|
|
WCHAR* filename;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
|
|
|
|
|
|
|
|
/* Instantiate a file source filter */
|
|
|
|
hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to create file source filter (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable add filter (%lx)\n", hr);
|
|
|
|
IBaseFilter_Release(preader);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Load the file in the file source filter */
|
|
|
|
hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Load (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("GetCurFile (%lx)\n", hr);
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
TRACE("File %s\n", debugstr_w(filename));
|
|
|
|
TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
|
|
|
|
TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
if (ppFilter)
|
|
|
|
*ppFilter = preader;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
2004-11-19 19:17:27 +01:00
|
|
|
|
|
|
|
error:
|
|
|
|
if (pfile)
|
|
|
|
IFileSourceFilter_Release(pfile);
|
|
|
|
IGraphBuilder_RemoveFilter(iface, preader);
|
|
|
|
IBaseFilter_Release(preader);
|
|
|
|
|
2004-12-27 18:15:58 +01:00
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
|
|
|
|
DWORD_PTR hFile) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(): stub !!!\n", This, iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(): stub !!!\n", This, iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IGraphBuilderVtbl IGraphBuilder_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Graphbuilder_QueryInterface,
|
|
|
|
Graphbuilder_AddRef,
|
|
|
|
Graphbuilder_Release,
|
|
|
|
Graphbuilder_AddFilter,
|
|
|
|
Graphbuilder_RemoveFilter,
|
2004-03-03 03:18:13 +01:00
|
|
|
Graphbuilder_EnumFilters,
|
2003-06-13 20:06:44 +02:00
|
|
|
Graphbuilder_FindFilterByName,
|
|
|
|
Graphbuilder_ConnectDirect,
|
|
|
|
Graphbuilder_Reconnect,
|
|
|
|
Graphbuilder_Disconnect,
|
|
|
|
Graphbuilder_SetDefaultSyncSource,
|
|
|
|
Graphbuilder_Connect,
|
|
|
|
Graphbuilder_Render,
|
|
|
|
Graphbuilder_RenderFile,
|
|
|
|
Graphbuilder_AddSourceFilter,
|
|
|
|
Graphbuilder_SetLogFile,
|
|
|
|
Graphbuilder_Abort,
|
|
|
|
Graphbuilder_ShouldOperationContinue
|
|
|
|
};
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDispatch methods ***/
|
|
|
|
static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
|
|
|
|
UINT*pctinfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo**ppTInfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR*rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID*rgDispId) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS*pDispParams,
|
|
|
|
VARIANT*pVarResult,
|
|
|
|
EXCEPINFO*pExepInfo,
|
|
|
|
UINT*puArgErr) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *);
|
|
|
|
|
|
|
|
static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter)
|
2005-01-03 21:23:14 +01:00
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
IPin* pInputPin;
|
|
|
|
IPin** ppPins;
|
|
|
|
ULONG nb;
|
|
|
|
ULONG i;
|
|
|
|
PIN_INFO PinInfo;
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
TRACE("%p %p\n", pGraph, pOutputPin);
|
|
|
|
PinInfo.pFilter = NULL;
|
2005-01-03 21:23:14 +01:00
|
|
|
|
|
|
|
hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
{
|
|
|
|
if (nb == 0)
|
|
|
|
{
|
|
|
|
TRACE("Reached a renderer\n");
|
|
|
|
/* Count renderers for end of stream notification */
|
|
|
|
pGraph->nRenderers++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(i = 0; i < nb; i++)
|
|
|
|
{
|
|
|
|
/* Explore the graph downstream from this pin
|
|
|
|
* FIXME: We should prevent exploring from a pin more than once. This can happens when
|
|
|
|
* several input pins are connected to the same output (a MUX for instance). */
|
2005-05-06 16:34:44 +02:00
|
|
|
ExploreGraph(pGraph, ppPins[i], FoundFilter);
|
|
|
|
IPin_Release(ppPins[i]);
|
2005-01-03 21:23:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
CoTaskMemFree(ppPins);
|
|
|
|
}
|
2005-05-06 16:34:44 +02:00
|
|
|
TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
|
|
|
|
FoundFilter(PinInfo.pFilter);
|
2005-01-03 21:23:14 +01:00
|
|
|
}
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
if (PinInfo.pFilter) IBaseFilter_Release(PinInfo.pFilter);
|
2005-01-03 21:23:14 +01:00
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
static HRESULT WINAPI SendRun(IBaseFilter *pFilter) {
|
|
|
|
return IBaseFilter_Run(pFilter, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SendPause(IBaseFilter *pFilter) {
|
|
|
|
return IBaseFilter_Pause(pFilter);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI SendStop(IBaseFilter *pFilter) {
|
|
|
|
return IBaseFilter_Stop(pFilter);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT SendFilterMessage(IMediaControl *iface, fnFoundFilter FoundFilter) {
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
2005-01-03 21:23:14 +01:00
|
|
|
int i;
|
|
|
|
IBaseFilter* pfilter;
|
|
|
|
IEnumPins* pEnum;
|
|
|
|
HRESULT hr;
|
|
|
|
IPin* pPin;
|
2005-09-07 13:31:17 +02:00
|
|
|
DWORD dummy;
|
2005-01-03 21:23:14 +01:00
|
|
|
PIN_DIRECTION dir;
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
/* Explorer the graph from source filters to renderers, determine renderers
|
|
|
|
* number and run filters from renderers to source filters */
|
2005-01-03 21:23:14 +01:00
|
|
|
This->nRenderers = 0;
|
2004-03-05 21:42:40 +01:00
|
|
|
ResetEvent(This->hEventCompletion);
|
|
|
|
|
2005-01-03 21:23:14 +01:00
|
|
|
for(i = 0; i < This->nFilters; i++)
|
|
|
|
{
|
|
|
|
BOOL source = TRUE;
|
|
|
|
pfilter = This->ppFiltersInGraph[i];
|
|
|
|
hr = IBaseFilter_EnumPins(pfilter, &pEnum);
|
|
|
|
if (hr != S_OK)
|
|
|
|
{
|
|
|
|
ERR("Enum pins failed %lx\n", hr);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
/* Check if it is a source filter */
|
|
|
|
while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
|
|
|
|
{
|
|
|
|
IPin_QueryDirection(pPin, &dir);
|
2005-05-06 16:34:44 +02:00
|
|
|
IPin_Release(pPin);
|
2005-01-03 21:23:14 +01:00
|
|
|
if (dir == PINDIR_INPUT)
|
|
|
|
{
|
|
|
|
source = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (source == TRUE)
|
|
|
|
{
|
2005-08-22 11:21:24 +02:00
|
|
|
TRACE("Found a source filter %p\n", pfilter);
|
2005-01-03 21:23:14 +01:00
|
|
|
IEnumPins_Reset(pEnum);
|
|
|
|
while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
|
|
|
|
{
|
|
|
|
/* Explore the graph downstream from this pin */
|
2005-05-06 16:34:44 +02:00
|
|
|
ExploreGraph(This, pPin, FoundFilter);
|
|
|
|
IPin_Release(pPin);
|
2005-01-03 21:23:14 +01:00
|
|
|
}
|
2005-05-06 16:34:44 +02:00
|
|
|
FoundFilter(pfilter);
|
2005-01-03 21:23:14 +01:00
|
|
|
}
|
|
|
|
IEnumPins_Release(pEnum);
|
|
|
|
}
|
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
return S_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMediaControl methods ***/
|
|
|
|
static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
if (This->state == State_Running) return S_OK;
|
2005-01-03 21:23:14 +01:00
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
SendFilterMessage(iface, SendRun);
|
|
|
|
This->state = State_Running;
|
2005-01-03 21:23:14 +01:00
|
|
|
LeaveCriticalSection(&This->cs);
|
2004-12-16 15:25:15 +01:00
|
|
|
return S_FALSE;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
2005-05-06 16:34:44 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
if (This->state == State_Paused) return S_OK;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
SendFilterMessage(iface, SendPause);
|
|
|
|
This->state = State_Paused;
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
return S_FALSE;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
2005-05-06 16:34:44 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
if (This->state == State_Stopped) return S_OK;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-05-06 16:34:44 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
if (This->state == State_Running) SendFilterMessage(iface, SendPause);
|
|
|
|
SendFilterMessage(iface, SendStop);
|
|
|
|
This->state = State_Stopped;
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
return S_FALSE;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
|
|
|
|
LONG msTimeout,
|
|
|
|
OAFilterState *pfs) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
2005-01-03 21:23:14 +01:00
|
|
|
TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
|
|
|
|
|
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
*pfs = This->state;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-01-03 21:23:14 +01:00
|
|
|
LeaveCriticalSection(&This->cs);
|
2005-08-22 11:21:24 +02:00
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
|
|
|
|
BSTR strFilename) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
|
|
|
|
BSTR strFilename,
|
|
|
|
IDispatch **ppUnk) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
|
|
|
|
IDispatch **ppUnk) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
|
|
|
|
IDispatch **ppUnk) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(): stub !!!\n", This, iface);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IMediaControlVtbl IMediaControl_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Mediacontrol_QueryInterface,
|
|
|
|
Mediacontrol_AddRef,
|
|
|
|
Mediacontrol_Release,
|
|
|
|
Mediacontrol_GetTypeInfoCount,
|
|
|
|
Mediacontrol_GetTypeInfo,
|
|
|
|
Mediacontrol_GetIDsOfNames,
|
|
|
|
Mediacontrol_Invoke,
|
|
|
|
Mediacontrol_Run,
|
|
|
|
Mediacontrol_Pause,
|
|
|
|
Mediacontrol_Stop,
|
|
|
|
Mediacontrol_GetState,
|
|
|
|
Mediacontrol_RenderFile,
|
|
|
|
Mediacontrol_AddSourceFilter,
|
|
|
|
Mediacontrol_get_FilterCollection,
|
|
|
|
Mediacontrol_get_RegFilterCollection,
|
|
|
|
Mediacontrol_StopWhenReady
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMediaSeeking methods ***/
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
|
|
|
|
DWORD *pCapabilities) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
|
|
|
|
DWORD *pCapabilities) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
|
2003-06-30 22:24:52 +02:00
|
|
|
const GUID *pFormat) {
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
|
|
|
|
GUID *pFormat) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
|
|
|
|
GUID *pFormat) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
|
2003-06-30 22:24:52 +02:00
|
|
|
const GUID *pFormat) {
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
|
2003-06-30 22:24:52 +02:00
|
|
|
const GUID *pFormat) {
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pDuration) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pStop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pCurrent) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pTarget,
|
2003-06-30 22:24:52 +02:00
|
|
|
const GUID *pTargetFormat,
|
2003-06-13 20:06:44 +02:00
|
|
|
LONGLONG Source,
|
2003-06-30 22:24:52 +02:00
|
|
|
const GUID *pSourceFormat) {
|
2003-06-13 20:06:44 +02:00
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pCurrent,
|
|
|
|
DWORD dwCurrentFlags,
|
|
|
|
LONGLONG *pStop,
|
|
|
|
DWORD dwStopFlags) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pCurrent,
|
|
|
|
LONGLONG *pStop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pEarliest,
|
|
|
|
LONGLONG *pLatest) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
|
|
|
|
double dRate) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
|
|
|
|
double *pdRate) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
|
|
|
|
LONGLONG *pllPreroll) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IMediaSeekingVtbl IMediaSeeking_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Mediaseeking_QueryInterface,
|
|
|
|
Mediaseeking_AddRef,
|
|
|
|
Mediaseeking_Release,
|
|
|
|
Mediaseeking_GetCapabilities,
|
|
|
|
Mediaseeking_CheckCapabilities,
|
|
|
|
Mediaseeking_IsFormatSupported,
|
|
|
|
Mediaseeking_QueryPreferredFormat,
|
|
|
|
Mediaseeking_GetTimeFormat,
|
|
|
|
Mediaseeking_IsUsingTimeFormat,
|
|
|
|
Mediaseeking_SetTimeFormat,
|
|
|
|
Mediaseeking_GetDuration,
|
|
|
|
Mediaseeking_GetStopPosition,
|
|
|
|
Mediaseeking_GetCurrentPosition,
|
|
|
|
Mediaseeking_ConvertTimeFormat,
|
|
|
|
Mediaseeking_SetPositions,
|
|
|
|
Mediaseeking_GetPositions,
|
|
|
|
Mediaseeking_GetAvailable,
|
|
|
|
Mediaseeking_SetRate,
|
|
|
|
Mediaseeking_GetRate,
|
|
|
|
Mediaseeking_GetPreroll
|
|
|
|
};
|
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
static HRESULT GetTargetInterface(IFilterGraphImpl* pGraph, REFIID riid, LPVOID* ppvObj)
|
|
|
|
{
|
|
|
|
HRESULT hr = E_NOINTERFACE;
|
|
|
|
int i;
|
|
|
|
int entry;
|
|
|
|
|
|
|
|
/* Check if the interface type is already registered */
|
|
|
|
for (entry = 0; entry < pGraph->nItfCacheEntries; entry++)
|
|
|
|
if (riid == pGraph->ItfCacheEntries[entry].riid)
|
|
|
|
{
|
|
|
|
if (pGraph->ItfCacheEntries[entry].iface)
|
|
|
|
{
|
|
|
|
/* Return the interface if available */
|
|
|
|
*ppvObj = pGraph->ItfCacheEntries[entry].iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (entry >= MAX_ITF_CACHE_ENTRIES)
|
|
|
|
{
|
|
|
|
FIXME("Not enough space to store interface in the cache\n");
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Find a filter supporting the requested interface */
|
|
|
|
for (i = 0; i < pGraph->nFilters; i++)
|
|
|
|
{
|
|
|
|
hr = IBaseFilter_QueryInterface(pGraph->ppFiltersInGraph[i], riid, ppvObj);
|
|
|
|
if (hr == S_OK)
|
|
|
|
{
|
|
|
|
pGraph->ItfCacheEntries[entry].riid = (IID*)riid;
|
|
|
|
pGraph->ItfCacheEntries[entry].filter = pGraph->ppFiltersInGraph[i];
|
|
|
|
pGraph->ItfCacheEntries[entry].iface = (IUnknown*)*ppvObj;
|
|
|
|
if (entry >= pGraph->nItfCacheEntries)
|
|
|
|
pGraph->nItfCacheEntries++;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
if (hr != E_NOINTERFACE)
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDispatch methods ***/
|
|
|
|
static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
|
|
|
|
UINT*pctinfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_GetTypeInfoCount(pBasicAudio, pctinfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo**ppTInfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%d, %ld, %p)\n", This, iface, iTInfo, lcid, ppTInfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_GetTypeInfo(pBasicAudio, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR*rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID*rgDispId) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p)\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_GetIDsOfNames(pBasicAudio, riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS*pDispParams,
|
|
|
|
VARIANT*pVarResult,
|
|
|
|
EXCEPINFO*pExepInfo,
|
|
|
|
UINT*puArgErr) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_Invoke(pBasicAudio, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** IBasicAudio methods ***/
|
|
|
|
static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
|
|
|
|
long lVolume) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, lVolume);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_put_Volume(pBasicAudio, lVolume);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
|
|
|
|
long *plVolume) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, plVolume);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_get_Volume(pBasicAudio, plVolume);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
|
|
|
|
long lBalance) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, lBalance);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_put_Balance(pBasicAudio, lBalance);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
|
|
|
|
long *plBalance) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicAudio* pBasicAudio;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, plBalance);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicAudio_get_Balance(pBasicAudio, plBalance);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IBasicAudioVtbl IBasicAudio_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Basicaudio_QueryInterface,
|
|
|
|
Basicaudio_AddRef,
|
|
|
|
Basicaudio_Release,
|
|
|
|
Basicaudio_GetTypeInfoCount,
|
|
|
|
Basicaudio_GetTypeInfo,
|
|
|
|
Basicaudio_GetIDsOfNames,
|
|
|
|
Basicaudio_Invoke,
|
|
|
|
Basicaudio_put_Volume,
|
|
|
|
Basicaudio_get_Volume,
|
|
|
|
Basicaudio_put_Balance,
|
|
|
|
Basicaudio_get_Balance
|
|
|
|
};
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDispatch methods ***/
|
|
|
|
static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
|
|
|
|
UINT*pctinfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetTypeInfoCount(pBasicVideo, pctinfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo**ppTInfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%d, %ld, %p)\n", This, iface, iTInfo, lcid, ppTInfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetTypeInfo(pBasicVideo, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR*rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID*rgDispId) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p)\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetIDsOfNames(pBasicVideo, riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS*pDispParams,
|
|
|
|
VARIANT*pVarResult,
|
|
|
|
EXCEPINFO*pExepInfo,
|
|
|
|
UINT*puArgErr) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_Invoke(pBasicVideo, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** IBasicVideo methods ***/
|
|
|
|
static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
|
|
|
|
REFTIME *pAvgTimePerFrame) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_AvgTimePerFrame(pBasicVideo, pAvgTimePerFrame);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
|
|
|
|
long *pBitRate) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pBitRate);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_BitRate(pBasicVideo, pBitRate);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
|
|
|
|
long *pBitErrorRate) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pBitErrorRate);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_BitErrorRate(pBasicVideo, pBitErrorRate);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
|
|
|
|
long *pVideoWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_VideoWidth(pBasicVideo, pVideoWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
|
|
|
|
long *pVideoHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_VideoHeight(pBasicVideo, pVideoHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
|
|
|
|
long SourceLeft) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, SourceLeft);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_SourceLeft(pBasicVideo, SourceLeft);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
|
|
|
|
long *pSourceLeft) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_SourceLeft(pBasicVideo, pSourceLeft);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
|
|
|
|
long SourceWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, SourceWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_SourceWidth(pBasicVideo, SourceWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
|
|
|
|
long *pSourceWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_SourceWidth(pBasicVideo, pSourceWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
|
|
|
|
long SourceTop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, SourceTop);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_SourceTop(pBasicVideo, SourceTop);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
|
|
|
|
long *pSourceTop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_SourceTop(pBasicVideo, pSourceTop);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
|
|
|
|
long SourceHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, SourceHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_SourceHeight(pBasicVideo, SourceHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
|
|
|
|
long *pSourceHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_SourceHeight(pBasicVideo, pSourceHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
|
|
|
|
long DestinationLeft) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationLeft);
|
|
|
|
|
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_DestinationLeft(pBasicVideo, DestinationLeft);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
|
|
|
|
long *pDestinationLeft) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_DestinationLeft(pBasicVideo, pDestinationLeft);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
|
|
|
|
long DestinationWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_DestinationWidth(pBasicVideo, DestinationWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
|
|
|
|
long *pDestinationWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_DestinationWidth(pBasicVideo, pDestinationWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
|
|
|
|
long DestinationTop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationTop);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_DestinationTop(pBasicVideo, DestinationTop);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
|
|
|
|
long *pDestinationTop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_DestinationTop(pBasicVideo, pDestinationTop);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
|
|
|
|
long DestinationHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_put_DestinationHeight(pBasicVideo, DestinationHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
|
|
|
|
long *pDestinationHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_get_DestinationHeight(pBasicVideo, pDestinationHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
|
|
|
|
long Left,
|
|
|
|
long Top,
|
|
|
|
long Width,
|
|
|
|
long Height) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_SetSourcePosition(pBasicVideo, Left, Top, Width, Height);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
|
|
|
|
long *pLeft,
|
|
|
|
long *pTop,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetSourcePosition(pBasicVideo, pLeft, pTop, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_SetDefaultSourcePosition(pBasicVideo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
|
|
|
|
long Left,
|
|
|
|
long Top,
|
|
|
|
long Width,
|
|
|
|
long Height) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_SetDestinationPosition(pBasicVideo, Left, Top, Width, Height);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
|
|
|
|
long *pLeft,
|
|
|
|
long *pTop,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetDestinationPosition(pBasicVideo, pLeft, pTop, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_SetDefaultDestinationPosition(pBasicVideo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetVideoSize(pBasicVideo, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
|
|
|
|
long StartIndex,
|
|
|
|
long Entries,
|
|
|
|
long *pRetrieved,
|
|
|
|
long *pPalette) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetVideoPaletteEntries(pBasicVideo, StartIndex, Entries, pRetrieved, pPalette);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
|
|
|
|
long *pBufferSize,
|
|
|
|
long *pDIBImage) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pBufferSize, pDIBImage);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_GetCurrentImage(pBasicVideo, pBufferSize, pDIBImage);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_IsUsingDefaultSource(pBasicVideo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IBasicVideo* pBasicVideo;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IBasicVideo_IsUsingDefaultDestination(pBasicVideo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IBasicVideoVtbl IBasicVideo_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Basicvideo_QueryInterface,
|
|
|
|
Basicvideo_AddRef,
|
|
|
|
Basicvideo_Release,
|
|
|
|
Basicvideo_GetTypeInfoCount,
|
|
|
|
Basicvideo_GetTypeInfo,
|
|
|
|
Basicvideo_GetIDsOfNames,
|
|
|
|
Basicvideo_Invoke,
|
|
|
|
Basicvideo_get_AvgTimePerFrame,
|
|
|
|
Basicvideo_get_BitRate,
|
|
|
|
Basicvideo_get_BitErrorRate,
|
|
|
|
Basicvideo_get_VideoWidth,
|
|
|
|
Basicvideo_get_VideoHeight,
|
|
|
|
Basicvideo_put_SourceLeft,
|
|
|
|
Basicvideo_get_SourceLeft,
|
|
|
|
Basicvideo_put_SourceWidth,
|
|
|
|
Basicvideo_get_SourceWidth,
|
|
|
|
Basicvideo_put_SourceTop,
|
|
|
|
Basicvideo_get_SourceTop,
|
|
|
|
Basicvideo_put_SourceHeight,
|
|
|
|
Basicvideo_get_SourceHeight,
|
|
|
|
Basicvideo_put_DestinationLeft,
|
|
|
|
Basicvideo_get_DestinationLeft,
|
|
|
|
Basicvideo_put_DestinationWidth,
|
|
|
|
Basicvideo_get_DestinationWidth,
|
|
|
|
Basicvideo_put_DestinationTop,
|
|
|
|
Basicvideo_get_DestinationTop,
|
|
|
|
Basicvideo_put_DestinationHeight,
|
|
|
|
Basicvideo_get_DestinationHeight,
|
|
|
|
Basicvideo_SetSourcePosition,
|
|
|
|
Basicvideo_GetSourcePosition,
|
|
|
|
Basicvideo_SetDefaultSourcePosition,
|
|
|
|
Basicvideo_SetDestinationPosition,
|
|
|
|
Basicvideo_GetDestinationPosition,
|
|
|
|
Basicvideo_SetDefaultDestinationPosition,
|
|
|
|
Basicvideo_GetVideoSize,
|
|
|
|
Basicvideo_GetVideoPaletteEntries,
|
|
|
|
Basicvideo_GetCurrentImage,
|
|
|
|
Basicvideo_IsUsingDefaultSource,
|
|
|
|
Basicvideo_IsUsingDefaultDestination
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDispatch methods ***/
|
|
|
|
static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
|
|
|
|
UINT*pctinfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetTypeInfoCount(pVideoWindow, pctinfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo**ppTInfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%d, %ld, %p)\n", This, iface, iTInfo, lcid, ppTInfo);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetTypeInfo(pVideoWindow, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR*rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID*rgDispId) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p)\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetIDsOfNames(pVideoWindow, riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS*pDispParams,
|
|
|
|
VARIANT*pVarResult,
|
|
|
|
EXCEPINFO*pExepInfo,
|
|
|
|
UINT*puArgErr) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_Invoke(pVideoWindow, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
/*** IVideoWindow methods ***/
|
|
|
|
static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
|
|
|
|
BSTR strCaption) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p))\n", This, iface, debugstr_w(strCaption), strCaption);
|
|
|
|
|
|
|
|
EnterCriticalSection(&This->cs);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Caption(pVideoWindow, strCaption);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
|
|
|
|
BSTR *strCaption) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, strCaption);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Caption(pVideoWindow, strCaption);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
|
|
|
|
long WindowStyle) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyle);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_WindowStyle(pVideoWindow, WindowStyle);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
|
|
|
|
long *WindowStyle) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_WindowStyle(pVideoWindow, WindowStyle);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
|
|
|
|
long WindowStyleEx) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyleEx);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_WindowStyleEx(pVideoWindow, WindowStyleEx);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
|
|
|
|
long *WindowStyleEx) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_WindowStyleEx(pVideoWindow, WindowStyleEx);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
|
|
|
|
long AutoShow) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, AutoShow);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_AutoShow(pVideoWindow, AutoShow);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
|
|
|
|
long *AutoShow) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_AutoShow(pVideoWindow, AutoShow);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
|
|
|
|
long WindowState) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, WindowState);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_WindowState(pVideoWindow, WindowState);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
|
|
|
|
long *WindowState) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, WindowState);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_WindowState(pVideoWindow, WindowState);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
|
|
|
|
long BackgroundPalette) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, BackgroundPalette);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_BackgroundPalette(pVideoWindow, BackgroundPalette);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
|
|
|
|
long *pBackgroundPalette) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pBackgroundPalette);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_BackgroundPalette(pVideoWindow, pBackgroundPalette);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
|
|
|
|
long Visible) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Visible);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Visible(pVideoWindow, Visible);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
|
|
|
|
long *pVisible) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pVisible);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Visible(pVideoWindow, pVisible);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
|
|
|
|
long Left) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Left);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Left(pVideoWindow, Left);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
|
|
|
|
long *pLeft) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pLeft);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Left(pVideoWindow, pLeft);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
|
|
|
|
long Width) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Width);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Width(pVideoWindow, Width);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
|
|
|
|
long *pWidth) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pWidth);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Width(pVideoWindow, pWidth);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
|
|
|
|
long Top) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Top);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Top(pVideoWindow, Top);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
|
|
|
|
long *pTop) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pTop);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Top(pVideoWindow, pTop);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
|
|
|
|
long Height) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Height);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Height(pVideoWindow, Height);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Height(pVideoWindow, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
|
|
|
|
OAHWND Owner) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%08lx)\n", This, iface, (DWORD) Owner);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_Owner(pVideoWindow, Owner);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
|
|
|
|
OAHWND *Owner) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-12 16:12:46 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, Owner);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_Owner(pVideoWindow, Owner);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
|
|
|
|
OAHWND Drain) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%08lx)\n", This, iface, (DWORD) Drain);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_MessageDrain(pVideoWindow, Drain);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
|
|
|
|
OAHWND *Drain) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, Drain);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_MessageDrain(pVideoWindow, Drain);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
|
|
|
|
long *Color) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, Color);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_BorderColor(pVideoWindow, Color);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
|
|
|
|
long Color) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Color);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_BorderColor(pVideoWindow, Color);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
|
|
|
|
long *FullScreenMode) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, FullScreenMode);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_get_FullScreenMode(pVideoWindow, FullScreenMode);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
|
|
|
|
long FullScreenMode) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, FullScreenMode);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_put_FullScreenMode(pVideoWindow, FullScreenMode);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
|
|
|
|
long Focus) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, Focus);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_SetWindowForeground(pVideoWindow, Focus);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
|
|
|
|
OAHWND hwnd,
|
|
|
|
long uMsg,
|
|
|
|
LONG_PTR wParam,
|
|
|
|
LONG_PTR lParam) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx)\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_NotifyOwnerMessage(pVideoWindow, hwnd, uMsg, wParam, lParam);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
|
|
|
|
long Left,
|
|
|
|
long Top,
|
|
|
|
long Width,
|
|
|
|
long Height) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_SetWindowPosition(pVideoWindow, Left, Top, Width, Height);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
|
|
|
|
long *pLeft,
|
|
|
|
long *pTop,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetWindowPosition(pVideoWindow, pLeft, pTop, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetMinIdealImageSize(pVideoWindow, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetMaxIdealImageSize(pVideoWindow, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
|
|
|
|
long *pLeft,
|
|
|
|
long *pTop,
|
|
|
|
long *pWidth,
|
|
|
|
long *pHeight) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_GetRestorePosition(pVideoWindow, pLeft, pTop, pWidth, pHeight);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
|
|
|
|
long HideCursor) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, HideCursor);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_HideCursor(pVideoWindow, HideCursor);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
|
|
|
|
long *CursorHidden) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
|
2005-09-02 13:20:09 +02:00
|
|
|
IVideoWindow* pVideoWindow;
|
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, CursorHidden);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2005-09-02 13:20:09 +02:00
|
|
|
EnterCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow);
|
|
|
|
|
|
|
|
if (hr == S_OK)
|
|
|
|
hr = IVideoWindow_IsCursorHidden(pVideoWindow, CursorHidden);
|
|
|
|
|
|
|
|
LeaveCriticalSection(&This->cs);
|
|
|
|
|
|
|
|
return hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IVideoWindowVtbl IVideoWindow_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Videowindow_QueryInterface,
|
|
|
|
Videowindow_AddRef,
|
|
|
|
Videowindow_Release,
|
|
|
|
Videowindow_GetTypeInfoCount,
|
|
|
|
Videowindow_GetTypeInfo,
|
|
|
|
Videowindow_GetIDsOfNames,
|
|
|
|
Videowindow_Invoke,
|
|
|
|
Videowindow_put_Caption,
|
|
|
|
Videowindow_get_Caption,
|
|
|
|
Videowindow_put_WindowStyle,
|
|
|
|
Videowindow_get_WindowStyle,
|
|
|
|
Videowindow_put_WindowStyleEx,
|
|
|
|
Videowindow_get_WindowStyleEx,
|
|
|
|
Videowindow_put_AutoShow,
|
|
|
|
Videowindow_get_AutoShow,
|
|
|
|
Videowindow_put_WindowState,
|
|
|
|
Videowindow_get_WindowState,
|
|
|
|
Videowindow_put_BackgroundPalette,
|
|
|
|
Videowindow_get_BackgroundPalette,
|
|
|
|
Videowindow_put_Visible,
|
|
|
|
Videowindow_get_Visible,
|
|
|
|
Videowindow_put_Left,
|
|
|
|
Videowindow_get_Left,
|
|
|
|
Videowindow_put_Width,
|
|
|
|
Videowindow_get_Width,
|
|
|
|
Videowindow_put_Top,
|
|
|
|
Videowindow_get_Top,
|
|
|
|
Videowindow_put_Height,
|
|
|
|
Videowindow_get_Height,
|
|
|
|
Videowindow_put_Owner,
|
|
|
|
Videowindow_get_Owner,
|
|
|
|
Videowindow_put_MessageDrain,
|
|
|
|
Videowindow_get_MessageDrain,
|
|
|
|
Videowindow_get_BorderColor,
|
|
|
|
Videowindow_put_BorderColor,
|
|
|
|
Videowindow_get_FullScreenMode,
|
|
|
|
Videowindow_put_FullScreenMode,
|
|
|
|
Videowindow_SetWindowForeground,
|
|
|
|
Videowindow_NotifyOwnerMessage,
|
|
|
|
Videowindow_SetWindowPosition,
|
|
|
|
Videowindow_GetWindowPosition,
|
|
|
|
Videowindow_GetMinIdealImageSize,
|
|
|
|
Videowindow_GetMaxIdealImageSize,
|
|
|
|
Videowindow_GetRestorePosition,
|
|
|
|
Videowindow_HideCursor,
|
|
|
|
Videowindow_IsCursorHidden
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*** IUnknown methods ***/
|
|
|
|
static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPVOID*ppvObj) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppvObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->()\n", This, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDispatch methods ***/
|
|
|
|
static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
|
|
|
|
UINT*pctinfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
|
|
|
|
UINT iTInfo,
|
|
|
|
LCID lcid,
|
|
|
|
ITypeInfo**ppTInfo) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
|
|
|
|
REFIID riid,
|
|
|
|
LPOLESTR*rgszNames,
|
|
|
|
UINT cNames,
|
|
|
|
LCID lcid,
|
|
|
|
DISPID*rgDispId) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
|
|
|
|
DISPID dispIdMember,
|
|
|
|
REFIID riid,
|
|
|
|
LCID lcid,
|
|
|
|
WORD wFlags,
|
|
|
|
DISPPARAMS*pDispParams,
|
|
|
|
VARIANT*pVarResult,
|
|
|
|
EXCEPINFO*pExepInfo,
|
|
|
|
UINT*puArgErr) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMediaEvent methods ***/
|
|
|
|
static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
|
|
|
|
OAEVENT *hEvent) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
|
|
|
|
|
|
|
|
*hEvent = (OAEVENT)This->evqueue.msg_event;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
|
|
|
|
long *lEventCode,
|
|
|
|
LONG_PTR *lParam1,
|
|
|
|
LONG_PTR *lParam2,
|
|
|
|
long msTimeout) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
2004-03-05 21:42:40 +01:00
|
|
|
Event evt;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
|
|
|
|
{
|
|
|
|
*lEventCode = evt.lEventCode;
|
|
|
|
*lParam1 = evt.lParam1;
|
|
|
|
*lParam2 = evt.lParam2;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*lEventCode = 0;
|
|
|
|
return E_ABORT;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
|
|
|
|
long msTimeout,
|
|
|
|
long *pEvCode) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
|
|
|
|
{
|
|
|
|
*pEvCode = This->CompletionStatus;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pEvCode = 0;
|
|
|
|
return E_ABORT;
|
2003-06-13 20:06:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
|
|
|
|
long lEvCode) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
|
|
|
|
|
|
|
|
if (lEvCode == EC_COMPLETE)
|
|
|
|
This->HandleEcComplete = FALSE;
|
|
|
|
else if (lEvCode == EC_REPAINT)
|
|
|
|
This->HandleEcRepaint = FALSE;
|
|
|
|
else
|
|
|
|
return S_FALSE;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
|
|
|
|
long lEvCode) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
|
|
|
|
|
|
|
|
if (lEvCode == EC_COMPLETE)
|
|
|
|
This->HandleEcComplete = TRUE;
|
|
|
|
else if (lEvCode == EC_REPAINT)
|
|
|
|
This->HandleEcRepaint = TRUE;
|
|
|
|
else
|
|
|
|
return S_FALSE;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
|
|
|
|
long lEvCode,
|
|
|
|
LONG_PTR lParam1,
|
|
|
|
LONG_PTR lParam2) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IMediaEventEx methods ***/
|
|
|
|
static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
|
|
|
|
OAHWND hwnd,
|
|
|
|
long lMsg,
|
|
|
|
LONG_PTR lInstanceData) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
|
|
|
|
|
|
|
|
This->notif.hWnd = (HWND)hwnd;
|
|
|
|
This->notif.msg = lMsg;
|
|
|
|
This->notif.instance = (long) lInstanceData;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
|
|
|
|
long lNoNotifyFlags) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
|
|
|
|
|
|
|
|
if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
This->notif.disabled = lNoNotifyFlags;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
|
|
|
|
long *lplNoNotifyFlags) {
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
|
|
|
|
|
|
|
|
if (!lplNoNotifyFlags)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
*lplNoNotifyFlags = This->notif.disabled;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IMediaEventExVtbl IMediaEventEx_VTable =
|
2003-06-13 20:06:44 +02:00
|
|
|
{
|
|
|
|
Mediaevent_QueryInterface,
|
|
|
|
Mediaevent_AddRef,
|
|
|
|
Mediaevent_Release,
|
|
|
|
Mediaevent_GetTypeInfoCount,
|
|
|
|
Mediaevent_GetTypeInfo,
|
|
|
|
Mediaevent_GetIDsOfNames,
|
|
|
|
Mediaevent_Invoke,
|
|
|
|
Mediaevent_GetEventHandle,
|
|
|
|
Mediaevent_GetEvent,
|
|
|
|
Mediaevent_WaitForCompletion,
|
|
|
|
Mediaevent_CancelDefaultHandling,
|
|
|
|
Mediaevent_RestoreDefaultHandling,
|
|
|
|
Mediaevent_FreeEventParams,
|
|
|
|
Mediaevent_SetNotifyWindow,
|
|
|
|
Mediaevent_SetNotifyFlags,
|
|
|
|
Mediaevent_GetNotifyFlags
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2003-07-03 20:09:28 +02:00
|
|
|
static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", pClassID);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
|
|
|
|
{
|
|
|
|
FIXME("(): stub\n");
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
|
|
|
|
{
|
|
|
|
FIXME("(): stub\n");
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
|
|
|
|
{
|
|
|
|
FIXME("(%lld): stub\n", tStart);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
|
|
|
|
{
|
|
|
|
FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", pClock);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", ppClock);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IMediaFilterVtbl IMediaFilter_VTable =
|
2003-07-03 20:09:28 +02:00
|
|
|
{
|
|
|
|
MediaFilter_QueryInterface,
|
|
|
|
MediaFilter_AddRef,
|
|
|
|
MediaFilter_Release,
|
|
|
|
MediaFilter_GetClassID,
|
|
|
|
MediaFilter_Stop,
|
|
|
|
MediaFilter_Pause,
|
|
|
|
MediaFilter_Run,
|
|
|
|
MediaFilter_GetState,
|
|
|
|
MediaFilter_SetSyncSource,
|
|
|
|
MediaFilter_GetSyncSource
|
|
|
|
};
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
|
|
|
|
Event evt;
|
|
|
|
|
|
|
|
TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
|
|
|
|
|
|
|
|
/* We need thread safety here, let's use the events queue's one */
|
|
|
|
EnterCriticalSection(&This->evqueue.msg_crst);
|
2005-01-03 21:23:14 +01:00
|
|
|
|
2004-03-05 21:42:40 +01:00
|
|
|
if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
|
|
|
|
{
|
2005-03-02 11:12:12 +01:00
|
|
|
TRACE("Process EC_COMPLETE notification\n");
|
|
|
|
if (++This->EcCompleteCount == This->nRenderers)
|
|
|
|
{
|
|
|
|
evt.lEventCode = EC_COMPLETE;
|
|
|
|
evt.lParam1 = S_OK;
|
|
|
|
evt.lParam2 = 0;
|
|
|
|
TRACE("Send EC_COMPLETE to app\n");
|
|
|
|
EventsQueue_PutEvent(&This->evqueue, &evt);
|
|
|
|
if (!This->notif.disabled && This->notif.hWnd)
|
|
|
|
{
|
|
|
|
TRACE("Send Window message\n");
|
|
|
|
PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
|
|
|
|
}
|
|
|
|
This->CompletionStatus = EC_COMPLETE;
|
|
|
|
SetEvent(This->hEventCompletion);
|
|
|
|
}
|
2004-03-05 21:42:40 +01:00
|
|
|
}
|
|
|
|
else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
|
|
|
|
{
|
2005-03-02 11:12:12 +01:00
|
|
|
/* FIXME: Not handled yet */
|
2004-03-05 21:42:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-03-02 11:12:12 +01:00
|
|
|
evt.lEventCode = EventCode;
|
|
|
|
evt.lParam1 = EventParam1;
|
|
|
|
evt.lParam2 = EventParam2;
|
|
|
|
EventsQueue_PutEvent(&This->evqueue, &evt);
|
|
|
|
if (!This->notif.disabled && This->notif.hWnd)
|
|
|
|
PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
|
2004-03-05 21:42:40 +01:00
|
|
|
}
|
|
|
|
|
2004-04-05 22:16:35 +02:00
|
|
|
LeaveCriticalSection(&This->evqueue.msg_crst);
|
2004-03-05 21:42:40 +01:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2005-06-06 21:50:35 +02:00
|
|
|
static const IMediaEventSinkVtbl IMediaEventSink_VTable =
|
2004-03-05 21:42:40 +01:00
|
|
|
{
|
|
|
|
MediaEventSink_QueryInterface,
|
|
|
|
MediaEventSink_AddRef,
|
|
|
|
MediaEventSink_Release,
|
|
|
|
MediaEventSink_Notify
|
|
|
|
};
|
|
|
|
|
2005-08-17 11:52:15 +02:00
|
|
|
static HRESULT WINAPI GraphConfig_QueryInterface(IGraphConfig *iface, REFIID riid, LPVOID *ppv)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_QueryInterface(This, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI GraphConfig_AddRef(IGraphConfig *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_AddRef(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI GraphConfig_Release(IGraphConfig *iface)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
return Filtergraph_Release(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_Reconnect(IGraphConfig *iface,
|
|
|
|
IPin* pOutputPin,
|
|
|
|
IPin* pInputPin,
|
|
|
|
const AM_MEDIA_TYPE* pmtFirstConnection,
|
|
|
|
IBaseFilter* pUsingFilter,
|
|
|
|
HANDLE hAbortEvent,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p, %p, %p, %p, %lx): stub!\n", This, pOutputPin, pInputPin, pmtFirstConnection, pUsingFilter, hAbortEvent, dwFlags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_Reconfigure(IGraphConfig *iface,
|
|
|
|
IGraphConfigCallback* pCallback,
|
|
|
|
PVOID pvContext,
|
|
|
|
DWORD dwFlags,
|
|
|
|
HANDLE hAbortEvent)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p, %lx, %p): stub!\n", This, pCallback, pvContext, dwFlags, hAbortEvent);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_AddFilterToCache(IGraphConfig *iface,
|
|
|
|
IBaseFilter* pFilter)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub!\n", This, pFilter);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_EnumCacheFilter(IGraphConfig *iface,
|
|
|
|
IEnumFilters** pEnum)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub!\n", This, pEnum);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_RemoveFilterFromCache(IGraphConfig *iface,
|
|
|
|
IBaseFilter* pFilter)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub!\n", This, pFilter);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_GetStartTime(IGraphConfig *iface,
|
|
|
|
REFERENCE_TIME* prtStart)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub!\n", This, prtStart);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_PushThroughData(IGraphConfig *iface,
|
|
|
|
IPin* pOutputPin,
|
|
|
|
IPinConnection* pConnection,
|
|
|
|
HANDLE hEventAbort)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p, %p): stub!\n", This, pOutputPin, pConnection, hEventAbort);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_SetFilterFlags(IGraphConfig *iface,
|
|
|
|
IBaseFilter* pFilter,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %lx): stub!\n", This, pFilter, dwFlags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_GetFilterFlags(IGraphConfig *iface,
|
|
|
|
IBaseFilter* pFilter,
|
|
|
|
DWORD* dwFlags)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p): stub!\n", This, pFilter, dwFlags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI GraphConfig_RemoveFilterEx(IGraphConfig *iface,
|
|
|
|
IBaseFilter* pFilter,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
|
|
|
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %lx): stub!\n", This, pFilter, dwFlags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IGraphConfigVtbl IGraphConfig_VTable =
|
|
|
|
{
|
|
|
|
GraphConfig_QueryInterface,
|
|
|
|
GraphConfig_AddRef,
|
|
|
|
GraphConfig_Release,
|
|
|
|
GraphConfig_Reconnect,
|
|
|
|
GraphConfig_Reconfigure,
|
|
|
|
GraphConfig_AddFilterToCache,
|
|
|
|
GraphConfig_EnumCacheFilter,
|
|
|
|
GraphConfig_RemoveFilterFromCache,
|
|
|
|
GraphConfig_GetStartTime,
|
|
|
|
GraphConfig_PushThroughData,
|
|
|
|
GraphConfig_SetFilterFlags,
|
|
|
|
GraphConfig_GetFilterFlags,
|
|
|
|
GraphConfig_RemoveFilterEx
|
|
|
|
};
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
/* This is the only function that actually creates a FilterGraph class... */
|
2005-05-05 11:50:35 +02:00
|
|
|
HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
|
|
|
|
{
|
2003-06-13 20:06:44 +02:00
|
|
|
IFilterGraphImpl *fimpl;
|
2004-11-19 19:17:27 +01:00
|
|
|
HRESULT hr;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
|
|
|
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
|
|
|
|
|
2004-10-18 23:21:19 +02:00
|
|
|
if( pUnkOuter )
|
|
|
|
return CLASS_E_NOAGGREGATION;
|
|
|
|
|
2005-03-24 22:01:35 +01:00
|
|
|
fimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
|
2003-06-13 20:06:44 +02:00
|
|
|
fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
|
|
|
|
fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
|
|
|
|
fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
|
|
|
|
fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
|
|
|
|
fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
|
|
|
|
fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
|
|
|
|
fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
|
2003-07-03 20:09:28 +02:00
|
|
|
fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
|
2004-03-05 21:42:40 +01:00
|
|
|
fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
|
2005-08-17 11:52:15 +02:00
|
|
|
fimpl->IGraphConfig_vtbl = &IGraphConfig_VTable;
|
2003-06-13 20:06:44 +02:00
|
|
|
fimpl->ref = 1;
|
2003-08-07 00:04:45 +02:00
|
|
|
fimpl->ppFiltersInGraph = NULL;
|
|
|
|
fimpl->pFilterNames = NULL;
|
|
|
|
fimpl->nFilters = 0;
|
|
|
|
fimpl->filterCapacity = 0;
|
2004-03-03 03:18:13 +01:00
|
|
|
fimpl->nameIndex = 1;
|
2005-03-02 11:12:12 +01:00
|
|
|
fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0);
|
2004-03-05 21:42:40 +01:00
|
|
|
fimpl->HandleEcComplete = TRUE;
|
|
|
|
fimpl->HandleEcRepaint = TRUE;
|
|
|
|
fimpl->notif.hWnd = 0;
|
2005-03-02 11:12:12 +01:00
|
|
|
fimpl->notif.disabled = FALSE;
|
2004-03-05 21:42:40 +01:00
|
|
|
fimpl->nRenderers = 0;
|
|
|
|
fimpl->EcCompleteCount = 0;
|
2005-01-03 21:23:14 +01:00
|
|
|
fimpl->state = State_Stopped;
|
2004-03-05 21:42:40 +01:00
|
|
|
EventsQueue_Init(&fimpl->evqueue);
|
2005-01-03 21:23:14 +01:00
|
|
|
InitializeCriticalSection(&fimpl->cs);
|
2005-09-02 13:20:09 +02:00
|
|
|
fimpl->nItfCacheEntries = 0;
|
2003-06-13 20:06:44 +02:00
|
|
|
|
2004-11-19 19:17:27 +01:00
|
|
|
hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
|
|
|
|
if (FAILED(hr)) {
|
|
|
|
ERR("Unable to create filter mapper (%lx)\n", hr);
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:44 +02:00
|
|
|
*ppObj = fimpl;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2005-05-05 11:50:35 +02:00
|
|
|
|
|
|
|
HRESULT FilterGraphNoThread_create(IUnknown *pUnkOuter, LPVOID *ppObj)
|
|
|
|
{
|
|
|
|
FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
|
|
|
|
return FilterGraph_create(pUnkOuter, ppObj);
|
|
|
|
}
|