mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 12:43:43 +00:00
- Define automation tables for Filter & Pin
- Plug in automation tables when creating a new filter factory / pin svn path=/trunk/; revision=42802
This commit is contained in:
parent
bb8ff85531
commit
1e7c4cb0cc
1 changed files with 109 additions and 13 deletions
|
@ -1,6 +1,10 @@
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
const GUID KSPROPSETID_BdaPinControl = {0xded49d5, 0xa8b7, 0x4d5d, {0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d}};
|
||||||
|
const GUID KSMETHODSETID_BdaDeviceConfiguration = {0x71985f45, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
|
||||||
|
const GUID KSPROPSETID_BdaTopology = {0xa14ee835, 0x0a23, 0x11d3, {0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
|
||||||
|
|
||||||
BDA_GLOBAL g_Settings =
|
BDA_GLOBAL g_Settings =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
|
@ -8,6 +12,84 @@ BDA_GLOBAL g_Settings =
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
KSPROPERTY_ITEM FilterPropertyItem[] =
|
||||||
|
{
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_TYPES(BdaPropertyNodeTypes, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPES( BdaPropertyPinTypes, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_TEMPLATE_CONNECTIONS(BdaPropertyTemplateConnections, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_METHODS(BdaPropertyNodeMethods, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_PROPERTIES(BdaPropertyNodeProperties, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_EVENTS(BdaPropertyNodeEvents, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_CONTROLLING_PIN_ID(BdaPropertyGetControllingPinId, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_DESCRIPTORS(BdaPropertyNodeDescriptors, NULL)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
KSPROPERTY_SET FilterPropertySet =
|
||||||
|
{
|
||||||
|
&KSPROPSETID_BdaTopology,
|
||||||
|
8,
|
||||||
|
FilterPropertyItem,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
KSMETHOD_ITEM FilterMethodItem[] =
|
||||||
|
{
|
||||||
|
//DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(BdaMethodCreatePin, NULL),
|
||||||
|
DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(BdaMethodCreateTopology, NULL)
|
||||||
|
};
|
||||||
|
|
||||||
|
KSMETHOD_SET FilterMethodSet =
|
||||||
|
{
|
||||||
|
&KSMETHODSETID_BdaDeviceConfiguration,
|
||||||
|
2,
|
||||||
|
FilterMethodItem,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
KSAUTOMATION_TABLE FilterAutomationTable =
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
sizeof(KSPROPERTY_SET),
|
||||||
|
&FilterPropertySet,
|
||||||
|
1,
|
||||||
|
sizeof(KSMETHOD_SET),
|
||||||
|
&FilterMethodSet,
|
||||||
|
0,
|
||||||
|
sizeof(KSEVENT_SET),
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
KSPROPERTY_ITEM PinPropertyItem[] =
|
||||||
|
{
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_ID(BdaPropertyGetPinControl, NULL),
|
||||||
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPE(BdaPropertyGetPinControl, NULL)
|
||||||
|
};
|
||||||
|
|
||||||
|
KSPROPERTY_SET PinPropertySet =
|
||||||
|
{
|
||||||
|
&KSPROPSETID_BdaPinControl,
|
||||||
|
2,
|
||||||
|
PinPropertyItem,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
KSAUTOMATION_TABLE PinAutomationTable =
|
||||||
|
{
|
||||||
|
1,
|
||||||
|
sizeof(KSPROPERTY_SET),
|
||||||
|
&PinPropertySet,
|
||||||
|
0,
|
||||||
|
sizeof(KSMETHOD_SET),
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
sizeof(KSEVENT_SET),
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
AllocateItem(
|
AllocateItem(
|
||||||
|
@ -158,10 +240,17 @@ BdaCreateFilterFactoryEx(
|
||||||
PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
|
PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
|
||||||
KIRQL OldLevel;
|
KIRQL OldLevel;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
KSFILTER_DESCRIPTOR FilterDescriptor;
|
||||||
|
|
||||||
/* FIXME provide a default automation table
|
/* backup filter descriptor */
|
||||||
* to handle requests which the driver doesnt implement
|
RtlMoveMemory(&FilterDescriptor, pFilterDescriptor, sizeof(KSFILTER_DESCRIPTOR));
|
||||||
*/
|
|
||||||
|
/* merge the automation tables */
|
||||||
|
Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&FilterDescriptor.AutomationTable, (PKSAUTOMATION_TABLE)pFilterDescriptor->AutomationTable, &FilterAutomationTable, NULL);
|
||||||
|
|
||||||
|
/* check for success */
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return Status;
|
||||||
|
|
||||||
/* allocate filter instance */
|
/* allocate filter instance */
|
||||||
FilterInstance = AllocateItem(NonPagedPool, sizeof(BDA_FILTER_INSTANCE_ENTRY));
|
FilterInstance = AllocateItem(NonPagedPool, sizeof(BDA_FILTER_INSTANCE_ENTRY));
|
||||||
|
@ -172,7 +261,7 @@ BdaCreateFilterFactoryEx(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create the filter factory */
|
/* create the filter factory */
|
||||||
Status = KsCreateFilterFactory(pKSDevice->FunctionalDeviceObject, pFilterDescriptor, NULL, NULL, 0, NULL, NULL, &FilterFactory);
|
Status = KsCreateFilterFactory(pKSDevice->FunctionalDeviceObject, &FilterDescriptor, NULL, NULL, 0, NULL, NULL, &FilterFactory);
|
||||||
|
|
||||||
/* check for success */
|
/* check for success */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
@ -233,15 +322,11 @@ BdaCreatePin(
|
||||||
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG PinId;
|
ULONG PinId;
|
||||||
|
KSPIN_DESCRIPTOR_EX NewPinDescriptor;
|
||||||
|
|
||||||
if (!pulPinId || !pKSFilter)
|
if (!pulPinId || !pKSFilter)
|
||||||
return STATUS_INVALID_PARAMETER;
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
|
||||||
/* FIXME provide a default automation table
|
|
||||||
* to handle requests which the driver doesnt implement
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* get parent filter factory */
|
/* get parent filter factory */
|
||||||
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
||||||
|
|
||||||
|
@ -281,16 +366,27 @@ BdaCreatePin(
|
||||||
/* get pin descriptor */
|
/* get pin descriptor */
|
||||||
PinDescriptor = (PKSPIN_DESCRIPTOR_EX)&InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptors[ulPinType];
|
PinDescriptor = (PKSPIN_DESCRIPTOR_EX)&InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptors[ulPinType];
|
||||||
|
|
||||||
/* create the pin factory */
|
/* make a copy of the pin descriptor */
|
||||||
Status = KsFilterCreatePinFactory(pKSFilter, PinDescriptor, &PinId);
|
RtlMoveMemory(&NewPinDescriptor, PinDescriptor, sizeof(KSPIN_DESCRIPTOR_EX));
|
||||||
|
|
||||||
|
/* merge the automation tables */
|
||||||
|
Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&NewPinDescriptor.AutomationTable, (PKSAUTOMATION_TABLE)PinDescriptor->AutomationTable, &PinAutomationTable, pKSFilter->Bag);
|
||||||
|
|
||||||
/* check for success */
|
/* check for success */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* store result */
|
/* create the pin factory */
|
||||||
*pulPinId = PinId;
|
Status = KsFilterCreatePinFactory(pKSFilter, &NewPinDescriptor, &PinId);
|
||||||
|
|
||||||
|
/* check for success */
|
||||||
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
/* store result */
|
||||||
|
*pulPinId = PinId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DPRINT("BdaCreatePin Result %x\n", Status);
|
DPRINT("BdaCreatePin Result %x\n", Status);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue