ReactOS  0.4.15-dev-1397-g19779b3
CMiniportWaveCMI Class Reference

#include <minwave.hpp>

Inheritance diagram for CMiniportWaveCMI:
Collaboration diagram for CMiniportWaveCMI:

Public Member Functions

 DECLARE_STD_UNKNOWN ()
 
 DEFINE_STD_CONSTRUCTOR (CMiniportWaveCMI)
 
 ~CMiniportWaveCMI ()
 
 STDMETHODIMP_ (void) ServiceWaveISR(UInt32 streamIndex)
 
 STDMETHODIMP_ (void) powerUp()
 
 STDMETHODIMP_ (void) powerDown()
 

Public Attributes

 IMP_IMiniportWaveCyclic
 
- Public Attributes inherited from CUnknown
union {
   IUnknown   IUnknown
 
   INonDelegatingUnknown   INonDelegatingUnknown
 
}; 
 
LONG m_ref_count
 
PUNKNOWN m_outer_unknown
 

Private Member Functions

NTSTATUS processResources (PRESOURCELIST resourceList)
 
NTSTATUS isFormatAllowed (UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
 
NTSTATUS validateFormat (PKSDATAFORMAT format, ULONG PinID, BOOLEAN capture)
 
NTSTATUS newDMAChannel (PDMACHANNEL *dmaChannel, UInt32 bufferLength)
 
NTSTATUS loadChannelConfigFromRegistry ()
 
NTSTATUS storeChannelConfigToRegistry ()
 

Private Attributes

PCMIADAPTER CMIAdapter
 
PPORTWAVECYCLIC Port
 
PDMACHANNEL DMAChannel [3]
 
UInt32 notificationInterval
 
CMI8738Infocm
 
UInt32 requestedChannelCount
 
UInt32 requestedChannelMask
 
CMiniportWaveStreamCMIstream [3]
 
bool isStreamRunning [3]
 
KMUTEX mutex
 

Friends

class CMiniportWaveStreamCMI
 
NTSTATUS NTAPI PropertyHandler_ChannelConfig (PPCPROPERTY_REQUEST PropertyRequest)
 

Detailed Description

Definition at line 38 of file minwave.hpp.

Constructor & Destructor Documentation

◆ ~CMiniportWaveCMI()

CMiniportWaveCMI::~CMiniportWaveCMI ( void  )

Definition at line 116 of file minwave.cpp.

117 {
118  PAGED_CODE();
119  DBGPRINT(("CMiniportWaveCMI[%p]::~CMiniportWaveCMI", this));
120 
121  storeChannelConfigToRegistry(); //or not. during system shutdown, this doesn't seem to work.
122 
123  if (CMIAdapter) {
124  CMIAdapter->Release();
125  CMIAdapter = NULL;
126  }
127 
128  for (int i=0;i<3;i++) {
129 #ifndef WAVERT
130  if (DMAChannel[i]) {
131  DMAChannel[i]->Release();
132  DMAChannel[i] = NULL;
133  }
134 #endif
135  if (isStreamRunning[i]) {
136  isStreamRunning[i] = false;
137  stream[i]->Release();
138  stream[i] = NULL;
139  }
140  }
141 
142  if (Port) {
143  Port->Release();
144  Port = NULL;
145  }
146 }
#define DBGPRINT(...)
Definition: pdo.c:21
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
PDMACHANNEL DMAChannel[3]
Definition: minwave.hpp:53
bool isStreamRunning[3]
Definition: minwave.hpp:62
PPORTWAVECYCLIC Port
Definition: minwave.hpp:52
Definition: parse.h:22
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
NTSTATUS storeChannelConfigToRegistry()
Definition: minwave.cpp:294
#define PAGED_CODE()

Member Function Documentation

◆ DECLARE_STD_UNKNOWN()

CMiniportWaveCMI::DECLARE_STD_UNKNOWN ( )

◆ DEFINE_STD_CONSTRUCTOR()

CMiniportWaveCMI::DEFINE_STD_CONSTRUCTOR ( CMiniportWaveCMI  )

◆ isFormatAllowed()

NTSTATUS CMiniportWaveCMI::isFormatAllowed ( UInt32  sampleRate,
BOOLEAN  multiChan,
BOOLEAN  AC3 
)
private

Definition at line 380 of file minwave.cpp.

381 {
382  PAGED_CODE();
383  ASSERT(sampleRate);
384  DBGPRINT(("CMiniportWaveCMI[%p]::isFormatAllowed(%d, %d, %d)", this, sampleRate, multiChan, AC3));
385 
386  if (multiChan) {
387  switch (sampleRate) {
388  case 44100: if (cm->formatMask & FMT_441_MULTI_PCM) return STATUS_SUCCESS; break;
389  case 48000: if (cm->formatMask & FMT_480_MULTI_PCM) return STATUS_SUCCESS; break;
390  case 88200: if (cm->formatMask & FMT_882_MULTI_PCM) return STATUS_SUCCESS; break;
391  case 96000: if (cm->formatMask & FMT_960_MULTI_PCM) return STATUS_SUCCESS; break;
392  }
394  }
395  if (AC3) {
396  switch (sampleRate) {
397  case 44100: if (cm->formatMask & FMT_441_DOLBY) return STATUS_SUCCESS; break;
398  case 48000: if (cm->formatMask & FMT_480_DOLBY) return STATUS_SUCCESS; break;
399  case 88200: if (cm->formatMask & FMT_882_DOLBY) return STATUS_SUCCESS; break;
400  case 96000: if (cm->formatMask & FMT_960_DOLBY) return STATUS_SUCCESS; break;
401  }
403  }
404  switch (sampleRate) {
405  case 44100: if (cm->formatMask & FMT_441_PCM) return STATUS_SUCCESS; break;
406  case 48000: if (cm->formatMask & FMT_480_PCM) return STATUS_SUCCESS; break;
407  case 88200: if (cm->formatMask & FMT_882_PCM) return STATUS_SUCCESS; break;
408  case 96000: if (cm->formatMask & FMT_960_PCM) return STATUS_SUCCESS; break;
409  }
411 }
#define FMT_882_DOLBY
Definition: property.h:52
#define DBGPRINT(...)
Definition: pdo.c:21
#define FMT_480_MULTI_PCM
Definition: property.h:47
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define FMT_480_PCM
Definition: property.h:43
#define FMT_441_PCM
Definition: property.h:42
#define FMT_441_DOLBY
Definition: property.h:50
#define FMT_960_MULTI_PCM
Definition: property.h:49
CMI8738Info * cm
Definition: minwave.hpp:56
#define ASSERT(a)
Definition: mode.c:45
UInt32 formatMask
Definition: interfaces.hpp:148
#define FMT_960_PCM
Definition: property.h:45
#define FMT_480_DOLBY
Definition: property.h:51
#define FMT_882_MULTI_PCM
Definition: property.h:48
#define FMT_960_DOLBY
Definition: property.h:53
#define FMT_882_PCM
Definition: property.h:44
#define STATUS_SUCCESS
Definition: shellext.h:65
#define FMT_441_MULTI_PCM
Definition: property.h:46
#define PAGED_CODE()

Referenced by validateFormat().

◆ loadChannelConfigFromRegistry()

NTSTATUS CMiniportWaveCMI::loadChannelConfigFromRegistry ( )
private

Definition at line 232 of file minwave.cpp.

233 {
234  PAGED_CODE();
235  PREGISTRYKEY DriverKey;
236  PREGISTRYKEY SettingsKey;
239  PVOID KeyInfo;
240 
241  DBGPRINT(("CMiniportWaveCMI::loadChannelConfigFromRegistry()"));
242 
243  if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
244  return STATUS_UNSUCCESSFUL;
245  }
246 
247  NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
248 
249  if(!NT_SUCCESS(ntStatus)) {
250  DBGPRINT(("PcNewRegistryKey() failed"));
251  return STATUS_UNSUCCESSFUL;
252  }
253 
254  RtlInitUnicodeString(&KeyName, L"Settings");
255 
256  ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
257  if(!NT_SUCCESS(ntStatus)) {
258  DBGPRINT(("DriverKey->NewSubKey() failed"));
259  return STATUS_UNSUCCESSFUL;
260  }
261 
262  KeyInfo = ExAllocatePoolWithTag(PagedPool, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), 'gnaa');
263  if (KeyInfo) {
264  RtlInitUnicodeString(&KeyName, L"ChannelCount");
265  ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
266  if (NT_SUCCESS (ntStatus)) {
268  if (PartialInfo->DataLength == sizeof(DWORD)) {
269  requestedChannelCount = (*(PLONG)PartialInfo->Data);
270  }
271  } else {
273  }
274 
275  RtlInitUnicodeString(&KeyName, L"ChannelMask");
276  ntStatus = SettingsKey->QueryValueKey(&KeyName, KeyValuePartialInformation, KeyInfo, sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD), &ResultLength);
277  if (NT_SUCCESS (ntStatus)) {
279  if (PartialInfo->DataLength == sizeof(DWORD)) {
280  requestedChannelMask = (*(PLONG)PartialInfo->Data);
281  }
282  } else {
284  }
285  }
286  ExFreePoolWithTag(KeyInfo,'gnaa');
287 
288  SettingsKey->Release();
289  DriverKey->Release();
290 
291  return STATUS_SUCCESS;
292 }
UInt32 requestedChannelCount
Definition: minwave.hpp:57
#define DBGPRINT(...)
Definition: pdo.c:21
#define KSAUDIO_SPEAKER_STEREO
Definition: ksmedia.h:1354
LONG NTSTATUS
Definition: precomp.h:26
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
IRegistryKey * PREGISTRYKEY
Definition: portcls.h:999
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
UInt32 requestedChannelMask
Definition: minwave.hpp:58
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
static const WCHAR L[]
Definition: oid.c:1250
NTSTATUS NTAPI PcNewRegistryKey(OUT PREGISTRYKEY *OutRegistryKey, IN PUNKNOWN OuterUnknown OPTIONAL, IN ULONG RegistryKeyType, IN ACCESS_MASK DesiredAccess, IN PVOID DeviceObject OPTIONAL, IN PVOID SubDevice OPTIONAL, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG CreateOptions OPTIONAL, OUT PULONG Disposition OPTIONAL)
Definition: registry.cpp:281
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define NULL
Definition: types.h:112
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
signed int * PLONG
Definition: retypes.h:5
#define PAGED_CODE()

