' ########################################################################################
' Microsoft Windows
' File: mediaobj.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_mediaobj_PBI)
#DEFINE PBX_mediaobj_PBI
%MEDIAOBJ_INC = 1
' // Size = 72 bytes
TYPE DMO_MEDIA_TYPE DWORD
 majortype AS GUID ' GUID majortype
 subtype AS GUID ' GUID subtype
 bFixedSizeSamples AS LONG ' BOOL bFixedSizeSamples
 bTemporalCompression AS LONG ' BOOL bTemporalCompression
 lSampleSize AS DWORD ' ULONG lSampleSize
 formattype AS GUID ' GUID formattype
 pUnk AS DWORD PTR ' IUnknown *pUnk
 cbFormat AS DWORD ' ULONG cbFormat
 pbFormat AS BYTE PTR ' [size_is(cbFormat)] BYTE *pbFormat
END TYPE
'typedef LONGLONG REFERENCE_TIME;
' enum DMO_INPUT_DATA_BUFFER_FLAGS
%DMO_INPUT_DATA_BUFFERF_SYNCPOINT = &H1
%DMO_INPUT_DATA_BUFFERF_TIME = &H2
%DMO_INPUT_DATA_BUFFERF_TIMELENGTH = &H4
' enum DMO_OUTPUT_DATA_BUFFER_FLAGS
%DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT = &H1
%DMO_OUTPUT_DATA_BUFFERF_TIME = &H2
%DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH = &H4
%DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE = &H1000000
' enum DMO_INPUT_STATUS_FLAGS
%DMO_INPUT_STATUSF_ACCEPT_DATA = &H1
' enum DMO_INPUT_STREAM_INFO_FLAGS
%DMO_INPUT_STREAMF_WHOLE_SAMPLES = &H1
%DMO_INPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = &H2
%DMO_INPUT_STREAMF_FIXED_SAMPLE_SIZE = &H4
%DMO_INPUT_STREAMF_HOLDS_BUFFERS = &H8
' enum DMO_OUTPUT_STREAM_INFO_FLAGS
%DMO_OUTPUT_STREAMF_WHOLE_SAMPLES = &H1
%DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER = &H2
%DMO_OUTPUT_STREAMF_FIXED_SAMPLE_SIZE = &H4
%DMO_OUTPUT_STREAMF_DISCARDABLE = &H8
%DMO_OUTPUT_STREAMF_OPTIONAL = &H10
' enum DMO_SET_TYPE_FLAGS
%DMO_SET_TYPEF_TEST_ONLY = &H1
%DMO_SET_TYPEF_CLEAR = &H2
' enum DMO_PROCESS_OUTPUT_FLAGS
%DMO_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER = &H1
' ########################################################################################
' Interface name = IMediaBuffer
' IID = {59EFF8B9-938C-4A26-82F2-95CB84CDC837}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMediaBuffer_INTERFACE_DEFINED)
 %IMediaBuffer_INTERFACE_DEFINED = 1
