ReactOS  0.4.13-dev-482-ge57f103
pin_wavecyclic.cpp File Reference
#include "private.hpp"
#include <debug.h>
Include dependency graph for pin_wavecyclic.cpp:

Go to the source code of this file.

Classes

class  CPortPinWaveCyclic
 
struct  LOOPEDSTREAMING_EVENT_CONTEXT
 
struct  ENDOFSTREAM_EVENT_CONTEXT
 
struct  SETPIN_CONTEXT
 

Macros

#define NDEBUG
 

Typedefs

typedef struct LOOPEDSTREAMING_EVENT_CONTEXTPLOOPEDSTREAMING_EVENT_CONTEXT
 
typedef struct ENDOFSTREAM_EVENT_CONTEXTPENDOFSTREAM_EVENT_CONTEXT
 
typedef struct SETPIN_CONTEXTPSETPIN_CONTEXT
 

Functions

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)
 
NTSTATUS NTAPI PinWaveCyclicAllocatorFraming (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent (IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
 
NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent (IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)
 
NTSTATUS NTAPI PinWaveCyclicDRMHandler (IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
 
 DEFINE_KSPROPERTY_CONNECTIONSET (PinWaveCyclicConnectionSet, PinWaveCyclicState, PinWaveCyclicDataFormat, PinWaveCyclicAllocatorFraming)
 
 DEFINE_KSPROPERTY_AUDIOSET (PinWaveCyclicAudioSet, PinWaveCyclicAudioPosition)
 
 DEFINE_KSPROPERTY_DRMSET (PinWaveCyclicDRMSet, PinWaveCyclicDRMHandler)
 
VOID CALLBACK PinSetStateWorkerRoutine (IN PDEVICE_OBJECT DeviceObject, IN PVOID Context)
 
NTSTATUS NewPortPinWaveCyclic (OUT IPortPinWaveCyclic **OutPin)
 

Variables

KSEVENT_ITEM PinWaveCyclicConnectionEventSet
 
KSEVENT_ITEM PinWaveCyclicStreamingEventSet
 
KSPROPERTY_SET PinWaveCyclicPropertySet []
 
KSEVENT_SET PinWaveCyclicEventSet []
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file pin_wavecyclic.cpp.

Typedef Documentation

◆ PENDOFSTREAM_EVENT_CONTEXT

◆ PLOOPEDSTREAMING_EVENT_CONTEXT

◆ PSETPIN_CONTEXT

Function Documentation

◆ DEFINE_KSPROPERTY_AUDIOSET()

DEFINE_KSPROPERTY_AUDIOSET ( PinWaveCyclicAudioSet  ,
PinWaveCyclicAudioPosition   
)

◆ DEFINE_KSPROPERTY_CONNECTIONSET()

DEFINE_KSPROPERTY_CONNECTIONSET ( PinWaveCyclicConnectionSet  ,
PinWaveCyclicState  ,
PinWaveCyclicDataFormat  ,
PinWaveCyclicAllocatorFraming   
)

◆ DEFINE_KSPROPERTY_DRMSET()

DEFINE_KSPROPERTY_DRMSET ( PinWaveCyclicDRMSet  ,
PinWaveCyclicDRMHandler   
)

◆ NewPortPinWaveCyclic()

NTSTATUS NewPortPinWaveCyclic ( OUT IPortPinWaveCyclic **  OutPin)

Definition at line 1383 of file pin_wavecyclic.cpp.

1385 {
1387 
1389  if (!This)
1391 
1392  This->AddRef();
1393 
1394  // store result
1395  *OutPin = (IPortPinWaveCyclic*)This;
1396 
1397  return STATUS_SUCCESS;
1398 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define TAG_PORTCLASS
Definition: private.hpp:24
smooth NULL
Definition: ftsmooth.c:416
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ PinSetStateWorkerRoutine()

VOID CALLBACK PinSetStateWorkerRoutine ( IN PDEVICE_OBJECT  DeviceObject,
IN PVOID  Context 
)

Definition at line 397 of file pin_wavecyclic.cpp.

400 {
401  PSETPIN_CONTEXT PinWorkContext = (PSETPIN_CONTEXT)Context;
403 
404  // try set stream
405  Status = PinWorkContext->Pin->m_Stream->SetState(PinWorkContext->NewState);
406 
407  DPRINT1("Setting state %u %x\n", PinWorkContext->NewState, Status);
408  if (NT_SUCCESS(Status))
409  {
410  // store new state
411  PinWorkContext->Pin->m_State = PinWorkContext->NewState;
412 
413  if (PinWorkContext->Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && PinWorkContext->Pin->m_State == KSSTATE_STOP)
414  {
415  /* FIXME complete pending irps with successful state */
416  PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
417  }
418  //HACK
419  //PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
420  }
421 
422  // store result
423  PinWorkContext->Irp->IoStatus.Information = sizeof(KSSTATE);
424  PinWorkContext->Irp->IoStatus.Status = Status;
425 
426  // complete irp
427  IoCompleteRequest(PinWorkContext->Irp, IO_NO_INCREMENT);
428 
429  // free work item
430  IoFreeWorkItem(PinWorkContext->WorkItem);
431 
432  // free work context
433  FreeItem(PinWorkContext, TAG_PORTCLASS);
434 
435 }
KSPIN_INTERFACE Interface
Definition: ks.h:2630
#define TAG_PORTCLASS
Definition: private.hpp:24
LONG NTSTATUS
Definition: precomp.h:26
PIO_WORKITEM WorkItem
CPortPinWaveCyclic * Pin
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
struct SETPIN_CONTEXT * PSETPIN_CONTEXT
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
IIrpQueue * m_IrpQueue
#define IoCompleteRequest
Definition: irp.c:1240
ULONG Id
Definition: dmksctrl.h:77
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PMINIPORTWAVECYCLICSTREAM m_Stream
Status
Definition: gdiplustypes.h:24
KSSTATE
Definition: ks.h:1244
#define DPRINT1
Definition: precomp.h:8
PKSPIN_CONNECT m_ConnectDetails
#define IO_NO_INCREMENT
Definition: iotypes.h:565

◆ PinWaveCyclicAddEndOfStreamEvent()

NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent ( IN PIRP  Irp,
IN PKSEVENTDATA  EventData,
IN PKSEVENT_ENTRY  EventEntry 
)

Definition at line 225 of file pin_wavecyclic.cpp.

229 {
233 
234  // get sub device descriptor
235  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
236 
237  // sanity check
239  PC_ASSERT(Descriptor->PortPin);
241 
242  // cast to pin impl
243  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
244 
245  // get extra size
246  Entry = (PENDOFSTREAM_EVENT_CONTEXT)(EventEntry + 1);
247 
248  // not a looped event
249  Entry->bLoopedStreaming = FALSE;
250 
251  // insert item
252  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
253 
254  // done
255  return STATUS_SUCCESS;
256 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define PC_ASSERT(exp)
Definition: usbehci.h:17
struct _Entry Entry
Definition: kefuncs.h:640
_In_ PIRP Irp
Definition: csq.h:116
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
return STATUS_SUCCESS
Definition: btrfs.c:2777
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
base of all file and directory entries
Definition: entries.h:82
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ PinWaveCyclicAddLoopedStreamEvent()

NTSTATUS NTAPI PinWaveCyclicAddLoopedStreamEvent ( IN PIRP  Irp,
IN PKSEVENTDATA  EventData,
IN PKSEVENT_ENTRY  EventEntry 
)

Definition at line 260 of file pin_wavecyclic.cpp.

264 {
269 
270  // get sub device descriptor
271  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
272 
273  // sanity check
275  PC_ASSERT(Descriptor->PortPin);
277 
278  // cast to pin impl
279  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
280 
281  // cast to looped event
283 
284  // get extra size
285  Entry = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1);
286 
287  Entry->bLoopedStreaming = TRUE;
288  Entry->Position = Data->Position;
289 
290  DPRINT1("Added event\n");
291 
292  // insert item
293  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
294 
295  // done
296  return STATUS_SUCCESS;
297 }
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define PC_ASSERT(exp)
Definition: usbehci.h:17
struct _Entry Entry
Definition: kefuncs.h:640
_In_ PIRP Irp
Definition: csq.h:116
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
struct LOOPEDSTREAMING_EVENT_CONTEXT * PLOOPEDSTREAMING_EVENT_CONTEXT
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2777
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
base of all file and directory entries
Definition: entries.h:82
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ PinWaveCyclicAllocatorFraming()

NTSTATUS NTAPI PinWaveCyclicAllocatorFraming ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 301 of file pin_wavecyclic.cpp.

305 {
308 
309  // get sub device descriptor
310  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
311 
312  // sanity check
314  PC_ASSERT(Descriptor->PortPin);
316 
317  // cast to pin impl
318  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
319 
320 
321  if (Request->Flags & KSPROPERTY_TYPE_GET)
322  {
323  // copy pin framing
324  RtlMoveMemory(Data, &Pin->m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING));
325 
326  Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
327  return STATUS_SUCCESS;
328  }
329 
330  // not supported
331  return STATUS_NOT_SUPPORTED;
332 }
#define PC_ASSERT(exp)
Definition: usbehci.h:17
_In_ PIRP Irp
Definition: csq.h:116
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
if(!(yy_init))
Definition: macro.lex.yy.c:714
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
return STATUS_SUCCESS
Definition: btrfs.c:2777
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ PinWaveCyclicAudioPosition()

NTSTATUS NTAPI PinWaveCyclicAudioPosition ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 336 of file pin_wavecyclic.cpp.

340 {
344 
345  // get sub device descriptor
346  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
347 
348  // sanity check
350  PC_ASSERT(Descriptor->PortPin);
352 
353  // cast to pin impl
354  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
355 
356  //sanity check
357  PC_ASSERT(Pin->m_Stream);
358 
359  if (Request->Flags & KSPROPERTY_TYPE_GET)
360  {
361  // FIXME non multithreading-safe
362  // copy audio position
363 
365 
366  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_STREAMING)
367  {
368  RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
369  DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
370  }
371  else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
372  {
373  Position->PlayOffset = Pin->m_Position.PlayOffset;
374  Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
375  DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset);
376  }
377 
378  Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
379  return STATUS_SUCCESS;
380  }
381 
382  // not supported
383  return STATUS_NOT_SUPPORTED;
384 }
#define PC_ASSERT(exp)
Definition: usbehci.h:17
_In_ PIRP Irp
Definition: csq.h:116
static COORD Position
Definition: mouse.c:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
void DPRINT(...)
Definition: polytest.cpp:61
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
uint64_t ULONGLONG
Definition: typedefs.h:65
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
return STATUS_SUCCESS
Definition: btrfs.c:2777
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
struct KSAUDIO_POSITION * PKSAUDIO_POSITION
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ PinWaveCyclicDataFormat()

NTSTATUS NTAPI PinWaveCyclicDataFormat ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 512 of file pin_wavecyclic.cpp.

516 {
520  PIO_STACK_LOCATION IoStack;
521 
522  // get current irp stack location
524 
525  // get sub device descriptor
526  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
527 
528  // sanity check
530  PC_ASSERT(Descriptor->PortPin);
531 
532  // cast to pin impl
533  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
534 
535  //sanity check
536  PC_ASSERT(Pin->m_Stream);
537  PC_ASSERT(Pin->m_Format);
538 
539  if (Request->Flags & KSPROPERTY_TYPE_SET)
540  {
541  // try to change data format
542  PKSDATAFORMAT NewDataFormat, DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
543  ULONG Size = min(Pin->m_Format->FormatSize, DataFormat->FormatSize);
544 
545  if (RtlCompareMemory(DataFormat, Pin->m_Format, Size) == Size)
546  {
547  // format is identical
548  Irp->IoStatus.Information = DataFormat->FormatSize;
549  return STATUS_SUCCESS;
550  }
551 
552  // new change request
553  PC_ASSERT(Pin->m_State != KSSTATE_RUN);
554  // FIXME queue a work item when Irql != PASSIVE_LEVEL
556 
557  // allocate new data format
558  NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
559  if (!NewDataFormat)
560  {
561  // not enough memory
562  return STATUS_NO_MEMORY;
563  }
564 
565  // copy new data format
566  RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
567 
568  // set new format
569  Status = Pin->m_Stream->SetFormat(NewDataFormat);
570  if (NT_SUCCESS(Status))
571  {
572  // free old format
573  FreeItem(Pin->m_Format, TAG_PORTCLASS);
574 
575  // store new format
576  Pin->m_Format = NewDataFormat;
577  Irp->IoStatus.Information = NewDataFormat->FormatSize;
578 
579 #if 0
580  PC_ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
584 
585 
586  DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
587  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
588  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
589 #endif
590 
591  }
592  else
593  {
594  // failed to set format
595  FreeItem(NewDataFormat, TAG_PORTCLASS);
596  }
597 
598 
599  // done
600  return Status;
601  }
602  else if (Request->Flags & KSPROPERTY_TYPE_GET)
603  {
604  // get current data format
605  PC_ASSERT(Pin->m_Format);
606 
607  if (Pin->m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
608  {
609  // buffer too small
610  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
611  return STATUS_MORE_ENTRIES;
612  }
613  // copy data format
614  RtlMoveMemory(Data, Pin->m_Format, Pin->m_Format->FormatSize);
615  // store result size
616  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
617 
618  // done
619  return STATUS_SUCCESS;
620  }
621 
622  // unsupported request
623  return STATUS_NOT_SUPPORTED;
624 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define KSDATAFORMAT_SUBTYPE_PCM
Definition: ksmedia.h:921
#define PC_ASSERT(exp)
Definition: usbehci.h:17
_In_ PIRP Irp
Definition: csq.h:116
#define TAG_PORTCLASS
Definition: private.hpp:24
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
LONG NTSTATUS
Definition: precomp.h:26
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX
Definition: ksmedia.h:931
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
void DPRINT(...)
Definition: polytest.cpp:61
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:883
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
Status
Definition: gdiplustypes.h:24
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define min(a, b)
Definition: monoChain.cc:55
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
KSDATAFORMAT * PKSDATAFORMAT
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

◆ PinWaveCyclicDRMHandler()

NTSTATUS NTAPI PinWaveCyclicDRMHandler ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 212 of file pin_wavecyclic.cpp.

216 {
217  DPRINT1("PinWaveCyclicDRMHandler\n");
218  ASSERT(0);
220 }
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define DPRINT1
Definition: precomp.h:8

◆ PinWaveCyclicState()

NTSTATUS NTAPI PinWaveCyclicState ( IN PIRP  Irp,
IN PKSIDENTIFIER  Request,
IN OUT PVOID  Data 
)

Definition at line 440 of file pin_wavecyclic.cpp.

444 {
449 
450  // get sub device descriptor
451  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
452 
453  // sanity check
455  PC_ASSERT(Descriptor->PortPin);
457 
458  // cast to pin impl
459  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
460 
461  //sanity check
462  PC_ASSERT(Pin->m_Stream);
463 
464  if (Request->Flags & KSPROPERTY_TYPE_SET)
465  {
466  // try set stream
467  Status = Pin->m_Stream->SetState(*State);
468 
469  DPRINT("Setting state %u %x\n", *State, Status);
470  if (NT_SUCCESS(Status))
471  {
472  // store new state
473  Pin->m_State = *State;
474 
475  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP)
476  {
477  // FIXME
478  // complete with successful state
479  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
480  Pin->m_IrpQueue->CancelBuffers();
481  Pin->m_Position.PlayOffset = 0;
482  Pin->m_Position.WriteOffset = 0;
483  }
484  else if (Pin->m_State == KSSTATE_STOP)
485  {
486  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
487  Pin->m_IrpQueue->CancelBuffers();
488  Pin->m_Position.PlayOffset = 0;
489  Pin->m_Position.WriteOffset = 0;
490  }
491  // store result
492  Irp->IoStatus.Information = sizeof(KSSTATE);
493  }
494  return Status;
495  }
496  else if (Request->Flags & KSPROPERTY_TYPE_GET)
497  {
498  // get current stream state
499  *State = Pin->m_State;
500  // store result
501  Irp->IoStatus.Information = sizeof(KSSTATE);
502 
503  return STATUS_SUCCESS;
504  }
505 
506  // unsupported request
507  return STATUS_NOT_SUPPORTED;
508 }
#define PC_ASSERT(exp)
Definition: usbehci.h:17
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
enum KSSTATE * PKSSTATE
void DPRINT(...)
Definition: polytest.cpp:61
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
enum State_ State
Definition: pofuncs.h:54
KSSTATE
Definition: ks.h:1244
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
#define PC_ASSERT_IRQL(x)
Definition: private.hpp:30
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Variable Documentation

◆ PinWaveCyclicConnectionEventSet

KSEVENT_ITEM PinWaveCyclicConnectionEventSet
Initial value:
=
{
sizeof(KSEVENTDATA),
0,
0
}
NTSTATUS NTAPI PinWaveCyclicAddEndOfStreamEvent(IN PIRP Irp, IN PKSEVENTDATA EventData, IN PKSEVENT_ENTRY EventEntry)

Definition at line 121 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicEventSet

KSEVENT_SET PinWaveCyclicEventSet[]
Initial value:
=
{
{
sizeof(PinWaveCyclicStreamingEventSet) / sizeof(KSEVENT_ITEM),
(const KSEVENT_ITEM*)&PinWaveCyclicStreamingEventSet
},
{
sizeof(PinWaveCyclicConnectionEventSet) / sizeof(KSEVENT_ITEM),
(const KSEVENT_ITEM*)&PinWaveCyclicConnectionEventSet
}
}
KSEVENT_ITEM PinWaveCyclicConnectionEventSet
#define KSEVENTSETID_Connection
Definition: ksmedia.h:1036
const GUID KSEVENTSETID_LoopedStreaming
Definition: capturebuffer.c:18
KSEVENT_ITEM PinWaveCyclicStreamingEventSet

Definition at line 167 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicPropertySet

KSPROPERTY_SET PinWaveCyclicPropertySet[]
Initial value:
=
{
{
sizeof(PinWaveCyclicConnectionSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicConnectionSet,
0,
},
{
sizeof(PinWaveCyclicAudioSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicAudioSet,
0,
},
{
sizeof(PinWaveCyclicDRMSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&PinWaveCyclicDRMSet,
0,
}
}
#define KSPROPSETID_DrmAudioStream
Definition: ksmedia.h:1051
#define KSPROPSETID_Audio
Definition: ksmedia.h:951
#define KSPROPSETID_Connection
Definition: ks.h:376
smooth NULL
Definition: ftsmooth.c:416

Definition at line 142 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicStreamingEventSet

KSEVENT_ITEM PinWaveCyclicStreamingEventSet
Initial value:

Definition at line 131 of file pin_wavecyclic.cpp.