mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 12:39:35 +00:00
[USBAUDIO]
- include controls from logical channels - process selector unit descriptors - automatic gain is KSNODETYPE_AGC svn path=/trunk/; revision=73106
This commit is contained in:
parent
698798ac5c
commit
e8322d1fb7
3 changed files with 75 additions and 8 deletions
|
@ -326,7 +326,8 @@ CountTopologyComponents(
|
|||
PUSB_AUDIO_CONTROL_INPUT_TERMINAL_DESCRIPTOR InputTerminalDescriptor;
|
||||
PUSB_AUDIO_CONTROL_FEATURE_UNIT_DESCRIPTOR FeatureUnitDescriptor;
|
||||
PUSB_AUDIO_CONTROL_MIXER_UNIT_DESCRIPTOR MixerUnitDescriptor;
|
||||
ULONG NodeCount = 0;
|
||||
PUSB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR SelectorUnitDescriptor;
|
||||
ULONG NodeCount = 0, Length, Index;
|
||||
ULONG DescriptorCount = 0;
|
||||
UCHAR Value;
|
||||
|
||||
|
@ -352,7 +353,15 @@ CountTopologyComponents(
|
|||
{
|
||||
FeatureUnitDescriptor = (PUSB_AUDIO_CONTROL_FEATURE_UNIT_DESCRIPTOR)InputTerminalDescriptor;
|
||||
DescriptorCount++;
|
||||
Value = FeatureUnitDescriptor->bmaControls[0];
|
||||
|
||||
/* get controls from all channels*/
|
||||
Value = 0;
|
||||
Length = FeatureUnitDescriptor->bLength - 7;
|
||||
for (Index = 0; Index < Length; Index++)
|
||||
{
|
||||
Value |= FeatureUnitDescriptor->bmaControls[Index];
|
||||
}
|
||||
|
||||
if (Value & 0x01) /* MUTE*/
|
||||
NodeCount++;
|
||||
if (Value & 0x02) /* VOLUME */
|
||||
|
@ -369,8 +378,6 @@ CountTopologyComponents(
|
|||
NodeCount++;
|
||||
if (Value & 0x80) /* DELAY */
|
||||
NodeCount++;
|
||||
|
||||
/* FIXME handle logical channels too */
|
||||
}
|
||||
else if (InputTerminalDescriptor->bDescriptorSubtype == 0x04 /* MIXER_UNIT */)
|
||||
{
|
||||
|
@ -378,6 +385,12 @@ CountTopologyComponents(
|
|||
DescriptorCount++;
|
||||
NodeCount += MixerUnitDescriptor->bNrInPins + 1; /* KSNODETYPE_SUPERMIX for each source pin and KSNODETYPE_SUM for target */
|
||||
}
|
||||
else if (InputTerminalDescriptor->bDescriptorSubtype == 0x05 /* SELECTOR_UNIT */)
|
||||
{
|
||||
SelectorUnitDescriptor = (PUSB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR)InputTerminalDescriptor;
|
||||
DescriptorCount++;
|
||||
NodeCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
@ -417,7 +430,7 @@ BuildUSBAudioFilterTopology(
|
|||
PKSFILTER_DESCRIPTOR FilterDescriptor)
|
||||
{
|
||||
PDEVICE_EXTENSION DeviceExtension;
|
||||
ULONG NodeCount, Index, DescriptorCount, StreamingTerminalIndex, NonStreamingTerminalDescriptorCount, TotalTerminalDescriptorCount, StreamingTerminalPinOffset, ControlDescriptorCount;
|
||||
ULONG NodeCount, Index, DescriptorCount, StreamingTerminalIndex, NonStreamingTerminalDescriptorCount, TotalTerminalDescriptorCount, StreamingTerminalPinOffset, ControlDescriptorCount, Length;
|
||||
UCHAR Value;
|
||||
PUSB_INTERFACE_DESCRIPTOR Descriptor;
|
||||
PUSB_AUDIO_CONTROL_INTERFACE_HEADER_DESCRIPTOR InterfaceHeaderDescriptor;
|
||||
|
@ -426,6 +439,7 @@ BuildUSBAudioFilterTopology(
|
|||
PUSB_AUDIO_CONTROL_FEATURE_UNIT_DESCRIPTOR FeatureUnitDescriptor;
|
||||
PUSB_AUDIO_CONTROL_MIXER_UNIT_DESCRIPTOR MixerUnitDescriptor;
|
||||
PUSB_AUDIO_CONTROL_OUTPUT_TERMINAL_DESCRIPTOR OutputTerminalDescriptor;
|
||||
PUSB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR SelectorUnitDescriptor;
|
||||
PKSNODE_DESCRIPTOR NodeDescriptors;
|
||||
PNODE_CONTEXT NodeContext, PreviousNodeContext;
|
||||
PKSTOPOLOGY_CONNECTION Connections;
|
||||
|
@ -558,7 +572,16 @@ BuildUSBAudioFilterTopology(
|
|||
else if (InputTerminalDescriptor->bDescriptorSubtype == 0x06 /* FEATURE_UNIT*/)
|
||||
{
|
||||
FeatureUnitDescriptor = (PUSB_AUDIO_CONTROL_FEATURE_UNIT_DESCRIPTOR)CommonDescriptor;
|
||||
Value = FeatureUnitDescriptor->bmaControls[0];
|
||||
|
||||
/* get controls from all channels*/
|
||||
Value = 0;
|
||||
Length = FeatureUnitDescriptor->bLength - 7;
|
||||
for (Index = 0; Index < Length; Index++)
|
||||
{
|
||||
Value |= FeatureUnitDescriptor->bmaControls[Index];
|
||||
}
|
||||
|
||||
|
||||
if (Value & 0x01) /* MUTE*/
|
||||
{
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Type = &KSNODETYPE_MUTE;
|
||||
|
@ -651,8 +674,8 @@ BuildUSBAudioFilterTopology(
|
|||
|
||||
if (Value & 0x40) /* AUTOMATIC GAIN */
|
||||
{
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Type = &KSNODETYPE_TONE;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Name = &KSNODETYPE_TONE;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Type = &KSNODETYPE_AGC;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Name = &KSNODETYPE_AGC;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].AutomationTable = AllocFunction(sizeof(KSAUTOMATION_TABLE));
|
||||
|
||||
/* insert into node context*/
|
||||
|
@ -707,6 +730,19 @@ BuildUSBAudioFilterTopology(
|
|||
|
||||
FilterDescriptor->NodeDescriptorsCount++;
|
||||
}
|
||||
else if (InputTerminalDescriptor->bDescriptorSubtype == 0x05 /* SELECTOR UNIT */)
|
||||
{
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Type = &KSNODETYPE_MUX;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].Name = &KSNODETYPE_MUX;
|
||||
NodeDescriptors[FilterDescriptor->NodeDescriptorsCount].AutomationTable = AllocFunction(sizeof(KSAUTOMATION_TABLE));
|
||||
|
||||
/* insert into node context*/
|
||||
NodeContext[DescriptorCount].Descriptor = CommonDescriptor;
|
||||
NodeContext[DescriptorCount].NodeCount = 1;
|
||||
NodeContext[DescriptorCount].Nodes[0] = FilterDescriptor->NodeDescriptorsCount;
|
||||
DescriptorCount++;
|
||||
FilterDescriptor->NodeDescriptorsCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
@ -853,6 +889,24 @@ BuildUSBAudioFilterTopology(
|
|||
}
|
||||
DescriptorCount++;
|
||||
}
|
||||
else if (InputTerminalDescriptor->bDescriptorSubtype == 0x05 /* SELECTOR_UNIT */)
|
||||
{
|
||||
SelectorUnitDescriptor = (PUSB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR)InputTerminalDescriptor;
|
||||
for (Index = 0; Index < SelectorUnitDescriptor->bNrInPins; Index++)
|
||||
{
|
||||
Value = SelectorUnitDescriptor->baSourceID[Index];
|
||||
PreviousNodeContext = FindNodeContextWithId(NodeContext, ControlDescriptorCount, Value);
|
||||
if (PreviousNodeContext)
|
||||
{
|
||||
Connections[FilterDescriptor->ConnectionsCount].FromNode = PreviousNodeContext->Nodes[PreviousNodeContext->NodeCount - 1];
|
||||
Connections[FilterDescriptor->ConnectionsCount].FromNodePin = 0;
|
||||
Connections[FilterDescriptor->ConnectionsCount].ToNodePin = 1;
|
||||
Connections[FilterDescriptor->ConnectionsCount].ToNode = NodeContext[DescriptorCount].Nodes[0];
|
||||
FilterDescriptor->ConnectionsCount++;
|
||||
}
|
||||
}
|
||||
DescriptorCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
UNIMPLEMENTED
|
||||
|
|
|
@ -15,6 +15,8 @@ DEFINE_GUID(KSNODETYPE_TONE, 0x7607E580L, 0xC557, 0x11D0, 0x
|
|||
DEFINE_GUID(KSNODETYPE_SUM, 0xDA441A60L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
|
||||
DEFINE_GUID(KSNODETYPE_SUPERMIX, 0xE573ADC0L, 0xC555, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
|
||||
DEFINE_GUID(KSNODETYPE_VOLUME, 0x3A5ACC00L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
|
||||
DEFINE_GUID(KSNODETYPE_MUX, 0x2CEAF780L, 0xC556, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
|
||||
DEFINE_GUID(KSNODETYPE_AGC, 0xE88C9BA0L, 0xC557, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
|
||||
DEFINE_GUID(KSCOMPONENTID_USBAUDIO, 0x8F1275F0L, 0x26E9, 0x4264, 0xBA, 0x4D, 0x39, 0xFF, 0xF0, 0x1D, 0x94, 0xAA);
|
||||
DEFINE_GUID(KSPROPSETID_Audio, 0x45FFAAA0L, 0x6E1B, 0x11D0, 0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
|
||||
/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */
|
||||
|
|
|
@ -129,6 +129,17 @@ typedef struct
|
|||
UCHAR iMixer;
|
||||
}USB_AUDIO_CONTROL_MIXER_UNIT_DESCRIPTOR, *PUSB_AUDIO_CONTROL_MIXER_UNIT_DESCRIPTOR;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UCHAR bLength;
|
||||
UCHAR bDescriptorType;
|
||||
UCHAR bDescriptorSubtype;
|
||||
UCHAR bUnitID;
|
||||
UCHAR bNrInPins;
|
||||
UCHAR baSourceID[1];
|
||||
UCHAR iSelector;
|
||||
}USB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR, *PUSB_AUDIO_CONTROL_SELECTOR_UNIT_DESCRIPTOR;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue