ReactOS  0.4.14-dev-49-gfb4591c
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 1396 of file pin_wavecyclic.cpp.

1398 {
1400 
1402  if (!This)
1404 
1405  This->AddRef();
1406 
1407  // store result
1408  *OutPin = (IPortPinWaveCyclic*)This;
1409 
1410  return STATUS_SUCCESS;
1411 }
#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:2966

◆ PinSetStateWorkerRoutine()

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

Definition at line 410 of file pin_wavecyclic.cpp.

413 {
414  PSETPIN_CONTEXT PinWorkContext = (PSETPIN_CONTEXT)Context;
416 
417  // try set stream
418  Status = PinWorkContext->Pin->m_Stream->SetState(PinWorkContext->NewState);
419 
420  DPRINT1("Setting state %u %x\n", PinWorkContext->NewState, Status);
421  if (NT_SUCCESS(Status))
422  {
423  // store new state
424  PinWorkContext->Pin->m_State = PinWorkContext->NewState;
425 
426  if (PinWorkContext->Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && PinWorkContext->Pin->m_State == KSSTATE_STOP)
427  {
428  /* FIXME complete pending irps with successful state */
429  PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
430  }
431  //HACK
432  //PinWorkContext->Pin->m_IrpQueue->CancelBuffers();
433  }
434 
435  // store result
436  PinWorkContext->Irp->IoStatus.Information = sizeof(KSSTATE);
437  PinWorkContext->Irp->IoStatus.Status = Status;
438 
439  // complete irp
440  IoCompleteRequest(PinWorkContext->Irp, IO_NO_INCREMENT);
441 
442  // free work item
443  IoFreeWorkItem(PinWorkContext->WorkItem);
444 
445  // free work context
446  FreeItem(PinWorkContext, TAG_PORTCLASS);
447 
448 }
KSPIN_INTERFACE Interface
Definition: ks.h:2601
#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:1214
#define DPRINT1
Definition: precomp.h:8
PKSPIN_CONNECT m_ConnectDetails
#define IO_NO_INCREMENT
Definition: iotypes.h:566

◆ PinWaveCyclicAddEndOfStreamEvent()

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

Definition at line 238 of file pin_wavecyclic.cpp.

242 {
246 
247  // get sub device descriptor
248  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
249 
250  // sanity check
252  PC_ASSERT(Descriptor->PortPin);
254 
255  // cast to pin impl
256  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
257 
258  // get extra size
259  Entry = (PENDOFSTREAM_EVENT_CONTEXT)(EventEntry + 1);
260 
261  // not a looped event
262  Entry->bLoopedStreaming = FALSE;
263 
264  // insert item
265  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
266 
267  // done
268  return STATUS_SUCCESS;
269 }
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:2966
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 273 of file pin_wavecyclic.cpp.

277 {
282 
283  // get sub device descriptor
284  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
285 
286  // sanity check
288  PC_ASSERT(Descriptor->PortPin);
290 
291  // cast to pin impl
292  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
293 
294  // cast to looped event
296 
297  // get extra size
298  Entry = (PLOOPEDSTREAMING_EVENT_CONTEXT)(EventEntry + 1);
299 
300  Entry->bLoopedStreaming = TRUE;
301  Entry->Position = Data->Position;
302 
303  DPRINT1("Added event\n");
304 
305  // insert item
306  (void)ExInterlockedInsertTailList(&Pin->m_EventList, &EventEntry->ListEntry, &Pin->m_EventListLock);
307 
308  // done
309  return STATUS_SUCCESS;
310 }
#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:2966
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 314 of file pin_wavecyclic.cpp.

318 {
321 
322  // get sub device descriptor
323  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSEVENT_ITEM_IRP_STORAGE(Irp);
324 
325  // sanity check
327  PC_ASSERT(Descriptor->PortPin);
329 
330  // cast to pin impl
331  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
332 
333 
334  if (Request->Flags & KSPROPERTY_TYPE_GET)
335  {
336  // copy pin framing
337  RtlMoveMemory(Data, &Pin->m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING));
338 
339  Irp->IoStatus.Information = sizeof(KSALLOCATOR_FRAMING);
340  return STATUS_SUCCESS;
341  }
342 
343  // not supported
344  return STATUS_NOT_SUPPORTED;
345 }
#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:2966
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 349 of file pin_wavecyclic.cpp.

353 {
357 
358  // get sub device descriptor
359  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
360 
361  // sanity check
363  PC_ASSERT(Descriptor->PortPin);
365 
366  // cast to pin impl
367  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
368 
369  //sanity check
370  PC_ASSERT(Pin->m_Stream);
371 
372  if (Request->Flags & KSPROPERTY_TYPE_GET)
373  {
374  // FIXME non multithreading-safe
375  // copy audio position
376 
378 
379  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_STREAMING)
380  {
381  RtlMoveMemory(Data, &Pin->m_Position, sizeof(KSAUDIO_POSITION));
382  DPRINT("Play %lu Record %lu\n", Pin->m_Position.PlayOffset, Pin->m_Position.WriteOffset);
383  }
384  else if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING)
385  {
386  Position->PlayOffset = Pin->m_Position.PlayOffset;
387  Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset();
388  DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset);
389  }
390 
391  Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION);
392  return STATUS_SUCCESS;
393  }
394 
395  // not supported
396  return STATUS_NOT_SUPPORTED;
397 }
#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:2966
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 525 of file pin_wavecyclic.cpp.

