AVCSTRM_OPEN

Il codice della funzione AVCSTRM_OPEN apre un flusso con un formato di flusso specifico.

Blocco dello stato I/O

Se ha esito positivo, avcstrm.sys imposta Irp-IoStatus.Status> su STATUS_SUCCESS.

In caso di esito positivo, viene restituito un STATUS_SUCCESS insieme al contesto di flusso nel membro AVCStreamContext della struttura AVC_STREAM_REQUEST_BLOCK . Questo contesto viene successivamente usato per altre richieste diavcstrm.sys .

I valori restituiti degli errori possibili includono:

Stato errore Descrizione
STATUS_DEVICE_REMOVED Il dispositivo corrispondente all'operazione di AVCSTRM_READ non esiste più.
STATUS_CANCELLED Impossibile completare la richiesta.
STATUS_INVALID_PARAMETER Un parametro specificato nell'IRP non è corretto,
STATUS_INSUFFICIENT_RESOURCES Le risorse di sistema non sono state sufficienti per completare la richiesta.
STATUS_PENDING La richiesta è stata ricevuta, ma richiede un'ulteriore elaborazione. La routine di completamento di I/O gestirà la risposta finale.

AVC_STREAM_REQUEST_BLOCK Input

SizeOfThisBlock, versione e funzione
Usare la macro INIT_AVCSTRM_HEADER per inizializzare questi membri. Passare AVCSTRM_OPEN nell'argomento Request della macro.

AVCStreamContext
Specifica il contesto di flusso (handle). Ciò deve essere NULL nell'input e, se AVCSTRM_OPEN restituisce correttamente, questo membro contiene un contesto di flusso valido per le operazioni diavcstrm.sys successive.

OpenStruct
Specifica la descrizione del flusso AV/C da creare.

L'enumerazione AVCSTRM_FORMAT fornisce l'elenco dei formati di streaming AV/C supportati (dalle specifiche IEC 61883) che avcstrm.sys supportano, ad esempio SDDV (61883-2) e MPEG2TS (61883-4).

Per creare una connessione isochronous, le intestazioni CIP e i parametri dipendenti della subunit sono necessari e sono definiti nella struttura AVCSTRM_FORMAT_INFO .

Di seguito è riportato un esempio delle informazioni sul formato MPEG2TS per la ricezione dei dati:

//
// MPEG2TS
//
    { 
        sizeof(AVCSTRM_FORMAT_INFO),
        AVCSTRM_FORMAT_MPEG2TS,
        {
            0,0,
            CIP_SPH_MPEG, 
            CIP_QPC_MPEG,
            CIP_FN_MPEG,
            IP_DBS_MPEG,
            0,0
        }, // CIP header[0]
        {
            0,0,0,
            CIP_TSF_OFF,
            CIP_FMT_MPEG,
            2,
        },  // CIP header[1]
        SRC_PACKETS_PER_MPEG2TS_FRAME,   // varies depending on number of source packets
        BUFFER_SIZE_MPEG2TS_NO_SPH,   // Remove source packet header
        NUM_OF_XMT_BUFFERS_MPEG2TS,   // Subunit defined
        0,
        FALSE, // not striping SPH is the default
        0,  
        BLOCK_PERIOD_MPEG2TS, // 192, / number of 1394 cycle offset to send one block
        0,0,0,0,
    },

Un driver subunit deve prima allocare un'IRP e una struttura AVC_STREAM_REQUEST_BLOCK .

Successivamente, deve usare la macro INIT_AVCSTRM_HEADER per inizializzare la struttura AVC_STREAM_REQUEST_BLOCK , passando AVCSTRM_OPEN come argomento Request alla macro.

Successivamente, il driver subunit imposta il membro AVCStreamContext su NULL.

Al termine dell'operazione, questo membro deve contenere un contesto di flusso valido (un handle) usato nelle operazioni di avcstrm.sys successive. Questo membro non deve essere modificato in seguito fino a quando il flusso non viene chiuso tramite AVCSTRM_CLOSE.. Infine, il driver subunit imposta il membro OpenStruct dell'unione CommandData che descrive il flusso da aprire.

Per inviare questa richiesta, un subunit invia un IRP_MJ_INTERNAL_DEVICE_CONTROL IRP con il membro IoControlCode dell'IRP impostato su IOCTL_AVCSTRM_CLASS e il membro Argument1 dell'IRP impostato sulla struttura AVC_STREAM_REQUEST_BLOCK che descrive l'operazione aperta da eseguire.

Un driver subunit può prevedere che questo comando venga completato in modo sincrono. Il risultato restituisce immediatamente senza l'operazione in sospeso in avcstrm.sys.

Questo codice di funzione deve essere chiamato in IRQL = PASSIVE_LEVEL.

Commenti

Questa funzione usa il membro OpenStruct dell'unione CommandData nella struttura AVC_STREAM_REQUEST_BLOCK, come illustrato di seguito.

typedef struct _AVC_STREAM_REQUEST_BLOCK {
  ULONG  SizeOfThisBlock;
  ULONG  Version;
  AVCSTRM_FUNCTION  Function;
  .
  .
  PVOID AVCStreamContext;
  .
  .
  union _tagCommandData {
    .
    .
    AVCSTRM_OPEN_STRUCT  OpenStruct;
    .
    .
  } CommandData;
} AVC_STREAM_REQUEST_BLOCK, *PAVC_STREAM_REQUEST_BLOCK;

Requisiti

Intestazioni: Dichiarato in avcstrm.h. Includere avcstrm.h.

Vedere anche

AVC_STREAM_REQUEST_BLOCK

INIT_AVCSTRM_HEADER

IRP_MJ_INTERNAL_DEVICE_CONTROL

IOCTL_AVCSTRM_CLASS

AVCSTRM_OPEN_STRUCT

AVCSTRM_FUNCTION

AVCSTRM_FORMAT

AVCSTRM_FORMAT_INFO