amstream.idl 7.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright 2004 Christian Costa
 *
 * 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
 */

import "unknwn.idl";
import "mmstream.idl";
import "strmif.idl";

cpp_quote("#include <ddraw.h>")
cpp_quote("#include <mmsystem.h>")
cpp_quote("#include <mmstream.h>")
cpp_quote("#include <ddstream.h>")
cpp_quote("#include <austream.h>")

cpp_quote("#if 0")
interface IDirectDraw;
interface IDirectDrawSurface;
cpp_quote("#endif")

interface IAMMultiMediaStream;
interface IAMMediaStream;
interface IMediaStreamFilter;
interface IAMMediaTypeStream;
interface IAMMediaTypeSample;

enum {
	AMMSF_NOGRAPHTHREAD      = 0x00000001
};

enum {
	AMMSF_ADDDEFAULTRENDERER = 0x00000001,
46 47 48
	AMMSF_CREATEPEER         = 0x00000002,
	AMMSF_STOPIFNOSAMPLES	 = 0x00000004,
	AMMSF_NOSTALL		 = 0x00000008
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
};

enum {
	AMMSF_RENDERTYPEMASK     = 0x00000003,
	AMMSF_RENDERTOEXISTING   = 0x00000000,
	AMMSF_RENDERALLSTREAMS   = 0x00000001,
	AMMSF_NORENDER           = 0x00000002,
	AMMSF_NOCLOCK            = 0x00000004,
	AMMSF_RUN                = 0x00000008
};


typedef [v1_enum] enum {
	Disabled = 0,
	ReadData = 1,
	RenderData = 2
} OUTPUT_STATE;

[
object,
uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D),
dual,
helpstring("IDirectShowStream Interface"),
pointer_default(unique)
]
interface IDirectShowStream : IDispatch
{
	[propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal);
	[propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
	[propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal);
	[propput, id(2), helpstring("propetry Video")] HRESULT Video([in] OUTPUT_STATE newVal);
	[propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal);
	[propput, id(3), helpstring("propetry Audio")] HRESULT Audio([in] OUTPUT_STATE newVal);
};

[
object,
uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D),
pointer_default(unique)
]
interface IAMMultiMediaStream : IMultiMediaStream
{
	HRESULT Initialize(
		[in] STREAM_TYPE StreamType,
		[in] DWORD dwFlags,
94
		[in] IGraphBuilder *pFilterGraph);
95 96 97 98 99 100 101 102

	HRESULT GetFilterGraph(
		[out] IGraphBuilder **ppGraphBuilder);

	HRESULT GetFilter(
		[out] IMediaStreamFilter **ppFilter);

	HRESULT AddMediaStream(
103 104
		[in] IUnknown *pStreamObject,
		[in] const MSPID *PurposeId,
105
		[in] DWORD dwFlags,
106
		[out] IMediaStream **ppNewStream);
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129

	HRESULT OpenFile(
		[in] LPCWSTR pszFileName,
		[in] DWORD dwFlags);

	HRESULT OpenMoniker(
		[in] IBindCtx *pCtx,
		[in] IMoniker *pMoniker,
		[in] DWORD dwFlags);

	HRESULT Render(
		[in] DWORD dwFlags);
}


[
object,
uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D),
pointer_default(unique)
]
interface IAMMediaStream : IMediaStream
{
	HRESULT Initialize(
130
		[in] IUnknown *pSourceObject,
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
		[in] DWORD dwFlags,
		[in] REFMSPID PurposeId,
		[in] const STREAM_TYPE StreamType);

	HRESULT SetState(
		[in] FILTER_STATE State);

	HRESULT JoinAMMultiMediaStream(
		[in] IAMMultiMediaStream *pAMMultiMediaStream);

	HRESULT JoinFilter(
		[in] IMediaStreamFilter *pMediaStreamFilter);

	HRESULT JoinFilterGraph(
		[in] IFilterGraph *pFilterGraph);
146
}
147 148 149 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


[
object,
local,
uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D),
pointer_default(unique)
]
interface IMediaStreamFilter : IBaseFilter
{
	HRESULT AddMediaStream(
		[in] IAMMediaStream *pAMMediaStream);

	HRESULT GetMediaStream(
		[in] REFMSPID idPurpose,
		[out] IMediaStream **ppMediaStream);

