IMiniportDMus::NewStream
The NewStream method creates a new instance of a logical stream associated with a specified physical channel.
HRESULT
NewStream(
OUT PMXF *ppMXF,
IN PUNKNOWN pOuterUnknown OPTIONAL,
IN POOL_TYPE PoolType,
IN ULONG uPinId,
IN DMUS_STREAM_TYPE StreamType,
IN PKSDATAFORMAT pDataFormat,
OUT PSERVICEGROUP *ppServiceGroup,
IN PAllocatorMXF pAllocatorMXF,
IN PMASTERCLOCK pMasterClock,
OUT PULONGLONG puuSchedulePreFetch
);
Parameters
- ppMXF
- Output pointer for the new stream. This parameter points to a caller-allocated pointer variable into which the method writes a pointer to the stream object's IMXF interface.
- pOuterUnknown
- Pointer to the IUnknown interface of an object that needs to aggregate the stream object. This parameter is optional. If aggregation is not required, the caller specifies this parameter as NULL.
- PoolType
- Specifies the type of memory pool from which the storage for the DMA-channel object should be allocated. This parameter is set to one of the POOL_TYPE enumeration values.
- uPinId
- Specifies the pin ID. This parameter identifies the pin that is to be opened. If the DMus miniport driver's IMiniport::GetDescription method outputs a filter descriptor that specifies a total of N pin factories on the filter, then valid pin IDs are in the range 0 to N-1.
- StreamType
- Specifies the type of data stream to create. This parameter is set to one of the following DMUS_STREAM_TYPE enumeration values:
- DMUS_STREAM_MIDI_RENDER
- Specifies an output (playback) stream.
- DMUS_STREAM_MIDI_CAPTURE
- Specifies an input stream.
- DMUS_STREAM_WAVE_SINK
- Specifies a wave-out stream.
- pDataFormat
- Pointer to a kernel streaming KSDATAFORMAT structure specifying the data format to use for this instance
- ppServiceGroup
- Output pointer for service group. This parameter points to a caller-allocated pointer variable into which the method writes a pointer to the IServiceGroup interface of the stream's service-group object. This is the service group that is being registered for interrupt notification.
- pAllocatorMXF
- Pointer to an IAllocatorMXF object. This is the port driver's memory allocator, which is needed to recycle DMUS_KERNEL_EVENT structures.
- pMasterClock
- Pointer to an IMasterClock object. This master clock passes a wrapper for the KS clock to the miniport driver. The master-clock pointer is required to sync to reference time.
- puuSchedulePreFetch
- Output pointer for the schedule-prefetch time. This parameter is a pointer to a caller-allocated ULONGLONG variable into which the method writes a time value that specifies how far ahead to query for events. The time is specified in 100-nanosecond units. The port driver is responsible for sequencing any events that exceed the amount of time that the miniport driver specifies here.
Return Value
NewStream returns S_OK if the call was successful. Otherwise, the method returns an appropriate error code.
Headers
Declared in dmusicks.h. Include dmusicks.h.
Comments
Note that the port driver creates the IAllocatorMXF object that the NewStream method inputs through the pAllocatorMXF parameter, but the miniport driver creates the IMXF object that the method outputs through the ppMXF parameter. For more information on IMXF and IAllocatorMXF, see MIDI Transport.
The ppMXF, pOuterUnknown, ppServiceGroup, pAllocatorMXF, and pMasterClock parameters follow the reference-counting conventions for COM objects.
The NewStream method is called at IRQL PASSIVE_LEVEL.
See Also
IMXF, POOL_TYPE, KSDATAFORMAT, IServiceGroup, IAllocatorMXF, DMUS_KERNEL_EVENT, IMasterClock