1/* 2 * Copyright (C) 2002 Robert Shearman 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * 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#define CHARS_IN_GUID 39 20cpp_quote("#define CHARS_IN_GUID 39") 21 22/* GetTimeFormat is defined in winnls.h as 23 * either the W or A suffixed version */ 24cpp_quote("#undef GetTimeFormat") 25 26typedef struct _AMMediaType 27{ 28 GUID majortype; 29 GUID subtype; 30 BOOL bFixedSizeSamples; 31 BOOL bTemporalCompression; 32 ULONG lSampleSize; 33 GUID formattype; 34 IUnknown * pUnk; 35 ULONG cbFormat; 36 [size_is(cbFormat)] BYTE * pbFormat; 37} AM_MEDIA_TYPE; 38 39typedef enum _PinDirection 40{ 41 PINDIR_INPUT, 42 PINDIR_OUTPUT 43} PIN_DIRECTION; 44 45#define MAX_PIN_NAME 128 46#define MAX_FILTER_NAME 128 47cpp_quote("#define MAX_PIN_NAME 128") 48cpp_quote("#define MAX_FILTER_NAME 128") 49 50cpp_quote("#ifndef REFERENCE_TIME_DEFINED") 51cpp_quote("#define REFERENCE_TIME_DEFINED") 52typedef LONGLONG REFERENCE_TIME; 53cpp_quote("#endif") 54 55cpp_quote("#ifndef REFTIME_DEFINED") 56cpp_quote("#define REFTIME_DEFINED") 57typedef DOUBLE REFTIME; 58cpp_quote("#endif") 59 60typedef DWORD_PTR HSEMAPHORE; 61typedef DWORD_PTR HEVENT; 62 63typedef struct _AllocatorProperties 64{ 65 long cBuffers; 66 long cbBuffer; 67 long cbAlign; 68 long cbPrefix; 69} ALLOCATOR_PROPERTIES; 70 71interface IAMovieSetup; 72interface IEnumFilters; 73interface IEnumMediaTypes; 74interface IEnumPins; 75interface IBaseFilter; 76interface IFilterGraph; 77interface IMediaFilter; 78interface IMediaSample; 79interface IMemAllocator; 80interface IMemAllocatorCallbackTemp; 81interface IMemAllocatorNotifyCallbackTemp; 82interface IMemInputPin; 83interface IPin; 84interface IReferenceClock; 85 86[ 87object, 88uuid(56a86891-0ad4-11ce-b03a-0020af0ba770), 89pointer_default(unique) 90] 91interface IPin : IUnknown 92{ 93 typedef struct _PinInfo 94 { 95 IBaseFilter *pFilter; 96 PIN_DIRECTION dir; 97 WCHAR achName[MAX_PIN_NAME]; 98 } PIN_INFO; 99 100 HRESULT Connect( 101 [in] IPin * pReceivePin, 102 [in] const AM_MEDIA_TYPE * pmt); 103 104 HRESULT ReceiveConnection( 105 [in] IPin * pConnector, 106 [in] const AM_MEDIA_TYPE *pmt); 107 108 HRESULT Disconnect(void); 109 110 HRESULT ConnectedTo( 111 [out] IPin **pPin); 112 113 HRESULT ConnectionMediaType( 114 [out] AM_MEDIA_TYPE *pmt); 115 116 HRESULT QueryPinInfo( 117 [out] PIN_INFO * pInfo); 118 119 HRESULT QueryDirection( 120 [out] PIN_DIRECTION *pPinDir); 121 122 HRESULT QueryId( 123 [out] LPWSTR * Id); 124 125 HRESULT QueryAccept( 126 [in] const AM_MEDIA_TYPE *pmt); 127 128 HRESULT EnumMediaTypes( 129 [out] IEnumMediaTypes **ppEnum); 130 131 HRESULT QueryInternalConnections( 132 [out] IPin* *apPin, 133 [in, out] ULONG *nPin); 134 135 HRESULT EndOfStream(void); 136 137 HRESULT BeginFlush(void); 138 139 HRESULT EndFlush(void); 140 HRESULT NewSegment( 141 [in] REFERENCE_TIME tStart, 142 [in] REFERENCE_TIME tStop, 143 [in] double dRate); 144} 145 146typedef IPin *PPIN; 147 148[ 149object, 150uuid(56a86892-0ad4-11ce-b03a-0020af0ba770), 151pointer_default(unique) 152] 153interface IEnumPins : IUnknown 154{ 155 156 HRESULT Next( 157 [in] ULONG cPins, 158 [out, size_is(cPins)] IPin ** ppPins, 159 [out] ULONG * pcFetched); 160 161 HRESULT Skip( 162 [in] ULONG cPins); 163 164 HRESULT Reset(void); 165 166 HRESULT Clone( 167 [out] IEnumPins **ppEnum); 168} 169 170typedef IEnumPins *PENUMPINS; 171 172[ 173object, 174uuid(89c31040-846b-11ce-97d3-00aa0055595a), 175pointer_default(unique) 176] 177interface IEnumMediaTypes : IUnknown 178{ 179 HRESULT Next( 180 [in] ULONG cMediaTypes, 181 [out, size_is(cMediaTypes)] 182 AM_MEDIA_TYPE ** ppMediaTypes, 183 [out] ULONG * pcFetched 184 ); 185 186 HRESULT Skip( 187 [in] ULONG cMediaTypes); 188 189 HRESULT Reset(void); 190 191 HRESULT Clone( 192 [out] IEnumMediaTypes **ppEnum 193 ); 194} 195 196typedef IEnumMediaTypes *PENUMMEDIATYPES; 197 198[ 199object, 200uuid(56a8689f-0ad4-11ce-b03a-0020af0ba770), 201pointer_default(unique) 202] 203interface IFilterGraph : IUnknown 204{ 205 HRESULT AddFilter( 206 [in] IBaseFilter * pFilter, 207 [in, string] LPCWSTR pName); 208 209 HRESULT RemoveFilter( 210 [in] IBaseFilter * pFilter); 211 212 HRESULT EnumFilters( 213 [out] IEnumFilters **ppEnum); 214 215 HRESULT FindFilterByName( 216 [in, string] LPCWSTR pName, 217 [out] IBaseFilter ** ppFilter); 218 219 HRESULT ConnectDirect( 220 [in] IPin * ppinOut, 221 [in] IPin * ppinIn, 222 [in, unique] const AM_MEDIA_TYPE* pmt); 223 224 HRESULT Reconnect( 225 [in] IPin * ppin); 226 227 HRESULT Disconnect( 228 [in] IPin * ppin); 229 230 HRESULT SetDefaultSyncSource(void); 231} 232 233typedef IFilterGraph *PFILTERGRAPH; 234 235[ 236object, 237uuid(56a86893-0ad4-11ce-b03a-0020af0ba770), 238pointer_default(unique) 239] 240interface IEnumFilters : IUnknown 241{ 242 HRESULT Next( 243 [in] ULONG cFilters, 244 [out] IBaseFilter ** ppFilter, 245 [out] ULONG * pcFetched); 246 247 248 HRESULT Skip( 249 [in] ULONG cFilters); 250 251 252 HRESULT Reset(void); 253 254 255 HRESULT Clone( 256 [out] IEnumFilters **ppEnum); 257} 258 259typedef IEnumFilters *PENUMFILTERS; 260 261[ 262object, 263uuid(56a86899-0ad4-11ce-b03a-0020af0ba770), 264pointer_default(unique) 265] 266interface IMediaFilter : IPersist 267{ 268 typedef enum _FilterState 269 { 270 State_Stopped, 271 State_Paused, 272 State_Running 273 } FILTER_STATE; 274 275 HRESULT Stop(void); 276 HRESULT Pause(void); 277 278 HRESULT Run(REFERENCE_TIME tStart); 279 280 HRESULT GetState( 281 [in] DWORD dwMilliSecsTimeout, 282 [out] FILTER_STATE *State); 283 284 HRESULT SetSyncSource( 285 [in] IReferenceClock * pClock); 286 287 HRESULT GetSyncSource( 288 [out] IReferenceClock ** pClock); 289} 290 291typedef IMediaFilter *PMEDIAFILTER; 292 293[ 294object, 295uuid(56a86895-0ad4-11ce-b03a-0020af0ba770), 296pointer_default(unique) 297] 298interface IBaseFilter : IMediaFilter 299{ 300 typedef struct _FilterInfo 301 { 302 WCHAR achName[MAX_FILTER_NAME]; 303 IFilterGraph * pGraph; 304 } FILTER_INFO; 305 306 HRESULT EnumPins( 307 [out] IEnumPins ** ppEnum); 308 309 HRESULT FindPin( 310 [in, string] LPCWSTR Id, 311 [out] IPin ** ppPin); 312 313 HRESULT QueryFilterInfo( 314 [out] FILTER_INFO * pInfo); 315 316 HRESULT JoinFilterGraph( 317 [in] IFilterGraph * pGraph, 318 [in, string] LPCWSTR pName); 319 320 HRESULT QueryVendorInfo( 321 [out, string] LPWSTR* pVendorInfo); 322} 323 324typedef IBaseFilter *PFILTER; 325 326[ 327object, 328uuid(56a86897-0ad4-11ce-b03a-0020af0ba770), 329pointer_default(unique) 330] 331interface IReferenceClock : IUnknown 332{ 333 HRESULT GetTime( 334 [out] REFERENCE_TIME *pTime); 335 336 HRESULT AdviseTime( 337 [in] REFERENCE_TIME baseTime, 338 [in] REFERENCE_TIME streamTime, 339 [in] HEVENT hEvent, 340 [out] DWORD_PTR * pdwAdviseCookie); 341 342 HRESULT AdvisePeriodic( 343 [in] REFERENCE_TIME startTime, 344 [in] REFERENCE_TIME periodTime, 345 [in] HSEMAPHORE hSemaphore, 346 [out] DWORD_PTR * pdwAdviseCookie); 347 348 HRESULT Unadvise( 349 [in] DWORD_PTR dwAdviseCookie); 350} 351 352typedef IReferenceClock *PREFERENCECLOCK; 353 354 355[ 356local, 357object, 358uuid(ebec459c-2eca-4d42-a8af-30df557614b8), 359pointer_default(unique) 360] 361interface IReferenceClockTimerControl : IUnknown { 362 363 HRESULT SetDefaultTimerResolution( 364 REFERENCE_TIME timerResolution); 365 HRESULT GetDefaultTimerResolution( 366 [out] REFERENCE_TIME* pTimerResolution); 367} 368 369 370/* 371[ 372object, 373uuid(36b73885-c2c8-11cf-8b46-00805f6cef60), 374pointer_default(unique) 375] 376interface IReferenceClock2 : IReferenceClock 377{ 378} 379 380typedef IReferenceClock2 *PREFERENCECLOCK2; 381 382*/ 383 384[ 385local, 386object, 387uuid(56a8689a-0ad4-11ce-b03a-0020af0ba770), 388pointer_default(unique) 389] 390interface IMediaSample : IUnknown 391{ 392 HRESULT GetPointer([out] BYTE ** ppBuffer); 393 394 long GetSize(void); 395 396 HRESULT GetTime( 397 [out] REFERENCE_TIME * pTimeStart, 398 [out] REFERENCE_TIME * pTimeEnd); 399 400 HRESULT SetTime( 401 [in] REFERENCE_TIME * pTimeStart, 402 [in] REFERENCE_TIME * pTimeEnd); 403 404 HRESULT IsSyncPoint(void); 405 406 HRESULT SetSyncPoint(BOOL bIsSyncPoint); 407 408 HRESULT IsPreroll(void); 409 410 HRESULT SetPreroll(BOOL bIsPreroll); 411 412 LONG GetActualDataLength(void); 413 414 HRESULT SetActualDataLength(LONG length); 415 416 HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType); 417 418 HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType); 419 420 HRESULT IsDiscontinuity(void); 421 422 HRESULT SetDiscontinuity(BOOL bDiscontinuity); 423 424 HRESULT GetMediaTime( 425 [out] LONGLONG * pTimeStart, 426 [out] LONGLONG * pTimeEnd); 427 428 HRESULT SetMediaTime( 429 [in] LONGLONG * pTimeStart, 430 [in] LONGLONG * pTimeEnd); 431} 432 433typedef IMediaSample *PMEDIASAMPLE; 434 435enum tagAM_SAMPLE_PROPERTY_FLAGS 436{ 437 AM_SAMPLE_SPLICEPOINT = 0x01, 438 AM_SAMPLE_PREROLL = 0x02, 439 AM_SAMPLE_DATADISCONTINUITY = 0x04, 440 AM_SAMPLE_TYPECHANGED = 0x08, 441 AM_SAMPLE_TIMEVALID = 0x10, 442 AM_SAMPLE_TIMEDISCONTINUITY = 0x40, 443 AM_SAMPLE_FLUSH_ON_PAUSE = 0x80, 444 AM_SAMPLE_STOPVALID = 0x100, 445 AM_SAMPLE_ENDOFSTREAM = 0x200, 446 AM_STREAM_MEDIA = 0, 447 AM_STREAM_CONTROL = 1 448}; 449 450typedef struct tagAM_SAMPLE2_PROPERTIES 451{ 452 DWORD cbData; 453 DWORD dwTypeSpecificFlags; 454 DWORD dwSampleFlags; 455 LONG lActual; 456 REFERENCE_TIME tStart; 457 REFERENCE_TIME tStop; 458 DWORD dwStreamId; 459 AM_MEDIA_TYPE *pMediaType; 460 BYTE *pbBuffer; 461 LONG cbBuffer; 462} AM_SAMPLE2_PROPERTIES; 463 464[ 465 local, 466 object, 467 uuid(36b73884-c2c8-11cf-8b46-00805f6cef60), 468 pointer_default(unique) 469] 470interface IMediaSample2 : IMediaSample 471{ 472 HRESULT GetProperties( 473 [in] DWORD cbProperties, 474 [out, size_is(cbProperties)] BYTE * pbProperties 475 ); 476 477 HRESULT SetProperties( 478 [in] DWORD cbProperties, 479 [in, size_is(cbProperties)] const BYTE * pbProperties 480 ); 481} 482 483typedef IMediaSample2 *PMEDIASAMPLE2; 484 485#define AM_GBF_PREVFRAMESKIPPED 1 486#define AM_GBF_NOTASYNCPOINT 2 487cpp_quote("#define AM_GBF_PREVFRAMESKIPPED 1") 488cpp_quote("#define AM_GBF_NOTASYNCPOINT 2") 489 490cpp_quote("#define AM_GBF_NOWAIT 4") 491cpp_quote("#define AM_GBF_NODDSURFACELOCK 8") 492 493[ 494object, 495uuid(56a8689c-0ad4-11ce-b03a-0020af0ba770), 496pointer_default(unique) 497] 498interface IMemAllocator : IUnknown 499{ 500 HRESULT SetProperties( 501 [in] ALLOCATOR_PROPERTIES* pRequest, 502 [out] ALLOCATOR_PROPERTIES* pActual); 503 504 HRESULT GetProperties( 505 [out] ALLOCATOR_PROPERTIES* pProps); 506 507 HRESULT Commit(void); 508 509 HRESULT Decommit(void); 510 511 HRESULT GetBuffer( 512 [out] IMediaSample **ppBuffer, 513 [in] REFERENCE_TIME * pStartTime, 514 [in] REFERENCE_TIME * pEndTime, 515 [in] DWORD dwFlags); 516 517 HRESULT ReleaseBuffer( 518 [in] IMediaSample *pBuffer); 519} 520 521typedef IMemAllocator *PMEMALLOCATOR; 522 523[ 524object, 525uuid(379a0cf0-c1de-11d2-abf5-00a0c905f375), 526pointer_default(unique) 527] 528interface IMemAllocatorCallbackTemp : IMemAllocator 529{ 530 HRESULT SetNotify( 531 [in] IMemAllocatorNotifyCallbackTemp *pNotify); 532 533 HRESULT GetFreeCount( 534 [out] LONG *plBuffersFree); 535} 536 537[ 538object, 539uuid(92980b30-c1de-11d2-abf5-00a0c905f375), 540pointer_default(unique) 541] 542interface IMemAllocatorNotifyCallbackTemp : IUnknown 543{ 544 HRESULT NotifyRelease(); 545} 546 547[ 548object, 549uuid(56a8689d-0ad4-11ce-b03a-0020af0ba770), 550pointer_default(unique) 551] 552interface IMemInputPin : IUnknown 553{ 554 HRESULT GetAllocator( 555 [out] IMemAllocator ** ppAllocator); 556 557 HRESULT NotifyAllocator( 558 [in] IMemAllocator * pAllocator, 559 [in] BOOL bReadOnly); 560 561 HRESULT GetAllocatorRequirements( [out] ALLOCATOR_PROPERTIES*pProps ); 562 563 HRESULT Receive( 564 [in] IMediaSample * pSample); 565 566 HRESULT ReceiveMultiple( 567 [in, size_is(nSamples)] IMediaSample **pSamples, 568 [in] long nSamples, 569 [out] long *nSamplesProcessed); 570 571 HRESULT ReceiveCanBlock(); 572} 573 574typedef IMemInputPin *PMEMINPUTPIN; 575 576[ 577object, 578uuid(a3d8cec0-7e5a-11cf-bbc5-00805f6cef20), 579pointer_default(unique) 580] 581interface IAMovieSetup : IUnknown 582{ 583 HRESULT Register( ); 584 HRESULT Unregister( ); 585} 586 587typedef IAMovieSetup *PAMOVIESETUP; 588 589typedef enum AM_SEEKING_SeekingFlags 590{ 591 AM_SEEKING_NoPositioning = 0x00, 592 AM_SEEKING_AbsolutePositioning = 0x01, 593 AM_SEEKING_RelativePositioning = 0x02, 594 AM_SEEKING_IncrementalPositioning = 0x03, 595 AM_SEEKING_PositioningBitsMask = 0x03, 596 AM_SEEKING_SeekToKeyFrame = 0x04, 597 AM_SEEKING_ReturnTime = 0x08, 598 AM_SEEKING_Segment = 0x10, 599 AM_SEEKING_NoFlush = 0x20 600} AM_SEEKING_SEEKING_FLAGS; 601 602typedef enum AM_SEEKING_SeekingCapabilities 603{ 604 AM_SEEKING_CanSeekAbsolute = 0x001, 605 AM_SEEKING_CanSeekForwards = 0x002, 606 AM_SEEKING_CanSeekBackwards = 0x004, 607 AM_SEEKING_CanGetCurrentPos = 0x008, 608 AM_SEEKING_CanGetStopPos = 0x010, 609 AM_SEEKING_CanGetDuration = 0x020, 610 AM_SEEKING_CanPlayBackwards = 0x040, 611 AM_SEEKING_CanDoSegments = 0x080, 612 AM_SEEKING_Source = 0x100 613} AM_SEEKING_SEEKING_CAPABILITIES; 614 615[ 616object, 617uuid(36b73880-c2c8-11cf-8b46-00805f6cef60), 618pointer_default(unique) 619] 620interface IMediaSeeking : IUnknown 621{ 622 HRESULT GetCapabilities( [out] DWORD * pCapabilities ); 623 624 HRESULT CheckCapabilities( [in,out] DWORD * pCapabilities ); 625 626 HRESULT IsFormatSupported([in] const GUID * pFormat); 627 628 HRESULT QueryPreferredFormat([out] GUID * pFormat); 629 630 HRESULT GetTimeFormat([out] GUID *pFormat); 631 632 HRESULT IsUsingTimeFormat([in] const GUID * pFormat); 633 634 HRESULT SetTimeFormat([in] const GUID * pFormat); 635 636 HRESULT GetDuration([out] LONGLONG *pDuration); 637 638 HRESULT GetStopPosition([out] LONGLONG *pStop); 639 640 HRESULT GetCurrentPosition([out] LONGLONG *pCurrent); 641 642 HRESULT ConvertTimeFormat([out] LONGLONG * pTarget, [in] const GUID * pTargetFormat, 643 [in] LONGLONG Source, [in] const GUID * pSourceFormat ); 644 645 HRESULT SetPositions( 646 [in,out] LONGLONG * pCurrent, 647 [in] DWORD dwCurrentFlags, 648 [in,out] LONGLONG * pStop, 649 [in] DWORD dwStopFlags); 650 651 HRESULT GetPositions( 652 [out] LONGLONG * pCurrent, 653 [out] LONGLONG * pStop); 654 655 HRESULT GetAvailable( 656 [out] LONGLONG * pEarliest, 657 [out] LONGLONG * pLatest); 658 659 HRESULT SetRate([in] double dRate); 660 661 HRESULT GetRate([out] double * pdRate); 662 663 HRESULT GetPreroll([out] LONGLONG * pllPreroll); 664} 665 666typedef IMediaSeeking *PMEDIASEEKING; 667 668enum tagAM_MEDIAEVENT_FLAGS 669{ 670 AM_MEDIAEVENT_NONOTIFY = 0x01 671}; 672 673enum _AMSTREAMSELECTINFOFLAGS 674{ 675 AMSTREAMSELECTINFO_ENABLED = 0x1, 676 AMSTREAMSELECTINFO_EXCLUSIVE = 0x2 677}; 678 679enum _AMSTREAMSELECTENABLEFLAGS 680{ 681 AMSTREAMSELECTENABLE_ENABLE = 0x1, 682 AMSTREAMSELECTENABLE_ENABLEALL = 0x2 683}; 684 685[ 686object, 687uuid(c1960960-17f5-11d1-abe1-00a0c905f375), 688pointer_default(unique) 689] 690interface IAMStreamSelect : IUnknown 691{ 692 HRESULT Count( 693 [out] DWORD *streams); 694 695 HRESULT Info( 696 [in] long index, 697 [out] AM_MEDIA_TYPE **media_type, 698 [out] DWORD *flags, 699 [out] LCID *lcid, 700 [out] DWORD *group, 701 [out] WCHAR **name, 702 [out] IUnknown **object, 703 [out] IUnknown **unknown); 704 705 HRESULT Enable( 706 [in] long index, 707 [in] DWORD flags); 708} 709 710typedef IAMStreamSelect *PAMSTREAMSELECT; 711