◆ newDMAChannel()

NTSTATUS CMiniportWaveCMI::newDMAChannel ( PDMACHANNEL dmaChannel,
UInt32  bufferLength 
)
private

Definition at line 61 of file minwave.cpp.

62 {
63  PAGED_CODE();
64  ASSERT(dmaChannel);
65  DBGPRINT(("CMiniportWaveCMI[%p]::newDMAChannel(%p)", this, dmaChannel));
66 
67  NTSTATUS ntStatus;
68 
69  ntStatus = Port->NewMasterDmaChannel(dmaChannel, NULL, NULL, bufferLength, TRUE, FALSE, (DMA_WIDTH)(-1), (DMA_SPEED)(-1));
70  if (NT_SUCCESS(ntStatus)) {
71  ULONG lDMABufferLength = bufferLength;
72  do {
73  ntStatus = (*dmaChannel)->AllocateBuffer(lDMABufferLength, NULL);
74  lDMABufferLength >>= 1;
75  } while (!NT_SUCCESS(ntStatus) && (lDMABufferLength > (PAGE_SIZE / 2)));
76  }
77  return ntStatus;
78 }
#define DBGPRINT(...)
Definition: pdo.c:21
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
enum _DMA_WIDTH DMA_WIDTH
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:107
#define FALSE
Definition: types.h:117
PPORTWAVECYCLIC Port
Definition: minwave.hpp:52
#define ASSERT(a)
Definition: mode.c:45
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PAGE_SIZE
Definition: env_spec_w32.h:49
enum _DMA_SPEED DMA_SPEED
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define PAGED_CODE()

