NWSMGetMediaHeaderInfo

Separates an SIDF media header into its various components.

Syntax

  #include <smsutapi.h> 
   
  CCODE NWSMGetMediaHeaderInfo ( 
     BUFFERPTR            headerBuffer, 
     UINT32               headerBufferSize,  
     NWSM_MEDIA_INFO  *mediaInfo);
  

Parameters

headerBuffer

(IN) Points to the beginning of the buffer containing an SIDF media header.

headerBufferSize

(IN) Specifies the size of the media header in bytes.

mediaInfo

(OUT) Points to the unformatted media header information.

Return Values

The following table lists the return values associated with the function.

0x00000000

Successful

0xFFFBFFF0

NWSMUT_BUFFER_UNDERFLOW

0xFFFBFFFA

NWSMUT_BUFFER_OVERFLOW

0xFFFBFFF9

NWSMUT_INVALID_FIELD_ID

0xFFFBFFFD

NWSMUT_INVALID_PARAMETER

NWSMGetMediaHeaderInfo Example

  /* example using SMS DI */ 
  #define MY_BUFFER_SIZE 1024 /* arbitrary size */ 
   
  NWSM_MEDIA_INFO mediaInfo;    
  NWSMSD_CONTROL_BLOCK controlBlock; /* SMS DI structure */ 
  NWSMSD_HEADER_BUFFER *headerBuffer; 
  NWSMSD_MEDIA_HANDLE mediaHandle; 
  NWBOOLEAN32 verifyHeader; 
  NWSMSD_HEADER_BUFFER *mediaHeader; 
  CCODE ccode, completionStatus; 
   
  /* Allocate memory for headerBuffer. maxTransferBufferSize is set by  NWSMSDSessionOpenForReading */ 
   
  headerBuffer=(NWSMSD_HEADER_BUFFER *)malloc(sizeof(NWSMSD_HEADER_BUFFER) + maxTransferBufferSize - 1); 
  headerBuffer->bufferSize = maxTransferBufferSize; 
   
  /* Set up the media header buffer information */ 
  mediaHeader = (NWSMSD_HEADER_BUFFER *) malloc(sizeof(NWSMSD_HEADER_BUFFER) +MY_BUFFER_SIZE - 1); 
  mediaHeader->bufferSize = MY_BUFFER_SIZE; 
   
  verifyHeader = TRUE; 
  ccode = NWSMSDMediaHeaderReturn(sdiConnection, mediaHandle, verifyHeader, mediaHeader, 0, &completionStatus); 
   
  if (ccode) 
  {   /* handle error here */ 
     return ccode; 
  } 
   
   /* Wait for the function to complete its task. The engine can do other things while waiting. */ 
   
  while (completionStatus == NWSMSD_WAIT_PENDING) 
        MyDelay(); 
   
  if (completionStatus == 0) 
     NWSMGetMediaHeaderInfo((BUFFERPTR)headerBuffer->headerBuffer, headerBuffer->headerSize, &mediaInfo);