Microsoft DirectX 9.0


The Initialize method initializes the object. This method should be called once, immediately after creating the object. The IMpeg2Data::GetSection and IMpeg2Data::GetTable methods call this method internally, so typically an application will not call it.


HRESULT Initialize(
  MPEG_REQUEST_TYPE  requestType,
  IMpeg2Data*  pMpeg2Data,
  PMPEG_CONTEXT  pContext,
  PID  pid,
  TID  tid,
  PMPEG2_FILTER  pFilter,
  DWORD  timeout,
  HANDLE  hDoneEvent



[in]  Specifies the request type, as an MPEG_REQUEST_TYPE value.


[in]  Pointer to the IMpeg2Data interface of the MPEG-2 Sections and Tables filter.


[in]  Pointer to an MPEG_CONTEXT structure. This structure indicates the MPEG-2 source.


[in]  Specifies a packet identifier (PID), indicating which packets in the transport stream are requested.


[in]  Specifies a table identifier (TID), indicating which table sections to retrieve.


[in]  Optional pointer to an MPEG2_FILTER structure. The caller can use this parameter to exclude packets based on additional MPEG-2 header fields. This parameter can be NULL.


[in]  Specifies the maximum length of time that a synchronous request should wait before it times out.


[in]  Specifies a handle to an event. The object signals the event when the request completes. This parameter is optional; it should be specified for asynchronous requests.

Return Values

The method returns an HRESULT. Possible values include those in the following table.

Return code Description
E_INVALIDARG Invalid argument.
E_OUTOFMEMORY Insufficient memory.
MPEG2_E_ALREADY_INITIALIZED The object has already been initialized.
S_OK The method succeeded.


This method is either synchronous or asynchronous, depending on the request type defined in the requestType parameter. When the method is asynchronous, it returns immediately and signals the event specified in hDoneEvent. When the method is synchronous, it blocks until the request completes or until the time out specified in the timeout parameter expires.

See Also