◆ processResources()

NTSTATUS CMiniportWaveCMI::processResources ( PRESOURCELIST  resourceList)
private

Definition at line 47 of file minwave.cpp.

48 {
49  PAGED_CODE();
50  ASSERT (resourceList);
51  DBGPRINT(("CMiniportWaveCMI[%p]::ProcessResources(%p)", this, resourceList));
52 
53  if (resourceList->NumberOfInterrupts() < 1) {
54  DBGPRINT(("Unknown configuration for wave miniport"));
56  }
57  return STATUS_SUCCESS;
58 }
#define DBGPRINT(...)
Definition: pdo.c:21
#define ASSERT(a)
Definition: mode.c:45
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_DEVICE_CONFIGURATION_ERROR
Definition: ntstatus.h:619
#define PAGED_CODE()

◆ STDMETHODIMP_() [1/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [2/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [3/3]

CMiniportWaveCMI::STDMETHODIMP_ ( void  )

◆ storeChannelConfigToRegistry()

NTSTATUS CMiniportWaveCMI::storeChannelConfigToRegistry ( )
private

Definition at line 294 of file minwave.cpp.

295 {
296  PAGED_CODE();
297  PREGISTRYKEY DriverKey;
298  PREGISTRYKEY SettingsKey;
300  DWORD Value;
301  DBGPRINT(("CMiniportWaveCMI::storeChannelConfigToRegistry()"));
302 
303  if ((!CMIAdapter) || (!(CMIAdapter->getDeviceObject()))) {
304  return STATUS_UNSUCCESSFUL;
305  }
306 
307  NTSTATUS ntStatus = PcNewRegistryKey(&DriverKey, NULL, DriverRegistryKey, KEY_ALL_ACCESS, CMIAdapter->getDeviceObject(), NULL, NULL, 0, NULL);
308 
309  if(!NT_SUCCESS(ntStatus)) {
310  DBGPRINT(("PcNewRegistryKey() failed"));
311  return STATUS_UNSUCCESSFUL;
312  }
313 
314  RtlInitUnicodeString(&KeyName, L"Settings");
315 
316  ntStatus = DriverKey->NewSubKey(&SettingsKey, NULL, KEY_ALL_ACCESS, &KeyName, REG_OPTION_NON_VOLATILE, NULL);
317  if(!NT_SUCCESS(ntStatus)) {
318  DBGPRINT(("DriverKey->NewSubKey() failed"));
319  return STATUS_UNSUCCESSFUL;
320  }
321 
323  RtlInitUnicodeString(&KeyName, L"ChannelCount");
324  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
325  if (!NT_SUCCESS(ntStatus)) {
326  DBGPRINT(("SetValueKey() failed"));
327  }
329  RtlInitUnicodeString(&KeyName, L"ChannelMask");
330  ntStatus = SettingsKey->SetValueKey(&KeyName, REG_DWORD, PVOID(&Value), sizeof(DWORD));
331  if (!NT_SUCCESS(ntStatus)) {
332  DBGPRINT(("SetValueKey() failed"));
333  }
334 
335  SettingsKey->Release();
336  DriverKey->Release();
337 
338  return STATUS_SUCCESS;
339 }
UInt32 requestedChannelCount
Definition: minwave.hpp:57
#define DBGPRINT(...)
Definition: pdo.c:21
LONG NTSTATUS
Definition: precomp.h:26
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
void * PVOID
Definition: retypes.h:9
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
IRegistryKey * PREGISTRYKEY
Definition: portcls.h:999
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
UInt32 requestedChannelMask
Definition: minwave.hpp:58
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static const WCHAR L[]
Definition: oid.c:1250
NTSTATUS NTAPI PcNewRegistryKey(OUT PREGISTRYKEY *OutRegistryKey, IN PUNKNOWN OuterUnknown OPTIONAL, IN ULONG RegistryKeyType, IN ACCESS_MASK DesiredAccess, IN PVOID DeviceObject OPTIONAL, IN PVOID SubDevice OPTIONAL, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG CreateOptions OPTIONAL, OUT PULONG Disposition OPTIONAL)
Definition: registry.cpp:281
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define NULL
Definition: types.h:112
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STATUS_SUCCESS
Definition: shellext.h:65
#define REG_DWORD
Definition: sdbapi.c:596
#define PAGED_CODE()

Referenced by ~CMiniportWaveCMI().

◆ validateFormat()

NTSTATUS CMiniportWaveCMI::validateFormat ( PKSDATAFORMAT  format,
ULONG  PinID,
BOOLEAN  capture 
)
private

Definition at line 413 of file minwave.cpp.

414 {
415  PAGED_CODE();
416  ASSERT(format);
417  DBGPRINT(("CMiniportWaveCMI[%p]::validateFormat(%p, %d, %d)", this, format, PinID, capture));
418 
419  PWAVEFORMATEX waveFormat = PWAVEFORMATEX(format + 1);
420  DBGPRINT(("---channels: %d, resolution: %d, sample rate: %d, pin: %d, formatMask: %x", waveFormat->nChannels, waveFormat->wBitsPerSample, waveFormat->nSamplesPerSec, PinID, cm->formatMask));
421 
422 //WaveFormatEx
423  if ( ( format->FormatSize >= sizeof(KSDATAFORMAT_WAVEFORMATEX))
426  switch (EXTRACT_WAVEFORMATEX_ID(&format->SubFormat)) {
427  case WAVE_FORMAT_PCM:
428  if ((PinID != PIN_WAVE_RENDER_SINK) && (PinID != PIN_WAVE_CAPTURE_SOURCE) && (PinID != ((ULONG)-1))) {
429  if ((PinID == PIN_WAVE_AC3_RENDER_SINK) && !IoIsWdmVersionAvailable(6,0)) {
431  }
432  }
433 
434  if ( ((waveFormat->wBitsPerSample == 16) || (waveFormat->wBitsPerSample == 32))
435  && ((waveFormat->nSamplesPerSec == 44100) || (waveFormat->nSamplesPerSec == 48000) || (waveFormat->nSamplesPerSec == 88200) || (waveFormat->nSamplesPerSec == 96000))
436  && (waveFormat->nChannels == 2) ) {
437  if ((capture) && (waveFormat->nSamplesPerSec > 48000) ) {
439  }
440  return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, FALSE);
441  }
442  if ( (waveFormat->wBitsPerSample == 16)
443  && ((waveFormat->nChannels >= 4) && (waveFormat->nChannels <= cm->maxChannels))
444  && ((waveFormat->nSamplesPerSec == 44100) || (waveFormat->nSamplesPerSec == 48000)) ) {
445 #if OUT_CHANNEL == 1
446  if ((PinID == PIN_WAVE_RENDER_SINK) || (PinID == ((ULONG)-1))) {
447  return isFormatAllowed(waveFormat->nSamplesPerSec, TRUE, FALSE);
448  }
449 #else
451 #endif
452  }
453  break;
455  if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && (PinID != ((ULONG)-1))) {
457  }
458  if ( ((waveFormat->wBitsPerSample >= MIN_BITS_PER_SAMPLE_AC3) && (waveFormat->wBitsPerSample <= MAX_BITS_PER_SAMPLE_AC3))
459  && ((waveFormat->nSamplesPerSec >= MIN_SAMPLE_RATE_AC3) && (waveFormat->nSamplesPerSec <= MAX_SAMPLE_RATE_AC3))
460  && (waveFormat->nChannels == MAX_CHANNELS_AC3) ) {
461  return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, TRUE);
462  }
463  break;
465  if ((PinID != PIN_WAVE_AC3_RENDER_SINK) && (PinID != ((ULONG)-1))) {
467  }
468  if ( ((waveFormat->wBitsPerSample >= MIN_BITS_PER_SAMPLE_WMA) && (waveFormat->wBitsPerSample <= MAX_BITS_PER_SAMPLE_WMA))
469  && ((waveFormat->nSamplesPerSec >= MIN_SAMPLE_RATE_WMA) && (waveFormat->nSamplesPerSec <= MAX_SAMPLE_RATE_WMA))
470  && (waveFormat->nChannels == MAX_CHANNELS_WMA) ) {
471  return isFormatAllowed(waveFormat->nSamplesPerSec, FALSE, TRUE);
472  }
473  break;
474  }
475  }
476 
478 }
#define MAX_SAMPLE_RATE_AC3
Definition: interfaces.hpp:53
#define DBGPRINT(...)
Definition: pdo.c:21
struct _WAVEFORMATEX * PWAVEFORMATEX
#define MIN_SAMPLE_RATE_WMA
Definition: interfaces.hpp:59
NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
Definition: minwave.cpp:380
#define TRUE
Definition: types.h:120
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define MIN_BITS_PER_SAMPLE_WMA
Definition: interfaces.hpp:57
WORD nChannels
Definition: mmreg.h:79
#define MIN_BITS_PER_SAMPLE_AC3
Definition: interfaces.hpp:50
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:931
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:240
#define WAVE_FORMAT_DOLBY_AC3_SPDIF
Definition: mmreg.h:129
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define MAX_BITS_PER_SAMPLE_AC3
Definition: interfaces.hpp:51
#define FALSE
Definition: types.h:117
#define MAX_CHANNELS_WMA
Definition: interfaces.hpp:56
#define EXTRACT_WAVEFORMATEX_ID(Guid)
Definition: ksmedia.h:127
#define MAX_CHANNELS_AC3
Definition: interfaces.hpp:49
CMI8738Info * cm
Definition: minwave.hpp:56
#define ASSERT(a)
Definition: mode.c:45
UInt32 formatMask
Definition: interfaces.hpp:148
UInt32 maxChannels
Definition: interfaces.hpp:136
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:883
#define MAX_BITS_PER_SAMPLE_WMA
Definition: interfaces.hpp:58
#define MIN_SAMPLE_RATE_AC3
Definition: interfaces.hpp:52
#define MAX_SAMPLE_RATE_WMA
Definition: interfaces.hpp:60
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD wBitsPerSample
Definition: mmreg.h:83
unsigned int ULONG
Definition: retypes.h:1
#define WAVE_FORMAT_WMA_SPDIF
BOOLEAN NTAPI IoIsWdmVersionAvailable(IN UCHAR MajorVersion, IN UCHAR MinorVersion)
Definition: util.c:126
#define PAGED_CODE()