$IID_IMediaBuffer = GUID$("{59EFF8B9-938C-4A26-82F2-95CB84CDC837}")
INTERFACE IMediaBuffer $IID_IMediaBuffer
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetLength ( ' VTable offset = 12
 BYVAL cbLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMaxLength ( ' VTable offset = 16
 BYREF pcbMaxLength AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetBufferAndLength ( ' VTable offset = 20
 BYREF ppBuffer AS DWORD
 , BYREF pcbLength AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMediaBuffer_INTERFACE_DEFINED__ */
' // Size = 24 bytes
TYPE DMO_OUTPUT_DATA_BUFFER QWORD FILL
 pBuffer AS DWORD ' IMediaBuffer *pBuffer
 dwStatus AS DWORD ' DWORD dwStatus
 rtTimestamp AS QUAD ' REFERENCE_TIME rtTimestamp
 rtTimelength AS QUAD ' REFERENCE_TIME rtTimelength
END TYPE
' ########################################################################################
' Interface name = IMediaObject
' IID = {D8AD0F58-5494-4102-97C5-EC798E59BCF4}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMediaObject_INTERFACE_DEFINED)
 %IMediaObject_INTERFACE_DEFINED = 1
$IID_IMediaObject = GUID$("{D8AD0F58-5494-4102-97C5-EC798E59BCF4}")
INTERFACE IMediaObject $IID_IMediaObject
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetStreamCount ( ' VTable offset = 12
 BYREF pcInputStreams AS DWORD
 , BYREF pcOutputStreams AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputStreamInfo ( ' VTable offset = 16
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputStreamInfo ( ' VTable offset = 20
 BYVAL dwOutputStreamIndex AS DWORD
 , BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputType ( ' VTable offset = 24
 BYVAL dwInputStreamIndex AS DWORD
 , BYVAL dwTypeIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputType ( ' VTable offset = 28
 BYVAL dwOutputStreamIndex AS DWORD
 , BYVAL dwTypeIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 ) AS LONG
 ' =====================================================================================
 METHOD SetInputType ( ' VTable offset = 32
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetOutputType ( ' VTable offset = 36
 BYVAL dwOutputStreamIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputCurrentType ( ' VTable offset = 40
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputCurrentType ( ' VTable offset = 44
 BYVAL dwOutputStreamIndex AS DWORD
 , BYREF pmt AS DMO_MEDIA_TYPE
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputSizeInfo ( ' VTable offset = 48
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF pcbSize AS DWORD
 , BYREF pcbMaxLookahead AS DWORD
 , BYREF pcbAlignment AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputSizeInfo ( ' VTable offset = 52
 BYVAL dwOutputStreamIndex AS DWORD
 , BYREF pcbSize AS DWORD
 , BYREF pcbAlignment AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputMaxLatency ( ' VTable offset = 56
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF prtMaxLatency AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD SetInputMaxLatency ( ' VTable offset = 60
 BYVAL dwInputStreamIndex AS DWORD
 , BYVAL rtMaxLatency AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD Flush ( ' VTable offset = 64
 ) AS LONG
 ' =====================================================================================
 METHOD Discontinuity ( ' VTable offset = 68
 BYVAL dwInputStreamIndex AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AllocateStreamingResources ( ' VTable offset = 72
 ) AS LONG
 ' =====================================================================================
 METHOD FreeStreamingResources ( ' VTable offset = 76
 ) AS LONG
 ' =====================================================================================
 METHOD GetInputStatus ( ' VTable offset = 80
 BYVAL dwInputStreamIndex AS DWORD
 , BYREF dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessInput ( ' VTable offset = 84
 BYVAL dwInputStreamIndex AS DWORD
 , BYVAL pBuffer AS IMediaBuffer
 , BYVAL dwFlags AS DWORD
 , BYVAL rtTimestamp AS QUAD
 , BYVAL rtTimelength AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD ProcessOutput ( ' VTable offset = 88
 BYVAL dwFlags AS DWORD
 , BYVAL cOutputBufferCount AS DWORD
 , BYREF pOutputBuffers AS DMO_OUTPUT_DATA_BUFFER
 , BYREF pdwStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Lock ( ' VTable offset = 92
 BYVAL bLock AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMediaObject_INTERFACE_DEFINED__ */
' ########################################################################################
' Interface name = IEnumDMO
' IID = {2C3CD98A-2BFA-4A53-9C27-5249BA64BA0F}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IEnumDMO_INTERFACE_DEFINED)
 %IEnumDMO_INTERFACE_DEFINED = 1
$IID_IEnumDMO = GUID$("{2C3CD98A-2BFA-4A53-9C27-5249BA64BA0F}")
INTERFACE IEnumDMO $IID_IEnumDMO
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Next ( ' VTable offset = 12
 BYVAL cItemsToFetch AS DWORD
 , BYREF pCLSID AS GUID
 , BYREF Names AS DWORD
 , BYREF pcItemsFetched AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Skip ( ' VTable offset = 16
 BYVAL cItemsToFetch AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Reset ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD Clone ( ' VTable offset = 24
 BYREF ppEnum AS IEnumDMO
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IEnumDMO_INTERFACE_DEFINED__ */
' enum DMO_INPLACE_PROCESS_FLAGS
%DMO_INPLACE_NORMAL = 0
%DMO_INPLACE_ZERO = &H1
' ########################################################################################
' Interface name = IMediaObjectInPlace
' IID = {651B9AD0-0FC7-4AA9-9538-D89931010741}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IMediaObjectInPlace_INTERFACE_DEFINED)
 %IMediaObjectInPlace_INTERFACE_DEFINED = 1
$IID_IMediaObjectInPlace = GUID$("{651B9AD0-0FC7-4AA9-9538-D89931010741}")
INTERFACE IMediaObjectInPlace $IID_IMediaObjectInPlace
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Process ( ' VTable offset = 12
 BYVAL ulSize AS DWORD
 , BYVAL pData AS BYTE PTR
 , BYVAL refTimeStart AS QUAD
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Clone ( ' VTable offset = 16
 BYREF ppMediaObject AS IMediaObjectInPlace
 ) AS LONG
 ' =====================================================================================
 METHOD GetLatency ( ' VTable offset = 20
 BYREF pLatencyTime AS QUAD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IMediaObjectInPlace_INTERFACE_DEFINED__ */
' enum DMO_QUALITY_STATUS_FLAGS
%DMO_QUALITY_STATUS_ENABLED = &H1
' ########################################################################################
' Interface name = IDMOQualityControl
' IID = {65ABEA96-CF36-453F-AF8A-705E98F16260}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IDMOQualityControl_INTERFACE_DEFINED)
 %IDMOQualityControl_INTERFACE_DEFINED = 1
$IID_IDMOQualityControl = GUID$("{65ABEA96-CF36-453F-AF8A-705E98F16260}")
INTERFACE IDMOQualityControl $IID_IDMOQualityControl
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetNow ( ' VTable offset = 12
 BYVAL rtNow AS QUAD
 ) AS LONG
 ' =====================================================================================
 METHOD SetStatus ( ' VTable offset = 16
 BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetStatus ( ' VTable offset = 20
 BYREF pdwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IDMOQualityControl_INTERFACE_DEFINED__ */
' enum DMO_VIDEO_OUTPUT_STREAM_FLAGS
%DMO_VOSF_NEEDS_PREVIOUS_SAMPLE = &H1
' ########################################################################################
' Interface name = IDMOVideoOutputOptimizations
' IID = {BE8F4F4E-5B16-4D29-B350-7F6B5D9298AC}
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IDMOVideoOutputOptimizations_INTERFACE_DEFINED)
 %IDMOVideoOutputOptimizations_INTERFACE_DEFINED = 1
$IID_IDMOVideoOutputOptimizations = GUID$("{BE8F4F4E-5B16-4D29-B350-7F6B5D9298AC}")
INTERFACE IDMOVideoOutputOptimizations $IID_IDMOVideoOutputOptimizations
 INHERIT IUnknown
 ' =====================================================================================
 METHOD QueryOperationModePreferences ( ' VTable offset = 12
 BYVAL ulOutputStreamIndex AS DWORD
 , BYREF pdwRequestedCapabilities AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetOperationMode ( ' VTable offset = 16
 BYVAL ulOutputStreamIndex AS DWORD
 , BYVAL dwEnabledFeatures AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentOperationMode ( ' VTable offset = 20
 BYVAL ulOutputStreamIndex AS DWORD
 , BYREF pdwEnabledFeatures AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentSampleRequirements ( ' VTable offset = 24
 BYVAL ulOutputStreamIndex AS DWORD
 , BYREF pdwRequestedFeatures AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IDMOVideoOutputOptimizations_INTERFACE_DEFINED__ */