' ########################################################################################
' Microsoft Windows
' File: StreamDescription.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_streamdescription_PBI)
#DEFINE PBX_streamdescription_PBI
%EQUATE `STREAMDESCRIPTION_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
#INCLUDE ONCE "Legacy/Media/wmsbuffer.inc"
#INCLUDE ONCE "Legacy/Media/wmscontext.inc"
$IID_IWMSStreamHeader = GUID$("{3309C903-10A4-11D2-9EEE-006097D2D7CF}")
$IID_IWMSStreamHeaderList = GUID$("{42176202-2B30-11D2-9EF7-006097D2D7CF}")
$IID_IWMSContentDescriptionList = GUID$("{105D6F73-6DF0-11D2-9F14-006097D2D7CF}")
$IID_IWMSStreamSwitchDescriptionList = GUID$("{75C3017C-6B3A-4E25-BE9F-A9927F4DD058}")
$IID_IWMSUnknownStreamFormat = GUID$("{52769631-38AA-11D2-9EFA-006097D2D7CF}")
$IID_IWMSUnknownStreamType = GUID$("{52769632-38AA-11D2-9EFA-006097D2D7CF}")
$IID_IWMSUnknownContainerFormat = GUID$("{52769631-38AA-11D2-9EFA-006097D2D7CF}")
' ########################################################################################
' Interface name = IWMSStreamHeader
' IID = {3309C903-10A4-11D2-9EEE-006097D2D7CF}
' Contains methods that describe the header for a specific stream.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSStreamHeader_INTERFACE_DEFINED)
 %IWMSStreamHeader_INTERFACE_DEFINED = 1
INTERFACE IWMSStreamHeader $IID_IWMSStreamHeader
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetFormat ( ' VTable offset = 12
 BYREF pFormat AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetFormat ( ' VTable offset = 16
 BYVAL Format AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetStreamType ( ' VTable offset = 20
 BYREF pStreamType AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetStreamType ( ' VTable offset = 24
 BYVAL StreamType AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetIntegerAttribute ( ' VTable offset = 28
 BYVAL dwAttributeId AS DWORD
 , BYREF pdwAttribute AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetIntegerAttribute ( ' VTable offset = 32
 BYVAL dwAttributeId AS DWORD
 , BYVAL dwAttribute AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStringAttribute ( ' VTable offset = 36
 BYVAL dwAttributeId AS DWORD
 , BYREF pszAttribute AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD SetStringAttribute ( ' VTable offset = 40
 BYVAL dwAttributeId AS DWORD
 , BYVAL szAttribute AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetExtendedAttribute ( ' VTable offset = 44
 BYVAL dwValueName AS DWORD
 , BYREF pVariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD SetExtendedAttribute ( ' VTable offset = 48
 BYVAL dwValueName AS DWORD
 , BYVAL VariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD GetNthExtendedAttribute ( ' VTable offset = 52
 BYVAL dwIndex AS DWORD
 , BYREF pdwValueName AS DWORD
 , BYREF pVariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD GetNumExtendedAttributes ( ' VTable offset = 56
 BYREF pdwValueName AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CloneStreamHeader ( ' VTable offset = 60
 BYREF ppHeader AS IWMSStreamHeader
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSStreamHeader_INTERFACE_DEFINED__ */
%EQUATE `WMS_STREAM_ID = 0
%EQUATE `WMS_STREAM_MIN_BITRATE = 1
%EQUATE `WMS_STREAM_MAX_BITRATE = 2
%EQUATE `WMS_STREAM_AVG_BITRATE = 3
%EQUATE `WMS_STREAM_MAX_PACKET_SIZE = 4
%EQUATE `WMS_STREAM_AVG_PACKET_SIZE = 5
%EQUATE `WMS_STREAM_PREROLL = 6
%EQUATE `WMS_STREAM_FLAGS = 7
%EQUATE `WMS_STREAM_NAME = 8
%EQUATE `WMS_STREAM_SHARING_GROUP = 9
%EQUATE `WMS_STREAM_SHARING_BANDWIDTH = 10
%EQUATE `WMS_NUM_STREAMHEADER_ATTRIBUTES = 11
%EQUATE `WMS_STREAM_HAS_NON_KEY_FRAMES = &H0001
%EQUATE `WMS_STREAM_RELIABLE_FLAG = &H0002
%EQUATE `WMS_STREAM_CONCEALED_FLAG = &H0004
%EQUATE `WMS_ASF_THRESHOLD_DURATION = 500
' ########################################################################################
' Interface name = IWMSStreamHeaderList
' IID = {42176202-2B30-11D2-9EF7-006097D2D7CF}
' Contains a collection of IWMSStreamHeader objects and methods that describe each stream in a multimedia stream.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSStreamHeaderList_INTERFACE_DEFINED)
 %IWMSStreamHeaderList_INTERFACE_DEFINED = 1
INTERFACE IWMSStreamHeaderList $IID_IWMSStreamHeaderList
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetHeaderCount ( ' VTable offset = 12
 BYREF pdwNumHeaders AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetHeader ( ' VTable offset = 16
 BYVAL dwHeaderNum AS DWORD
 , BYREF ppHeader AS IWMSStreamHeader
 ) AS LONG
 ' =====================================================================================
 METHOD AppendHeader ( ' VTable offset = 20
 BYVAL pHeader AS IWMSStreamHeader
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveAllHeaders ( ' VTable offset = 24
 ) AS LONG
 ' =====================================================================================
 METHOD GetContainerFormat ( ' VTable offset = 28
 BYREF pFormat AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetContainerFormat ( ' VTable offset = 32
 BYVAL Format AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetDataVersion ( ' VTable offset = 36
 BYREF pFormat AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetDataVersion ( ' VTable offset = 40
 BYVAL Format AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetNativeContainerHeader ( ' VTable offset = 44
 BYREF ppBuffer AS INSSBuffer
 , BYREF pdwOffset AS DWORD
 , BYREF pdwLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetNativeContainerHeader ( ' VTable offset = 48
 BYVAL pBuffer AS INSSBuffer
 , BYVAL dwOffset AS DWORD
 , BYVAL dwLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetContentDescription ( ' VTable offset = 52
 BYREF ppDescription AS IWMSContentDescriptionList
 ) AS LONG
 ' =====================================================================================
 METHOD SetContentDescription ( ' VTable offset = 56
 BYVAL pDescription AS IWMSContentDescriptionList
 ) AS LONG
 ' =====================================================================================
 METHOD GetIntegerAttribute ( ' VTable offset = 60
 BYVAL dwAttributeId AS DWORD
 , BYREF pdwAttribute AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetIntegerAttribute ( ' VTable offset = 64
 BYVAL dwAttributeId AS DWORD
 , BYVAL dwAttribute AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStringAttribute ( ' VTable offset = 68
 BYVAL dwAttributeId AS DWORD
 , BYREF pszAttribute AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD SetStringAttribute ( ' VTable offset = 72
 BYVAL dwAttributeId AS DWORD
 , BYVAL szAttribute AS WSTRING
 ) AS LONG
 ' =====================================================================================
 METHOD GetExtendedAttribute ( ' VTable offset = 76
 BYVAL dwValueName AS DWORD
 , BYREF pVariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD SetExtendedAttribute ( ' VTable offset = 80
 BYVAL dwValueName AS DWORD
 , BYVAL VariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD GetNthExtendedAttribute ( ' VTable offset = 84
 BYVAL dwIndex AS DWORD
 , BYREF pdwValueName AS DWORD
 , BYREF pVariantValue AS VARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD GetNumExtendedAttributes ( ' VTable offset = 88
 BYREF pdwValueName AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CloneStreamHeaderList ( ' VTable offset = 92
 BYVAL pBufferAllocator AS IWMSBufferAllocator
 , BYREF ppHeader AS IWMSStreamHeaderList
 ) AS LONG
 ' =====================================================================================
 METHOD RecordPlaylistGenerationId ( ' VTable offset = 96
 BYVAL pCommand AS IWMSCommandContext
 ) AS LONG
 ' =====================================================================================
 METHOD CheckPlaylistGenerationId ( ' VTable offset = 100
 BYVAL pCommand AS IWMSCommandContext
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSStreamHeaderList_INTERFACE_DEFINED__ */
%EQUATE `WMS_TOTAL_MIN_BITRATE = 0
%EQUATE `WMS_TOTAL_MAX_BITRATE = 1
%EQUATE `WMS_TOTAL_AVG_BITRATE = 2
%EQUATE `WMS_CONTAINER_FLAGS = 3
%EQUATE `WMS_CONTAINER_DURATION_LO = 4
%EQUATE `WMS_CONTAINER_DURATION_HI = 5
%EQUATE `WMS_CONTAINER_MAX_PACKET_SIZE = 6
%EQUATE `WMS_CONTAINER_PLAYLIST_ENTRY_NAME = 7
%EQUATE `WMS_TOTAL_PACKETS_LO = 8
%EQUATE `WMS_TOTAL_PACKETS_HI = 9
%EQUATE `WMS_STREAM_PLAYLIST_GENERATION_ID = 10
%EQUATE `WMS_CONTAINER_FILESIZE_LO = 11
%EQUATE `WMS_CONTAINER_FILESIZE_HI = 12
%EQUATE `WMS_STREAM_DISTRIBUTION_PLAYLIST_GENERATION_ID = 13
%EQUATE `WMS_CONTAINER_LOG_PHYSICAL_URL = 14
%EQUATE `WMS_CONTAINER_IS_VBR = 15
%EQUATE `WMS_STREAM_BROADCAST_GENERATION_ID = 16
%EQUATE `WMS_STREAM_DISTRIBUTION_BROADCAST_GENERATION_ID = 17
%EQUATE `WMS_NUM_STREAMHEADERLIST_ATTRIBUTES = 18
%EQUATE `WMS_CONTAINER_BROADCAST = &H0001
%EQUATE `WMS_CONTAINER_CANSEEK = &H0002
%EQUATE `WMS_CONTAINER_CANSTRIDE = &H0004
%EQUATE `WMS_CONTAINER_LIVE = &H0008
%EQUATE `WMS_CONTAINER_RECORDABLE = &H0010
%EQUATE `WMS_CONTAINER_PART_OF_PLAYLIST = &H0020
%EQUATE `WMS_CONTAINER_ONDEMAND_PLAYLIST_EMULATING_BCAST = &H0040
%EQUATE `WMS_CONTAINER_PART_OF_WRAPPER_PLAYLIST = &H0080
%EQUATE `WMS_CONTAINER_ALLOW_PLAYLIST_SKIP_FORWARD = &H0100
%EQUATE `WMS_CONTAINER_ALLOW_PLAYLIST_SKIP_BACKWARD = &H0200
%EQUATE `WMS_CONTAINER_SEEKABLE_EMULATING_BROADCAST = &H0400
%EQUATE `WMS_CONTAINER_LAST_ENTRY_IN_PLAYLIST = &H0800
' ########################################################################################
' Interface name = IWMSContentDescriptionList
' IID = {105D6F73-6DF0-11D2-9F14-006097D2D7CF}
' Contains a collection of content description contexts for different languages.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSContentDescriptionList_INTERFACE_DEFINED)
 %IWMSContentDescriptionList_INTERFACE_DEFINED = 1
INTERFACE IWMSContentDescriptionList $IID_IWMSContentDescriptionList
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDescriptionCount ( ' VTable offset = 12
 BYREF pdwNumDescriptions AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIndexedDescription ( ' VTable offset = 16
 BYVAL dwDescriptionNum AS DWORD
 , BYREF pstrLanguage AS DWORD
 , BYREF ppDescription AS IWMSContext
 ) AS LONG
 ' =====================================================================================
 METHOD GetDescriptionInLanguage ( ' VTable offset = 20
 BYREF pstrLanguage AS WSTRINGZ
 , BYREF ppDescription AS IWMSContext
 ) AS LONG
 ' =====================================================================================
 METHOD AppendDescription ( ' VTable offset = 24
 BYREF pstrLanguage AS WSTRINGZ
 , BYVAL pDescription AS IWMSContext
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveAllDescriptions ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
 METHOD GetPlaylistGenid ( ' VTable offset = 32
 BYREF pdwPlaylistGenerationId AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetPlaylistGenid ( ' VTable offset = 36
 BYVAL dwPlaylistGenerationId AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetBroadcastid ( ' VTable offset = 40
 BYREF pdwPlaylistGenerationId AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetBroadcastid ( ' VTable offset = 44
 BYVAL dwPlaylistGenerationId AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetValueOnAllDescriptions ( ' VTable offset = 48
 BYREF pstrName AS WSTRINGZ
 , BYVAL lNameHint AS LONG
 , BYVAL lNameHint AS VARIANT
 , BYVAL lOptions AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveValueFromAllDescriptions ( ' VTable offset = 52
 BYREF pstrName AS WSTRINGZ
 , BYVAL lNameHint AS LONG
 , BYVAL lOptions AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSContentDescriptionList_INTERFACE_DEFINED__ */
' enum WMS_STREAM_CONSTANTS
%EQUATE `WMS_DATA_STREAM_MIN = 0
%EQUATE `WMS_DATA_STREAM_MAX = &Hfffe
%EQUATE `WMS_NO_STREAM = &Hffff
%EQUATE `WMS_RETRANSMISSION_STREAM_MIN = &H10000
%EQUATE `WMS_RETRANSMISSION_STREAM_MAX = &H1fffe
%EQUATE `WMS_FEC_STREAM_MIN = &H20000
%EQUATE `WMS_FEC_STREAM_MAX = &H2fffe
'#define IS_DATA_STREAM(x) ( ( x ) >= WMS_DATA_STREAM_MIN && ( x ) <= WMS_DATA_STREAM_MAX )
MACRO IS_DATA_STREAM(x) = ((x >= %WMS_DATA_STREAM_MIN) AND (x <= %WMS_DATA_STREAM_MAX))
'#define IS_RETRANSMISSION_STREAM(x) ( ( x ) >= WMS_RETRANSMISSION_STREAM_MIN && ( x ) <= WMS_RETRANSMISSION_STREAM_MAX )
MACRO IS_RETRANSMISSION_STREAM(x) = ((x >= %WMS_RETRANSMISSION_STREAM_MIN) AND (x <= WMS_RETRANSMISSION_STREAM_MAX))
'#define IS_FEC_STREAM(x) ( ( x ) >= WMS_FEC_STREAM_MIN && ( x ) <= WMS_FEC_STREAM_MAX )
MACRO IS_FEC_STREAM(x) = ((x >= %WMS_FEC_STREAM_MIN) AND (x <= %WMS_FEC_STREAM_MAX))
' WMS_STREAM_MODIFIERS enum
%EQUATE `WMS_NO_MODIFIER = 0
%EQUATE `WMS_THINNING_MODIFIER = 1
%EQUATE `WMS_REMOVE_ALL_FRAMES_MODIFIER = 2
' enum WMS_THINNING_MODIFIER_TYPES
%EQUATE `WMS_NO_THINNING = 0
%EQUATE `WMS_INTERMEDIATE_FRAME_THINNING = 1
%EQUATE `WMS_REMOVE_ALL_FRAMES = 2
' // Size = 24 bytes
TYPE CWMSStreamSwitch DWORD
 wPlaylistSequenceNumber AS WORD ' WORD
 dwOldStreamNumber AS DWORD
 dwNewStreamNumber AS DWORD
 ModifierType AS LONG ' WMS_STREAM_MODIFIERS
 dwModifier AS DWORD
 dwPredictiveStreamSelections AS DWORD
END TYPE
' ########################################################################################
' Interface name = IWMSStreamSwitchDescriptionList
' IID = {75C3017C-6B3A-4E25-BE9F-A9927F4DD058}
' Contains methods that control which streams are sent down a data path.
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IWMSStreamSwitchDescriptionList_INTERFACE_DEFINED)
 %IWMSStreamSwitchDescriptionList_INTERFACE_DEFINED = 1
INTERFACE IWMSStreamSwitchDescriptionList $IID_IWMSStreamSwitchDescriptionList
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetDescriptionCount ( ' VTable offset = 12
 BYREF pdwNumDescriptions AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIndexedDescription ( ' VTable offset = 16
 BYVAL dwDescriptionNum AS DWORD
 , BYREF pStreamSwitchDesc AS CWMSStreamSwitch
 ) AS LONG
 ' =====================================================================================
 METHOD ChangeIndexedDescription ( ' VTable offset = 20
 BYVAL dwDescriptionNum AS DWORD
 , BYREF pStreamSwitchDesc AS CWMSStreamSwitch
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveIndexedDescription ( ' VTable offset = 24
 BYVAL dwDescriptionNum AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AppendDescription ( ' VTable offset = 28
 BYREF pStreamSwitchDesc AS CWMSStreamSwitch
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveAllDescriptions ( ' VTable offset = 32
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IWMSStreamSwitchDescriptionList_INTERFACE_DEFINED__ */
' WMS_SEEK_TYPE enum
%EQUATE `WMS_SEEK_TO_TIME = 1
%EQUATE `WMS_SEEK_TO_PACKET = 2
%EQUATE `WMS_SEEK_TO_PLAYLIST_ENTRY = 3
%EQUATE `WMS_SEEK_TO_BYTE_OFFSET = 4
#ENDIF
