' ########################################################################################
' Microsoft Windows
' File: mpeg2data.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_mpeg2data_PBI)
#DEFINE PBX_mpeg2data_PBI
%EQUATE `MPEG2DATA_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/OAIdl.inc"
#INCLUDE ONCE "Legacy/COM/OCIdl.inc"
#INCLUDE ONCE "Legacy/System/bdaiface.inc"
#INCLUDE ONCE "Legacy/System/mpeg2structs.inc"
'#pragma pack(push)
'#pragma pack(1)
%EQUATE `MPEG_PAT_PID = &H0000
%EQUATE `MPEG_PAT_TID = &H00
%EQUATE `MPEG_CAT_PID = &H0001
%EQUATE `MPEG_CAT_TID = &H01
%EQUATE `MPEG_PMT_TID = &H02
%EQUATE `MPEG_TSDT_PID = &H0002
%EQUATE `MPEG_TSDT_TID = &H03
%EQUATE `ATSC_MGT_PID = &H1FFB
%EQUATE `ATSC_MGT_TID = &HC7
%EQUATE `ATSC_VCT_PID = &H1FFB
%EQUATE `ATSC_VCT_TERR_TID = &HC8
%EQUATE `ATSC_VCT_CABL_TID = &HC9
%EQUATE `ATSC_EIT_TID = &HCB
%EQUATE `ATSC_ETT_TID = &HCC
%EQUATE `ATSC_RRT_TID = &HCA
%EQUATE `ATSC_RRT_PID = &H1FFB
%EQUATE `ATSC_STT_PID = &H1FFB
%EQUATE `ATSC_STT_TID = &HCD
%EQUATE `ATSC_PIT_TID = &HD0
%EQUATE `DVB_NIT_PID = &H0010
%EQUATE `DVB_NIT_ACTUAL_TID = &H40
%EQUATE `DVB_NIT_OTHER_TID = &H41
%EQUATE `DVB_SDT_PID = &H0011
%EQUATE `DVB_SDT_ACTUAL_TID = &H42
%EQUATE `DVB_SDT_OTHER_TID = &H46
%EQUATE `DVB_BAT_PID = &H0011
%EQUATE `DVB_BAT_TID = &H4A
%EQUATE `DVB_EIT_PID = &H0012
%EQUATE `DVB_EIT_ACTUAL_TID = &H4E
%EQUATE `DVB_EIT_OTHER_TID = &H4F
%EQUATE `DVB_RST_PID = &H0013
%EQUATE `DVB_RST_TID = &H71
%EQUATE `DVB_TDT_PID = &H0014
%EQUATE `DVB_TDT_TID = &H70
%EQUATE `DVB_ST_PID_16 = &H0010
%EQUATE `DVB_ST_PID_17 = &H0011
%EQUATE `DVB_ST_PID_18 = &H0012
%EQUATE `DVB_ST_PID_19 = &H0013
%EQUATE `DVB_ST_PID_20 = &H0014
%EQUATE `DVB_ST_TID = &H72
%EQUATE `ISDB_ST_TID = &H72
%EQUATE `DVB_TOT_PID = &H0014
%EQUATE `DVB_TOT_TID = &H73
%EQUATE `DVB_DIT_PID = &H001E
%EQUATE `DVB_DIT_TID = &H7E
%EQUATE `DVB_SIT_PID = &H001F
%EQUATE `DVB_SIT_TID = &H7F
'%ISDB_DCT_PID = &H0017 ' // Removed in the Windows 7 SDK
'%ISDB_DCT_TID = &HC0 ' // Removed in the Windows 7 SDK
'%ISDB_LIT_PID = &H0020 ' // Removed in the Windows 7 SDK
'%ISDB_LIT_TID = &HD0 ' // Removed in the Windows 7 SDK
'%ISDB_ERT_PID = &H0021 ' // Removed in the Windows 7 SDK
'%ISDB_ERT_TID = &HD1 ' // Removed in the Windows 7 SDK
'%ISDB_ITT_TID = &HD2 ' // Removed in the Windows 7 SDK
'%ISDB_DLT_TID = &HC1 ' // Removed in the Windows 7 SDK
'%ISDB_PCAT_PID = &H0022 ' // Removed in the Windows 7 SDK
'%ISDB_PCAT_TID = &HC2 ' // Removed in the Windows 7 SDK
%EQUATE `DVB_SIT_TID = &H7F
%EQUATE `ISDB_EMM_TID = &H85
%EQUATE `ISDB_BIT_PID = &H0024
%EQUATE `ISDB_BIT_TID = &HC4
%EQUATE `ISDB_NBIT_PID = &H0025
%EQUATE `ISDB_NBIT_MSG_TID = &HC5
%EQUATE `ISDB_NBIT_REF_TID = &HC6
%EQUATE `ISDB_LDT_PID = &H0025
%EQUATE `ISDB_LDT_TID = &HC7
%EQUATE `ISDB_SDTT_PID = &H0023
%EQUATE `ISDB_SDTT_ALT_PID = &H0028
%EQUATE `ISDB_SDTT_TID = &HC3
%EQUATE `ISDB_CDT_PID = &H0029
%EQUATE `ISDB_CDT_TID = &HC8
%EQUATE `SCTE_EAS_TID = &HD8
%EQUATE `SCTE_EAS_IB_PID = &H1FFB
%EQUATE `SCTE_EAS_OOB_PID = &H1FFC
' ########################################################################################
' Interface name = IMpeg2TableFilter
' IID = BDCDD913-9ECD-4FB2-81AE-ADF747EA75A5
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMpeg2TableFilter_INTERFACE_DEFINED)
 %IMpeg2TableFilter_INTERFACE_DEFINED = 1
$IID_IMpeg2TableFilter = GUID$("{BDCDD913-9ECD-4FB2-81AE-ADF747EA75A5}")
INTERFACE IMpeg2TableFilter $IID_IMpeg2TableFilter
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AddPID ( ' VTable offset = 12
 BYVAL p AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD AddTable ( ' VTable offset = 16
 BYVAL p AS WORD
 , BYVAL t AS BYTE
 ) AS LONG
 ' =====================================================================================
 METHOD AddExtension ( ' VTable offset = 20
 BYVAL p AS WORD
 , BYVAL t AS BYTE
 , BYVAL e AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD RemovePID ( ' VTable offset = 24
 BYVAL p AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveTable ( ' VTable offset = 28
 BYVAL p AS WORD
 , BYVAL t AS BYTE
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveExtension ( ' VTable offset = 32
 BYVAL p AS WORD
 , BYVAL t AS BYTE
 , BYVAL e AS WORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMpeg2TableFilter_INTERFACE_DEFINED__ */
' // Size = 8 bytes
TYPE Mpeg2TableSampleHdr BYTE
 SectionCount AS BYTE ' BYTE
 Reserved(2) AS BYTE ' BYTE[3]
 SectionOffsets(0) AS LONG ' long[1]
END TYPE
$CLSID_Mpeg2TableFilter = GUID$("{752845F1-758F-4C83-A043-4270C593308E}")
$LIBID_Mpeg2DataLib = GUID$("{DBAF6C1B-B6A4-4898-AE65-204F0D9509A1}")
$CLSID_SectionList = GUID$("{73DA5D04-4347-45D3-A9DC-FAE9DDBE558D}")
$CLSID_Mpeg2Stream = GUID$("{F91D96C7-8509-4D0B-AB26-A0DD10904BB7}")
$CLSID_Mpeg2Data = GUID$("{C666E115-BB62-4027-A113-82D643FE2D99}")
' ########################################################################################
' Interface name = IMpeg2Data
' IID = 9B396D40-F380-4E3C-A514-1A82BF6EBFE6
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMpeg2Data_INTERFACE_DEFINED)
 %IMpeg2Data_INTERFACE_DEFINED = 1
$IID_IMpeg2Data = GUID$("{9B396D40-F380-4E3C-A514-1A82BF6EBFE6}")
INTERFACE IMpeg2Data $IID_IMpeg2Data
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetSection ( ' VTable offset = 12
 BYVAL pid AS WORD
 , BYVAL tid AS BYTE
 , BYREF pFilter AS MPEG2_FILTER
 , BYVAL dwTimeout AS DWORD
 , BYREF ppSectionList AS ISectionList
 ) AS LONG
 ' =====================================================================================
 METHOD GetTable ( ' VTable offset = 16
 BYVAL pid AS WORD
 , BYVAL tid AS BYTE
 , BYREF pFilter AS MPEG2_FILTER
 , BYVAL dwTimeout AS DWORD
 , BYREF ppSectionList AS ISectionList
 ) AS LONG
 ' =====================================================================================
 METHOD GetStreamOfSections ( ' VTable offset = 20
 BYVAL pid AS WORD
 , BYVAL tid AS BYTE
 , BYREF pFilter AS MPEG2_FILTER
 , BYVAL hDataReadyEvent AS DWORD
 , BYREF ppMpegStream AS IMpeg2Stream
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMpeg2Data_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = ISectionList
' IID = AFEC1EB5-2A64-46C6-BF4B-AE3CCB6AFDB0
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%ISectionList_INTERFACE_DEFINED)
 %ISectionList_INTERFACE_DEFINED = 1
$IID_ISectionList = GUID$("{AFEC1EB5-2A64-46C6-BF4B-AE3CCB6AFDB0}")
INTERFACE ISectionList $IID_ISectionList
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL requestType AS LONG
 , BYVAL pMpeg2Data AS IMpeg2Data
 , BYREF pContext AS MPEG_CONTEXT
 , BYVAL pid AS WORD
 , BYVAL tid AS BYTE
 , BYREF pFilter AS MPEG2_FILTER
 , BYVAL timeout AS DWORD
 , BYVAL hDoneEvent AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD InitializeWithRawSections ( ' VTable offset = 16
 BYREF pmplSections AS MPEG_PACKET_LIST
 ) AS LONG
 ' =====================================================================================
 METHOD CancelPendingRequest ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD GetNumberOfSections ( ' VTable offset = 24
 BYREF pCount AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSectionData ( ' VTable offset = 28
 BYVAL sectionNumber AS WORD
 , BYREF pdwRawPacketLength AS DWORD
 , BYREF ppSection AS SECTION
 ) AS LONG
 ' =====================================================================================
 METHOD GetProgramIdentifier ( ' VTable offset = 32
 BYREF pPid AS WORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetTableIdentifier ( ' VTable offset = 36
 BYREF pTableId AS BYTE
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __ISectionList_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IMpeg2Stream
' IID = 400CC286-32A0-4CE4-9041-39571125A635
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMpeg2Stream_INTERFACE_DEFINED)
 %IMpeg2Stream_INTERFACE_DEFINED = 1
$IID_IMpeg2Stream = GUID$("{400CC286-32A0-4CE4-9041-39571125A635}")
INTERFACE IMpeg2Stream $IID_IMpeg2Stream
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Initialize ( ' VTable offset = 12
 BYVAL requestType AS LONG
 , BYVAL pMpeg2Data AS IMpeg2Data
 , BYREF pContext AS MPEG_CONTEXT
 , BYVAL pid AS WORD
 , BYVAL tid AS BYTE
 , BYREF pFilter AS MPEG2_FILTER
 , BYVAL hDataReadyEven AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SupplyDataBuffer ( ' VTable offset = 16
 BYREF pStreamBuffer AS MPEG_STREAM_BUFFER
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMpeg2Stream_INTERFACE_DEFINED__ */
'#pragma pack(pop)
#ENDIF
