Author: janderwald
Date: Wed Oct 14 12:24:19 2009
New Revision: 43446
URL:
http://svn.reactos.org/svn/reactos?rev=43446&view=rev
Log:
- Implement KSPROPERTY_CONNECTION_ALLOCATORFRAMING for CPortPinWaveCyclic +
CPortPinWavePci
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Wed
Oct 14 12:24:19 2009
@@ -51,6 +51,7 @@
friend NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN
OUT PVOID Data);
friend NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request,
IN OUT PVOID Data);
friend NTSTATUS NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER
Request, IN OUT PVOID Data);
+ friend NTSTATUS NTAPI PinWaveCyclicAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER
Request, IN OUT PVOID Data);
IPortWaveCyclic * m_Port;
IPortFilterWaveCyclic * m_Filter;
@@ -75,6 +76,7 @@
ULONG m_TotalPackets;
ULONG m_StopCount;
KSAUDIO_POSITION m_Position;
+ KSALLOCATOR_FRAMING m_AllocatorFraming;
SUBDEVICE_DESCRIPTOR m_Descriptor;
ULONG m_Delay;
@@ -93,9 +95,9 @@
NTSTATUS NTAPI PinWaveCyclicState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID
Data);
NTSTATUS NTAPI PinWaveCyclicDataFormat(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT
PVOID Data);
NTSTATUS NTAPI PinWaveCyclicAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT
PVOID Data);
-
-
-DEFINE_KSPROPERTY_CONNECTIONSET(PinWaveCyclicConnectionSet, PinWaveCyclicState,
PinWaveCyclicDataFormat);
+NTSTATUS NTAPI PinWaveCyclicAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN
OUT PVOID Data);
+
+DEFINE_KSPROPERTY_CONNECTIONSET(PinWaveCyclicConnectionSet, PinWaveCyclicState,
PinWaveCyclicDataFormat, PinWaveCyclicAllocatorFraming);
DEFINE_KSPROPERTY_AUDIOSET(PinWaveCyclicAudioSet, PinWaveCyclicAudioPosition);
KSPROPERTY_SET PinWaveCyclicPropertySet[] =
@@ -144,7 +146,40 @@
return STATUS_UNSUCCESSFUL;
}
-
+NTSTATUS
+NTAPI
+PinWaveCyclicAllocatorFraming(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ CPortPinWaveCyclic *Pin;
+ PSUBDEVICE_DESCRIPTOR Descriptor;
+
+ // get sub device descriptor
+ Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
+
+ // sanity check
+ PC_ASSERT(Descriptor);
+ PC_ASSERT(Descriptor->PortPin);
+ PC_ASSERT_IRQL(DISPATCH_LEVEL);
+
+ // cast to pin impl
+ Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
+
+
+ if (Request->Flags & KSPROPERTY_TYPE_GET)
+ {
+ // copy pin framing
+ RtlMoveMemory(Data, &Pin->m_AllocatorFraming,
sizeof(KSALLOCATOR_FRAMING));
+
+ Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
+ return STATUS_SUCCESS;
+ }
+
+ // not supported
+ return STATUS_NOT_SUPPORTED;
+}
NTSTATUS
NTAPI
@@ -960,6 +995,7 @@
PDEVICE_OBJECT DeviceObject;
BOOLEAN Capture;
PVOID SilenceBuffer;
+ PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor = NULL;
//IDrmAudioStream * DrmAudio = NULL;
m_KsPinDescriptor = KsPinDescriptor;
@@ -1015,6 +1051,8 @@
}
#endif
+ DPRINT("CPortPinWaveCyclic::Init Status %x\n", Status);
+
if (!NT_SUCCESS(Status))
return Status;
@@ -1024,8 +1062,6 @@
if (!NT_SUCCESS(Status))
return Status;
-
- PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor = NULL;
Status = Subdevice->GetDescriptor(&SubDeviceDescriptor);
if (!NT_SUCCESS(Status))
@@ -1044,11 +1080,10 @@
m_Descriptor.UnknownMiniport = SubDeviceDescriptor->UnknownMiniport;
m_Descriptor.PortPin = (PVOID)this;
- DPRINT("CPortPinWaveCyclic::Init Status %x\n", Status);
-
// release subdevice descriptor
Subdevice->Release();
+ // add ourselves to service group
Status = m_ServiceGroup->AddMember(PSERVICESINK(this));
if (!NT_SUCCESS(Status))
{
@@ -1072,6 +1107,15 @@
if (!SilenceBuffer)
return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* set up allocator framing */
+ m_AllocatorFraming.RequirementsFlags = KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY |
KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY;
+ m_AllocatorFraming.PoolType = NonPagedPool;
+ m_AllocatorFraming.Frames = 8;
+ m_AllocatorFraming.FileAlignment = FILE_64_BYTE_ALIGNMENT;
+ m_AllocatorFraming.Reserved = 0;
+ m_AllocatorFraming.FrameSize = m_FrameSize;
+
m_Stream->Silence(SilenceBuffer, m_FrameSize);
Status = m_IrpQueue->Init(ConnectDetails, DataFormat, DeviceObject, m_FrameSize,
0, SilenceBuffer);
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] Wed Oct
14 12:24:19 2009
@@ -94,7 +94,7 @@
NTSTATUS NTAPI PinWavePciAudioPosition(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT
PVOID Data);
NTSTATUS NTAPI PinWavePciAllocatorFraming(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT
PVOID Data);
-DEFINE_KSPROPERTY_ALLOCATORFRAMING(PinWavePciConnectionSet, PinWavePciState,
PinWavePciDataFormat, PinWavePciAllocatorFraming);
+DEFINE_KSPROPERTY_CONNECTIONSET(PinWavePciConnectionSet, PinWavePciState,
PinWavePciDataFormat, PinWavePciAllocatorFraming);
DEFINE_KSPROPERTY_AUDIOSET(PinWavePciAudioSet, PinWavePciAudioPosition);
KSPROPERTY_SET PinWavePciPropertySet[] =
@@ -123,8 +123,32 @@
IN PKSIDENTIFIER Request,
IN OUT PVOID Data)
{
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
+ CPortPinWavePci *Pin;
+ PSUBDEVICE_DESCRIPTOR Descriptor;
+
+ // get sub device descriptor
+ Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
+
+ // sanity check
+ PC_ASSERT(Descriptor);
+ PC_ASSERT(Descriptor->PortPin);
+ PC_ASSERT_IRQL(DISPATCH_LEVEL);
+
+ // cast to pin impl
+ Pin = (CPortPinWavePci*)Descriptor->PortPin;
+
+
+ if (Request->Flags & KSPROPERTY_TYPE_GET)
+ {
+ // copy pin framing
+ RtlMoveMemory(Data, &Pin->m_AllocatorFraming,
sizeof(KSALLOCATOR_FRAMING));
+
+ Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
+ return STATUS_SUCCESS;
+ }
+
+ // not supported
+ return STATUS_NOT_SUPPORTED;
}
NTSTATUS
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp [iso-8859-1] Wed Oct 14
12:24:19 2009
@@ -317,13 +317,6 @@
IN PSUBDEVICE_DESCRIPTOR Descriptor);
#define DEFINE_KSPROPERTY_CONNECTIONSET(PinSet,\
- PropStateHandler, PropDataFormatHandler)\
-DEFINE_KSPROPERTY_TABLE(PinSet) {\
- DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(PropStateHandler, PropStateHandler),\
- DEFINE_KSPROPERTY_ITEM_CONNECTION_DATAFORMAT(PropDataFormatHandler,
PropDataFormatHandler)\
-}
-
-#define DEFINE_KSPROPERTY_ALLOCATORFRAMING(PinSet,\
PropStateHandler, PropDataFormatHandler, PropAllocatorFraming)\
DEFINE_KSPROPERTY_TABLE(PinSet) {\
DEFINE_KSPROPERTY_ITEM_CONNECTION_STATE(PropStateHandler, PropStateHandler),\