Skip to content

Instantly share code, notes, and snippets.

@Alexpux
Last active July 18, 2018 11:14
Show Gist options
  • Save Alexpux/47f863265d183c82dae1e2dbbc19cdcf to your computer and use it in GitHub Desktop.
Save Alexpux/47f863265d183c82dae1e2dbbc19cdcf to your computer and use it in GitHub Desktop.
New IDL files
cpp_quote("/**")
cpp_quote(" * This file is part of the mingw-w64 runtime package.")
cpp_quote(" * No warranty is given; refer to the file DISCLAIMER within this package.")
cpp_quote(" */")
cpp_quote("")
cpp_quote("#include <winapifamily.h>")
cpp_quote("")
cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
import "unknwn.idl";
import "propidl.idl";
import "mfidl.idl";
import "mftransform.idl";
import "mediaobj.idl";
import "strmif.idl";
interface IMFTrackedSample;
interface IMFVideoDisplayControl;
interface IMFVideoPresenter;
interface IMFVideoPositionMapper;
interface IMFDesiredSample;
interface IMFVideoMixerControl;
interface IMFVideoRenderer;
interface IMFVideoDeviceID;
interface IEVRFilterConfig;
cpp_quote("#if defined(__midl)")
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif
#ifndef D3DFORMAT
cpp_quote("")
typedef enum _D3DFORMAT {
D3DFMT_UNKNOWN = 0,
D3DFMT_R8G8B8 = 20,
D3DFMT_A8R8G8B8 = 21,
D3DFMT_X8R8G8B8 = 22,
D3DFMT_R5G6B5 = 23,
D3DFMT_X1R5G5B5 = 24,
D3DFMT_A1R5G5B5 = 25,
D3DFMT_A4R4G4B4 = 26,
D3DFMT_R3G3B2 = 27,
D3DFMT_A8 = 28,
D3DFMT_A8R3G3B2 = 29,
D3DFMT_X4R4G4B4 = 30,
D3DFMT_A2B10G10R10 = 31,
D3DFMT_G16R16 = 34,
D3DFMT_A8P8 = 40,
D3DFMT_P8 = 41,
D3DFMT_L8 = 50,
D3DFMT_A8L8 = 51,
D3DFMT_A4L4 = 52,
D3DFMT_V8U8 = 60,
D3DFMT_L6V5U5 = 61,
D3DFMT_X8L8V8U8 = 62,
D3DFMT_Q8W8V8U8 = 63,
D3DFMT_V16U16 = 64,
D3DFMT_W11V11U10 = 65,
D3DFMT_A2W10V10U10 = 67,
/*
D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
*/
D3DFMT_D16_LOCKABLE = 70,
D3DFMT_D32 = 71,
D3DFMT_D15S1 = 73,
D3DFMT_D24S8 = 75,
D3DFMT_D16 = 80,
D3DFMT_D24X8 = 77,
D3DFMT_D24X4S4 = 79,
D3DFMT_VERTEXDATA = 100,
D3DFMT_INDEX16 = 101,
D3DFMT_INDEX32 = 102,
D3DFMT_FORCE_DWORD = 0x7fffffff
} D3DFORMAT;
#endif
cpp_quote("#endif")
cpp_quote("")
typedef enum MFVideoAspectRatioMode {
MFVideoARMode_None = 0x00000000,
MFVideoARMode_PreservePicture = 0x00000001,
MFVideoARMode_PreservePixel = 0x00000002,
MFVideoARMode_NonLinearStretch = 0x00000004,
MFVideoARMode_Mask = 0x00000007
} MFVideoAspectRatioMode;
cpp_quote("")
typedef enum MFVideoRenderPrefs {
MFVideoRenderPrefs_DoNotRenderBorder = 0x00000001,
MFVideoRenderPrefs_DoNotClipToDevice = 0x00000002,
MFVideoRenderPrefs_AllowOutputThrottling = 0x00000004,
MFVideoRenderPrefs_ForceOutputThrottling = 0x00000008,
MFVideoRenderPrefs_ForceBatching = 0x00000010,
MFVideoRenderPrefs_AllowBatching = 0x00000020,
MFVideoRenderPrefs_ForceScaling = 0x00000040,
MFVideoRenderPrefs_AllowScaling = 0x00000080,
MFVideoRenderPrefs_DoNotRepaintOnStop = 0x00000100,
MFVideoRenderPrefs_Mask = 0x000001ff
} MFVideoRenderPrefs;
cpp_quote("")
cpp_quote("#ifndef _MFVideoNormalizedRect_")
cpp_quote("#define _MFVideoNormalizedRect_")
typedef struct MFVideoNormalizedRect {
float left;
float top;
float right;
float bottom;
} MFVideoNormalizedRect;
cpp_quote("#endif")
cpp_quote("")
typedef enum MFVP_MESSAGE_TYPE {
MFVP_MESSAGE_FLUSH = 0x00000000,
MFVP_MESSAGE_INVALIDATEMEDIATYPE = 0x00000001,
MFVP_MESSAGE_PROCESSINPUTNOTIFY = 0x00000002,
MFVP_MESSAGE_BEGINSTREAMING = 0x00000003,
MFVP_MESSAGE_ENDSTREAMING = 0x00000004,
MFVP_MESSAGE_ENDOFSTREAM = 0x00000005,
MFVP_MESSAGE_STEP = 0x00000006,
MFVP_MESSAGE_CANCELSTEP = 0x00000007
} MFVP_MESSAGE_TYPE;
cpp_quote("")
typedef enum _MFVideoMixPrefs {
MFVideoMixPrefs_ForceHalfInterlace = 0x00000001,
MFVideoMixPrefs_AllowDropToHalfInterlace = 0x00000002,
MFVideoMixPrefs_AllowDropToBob = 0x00000004,
MFVideoMixPrefs_ForceBob = 0x00000008,
MFVideoMixPrefs_EnableRotation = 0x00000010,
MFVideoMixPrefs_Mask = 0x0000000f
} MFVideoMixPrefs;
cpp_quote("")
typedef enum _EVRFilterConfig_Prefs {
EVRFilterConfigPrefs_EnableQoS = 0x00000001,
EVRFilterConfigPrefs_Mask = 0x00000001
} EVRFilterConfigPrefs;
cpp_quote("")
typedef enum _MF_SERVICE_LOOKUP_TYPE {
MF_SERVICE_LOOKUP_UPSTREAM,
MF_SERVICE_LOOKUP_UPSTREAM_DIRECT,
MF_SERVICE_LOOKUP_DOWNSTREAM,
MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT,
MF_SERVICE_LOOKUP_ALL,
MF_SERVICE_LOOKUP_GLOBAL
} MF_SERVICE_LOOKUP_TYPE;
cpp_quote("")
cpp_quote("DEFINE_GUID(MR_VIDEO_RENDER_SERVICE, 0x1092a86c, 0xab1a, 0x459a, 0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff);")
cpp_quote("DEFINE_GUID(MR_VIDEO_MIXER_SERVICE, 0x73cd2fc, 0x6cf4, 0x40b7, 0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8);")
cpp_quote("DEFINE_GUID(MR_VIDEO_ACCELERATION_SERVICE, 0xefef5175, 0x5c7d, 0x4ce2, 0xbb, 0xbd, 0x34, 0xff, 0x8b, 0xca, 0x65, 0x54);")
cpp_quote("DEFINE_GUID(MR_BUFFER_SERVICE, 0xa562248c, 0x9ac6, 0x4ffc, 0x9f, 0xba, 0x3a, 0xf8, 0xf8, 0xad, 0x1a, 0x4d);")
cpp_quote("DEFINE_GUID(VIDEO_ZOOM_RECT, 0x7aaa1638, 0x1b7f, 0x4c93, 0xbd, 0x89, 0x5b, 0x9c, 0x9f, 0xb6, 0xfc, 0xf0);")
cpp_quote("")
[object, uuid(1F6A9F17-E70B-4e24-8AE4-0B2C3BA7A4AE), helpstring("IMFVideoPositionMapper Interface"), local]
interface IMFVideoPositionMapper : IUnknown {
HRESULT MapOutputCoordinateToInputStream ([in] float xOut, [in] float yOut, [in] DWORD dwOutputStreamIndex, [in] DWORD dwInputStreamIndex, [out] float* pxIn, [out] float* pyIn);
};
cpp_quote("")
[object, uuid(A38D9567-5A9C-4f3c-B293-8EB415B279BA), helpstring("IMFVideoDeviceID Interface"), local]
interface IMFVideoDeviceID : IUnknown {
HRESULT GetDeviceID ([out] IID* pDeviceID);
};
cpp_quote("")
[object, uuid(a490b1e4-ab84-4d31-a1b2-181e03b1077a), helpstring("IMFVideoDisplayControl Interface")]
interface IMFVideoDisplayControl : IUnknown {
HRESULT GetNativeVideoSize ([in, out, unique] SIZE* pszVideo, [in, out, unique] SIZE* pszARVideo);
HRESULT GetIdealVideoSize ([in, out, unique] SIZE* pszMin, [in, out, unique] SIZE* pszMax);
HRESULT SetVideoPosition ([in, unique] const MFVideoNormalizedRect* pnrcSource, [in, unique] const LPRECT prcDest);
HRESULT GetVideoPosition ([out] MFVideoNormalizedRect* pnrcSource, [out] LPRECT prcDest);
HRESULT SetAspectRatioMode ([in] DWORD dwAspectRatioMode);
HRESULT GetAspectRatioMode ([out] DWORD* pdwAspectRatioMode);
HRESULT SetVideoWindow ([in] HWND hwndVideo);
HRESULT GetVideoWindow ([out] HWND* phwndVideo);
HRESULT RepaintVideo ();
HRESULT GetCurrentImage ([in, out] BITMAPINFOHEADER* pBih,[out, size_is(, *pcbDib)] BYTE** pDib, [out] DWORD* pcbDib, [in, out, unique] LONGLONG* pTimeStamp);
HRESULT SetBorderColor ([in] COLORREF Clr);
HRESULT GetBorderColor ([out] COLORREF* pClr);
HRESULT SetRenderingPrefs ([in] DWORD dwRenderFlags);
HRESULT GetRenderingPrefs ([out] DWORD* pdwRenderFlags);
HRESULT SetFullscreen ([in] WINBOOL fFullscreen);
HRESULT GetFullscreen ([out] WINBOOL* pfFullscreen);
};
cpp_quote("")
[object, uuid(29AFF080-182A-4a5d-AF3B-448F3A6346CB), helpstring("IMFVideoPresenter Interface"), local]
interface IMFVideoPresenter : IMFClockStateSink {
HRESULT ProcessMessage (MFVP_MESSAGE_TYPE eMessage, ULONG_PTR ulParam);
HRESULT GetCurrentMediaType ([out] IMFVideoMediaType** ppMediaType);
};
cpp_quote("")
[object, uuid(56C294D0-753E-4260-8D61-A3D8820B1D54), helpstring("IMFDesiredSample Interface"), local]
interface IMFDesiredSample : IUnknown {
HRESULT GetDesiredSampleTimeAndDuration ([out] LONGLONG *phnsSampleTime, [out] LONGLONG *phnsSampleDuration);
void SetDesiredSampleTimeAndDuration ([in] LONGLONG hnsSampleTime, [in] LONGLONG hnsSampleDuration);
void Clear();
};
cpp_quote("")
[object, uuid(245BF8E9-0755-40f7-88A5-AE0F18D55E17), helpstring("IMFTrackedSample Interface"), local]
interface IMFTrackedSample : IUnknown {
HRESULT SetAllocator ([in] IMFAsyncCallback* pSampleAllocator, [in, unique] IUnknown* pUnkState);
};
cpp_quote("")
[object, uuid(A5C6C53F-C202-4aa5-9695-175BA8C508A5), helpstring("IMFVideoMixerControl Interface")]
interface IMFVideoMixerControl : IUnknown {
HRESULT SetStreamZOrder ([in] DWORD dwStreamID, [in] DWORD dwZ);
HRESULT GetStreamZOrder ([in] DWORD dwStreamID, [out] DWORD* pdwZ);
HRESULT SetStreamOutputRect ([in] DWORD dwStreamID, [in] const MFVideoNormalizedRect *pnrcOutput);
HRESULT GetStreamOutputRect ([in] DWORD dwStreamID, [out] MFVideoNormalizedRect *pnrcOutput);
};
cpp_quote("")
[object, uuid(8459616d-966e-4930-b658-54fa7e5a16d3), helpstring("IMFVideoMixerControl2 Interface")]
interface IMFVideoMixerControl2 : IMFVideoMixerControl {
HRESULT SetMixingPrefs ([in] DWORD dwMixFlags);
HRESULT GetMixingPrefs ([out] DWORD* pdwMixFlags);
};
cpp_quote("")
[object, uuid(DFDFD197-A9CA-43d8-B341-6AF3503792CD), helpstring("IMFVideoRenderer Interface"), local]
interface IMFVideoRenderer : IUnknown {
HRESULT InitializeRenderer ([in, unique] IMFTransform* pVideoMixer, [in, unique] IMFVideoPresenter* pVideoPresenter);
};
cpp_quote("")
[object, uuid(83E91E85-82C1-4ea7-801D-85DC50B75086), helpstring("IEVRFilterConfig Interface"), local]
interface IEVRFilterConfig : IUnknown {
HRESULT SetNumberOfStreams ([in] DWORD dwMaxStreams);
HRESULT GetNumberOfStreams ([out,] DWORD* pdwMaxStreams);
};
cpp_quote("")
[object, uuid(aea36028-796d-454f-beee-b48071e24304), helpstring("IEVRFilterConfigEx Interface")]
interface IEVRFilterConfigEx : IEVRFilterConfig {
HRESULT SetConfigPrefs ([in] DWORD dwConfigFlags);
HRESULT GetConfigPrefs ([out] DWORD* pdwConfigFlags);
};
cpp_quote("")
[object, uuid(fa993889-4383-415a-a930-dd472a8cf6f7), helpstring("IMFTopologyServiceLookup Interface"), local]
interface IMFTopologyServiceLookup : IUnknown {
HRESULT LookupService([in] MF_SERVICE_LOOKUP_TYPE Type, [in] DWORD dwIndex, [in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] LPVOID* ppvObjects, [in, out] DWORD * pnObjects);
};
cpp_quote("")
[local, object, uuid(fa99388a-4383-415a-a930-dd472a8cf6f7)]
interface IMFTopologyServiceLookupClient : IUnknown {
HRESULT InitServicePointers ([in] IMFTopologyServiceLookup * pLookup);
HRESULT ReleaseServicePointers ();
};
cpp_quote("")
[object, uuid(83A4CE40-7710-494b-A893-A472049AF630), helpstring("IEVRTrustedVideoPlugin Interface"), local]
interface IEVRTrustedVideoPlugin: IUnknown {
HRESULT IsInTrustedVideoMode ([out] WINBOOL *pYes);
HRESULT CanConstrict ([out] WINBOOL *pYes);
HRESULT SetConstriction (DWORD dwKPix);
HRESULT DisableImageExport (WINBOOL bDisable);
};
cpp_quote("")
cpp_quote("#if MFEVRDLL")
cpp_quote("#define EVRPUBLIC(func) STDAPI _##func")
cpp_quote("#else" )
cpp_quote("#define EVRPUBLIC(func) STDAPI func")
cpp_quote("#endif")
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoPresenter)(" )
cpp_quote( " _In_opt_ IUnknown * pOwner," )
cpp_quote( " REFIID riidDevice," )
cpp_quote( " REFIID riid," )
cpp_quote( " _Outptr_result_maybenull_ void ** ppVideoPresenter" )
cpp_quote( " );" )
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoMixer)(" )
cpp_quote( " _In_opt_ IUnknown * pOwner," )
cpp_quote( " REFIID riidDevice," )
cpp_quote( " REFIID riid," )
cpp_quote( " _Outptr_ void ** ppv" )
cpp_quote( " );" )
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoMixerAndPresenter)(" )
cpp_quote( " _In_opt_ IUnknown * pMixerOwner,")
cpp_quote( " _In_opt_ IUnknown * pPresenterOwner,")
cpp_quote( " REFIID riidMixer,")
cpp_quote( " _Outptr_ void ** ppvVideoMixer, ")
cpp_quote( " REFIID riidPresenter,")
cpp_quote( " _Outptr_ void ** ppvVideoPresenter")
cpp_quote( " );" )
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoRenderer)(" )
cpp_quote( " REFIID riidRenderer,")
cpp_quote( " _Outptr_result_maybenull_ void ** ppVideoRenderer" )
cpp_quote( " );" )
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoSampleFromSurface)(" )
cpp_quote( " _In_ IUnknown* pUnkSurface," )
cpp_quote( " _Out_ IMFSample** ppSample" )
cpp_quote( " );" )
cpp_quote("")
cpp_quote( "EVRPUBLIC(MFCreateVideoSampleAllocator)(" )
cpp_quote( " _In_ REFIID riid," )
cpp_quote( " _Outptr_ void** ppSampleAllocator" )
cpp_quote( " );" )
cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */")
cpp_quote("")
--- /mingw64/x86_64-w64-mingw32/include/mfidl.idl.orig 2018-07-18 14:11:48.314571300 +0300
+++ /mingw64/x86_64-w64-mingw32/include/mfidl.idl 2018-07-18 14:11:54.054579300 +0300
@@ -255,6 +255,19 @@
HRESULT StopBuffering();
}
+[
+ object,
+ uuid(F6696E82-74F7-4f3d-A178-8A5E09C3659F),
+]
+interface IMFClockStateSink : IUnknown
+{
+ HRESULT OnClockStart([in] MFTIME hnsSystemTime,[in] LONGLONG llClockStartOffset);
+ HRESULT OnClockStop([in] MFTIME hnsSystemTime);
+ HRESULT OnClockPause([in] MFTIME hnsSystemTime);
+ HRESULT OnClockRestart([in] MFTIME hnsSystemTime);
+ HRESULT OnClockSetRate([in] MFTIME hnsSystemTime, [in] float flRate);
+}
+
cpp_quote("HRESULT WINAPI MFRequireProtectedEnvironment(IMFPresentationDescriptor *pPresentationDescriptor);")
cpp_quote("HRESULT WINAPI MFSerializePresentationDescriptor(IMFPresentationDescriptor *pPD,DWORD *pcbData,BYTE **ppbData);")
cpp_quote("/**")
cpp_quote(" * This file is part of the mingw-w64 runtime package.")
cpp_quote(" * No warranty is given; refer to the file DISCLAIMER within this package.")
cpp_quote(" */")
cpp_quote("")
import "unknwn.idl";
import "propsys.idl";
import "mfidl.idl";
import "evr.idl";
cpp_quote("#if (WINVER >= _WIN32_WINNT_WIN7) ")
interface IMFPMediaPlayer;
interface IMFPMediaItem;
interface IMFPMediaPlayerCallback;
interface IMFMediaEvent;
interface IMFNetCredential;
cpp_quote("")
cpp_quote("interface IMFMediaEvent;")
cpp_quote("interface IMFNetCredential;")
cpp_quote("")
typedef UINT32 MFP_CREATION_OPTIONS;
cpp_quote("")
typedef [v1_enum] enum _MFP_CREATION_OPTIONS {
MFP_OPTION_NONE = 0x00000000,
MFP_OPTION_FREE_THREADED_CALLBACK = 0x00000001,
MFP_OPTION_NO_MMCSS = 0x00000002,
MFP_OPTION_NO_REMOTE_DESKTOP_OPTIMIZATION = 0x00000004,
} _MFP_CREATION_OPTIONS;
cpp_quote("")
typedef [v1_enum] enum MFP_MEDIAPLAYER_STATE {
MFP_MEDIAPLAYER_STATE_EMPTY = 0x00000000,
MFP_MEDIAPLAYER_STATE_STOPPED = 0x00000001,
MFP_MEDIAPLAYER_STATE_PLAYING = 0x00000002,
MFP_MEDIAPLAYER_STATE_PAUSED = 0x00000003,
MFP_MEDIAPLAYER_STATE_SHUTDOWN = 0x00000004,
} MFP_MEDIAPLAYER_STATE;
cpp_quote("")
typedef UINT32 MFP_MEDIAITEM_CHARACTERISTICS;
cpp_quote("")
typedef [v1_enum] enum _MFP_MEDIAITEM_CHARACTERISTICS {
MFP_MEDIAITEM_IS_LIVE = 0x00000001,
MFP_MEDIAITEM_CAN_SEEK = 0x00000002,
MFP_MEDIAITEM_CAN_PAUSE = 0x00000004,
MFP_MEDIAITEM_HAS_SLOW_SEEK = 0x00000008,
} _MFP_MEDIAITEM_CHARACTERISTICS;
cpp_quote("")
typedef UINT32 MFP_CREDENTIAL_FLAGS;
cpp_quote("")
typedef [v1_enum] enum _MFP_CREDENTIAL_FLAGS{
MFP_CREDENTIAL_PROMPT = 0x00000001,
MFP_CREDENTIAL_SAVE = 0x00000002,
MFP_CREDENTIAL_DO_NOT_CACHE = 0x00000004,
MFP_CREDENTIAL_CLEAR_TEXT = 0x00000008,
MFP_CREDENTIAL_PROXY = 0x00000010,
MFP_CREDENTIAL_LOGGED_ON_USER = 0x00000020,
} _MFP_CREDENTIAL_FLAGS;
cpp_quote("STDAPI MFPCreateMediaPlayer(")
cpp_quote(" __in_opt LPCWSTR pwszURL,")
cpp_quote(" __in WINBOOL fStartPlayback,")
cpp_quote(" __in_opt MFP_CREATION_OPTIONS creationOptions,")
cpp_quote(" __in_opt IMFPMediaPlayerCallback * pCallback,")
cpp_quote(" __in_opt HWND hWnd,")
cpp_quote(" __out_opt IMFPMediaPlayer ** ppMediaPlayer );")
cpp_quote("")
[local, object, uuid(A714590A-58AF-430a-85BF-44F5EC838D85),]
interface IMFPMediaPlayer : IUnknown {
HRESULT Play();
HRESULT Pause();
HRESULT Stop();
HRESULT FrameStep();
HRESULT SetPosition([in, annotation("__in")] REFGUID guidPositionType, [in] const PROPVARIANT * pvPositionValue);
HRESULT GetPosition([in] REFGUID guidPositionType, [out] PROPVARIANT * pvPositionValue);
HRESULT GetDuration([in] REFGUID guidPositionType, [out] PROPVARIANT * pvDurationValue);
HRESULT SetRate([in] float flRate);
HRESULT GetRate([out] float *pflRate);
HRESULT GetSupportedRates([in] WINBOOL fForwardDirection, [out] float *pflSlowestRate, [out] float *pflFastestRate);
HRESULT GetState([out] MFP_MEDIAPLAYER_STATE * peState);
HRESULT CreateMediaItemFromURL([in] LPCWSTR pwszURL, [in] WINBOOL fSync, [in] DWORD_PTR dwUserData, [out] IMFPMediaItem ** ppMediaItem);
HRESULT CreateMediaItemFromObject([in] IUnknown * pIUnknownObj, [in] WINBOOL fSync, [in] DWORD_PTR dwUserData, [out] IMFPMediaItem ** ppMediaItem);
HRESULT SetMediaItem([in] IMFPMediaItem * pIMFPMediaItem);
HRESULT ClearMediaItem();
HRESULT GetMediaItem([out]IMFPMediaItem ** ppIMFPMediaItem);
HRESULT GetVolume([out] float *pflVolume);
HRESULT SetVolume([in] float flVolume);
HRESULT GetBalance([out] float *pflBalance);
HRESULT SetBalance([in] float flBalance);
HRESULT GetMute([out] WINBOOL * pfMute);
HRESULT SetMute([in] WINBOOL fMute);
HRESULT GetNativeVideoSize([out] SIZE *pszVideo, [out] SIZE *pszARVideo);
HRESULT GetIdealVideoSize([out] SIZE *pszMin, [out] SIZE *pszMax );
HRESULT SetVideoSourceRect([in] MFVideoNormalizedRect const *pnrcSource);
HRESULT GetVideoSourceRect([out] MFVideoNormalizedRect *pnrcSource);
HRESULT SetAspectRatioMode([in] DWORD dwAspectRatioMode);
HRESULT GetAspectRatioMode([out] DWORD *pdwAspectRatioMode);
HRESULT GetVideoWindow([out] HWND *phwndVideo );
HRESULT UpdateVideo();
HRESULT SetBorderColor([in] COLORREF Clr);
HRESULT GetBorderColor([out] COLORREF *pClr );
HRESULT InsertEffect([in, annotation("__in")] IUnknown * pEffect, [in] WINBOOL fOptional);
HRESULT RemoveEffect([in] IUnknown * pEffect);
HRESULT RemoveAllEffects();
HRESULT Shutdown();
};
cpp_quote("EXTERN_GUID( MFP_POSITIONTYPE_100NS, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 );")
cpp_quote("")
[local, object, uuid(90EB3E6B-ECBF-45cc-B1DA-C6FE3EA70D57),]
interface IMFPMediaItem : IUnknown {
HRESULT GetMediaPlayer([out] IMFPMediaPlayer ** ppMediaPlayer );
HRESULT GetURL([out] LPWSTR * ppwszURL );
HRESULT GetObject([out] IUnknown ** ppIUnknown );
HRESULT GetUserData([out] DWORD_PTR * pdwUserData );
HRESULT SetUserData([in] DWORD_PTR dwUserData );
HRESULT GetStartStopPosition([out] GUID * pguidStartPositionType, [out] PROPVARIANT * pvStartValue, [out] GUID * pguidStopPositionType, [out] PROPVARIANT * pvStopValue);
HRESULT SetStartStopPosition([in] const GUID * pguidStartPositionType, [in] const PROPVARIANT * pvStartValue, [in] const GUID * pguidStopPositionType, [in] const PROPVARIANT * pvStopValue);
HRESULT HasVideo([out] WINBOOL * pfHasVideo, [out] WINBOOL * pfSelected);
HRESULT HasAudio([out] WINBOOL * pfHasAudio, [out] WINBOOL * pfSelected);
HRESULT IsProtected([out] WINBOOL * pfProtected);
HRESULT GetDuration([in] REFGUID guidPositionType, [out] PROPVARIANT * pvDurationValue);
HRESULT GetNumberOfStreams([out] DWORD * pdwStreamCount);
HRESULT GetStreamSelection([in] DWORD dwStreamIndex, [out] WINBOOL * pfEnabled);
HRESULT SetStreamSelection([in] DWORD dwStreamIndex,[in] WINBOOL fEnabled);
HRESULT GetStreamAttribute([in] DWORD dwStreamIndex, [in] REFGUID guidMFAttribute, [out] PROPVARIANT * pvValue);
HRESULT GetPresentationAttribute([in] REFGUID guidMFAttribute, [out] PROPVARIANT * pvValue);
HRESULT GetCharacteristics([out] MFP_MEDIAITEM_CHARACTERISTICS * pCharacteristics);
HRESULT SetStreamSink([in] DWORD dwStreamIndex, [in] IUnknown* pMediaSink);
HRESULT GetMetadata([out] IPropertyStore** ppMetadataStore );
};
cpp_quote("")
typedef enum MFP_EVENT_TYPE {
MFP_EVENT_TYPE_PLAY = 0,
MFP_EVENT_TYPE_PAUSE = 1,
MFP_EVENT_TYPE_STOP = 2,
MFP_EVENT_TYPE_POSITION_SET = 3,
MFP_EVENT_TYPE_RATE_SET = 4,
MFP_EVENT_TYPE_MEDIAITEM_CREATED = 5,
MFP_EVENT_TYPE_MEDIAITEM_SET = 6,
MFP_EVENT_TYPE_FRAME_STEP = 7,
MFP_EVENT_TYPE_MEDIAITEM_CLEARED = 8,
MFP_EVENT_TYPE_MF = 9,
MFP_EVENT_TYPE_ERROR = 10,
MFP_EVENT_TYPE_PLAYBACK_ENDED = 11,
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL = 12,
}
MFP_EVENT_TYPE;
cpp_quote("")
typedef struct MFP_EVENT_HEADER {
MFP_EVENT_TYPE eEventType;
HRESULT hrEvent;
IMFPMediaPlayer * pMediaPlayer;
MFP_MEDIAPLAYER_STATE eState;
IPropertyStore * pPropertyStore;
} MFP_EVENT_HEADER;
cpp_quote("")
typedef struct MFP_PLAY_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_PLAY_EVENT;
cpp_quote("")
typedef struct MFP_PAUSE_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_PAUSE_EVENT;
cpp_quote("")
typedef struct MFP_STOP_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_STOP_EVENT;
cpp_quote("")
typedef struct MFP_POSITION_SET_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_POSITION_SET_EVENT;
cpp_quote("")
typedef struct MFP_RATE_SET_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
float flRate;
} MFP_RATE_SET_EVENT;
cpp_quote("")
typedef struct MFP_MEDIAITEM_CREATED_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
DWORD_PTR dwUserData;
} MFP_MEDIAITEM_CREATED_EVENT;
cpp_quote("")
typedef struct MFP_MEDIAITEM_SET_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_MEDIAITEM_SET_EVENT;
cpp_quote("")
typedef struct MFP_FRAME_STEP_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_FRAME_STEP_EVENT;
cpp_quote("")
typedef struct MFP_MEDIAITEM_CLEARED_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_MEDIAITEM_CLEARED_EVENT;
cpp_quote("")
typedef struct MFP_MF_EVENT {
MFP_EVENT_HEADER header;
MediaEventType MFEventType;
IMFMediaEvent * pMFMediaEvent;
IMFPMediaItem * pMediaItem;
} MFP_MF_EVENT;
cpp_quote("")
typedef struct MFP_ERROR_EVENT {
MFP_EVENT_HEADER header;
} MFP_ERROR_EVENT;
cpp_quote("")
typedef struct MFP_PLAYBACK_ENDED_EVENT {
MFP_EVENT_HEADER header;
IMFPMediaItem * pMediaItem;
} MFP_PLAYBACK_ENDED_EVENT;
cpp_quote("")
typedef struct MFP_ACQUIRE_USER_CREDENTIAL_EVENT {
MFP_EVENT_HEADER header;
DWORD_PTR dwUserData;
WINBOOL fProceedWithAuthentication;
HRESULT hrAuthenticationStatus;
LPCWSTR pwszURL;
LPCWSTR pwszSite;
LPCWSTR pwszRealm;
LPCWSTR pwszPackage;
LONG nRetries;
MFP_CREDENTIAL_FLAGS flags;
IMFNetCredential * pCredential;
} MFP_ACQUIRE_USER_CREDENTIAL_EVENT;
cpp_quote( "EXTERN_C const DECLSPEC_SELECTANY PROPERTYKEY MFP_PKEY_StreamIndex = { { 0xa7cf9740, 0xe8d9, 0x4a87, { 0xbd, 0x8e, 0x29, 0x67, 0x0, 0x1f, 0xd3, 0xad } }, 0x00 }; ")
cpp_quote( "EXTERN_C const DECLSPEC_SELECTANY PROPERTYKEY MFP_PKEY_StreamRenderingResults = { { 0xa7cf9740, 0xe8d9, 0x4a87, { 0xbd, 0x8e, 0x29, 0x67, 0x0, 0x1f, 0xd3, 0xad } }, 0x01 }; ")
cpp_quote( "#define __MFP_CAST_EVENT( pHdr, Tag ) ( ( (pHdr)->eEventType == MFP_EVENT_TYPE_##Tag ) ? (MFP_##Tag##_EVENT*)(pHdr) : NULL )" )
cpp_quote( "#define MFP_GET_PLAY_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, PLAY )" )
cpp_quote( "#define MFP_GET_PAUSE_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, PAUSE )" )
cpp_quote( "#define MFP_GET_STOP_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, STOP )" )
cpp_quote( "#define MFP_GET_POSITION_SET_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, POSITION_SET )" )
cpp_quote( "#define MFP_GET_RATE_SET_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, RATE_SET )" )
cpp_quote( "#define MFP_GET_MEDIAITEM_CREATED_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, MEDIAITEM_CREATED )" )
cpp_quote( "#define MFP_GET_MEDIAITEM_SET_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, MEDIAITEM_SET )" )
cpp_quote( "#define MFP_GET_FRAME_STEP_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, FRAME_STEP )" )
cpp_quote( "#define MFP_GET_MEDIAITEM_CLEARED_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, MEDIAITEM_CLEARED )" )
cpp_quote( "#define MFP_GET_MF_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, MF )" )
cpp_quote( "#define MFP_GET_ERROR_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, ERROR )" )
cpp_quote( "#define MFP_GET_PLAYBACK_ENDED_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, PLAYBACK_ENDED )" )
cpp_quote( "#define MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT( pHdr ) __MFP_CAST_EVENT( pHdr, ACQUIRE_USER_CREDENTIAL )" )
cpp_quote("")
[local, object, uuid(766C8FFB-5FDB-4fea-A28D-B912996F51BD),]
interface IMFPMediaPlayerCallback : IUnknown {
void OnMediaPlayerEvent([in] MFP_EVENT_HEADER * pEventHeader);
};
cpp_quote("#endif // (WINVER >= _WIN32_WINNT_WIN7) ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment