Author: janderwald
Date: Tue Mar 10 04:52:51 2009
New Revision: 39926
URL:
http://svn.reactos.org/svn/reactos?rev=39926&view=rev
Log:
- Implement KSPROPERTY_PIN_PROPOSEDATAFORMAT
- Add KSPROPERTY_PIN_PROPOSEDATAFORMAT handler to IPortWaveCyclic
Modified:
trunk/reactos/drivers/ksfilter/ks/connectivity.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c
Modified: trunk/reactos/drivers/ksfilter/ks/connectivity.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/connec…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/connectivity.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/connectivity.c [iso-8859-1] Tue Mar 10 04:52:51
2009
@@ -114,16 +114,11 @@
PIO_STACK_LOCATION IoStack;
ULONG Size, Index;
PVOID Buffer;
+ PKSDATARANGE_AUDIO *WaveFormatOut;
+ PKSDATAFORMAT_WAVEFORMATEX WaveFormatIn;
IoStack = IoGetCurrentIrpStackLocation(Irp);
Buffer = Irp->UserBuffer;
-
- if (Property->Flags != KSPROPERTY_TYPE_GET)
- {
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
- Irp->IoStatus.Information = 0;
- return STATUS_NOT_IMPLEMENTED;
- }
switch(Property->Id)
{
@@ -306,6 +301,65 @@
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = Size;
break;
+ case KSPROPERTY_PIN_PROPOSEDATAFORMAT:
+ Pin = (KSP_PIN*)Property;
+ if (Pin->PinId >= DescriptorsCount)
+ {
+ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
+ Irp->IoStatus.Information = 0;
+ break;
+ }
+ Size = sizeof(KSDATAFORMAT);
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < Size)
+ {
+ Irp->IoStatus.Information = Size;
+ Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
+ break;
+ }
+ if (IoStack->Parameters.DeviceIoControl.OutputBufferLength !=
sizeof(KSDATAFORMAT_WAVEFORMATEX))
+ {
+ UNIMPLEMENTED
+ Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
+ Irp->IoStatus.Information = 0;
+ return STATUS_NOT_IMPLEMENTED;
+ }
+
+ WaveFormatIn = (PKSDATAFORMAT_WAVEFORMATEX)Buffer;
+ if (!Descriptor[Pin->PinId].DataRanges ||
!Descriptor[Pin->PinId].DataRangesCount)
+ {
+ Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
+ Irp->IoStatus.Information = 0;
+ return STATUS_UNSUCCESSFUL;
+ }
+ WaveFormatOut = (PKSDATARANGE_AUDIO*)Descriptor[Pin->PinId].DataRanges;
+ for(Index = 0; Index < Descriptor[Pin->PinId].DataRangesCount;
Index++)
+ {
+ if (WaveFormatOut[Index]->DataRange.FormatSize !=
sizeof(KSDATARANGE_AUDIO))
+ {
+ UNIMPLEMENTED
+ continue;
+ }
+
+ if (WaveFormatOut[Index]->MinimumSampleFrequency >
WaveFormatIn->WaveFormatEx.nSamplesPerSec ||
+ WaveFormatOut[Index]->MaximumSampleFrequency <
WaveFormatIn->WaveFormatEx.nSamplesPerSec ||
+ WaveFormatOut[Index]->MinimumBitsPerSample >
WaveFormatIn->WaveFormatEx.wBitsPerSample ||
+ WaveFormatOut[Index]->MaximumBitsPerSample <
WaveFormatIn->WaveFormatEx.wBitsPerSample ||
+ WaveFormatOut[Index]->MaximumChannels <
WaveFormatIn->WaveFormatEx.nChannels)
+ {
+ Irp->IoStatus.Status = STATUS_NO_MATCH;
+ Irp->IoStatus.Information = 0;
+ return STATUS_NO_MATCH;
+ }
+ else
+ {
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = 0;
+ return STATUS_SUCCESS;
+ }
+ }
+ Irp->IoStatus.Status = STATUS_NO_MATCH;
+ Irp->IoStatus.Information = 0;
+ return STATUS_NO_MATCH;
default:
DPRINT1("Unhandled property request %x\n", Property->Id);
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] Tue Mar
10 04:52:51 2009
@@ -41,7 +41,7 @@
};
DEFINE_KSPROPERTY_TOPOLOGYSET(PortFilterWaveCyclicTopologySet, TopologyPropertyHandler);
-DEFINE_KSPROPERTY_PINSETCONSTRAINED(PortFilterWaveCyclicPinSet, PinPropertyHandler,
PinPropertyHandler, PinPropertyHandler);
+DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT(PortFilterWaveCyclicPinSet, PinPropertyHandler,
PinPropertyHandler, PinPropertyHandler);
KSPROPERTY_SET WaveCyclicPropertySet[] =
{
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Tue Mar 10
04:52:51 2009
@@ -241,4 +241,22 @@
GetDeviceObject(
IPortWaveCyclic* iface);
+
+#define DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT(PinSet,\
+ PropGeneral, PropInstances, PropIntersection)\
+DEFINE_KSPROPERTY_TABLE(PinSet) {\
+ DEFINE_KSPROPERTY_ITEM_PIN_CINSTANCES(PropInstances),\
+ DEFINE_KSPROPERTY_ITEM_PIN_CTYPES(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_DATAFLOW(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_DATARANGES(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_DATAINTERSECTION(PropIntersection),\
+ DEFINE_KSPROPERTY_ITEM_PIN_INTERFACES(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_COMMUNICATION(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_CATEGORY(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_NAME(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral),\
+ DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(PropGeneral)\
+}
+
#endif
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.c [iso-8859-1] Tue Mar
10 04:52:51 2009
@@ -81,6 +81,7 @@
case KSPROPERTY_PIN_COMMUNICATION:
case KSPROPERTY_PIN_CATEGORY:
case KSPROPERTY_PIN_NAME:
+ case KSPROPERTY_PIN_PROPOSEDATAFORMAT:
Status = KsPinPropertyHandler(Irp, Request, Data,
Descriptor->Factory.PinDescriptorCount, Descriptor->Factory.KsPinDescriptor);
break;
case KSPROPERTY_PIN_GLOBALCINSTANCES:
@@ -102,7 +103,6 @@
default:
Status = STATUS_NOT_FOUND;
}
-
return Status;
}