	HRESULT EnumMediaStreams(
		[in] long Index,
		[out] IMediaStream **ppMediaStream);

	HRESULT SupportSeeking(
		[in] BOOL bRenderer);

	HRESULT ReferenceTimeToStreamTime(
		[in] [out] REFERENCE_TIME *pTime);

	HRESULT GetCurrentStreamTime(
		[out] REFERENCE_TIME *pCurrentStreamTime);

	HRESULT WaitUntil(
		[in]  REFERENCE_TIME WaitStreamTime);

	HRESULT Flush(
		[in] BOOL bCancelEOS);

	HRESULT EndOfStream();
184
}
185 186 187 188 189 190 191 192 193 194 195


[
object,
local,
uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D),
pointer_default(unique)
]
interface IDirectDrawMediaSampleAllocator : IUnknown
{
	HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw);
196
}
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211


[
object,
local,
uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D),
pointer_default(unique)
]
interface IDirectDrawMediaSample : IUnknown
{
	HRESULT GetSurfaceAndReleaseLock(
		[out] IDirectDrawSurface **ppDirectDrawSurface,
		[out] RECT * pRect);

	HRESULT LockMediaSamplePointer(void);
212
}
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233


[
object,
local,
uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D),
pointer_default(unique)
]

interface IAMMediaTypeStream : IMediaStream
{
	HRESULT GetFormat(
		[out] AM_MEDIA_TYPE * pMediaType,
		[in] DWORD dwFlags);

	HRESULT SetFormat(
		[in] AM_MEDIA_TYPE * pMediaType,
		[in] DWORD dwFlags);

	HRESULT CreateSample(
		[in] long lSampleSize,
234
		[in] BYTE * pbBuffer,
235
		[in] DWORD dwFlags,
236
		[in] IUnknown *pUnkOuter,
237 238 239 240 241 242 243
		[out] IAMMediaTypeSample ** ppAMMediaTypeSample);

	HRESULT GetStreamAllocatorRequirements(
		[out] ALLOCATOR_PROPERTIES *pProps);

	HRESULT SetStreamAllocatorRequirements(
		[in] ALLOCATOR_PROPERTIES *pProps);
244
}
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303


[
object,
local,
uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D),
pointer_default(unique)
]
interface IAMMediaTypeSample : IStreamSample
{
	HRESULT SetPointer(
		[in] BYTE *pBuffer,
		[in] long lSize);

	HRESULT GetPointer(
		[out] BYTE ** ppBuffer);

	long GetSize(void);

	HRESULT GetTime(
		[out] REFERENCE_TIME * pTimeStart,
		[out] REFERENCE_TIME * pTimeEnd);

	HRESULT SetTime(
		[in] REFERENCE_TIME * pTimeStart,
		[in] REFERENCE_TIME * pTimeEnd);

	HRESULT IsSyncPoint(void);

	HRESULT SetSyncPoint(
		BOOL bIsSyncPoint);

	HRESULT IsPreroll(void);

	HRESULT SetPreroll(
		BOOL bIsPreroll);

	long GetActualDataLength(void);

	HRESULT SetActualDataLength(long Len);

	HRESULT GetMediaType(
		AM_MEDIA_TYPE **ppMediaType);

	HRESULT SetMediaType(
		AM_MEDIA_TYPE *pMediaType);

	HRESULT IsDiscontinuity(void);

	HRESULT SetDiscontinuity(
		BOOL bDiscontinuity);

	HRESULT GetMediaTime(
		[out] LONGLONG * pTimeStart,
		[out] LONGLONG * pTimeEnd);

	HRESULT SetMediaTime(
		[in] LONGLONG * pTimeStart,
		[in] LONGLONG * pTimeEnd);
304
}
305

306 307 308 309 310 311
[
    uuid(49C47CE5-9BA4-11d0-8212-00C04FC32C45)
]
coclass AMMultiMediaStream
{
    [default] dispinterface IDirectShowStream;
312
}
313

314 315 316 317
cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream,  0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
cpp_quote("DEFINE_GUID(CLSID_AMAudioStream,       0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
cpp_quote("DEFINE_GUID(CLSID_AMAudioData,         0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream,   0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0x0d, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")