Friends And Related Function Documentation

◆ CMiniportWaveStreamCMI

Definition at line 89 of file minwave.hpp.

◆ PropertyHandler_ChannelConfig

NTSTATUS NTAPI PropertyHandler_ChannelConfig ( PPCPROPERTY_REQUEST  PropertyRequest)
friend

Member Data Documentation

◆ cm

CMI8738Info* CMiniportWaveCMI::cm
private

Definition at line 56 of file minwave.hpp.

Referenced by isFormatAllowed(), STDMETHODIMP_(), and validateFormat().

◆ CMIAdapter

PCMIADAPTER CMiniportWaveCMI::CMIAdapter
private

◆ DMAChannel

PDMACHANNEL CMiniportWaveCMI::DMAChannel[3]
private

Definition at line 53 of file minwave.hpp.

Referenced by ~CMiniportWaveCMI().

◆ IMP_IMiniportWaveCyclic

CMiniportWaveCMI::IMP_IMiniportWaveCyclic

Definition at line 81 of file minwave.hpp.

◆ isStreamRunning

bool CMiniportWaveCMI::isStreamRunning[3]
private

Definition at line 62 of file minwave.hpp.

Referenced by STDMETHODIMP_(), and ~CMiniportWaveCMI().

◆ mutex

KMUTEX CMiniportWaveCMI::mutex
private

Definition at line 63 of file minwave.hpp.

◆ notificationInterval

UInt32 CMiniportWaveCMI::notificationInterval
private

Definition at line 54 of file minwave.hpp.

◆ Port

PPORTWAVECYCLIC CMiniportWaveCMI::Port
private

Definition at line 52 of file minwave.hpp.

Referenced by newDMAChannel(), and ~CMiniportWaveCMI().

◆ requestedChannelCount

UInt32 CMiniportWaveCMI::requestedChannelCount
private

Definition at line 57 of file minwave.hpp.

Referenced by loadChannelConfigFromRegistry(), and storeChannelConfigToRegistry().

◆ requestedChannelMask

UInt32 CMiniportWaveCMI::requestedChannelMask
private

Definition at line 58 of file minwave.hpp.

Referenced by loadChannelConfigFromRegistry(), and storeChannelConfigToRegistry().

◆ stream

CMiniportWaveStreamCMI* CMiniportWaveCMI::stream[3]
private

Definition at line 61 of file minwave.hpp.


The documentation for this class was generated from the following files: