' ########################################################################################
' Microsoft Windows
' File: mftransform.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_mftransform_PBI)
#DEFINE PBX_mftransform_PBI
%EQUATE `MFTRANSFORM_INC = 1
'/* header files for imported files */
#INCLUDE "Legacy/System/mfobjects.inc"
' enum MFT_INPUT_DATA_BUFFER_FLAGS
%EQUATE `MFT_INPUT_DATA_BUFFER_PLACEHOLDER = &Hffffffff
' enum MFT_OUTPUT_DATA_BUFFER_FLAGS
%EQUATE `MFT_OUTPUT_DATA_BUFFER_INCOMPLETE = &H1000000
%EQUATE `MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE = &H100
%EQUATE `MFT_OUTPUT_DATA_BUFFER_STREAM_END = &H200
%EQUATE `MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE = &H300
' enum MFT_INPUT_STATUS_FLAGS
%EQUATE `MFT_INPUT_STATUS_ACCEPT_DATA = &H1
' enum MFT_OUTPUT_STATUS_FLAGS
%EQUATE `MFT_OUTPUT_STATUS_SAMPLE_READY = &H1
' enum MFT_INPUT_STREAM_INFO_FLAGS
%EQUATE `MFT_INPUT_STREAM_WHOLE_SAMPLES = &H1
%EQUATE `MFT_INPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER = &H2
%EQUATE `MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE = &H4
%EQUATE `MFT_INPUT_STREAM_HOLDS_BUFFERS = &H8
%EQUATE `MFT_INPUT_STREAM_DOES_NOT_ADDREF = &H100
%EQUATE `MFT_INPUT_STREAM_REMOVABLE = &H200
%EQUATE `MFT_INPUT_STREAM_OPTIONAL = &H400
%EQUATE `MFT_INPUT_STREAM_PROCESSES_IN_PLACE = &H800
' enum MFT_OUTPUT_STREAM_INFO_FLAGS
%EQUATE `MFT_OUTPUT_STREAM_WHOLE_SAMPLES = &H1
%EQUATE `MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER = &H2
%EQUATE `MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE = &H4
%EQUATE `MFT_OUTPUT_STREAM_DISCARDABLE = &H8
%EQUATE `MFT_OUTPUT_STREAM_OPTIONAL = &H10
%EQUATE `MFT_OUTPUT_STREAM_PROVIDES_SAMPLES = &H100
%EQUATE `MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES = &H200
%EQUATE `MFT_OUTPUT_STREAM_LAZY_READ = &H400
%EQUATE `MFT_OUTPUT_STREAM_REMOVABLE = &H800
' enum MFT_SET_TYPE_FLAGS
%EQUATE `MFT_SET_TYPE_TEST_ONLY = &H1
' enum MFT_PROCESS_OUTPUT_FLAGS
%EQUATE `MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER = &H1
' enum MFT_PROCESS_OUTPUT_STATUS
%EQUATE `MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS = &H100
' enum MFT_DRAIN_TYPE
%EQUATE `MFT_DRAIN_PRODUCE_TAILS = 0
%EQUATE `MFT_DRAIN_NO_TAILS = &H1
%EQUATE `MFT_STREAMS_UNLIMITED = &HFFFFFFFF
'%MFT_OUTPUT_BOUND_LOWER_UNBOUNDED MINLONGLONG
'%MFT_OUTPUT_BOUND_UPPER_UNBOUNDED MAXLONGLONG
' enum MFT_MESSAGE_TYPE
%EQUATE `MFT_MESSAGE_COMMAND_FLUSH = 0
%EQUATE `MFT_MESSAGE_COMMAND_DRAIN = &H1
%EQUATE `MFT_MESSAGE_DROP_SAMPLES = &H3
%EQUATE `MFT_MESSAGE_SET_D3D_MANAGER = &H2
%EQUATE `MFT_MESSAGE_DROP_SAMPLES = &H3
%EQUATE `MFT_MESSAGE_NOTIFY_BEGIN_STREAMING = &H10000000
%EQUATE `MFT_MESSAGE_NOTIFY_END_STREAMING = &H10000001
%EQUATE `MFT_MESSAGE_NOTIFY_END_OF_STREAM = &H10000002
%EQUATE `MFT_MESSAGE_NOTIFY_START_OF_STREAM = &H10000003
%EQUATE `MFT_MESSAGE_COMMAND_MARKER = &H20000000
' // Size = 24 bytes
TYPE MFT_INPUT_STREAM_INFO ' Must be 8 byte aligned
 hnsMaxLatency AS QUAD ' LONGLONG
 dwFlags AS DWORD
 cbSize AS DWORD
 cbMaxLookahead AS DWORD
 cbAlignment AS DWORD
END TYPE
' // Size = 12 bytes
TYPE MFT_OUTPUT_STREAM_INFO DWORD
 dwFlags AS DWORD
 cbSize AS DWORD
 cbAlignment AS DWORD
END TYPE
' // Size = 16 bytes
TYPE MFT_OUTPUT_DATA_BUFFER DWORD
 dwStreamID AS DWORD
 pSample AS DWORD PTR ' IMFSample *
 dwStatus AS DWORD
 pEvents AS DWORD PTR ' IMFCollection *
END TYPE
'typedef struct _MFT_OUTPUT_DATA_BUFFER *PMFT_OUTPUT_DATA_BUFFER;
' ########################################################################################
' Interface name = IMFTransform
' IID = BF94C121-5B05-4E6F-8000-BA598961414D
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMFTransform_INTERFACE_DEFINED)
 %IMFTransform_INTERFACE_DEFINED = 1
$IID_IMFTransform = GUID$("{BF94C121-5B05-4E6F-8000-BA598961414D}")
INTERFACE IMFTransform $IID_IMFTransform
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetStreamLimits ( ' VTable offset = 12
 BYREF pdwInputMinimum AS DWORD
 , BYREF pdwInputMaximum AS DWORD
 , BYREF pdwOutputMinimum AS DWORD
 , BYREF pdwOutputMaximum AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStreamCount ( ' VTable offset = 16
 BYREF pcInputStreams AS DWORD
 , BYREF pcOutputStreams AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStreamIDs ( ' VTable offset = 20
 BYVAL dwInputIDArraySize AS DWORD
 , BYREF pdwInputIDs AS DWORD
 , BYVAL dwOutputIDArraySize AS DWORD
 , BYREF pdwOutputIDs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputStreamInfo ( ' VTable offset = 24
 BYVAL dwInputStreamID AS DWORD
 , BYREF pStreamInfo AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputStreamInfo ( ' VTable offset = 28
 BYVAL dwOutputStreamID AS DWORD
 , BYREF pStreamInfo AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetAttributes ( ' VTable offset = 32
 BYREF pAttributes AS IMFAttributes
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputStreamAttributes ( ' VTable offset = 36
 BYVAL dwInputStreamID AS DWORD
 , BYREF pAttributes AS IMFAttributes
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputStreamAttributes ( ' VTable offset = 40
 BYVAL dwOutputStreamID AS DWORD
 , BYREF pAttributes AS IMFAttributes
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteInputStream ( ' VTable offset = 44
 BYVAL dwStreamID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AddInputStreams ( ' VTable offset = 48
 BYVAL cStreams AS DWORD
 , BYVAL adwStreamIDs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputAvailableType ( ' VTable offset = 52
 BYVAL dwInputStreamID AS DWORD
 , BYVAL dwTypeIndex AS DWORD
 , BYREF ppType AS IMFMediaType
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputAvailableType ( ' VTable offset = 56
 BYVAL dwOutputStreamID AS DWORD
 , BYVAL dwTypeIndex AS DWORD
 , BYREF ppType AS IMFMediaType
 ) AS LONG
 ' =====================================================================================
 METHOD SetInputType ( ' VTable offset = 60
 BYVAL dwInputStreamID AS DWORD
 , BYVAL pType AS IMFMediaType
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetOutputType ( ' VTable offset = 64
 BYVAL dwOutputStreamID AS DWORD
 , BYVAL pType AS IMFMediaType
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputCurrentType ( ' VTable offset = 68
 BYVAL dwInputStreamID AS DWORD
 , BYREF ppType AS IMFMediaType
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputCurrentType ( ' VTable offset = 72
 BYVAL dwOutputStreamID AS DWORD
 , BYREF ppType AS IMFMediaType
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputStatus ( ' VTable offset = 76
 BYVAL dwInputStreamID AS DWORD
 , BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputStatus ( ' VTable offset = 80
 BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetOutputBounds ( ' VTable offset = 84
 BYVAL hnsLowerBound AS QUAD
 , BYVAL hnsUpperBound AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessEvent ( ' VTable offset = 88
 BYVAL dwInputStreamID AS DWORD
 , BYVAL pEvent AS IMFMediaEvent
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessMessage ( ' VTable offset = 92
 BYVAL eMessage AS DWORD
 , BYVAL ulParam AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessInput ( ' VTable offset = 96
 BYVAL dwInputStreamID AS DWORD
 , BYVAL pSample AS IMFSample
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessOutput ( ' VTable offset = 100
 BYVAL dwFlags AS DWORD
 , BYVAL cOutputBufferCount AS DWORD
 , BYREF pOutputSamples AS MFT_OUTPUT_DATA_BUFFER
 , BYREF pdwStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMFTransform_INTERFACE_DEFINED__ */
'#if (WINVER >= _WIN32_WINNT_WIN7)
' // Size = 20 bytes
TYPE STREAM_MEDIUM DWORD
 gidMedium AS GUID ' GUID
 unMediumInstance AS DWORD ' UINT32
END TYPE
'#endif // (WINVER >= _WIN32_WINNT_WIN7)
MACRO MFPKEY_CLSID = GUID$("{c57a84c0-1a80-40a3-97b5-9272a403c8ae}") & MKDWD$(&H01)
MACRO MFPKEY_CATEGORY = GUID$("{c57a84c0-1a80-40a3-97b5-9272a403c8ae}") & MKDWD$(&H02)
MACRO MFPKEY_EXATTRIBUTE_SUPPORTED = GUID$("{456fe843-3c87-40c0-949d-1409c97dab2c}") & MKDWD$(&H01)
MACRO MFPKEY_MULTICHANNEL_CHANNEL_MASK = GUID$("{58bdaf8c-3224-4692-86d0-44d65c5bf82b}") & MKDWD$(&H01)
$MF_SA_D3D_AWARE = GUID$("{eaa35c29-775e-488e-9b61-b3283e49583b}")
$MF_SA_REQUIRED_SAMPLE_COUNT = GUID$("{18802c61-324b-4952-abd0-176ff5c696ff}")
'#if (WINVER >= _WIN32_WINNT_WIN7)
$MF_TRANSFORM_ASYNC = GUID$("{f81a699a-649a-497d-8c73-29f8fed6ad7a}")
$MF_TRANSFORM_ASYNC_UNLOCK = GUID$("{e5666d6b-3422-4eb6-a421-da7db1f8e207}")
$MF_TRANSFORM_FLAGS_Attribute = GUID$("{9359bb7e-6275-46c4-a025-1c01e45f1a86}")
$MF_TRANSFORM_CATEGORY_Attribute = GUID$("{ceabba49-506d-4757-a6ff-66c184987e4e}")
$MFT_TRANSFORM_CLSID_Attribute = GUID$("{6821c42b-65a4-4e82-99bc-9a88205ecd0c}")
$MFT_INPUT_TYPES_Attributes = GUID$("{4276c9b1-759d-4bf3-9cd0-0d723d138f96}")
$MFT_OUTPUT_TYPES_Attributes = GUID$("{8eae8cf3-a44f-4306-ba5c-bf5dda242818}")
$MFT_ENUM_HARDWARE_URL_Attribute = GUID$("{2fb866ac-b078-4942-ab6c-003d05cda674}")
$MFT_FRIENDLY_NAME_Attribute = GUID$("{314ffbae-5b41-4c95-9c19-4e7d586face3}")
$MFT_CONNECTED_STREAM_ATTRIBUTE = GUID$("{71eeb820-a59f-4de2-bcec-38db1dd611a4}")
$MFT_CONNECTED_TO_HW_STREAM = GUID$("{34e6e728-06d6-4491-a553-4795650db912}")
$MFT_PREFERRED_OUTPUTTYPE_Attribute = GUID$("{7e700499-396a-49ee-b1b4-f628021e8c9d}")
$MFT_PROCESS_LOCAL_Attribute = GUID$("{543186e4-4649-4e65-b588-4aa352aff379}")
$MFT_PREFERRED_ENCODER_PROFILE = GUID$("{53004909-1ef5-46d7-a18e-5a75f8b5905f}")
$MFT_HW_TIMESTAMP_WITH_QPC_Attribute = GUID$("{8d030fb8-cc43-4258-a22e-9210bef89be4}")
$MFT_FIELDOFUSE_UNLOCK_Attribute = GUID$("{8ec2e9fd-9148-410d-831e-702439461a8e}")
$MFT_CODEC_MERIT_Attribute = GUID$("{88a7cb15-7b07-4a34-9128-e64c6703c4d3}")
$MFT_ENUM_TRANSCODE_ONLY_ATTRIBUTE = GUID$("{111ea8cd-b62a-4bdb-89f6-67ffcdc2458b}")
DECLARE FUNCTION MFCreateTransformActivate LIB "mfplat.dll" ALIAS "MFCreateTransformActivate" ( BYREF ppActivate AS IMFActivate ) AS LONG
'#endif // (WINVER >= _WIN32_WINNT_WIN7)
#ENDIF
