amvideo.idl 7.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 2003 Robert Shearman
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 */

import "objidl.idl";

/* trick widl into thinking that it knows the DirectDraw types 
 * as there is no IDL file for them (yet) */
cpp_quote("#if 0")
typedef void * LPDIRECTDRAW;
typedef void DDSURFACEDESC,DDCAPS;
typedef DWORD RGBQUAD;
typedef LONGLONG REFERENCE_TIME;
typedef struct
{
    DWORD 	biSize;
    LONG  	biWidth;
    LONG  	biHeight;
    WORD 	biPlanes;
    WORD 	biBitCount;
    DWORD 	biCompression;
    DWORD 	biSizeImage;
    LONG  	biXPelsPerMeter;
    LONG  	biYPelsPerMeter;
    DWORD 	biClrUsed;
    DWORD 	biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
cpp_quote("#endif")

cpp_quote("#include <ddraw.h>")

cpp_quote("#define AMDDS_NONE 0x00")
cpp_quote("#define AMDDS_DCIPS 0x01")
cpp_quote("#define AMDDS_PS 0x02")
cpp_quote("#define AMDDS_RGBOVR 0x04")
cpp_quote("#define AMDDS_YUVOVR 0x08")
cpp_quote("#define AMDDS_RGBOFF 0x10")
cpp_quote("#define AMDDS_YUVOFF 0x20")
cpp_quote("#define AMDDS_RGBFLP 0x40")
cpp_quote("#define AMDDS_YUVFLP 0x80")
cpp_quote("#define AMDDS_ALL 0xFF")
cpp_quote("#define AMDDS_DEFAULT AMDDS_ALL")

cpp_quote("#define AMDDS_YUV (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP)")
cpp_quote("#define AMDDS_RGB (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP)")
cpp_quote("#define AMDSS_PRIMARY (AMDDS_DCIPS | AMDDS_PS)")

[
    object,
64
    /* uuid(36d39eb0-dd75-11ce-bf0e-00aa0055595a)  conflicts with uuids.h */
65 66
    pointer_default(unique),
    local
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
]
interface IDirectDrawVideo : IUnknown
{
    HRESULT GetSwitches([out] DWORD * pSwitches);
    HRESULT SetSwitches([in] DWORD Switches);
    HRESULT GetCaps([out] DDCAPS * pCaps);
    HRESULT GetEmulatedCaps([out] DDCAPS *pCaps);
    HRESULT GetSurfaceDesc([out] DDSURFACEDESC * pSurfaceDesc);
    HRESULT GetFourCCCodes([out] DWORD * pCount, [out] DWORD * pCodes);
    HRESULT SetDirectDraw([in] LPDIRECTDRAW pDirectDraw);
    HRESULT GetDirectDraw([out] LPDIRECTDRAW * ppDirectDraw);
    HRESULT GetSurfaceType([out] DWORD * pSurfaceType);
    HRESULT SetDefault();
    HRESULT UseScanLine([in] long UseScanLine);
    HRESULT CanUseScanLine([out] long * UseScanLine);
    HRESULT UseOverlayStretch([in] long UseOverlayStretch);
    HRESULT CanUseOverlayStretch([out] long * UseOverlayStretch);
    HRESULT UseWhenFullScreen([in] long UseWhenFullScreen);
    HRESULT WillUseFullScreen([out] long * UseWhenFullScreen);
}

[
    object,
90
    /* uuid(1bd0ecb0-f8e2-11ce-aac6-0020af0b99a3)  conflicts with uuids.h */
91 92
    pointer_default(unique),
    local
93 94 95
]
interface IQualProp : IUnknown
{
96 97 98 99 100 101
    [propget] HRESULT FramesDroppedInRenderer([out] int * pcFrames);
    [propget] HRESULT FramesDrawn([out] int * pcFramesDrawn);
    [propget] HRESULT AvgFrameRate([out] int * piAvgFrameRate);
    [propget] HRESULT Jitter([out] int * iJitter);
    [propget] HRESULT AvgSyncOffset([out] int * piAvg);
    [propget] HRESULT DevSyncOffset([out] int * piDev);
102 103 104 105
}

[
    object,
106
    /* uuid(dd1d7110-7836-11cf-bf47-00aa0055595a)  conflicts with uuids.h */
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
    pointer_default(unique)
]
interface IFullScreenVideo : IUnknown
{
    HRESULT CountModes([out] long * pModes);
    HRESULT GetModeInfo([in] long Mode, [out] long * pWidth, [out] long * pHeight, [out] long * pDepth);
    HRESULT GetCurrentMode([out] long * pMode);
    HRESULT IsModeAvailable([in] long Mode);
    HRESULT IsModeEnabled([in] long Mode);
    HRESULT SetEnabled([in] long Mode, [in] long bEnabled);
    HRESULT GetClipFactor([out] long * pClipFactor);
    HRESULT SetClipFactor([in] long ClipFactor);
    HRESULT SetMessageDrain([in] HWND hwnd);
    HRESULT GetMessageDrain([out] HWND * hwnd);
    HRESULT SetMonitor([in] long Monitor);
    HRESULT GetMonitor([out] long * Monitor);
    HRESULT HideOnDeactivate([in] long Hide);
    HRESULT IsHideOnDeactivate();
    HRESULT SetCaption([in] BSTR strCaption);
    HRESULT GetCaption([out] BSTR * pstrCaption);
    HRESULT SetDefault();
}

[
    object,
132
    /* uuid(53479470-f1dd-11cf-bc42-00aa00ac74f6)  conflicts with uuids.h */
133 134
    pointer_default(unique),
    local
135 136 137 138 139 140 141 142 143 144 145 146
]
interface IFullScreenVideoEx : IFullScreenVideo
{
    HRESULT SetAcceleratorTable([in] HWND hwnd, [in] HACCEL hAccel);
    HRESULT GetAcceleratorTable([out] HWND * phwnd, [out] HACCEL * phAccel);
    HRESULT KeepPixelAspectRatio([in] long KeepAspect);
    /* FIXME: not sure is this next method is an [out] */
    HRESULT IsKeepPixelAspectRatio([out] long * pKeepAspect);
}

[
    object,
147
    /* uuid(61ded640-e912-11ce-a099-00aa00479a58)  conflicts with uuids.h */
148 149
    pointer_default(unique),
    local
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
]
interface IBaseVideoMixer : IUnknown
{
    HRESULT SetLeadPin([in] int iPin);
    HRESULT GetLeadPin([out] int * piPin);
    HRESULT GetInputPinCount([out] int * piPinCount);
    HRESULT IsUsingClock([out] int * pbValue);
    HRESULT SetUsingClock([in] int bValue);
    HRESULT GetClockPeriod([out] int * pbValue);
    HRESULT SetClockPeriod([in] int bValue);
}

#define iPALETTE_COLORS 256
#define iMASK_COLORS 3

cpp_quote("#define iPALETTE_COLORS 256")
cpp_quote("#define iEGA_COLORS 16")
cpp_quote("#define iMASK_COLORS 3")
cpp_quote("#define iTRUECOLOR 16")
cpp_quote("#define iRED 0")
cpp_quote("#define iGREEN 1")
cpp_quote("#define iBLUE 2")
cpp_quote("#define iPALETTE 8")
cpp_quote("#define iMAXBITS 8")

typedef struct tag_TRUECOLORINFO
{
    DWORD dwBitMasks[iMASK_COLORS];
    RGBQUAD bmiColors[iPALETTE_COLORS];
} TRUECOLORINFO;

typedef struct tagVIDEOINFOHEADER
{
    RECT rcSource;
    RECT rcTarget;
    DWORD dwBitRate;
    DWORD dwBitErrorRate;
    REFERENCE_TIME AvgTimePerFrame;

    BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER;

typedef struct tagVIDEOINFO
{
    RECT rcSource;
    RECT rcTarget;
    DWORD dwBitRate;
    DWORD dwBitErrorRate;
    REFERENCE_TIME AvgTimePerFrame;

    BITMAPINFOHEADER bmiHeader;

    union
    {
        RGBQUAD bmiColors[iPALETTE_COLORS];
        DWORD dwBitMasks[iMASK_COLORS];
        TRUECOLORINFO TrueColorInfo;
207
    } DUMMYUNIONNAME;
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
} VIDEOINFO;

typedef struct tagMPEG1VIDEOINFO
{
    VIDEOINFOHEADER hdr;
    DWORD dwStartTimeCode;
    DWORD cbSequenceHeader;
    BYTE bSequenceHeader[1];
} MPEG1VIDEOINFO;

cpp_quote("#define MAX_SIZE_MPEG1_SEQUENCE_INFO 140")
cpp_quote("#define MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader)")

typedef struct tagAnalogVideoInfo
{
    RECT rcSource;
    RECT rcTarget;
    DWORD dwActiveWidth;
    DWORD dwActiveHeight;
    REFERENCE_TIME AvgTimePerFrame;
} ANALOGVIDEOINFO;

typedef enum
{
    AM_PROPERTY_FRAMESTEP_STEP = 0x01,
    AM_PROPERTY_FRAMESTEP_CANCEL = 0x02,
    AM_PROPERTY_FRAMESTEP_CANSTEP = 0x03,
    AM_PROPERTY_FRAMESTEP_CANSTEPMULTIPLE = 0x04
} AM_PROPERTY_FRAMESTEP;

typedef struct _AM_FRAMESTEP_STEP
{
    DWORD dwFramesToStep;
} AM_FRAMESTEP_STEP;