Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Con un flusso aperto, un driver subunit può iniziare a collegare esempi di flusso a AV/C Streaming. Questi esempi possono essere operazioni di lettura o scrittura e possono essere inviate allo stesso modo al driver di filtro AV/C Streaming, Avcstrm.sys. Questo servizio è sempre asincrono a causa della dipendenza dallo stato del flusso corrente e dalla disponibilità dei dati di flusso.
INIT_AVCSTRM_HEADER(pAVCStrmReq, (pSrb->Command == SRB_READ_DATA) ? <mark type="enumval">AVCSTRM_READ</mark> : AVCSTRM_WRITE);
pAVCStrmReq->AVCStreamContext = pStrmExt->AVCStreamContext; // from cached context saved in OPEN_STREAM request
// Avcstrm.sys does not act as a clock provider. The subunit driver must provide this functionality if it wants to be the clock provider.
pAVCStrmReq->CommandData.BufferStruct.StreamHeader = pSrb->CommandData.DataBufferArray;
pAVCStrmReq->CommandData.BufferStruct.FrameBuffer =
MmGetSystemAddressForMdlSafe(pSrb->Irp->MdlAddress, NormalPagePriority);
// This is an asynchronous operation
NextIrpStack = IoGetNextIrpStackLocation(pIrpReq);
NextIrpStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
NextIrpStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_AVCSTRM_CLASS;
NextIrpStack->Parameters.Others.Argument1 = pAVCStrmReq;
// Cannot be canceled! Use <mark type="enumval">AVCSTRM_ABORT_STREAMING</mark> to abort
IoSetCancelRoutine(
pIrpReq,
NULL
);
IoSetCompletionRoutine(
pIrpReq,
AVCTapeReqReadDataCR,
pDriverReq,
TRUE, // Success
TRUE, // Error
TRUE // or Cancel
);
pSrb->Status = STATUS_PENDING;
Status =
IoCallDriver(
pDevExt->pBusDeviceObject,
pIrpReq
);
Poiché l'operazione è asincrona, lo stato deve essere STATUS_PENDING. Al termine dei dati, verrà chiamata la routine di completamento. Nella routine di completamento, un driver subunit può eseguire l'elaborazione post-elaborazione, inclusi l'aggiornamento delle statistiche dei dati elaborati e eventualmente aggiungere l'ora di presentazione se la subunit è il provider di orologio.
// Keep track of the number of frames processed
pStrmExt->FramesProcessed++;
// Retrieve current stream time
if(pStrmExt->hMasterClock)
pStrmExt->CurrentStreamTime = pSrb->CommandData.DataBufferArray->PresentationTime.Time;
// Update final status
pSrb->Status = pIrpReq->IoStatus.Status;
// Complete this data SRB
StreamClassStreamNotification(
StreamRequestComplete,
pSrb->StreamObject,
pSrb
);