529 {
533  PIO_STACK_LOCATION IoStack;
534 
535  // get current irp stack location
537 
538  // get sub device descriptor
539  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
540 
541  // sanity check
543  PC_ASSERT(Descriptor->PortPin);
544 
545  // cast to pin impl
546  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
547 
548  //sanity check
549  PC_ASSERT(Pin->m_Stream);
550  PC_ASSERT(Pin->m_Format);
551 
552  if (Request->Flags & KSPROPERTY_TYPE_SET)
553  {
554  // try to change data format
555  PKSDATAFORMAT NewDataFormat, DataFormat = (PKSDATAFORMAT)Irp->UserBuffer;
556  ULONG Size = min(Pin->m_Format->FormatSize, DataFormat->FormatSize);
557 
558  if (RtlCompareMemory(DataFormat, Pin->m_Format, Size) == Size)
559  {
560  // format is identical
561  Irp->IoStatus.Information = DataFormat->FormatSize;
562  return STATUS_SUCCESS;
563  }
564 
565  // new change request
566  PC_ASSERT(Pin->m_State != KSSTATE_RUN);
567  // FIXME queue a work item when Irql != PASSIVE_LEVEL
569 
570  // allocate new data format
571  NewDataFormat = (PKSDATAFORMAT)AllocateItem(NonPagedPool, DataFormat->FormatSize, TAG_PORTCLASS);
572  if (!NewDataFormat)
573  {
574  // not enough memory
575  return STATUS_NO_MEMORY;
576  }
577 
578  // copy new data format
579  RtlMoveMemory(NewDataFormat, DataFormat, DataFormat->FormatSize);
580 
581  // set new format
582  Status = Pin->m_Stream->SetFormat(NewDataFormat);
583  if (NT_SUCCESS(Status))
584  {
585  // free old format
586  FreeItem(Pin->m_Format, TAG_PORTCLASS);
587 
588  // store new format
589  Pin->m_Format = NewDataFormat;
590  Irp->IoStatus.Information = NewDataFormat->FormatSize;
591 
592 #if 0
593  PC_ASSERT(NewDataFormat->FormatSize == sizeof(KSDATAFORMAT_WAVEFORMATEX));
597 
598 
599  DPRINT("NewDataFormat: Channels %u Bits %u Samples %u\n", ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nChannels,
600  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.wBitsPerSample,
601  ((PKSDATAFORMAT_WAVEFORMATEX)NewDataFormat)->WaveFormatEx.nSamplesPerSec);
602 #endif
603 
604  }
605  else
606  {
607  // failed to set format
608  FreeItem(NewDataFormat, TAG_PORTCLASS);
609  }
610 
611 
612  // done
613  return Status;
614  }
615  else if (Request->Flags & KSPROPERTY_TYPE_GET)
616  {
617  // get current data format
618  PC_ASSERT(Pin->m_Format);
619 
620  if (Pin->m_Format->FormatSize > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
621  {
622  // buffer too small
623  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
624  return STATUS_MORE_ENTRIES;
625  }
626  // copy data format
627  RtlMoveMemory(Data, Pin->m_Format, Pin->m_Format->FormatSize);
628  // store result size
629  Irp->IoStatus.Information = Pin->m_Format->FormatSize;
630 
631  // done
632  return STATUS_SUCCESS;
633  }
634 
635  // unsupported request
636  return STATUS_NOT_SUPPORTED;
637 }
#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:2772
return STATUS_SUCCESS
Definition: btrfs.c:2966
#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 225 of file pin_wavecyclic.cpp.

229 {
230  DPRINT1("PinWaveCyclicDRMHandler\n");
231  ASSERT(0);
233 }
#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 453 of file pin_wavecyclic.cpp.

457 {
462 
463  // get sub device descriptor
464  Descriptor = (PSUBDEVICE_DESCRIPTOR)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
465 
466  // sanity check
468  PC_ASSERT(Descriptor->PortPin);
470 
471  // cast to pin impl
472  Pin = (CPortPinWaveCyclic*)Descriptor->PortPin;
473 
474  //sanity check
475  PC_ASSERT(Pin->m_Stream);
476 
477  if (Request->Flags & KSPROPERTY_TYPE_SET)
478  {
479  // try set stream
480  Status = Pin->m_Stream->SetState(*State);
481 
482  DPRINT("Setting state %u %x\n", *State, Status);
483  if (NT_SUCCESS(Status))
484  {
485  // store new state
486  Pin->m_State = *State;
487 
488  if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP)
489  {
490  // FIXME
491  // complete with successful state
492  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
493  Pin->m_IrpQueue->CancelBuffers();
494  Pin->m_Position.PlayOffset = 0;
495  Pin->m_Position.WriteOffset = 0;
496  }
497  else if (Pin->m_State == KSSTATE_STOP)
498  {
499  Pin->m_Stream->Silence(Pin->m_CommonBuffer, Pin->m_CommonBufferSize);
500  Pin->m_IrpQueue->CancelBuffers();
501  Pin->m_Position.PlayOffset = 0;
502  Pin->m_Position.WriteOffset = 0;
503  }
504  // store result
505  Irp->IoStatus.Information = sizeof(KSSTATE);
506  }
507  return Status;
508  }
509  else if (Request->Flags & KSPROPERTY_TYPE_GET)
510  {
511  // get current stream state
512  *State = Pin->m_State;
513  // store result
514  Irp->IoStatus.Information = sizeof(KSSTATE);
515 
516  return STATUS_SUCCESS;
517  }
518 
519  // unsupported request
520  return STATUS_NOT_SUPPORTED;
521 }
#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:1214
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
return STATUS_SUCCESS
Definition: btrfs.c:2966
#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 134 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 180 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:346
smooth NULL
Definition: ftsmooth.c:416

Definition at line 155 of file pin_wavecyclic.cpp.

◆ PinWaveCyclicStreamingEventSet

KSEVENT_ITEM PinWaveCyclicStreamingEventSet
Initial value:

Definition at line 144 of file pin_wavecyclic.cpp.