Changeset 6952
- Timestamp:
- Oct 6, 2001, 10:56:18 AM (24 years ago)
- Location:
- trunk
- Files:
-
- 14 added
- 10 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/include/win/strmif.h ¶
r6715 r6952 12 12 13 13 #include "ole2.h" 14 #include "wine/obj_oleaut.h" 15 #include "wine/obj_property.h" 16 #include "wine/obj_ksproperty.h" 14 17 15 18 /* undef GetTimeFormat - FIXME? */ … … 251 254 252 255 typedef LONGLONG REFERENCE_TIME; 253 #ifdef __WIN32OS2__254 typedef DWORD HSEMAPHORE;255 typedef DWORD HEVENT;256 #else257 256 typedef DWORD_PTR HSEMAPHORE; 258 257 typedef DWORD_PTR HEVENT; 259 #endif260 258 261 259 /* enums. */ … … 287 285 REG_PINFLAG_B_OUTPUT = 0x8, 288 286 } REG_PINFLAG; 287 288 typedef enum 289 { 290 AM_SAMPLE_SPLICEPOINT = 0x1, 291 AM_SAMPLE_PREROLL = 0x2, 292 AM_SAMPLE_DATADISCONTINUITY = 0x4, 293 AM_SAMPLE_TYPECHANGED = 0x8, 294 AM_SAMPLE_TIMEVALID = 0x10, 295 AM_SAMPLE_TIMEDISCONTINUITY = 0x40, 296 AM_SAMPLE_FLUSH_ON_PAUSE = 0x80, 297 AM_SAMPLE_STOPVALID = 0x100, 298 AM_SAMPLE_ENDOFSTREAM = 0x200, 299 300 AM_STREAM_MEDIA = 0, 301 AM_STREAM_CONTROL = 1 302 } AM_SAMPLE_PROPERTY_FLAGS; 289 303 290 304 … … 403 417 } REGFILTER2; 404 418 419 typedef struct 420 { 421 DWORD cbData; 422 DWORD dwTypeSpecificFlags; 423 DWORD dwSampleFlags; 424 LONG lActual; 425 REFERENCE_TIME tStart; 426 REFERENCE_TIME tStop; 427 DWORD dwStreamId; 428 AM_MEDIA_TYPE* pMediaType; 429 BYTE* pbBuffer; 430 LONG cbBuffer; 431 } AM_SAMPLE2_PROPERTIES; 432 433 405 434 406 435 /* defines. */ … … 410 439 #define MAX_FILTER_NAME 128 411 440 441 #define AM_GBF_PREVFRAMESKIPPED 1 442 #define AM_GBF_NOTASYNCPOINT 2 443 #define AM_GBF_NOWAIT 4 444 412 445 413 446 /* interfaces. */ 447 448 /************************************************************************** 449 * 450 * IAsyncReader interface 451 * 452 */ 453 454 #define ICOM_INTERFACE IAsyncReader 455 #define IAsyncReader_METHODS \ 456 ICOM_METHOD3(HRESULT,RequestAllocator,IMemAllocator*,a1,ALLOCATOR_PROPERTIES*,a2,IMemAllocator**,a3) \ 457 ICOM_METHOD2(HRESULT,Request,IMediaSample*,a1,DWORD_PTR,a2) \ 458 ICOM_METHOD3(HRESULT,WaitForNext,DWORD,a1,IMediaSample**,a2,DWORD_PTR*,a3) \ 459 ICOM_METHOD1(HRESULT,SyncReadAligned,IMediaSample*,a1) \ 460 ICOM_METHOD3(HRESULT,SyncRead,LONGLONG,a1,LONG,a2,BYTE*,a3) \ 461 ICOM_METHOD2(HRESULT,Length,LONGLONG*,a1,LONGLONG*,a2) \ 462 ICOM_METHOD (HRESULT,BeginFlush) \ 463 ICOM_METHOD (HRESULT,EndFlush) 464 465 #define IAsyncReader_IMETHODS \ 466 IUnknown_IMETHODS \ 467 IAsyncReader_METHODS 468 469 ICOM_DEFINE(IAsyncReader,IUnknown) 470 #undef ICOM_INTERFACE 471 472 /*** IUnknown methods ***/ 473 #define IAsyncReader_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 474 #define IAsyncReader_AddRef(p) ICOM_CALL (AddRef,p) 475 #define IAsyncReader_Release(p) ICOM_CALL (Release,p) 476 /*** IAsyncReader methods ***/ 477 #define IAsyncReader_RequestAllocator(p,a1,a2,a3) ICOM_CALL3(RequestAllocator,p,a1,a2,a3) 478 #define IAsyncReader_Request(p,a1,a2) ICOM_CALL2(Request,p,a1,a2) 479 #define IAsyncReader_WaitForNext(p,a1,a2,a3) ICOM_CALL3(WaitForNext,p,a1,a2,a3) 480 #define IAsyncReader_SyncReadAligned(p,a1) ICOM_CALL1(SyncReadAligned,p,a1) 481 #define IAsyncReader_SyncRead(p,a1,a2,a3) ICOM_CALL3(SyncRead,p,a1,a2,a3) 482 #define IAsyncReader_Length(p,a1,a2) ICOM_CALL2(Length,p,a1,a2) 483 #define IAsyncReader_BeginFlush(p) ICOM_CALL (BeginFlush,p) 484 #define IAsyncReader_EndFlush(p) ICOM_CALL (EndFlush,p) 414 485 415 486 /************************************************************************** … … 492 563 /************************************************************************** 493 564 * 565 * ICaptureGraphBuilder interface 566 * 567 */ 568 569 #define ICOM_INTERFACE ICaptureGraphBuilder 570 #define ICaptureGraphBuilder_METHODS \ 571 ICOM_METHOD1(HRESULT,SetFiltergraph,IGraphBuilder*,a1) \ 572 ICOM_METHOD1(HRESULT,GetFiltergraph,IGraphBuilder**,a1) \ 573 ICOM_METHOD4(HRESULT,SetOutputFileName,const GUID*,a1,LPCOLESTR,a2,IBaseFilter**,a3,IFileSinkFilter**,a4) \ 574 ICOM_METHOD4(HRESULT,FindInterface,const GUID*,a1,IBaseFilter*,a2,REFIID,a3,void**,a4) \ 575 ICOM_METHOD4(HRESULT,RenderStream,const GUID*,a1,IUnknown*,a2,IBaseFilter*,a3,IBaseFilter*,a4) \ 576 ICOM_METHOD6(HRESULT,ControlStream,const GUID*,a1,IBaseFilter*,a2,REFERENCE_TIME*,a3,REFERENCE_TIME*,a4,WORD,a5,WORD,a6) \ 577 ICOM_METHOD2(HRESULT,AllocCapFile,LPCOLESTR,a1,DWORDLONG,a2) \ 578 ICOM_METHOD4(HRESULT,CopyCaptureFile,LPOLESTR,a1,LPOLESTR,a2,int,a3,IAMCopyCaptureFileProgress*,a4) 579 580 #define ICaptureGraphBuilder_IMETHODS \ 581 IUnknown_IMETHODS \ 582 ICaptureGraphBuilder_METHODS 583 584 ICOM_DEFINE(ICaptureGraphBuilder,IUnknown) 585 #undef ICOM_INTERFACE 586 587 /*** IUnknown methods ***/ 588 #define ICaptureGraphBuilder_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 589 #define ICaptureGraphBuilder_AddRef(p) ICOM_CALL (AddRef,p) 590 #define ICaptureGraphBuilder_Release(p) ICOM_CALL (Release,p) 591 /*** ICaptureGraphBuilder methods ***/ 592 #define ICaptureGraphBuilder_SetFiltergraph(p,a1) ICOM_CALL1(SetFiltergraph,p,a1) 593 #define ICaptureGraphBuilder_GetFiltergraph(p,a1) ICOM_CALL1(GetFiltergraph,p,a1) 594 #define ICaptureGraphBuilder_SetOutputFileName(p,a1,a2,a3,a4) ICOM_CALL4(SetOutputFileName,p,a1,a2,a3,a4) 595 #define ICaptureGraphBuilder_FindInterface(p,a1,a2,a3,a4) ICOM_CALL4(FindInterface,p,a1,a2,a3,a4) 596 #define ICaptureGraphBuilder_RenderStream(p,a1,a2,a3,a4) ICOM_CALL4(RenderStream,p,a1,a2,a3,a4) 597 #define ICaptureGraphBuilder_ControlStream(p,a1,a2,a3,a4,a5,a6) ICOM_CALL6(ControlStream,p,a1,a2,a3,a4,a5,a6) 598 #define ICaptureGraphBuilder_AllocCapFile(p,a1,a2) ICOM_CALL2(AllocCapFile,p,a1,a2) 599 #define ICaptureGraphBuilder_CopyCaptureFile(p,a1,a2,a3,a4) ICOM_CALL4(CopyCaptureFile,p,a1,a2,a3,a4) 600 601 /************************************************************************** 602 * 603 * ICaptureGraphBuilder2 interface 604 * 605 */ 606 607 #define ICOM_INTERFACE ICaptureGraphBuilder2 608 #define ICaptureGraphBuilder2_METHODS \ 609 ICOM_METHOD1(HRESULT,SetFiltergraph,IGraphBuilder*,a1) \ 610 ICOM_METHOD1(HRESULT,GetFiltergraph,IGraphBuilder**,a1) \ 611 ICOM_METHOD4(HRESULT,SetOutputFileName,const GUID*,a1,LPCOLESTR,a2,IBaseFilter**,a3,IFileSinkFilter**,a4) \ 612 ICOM_METHOD5(HRESULT,FindInterface,const GUID*,a1,const GUID*,a2,IBaseFilter*,a3,REFIID,a4,void**,a5) \ 613 ICOM_METHOD5(HRESULT,RenderStream,const GUID*,a1,const GUID*,a2,IUnknown*,a3,IBaseFilter*,a4,IBaseFilter*,a5) \ 614 ICOM_METHOD7(HRESULT,ControlStream,const GUID*,a1,const GUID*,a2,IBaseFilter*,a3,REFERENCE_TIME*,a4,REFERENCE_TIME*,a5,WORD,a6,WORD,a7) \ 615 ICOM_METHOD2(HRESULT,AllocCapFile,LPCOLESTR,a1,DWORDLONG,a2) \ 616 ICOM_METHOD4(HRESULT,CopyCaptureFile,LPOLESTR,a1,LPOLESTR,a2,int,a3,IAMCopyCaptureFileProgress*,a4) \ 617 ICOM_METHOD7(HRESULT,FindPin,IUnknown*,a1,PIN_DIRECTION,a2,const GUID*,a3,const GUID*,a4,BOOL,a5,int,a6,IPin**,a7) 618 619 #define ICaptureGraphBuilder2_IMETHODS \ 620 IUnknown_IMETHODS \ 621 ICaptureGraphBuilder2_METHODS 622 623 ICOM_DEFINE(ICaptureGraphBuilder2,IUnknown) 624 #undef ICOM_INTERFACE 625 626 /*** IUnknown methods ***/ 627 #define ICaptureGraphBuilder2_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 628 #define ICaptureGraphBuilder2_AddRef(p) ICOM_CALL (AddRef,p) 629 #define ICaptureGraphBuilder2_Release(p) ICOM_CALL (Release,p) 630 /*** ICaptureGraphBuilder2 methods ***/ 631 #define ICaptureGraphBuilder2_SetFiltergraph(p,a1) ICOM_CALL1(SetFiltergraph,p,a1) 632 #define ICaptureGraphBuilder2_GetFiltergraph(p,a1) ICOM_CALL1(GetFiltergraph,p,a1) 633 #define ICaptureGraphBuilder2_SetOutputFileName(p,a1,a2,a3,a4) ICOM_CALL4(SetOutputFileName,p,a1,a2,a3,a4) 634 #define ICaptureGraphBuilder2_FindInterface(p,a1,a2,a3,a4,a5) ICOM_CALL5(FindInterface,p,a1,a2,a3,a4,a5) 635 #define ICaptureGraphBuilder2_RenderStream(p,a1,a2,a3,a4,a5) ICOM_CALL5(RenderStream,p,a1,a2,a3,a4,a5) 636 #define ICaptureGraphBuilder2_ControlStream(p,a1,a2,a3,a4,a5,a6,a7) ICOM_CALL7(ControlStream,p,a1,a2,a3,a4,a5,a6,a7) 637 #define ICaptureGraphBuilder2_AllocCapFile(p,a1,a2) ICOM_CALL2(AllocCapFile,p,a1,a2) 638 #define ICaptureGraphBuilder2_CopyCaptureFile(p,a1,a2,a3,a4) ICOM_CALL4(CopyCaptureFile,p,a1,a2,a3,a4) 639 #define ICaptureGraphBuilder2_FindPin(p,a1,a2,a3,a4,a5,a6,a7) ICOM_CALL7(FindPin,p,a1,a2,a3,a4,a5,a6,a7) 640 641 /************************************************************************** 642 * 494 643 * ICreateDevEnum interface 495 644 * … … 513 662 /*** ICreateDevEnum methods ***/ 514 663 #define ICreateDevEnum_CreateClassEnumerator(p,a1,a2,a3) ICOM_CALL3(CreateClassEnumerator,p,a1,a2,a3) 664 665 /************************************************************************** 666 * 667 * IDistributorNotify interface 668 * 669 */ 670 671 #define ICOM_INTERFACE IDistributorNotify 672 #define IDistributorNotify_METHODS \ 673 ICOM_METHOD (HRESULT,Stop) \ 674 ICOM_METHOD (HRESULT,Pause) \ 675 ICOM_METHOD1(HRESULT,Run,REFERENCE_TIME,a1) \ 676 ICOM_METHOD1(HRESULT,SetSyncSource,IReferenceClock*,a1) \ 677 ICOM_METHOD (HRESULT,NotifyGraphChange) 678 679 #define IDistributorNotify_IMETHODS \ 680 IUnknown_IMETHODS \ 681 IDistributorNotify_METHODS 682 683 ICOM_DEFINE(IDistributorNotify,IUnknown) 684 #undef ICOM_INTERFACE 685 686 /*** IUnknown methods ***/ 687 #define IDistributorNotify_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 688 #define IDistributorNotify_AddRef(p) ICOM_CALL (AddRef,p) 689 #define IDistributorNotify_Release(p) ICOM_CALL (Release,p) 690 /*** IDistributorNotify methods ***/ 691 #define IDistributorNotify_Stop(p) ICOM_CALL (Stop,p) 692 #define IDistributorNotify_Pause(p) ICOM_CALL (Pause,p) 693 #define IDistributorNotify_Run(p,a1) ICOM_CALL1(Run,p,a1) 694 #define IDistributorNotify_SetSyncSource(p,a1) ICOM_CALL1(SetSyncSource,p,a1) 695 #define IDistributorNotify_NotifyGraphChange(p) ICOM_CALL (NotifyGraphChange,p) 696 697 /************************************************************************** 698 * 699 * IDVSplitter interface 700 * 701 */ 702 703 #define ICOM_INTERFACE IDVSplitter 704 #define IDVSplitter_METHODS \ 705 ICOM_METHOD1(HRESULT,DiscardAlternateVideoFrames,int,a1) 706 707 #define IDVSplitter_IMETHODS \ 708 IUnknown_IMETHODS \ 709 IDVSplitter_METHODS 710 711 ICOM_DEFINE(IDVSplitter,IUnknown) 712 #undef ICOM_INTERFACE 713 714 /*** IUnknown methods ***/ 715 #define IDVSplitter_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 716 #define IDVSplitter_AddRef(p) ICOM_CALL (AddRef,p) 717 #define IDVSplitter_Release(p) ICOM_CALL (Release,p) 718 /*** IDVSplitter methods ***/ 719 #define IDVSplitter_DiscardAlternateVideoFrames(p,a1) ICOM_CALL1(DiscardAlternateVideoFrames,p,a1) 515 720 516 721 /************************************************************************** … … 684 889 #define IFileSourceFilter_Load(p,a1,a2) ICOM_CALL2(Load,p,a1,a2) 685 890 #define IFileSourceFilter_GetCurFile(p,a1,a2) ICOM_CALL2(GetCurFile,p,a1,a2) 891 892 /************************************************************************** 893 * 894 * IFilterChain interface 895 * 896 */ 897 898 #define ICOM_INTERFACE IFilterChain 899 #define IFilterChain_METHODS \ 900 ICOM_METHOD2(HRESULT,StartChain,IBaseFilter*,a1,IBaseFilter*,a2) \ 901 ICOM_METHOD2(HRESULT,PauseChain,IBaseFilter*,a1,IBaseFilter*,a2) \ 902 ICOM_METHOD2(HRESULT,StopChain,IBaseFilter*,a1,IBaseFilter*,a2) \ 903 ICOM_METHOD2(HRESULT,RemoveChain,IBaseFilter*,a1,IBaseFilter*,a2) 904 905 #define IFilterChain_IMETHODS \ 906 IUnknown_IMETHODS \ 907 IFilterChain_METHODS 908 909 ICOM_DEFINE(IFilterChain,IUnknown) 910 #undef ICOM_INTERFACE 911 912 /*** IUnknown methods ***/ 913 #define IFilterChain_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 914 #define IFilterChain_AddRef(p) ICOM_CALL (AddRef,p) 915 #define IFilterChain_Release(p) ICOM_CALL (Release,p) 916 /*** IFilterChain methods ***/ 917 #define IFilterChain_StartChain(p,a1,a2) ICOM_CALL2(StartChain,p,a1,a2) 918 #define IFilterChain_PauseChain(p,a1,a2) ICOM_CALL2(PauseChain,p,a1,a2) 919 #define IFilterChain_StopChain(p,a1,a2) ICOM_CALL2(StopChain,p,a1,a2) 920 #define IFilterChain_RemoveChain(p,a1,a2) ICOM_CALL2(RemoveChain,p,a1,a2) 686 921 687 922 /************************************************************************** … … 912 1147 /************************************************************************** 913 1148 * 1149 * IGraphConfig interface 1150 * 1151 */ 1152 1153 #define ICOM_INTERFACE IGraphConfig 1154 #define IGraphConfig_METHODS \ 1155 ICOM_METHOD6(HRESULT,Reconnect,IPin*,a1,IPin*,a2,const AM_MEDIA_TYPE*,a3,IBaseFilter*,a4,HANDLE,a5,DWORD,a6) \ 1156 ICOM_METHOD4(HRESULT,Reconfigure,IGraphConfigCallback*,a1,PVOID,a2,DWORD,a3,HANDLE,a4) \ 1157 ICOM_METHOD1(HRESULT,AddFilterToCache,IBaseFilter*,a1) \ 1158 ICOM_METHOD1(HRESULT,EnumCacheFilter,IEnumFilters**,a1) \ 1159 ICOM_METHOD1(HRESULT,RemoveFilterFromCache,IBaseFilter*,a1) \ 1160 ICOM_METHOD1(HRESULT,GetStartTime,REFERENCE_TIME*,a1) \ 1161 ICOM_METHOD3(HRESULT,PushThroughData,IPin*,a1,IPinConnection*,a2,HANDLE,a3) \ 1162 ICOM_METHOD2(HRESULT,SetFilterFlags,IBaseFilter*,a1,DWORD,a2) \ 1163 ICOM_METHOD2(HRESULT,GetFilterFlags,IBaseFilter*,a1,DWORD*,a2) \ 1164 ICOM_METHOD2(HRESULT,RemoveFilterEx,IBaseFilter*,a1,DWORD,a2) 1165 1166 #define IGraphConfig_IMETHODS \ 1167 IUnknown_IMETHODS \ 1168 IGraphConfig_METHODS 1169 1170 ICOM_DEFINE(IGraphConfig,IUnknown) 1171 #undef ICOM_INTERFACE 1172 1173 /*** IUnknown methods ***/ 1174 #define IGraphConfig_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 1175 #define IGraphConfig_AddRef(p) ICOM_CALL (AddRef,p) 1176 #define IGraphConfig_Release(p) ICOM_CALL (Release,p) 1177 /*** IGraphConfig methods ***/ 1178 #define IGraphConfig_Reconnect(p,a1,a2,a3,a4,a5,a6) ICOM_CALL6(Reconnect,p,a1,a2,a3,a4,a5,a6) 1179 #define IGraphConfig_Reconfigure(p,a1,a2,a3,a4) ICOM_CALL4(Reconfigure,p,a1,a2,a3,a4) 1180 #define IGraphConfig_AddFilterToCache(p,a1) ICOM_CALL1(AddFilterToCache,p,a1) 1181 #define IGraphConfig_EnumCacheFilter(p,a1) ICOM_CALL1(EnumCacheFilter,p,a1) 1182 #define IGraphConfig_RemoveFilterFromCache(p,a1) ICOM_CALL1(RemoveFilterFromCache,p,a1) 1183 #define IGraphConfig_GetStartTime(p,a1) ICOM_CALL1(GetStartTime,p,a1) 1184 #define IGraphConfig_PushThroughData(p,a1,a2,a3) ICOM_CALL3(PushThroughData,p,a1,a2,a3) 1185 #define IGraphConfig_SetFilterFlags(p,a1,a2) ICOM_CALL2(SetFilterFlags,p,a1,a2) 1186 #define IGraphConfig_GetFilterFlags(p,a1,a2) ICOM_CALL2(GetFilterFlags,p,a1,a2) 1187 #define IGraphConfig_RemoveFilterEx(p,a1,a2) ICOM_CALL2(RemoveFilterEx,p,a1,a2) 1188 1189 /************************************************************************** 1190 * 1191 * IGraphConfigCallback interface 1192 * 1193 */ 1194 1195 #define ICOM_INTERFACE IGraphConfigCallback 1196 #define IGraphConfigCallback_METHODS \ 1197 ICOM_METHOD2(HRESULT,Reconfigure,PVOID,a1,DWORD,a2) 1198 1199 #define IGraphConfigCallback_IMETHODS \ 1200 IUnknown_IMETHODS \ 1201 IGraphConfigCallback_METHODS 1202 1203 ICOM_DEFINE(IGraphConfigCallback,IUnknown) 1204 #undef ICOM_INTERFACE 1205 1206 /*** IUnknown methods ***/ 1207 #define IGraphConfigCallback_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 1208 #define IGraphConfigCallback_AddRef(p) ICOM_CALL (AddRef,p) 1209 #define IGraphConfigCallback_Release(p) ICOM_CALL (Release,p) 1210 /*** IGraphConfigCallback methods ***/ 1211 #define IGraphConfigCallback_Reconfigure(p,a1,a2) ICOM_CALL2(Reconfigure,p,a1,a2) 1212 1213 /************************************************************************** 1214 * 914 1215 * IGraphVersion interface 915 1216 * … … 934 1235 #define IGraphVersion_QueryVersion(p,a1) ICOM_CALL1(QueryVersion,p,a1) 935 1236 1237 936 1238 /************************************************************************** 937 1239 * … … 957 1259 /*** IMediaEventSink methods ***/ 958 1260 #define IMediaEventSink_Notify(p,a1,a2,a3) ICOM_CALL3(Notify,p,a1,a2,a3) 1261 1262 /************************************************************************** 1263 * 1264 * IMediaPropertyBag interface 1265 * 1266 */ 1267 1268 #define ICOM_INTERFACE IMediaPropertyBag 1269 #define IMediaPropertyBag_METHODS \ 1270 ICOM_METHOD3(HRESULT,EnumProperty,ULONG,a1,VARIANT*,a2,VARIANT*,a3) 1271 1272 #define IMediaPropertyBag_IMETHODS \ 1273 IPropertyBag_IMETHODS \ 1274 IMediaPropertyBag_METHODS 1275 1276 ICOM_DEFINE(IMediaPropertyBag,IPropertyBag) 1277 #undef ICOM_INTERFACE 1278 1279 /*** IUnknown methods ***/ 1280 #define IMediaPropertyBag_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 1281 #define IMediaPropertyBag_AddRef(p) ICOM_CALL (AddRef,p) 1282 #define IMediaPropertyBag_Release(p) ICOM_CALL (Release,p) 1283 /*** IPropertyBag methods ***/ 1284 #define IMediaPropertyBag_Read(p,a1,a2,a3) ICOM_CALL3(Read,p,a1,a2,a3) 1285 #define IMediaPropertyBag_Write(p,a1,a2) ICOM_CALL2(Write,p,a1,a2) 1286 /*** IMediaPropertyBag methods ***/ 1287 #define IMediaPropertyBag_EnumProperty(p,a1,a2,a3) ICOM_CALL3(EnumProperty,p,a1,a2,a3) 959 1288 960 1289 /************************************************************************** … … 1003 1332 #define IMediaSample_IsPreroll(p) ICOM_CALL (IsPreroll,p) 1004 1333 #define IMediaSample_SetPreroll(p,a1) ICOM_CALL1(SetPreroll,p,a1) 1005 #define IMediaSample_GetActualDataLength(p ,a1) ICOM_CALL1(GetActualDataLength,p,a1)1334 #define IMediaSample_GetActualDataLength(p) ICOM_CALL (GetActualDataLength,p) 1006 1335 #define IMediaSample_SetActualDataLength(p,a1) ICOM_CALL1(SetActualDataLength,p,a1) 1007 1336 #define IMediaSample_GetMediaType(p,a1) ICOM_CALL1(GetMediaType,p,a1) … … 1238 1567 /************************************************************************** 1239 1568 * 1569 * IOverlay interface 1570 * 1571 */ 1572 1573 #define ICOM_INTERFACE IOverlay 1574 #define IOverlay_METHODS \ 1575 ICOM_METHOD2(HRESULT,GetPalette,DWORD*,a1,PALETTEENTRY**,a2) \ 1576 ICOM_METHOD2(HRESULT,SetPalette,DWORD,a1,PALETTEENTRY*,a2) \ 1577 ICOM_METHOD1(HRESULT,GetDefaultColorKey,COLORKEY*,a1) \ 1578 ICOM_METHOD1(HRESULT,GetColorKey,COLORKEY*,a1) \ 1579 ICOM_METHOD1(HRESULT,SetColorKey,COLORKEY*,a1) \ 1580 ICOM_METHOD1(HRESULT,GetWindowHandle,HWND*,a1) \ 1581 ICOM_METHOD3(HRESULT,GetClipList,RECT*,a1,RECT*,a2,RGNDATA**,a3) \ 1582 ICOM_METHOD2(HRESULT,GetVideoPosition,RECT*,a1,RECT*,a2) \ 1583 ICOM_METHOD2(HRESULT,Advise,IOverlayNotify*,a1,DWORD,a2) \ 1584 ICOM_METHOD (HRESULT,Unadvise) 1585 1586 #define IOverlay_IMETHODS \ 1587 IUnknown_IMETHODS \ 1588 IOverlay_METHODS 1589 1590 ICOM_DEFINE(IOverlay,IUnknown) 1591 #undef ICOM_INTERFACE 1592 1593 /*** IUnknown methods ***/ 1594 #define IOverlay_QueryInterface(p,a1,a2) ICOM_CALL2(QueryInterface,p,a1,a2) 1595 #define IOverlay_AddRef(p) ICOM_CALL (AddRef,p) 1596 #define IOverlay_Release(p) ICOM_CALL (Release,p) 1597 /*** IOverlay methods ***/ 1598 #define IOverlay_GetPalette(p,a1,a2) ICOM_CALL2(GetPalette,p,a1,a2) 1599 #define IOverlay_SetPalette(p,a1,a2) ICOM_CALL2(SetPalette,p,a1,a2) 1600 #define IOverlay_GetDefaultColorKey(p,a1) ICOM_CALL1(GetDefaultColorKey,p,a1) 1601 #define IOverlay_GetColorKey(p,a1) ICOM_CALL1(GetColorKey,p,a1) 1602 #define IOverlay_SetColorKey(p,a1) ICOM_CALL1(SetColorKey,p,a1) 1603 #define IOverlay_GetWindowHandle(p,a1) ICOM_CALL1(GetWindowHandle,p,a1) 1604 #define IOverlay_GetClipList(p,a1,a2,a3) ICOM_CALL3(GetClipList,p,a1,a2,a3) 1605 #define IOverlay_GetVideoPosition(p,a1,a2) ICOM_CALL2(GetVideoPosition,p,a1,a2) 1606 #define IOverlay_Advise(p,a1,a2) ICOM_CALL2(Advise,p,a1,a2) 1607 #define IOverlay_Unadvise(p) ICOM_CALL1(Unadvise,p) 1608 1609 /************************************************************************** 1610 * 1240 1611 * IPin interface 1241 1612 * -
TabularUnified trunk/include/win/uuids.h ¶
r6715 r6952 1 1 #ifndef __WINE_DSHOW_UUIDS_H 2 2 #define __WINE_DSHOW_UUIDS_H 3 4 #include "wine/obj_base.h" 3 5 4 6 /* FIXME - many GUIDs should be defined in this header. */ -
TabularUnified trunk/include/win/wine/obj_property.h ¶
r641 r6952 1 /* $Id: obj_property.h,v 1.5 1999-08-22 22:52:09 sandervl Exp $ */2 1 /* 3 2 * Defines the COM interfaces and APIs from ocidl.h related to property … … 8 7 #ifndef __WINE_WINE_OBJ_PROPERTY_H 9 8 #define __WINE_WINE_OBJ_PROPERTY_H 10 11 12 #include "winbase.h"13 #include "wine/obj_oleaut.h" /* for DISPID */14 9 15 10 #ifdef __cplusplus … … 56 51 57 52 53 typedef enum tagPROPBAG2_TYPE 54 { 55 PROPBAG2_TYPE_UNDEFINED = 0, 56 PROPBAG2_TYPE_DATA = 1, 57 PROPBAG2_TYPE_URL = 2, 58 PROPBAG2_TYPE_OBJECT = 3, 59 PROPBAG2_TYPE_STREAM = 4, 60 PROPBAG2_TYPE_STORAGE = 5, 61 PROPBAG2_TYPE_MONIKER = 6 62 } PROPBAG2_TYPE; 63 64 typedef struct tagPROPBAG2 65 { 66 DWORD dwType; 67 VARTYPE vt; 68 CLIPFORMAT cfType; 69 DWORD dwHint; 70 LPOLESTR pstrName; 71 CLSID clsid; 72 } PROPBAG2; 73 58 74 /***************************************************************************** 59 75 * Predeclare the interfaces … … 83 99 typedef struct IPersistPropertyBag IPersistPropertyBag,*LPPERSISTPROPERTYBAG; 84 100 101 DEFINE_GUID(IID_IPersistPropertyBag2, 0x22f55881, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04); 102 typedef struct IPersistPropertyBag2 IPersistPropertyBag2,*LPPERSISTPROPERTYBAG2; 103 85 104 DEFINE_GUID(IID_IErrorLog, 0x3127ca40L, 0x446e, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51); 86 105 typedef struct IErrorLog IErrorLog,*LPERRORLOG; … … 89 108 typedef struct IPropertyBag IPropertyBag,*LPPROPERTYBAG; 90 109 110 DEFINE_GUID(IID_IPropertyBag2, 0x22f55882, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04); 111 typedef struct IPropertyBag2 IPropertyBag2,*LPPROPERTYBAG2; 112 91 113 DEFINE_GUID(IID_ISpecifyPropertyPages, 0xb196b28b, 0xbab4, 0x101a, 0xb6, 0x9c, 0x00, 0xaa, 0x00, 0x34, 0x1d, 0x07); 92 114 typedef struct ISpecifyPropertyPages ISpecifyPropertyPages,*LPSPECIFYPROPERTYPAGES; … … 118 140 #undef ICOM_INTERFACE 119 141 120 #ifdef ICOM_CINTERFACE121 142 /*** IUnknown methods ***/ 122 143 #define IPropertyPage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 135 156 #define IPropertyPage_Help(p,a) ICOM_CALL1(Help,p,a) 136 157 #define IPropertyPage_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) 137 #endif138 158 139 159 … … 150 170 #undef ICOM_INTERFACE 151 171 152 #ifdef ICOM_CINTERFACE153 172 /*** IUnknown methods ***/ 154 173 #define IPropertyPage2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 169 188 /*** IPropertyPage2 methods ***/ 170 189 #define IPropertyPage2_EditProperty(p,a) ICOM_CALL1(EditProperty,p,a) 171 #endif172 190 173 191 … … 187 205 #undef ICOM_INTERFACE 188 206 189 #ifdef ICOM_CINTERFACE190 207 /*** IUnknown methods ***/ 191 208 #define IPropertyPageSite_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 197 214 #define IPropertyPageSite_GetPageContainer(p,a) ICOM_CALL1(GetPageContainer,p,a) 198 215 #define IPropertyPageSite_TranslateAccelerator(p,a) ICOM_CALL1(TranslateAccelerator,p,a) 199 #endif200 216 201 217 … … 213 229 #undef ICOM_INTERFACE 214 230 215 #ifdef ICOM_CINTERFACE216 231 /*** IUnknown methods ***/ 217 232 #define IPropertyNotifySink_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 221 236 #define IPropertyNotifySink_OnChanged(p,a) ICOM_CALL1(OnChanged,p,a) 222 237 #define IPropertyNotifySink_OnRequestEdit(p,a) ICOM_CALL1(OnRequestEdit,p,a) 223 #endif224 238 225 239 … … 237 251 #undef ICOM_INTERFACE 238 252 239 #ifdef ICOM_CINTERFACE240 253 /*** IUnknown methods ***/ 241 254 #define ISimpleFrameSite_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 245 258 #define ISimpleFrameSite_PreMessageFilter(p,a,b,c,d,e,f) ICOM_CALL1(PreMessageFilter,p,a,b,c,d,e,f) 246 259 #define ISimpleFrameSite_PostMessageFilter(p,a,b,c,d,e,f) ICOM_CALL1(PostMessageFilter,p,a,b,c,d,e,f) 247 #endif248 260 249 261 … … 264 276 #undef ICOM_INTERFACE 265 277 266 #ifdef ICOM_CINTERFACE267 278 /*** IUnknown methods ***/ 268 279 #define IPersistStreamInit_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 277 288 #define IPersistStreamInit_GetSizeMax(p,a) ICOM_CALL1(GetSizeMax,p,a) 278 289 #define IPersistStreamInit_InitNew(p) ICOM_CALL (InitNew,p) 279 #endif280 290 281 291 … … 296 306 #undef ICOM_INTERFACE 297 307 298 #ifdef ICOM_CINTERFACE299 308 /*** IUnknown methods ***/ 300 309 #define IPersistMemory_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 309 318 #define IPersistMemory_GetSizeMax(p,a) ICOM_CALL1(GetSizeMax,p,a) 310 319 #define IPersistMemory_InitNew(p) ICOM_CALL (InitNew,p) 311 #endif312 320 313 321 … … 326 334 #undef ICOM_INTERFACE 327 335 328 #ifdef ICOM_CINTERFACE329 336 /*** IUnknown methods ***/ 330 337 #define IPersistPropertyBag_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 337 344 #define IPersistPropertyBag_Load(p,a,b) ICOM_CALL2(Load,p,a,b) 338 345 #define IPersistPropertyBag_Save(p,a,b,c) ICOM_CALL3(Save,p,a,b,c) 339 #endif 346 347 348 /***************************************************************************** 349 * IPersistPropertyBag2 interface 350 */ 351 #define ICOM_INTERFACE IPersistPropertyBag2 352 #define IPersistPropertyBag2_METHODS \ 353 ICOM_METHOD (HRESULT,InitNew) \ 354 ICOM_METHOD2(HRESULT,Load, IPropertyBag2*,pPropBag, IErrorLog*,pErrorLog) \ 355 ICOM_METHOD3(HRESULT,Save, IPropertyBag2*,pPropBag, BOOL,fClearDirty, BOOL,fSaveAllProperties) \ 356 ICOM_METHOD (HRESULT,IsDirty) 357 #define IPersistPropertyBag2_IMETHODS \ 358 IPersist_IMETHODS \ 359 IPersistPropertyBag2_METHODS 360 ICOM_DEFINE(IPersistPropertyBag2,IPersist) 361 #undef ICOM_INTERFACE 362 363 /*** IUnknown methods ***/ 364 #define IPersistPropertyBag2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) 365 #define IPersistPropertyBag2_AddRef(p) ICOM_CALL (AddRef,p) 366 #define IPersistPropertyBag2_Release(p) ICOM_CALL (Release,p) 367 /*** IPersist methods ***/ 368 #define IPersistPropertyBag2_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a) 369 /*** IPersistPropertyBag methods ***/ 370 #define IPersistPropertyBag2_InitNew(p) ICOM_CALL (InitNew,p) 371 #define IPersistPropertyBag2_Load(p,a,b) ICOM_CALL2(Load,p,a,b) 372 #define IPersistPropertyBag2_Save(p,a,b,c) ICOM_CALL3(Save,p,a,b,c) 373 #define IPersistPropertyBag2_IsDirty(p) ICON_CALL (IsDirty,p) 340 374 341 375 … … 352 386 #undef ICOM_INTERFACE 353 387 354 #ifdef ICOM_CINTERFACE355 388 /*** IUnknown methods ***/ 356 389 #define IErrorLog_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 359 392 /*** IErrorLog methods ***/ 360 393 #define IErrorLog_AddError(p,a,b) ICOM_CALL2(GetClassID,p,a,b) 361 #endif362 394 363 395 … … 375 407 #undef ICOM_INTERFACE 376 408 377 #ifdef ICOM_CINTERFACE378 409 /*** IUnknown methods ***/ 379 410 #define IPropertyBag_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 383 414 #define IPropertyBag_Read(p,a,b,c) ICOM_CALL3(Read,p,a,b,c) 384 415 #define IPropertyBag_Write(p,a,b) ICOM_CALL2(Write,p,a,b) 385 #endif 416 417 418 /***************************************************************************** 419 * IPropertyBag2 interface 420 */ 421 #define ICOM_INTERFACE IPropertyBag2 422 #define IPropertyBag2_METHODS \ 423 ICOM_METHOD5(HRESULT,Read, ULONG,cProperties, PROPBAG2*,pPropBag, IErrorLog*,pErrLog, VARIANT*,pvarValue, HRESULT*,phrError) \ 424 ICOM_METHOD3(HRESULT,Write, ULONG,cProperties, PROPBAG2*,pPropBag, VARIANT*,pvarValue) \ 425 ICOM_METHOD1(HRESULT,CountProperties, ULONG*,pcProperties) \ 426 ICOM_METHOD4(HRESULT,GetPropertyInfo, ULONG,iProperty, ULONG,cProperties, PROPBAG2*,pPropBag, ULONG*,pcProperties) \ 427 ICOM_METHOD4(HRESULT,LoadObject, LPCOLESTR,pstrName, DWORD,dwHint, IUnknown*,pUnkObject, IErrorLog*,pErrLog) 428 #define IPropertyBag2_IMETHODS \ 429 IUnknown_IMETHODS \ 430 IPropertyBag2_METHODS 431 ICOM_DEFINE(IPropertyBag2,IUnknown) 432 #undef ICOM_INTERFACE 433 434 /*** IUnknown methods ***/ 435 #define IPropertyBag2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) 436 #define IPropertyBag2_AddRef(p) ICOM_CALL (AddRef,p) 437 #define IPropertyBag2_Release(p) ICOM_CALL (Release,p) 438 /*** IPropertyBag methods ***/ 439 #define IPropertyBag2_Read(p,a,b,c,d,e) ICOM_CALL5(Read,p,a,b,c,d,e) 440 #define IPropertyBag2_Write(p,a,b,c) ICOM_CALL3(Write,p,a,b,c) 441 #define IPropertyBag2_CountProperties(p,a) ICOM_CALL1(CountProperties,p,a) 442 #define IPropertyBag2_GetPropertyInfo(p,a,b,c,d) ICOM_CALL4(GetPropertyInfo,p,a,b,c,d) 443 #define IPropertyBag2_LoadObject(p,a,b,c,d) ICOM_CALL4(LoadObject,p,a,b,c,d) 386 444 387 445 … … 398 456 #undef ICOM_INTERFACE 399 457 400 #ifdef ICOM_CINTERFACE401 458 /*** IUnknown methods ***/ 402 459 #define ISpecifyPropertyPages_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 405 462 /*** ISpecifyPropertyPages methods ***/ 406 463 #define ISpecifyPropertyPages_GetPages(p,a) ICOM_CALL3(GetPages,p,a) 407 #endif408 464 409 465 … … 423 479 #undef ICOM_INTERFACE 424 480 425 #ifdef ICOM_CINTERFACE426 481 /*** IUnknown methods ***/ 427 482 #define IPerPropertyBrowsing_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b) … … 433 488 #define IPerPropertyBrowsing_GetPredefinedStrings(p,a,b,c) ICOM_CALL3(GetPredefinedStrings,p,a,b,c) 434 489 #define IPerPropertyBrowsing_GetPredefinedValue(p,a,b,c) ICOM_CALL3(GetPredefinedValue,p,a,b,c) 435 #endif436 490 437 491 #ifdef __cplusplus -
TabularUnified trunk/src/oleaut32/typelib.c ¶
r6944 r6952 123 123 return S_OK; 124 124 } 125 #endif 126 125 #endif 127 126 /**************************************************************************** 128 127 * QueryPathOfRegTypeLib [OLEAUT32.164] … … 558 557 } 559 558 560 #if def __WIN32OS2__559 #ifndef __WIN32OS2__ 561 560 /**************************************************************************** 562 561 * OaBuildVersion (TYPELIB.15) … … 596 595 } 597 596 #endif 597 598 598 /* for better debugging info leave the static out for the time being */ 599 599 #define static … … 780 780 //#define TYPELIBDEBUG 781 781 #if defined(__WIN32OS2__) && defined(TYPELIBDEBUG) 782 782 783 /* 783 784 debug … … 1883 1884 { 1884 1885 *ppTypeLib = ITypeLib2_Constructor_MSFT(pBase, dwTLBLength); 1885 ITypeLib2_AddRef(*ppTypeLib);1886 1886 } 1887 1887 else if ( dwSignature == SLTG_SIGNATURE) 1888 1888 { 1889 1889 *ppTypeLib = ITypeLib2_Constructor_SLTG(pBase, dwTLBLength); 1890 ITypeLib2_AddRef(*ppTypeLib);1891 1890 } 1892 1891 UnmapViewOfFile(pBase); … … 1921 1920 { 1922 1921 *ppTypeLib = ITypeLib2_Constructor_MSFT(pBase, dwTLBLength); 1923 ITypeLib2_AddRef(*ppTypeLib);1924 1922 } 1925 1923 else if ( dwSignature == SLTG_SIGNATURE) 1926 1924 { 1927 1925 *ppTypeLib = ITypeLib2_Constructor_SLTG(pBase, dwTLBLength); 1928 ITypeLib2_AddRef(*ppTypeLib);1929 1926 } 1930 1927 else … … 2415 2412 } 2416 2413 2417 static char *SLTG_DoImpls( SLTG_ImplInfo *info, ITypeInfoImpl *pTI,2414 static char *SLTG_DoImpls(char *pBlk, ITypeInfoImpl *pTI, 2418 2415 BOOL OneOnly) 2419 2416 { 2417 SLTG_ImplInfo *info; 2420 2418 TLBImplType **ppImplType = &pTI->impltypelist; 2421 2419 /* I don't really get this structure, usually it's 0x16 bytes 2420 long, but iuser.tlb contains some that are 0x18 bytes long. 2421 That's ok because we can use the next ptr to jump to the next 2422 one. But how do we know the length of the last one? The WORD 2423 at offs 0x8 might be the clue. For now I'm just assuming that 2424 the last one is the regular 0x16 bytes. */ 2425 2426 info = (SLTG_ImplInfo*)pBlk; 2422 2427 while(1) { 2423 2428 *ppImplType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, … … 2432 2437 if(OneOnly) 2433 2438 FIXME("Interface inheriting more than one interface\n"); 2434 info ++;2435 } 2436 info++; 2439 info = (SLTG_ImplInfo*)(pBlk + info->next); 2440 } 2441 info++; /* see comment at top of function */ 2437 2442 return (char*)info; 2438 2443 } … … 2456 2461 2457 2462 if(*(WORD*)pFirstItem == SLTG_IMPL_MAGIC) { 2458 pNextItem = SLTG_DoImpls( (SLTG_ImplInfo*)pFirstItem, pTI, FALSE);2463 pNextItem = SLTG_DoImpls(pFirstItem, pTI, FALSE); 2459 2464 } 2460 2465 … … 2483 2488 2484 2489 if(*(WORD*)pFirstItem == SLTG_IMPL_MAGIC) { 2485 pNextItem = SLTG_DoImpls( (SLTG_ImplInfo*)pFirstItem, pTI, TRUE);2490 pNextItem = SLTG_DoImpls(pFirstItem, pTI, TRUE); 2486 2491 } 2487 2492 … … 3847 3852 TLBVarDesc * pVDesc; 3848 3853 HRESULT ret=S_OK; 3849 UINT nNameLen = SysStringLen(*rgszNames); 3850 3854 3851 3855 TRACE("(%p) Name %s cNames %d\n", This, debugstr_w(*rgszNames), 3852 3856 cNames); 3853 3857 for(pFDesc=This->funclist; pFDesc; pFDesc=pFDesc->next) { 3854 3858 int i, j; 3855 if( !memcmp(*rgszNames, pFDesc->Name, nNameLen)) {3859 if(!lstrcmpiW(*rgszNames, pFDesc->Name)) { 3856 3860 if(cNames) *pMemId=pFDesc->funcdesc.memid; 3857 3861 for(i=1; i < cNames; i++){ 3858 UINT nParamLen = SysStringLen(rgszNames[i]);3859 3862 for(j=0; j<pFDesc->funcdesc.cParams; j++) 3860 if( memcmp(rgszNames[i],pFDesc->pParamDesc[j].Name, nParamLen))3863 if(!lstrcmpiW(rgszNames[i],pFDesc->pParamDesc[j].Name)) 3861 3864 break; 3862 3865 if( j<pFDesc->funcdesc.cParams) … … 3869 3872 } 3870 3873 for(pVDesc=This->varlist; pVDesc; pVDesc=pVDesc->next) { 3871 if( !memcmp(*rgszNames, pVDesc->Name, nNameLen)) {3874 if(!lstrcmpiW(*rgszNames, pVDesc->Name)) { 3872 3875 if(cNames) *pMemId=pVDesc->vardesc.memid; 3873 3876 return ret; … … 3984 3987 for(pFDesc=This->funclist; pFDesc; pFDesc=pFDesc->next) 3985 3988 if (pFDesc->funcdesc.memid == memid) { 3986 if (pFDesc->funcdesc.invkind & (dwFlags & ~DISPATCH_METHOD))3989 if (pFDesc->funcdesc.invkind & dwFlags) 3987 3990 break; 3988 3991 } … … 4000 4003 if (i<pDispParams->cArgs) { 4001 4004 TRACE("set %d to disparg type %d vs %d\n",i, 4002 V_VT( pDispParams->rgvarg+i),4005 V_VT(&pDispParams->rgvarg[pDispParams->cArgs-i-1]), 4003 4006 pFDesc->funcdesc.lprgelemdescParam[i].tdesc.vt 4004 4007 ); 4005 args[i+1] = V_UNION( pDispParams->rgvarg+i,lVal);4008 args[i+1] = V_UNION(&pDispParams->rgvarg[pDispParams->cArgs-i-1],lVal); 4006 4009 } else { 4007 4010 TYPEDESC *tdesc = &(pFDesc->funcdesc.lprgelemdescParam[i].tdesc); … … 4084 4087 } 4085 4088 } else { 4086 FIXME("variable based invoking not supported yet.\n");4087 4089 for(pVDesc=This->varlist; pVDesc; pVDesc=pVDesc->next) { 4088 4090 if (pVDesc->vardesc.memid == memid) { 4089 FIXME("varseek: Found memid name %s \n",debugstr_w(((LPWSTR)pVDesc->Name)));4091 FIXME("varseek: Found memid name %s, but variable-based invoking not supported\n",debugstr_w(((LPWSTR)pVDesc->Name))); 4090 4092 dump_TLBVarDesc(pVDesc); 4091 4093 break; … … 4093 4095 } 4094 4096 } 4095 FIXME("Did not find member id %d!\n",(int)memid); 4097 /* not found, look for it in inherited interfaces */ 4098 if (This->TypeAttr.typekind==TKIND_INTERFACE && This->TypeAttr.cImplTypes) { 4099 /* recursive search */ 4100 ITypeInfo *pTInfo; 4101 HRESULT hr; 4102 hr=ITypeInfo_GetRefTypeInfo(iface, This->impltypelist->hRef, &pTInfo); 4103 if(SUCCEEDED(hr)){ 4104 hr=ITypeInfo_Invoke(pTInfo,pIUnk,memid,dwFlags,pDispParams,pVarResult,pExcepInfo,pArgErr); 4105 ITypeInfo_Release(pTInfo); 4106 return hr; 4107 } 4108 WARN("Could not search inherited interface!\n"); 4109 } 4110 ERR("did not find member id %d, flags %d!\n", (int)memid, dwFlags); 4096 4111 return DISP_E_MEMBERNOTFOUND; 4097 4112 } -
TabularUnified trunk/src/oleaut32/variant.c ¶
r6944 r6952 1577 1577 break; 1578 1578 1579 case( VT_UNKNOWN ): 1580 if (vtFrom == VT_DISPATCH) 1581 { 1582 res = IDispatch_QueryInterface(V_DISPATCH(ps), &IID_IUnknown, (LPVOID*)&V_UNKNOWN(pd)); 1583 } 1584 else 1585 { 1586 res = DISP_E_TYPEMISMATCH; 1587 FIXME("Coercion from %d to %d\n", vtFrom, vt ); 1588 } 1589 break; 1590 1579 1591 default: 1580 1592 res = DISP_E_TYPEMISMATCH; -
TabularUnified trunk/src/quartz/complist.c ¶
r6710 r6952 10 10 #include "winbase.h" 11 11 #include "wingdi.h" 12 #include "winuser.h" 12 13 #include "winerror.h" 13 14 #include "wine/obj_base.h" -
TabularUnified trunk/src/quartz/devenum.c ¶
r6710 r6952 2 2 * Implementation of CLSID_SystemDeviceEnum. 3 3 * 4 * FIXME - stub.4 * FIXME - not tested enough. 5 5 * 6 6 * hidenori@a2.ctktv.ne.jp … … 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 15 #include "winreg.h" 14 16 #include "winerror.h" 15 17 #include "wine/obj_base.h" 16 #include "wine/obj_oleaut.h" 18 #include "objidl.h" 19 #include "oleidl.h" 20 #include "ocidl.h" 17 21 #include "strmif.h" 18 22 #include "control.h" 19 23 #include "uuids.h" 24 #include "wine/unicode.h" 20 25 21 26 #include "debugtools.h" … … 24 29 #include "quartz_private.h" 25 30 #include "devenum.h" 31 #include "regsvr.h" 32 #include "enumunk.h" 33 #include "complist.h" 34 #include "devmon.h" 35 36 37 /*************************************************************************** 38 * 39 * new/delete for CLSID_SystemDeviceEnum 40 * 41 */ 26 42 27 43 /* can I use offsetof safely? - FIXME? */ … … 68 84 } 69 85 86 87 /*************************************************************************** 88 * 89 * CSysDevEnum::ICreateDevEnum 90 * 91 */ 92 93 94 static HRESULT WINAPI 95 ICreateDevEnum_fnQueryInterface(ICreateDevEnum* iface,REFIID riid,void** ppobj) 96 { 97 CSysDevEnum_THIS(iface,createdevenum); 98 99 TRACE("(%p)->()\n",This); 100 101 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 102 } 103 104 static ULONG WINAPI 105 ICreateDevEnum_fnAddRef(ICreateDevEnum* iface) 106 { 107 CSysDevEnum_THIS(iface,createdevenum); 108 109 TRACE("(%p)->()\n",This); 110 111 return IUnknown_AddRef(This->unk.punkControl); 112 } 113 114 static ULONG WINAPI 115 ICreateDevEnum_fnRelease(ICreateDevEnum* iface) 116 { 117 CSysDevEnum_THIS(iface,createdevenum); 118 119 TRACE("(%p)->()\n",This); 120 121 return IUnknown_Release(This->unk.punkControl); 122 } 123 124 static HRESULT WINAPI 125 ICreateDevEnum_fnCreateClassEnumerator(ICreateDevEnum* iface,REFCLSID rclsidDeviceClass,IEnumMoniker** ppobj, DWORD dwFlags) 126 { 127 CSysDevEnum_THIS(iface,createdevenum); 128 HRESULT hr; 129 HKEY hKey; 130 QUARTZ_CompList* pMonList; 131 IMoniker* pMon; 132 DWORD dwIndex; 133 LONG lr; 134 WCHAR wszPath[ 1024 ]; 135 DWORD dwLen; 136 DWORD dwNameMax; 137 DWORD cbName; 138 FILETIME ftLastWrite; 139 140 TRACE("(%p)->(%s,%p,%08lx)\n",This, 141 debugstr_guid(rclsidDeviceClass),ppobj,dwFlags); 142 if ( dwFlags != 0 ) 143 { 144 FIXME("unknown flags %08lx\n",dwFlags); 145 return E_NOTIMPL; 146 } 147 148 if ( ppobj == NULL ) 149 return E_POINTER; 150 *ppobj = NULL; 151 152 hr = QUARTZ_CreateCLSIDPath( 153 wszPath, sizeof(wszPath)/sizeof(wszPath[0]), 154 rclsidDeviceClass, QUARTZ_wszInstance ); 155 if ( FAILED(hr) ) 156 return hr; 157 158 if ( RegOpenKeyExW( HKEY_CLASSES_ROOT, wszPath, 159 0, KEY_READ, &hKey ) != ERROR_SUCCESS ) 160 return E_FAIL; 161 162 dwLen = strlenW(wszPath); 163 wszPath[dwLen++] = '\\'; wszPath[dwLen] = 0; 164 dwNameMax = sizeof(wszPath)/sizeof(wszPath[0]) - dwLen - 8; 165 166 pMonList = QUARTZ_CompList_Alloc(); 167 if ( pMonList == NULL ) 168 { 169 hr = E_OUTOFMEMORY; 170 goto err; 171 } 172 173 /* enumerate all subkeys. */ 174 dwIndex = 0; 175 while ( 1 ) 176 { 177 cbName = dwNameMax; 178 lr = RegEnumKeyExW( 179 hKey, dwIndex, &wszPath[dwLen], &cbName, 180 NULL, NULL, NULL, &ftLastWrite ); 181 if ( lr == ERROR_NO_MORE_ITEMS ) 182 break; 183 if ( lr != ERROR_SUCCESS ) 184 { 185 hr = E_FAIL; 186 goto err; 187 } 188 189 hr = QUARTZ_CreateDeviceMoniker( 190 HKEY_CLASSES_ROOT, wszPath, &pMon ); 191 if ( FAILED(hr) ) 192 goto err; 193 194 hr = QUARTZ_CompList_AddComp( 195 pMonList, (IUnknown*)pMon, NULL, 0 ); 196 IMoniker_Release( pMon ); 197 198 if ( FAILED(hr) ) 199 goto err; 200 201 dwIndex ++; 202 } 203 204 /* create an enumerator. */ 205 hr = QUARTZ_CreateEnumUnknown( 206 &IID_IEnumMoniker, (void**)ppobj, pMonList ); 207 if ( FAILED(hr) ) 208 goto err; 209 210 hr = S_OK; 211 err: 212 if ( pMonList != NULL ) 213 QUARTZ_CompList_Free( pMonList ); 214 RegCloseKey( hKey ); 215 216 return hr; 217 } 218 219 static ICOM_VTABLE(ICreateDevEnum) icreatedevenum = 220 { 221 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 222 /* IUnknown fields */ 223 ICreateDevEnum_fnQueryInterface, 224 ICreateDevEnum_fnAddRef, 225 ICreateDevEnum_fnRelease, 226 /* ICreateDevEnum fields */ 227 ICreateDevEnum_fnCreateClassEnumerator, 228 }; 229 230 HRESULT CSysDevEnum_InitICreateDevEnum( CSysDevEnum* psde ) 231 { 232 TRACE("(%p)\n",psde); 233 ICOM_VTBL(&psde->createdevenum) = &icreatedevenum; 234 235 return NOERROR; 236 } 237 238 void CSysDevEnum_UninitICreateDevEnum( CSysDevEnum* psde ) 239 { 240 TRACE("(%p)\n",psde); 241 } -
TabularUnified trunk/src/quartz/devmon.c ¶
r6710 r6952 1 1 /* 2 2 * Implements IMoniker for CLSID_CDeviceMoniker. 3 * Implements IPropertyBag. (internal) 3 4 * 4 5 * hidenori@a2.ctktv.ne.jp … … 27 28 #include "quartz_private.h" 28 29 #include "devmon.h" 29 #include "monprop.h"30 30 #include "regsvr.h" 31 31 32 33 /*************************************************************************** 34 * 35 * CDeviceMoniker::IMoniker 36 * 37 */ 32 38 33 39 static HRESULT WINAPI … … 150 156 return hr; 151 157 152 returnCoCreateInstance(158 hr = CoCreateInstance( 153 159 &clsid, NULL, CLSCTX_INPROC_SERVER, riid, ppvResult ); 160 TRACE( "hr = %08lx\n", hr ); 161 162 return hr; 154 163 } 155 164 … … 374 383 } 375 384 385 /*************************************************************************** 386 * 387 * new/delete for CDeviceMoniker 388 * 389 */ 376 390 377 391 static void QUARTZ_DestroyDeviceMoniker(IUnknown* punk) … … 383 397 384 398 /* can I use offsetof safely? - FIXME? */ 385 static QUARTZ_IFEntry IFEntries[] =399 static QUARTZ_IFEntry CDeviceMoniker_IFEntries[] = 386 400 { 387 401 { &IID_IPersist, offsetof(CDeviceMoniker,moniker)-offsetof(CDeviceMoniker,unk) }, … … 411 425 } 412 426 413 pdm->unk.pEntries = IFEntries;414 pdm->unk.dwEntries = sizeof( IFEntries)/sizeof(IFEntries[0]);427 pdm->unk.pEntries = CDeviceMoniker_IFEntries; 428 pdm->unk.dwEntries = sizeof(CDeviceMoniker_IFEntries)/sizeof(CDeviceMoniker_IFEntries[0]); 415 429 pdm->unk.pOnFinalRelease = &QUARTZ_DestroyDeviceMoniker; 416 430 … … 421 435 422 436 437 /*************************************************************************** 438 * 439 * CRegPropertyBag::IPropertyBag 440 * 441 */ 442 443 static HRESULT WINAPI 444 IPropertyBag_fnQueryInterface(IPropertyBag* iface,REFIID riid,void** ppobj) 445 { 446 CRegPropertyBag_THIS(iface,propbag); 447 448 TRACE("(%p)->()\n",This); 449 450 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 451 } 452 453 static ULONG WINAPI 454 IPropertyBag_fnAddRef(IPropertyBag* iface) 455 { 456 CRegPropertyBag_THIS(iface,propbag); 457 458 TRACE("(%p)->()\n",This); 459 460 return IUnknown_AddRef(This->unk.punkControl); 461 } 462 463 static ULONG WINAPI 464 IPropertyBag_fnRelease(IPropertyBag* iface) 465 { 466 CRegPropertyBag_THIS(iface,propbag); 467 468 TRACE("(%p)->()\n",This); 469 470 return IUnknown_Release(This->unk.punkControl); 471 } 472 473 static HRESULT WINAPI 474 IPropertyBag_fnRead(IPropertyBag* iface,LPCOLESTR lpszPropName,VARIANT* pVar,IErrorLog* pLog) 475 { 476 CRegPropertyBag_THIS(iface,propbag); 477 LONG lr; 478 DWORD dwSize; 479 DWORD dwValueType; 480 481 TRACE("(%p)->(%s,%p,%p)\n",This, 482 debugstr_w(lpszPropName),pVar,pLog); 483 484 if ( lpszPropName == NULL || pVar == NULL ) 485 return E_POINTER; 486 487 dwSize = 0; 488 lr = RegQueryValueExW( 489 This->m_hKey, lpszPropName, NULL, 490 &dwValueType, NULL, &dwSize ); 491 if ( lr != ERROR_SUCCESS ) 492 { 493 TRACE( "RegQueryValueExW failed.\n" ); 494 return E_INVALIDARG; 495 } 496 497 switch ( dwValueType ) 498 { 499 case REG_SZ: 500 TRACE( "REG_SZ / length = %lu\n", dwSize ); 501 if ( pVar->n1.n2.vt == VT_EMPTY ) 502 pVar->n1.n2.vt = VT_BSTR; 503 if ( pVar->n1.n2.vt != VT_BSTR ) 504 { 505 TRACE( "type of VARIANT is not BSTR\n" ); 506 return E_FAIL; 507 } 508 509 pVar->n1.n2.n3.bstrVal = SysAllocStringByteLen( 510 NULL, dwSize ); 511 if ( pVar->n1.n2.n3.bstrVal == NULL ) 512 { 513 TRACE( "out of memory.\n" ); 514 return E_OUTOFMEMORY; 515 } 516 lr = RegQueryValueExW( 517 This->m_hKey, lpszPropName, NULL, 518 &dwValueType, 519 (BYTE*)pVar->n1.n2.n3.bstrVal, &dwSize ); 520 if ( lr != ERROR_SUCCESS ) 521 { 522 TRACE( "failed to query value\n" ); 523 SysFreeString(pVar->n1.n2.n3.bstrVal); 524 return E_FAIL; 525 } 526 TRACE( "value is BSTR; %s\n", debugstr_w(pVar->n1.n2.n3.bstrVal) ); 527 break; 528 default: 529 FIXME("(%p)->(%s,%p,%p) - unsupported value type.\n",This, 530 debugstr_w(lpszPropName),pVar,pLog); 531 return E_FAIL; 532 } 533 534 TRACE( "returned successfully.\n" ); 535 return NOERROR; 536 } 537 538 static HRESULT WINAPI 539 IPropertyBag_fnWrite(IPropertyBag* iface,LPCOLESTR lpszPropName,VARIANT* pVar) 540 { 541 CRegPropertyBag_THIS(iface,propbag); 542 543 FIXME("(%p)->(%s,%p) stub!\n",This, 544 debugstr_w(lpszPropName),pVar); 545 546 if ( lpszPropName == NULL || pVar == NULL ) 547 return E_POINTER; 548 549 return E_NOTIMPL; 550 } 551 552 553 554 555 static ICOM_VTABLE(IPropertyBag) ipropbag = 556 { 557 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 558 /* IUnknown fields */ 559 IPropertyBag_fnQueryInterface, 560 IPropertyBag_fnAddRef, 561 IPropertyBag_fnRelease, 562 /* IPropertyBag fields */ 563 IPropertyBag_fnRead, 564 IPropertyBag_fnWrite, 565 }; 566 567 static HRESULT CRegPropertyBag_InitIPropertyBag( 568 CRegPropertyBag* prpb, HKEY hkRoot, LPCWSTR lpKeyPath ) 569 { 570 ICOM_VTBL(&prpb->propbag) = &ipropbag; 571 572 if ( RegOpenKeyExW( 573 hkRoot, lpKeyPath, 0, 574 KEY_ALL_ACCESS, &prpb->m_hKey ) != ERROR_SUCCESS ) 575 return E_FAIL; 576 577 return NOERROR; 578 } 579 580 static void CRegPropertyBag_UninitIPropertyBag( 581 CRegPropertyBag* prpb ) 582 { 583 RegCloseKey( prpb->m_hKey ); 584 } 585 586 587 /*************************************************************************** 588 * 589 * new/delete for CRegPropertyBag 590 * 591 */ 592 593 static void QUARTZ_DestroyRegPropertyBag(IUnknown* punk) 594 { 595 CRegPropertyBag_THIS(punk,unk); 596 597 CRegPropertyBag_UninitIPropertyBag(This); 598 } 599 600 601 /* can I use offsetof safely? - FIXME? */ 602 static QUARTZ_IFEntry CRegPropertyBag_IFEntries[] = 603 { 604 { &IID_IPropertyBag, offsetof(CRegPropertyBag,propbag)-offsetof(CRegPropertyBag,unk) }, 605 }; 606 607 HRESULT QUARTZ_CreateRegPropertyBag( 608 HKEY hkRoot, LPCWSTR lpKeyPath, 609 IPropertyBag** ppPropBag ) 610 { 611 CRegPropertyBag* prpb; 612 HRESULT hr; 613 614 TRACE("(%08x,%s,%p)\n",hkRoot,debugstr_w(lpKeyPath),ppPropBag ); 615 616 prpb = (CRegPropertyBag*)QUARTZ_AllocObj( sizeof(CRegPropertyBag) ); 617 if ( prpb == NULL ) 618 return E_OUTOFMEMORY; 619 620 QUARTZ_IUnkInit( &prpb->unk, NULL ); 621 hr = CRegPropertyBag_InitIPropertyBag( prpb, hkRoot, lpKeyPath ); 622 if ( FAILED(hr) ) 623 { 624 QUARTZ_FreeObj( prpb ); 625 return hr; 626 } 627 628 prpb->unk.pEntries = CRegPropertyBag_IFEntries; 629 prpb->unk.dwEntries = sizeof(CRegPropertyBag_IFEntries)/sizeof(CRegPropertyBag_IFEntries[0]); 630 prpb->unk.pOnFinalRelease = &QUARTZ_DestroyRegPropertyBag; 631 632 *ppPropBag = (IPropertyBag*)(&prpb->propbag); 633 634 return S_OK; 635 } 636 637 638 -
TabularUnified trunk/src/quartz/devmon.h ¶
r6710 r6952 34 34 35 35 36 /* 37 implements IPropertyBag for accessing registry. 38 39 - At least, the following interfaces should be implemented: 40 41 IUnknown 42 + IPropertyBag 43 */ 44 45 #include "iunk.h" 46 47 typedef struct DMON_IPropertyBagImpl 48 { 49 ICOM_VFIELD(IPropertyBag); 50 } DMON_IPropertyBagImpl; 51 52 typedef struct CRegPropertyBag 53 { 54 QUARTZ_IUnkImpl unk; 55 DMON_IPropertyBagImpl propbag; 56 /* IPropertyBag fields */ 57 HKEY m_hKey; 58 } CRegPropertyBag; 59 60 #define CRegPropertyBag_THIS(iface,member) CRegPropertyBag* This = (CRegPropertyBag*)(((char*)iface)-offsetof(CRegPropertyBag,member)) 61 62 HRESULT QUARTZ_CreateRegPropertyBag( 63 HKEY hkRoot, LPCWSTR lpKeyPath, 64 IPropertyBag** ppPropBag ); 65 36 66 #endif /* WINE_DSHOW_DEVMON_H */ -
TabularUnified trunk/src/quartz/enumunk.c ¶
r6710 r6952 10 10 #include "winbase.h" 11 11 #include "wingdi.h" 12 #include "winuser.h" 12 13 #include "winerror.h" 13 14 #include "wine/obj_base.h" … … 177 178 (void**)ppunk, 178 179 This->pCompList ); 180 FIXME( "current pointer must be seeked correctly\n" ); 179 181 180 182 QUARTZ_CompList_Unlock( This->pCompList ); -
TabularUnified trunk/src/quartz/fgidisp.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 14 15 #include "winerror.h" 15 16 #include "wine/obj_base.h" -
TabularUnified trunk/src/quartz/fgraph.c ¶
r6710 r6952 10 10 #include "winbase.h" 11 11 #include "wingdi.h" 12 #include "winuser.h" 12 13 #include "winerror.h" 13 14 #include "wine/obj_base.h" … … 23 24 #include "fgraph.h" 24 25 26 /*************************************************************************** 27 * 28 * new/delete for CFilterGraph 29 * 30 */ 31 25 32 /* can I use offsetof safely? - FIXME? */ 26 33 static QUARTZ_IFEntry IFEntries[] = … … 32 39 { &IID_IFilterGraph2, offsetof(CFilterGraph,fgraph)-offsetof(CFilterGraph,unk) }, 33 40 { &IID_IGraphVersion, offsetof(CFilterGraph,graphversion)-offsetof(CFilterGraph,unk) }, 41 { &IID_IGraphConfig, offsetof(CFilterGraph,grphconf)-offsetof(CFilterGraph,unk) }, 34 42 { &IID_IMediaControl, offsetof(CFilterGraph,mediacontrol)-offsetof(CFilterGraph,unk) }, 35 43 { &IID_IMediaFilter, offsetof(CFilterGraph,mediafilter)-offsetof(CFilterGraph,unk) }, … … 60 68 FGENT(IFilterGraph2) 61 69 FGENT(IGraphVersion) 70 FGENT(IGraphConfig) 62 71 FGENT(IMediaControl) 63 72 FGENT(IMediaFilter) … … 80 89 int i; 81 90 91 TRACE( "(%p)\n", punk ); 92 82 93 /* At first, call Stop. */ 83 94 IMediaControl_Stop( CFilterGraph_IMediaControl(This) ); … … 136 147 137 148 149 /*************************************************************************** 150 * 151 * CFilterGraph::IPersist 152 * 153 */ 154 155 static HRESULT WINAPI 156 IPersist_fnQueryInterface(IPersist* iface,REFIID riid,void** ppobj) 157 { 158 CFilterGraph_THIS(iface,persist); 159 160 TRACE("(%p)->()\n",This); 161 162 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 163 } 164 165 static ULONG WINAPI 166 IPersist_fnAddRef(IPersist* iface) 167 { 168 CFilterGraph_THIS(iface,persist); 169 170 TRACE("(%p)->()\n",This); 171 172 return IUnknown_AddRef(This->unk.punkControl); 173 } 174 175 static ULONG WINAPI 176 IPersist_fnRelease(IPersist* iface) 177 { 178 CFilterGraph_THIS(iface,persist); 179 180 TRACE("(%p)->()\n",This); 181 182 return IUnknown_Release(This->unk.punkControl); 183 } 184 185 186 static HRESULT WINAPI 187 IPersist_fnGetClassID(IPersist* iface,CLSID* pclsid) 188 { 189 CFilterGraph_THIS(iface,persist); 190 191 TRACE("(%p)->()\n",This); 192 193 if ( pclsid == NULL ) 194 return E_POINTER; 195 memcpy( pclsid, &CLSID_FilterGraph, sizeof(CLSID) ); 196 197 return E_NOTIMPL; 198 } 199 200 201 static ICOM_VTABLE(IPersist) ipersist = 202 { 203 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 204 /* IUnknown fields */ 205 IPersist_fnQueryInterface, 206 IPersist_fnAddRef, 207 IPersist_fnRelease, 208 /* IPersist fields */ 209 IPersist_fnGetClassID, 210 }; 211 212 HRESULT CFilterGraph_InitIPersist( CFilterGraph* pfg ) 213 { 214 TRACE("(%p)\n",pfg); 215 ICOM_VTBL(&pfg->persist) = &ipersist; 216 217 return NOERROR; 218 } 219 220 void CFilterGraph_UninitIPersist( CFilterGraph* pfg ) 221 { 222 TRACE("(%p)\n",pfg); 223 } -
TabularUnified trunk/src/quartz/fgraph.h ¶
r6710 r6952 12 12 + IFilterGraph - IGraphBuilder - IFilterGraph2 13 13 + IGraphVersion 14 + IGraphConfig 14 15 + IDispatch - IMediaControl 15 16 + IPersist - IMediaFilter … … 50 51 ICOM_VFIELD(IGraphVersion); 51 52 } FG_IGraphVersionImpl; 53 54 typedef struct FG_IGraphConfigImpl 55 { 56 ICOM_VFIELD(IGraphConfig); 57 } FG_IGraphConfigImpl; 52 58 53 59 typedef struct FG_IMediaControlImpl … … 96 102 } FG_IVideoWindowImpl; 97 103 104 typedef struct FilterGraph_MEDIAEVENT FilterGraph_MEDIAEVENT; 98 105 99 106 typedef struct CFilterGraph … … 104 111 FG_IFilterGraph2Impl fgraph; 105 112 FG_IGraphVersionImpl graphversion; 113 FG_IGraphConfigImpl grphconf; 106 114 FG_IMediaControlImpl mediacontrol; 107 115 FG_IMediaFilterImpl mediafilter; … … 124 132 CRITICAL_SECTION m_csGraphState; 125 133 FILTER_STATE m_stateGraph; /* must NOT accessed directly! */ 134 CRITICAL_SECTION m_csClock; 135 IReferenceClock* m_pClock; 126 136 /* IMediaEvent fields. */ 127 137 HANDLE m_hMediaEvent; 138 CRITICAL_SECTION m_csMediaEvents; 139 FilterGraph_MEDIAEVENT* m_pMediaEvents; 140 ULONG m_cbMediaEventsPut; 141 ULONG m_cbMediaEventsGet; 142 ULONG m_cbMediaEventsMax; 143 HWND m_hwndEventNotify; 144 long m_lEventNotifyMsg; 145 LONG_PTR m_lEventNotifyParam; 146 long m_lEventNotifyFlags; 128 147 /* IMediaEventSink fields. */ 129 148 /* IMediaPosition fields. */ … … 138 157 #define CFilterGraph_IDispatch(th) ((IDispatch*)&((th)->disp)) 139 158 #define CFilterGraph_IFilterGraph2(th) ((IFilterGraph2*)&((th)->fgraph)) 159 #define CFilterGraph_IMediaControl(th) ((IMediaControl*)&((th)->mediacontrol)) 140 160 #define CFilterGraph_IMediaFilter(th) ((IMediaFilter*)&((th)->mediafilter)) 141 #define CFilterGraph_IMediaControl(th) ((IMediaControl*)&((th)->mediacontrol)) 161 #define CFilterGraph_IMediaEventEx(th) ((IMediaEventEx*)&((th)->mediaevent)) 162 #define CFilterGraph_IMediaEventSink(th) ((IMediaEventSink*)&((th)->mediaeventsink)) 142 163 143 164 HRESULT QUARTZ_CreateFilterGraph(IUnknown* punkOuter,void** ppobj); … … 151 172 HRESULT CFilterGraph_InitIGraphVersion( CFilterGraph* pfg ); 152 173 void CFilterGraph_UninitIGraphVersion( CFilterGraph* pfg ); 174 HRESULT CFilterGraph_InitIGraphConfig( CFilterGraph* pfg ); 175 void CFilterGraph_UninitIGraphConfig( CFilterGraph* pfg ); 153 176 HRESULT CFilterGraph_InitIMediaControl( CFilterGraph* pfg ); 154 177 void CFilterGraph_UninitIMediaControl( CFilterGraph* pfg ); -
TabularUnified trunk/src/quartz/fmap.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 15 #include "winreg.h" 14 16 #include "winerror.h" 15 17 #include "wine/obj_base.h" … … 24 26 #include "quartz_private.h" 25 27 #include "fmap.h" 28 #include "regsvr.h" 29 30 31 /*************************************************************************** 32 * 33 * new/delete for CLSID_FilterMapper 34 * 35 */ 26 36 27 37 /* can I use offsetof safely? - FIXME? */ … … 66 76 return S_OK; 67 77 } 78 79 /*************************************************************************** 80 * 81 * CLSID_FilterMapper::IFilterMapper 82 * 83 */ 84 85 static HRESULT WINAPI 86 IFilterMapper_fnQueryInterface(IFilterMapper* iface,REFIID riid,void** ppobj) 87 { 88 CFilterMapper_THIS(iface,fmap); 89 90 TRACE("(%p)->()\n",This); 91 92 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 93 } 94 95 static ULONG WINAPI 96 IFilterMapper_fnAddRef(IFilterMapper* iface) 97 { 98 CFilterMapper_THIS(iface,fmap); 99 100 TRACE("(%p)->()\n",This); 101 102 return IUnknown_AddRef(This->unk.punkControl); 103 } 104 105 static ULONG WINAPI 106 IFilterMapper_fnRelease(IFilterMapper* iface) 107 { 108 CFilterMapper_THIS(iface,fmap); 109 110 TRACE("(%p)->()\n",This); 111 112 return IUnknown_Release(This->unk.punkControl); 113 } 114 115 116 static HRESULT WINAPI 117 IFilterMapper_fnRegisterFilter(IFilterMapper* iface,CLSID clsid,LPCWSTR lpwszName,DWORD dwMerit) 118 { 119 CFilterMapper_THIS(iface,fmap); 120 121 FIXME("(%p)->(%s,%s,%08lx)\n",This, 122 debugstr_guid(&clsid),debugstr_w(lpwszName),dwMerit); 123 124 /* FIXME */ 125 /* FIXME - handle dwMerit! */ 126 return QUARTZ_RegisterAMovieFilter( 127 &CLSID_LegacyAmFilterCategory, 128 &clsid, 129 NULL, 0, 130 lpwszName, NULL, TRUE ); 131 } 132 133 static HRESULT WINAPI 134 IFilterMapper_fnRegisterFilterInstance(IFilterMapper* iface,CLSID clsid,LPCWSTR lpwszName,CLSID* pclsidMedia) 135 { 136 CFilterMapper_THIS(iface,fmap); 137 HRESULT hr; 138 139 FIXME("(%p)->()\n",This); 140 141 if ( pclsidMedia == NULL ) 142 return E_POINTER; 143 hr = CoCreateGuid(pclsidMedia); 144 if ( FAILED(hr) ) 145 return hr; 146 147 /* FIXME */ 148 /* this doesn't work. */ 149 /* return IFilterMapper_RegisterFilter(iface, 150 *pclsidMedia,lpwszName,0x60000000); */ 151 152 return E_NOTIMPL; 153 } 154 155 static HRESULT WINAPI 156 IFilterMapper_fnRegisterPin(IFilterMapper* iface,CLSID clsidFilter,LPCWSTR lpwszName,BOOL bRendered,BOOL bOutput,BOOL bZero,BOOL bMany,CLSID clsidReserved,LPCWSTR lpwszReserved) 157 { 158 CFilterMapper_THIS(iface,fmap); 159 160 FIXME("(%p)->() stub!\n",This); 161 162 return E_NOTIMPL; 163 } 164 165 static HRESULT WINAPI 166 IFilterMapper_fnRegisterPinType(IFilterMapper* iface,CLSID clsidFilter,LPCWSTR lpwszName,CLSID clsidMajorType,CLSID clsidSubType) 167 { 168 CFilterMapper_THIS(iface,fmap); 169 170 FIXME("(%p)->() stub!\n",This); 171 172 return E_NOTIMPL; 173 } 174 175 static HRESULT WINAPI 176 IFilterMapper_fnUnregisterFilter(IFilterMapper* iface,CLSID clsidFilter) 177 { 178 CFilterMapper_THIS(iface,fmap); 179 180 FIXME("(%p)->(%s)\n",This,debugstr_guid(&clsidFilter)); 181 182 /* FIXME */ 183 return QUARTZ_RegisterAMovieFilter( 184 &CLSID_LegacyAmFilterCategory, 185 &clsidFilter, 186 NULL, 0, NULL, NULL, FALSE ); 187 } 188 189 static HRESULT WINAPI 190 IFilterMapper_fnUnregisterFilterInstance(IFilterMapper* iface,CLSID clsidMedia) 191 { 192 CFilterMapper_THIS(iface,fmap); 193 194 FIXME("(%p)->(%s)\n",This,debugstr_guid(&clsidMedia)); 195 196 /* FIXME */ 197 /* this doesn't work. */ 198 /* return IFilterMapper_UnregisterFilter(iface,clsidMedia); */ 199 200 return E_NOTIMPL; 201 } 202 203 static HRESULT WINAPI 204 IFilterMapper_fnUnregisterPin(IFilterMapper* iface,CLSID clsidPin,LPCWSTR lpwszName) 205 { 206 CFilterMapper_THIS(iface,fmap); 207 208 FIXME("(%p)->(%s,%s) stub!\n",This, 209 debugstr_guid(&clsidPin),debugstr_w(lpwszName)); 210 211 return E_NOTIMPL; 212 } 213 214 static HRESULT WINAPI 215 IFilterMapper_fnEnumMatchingFilters(IFilterMapper* iface,IEnumRegFilters** ppobj,DWORD dwMerit,BOOL bInputNeeded,CLSID clsInMajorType,CLSID clsidSubType,BOOL bRender,BOOL bOutputNeeded,CLSID clsOutMajorType,CLSID clsOutSubType) 216 { 217 CFilterMapper_THIS(iface,fmap); 218 219 FIXME("(%p)->() stub!\n",This); 220 221 return E_NOTIMPL; 222 } 223 224 225 226 static ICOM_VTABLE(IFilterMapper) ifmap = 227 { 228 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 229 /* IUnknown fields */ 230 IFilterMapper_fnQueryInterface, 231 IFilterMapper_fnAddRef, 232 IFilterMapper_fnRelease, 233 /* IFilterMapper fields */ 234 IFilterMapper_fnRegisterFilter, 235 IFilterMapper_fnRegisterFilterInstance, 236 IFilterMapper_fnRegisterPin, 237 IFilterMapper_fnRegisterPinType, 238 IFilterMapper_fnUnregisterFilter, 239 IFilterMapper_fnUnregisterFilterInstance, 240 IFilterMapper_fnUnregisterPin, 241 IFilterMapper_fnEnumMatchingFilters, 242 }; 243 244 245 HRESULT CFilterMapper_InitIFilterMapper( CFilterMapper* pfm ) 246 { 247 TRACE("(%p)\n",pfm); 248 ICOM_VTBL(&pfm->fmap) = &ifmap; 249 250 return NOERROR; 251 } 252 253 void CFilterMapper_UninitIFilterMapper( CFilterMapper* pfm ) 254 { 255 TRACE("(%p)\n",pfm); 256 } -
TabularUnified trunk/src/quartz/fmap2.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 15 #include "winreg.h" 14 16 #include "winerror.h" 15 17 #include "wine/obj_base.h" … … 24 26 #include "quartz_private.h" 25 27 #include "fmap2.h" 28 #include "regsvr.h" 29 30 31 /*************************************************************************** 32 * 33 * new/delete for CLSID_FilterMapper2 34 * 35 */ 26 36 27 37 /* can I use offsetof safely? - FIXME? */ … … 67 77 return S_OK; 68 78 } 79 80 /*************************************************************************** 81 * 82 * CLSID_FilterMapper2::IFilterMapper3 83 * 84 */ 85 86 87 static HRESULT WINAPI 88 IFilterMapper3_fnQueryInterface(IFilterMapper3* iface,REFIID riid,void** ppobj) 89 { 90 CFilterMapper2_THIS(iface,fmap3); 91 92 TRACE("(%p)->()\n",This); 93 94 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 95 } 96 97 static ULONG WINAPI 98 IFilterMapper3_fnAddRef(IFilterMapper3* iface) 99 { 100 CFilterMapper2_THIS(iface,fmap3); 101 102 TRACE("(%p)->()\n",This); 103 104 return IUnknown_AddRef(This->unk.punkControl); 105 } 106 107 static ULONG WINAPI 108 IFilterMapper3_fnRelease(IFilterMapper3* iface) 109 { 110 CFilterMapper2_THIS(iface,fmap3); 111 112 TRACE("(%p)->()\n",This); 113 114 return IUnknown_Release(This->unk.punkControl); 115 } 116 117 static HRESULT WINAPI 118 IFilterMapper3_fnCreateCategory(IFilterMapper3* iface,REFCLSID rclsidCategory,DWORD dwMerit,LPCWSTR lpwszDesc) 119 { 120 CFilterMapper2_THIS(iface,fmap3); 121 122 FIXME("(%p)->(%s,%lu,%s) stub!\n",This, 123 debugstr_guid(rclsidCategory), 124 (unsigned long)dwMerit,debugstr_w(lpwszDesc)); 125 126 return E_NOTIMPL; 127 } 128 129 130 static HRESULT WINAPI 131 IFilterMapper3_fnUnregisterFilter(IFilterMapper3* iface,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,REFCLSID rclsidFilter) 132 { 133 CFilterMapper2_THIS(iface,fmap3); 134 135 FIXME("(%p)->(%s,%s,%s) stub!\n",This, 136 debugstr_guid(pclsidCategory), 137 debugstr_w(lpwszInst), 138 debugstr_guid(rclsidFilter)); 139 140 if ( pclsidCategory == NULL ) 141 pclsidCategory = &CLSID_LegacyAmFilterCategory; 142 143 /* FIXME */ 144 return QUARTZ_RegisterAMovieFilter( 145 pclsidCategory, 146 rclsidFilter, 147 NULL, 0, 148 NULL, lpwszInst, FALSE ); 149 } 150 151 152 static HRESULT WINAPI 153 IFilterMapper3_fnRegisterFilter(IFilterMapper3* iface,REFCLSID rclsidFilter,LPCWSTR lpName,IMoniker** ppMoniker,const CLSID* pclsidCategory,const OLECHAR* lpwszInst,const REGFILTER2* pRF2) 154 { 155 CFilterMapper2_THIS(iface,fmap3); 156 157 FIXME( "(%p)->(%s,%s,%p,%s,%s,%p) stub!\n",This, 158 debugstr_guid(rclsidFilter),debugstr_w(lpName), 159 ppMoniker,debugstr_guid(pclsidCategory), 160 debugstr_w(lpwszInst),pRF2 ); 161 162 if ( lpName == NULL || pRF2 == NULL ) 163 return E_POINTER; 164 165 if ( ppMoniker != NULL ) 166 { 167 FIXME( "ppMoniker != NULL - not implemented!\n" ); 168 return E_NOTIMPL; 169 } 170 171 if ( pclsidCategory == NULL ) 172 pclsidCategory = &CLSID_LegacyAmFilterCategory; 173 174 /* FIXME!! - all members in REGFILTER2 are ignored ! */ 175 176 return QUARTZ_RegisterAMovieFilter( 177 pclsidCategory, 178 rclsidFilter, 179 NULL, 0, 180 lpName, lpwszInst, TRUE ); 181 } 182 183 184 static HRESULT WINAPI 185 IFilterMapper3_fnEnumMatchingFilters(IFilterMapper3* iface,IEnumMoniker** ppMoniker,DWORD dwFlags,BOOL bExactMatch,DWORD dwMerit,BOOL bInputNeeded,DWORD cInputTypes,const GUID* pguidInputTypes,const REGPINMEDIUM* pPinMediumIn,const CLSID* pPinCategoryIn,BOOL bRender,BOOL bOutputNeeded,DWORD cOutputTypes,const GUID* pguidOutputTypes,const REGPINMEDIUM* pPinMediumOut,const CLSID* pPinCategoryOut) 186 { 187 CFilterMapper2_THIS(iface,fmap3); 188 189 FIXME("(%p)->() stub!\n",This); 190 191 return E_NOTIMPL; 192 } 193 194 static HRESULT WINAPI 195 IFilterMapper3_fnGetICreateDevEnum(IFilterMapper3* iface,ICreateDevEnum** ppDevEnum) 196 { 197 CFilterMapper2_THIS(iface,fmap3); 198 199 /* undocumented */ 200 FIXME("(%p)->() stub!\n",This); 201 202 return E_NOTIMPL; 203 } 204 205 206 207 208 static ICOM_VTABLE(IFilterMapper3) ifmap3 = 209 { 210 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 211 /* IUnknown fields */ 212 IFilterMapper3_fnQueryInterface, 213 IFilterMapper3_fnAddRef, 214 IFilterMapper3_fnRelease, 215 /* IFilterMapper2 fields */ 216 IFilterMapper3_fnCreateCategory, 217 IFilterMapper3_fnUnregisterFilter, 218 IFilterMapper3_fnRegisterFilter, 219 IFilterMapper3_fnEnumMatchingFilters, 220 /* IFilterMapper3 fields */ 221 IFilterMapper3_fnGetICreateDevEnum, 222 }; 223 224 225 HRESULT CFilterMapper2_InitIFilterMapper3( CFilterMapper2* pfm ) 226 { 227 TRACE("(%p)\n",pfm); 228 ICOM_VTBL(&pfm->fmap3) = &ifmap3; 229 230 return NOERROR; 231 } 232 233 void CFilterMapper2_UninitIFilterMapper3( CFilterMapper2* pfm ) 234 { 235 TRACE("(%p)\n",pfm); 236 } 237 -
TabularUnified trunk/src/quartz/ifgraph.c ¶
r6710 r6952 2 2 * Implementation of IFilterGraph. 3 3 * 4 * FIXME - stub. 5 * FIXME - implement IGraphBuilder / IFilterGraph2. 4 * FIXME - create a thread to process some methods correctly. 5 * 6 * FIXME - ReconnectEx 7 * FIXME - process Pause/Stop asynchronously and notify when completed. 8 * 6 9 * 7 10 * hidenori@a2.ctktv.ne.jp … … 13 16 #include "winbase.h" 14 17 #include "wingdi.h" 18 #include "winuser.h" 15 19 #include "winerror.h" 16 20 #include "wine/obj_base.h" … … 21 25 #include "vfwmsgs.h" 22 26 #include "wine/unicode.h" 27 #include "evcode.h" 23 28 24 29 #include "debugtools.h" … … 28 33 #include "fgraph.h" 29 34 #include "enumunk.h" 35 #include "sysclock.h" 30 36 31 37 … … 75 81 76 82 83 static HRESULT CFilterGraph_GraphChanged( CFilterGraph* This ) 84 { 85 /* IDistributorNotify_NotifyGraphChange() */ 86 87 IMediaEventSink_Notify(CFilterGraph_IMediaEventSink(This), 88 EC_GRAPH_CHANGED, 0, 0); 89 EnterCriticalSection( &This->m_csGraphVersion ); 90 This->m_lGraphVersion ++; 91 LeaveCriticalSection( &This->m_csGraphVersion ); 92 93 return NOERROR; 94 } 95 96 77 97 /****************************************************************************/ 78 98 … … 111 131 { 112 132 CFilterGraph_THIS(iface,fgraph); 133 FILTER_STATE fs; 113 134 FILTER_INFO info; 114 135 HRESULT hr; … … 120 141 121 142 QUARTZ_CompList_Lock( This->m_pFilterList ); 143 144 hr = IMediaFilter_GetState(CFilterGraph_IMediaFilter(This),0,&fs); 145 if ( hr == VFW_S_STATE_INTERMEDIATE ) 146 hr = VFW_E_STATE_CHANGED; 147 if ( fs != State_Stopped ) 148 hr = VFW_E_NOT_STOPPED; 149 if ( FAILED(hr) ) 150 goto end; 151 152 TRACE( "(%p) search the specified name.\n",This ); 122 153 123 154 if ( pName != NULL ) … … 180 211 181 212 name_ok: 213 TRACE( "(%p) add this filter.\n",This ); 214 182 215 /* register this filter. */ 183 216 hr = QUARTZ_CompList_AddComp( … … 188 221 189 222 hr = IBaseFilter_JoinFilterGraph(pFilter,(IFilterGraph*)iface,pName); 190 if ( FAILED(hr) ) 191 { 223 if ( SUCCEEDED(hr) ) 224 { 225 EnterCriticalSection( &This->m_csClock ); 226 hr = IBaseFilter_SetSyncSource( pFilter, This->m_pClock ); 227 LeaveCriticalSection( &This->m_csClock ); 228 } 229 if ( FAILED(hr) ) 230 { 231 IBaseFilter_JoinFilterGraph(pFilter,NULL,pName); 192 232 QUARTZ_CompList_RemoveComp( 193 233 This->m_pFilterList,(IUnknown*)pFilter); … … 195 235 } 196 236 197 EnterCriticalSection( &This->m_csGraphVersion);198 This->m_lGraphVersion ++;199 LeaveCriticalSection( &This->m_csGraphVersion );237 hr = CFilterGraph_GraphChanged(This); 238 if ( FAILED(hr) ) 239 goto end; 200 240 201 241 hr = hrSucceeded; … … 203 243 QUARTZ_CompList_Unlock( This->m_pFilterList ); 204 244 245 TRACE( "(%p) return %08lx\n", This, hr ); 246 205 247 return hr; 206 248 } … … 211 253 CFilterGraph_THIS(iface,fgraph); 212 254 QUARTZ_CompListItem* pItem; 255 FILTER_STATE fs; 213 256 HRESULT hr = NOERROR; 214 257 … … 217 260 QUARTZ_CompList_Lock( This->m_pFilterList ); 218 261 262 hr = IMediaFilter_GetState(CFilterGraph_IMediaFilter(This),0,&fs); 263 if ( hr == VFW_S_STATE_INTERMEDIATE ) 264 hr = VFW_E_STATE_CHANGED; 265 if ( fs != State_Stopped ) 266 hr = VFW_E_NOT_STOPPED; 267 if ( FAILED(hr) ) 268 goto end; 269 270 hr = S_FALSE; /* FIXME? */ 219 271 pItem = QUARTZ_CompList_SearchComp( 220 272 This->m_pFilterList, (IUnknown*)pFilter ); … … 222 274 { 223 275 CFilterGraph_DisconnectAllPins(pFilter); 276 IBaseFilter_SetSyncSource( pFilter, NULL ); 224 277 hr = IBaseFilter_JoinFilterGraph( 225 278 pFilter, NULL, QUARTZ_CompList_GetDataPtr(pItem) ); … … 228 281 } 229 282 230 EnterCriticalSection( &This->m_csGraphVersion ); 231 This->m_lGraphVersion ++; 232 LeaveCriticalSection( &This->m_csGraphVersion ); 233 283 hr = CFilterGraph_GraphChanged(This); 284 if ( FAILED(hr) ) 285 goto end; 286 287 end:; 234 288 QUARTZ_CompList_Unlock( This->m_pFilterList ); 235 289 … … 332 386 pConnTo = NULL; 333 387 hr = IPin_ConnectedTo(pIn,&pConnTo); 334 if ( FAILED(hr) ) 335 goto end; 336 if ( pConnTo != NULL ) 388 if ( hr == NOERROR && pConnTo != NULL ) 337 389 { 338 390 IPin_Release(pConnTo); 391 hr = VFW_E_ALREADY_CONNECTED; 339 392 goto end; 340 393 } … … 342 395 pConnTo = NULL; 343 396 hr = IPin_ConnectedTo(pOut,&pConnTo); 344 if ( FAILED(hr) ) 345 goto end; 346 if ( pConnTo != NULL ) 397 if ( hr == NOERROR && pConnTo != NULL ) 347 398 { 348 399 IPin_Release(pConnTo); 349 goto end; 350 } 351 352 hr = IPin_Connect(pIn,pOut,pmt); 353 if ( FAILED(hr) ) 354 goto end; 400 hr = VFW_E_ALREADY_CONNECTED; 401 goto end; 402 } 403 404 TRACE("(%p) try to connect %p<->%p\n",This,pIn,pOut); 355 405 hr = IPin_Connect(pOut,pIn,pmt); 356 406 if ( FAILED(hr) ) 357 407 { 408 TRACE("(%p)->Connect(%p,%p) hr = %08lx\n",pOut,pIn,pmt,hr); 409 IPin_Disconnect(pOut); 358 410 IPin_Disconnect(pIn); 359 411 goto end; 360 412 } 361 413 362 EnterCriticalSection( &This->m_csGraphVersion);363 This->m_lGraphVersion ++;364 LeaveCriticalSection( &This->m_csGraphVersion );414 hr = CFilterGraph_GraphChanged(This); 415 if ( FAILED(hr) ) 416 goto end; 365 417 366 418 end: … … 384 436 CFilterGraph_THIS(iface,fgraph); 385 437 386 FIXME( "(%p)->(%p) stub!\n",This,pPin ); 387 388 EnterCriticalSection( &This->m_csGraphVersion ); 389 This->m_lGraphVersion ++; 390 LeaveCriticalSection( &This->m_csGraphVersion ); 391 392 return E_NOTIMPL; 438 TRACE( "(%p)->(%p)\n",This,pPin ); 439 440 return IFilterGraph2_ReconnectEx(iface,pPin,NULL); 393 441 } 394 442 … … 397 445 { 398 446 CFilterGraph_THIS(iface,fgraph); 399 400 FIXME( "(%p)->(%p) stub!\n",This,pPin ); 401 402 EnterCriticalSection( &This->m_csGraphVersion ); 403 This->m_lGraphVersion ++; 404 LeaveCriticalSection( &This->m_csGraphVersion ); 405 406 return E_NOTIMPL; 447 IPin* pConnTo; 448 HRESULT hr; 449 450 TRACE( "(%p)->(%p)\n",This,pPin ); 451 452 QUARTZ_CompList_Lock( This->m_pFilterList ); 453 454 pConnTo = NULL; 455 hr = IPin_ConnectedTo(pPin,&pConnTo); 456 if ( hr == NOERROR && pConnTo != NULL ) 457 { 458 IPin_Disconnect(pConnTo); 459 IPin_Release(pConnTo); 460 } 461 hr = IPin_Disconnect(pPin); 462 if ( FAILED(hr) ) 463 goto end; 464 465 hr = CFilterGraph_GraphChanged(This); 466 if ( FAILED(hr) ) 467 goto end; 468 469 end: 470 QUARTZ_CompList_Unlock( This->m_pFilterList ); 471 472 return hr; 407 473 } 408 474 … … 411 477 { 412 478 CFilterGraph_THIS(iface,fgraph); 479 IUnknown* punk; 480 IReferenceClock* pClock; 481 HRESULT hr; 413 482 414 483 FIXME( "(%p)->() stub!\n", This ); 415 return E_NOTIMPL; 484 485 /* FIXME - search all filters. */ 486 487 hr = QUARTZ_CreateSystemClock( NULL, (void**)&punk ); 488 if ( FAILED(hr) ) 489 return hr; 490 hr = IUnknown_QueryInterface( punk, &IID_IReferenceClock, (void**)&pClock ); IUnknown_Release( punk ); 491 if ( FAILED(hr) ) 492 return hr; 493 494 hr = IMediaFilter_SetSyncSource( 495 CFilterGraph_IMediaFilter(This), pClock ); 496 IReferenceClock_Release( pClock ); 497 498 return hr; 416 499 } 417 500 … … 580 663 { 581 664 CFilterGraph_THIS(iface,fgraph); 665 HRESULT hr; 582 666 583 667 FIXME( "(%p)->(%p,%p) stub!\n",This,pPin,pmt ); 584 668 585 EnterCriticalSection( &This->m_csGraphVersion );586 This->m_lGraphVersion ++; 587 LeaveCriticalSection( &This->m_csGraphVersion);669 /* reconnect asynchronously. */ 670 671 hr = CFilterGraph_GraphChanged(This); 588 672 589 673 return E_NOTIMPL; … … 657 741 if ( pItem == NULL ) 658 742 break; 659 IFilterGraph2_ fnRemoveFilter(743 IFilterGraph2_RemoveFilter( 660 744 (IFilterGraph2*)(&pfg->fgraph), 661 745 (IBaseFilter*)QUARTZ_CompList_GetItemPtr(pItem) ); -
TabularUnified trunk/src/quartz/igrver.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 14 15 #include "winerror.h" 15 16 #include "wine/obj_base.h" -
TabularUnified trunk/src/quartz/imcntl.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 14 15 #include "winerror.h" 15 16 #include "wine/obj_base.h" -
TabularUnified trunk/src/quartz/imfilter.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 14 15 #include "winerror.h" 15 16 #include "wine/obj_base.h" … … 19 20 #include "uuids.h" 20 21 #include "vfwmsgs.h" 22 #include "evcode.h" 21 23 22 24 #include "debugtools.h" … … 127 129 if ( This->m_stateGraph != State_Stopped ) 128 130 { 131 /* IDistributorNotify_Stop() */ 132 129 133 QUARTZ_CompList_Lock( This->m_pFilterList ); 130 134 … … 171 175 if ( This->m_stateGraph != State_Paused ) 172 176 { 177 /* IDistributorNotify_Pause() */ 178 173 179 QUARTZ_CompList_Lock( This->m_pFilterList ); 174 180 … … 210 216 TRACE("(%p)->()\n",This); 211 217 212 /* handle the special time. */213 if ( rtStart == (REFERENCE_TIME)0 )214 {215 hr = IMediaFilter_GetSyncSource(iface,&pClock);216 if ( hr == S_OK && pClock != NULL )217 {218 IReferenceClock_GetTime(pClock,&rtStart);219 IReferenceClock_Release(pClock);220 }221 }222 223 hr = S_OK;224 225 218 EnterCriticalSection( &This->m_csGraphState ); 226 219 220 if ( This->m_stateGraph == State_Stopped ) 221 { 222 hr = IMediaFilter_Pause(iface); 223 if ( FAILED(hr) ) 224 goto end; 225 } 226 227 /* handle the special time. */ 228 if ( rtStart == (REFERENCE_TIME)0 ) 229 { 230 hr = IMediaFilter_GetSyncSource(iface,&pClock); 231 if ( hr == S_OK && pClock != NULL ) 232 { 233 IReferenceClock_GetTime(pClock,&rtStart); 234 IReferenceClock_Release(pClock); 235 } 236 } 237 238 hr = NOERROR; 239 227 240 if ( This->m_stateGraph != State_Running ) 228 241 { 242 /* IDistributorNotify_Run() */ 243 229 244 QUARTZ_CompList_Lock( This->m_pFilterList ); 230 245 … … 249 264 } 250 265 266 end: 251 267 LeaveCriticalSection( &This->m_csGraphState ); 252 268 … … 265 281 if ( pState == NULL ) 266 282 return E_POINTER; 267 268 EnterCriticalSection( &This->m_csGraphState );269 *pState = This->m_stateGraph;270 LeaveCriticalSection( &This->m_csGraphState );271 283 272 284 dwTickStart = GetTickCount(); … … 292 304 } 293 305 306 EnterCriticalSection( &This->m_csGraphState ); 307 *pState = This->m_stateGraph; 308 LeaveCriticalSection( &This->m_csGraphState ); 309 294 310 return hr; 295 311 } … … 299 315 { 300 316 CFilterGraph_THIS(iface,mediafilter); 301 302 FIXME("(%p)->() stub!\n",This); 303 304 return E_NOTIMPL; 317 QUARTZ_CompListItem* pItem; 318 IBaseFilter* pFilter; 319 HRESULT hr = NOERROR; 320 HRESULT hrCur; 321 322 TRACE("(%p)->(%p)\n",This,pobjClock); 323 324 /* IDistributorNotify_SetSyncSource() */ 325 326 EnterCriticalSection( &This->m_csClock ); 327 QUARTZ_CompList_Lock( This->m_pFilterList ); 328 329 if ( This->m_pClock != NULL ) 330 { 331 IReferenceClock_Release(This->m_pClock); 332 This->m_pClock = NULL; 333 } 334 335 This->m_pClock = pobjClock; 336 if ( pobjClock != NULL ) 337 IReferenceClock_AddRef( pobjClock ); 338 339 pItem = QUARTZ_CompList_GetFirst( This->m_pFilterList ); 340 while ( pItem != NULL ) 341 { 342 pFilter = (IBaseFilter*)QUARTZ_CompList_GetItemPtr( pItem ); 343 hrCur = IBaseFilter_SetSyncSource(pFilter,pobjClock); 344 if ( FAILED(hrCur) ) 345 hr = hrCur; 346 pItem = QUARTZ_CompList_GetNext( This->m_pFilterList, pItem ); 347 } 348 349 QUARTZ_CompList_Unlock( This->m_pFilterList ); 350 351 IMediaEventSink_Notify(CFilterGraph_IMediaEventSink(This), 352 EC_CLOCK_CHANGED, 0, 0); 353 354 LeaveCriticalSection( &This->m_csClock ); 355 356 TRACE( "hr = %08lx\n", hr ); 357 358 return hr; 305 359 } 306 360 … … 309 363 { 310 364 CFilterGraph_THIS(iface,mediafilter); 311 312 FIXME("(%p)->() stub!\n",This); 313 314 return E_NOTIMPL; 365 HRESULT hr = VFW_E_NO_CLOCK; 366 367 TRACE("(%p)->(%p)\n",This,ppobjClock); 368 369 if ( ppobjClock == NULL ) 370 return E_POINTER; 371 372 EnterCriticalSection( &This->m_csClock ); 373 *ppobjClock = This->m_pClock; 374 if ( This->m_pClock != NULL ) 375 { 376 hr = NOERROR; 377 IReferenceClock_AddRef( This->m_pClock ); 378 } 379 LeaveCriticalSection( &This->m_csClock ); 380 381 TRACE( "hr = %08lx\n", hr ); 382 383 return hr; 315 384 } 316 385 … … 342 411 343 412 InitializeCriticalSection( &pfg->m_csGraphState ); 413 InitializeCriticalSection( &pfg->m_csClock ); 344 414 pfg->m_stateGraph = State_Stopped; 415 pfg->m_pClock = NULL; 345 416 346 417 return NOERROR; … … 351 422 TRACE("(%p)\n",pfg); 352 423 424 if ( pfg->m_pClock != NULL ) 425 { 426 IReferenceClock_Release( pfg->m_pClock ); 427 pfg->m_pClock = NULL; 428 } 429 353 430 DeleteCriticalSection( &pfg->m_csGraphState ); 354 } 431 DeleteCriticalSection( &pfg->m_csClock ); 432 } -
TabularUnified trunk/src/quartz/impos.c ¶
r6710 r6952 12 12 #include "winbase.h" 13 13 #include "wingdi.h" 14 #include "winuser.h" 14 15 #include "winerror.h" 15 16 #include "wine/obj_base.h" -
TabularUnified trunk/src/quartz/imseek.c ¶
r6710 r6952 3 3 * 4 4 * FIXME - stub. 5 * FIXME - this interface should be allocated as a plug-in(?) 5 6 * 6 7 * hidenori@a2.ctktv.ne.jp … … 12 13 #include "winbase.h" 13 14 #include "wingdi.h" 15 #include "winuser.h" 14 16 #include "winerror.h" 15 17 #include "wine/obj_base.h" … … 133 135 CFilterGraph_THIS(iface,mediaseeking); 134 136 137 /* the following line may produce too many FIXMEs... */ 135 138 FIXME("(%p)->() stub!\n",This); 136 139 -
TabularUnified trunk/src/quartz/iunk.c ¶
r6710 r6952 66 66 if ( hr == E_NOINTERFACE ) 67 67 { 68 FIXME(" unknown interface: %s\n",debugstr_guid(riid));68 FIXME("(%p) unknown interface: %s\n",This,debugstr_guid(riid)); 69 69 } 70 70 -
TabularUnified trunk/src/quartz/main.c ¶
r6710 r6952 1 /* 2 * Exported APIs. 3 * 4 * hidenori@a2.ctktv.ne.jp 5 */ 6 1 7 #include "config.h" 2 8 … … 5 11 #include "winbase.h" 6 12 #include "wingdi.h" 13 #include "winuser.h" 14 #include "winnls.h" 15 #include "mmsystem.h" 7 16 #include "ole2.h" 8 17 #include "wine/obj_oleaut.h" … … 10 19 #include "control.h" 11 20 #include "uuids.h" 21 #include "errors.h" 12 22 13 23 #include "debugtools.h" … … 22 32 #include "fmap2.h" 23 33 #include "seekpass.h" 34 #include "audren.h" 24 35 25 36 … … 66 77 { &CLSID_FilterMapper2, &QUARTZ_CreateFilterMapper2 }, 67 78 { &CLSID_SeekingPassThru, &QUARTZ_CreateSeekingPassThru }, 79 { &CLSID_AudioRender, &QUARTZ_CreateAudioRenderer }, 68 80 { NULL, NULL }, 69 81 }; … … 105 117 HeapFree( hDLLHeap, 0, pMem ); 106 118 } 119 120 void* QUARTZ_ReallocMem( void* pMem, DWORD dwSize ) 121 { 122 if ( pMem == NULL ) 123 return QUARTZ_AllocMem( dwSize ); 124 125 return HeapReAlloc( hDLLHeap, 0, pMem, dwSize ); 126 } 127 128 static 129 LPWSTR QUARTZ_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen ) 130 { 131 INT len; 132 133 len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen ); 134 if ( len == 0 ) 135 *lpwstr = 0; 136 return lpwstr; 137 } 138 107 139 108 140 /************************************************************************/ … … 264 296 LPVOID lpvReserved ) 265 297 { 298 TRACE("(%08x,%08lx,%p)\n",hInstDLL,fdwReason,lpvReserved); 299 266 300 switch ( fdwReason ) 267 301 { … … 337 371 } 338 372 339 340 373 /**************************************************************************/ 374 /**************************************************************************/ 375 376 /* FIXME - all string should be defined in the resource of quartz. */ 377 378 static LPCSTR hresult_to_string( HRESULT hr ) 379 { 380 switch ( hr ) 381 { 382 #define ENTRY(x) case x: return (const char*)#x 383 /* some known codes */ 384 ENTRY(S_OK); 385 ENTRY(S_FALSE); 386 ENTRY(E_FAIL); 387 ENTRY(E_POINTER); 388 ENTRY(E_NOTIMPL); 389 ENTRY(E_NOINTERFACE); 390 ENTRY(E_OUTOFMEMORY); 391 ENTRY(CLASS_E_CLASSNOTAVAILABLE); 392 ENTRY(CLASS_E_NOAGGREGATION); 393 394 /* vfwmsgs.h */ 395 ENTRY(VFW_S_NO_MORE_ITEMS); 396 ENTRY(VFW_E_BAD_KEY); 397 ENTRY(VFW_E_INVALIDMEDIATYPE); 398 ENTRY(VFW_E_INVALIDSUBTYPE); 399 ENTRY(VFW_E_NEED_OWNER); 400 ENTRY(VFW_E_ENUM_OUT_OF_SYNC); 401 ENTRY(VFW_E_ALREADY_CONNECTED); 402 ENTRY(VFW_E_FILTER_ACTIVE); 403 ENTRY(VFW_E_NO_TYPES); 404 ENTRY(VFW_E_NO_ACCEPTABLE_TYPES); 405 ENTRY(VFW_E_INVALID_DIRECTION); 406 ENTRY(VFW_E_NOT_CONNECTED); 407 ENTRY(VFW_E_NO_ALLOCATOR); 408 ENTRY(VFW_E_RUNTIME_ERROR); 409 ENTRY(VFW_E_BUFFER_NOTSET); 410 ENTRY(VFW_E_BUFFER_OVERFLOW); 411 ENTRY(VFW_E_BADALIGN); 412 ENTRY(VFW_E_ALREADY_COMMITTED); 413 ENTRY(VFW_E_BUFFERS_OUTSTANDING); 414 ENTRY(VFW_E_NOT_COMMITTED); 415 ENTRY(VFW_E_SIZENOTSET); 416 ENTRY(VFW_E_NO_CLOCK); 417 ENTRY(VFW_E_NO_SINK); 418 ENTRY(VFW_E_NO_INTERFACE); 419 ENTRY(VFW_E_NOT_FOUND); 420 ENTRY(VFW_E_CANNOT_CONNECT); 421 ENTRY(VFW_E_CANNOT_RENDER); 422 ENTRY(VFW_E_CHANGING_FORMAT); 423 ENTRY(VFW_E_NO_COLOR_KEY_SET); 424 ENTRY(VFW_E_NOT_OVERLAY_CONNECTION); 425 ENTRY(VFW_E_NOT_SAMPLE_CONNECTION); 426 ENTRY(VFW_E_PALETTE_SET); 427 ENTRY(VFW_E_COLOR_KEY_SET); 428 ENTRY(VFW_E_NO_COLOR_KEY_FOUND); 429 ENTRY(VFW_E_NO_PALETTE_AVAILABLE); 430 ENTRY(VFW_E_NO_DISPLAY_PALETTE); 431 ENTRY(VFW_E_TOO_MANY_COLORS); 432 ENTRY(VFW_E_STATE_CHANGED); 433 ENTRY(VFW_E_NOT_STOPPED); 434 ENTRY(VFW_E_NOT_PAUSED); 435 ENTRY(VFW_E_NOT_RUNNING); 436 ENTRY(VFW_E_WRONG_STATE); 437 ENTRY(VFW_E_START_TIME_AFTER_END); 438 ENTRY(VFW_E_INVALID_RECT); 439 ENTRY(VFW_E_TYPE_NOT_ACCEPTED); 440 ENTRY(VFW_E_SAMPLE_REJECTED); 441 ENTRY(VFW_E_SAMPLE_REJECTED_EOS); 442 ENTRY(VFW_S_DUPLICATE_NAME); 443 ENTRY(VFW_E_DUPLICATE_NAME); 444 ENTRY(VFW_E_TIMEOUT); 445 ENTRY(VFW_E_INVALID_FILE_FORMAT); 446 ENTRY(VFW_E_ENUM_OUT_OF_RANGE); 447 ENTRY(VFW_E_CIRCULAR_GRAPH); 448 ENTRY(VFW_E_NOT_ALLOWED_TO_SAVE); 449 ENTRY(VFW_E_TIME_ALREADY_PASSED); 450 ENTRY(VFW_E_ALREADY_CANCELLED); 451 ENTRY(VFW_E_CORRUPT_GRAPH_FILE); 452 ENTRY(VFW_E_ADVISE_ALREADY_SET); 453 ENTRY(VFW_S_STATE_INTERMEDIATE); 454 ENTRY(VFW_E_NO_MODEX_AVAILABLE); 455 ENTRY(VFW_E_NO_ADVISE_SET); 456 ENTRY(VFW_E_NO_FULLSCREEN); 457 ENTRY(VFW_E_IN_FULLSCREEN_MODE); 458 ENTRY(VFW_E_UNKNOWN_FILE_TYPE); 459 ENTRY(VFW_E_CANNOT_LOAD_SOURCE_FILTER); 460 ENTRY(VFW_S_PARTIAL_RENDER); 461 ENTRY(VFW_E_FILE_TOO_SHORT); 462 ENTRY(VFW_E_INVALID_FILE_VERSION); 463 ENTRY(VFW_S_SOME_DATA_IGNORED); 464 ENTRY(VFW_S_CONNECTIONS_DEFERRED); 465 ENTRY(VFW_E_INVALID_CLSID); 466 ENTRY(VFW_E_INVALID_MEDIA_TYPE); 467 ENTRY(VFW_E_SAMPLE_TIME_NOT_SET); 468 ENTRY(VFW_S_RESOURCE_NOT_NEEDED); 469 ENTRY(VFW_E_MEDIA_TIME_NOT_SET); 470 ENTRY(VFW_E_NO_TIME_FORMAT_SET); 471 ENTRY(VFW_E_MONO_AUDIO_HW); 472 ENTRY(VFW_S_MEDIA_TYPE_IGNORED); 473 ENTRY(VFW_E_NO_DECOMPRESSOR); 474 ENTRY(VFW_E_NO_AUDIO_HARDWARE); 475 ENTRY(VFW_S_VIDEO_NOT_RENDERED); 476 ENTRY(VFW_S_AUDIO_NOT_RENDERED); 477 ENTRY(VFW_E_RPZA); 478 ENTRY(VFW_S_RPZA); 479 ENTRY(VFW_E_PROCESSOR_NOT_SUITABLE); 480 ENTRY(VFW_E_UNSUPPORTED_AUDIO); 481 ENTRY(VFW_E_UNSUPPORTED_VIDEO); 482 ENTRY(VFW_E_MPEG_NOT_CONSTRAINED); 483 ENTRY(VFW_E_NOT_IN_GRAPH); 484 ENTRY(VFW_S_ESTIMATED); 485 ENTRY(VFW_E_NO_TIME_FORMAT); 486 ENTRY(VFW_E_READ_ONLY); 487 ENTRY(VFW_S_RESERVED); 488 ENTRY(VFW_E_BUFFER_UNDERFLOW); 489 ENTRY(VFW_E_UNSUPPORTED_STREAM); 490 ENTRY(VFW_E_NO_TRANSPORT); 491 ENTRY(VFW_S_STREAM_OFF); 492 ENTRY(VFW_S_CANT_CUE); 493 ENTRY(VFW_E_BAD_VIDEOCD); 494 ENTRY(VFW_S_NO_STOP_TIME); 495 ENTRY(VFW_E_OUT_OF_VIDEO_MEMORY); 496 ENTRY(VFW_E_VP_NEGOTIATION_FAILED); 497 ENTRY(VFW_E_DDRAW_CAPS_NOT_SUITABLE); 498 ENTRY(VFW_E_NO_VP_HARDWARE); 499 ENTRY(VFW_E_NO_CAPTURE_HARDWARE); 500 ENTRY(VFW_E_DVD_OPERATION_INHIBITED); 501 ENTRY(VFW_E_DVD_INVALIDDOMAIN); 502 ENTRY(VFW_E_DVD_NO_BUTTON); 503 ENTRY(VFW_E_DVD_GRAPHNOTREADY); 504 ENTRY(VFW_E_DVD_RENDERFAIL); 505 ENTRY(VFW_E_DVD_DECNOTENOUGH); 506 ENTRY(VFW_E_DDRAW_VERSION_NOT_SUITABLE); 507 ENTRY(VFW_E_COPYPROT_FAILED); 508 ENTRY(VFW_S_NOPREVIEWPIN); 509 ENTRY(VFW_E_TIME_EXPIRED); 510 ENTRY(VFW_S_DVD_NON_ONE_SEQUENTIAL); 511 ENTRY(VFW_E_DVD_WRONG_SPEED); 512 ENTRY(VFW_E_DVD_MENU_DOES_NOT_EXIST); 513 ENTRY(VFW_E_DVD_CMD_CANCELLED); 514 ENTRY(VFW_E_DVD_STATE_WRONG_VERSION); 515 ENTRY(VFW_E_DVD_STATE_CORRUPT); 516 ENTRY(VFW_E_DVD_STATE_WRONG_DISC); 517 ENTRY(VFW_E_DVD_INCOMPATIBLE_REGION); 518 ENTRY(VFW_E_DVD_NO_ATTRIBUTES); 519 ENTRY(VFW_E_DVD_NO_GOUP_PGC); 520 ENTRY(VFW_E_DVD_LOW_PARENTAL_LEVEL); 521 ENTRY(VFW_E_DVD_NOT_IN_KARAOKE_MODE); 522 ENTRY(VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE); 523 ENTRY(VFW_S_DVD_NOT_ACCURATE); 524 ENTRY(VFW_E_FRAME_STEP_UNSUPPORTED); 525 ENTRY(VFW_E_DVD_STREAM_DISABLED); 526 ENTRY(VFW_E_DVD_TITLE_UNKNOWN); 527 ENTRY(VFW_E_DVD_INVALID_DISC); 528 ENTRY(VFW_E_DVD_NO_RESUME_INFORMATION); 529 ENTRY(VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD); 530 ENTRY(VFW_E_PIN_ALREADY_BLOCKED); 531 ENTRY(VFW_E_CERTIFICATION_FAILURE); 532 #undef ENTRY 533 } 534 535 return NULL; 536 } 537 538 /*********************************************************************** 539 * AMGetErrorTextA (quartz.@) 540 */ 541 DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR pszbuf, DWORD dwBufLen) 542 { 543 LPCSTR lpszRes; 544 DWORD len; 545 546 lpszRes = hresult_to_string( hr ); 547 if ( lpszRes == NULL ) 548 return 0; 549 len = (DWORD)(strlen(lpszRes)+1); 550 if ( len > dwBufLen ) 551 return 0; 552 553 memcpy( pszbuf, lpszRes, len ); 554 return len; 555 } 556 557 /*********************************************************************** 558 * AMGetErrorTextW (quartz.@) 559 */ 560 DWORD WINAPI AMGetErrorTextW(HRESULT hr, LPWSTR pwszbuf, DWORD dwBufLen) 561 { 562 CHAR szBuf[MAX_ERROR_TEXT_LEN+1]; 563 DWORD dwLen; 564 565 dwLen = AMGetErrorTextA(hr,szBuf,MAX_ERROR_TEXT_LEN); 566 if ( dwLen == 0 ) 567 return 0; 568 szBuf[dwLen] = 0; 569 570 QUARTZ_strncpyAtoW( pwszbuf, szBuf, dwBufLen ); 571 572 return lstrlenW( pwszbuf ); 573 } -
TabularUnified trunk/src/quartz/makefile ¶
r6918 r6952 1 # $Id: makefile,v 1. 4 2001-10-01 01:41:21 birdExp $1 # $Id: makefile,v 1.5 2001-10-06 08:54:26 sandervl Exp $ 2 2 3 3 # … … 28 28 # 29 29 OBJS = \ 30 $(OBJDIR)\amerror.obj \31 30 $(OBJDIR)\amundoc.obj \ 31 $(OBJDIR)\audren.obj \ 32 $(OBJDIR)\basefilt.obj \ 33 $(OBJDIR)\basepin.obj \ 32 34 $(OBJDIR)\complist.obj \ 33 $(OBJDIR)\fgclsid.obj \ 35 $(OBJDIR)\devenum.obj \ 36 $(OBJDIR)\devmon.obj \ 37 $(OBJDIR)\enumunk.obj \ 38 $(OBJDIR)\fgevent.obj \ 34 39 $(OBJDIR)\fgidisp.obj \ 40 $(OBJDIR)\fgpass.obj \ 35 41 $(OBJDIR)\fgraph.obj \ 36 42 $(OBJDIR)\fmap.obj \ 37 43 $(OBJDIR)\fmap2.obj \ 38 $(OBJDIR)\ibasaud.obj \39 $(OBJDIR)\ibasvid.obj \40 44 $(OBJDIR)\ifgraph.obj \ 41 $(OBJDIR)\ifmap.obj \ 42 $(OBJDIR)\ifmap3.obj \ 45 $(OBJDIR)\igconfig.obj \ 43 46 $(OBJDIR)\igrver.obj \ 44 47 $(OBJDIR)\imcntl.obj \ 45 $(OBJDIR)\imem.obj \46 $(OBJDIR)\imesink.obj \47 $(OBJDIR)\imevent.obj \48 48 $(OBJDIR)\imfilter.obj \ 49 49 $(OBJDIR)\impos.obj \ 50 50 $(OBJDIR)\imseek.obj \ 51 $(OBJDIR)\irclock.obj \52 51 $(OBJDIR)\iunk.obj \ 53 $(OBJDIR)\ividwin.obj \54 52 $(OBJDIR)\main.obj \ 55 53 $(OBJDIR)\memalloc.obj \ 56 $(OBJDIR)\m onprop.obj \54 $(OBJDIR)\mtype.obj \ 57 55 $(OBJDIR)\regsvr.obj \ 56 $(OBJDIR)\sample.obj \ 58 57 $(OBJDIR)\seekpass.obj \ 59 58 $(OBJDIR)\sysclock.obj \ 60 $(OBJDIR)\devenum.obj \61 $(OBJDIR)\devmon.obj \62 $(OBJDIR)\enumunk.obj \63 $(OBJDIR)\idevenum.obj \64 59 $(OBJDIR)\initterm.obj \ 65 60 $(OBJDIR)\initquartz.obj \ … … 74 69 $(ODIN32_LIB)/kernel32.lib \ 75 70 $(ODIN32_LIB)/user32.lib \ 71 $(ODIN32_LIB)/winmm.lib \ 72 $(ODIN32_LIB)/ntdll.lib \ 76 73 $(ODIN32_LIB)/ole32.lib \ 77 74 $(ODIN32_LIB)/oleaut32.lib \ -
TabularUnified trunk/src/quartz/memalloc.c ¶
r6710 r6952 2 2 * Implementation of CLSID_MemoryAllocator. 3 3 * 4 * FIXME - stub.5 *6 4 * hidenori@a2.ctktv.ne.jp 7 5 */ … … 12 10 #include "winbase.h" 13 11 #include "wingdi.h" 12 #include "winuser.h" 14 13 #include "winerror.h" 15 14 #include "wine/obj_base.h" … … 24 23 25 24 25 /*************************************************************************** 26 * 27 * new/delete for CLSID_MemoryAllocator. 28 * 29 */ 30 26 31 /* can I use offsetof safely? - FIXME? */ 27 32 static QUARTZ_IFEntry IFEntries[] = … … 64 69 return S_OK; 65 70 } 71 72 73 /*************************************************************************** 74 * 75 * CMemoryAllocator::IMemAllocator 76 * 77 */ 78 79 80 static HRESULT WINAPI 81 IMemAllocator_fnQueryInterface(IMemAllocator* iface,REFIID riid,void** ppobj) 82 { 83 CMemoryAllocator_THIS(iface,memalloc); 84 85 TRACE("(%p)->()\n",This); 86 87 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 88 } 89 90 static ULONG WINAPI 91 IMemAllocator_fnAddRef(IMemAllocator* iface) 92 { 93 CMemoryAllocator_THIS(iface,memalloc); 94 95 TRACE("(%p)->()\n",This); 96 97 return IUnknown_AddRef(This->unk.punkControl); 98 } 99 100 static ULONG WINAPI 101 IMemAllocator_fnRelease(IMemAllocator* iface) 102 { 103 CMemoryAllocator_THIS(iface,memalloc); 104 105 TRACE("(%p)->()\n",This); 106 107 return IUnknown_Release(This->unk.punkControl); 108 } 109 110 static HRESULT WINAPI 111 IMemAllocator_fnSetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pPropReq,ALLOCATOR_PROPERTIES* pPropActual) 112 { 113 CMemoryAllocator_THIS(iface,memalloc); 114 long padding; 115 HRESULT hr; 116 117 TRACE( "(%p)->(%p,%p)\n", This, pPropReq, pPropActual ); 118 119 if ( pPropReq == NULL || pPropActual == NULL ) 120 return E_POINTER; 121 if ( pPropReq->cBuffers < 0 || 122 pPropReq->cbBuffer < 0 || 123 pPropReq->cbAlign < 0 || 124 pPropReq->cbPrefix < 0 ) 125 return E_INVALIDARG; 126 127 if ( ( pPropReq->cbAlign & (pPropReq->cbAlign-1) ) != 0 ) 128 return E_INVALIDARG; 129 130 hr = NOERROR; 131 132 EnterCriticalSection( &This->csMem ); 133 134 if ( This->pData != NULL || This->ppSamples != NULL ) 135 { 136 /* if commited, properties must not be changed. */ 137 hr = E_UNEXPECTED; 138 goto end; 139 } 140 141 This->prop.cBuffers = pPropReq->cBuffers; 142 This->prop.cbBuffer = pPropReq->cbBuffer; 143 This->prop.cbAlign = pPropReq->cbAlign; 144 This->prop.cbPrefix = pPropReq->cbPrefix; 145 146 if ( This->prop.cbAlign == 0 ) 147 This->prop.cbAlign = 1; 148 padding = This->prop.cbAlign - 149 ( (This->prop.cbBuffer+This->prop.cbPrefix) % This->prop.cbAlign ); 150 151 This->prop.cbBuffer += padding; 152 153 memcpy( pPropActual, &This->prop, sizeof(ALLOCATOR_PROPERTIES) ); 154 155 end: 156 LeaveCriticalSection( &This->csMem ); 157 158 return hr; 159 } 160 161 static HRESULT WINAPI 162 IMemAllocator_fnGetProperties(IMemAllocator* iface,ALLOCATOR_PROPERTIES* pProp) 163 { 164 CMemoryAllocator_THIS(iface,memalloc); 165 166 TRACE( "(%p)->(%p)\n", This, pProp ); 167 168 if ( pProp == NULL ) 169 return E_POINTER; 170 171 EnterCriticalSection( &This->csMem ); 172 173 memcpy( pProp, &This->prop, sizeof(ALLOCATOR_PROPERTIES) ); 174 175 LeaveCriticalSection( &This->csMem ); 176 177 return NOERROR; 178 } 179 180 static HRESULT WINAPI 181 IMemAllocator_fnCommit(IMemAllocator* iface) 182 { 183 CMemoryAllocator_THIS(iface,memalloc); 184 HRESULT hr; 185 LONG lBufSize; 186 LONG i; 187 BYTE* pCur; 188 189 TRACE( "(%p)->()\n", This ); 190 191 EnterCriticalSection( &This->csMem ); 192 193 hr = NOERROR; 194 if ( This->pData != NULL || This->ppSamples != NULL || 195 This->prop.cBuffers <= 0 ) 196 goto end; 197 198 lBufSize = This->prop.cBuffers * 199 (This->prop.cbBuffer + This->prop.cbPrefix) + 200 This->prop.cbAlign; 201 if ( lBufSize <= 0 ) 202 lBufSize = 1; 203 204 This->pData = (BYTE*)QUARTZ_AllocMem( lBufSize ); 205 if ( This->pData == NULL ) 206 { 207 hr = E_OUTOFMEMORY; 208 goto end; 209 } 210 211 This->ppSamples = (CMemMediaSample**)QUARTZ_AllocMem( 212 sizeof(CMemMediaSample*) * This->prop.cBuffers ); 213 if ( This->ppSamples == NULL ) 214 { 215 hr = E_OUTOFMEMORY; 216 goto end; 217 } 218 219 for ( i = 0; i < This->prop.cBuffers; i++ ) 220 This->ppSamples[i] = NULL; 221 222 pCur = This->pData + This->prop.cbAlign - ((This->pData-(BYTE*)NULL) & (This->prop.cbAlign-1)); 223 224 for ( i = 0; i < This->prop.cBuffers; i++ ) 225 { 226 hr = QUARTZ_CreateMemMediaSample( 227 pCur, (This->prop.cbBuffer + This->prop.cbPrefix), 228 iface, &This->ppSamples[i] ); 229 if ( FAILED(hr) ) 230 goto end; 231 pCur += (This->prop.cbBuffer + This->prop.cbPrefix); 232 } 233 234 hr = NOERROR; 235 end: 236 if ( FAILED(hr) ) 237 IMemAllocator_Decommit(iface); 238 239 LeaveCriticalSection( &This->csMem ); 240 241 return hr; 242 } 243 244 static HRESULT WINAPI 245 IMemAllocator_fnDecommit(IMemAllocator* iface) 246 { 247 CMemoryAllocator_THIS(iface,memalloc); 248 HRESULT hr; 249 LONG i; 250 BOOL bBlock; 251 252 TRACE( "(%p)->()\n", This ); 253 254 EnterCriticalSection( &This->csMem ); 255 256 hr = NOERROR; 257 258 if ( This->pData == NULL && This->ppSamples == NULL ) 259 goto end; 260 261 while ( 1 ) 262 { 263 bBlock = FALSE; 264 i = 0; 265 266 ResetEvent( This->hEventSample ); 267 268 while ( 1 ) 269 { 270 if ( i >= This->prop.cBuffers ) 271 break; 272 273 if ( This->ppSamples[i] != NULL ) 274 { 275 if ( This->ppSamples[i]->ref == 0 ) 276 { 277 QUARTZ_DestroyMemMediaSample( This->ppSamples[i] ); 278 This->ppSamples[i] = NULL; 279 } 280 else 281 { 282 bBlock = TRUE; 283 } 284 } 285 i++; 286 } 287 288 if ( !bBlock ) 289 { 290 QUARTZ_FreeMem(This->ppSamples); 291 This->ppSamples = NULL; 292 QUARTZ_FreeMem(This->pData); 293 This->pData = NULL; 294 hr = NOERROR; 295 break; 296 } 297 298 WaitForSingleObject( This->hEventSample, INFINITE ); 299 } 300 301 end: 302 LeaveCriticalSection( &This->csMem ); 303 304 return hr; 305 } 306 307 static HRESULT WINAPI 308 IMemAllocator_fnGetBuffer(IMemAllocator* iface,IMediaSample** ppSample,REFERENCE_TIME* prtStart,REFERENCE_TIME* prtEnd,DWORD dwFlags) 309 { 310 CMemoryAllocator_THIS(iface,memalloc); 311 LONG i; 312 HRESULT hr; 313 314 TRACE( "(%p)->(%p,%p,%p,%lu)\n", This, ppSample, prtStart, prtEnd, dwFlags ); 315 316 if ( ppSample == NULL ) 317 return E_POINTER; 318 319 EnterCriticalSection( &This->csMem ); 320 321 hr = NOERROR; 322 323 if ( This->pData == NULL || This->ppSamples == NULL || 324 This->prop.cBuffers <= 0 ) 325 { 326 hr = E_FAIL; /* FIXME? */ 327 goto end; 328 } 329 330 while ( 1 ) 331 { 332 ResetEvent( This->hEventSample ); 333 334 for ( i = 0; i < This->prop.cBuffers; i++ ) 335 { 336 if ( This->ppSamples[i]->ref == 0 ) 337 { 338 *ppSample = (IMediaSample*)(This->ppSamples[i]); 339 IMediaSample_AddRef( *ppSample ); 340 hr = NOERROR; 341 goto end; 342 } 343 } 344 345 if ( dwFlags & AM_GBF_NOWAIT ) 346 { 347 hr = E_FAIL; /* FIXME? */ 348 goto end; 349 } 350 351 WaitForSingleObject( This->hEventSample, INFINITE ); 352 } 353 354 end: 355 LeaveCriticalSection( &This->csMem ); 356 357 return hr; 358 } 359 360 static HRESULT WINAPI 361 IMemAllocator_fnReleaseBuffer(IMemAllocator* iface,IMediaSample* pSample) 362 { 363 CMemoryAllocator_THIS(iface,memalloc); 364 365 TRACE( "(%p)->(%p)\n", This, pSample ); 366 SetEvent( This->hEventSample ); 367 368 return NOERROR; 369 } 370 371 372 373 static ICOM_VTABLE(IMemAllocator) imemalloc = 374 { 375 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 376 /* IUnknown fields */ 377 IMemAllocator_fnQueryInterface, 378 IMemAllocator_fnAddRef, 379 IMemAllocator_fnRelease, 380 /* IMemAllocator fields */ 381 IMemAllocator_fnSetProperties, 382 IMemAllocator_fnGetProperties, 383 IMemAllocator_fnCommit, 384 IMemAllocator_fnDecommit, 385 IMemAllocator_fnGetBuffer, 386 IMemAllocator_fnReleaseBuffer, 387 }; 388 389 390 HRESULT CMemoryAllocator_InitIMemAllocator( CMemoryAllocator* pma ) 391 { 392 TRACE("(%p)\n",pma); 393 394 ICOM_VTBL(&pma->memalloc) = &imemalloc; 395 396 ZeroMemory( &pma->prop, sizeof(pma->prop) ); 397 pma->hEventSample = (HANDLE)NULL; 398 pma->pData = NULL; 399 pma->ppSamples = NULL; 400 401 pma->hEventSample = CreateEventA( NULL, TRUE, FALSE, NULL ); 402 if ( pma->hEventSample == (HANDLE)NULL ) 403 return E_OUTOFMEMORY; 404 405 InitializeCriticalSection( &pma->csMem ); 406 407 return NOERROR; 408 } 409 410 void CMemoryAllocator_UninitIMemAllocator( CMemoryAllocator* pma ) 411 { 412 TRACE("(%p)\n",pma); 413 414 IMemAllocator_Decommit( (IMemAllocator*)(&pma->memalloc) ); 415 416 DeleteCriticalSection( &pma->csMem ); 417 418 if ( pma->hEventSample != (HANDLE)NULL ) 419 CloseHandle( pma->hEventSample ); 420 } -
TabularUnified trunk/src/quartz/memalloc.h ¶
r6710 r6952 13 13 14 14 #include "iunk.h" 15 #include "sample.h" 15 16 16 17 typedef struct MA_IMemAllocatorImpl … … 27 28 CRITICAL_SECTION csMem; 28 29 ALLOCATOR_PROPERTIES prop; 30 HANDLE hEventSample; 31 BYTE* pData; 32 CMemMediaSample** ppSamples; 29 33 } CMemoryAllocator; 30 34 -
TabularUnified trunk/src/quartz/quartz_private.h ¶
r6563 r6952 8 8 void* QUARTZ_AllocMem( DWORD dwSize ); 9 9 void QUARTZ_FreeMem( void* pMem ); 10 void* QUARTZ_ReallocMem( void* pMem, DWORD dwSize ); 10 11 11 12 #endif /* QUARTZ_PRIVATE_H */ -
TabularUnified trunk/src/quartz/regsvr.c ¶
r6710 r6952 13 13 #include "winerror.h" 14 14 #include "winreg.h" 15 #ifdef __WIN32OS2__16 #include "wine/obj_base.h"17 #endif18 15 #include "uuids.h" 19 16 #include "wine/unicode.h" -
TabularUnified trunk/src/quartz/seekpass.c ¶
r6710 r6952 1 1 /* 2 * Implementation of CLSID_SeekingPassThru. 2 * Implementation of CLSID_SeekingPassThru 3 * 4 * FIXME - not tested yet. 3 5 * 4 6 * hidenori@a2.ctktv.ne.jp … … 10 12 #include "winbase.h" 11 13 #include "wingdi.h" 14 #include "winuser.h" 12 15 #include "winerror.h" 13 16 #include "wine/obj_base.h" 14 17 #include "strmif.h" 18 #include "control.h" 15 19 #include "uuids.h" 16 20 … … 22 26 23 27 28 /*************************************************************************** 29 * 30 * CSeekingPassThru::ISeekingPassThru 31 * 32 */ 24 33 25 34 static HRESULT WINAPI … … 58 67 CSeekingPassThru_THIS(iface,seekpass); 59 68 60 FIXME("(%p)->(%d,%p) stub!\n",This,bRendering,pPin); 61 62 return E_NOTIMPL; 69 FIXME("(%p)->(%d,%p) not tested!\n",This,bRendering,pPin); 70 71 if ( pPin == NULL ) 72 return E_POINTER; 73 74 /* Why is 'bRendering' given as an argument?? */ 75 EnterCriticalSection( &This->cs ); 76 77 if ( This->passthru.pPin != NULL ) 78 IPin_Release( This->passthru.pPin ); 79 This->passthru.pPin = pPin; IPin_AddRef( pPin ); 80 81 LeaveCriticalSection( &This->cs ); 82 83 return NOERROR; 63 84 } 64 85 … … 80 101 TRACE("(%p)\n",This); 81 102 ICOM_VTBL(&This->seekpass) = &iseekingpassthru; 103 This->passthru.punk = This->unk.punkControl; 104 This->passthru.pPin = NULL; 105 InitializeCriticalSection( &This->cs ); 82 106 83 107 return NOERROR; … … 88 112 { 89 113 TRACE("(%p)\n",This); 90 } 91 114 if ( This->passthru.pPin != NULL ) 115 { 116 IPin_Release( This->passthru.pPin ); 117 This->passthru.pPin = NULL; 118 } 119 DeleteCriticalSection( &This->cs ); 120 } 121 122 /*************************************************************************** 123 * 124 * new/delete for CLSID_SeekingPassThru. 125 * 126 */ 92 127 93 128 /* can I use offsetof safely? - FIXME? */ … … 95 130 { 96 131 { &IID_ISeekingPassThru, offsetof(CSeekingPassThru,seekpass)-offsetof(CSeekingPassThru,unk) }, 132 { &IID_IMediaPosition, offsetof(CSeekingPassThru,passthru.mpos)-offsetof(CSeekingPassThru,unk) }, 133 { &IID_IMediaSeeking, offsetof(CSeekingPassThru,passthru.mseek)-offsetof(CSeekingPassThru,unk) }, 97 134 }; 98 135 … … 133 170 } 134 171 172 173 174 175 /*************************************************************************** 176 * 177 * CPassThruImpl Helper methods. 178 * 179 */ 180 181 static 182 HRESULT CPassThruImpl_GetConnected( CPassThruImpl* pImpl, IPin** ppPin ) 183 { 184 return IPin_ConnectedTo( pImpl->pPin, ppPin ); 185 } 186 187 HRESULT CPassThruImpl_QueryPosPass( 188 CPassThruImpl* pImpl, IMediaPosition** ppPosition ) 189 { 190 IPin* pPin; 191 HRESULT hr; 192 193 hr = CPassThruImpl_GetConnected( pImpl, &pPin ); 194 if ( FAILED(hr) ) 195 return hr; 196 hr = IPin_QueryInterface(pPin,&IID_IMediaPosition,(void**)ppPosition); 197 IPin_Release(pPin); 198 199 return hr; 200 } 201 202 HRESULT CPassThruImpl_QuerySeekPass( 203 CPassThruImpl* pImpl, IMediaSeeking** ppSeeking ) 204 { 205 IPin* pPin; 206 HRESULT hr; 207 208 hr = CPassThruImpl_GetConnected( pImpl, &pPin ); 209 if ( FAILED(hr) ) 210 return hr; 211 hr = IPin_QueryInterface(pPin,&IID_IMediaSeeking,(void**)ppSeeking); 212 IPin_Release(pPin); 213 214 return hr; 215 } 216 217 /*************************************************************************** 218 * 219 * An implementation for CPassThruImpl::IMediaPosition. 220 * 221 */ 222 223 224 #define QUERYPOSPASS \ 225 IMediaPosition* pPos = NULL; \ 226 HRESULT hr; \ 227 hr = CPassThruImpl_QueryPosPass( This, &pPos ); \ 228 if ( FAILED(hr) ) return hr; 229 230 static HRESULT WINAPI 231 IMediaPosition_fnQueryInterface(IMediaPosition* iface,REFIID riid,void** ppobj) 232 { 233 CPassThruImpl_THIS(iface,mpos); 234 235 TRACE("(%p)->()\n",This); 236 237 return IUnknown_QueryInterface(This->punk,riid,ppobj); 238 } 239 240 static ULONG WINAPI 241 IMediaPosition_fnAddRef(IMediaPosition* iface) 242 { 243 CPassThruImpl_THIS(iface,mpos); 244 245 TRACE("(%p)->()\n",This); 246 247 return IUnknown_AddRef(This->punk); 248 } 249 250 static ULONG WINAPI 251 IMediaPosition_fnRelease(IMediaPosition* iface) 252 { 253 CPassThruImpl_THIS(iface,mpos); 254 255 TRACE("(%p)->()\n",This); 256 257 return IUnknown_Release(This->punk); 258 } 259 260 static HRESULT WINAPI 261 IMediaPosition_fnGetTypeInfoCount(IMediaPosition* iface,UINT* pcTypeInfo) 262 { 263 CPassThruImpl_THIS(iface,mpos); 264 265 FIXME("(%p)->() stub!\n",This); 266 267 return E_NOTIMPL; 268 } 269 270 static HRESULT WINAPI 271 IMediaPosition_fnGetTypeInfo(IMediaPosition* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj) 272 { 273 CPassThruImpl_THIS(iface,mpos); 274 275 FIXME("(%p)->() stub!\n",This); 276 277 return E_NOTIMPL; 278 } 279 280 static HRESULT WINAPI 281 IMediaPosition_fnGetIDsOfNames(IMediaPosition* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId) 282 { 283 CPassThruImpl_THIS(iface,mpos); 284 285 FIXME("(%p)->() stub!\n",This); 286 287 return E_NOTIMPL; 288 } 289 290 static HRESULT WINAPI 291 IMediaPosition_fnInvoke(IMediaPosition* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr) 292 { 293 CPassThruImpl_THIS(iface,mpos); 294 295 FIXME("(%p)->() stub!\n",This); 296 297 return E_NOTIMPL; 298 } 299 300 301 static HRESULT WINAPI 302 IMediaPosition_fnget_Duration(IMediaPosition* iface,REFTIME* prefTime) 303 { 304 CPassThruImpl_THIS(iface,mpos); 305 QUERYPOSPASS 306 307 TRACE("(%p)->()\n",This); 308 309 return IMediaPosition_get_Duration(pPos,prefTime); 310 } 311 312 static HRESULT WINAPI 313 IMediaPosition_fnput_CurrentPosition(IMediaPosition* iface,REFTIME refTime) 314 { 315 CPassThruImpl_THIS(iface,mpos); 316 QUERYPOSPASS 317 318 TRACE("(%p)->()\n",This); 319 320 return IMediaPosition_put_CurrentPosition(pPos,refTime); 321 } 322 323 static HRESULT WINAPI 324 IMediaPosition_fnget_CurrentPosition(IMediaPosition* iface,REFTIME* prefTime) 325 { 326 CPassThruImpl_THIS(iface,mpos); 327 QUERYPOSPASS 328 329 TRACE("(%p)->()\n",This); 330 331 return IMediaPosition_get_CurrentPosition(pPos,prefTime); 332 } 333 334 static HRESULT WINAPI 335 IMediaPosition_fnget_StopTime(IMediaPosition* iface,REFTIME* prefTime) 336 { 337 CPassThruImpl_THIS(iface,mpos); 338 QUERYPOSPASS 339 340 TRACE("(%p)->()\n",This); 341 342 return IMediaPosition_get_StopTime(pPos,prefTime); 343 } 344 345 static HRESULT WINAPI 346 IMediaPosition_fnput_StopTime(IMediaPosition* iface,REFTIME refTime) 347 { 348 CPassThruImpl_THIS(iface,mpos); 349 QUERYPOSPASS 350 351 TRACE("(%p)->()\n",This); 352 353 return IMediaPosition_put_StopTime(pPos,refTime); 354 } 355 356 static HRESULT WINAPI 357 IMediaPosition_fnget_PrerollTime(IMediaPosition* iface,REFTIME* prefTime) 358 { 359 CPassThruImpl_THIS(iface,mpos); 360 QUERYPOSPASS 361 362 TRACE("(%p)->()\n",This); 363 364 return IMediaPosition_get_PrerollTime(pPos,prefTime); 365 } 366 367 static HRESULT WINAPI 368 IMediaPosition_fnput_PrerollTime(IMediaPosition* iface,REFTIME refTime) 369 { 370 CPassThruImpl_THIS(iface,mpos); 371 QUERYPOSPASS 372 373 TRACE("(%p)->()\n",This); 374 375 return IMediaPosition_put_PrerollTime(pPos,refTime); 376 } 377 378 static HRESULT WINAPI 379 IMediaPosition_fnput_Rate(IMediaPosition* iface,double dblRate) 380 { 381 CPassThruImpl_THIS(iface,mpos); 382 QUERYPOSPASS 383 384 TRACE("(%p)->()\n",This); 385 386 return IMediaPosition_put_Rate(pPos,dblRate); 387 } 388 389 static HRESULT WINAPI 390 IMediaPosition_fnget_Rate(IMediaPosition* iface,double* pdblRate) 391 { 392 CPassThruImpl_THIS(iface,mpos); 393 QUERYPOSPASS 394 395 TRACE("(%p)->()\n",This); 396 397 return IMediaPosition_get_Rate(pPos,pdblRate); 398 } 399 400 static HRESULT WINAPI 401 IMediaPosition_fnCanSeekForward(IMediaPosition* iface,LONG* pCanSeek) 402 { 403 CPassThruImpl_THIS(iface,mpos); 404 QUERYPOSPASS 405 406 TRACE("(%p)->()\n",This); 407 408 return IMediaPosition_CanSeekForward(pPos,pCanSeek); 409 } 410 411 static HRESULT WINAPI 412 IMediaPosition_fnCanSeekBackward(IMediaPosition* iface,LONG* pCanSeek) 413 { 414 CPassThruImpl_THIS(iface,mpos); 415 QUERYPOSPASS 416 417 TRACE("(%p)->()\n",This); 418 419 return IMediaPosition_CanSeekBackward(pPos,pCanSeek); 420 } 421 422 423 static ICOM_VTABLE(IMediaPosition) impos = 424 { 425 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 426 /* IUnknown fields */ 427 IMediaPosition_fnQueryInterface, 428 IMediaPosition_fnAddRef, 429 IMediaPosition_fnRelease, 430 /* IDispatch fields */ 431 IMediaPosition_fnGetTypeInfoCount, 432 IMediaPosition_fnGetTypeInfo, 433 IMediaPosition_fnGetIDsOfNames, 434 IMediaPosition_fnInvoke, 435 /* IMediaPosition fields */ 436 IMediaPosition_fnget_Duration, 437 IMediaPosition_fnput_CurrentPosition, 438 IMediaPosition_fnget_CurrentPosition, 439 IMediaPosition_fnget_StopTime, 440 IMediaPosition_fnput_StopTime, 441 IMediaPosition_fnget_PrerollTime, 442 IMediaPosition_fnput_PrerollTime, 443 IMediaPosition_fnput_Rate, 444 IMediaPosition_fnget_Rate, 445 IMediaPosition_fnCanSeekForward, 446 IMediaPosition_fnCanSeekBackward, 447 }; 448 449 450 HRESULT CPassThruImpl_InitIMediaPosition( CPassThruImpl* pImpl ) 451 { 452 TRACE("(%p)\n",pImpl); 453 ICOM_VTBL(&pImpl->mpos) = &impos; 454 455 return NOERROR; 456 } 457 458 void CPassThruImpl_UninitIMediaPosition( CPassThruImpl* pImpl ) 459 { 460 TRACE("(%p)\n",pImpl); 461 } 462 463 #undef QUERYPOSPASS 464 465 466 /*************************************************************************** 467 * 468 * An implementation for CPassThruImpl::IMediaSeeking. 469 * 470 */ 471 472 #define QUERYSEEKPASS \ 473 IMediaSeeking* pSeek = NULL; \ 474 HRESULT hr; \ 475 hr = CPassThruImpl_QuerySeekPass( This, &pSeek ); \ 476 if ( FAILED(hr) ) return hr; 477 478 479 static HRESULT WINAPI 480 IMediaSeeking_fnQueryInterface(IMediaSeeking* iface,REFIID riid,void** ppobj) 481 { 482 CPassThruImpl_THIS(iface,mseek); 483 484 TRACE("(%p)->()\n",This); 485 486 return IUnknown_QueryInterface(This->punk,riid,ppobj); 487 } 488 489 static ULONG WINAPI 490 IMediaSeeking_fnAddRef(IMediaSeeking* iface) 491 { 492 CPassThruImpl_THIS(iface,mseek); 493 494 TRACE("(%p)->()\n",This); 495 496 return IUnknown_AddRef(This->punk); 497 } 498 499 static ULONG WINAPI 500 IMediaSeeking_fnRelease(IMediaSeeking* iface) 501 { 502 CPassThruImpl_THIS(iface,mseek); 503 504 TRACE("(%p)->()\n",This); 505 506 return IUnknown_Release(This->punk); 507 } 508 509 510 static HRESULT WINAPI 511 IMediaSeeking_fnGetCapabilities(IMediaSeeking* iface,DWORD* pdwCaps) 512 { 513 CPassThruImpl_THIS(iface,mseek); 514 QUERYSEEKPASS 515 516 TRACE("(%p)->()\n",This); 517 518 return IMediaSeeking_GetCapabilities(pSeek,pdwCaps); 519 } 520 521 static HRESULT WINAPI 522 IMediaSeeking_fnCheckCapabilities(IMediaSeeking* iface,DWORD* pdwCaps) 523 { 524 CPassThruImpl_THIS(iface,mseek); 525 QUERYSEEKPASS 526 527 TRACE("(%p)->()\n",This); 528 529 return IMediaSeeking_CheckCapabilities(pSeek,pdwCaps); 530 } 531 532 static HRESULT WINAPI 533 IMediaSeeking_fnIsFormatSupported(IMediaSeeking* iface,const GUID* pidFormat) 534 { 535 CPassThruImpl_THIS(iface,mseek); 536 QUERYSEEKPASS 537 538 TRACE("(%p)->()\n",This); 539 540 return IMediaSeeking_IsFormatSupported(pSeek,pidFormat); 541 } 542 543 static HRESULT WINAPI 544 IMediaSeeking_fnQueryPreferredFormat(IMediaSeeking* iface,GUID* pidFormat) 545 { 546 CPassThruImpl_THIS(iface,mseek); 547 QUERYSEEKPASS 548 549 TRACE("(%p)->()\n",This); 550 551 return IMediaSeeking_QueryPreferredFormat(pSeek,pidFormat); 552 } 553 554 static HRESULT WINAPI 555 IMediaSeeking_fnGetTimeFormat(IMediaSeeking* iface,GUID* pidFormat) 556 { 557 CPassThruImpl_THIS(iface,mseek); 558 QUERYSEEKPASS 559 560 TRACE("(%p)->()\n",This); 561 562 return IMediaSeeking_GetTimeFormat(pSeek,pidFormat); 563 } 564 565 static HRESULT WINAPI 566 IMediaSeeking_fnIsUsingTimeFormat(IMediaSeeking* iface,const GUID* pidFormat) 567 { 568 CPassThruImpl_THIS(iface,mseek); 569 QUERYSEEKPASS 570 571 TRACE("(%p)->()\n",This); 572 573 return IMediaSeeking_IsUsingTimeFormat(pSeek,pidFormat); 574 } 575 576 static HRESULT WINAPI 577 IMediaSeeking_fnSetTimeFormat(IMediaSeeking* iface,const GUID* pidFormat) 578 { 579 CPassThruImpl_THIS(iface,mseek); 580 QUERYSEEKPASS 581 582 TRACE("(%p)->()\n",This); 583 584 return IMediaSeeking_SetTimeFormat(pSeek,pidFormat); 585 } 586 587 static HRESULT WINAPI 588 IMediaSeeking_fnGetDuration(IMediaSeeking* iface,LONGLONG* pllDuration) 589 { 590 CPassThruImpl_THIS(iface,mseek); 591 QUERYSEEKPASS 592 593 TRACE("(%p)->()\n",This); 594 595 return IMediaSeeking_GetDuration(pSeek,pllDuration); 596 } 597 598 static HRESULT WINAPI 599 IMediaSeeking_fnGetStopPosition(IMediaSeeking* iface,LONGLONG* pllPos) 600 { 601 CPassThruImpl_THIS(iface,mseek); 602 QUERYSEEKPASS 603 604 TRACE("(%p)->()\n",This); 605 606 return IMediaSeeking_GetStopPosition(pSeek,pllPos); 607 } 608 609 static HRESULT WINAPI 610 IMediaSeeking_fnGetCurrentPosition(IMediaSeeking* iface,LONGLONG* pllPos) 611 { 612 CPassThruImpl_THIS(iface,mseek); 613 QUERYSEEKPASS 614 615 TRACE("(%p)->()\n",This); 616 617 return IMediaSeeking_GetCurrentPosition(pSeek,pllPos); 618 } 619 620 static HRESULT WINAPI 621 IMediaSeeking_fnConvertTimeFormat(IMediaSeeking* iface,LONGLONG* pllOut,const GUID* pidFmtOut,LONGLONG llIn,const GUID* pidFmtIn) 622 { 623 CPassThruImpl_THIS(iface,mseek); 624 QUERYSEEKPASS 625 626 TRACE("(%p)->()\n",This); 627 628 return IMediaSeeking_ConvertTimeFormat(pSeek,pllOut,pidFmtOut,llIn,pidFmtIn); 629 } 630 631 static HRESULT WINAPI 632 IMediaSeeking_fnSetPositions(IMediaSeeking* iface,LONGLONG* pllCur,DWORD dwCurFlags,LONGLONG* pllStop,DWORD dwStopFlags) 633 { 634 CPassThruImpl_THIS(iface,mseek); 635 QUERYSEEKPASS 636 637 TRACE("(%p)->()\n",This); 638 639 return IMediaSeeking_SetPositions(pSeek,pllCur,dwCurFlags,pllStop,dwStopFlags); 640 } 641 642 static HRESULT WINAPI 643 IMediaSeeking_fnGetPositions(IMediaSeeking* iface,LONGLONG* pllCur,LONGLONG* pllStop) 644 { 645 CPassThruImpl_THIS(iface,mseek); 646 QUERYSEEKPASS 647 648 TRACE("(%p)->()\n",This); 649 650 return IMediaSeeking_GetPositions(pSeek,pllCur,pllStop); 651 } 652 653 static HRESULT WINAPI 654 IMediaSeeking_fnGetAvailable(IMediaSeeking* iface,LONGLONG* pllFirst,LONGLONG* pllLast) 655 { 656 CPassThruImpl_THIS(iface,mseek); 657 QUERYSEEKPASS 658 659 TRACE("(%p)->()\n",This); 660 661 return IMediaSeeking_GetAvailable(pSeek,pllFirst,pllLast); 662 } 663 664 static HRESULT WINAPI 665 IMediaSeeking_fnSetRate(IMediaSeeking* iface,double dblRate) 666 { 667 CPassThruImpl_THIS(iface,mseek); 668 QUERYSEEKPASS 669 670 TRACE("(%p)->()\n",This); 671 672 return IMediaSeeking_SetRate(pSeek,dblRate); 673 } 674 675 static HRESULT WINAPI 676 IMediaSeeking_fnGetRate(IMediaSeeking* iface,double* pdblRate) 677 { 678 CPassThruImpl_THIS(iface,mseek); 679 QUERYSEEKPASS 680 681 TRACE("(%p)->()\n",This); 682 683 return IMediaSeeking_GetRate(pSeek,pdblRate); 684 } 685 686 static HRESULT WINAPI 687 IMediaSeeking_fnGetPreroll(IMediaSeeking* iface,LONGLONG* pllPreroll) 688 { 689 CPassThruImpl_THIS(iface,mseek); 690 QUERYSEEKPASS 691 692 TRACE("(%p)->()\n",This); 693 694 return IMediaSeeking_GetPreroll(pSeek,pllPreroll); 695 } 696 697 698 699 700 static ICOM_VTABLE(IMediaSeeking) imseek = 701 { 702 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 703 /* IUnknown fields */ 704 IMediaSeeking_fnQueryInterface, 705 IMediaSeeking_fnAddRef, 706 IMediaSeeking_fnRelease, 707 /* IMediaSeeking fields */ 708 IMediaSeeking_fnGetCapabilities, 709 IMediaSeeking_fnCheckCapabilities, 710 IMediaSeeking_fnIsFormatSupported, 711 IMediaSeeking_fnQueryPreferredFormat, 712 IMediaSeeking_fnGetTimeFormat, 713 IMediaSeeking_fnIsUsingTimeFormat, 714 IMediaSeeking_fnSetTimeFormat, 715 IMediaSeeking_fnGetDuration, 716 IMediaSeeking_fnGetStopPosition, 717 IMediaSeeking_fnGetCurrentPosition, 718 IMediaSeeking_fnConvertTimeFormat, 719 IMediaSeeking_fnSetPositions, 720 IMediaSeeking_fnGetPositions, 721 IMediaSeeking_fnGetAvailable, 722 IMediaSeeking_fnSetRate, 723 IMediaSeeking_fnGetRate, 724 IMediaSeeking_fnGetPreroll, 725 }; 726 727 728 729 HRESULT CPassThruImpl_InitIMediaSeeking( CPassThruImpl* pImpl ) 730 { 731 TRACE("(%p)\n",pImpl); 732 ICOM_VTBL(&pImpl->mseek) = &imseek; 733 734 return NOERROR; 735 } 736 737 void CPassThruImpl_UninitIMediaSeeking( CPassThruImpl* pImpl ) 738 { 739 TRACE("(%p)\n",pImpl); 740 } 741 742 #undef QUERYSEEKPASS -
TabularUnified trunk/src/quartz/seekpass.h ¶
r6710 r6952 14 14 #include "iunk.h" 15 15 16 17 /****************************************************************************/ 18 19 typedef struct CPassThruImpl 20 { 21 struct { ICOM_VFIELD(IMediaPosition); } mpos; 22 struct { ICOM_VFIELD(IMediaSeeking); } mseek; 23 24 IUnknown* punk; 25 IPin* pPin; 26 } CPassThruImpl; 27 28 #define CPassThruImpl_THIS(iface,member) CPassThruImpl* This = ((CPassThruImpl*)(((char*)iface)-offsetof(CPassThruImpl,member))) 29 30 HRESULT CPassThruImpl_InitIMediaPosition( CPassThruImpl* pImpl ); 31 void CPassThruImpl_UninitIMediaPosition( CPassThruImpl* pImpl ); 32 HRESULT CPassThruImpl_InitIMediaSeeking( CPassThruImpl* pImpl ); 33 void CPassThruImpl_UninitIMediaSeeking( CPassThruImpl* pImpl ); 34 35 HRESULT CPassThruImpl_QueryPosPass( 36 CPassThruImpl* pImpl, IMediaPosition** ppPosition ); 37 HRESULT CPassThruImpl_QuerySeekPass( 38 CPassThruImpl* pImpl, IMediaSeeking** ppSeeking ); 39 40 /****************************************************************************/ 41 16 42 typedef struct QUARTZ_ISeekingPassThruImpl 17 43 { 18 44 ICOM_VFIELD(ISeekingPassThru); 19 45 } QUARTZ_ISeekingPassThruImpl; 20 21 46 22 47 typedef struct CSeekingPassThru … … 26 51 27 52 /* ISeekingPassThru fields. */ 53 CRITICAL_SECTION cs; 54 CPassThruImpl passthru; 28 55 } CSeekingPassThru; 29 56 -
TabularUnified trunk/src/quartz/sysclock.c ¶
r6710 r6952 2 2 * Implementation of CLSID_SystemClock. 3 3 * 4 * FIXME - stub.5 *6 4 * hidenori@a2.ctktv.ne.jp 7 5 */ … … 12 10 #include "winbase.h" 13 11 #include "wingdi.h" 12 #include "winuser.h" 14 13 #include "winerror.h" 15 14 #include "wine/obj_base.h" … … 24 23 25 24 25 /*************************************************************************** 26 * 27 * new/delete for CLSID_SystemClock 28 * 29 */ 30 26 31 /* can I use offsetof safely? - FIXME? */ 27 32 static QUARTZ_IFEntry IFEntries[] = … … 65 70 return S_OK; 66 71 } 72 73 74 /*************************************************************************** 75 * 76 * CLSID_SystemClock::IReferenceClock 77 * 78 */ 79 80 #define QUARTZ_MSG_ADDTIMER (WM_APP+0) 81 #define QUARTZ_MSG_REMOVETIMER (WM_APP+1) 82 #define QUARTZ_MSG_EXITTHREAD (WM_APP+2) 83 84 85 /****************************************************************************/ 86 87 static QUARTZ_TimerEntry* IReferenceClock_AllocTimerEntry(CSystemClock* This) 88 { 89 QUARTZ_TimerEntry* pEntry; 90 DWORD dw; 91 92 pEntry = &This->m_timerEntries[0]; 93 for ( dw = 0; dw < WINE_QUARTZ_SYSCLOCK_TIMER_MAX; dw++ ) 94 { 95 if ( pEntry->hEvent == (HANDLE)NULL ) 96 return pEntry; 97 pEntry ++; 98 } 99 100 return NULL; 101 } 102 103 static QUARTZ_TimerEntry* IReferenceClock_SearchTimer(CSystemClock* This, DWORD dwAdvCookie) 104 { 105 QUARTZ_TimerEntry* pEntry; 106 DWORD dw; 107 108 pEntry = &This->m_timerEntries[0]; 109 for ( dw = 0; dw < WINE_QUARTZ_SYSCLOCK_TIMER_MAX; dw++ ) 110 { 111 if ( pEntry->hEvent != (HANDLE)NULL && 112 pEntry->dwAdvCookie == dwAdvCookie ) 113 return pEntry; 114 pEntry ++; 115 } 116 117 return NULL; 118 } 119 120 static DWORD IReferenceClock_OnTimerUpdated(CSystemClock* This) 121 { 122 QUARTZ_TimerEntry* pEntry; 123 REFERENCE_TIME rtCur; 124 REFERENCE_TIME rtSignal; 125 REFERENCE_TIME rtCount; 126 HRESULT hr; 127 LONG lCount; 128 DWORD dw; 129 DWORD dwTimeout = INFINITE; 130 DWORD dwTimeoutCur; 131 132 hr = IReferenceClock_GetTime((IReferenceClock*)(&This->refclk),&rtCur); 133 if ( hr != NOERROR ) 134 return INFINITE; 135 136 pEntry = &This->m_timerEntries[0]; 137 for ( dw = 0; dw < WINE_QUARTZ_SYSCLOCK_TIMER_MAX; dw++ ) 138 { 139 if ( pEntry->hEvent != (HANDLE)NULL ) 140 { 141 rtSignal = pEntry->rtStart + pEntry->rtInterval; 142 if ( rtCur >= rtSignal ) 143 { 144 if ( pEntry->fPeriodic ) 145 { 146 rtCount = ((rtCur - pEntry->rtStart) / pEntry->rtInterval); 147 lCount = ( rtCount > (REFERENCE_TIME)0x7fffffff ) ? 148 (LONG)0x7fffffff : (LONG)rtCount; 149 if ( !ReleaseSemaphore( pEntry->hEvent, lCount, NULL ) ) 150 { 151 while ( lCount > 0 ) 152 { 153 if ( !ReleaseSemaphore( pEntry->hEvent, 1, NULL ) ) 154 break; 155 } 156 } 157 dwTimeout = 0; 158 } 159 else 160 { 161 TRACE( "signal an event\n" ); 162 SetEvent( pEntry->hEvent ); 163 pEntry->hEvent = (HANDLE)NULL; 164 } 165 } 166 else 167 { 168 rtCount = rtSignal - rtCur; 169 /* [100ns] -> [ms] */ 170 rtCount = (rtCount+(REFERENCE_TIME)9999)/(REFERENCE_TIME)10000; 171 dwTimeoutCur = (rtCount >= 0xfffffffe) ? (DWORD)0xfffffffe : (DWORD)rtCount; 172 if ( dwTimeout > dwTimeoutCur ) 173 dwTimeout = dwTimeoutCur; 174 } 175 } 176 pEntry ++; 177 } 178 179 return dwTimeout; 180 } 181 182 static 183 DWORD WINAPI IReferenceClock_TimerEntry( LPVOID lpvParam ) 184 { 185 CSystemClock* This = (CSystemClock*)lpvParam; 186 MSG msg; 187 DWORD dwRes; 188 DWORD dwTimeout; 189 190 /* initialize the message queue. */ 191 PeekMessageA( &msg, (HWND)NULL, 0, 0, PM_NOREMOVE ); 192 /* resume the owner thread. */ 193 SetEvent( This->m_hEventInit ); 194 195 TRACE( "Enter message loop.\n" ); 196 197 /* message loop. */ 198 dwTimeout = INFINITE; 199 while ( 1 ) 200 { 201 if ( dwTimeout > 0 ) 202 { 203 dwRes = MsgWaitForMultipleObjects( 204 0, NULL, FALSE, 205 dwTimeout, 206 QS_ALLEVENTS ); 207 } 208 209 EnterCriticalSection( &This->m_csClock ); 210 dwTimeout = IReferenceClock_OnTimerUpdated(This); 211 LeaveCriticalSection( &This->m_csClock ); 212 TRACE( "catch an event / timeout %lu\n", dwTimeout ); 213 214 while ( PeekMessageA( &msg, (HWND)NULL, 0, 0, PM_REMOVE ) ) 215 { 216 if ( msg.message == WM_QUIT ) 217 goto quitthread; 218 219 if ( msg.hwnd != (HWND)NULL ) 220 { 221 TranslateMessage( &msg ); 222 DispatchMessageA( &msg ); 223 } 224 else 225 { 226 switch ( msg.message ) 227 { 228 case QUARTZ_MSG_ADDTIMER: 229 case QUARTZ_MSG_REMOVETIMER: 230 dwTimeout = 0; 231 break; 232 case QUARTZ_MSG_EXITTHREAD: 233 PostQuitMessage(0); 234 break; 235 default: 236 FIXME( "invalid message %04u\n", (unsigned)msg.message ); 237 break; 238 } 239 } 240 } 241 } 242 243 quitthread: 244 TRACE( "quit thread\n" ); 245 return 0; 246 } 247 248 /****************************************************************************/ 249 250 static HRESULT WINAPI 251 IReferenceClock_fnQueryInterface(IReferenceClock* iface,REFIID riid,void** ppobj) 252 { 253 CSystemClock_THIS(iface,refclk); 254 255 TRACE("(%p)->()\n",This); 256 257 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj); 258 } 259 260 static ULONG WINAPI 261 IReferenceClock_fnAddRef(IReferenceClock* iface) 262 { 263 CSystemClock_THIS(iface,refclk); 264 265 TRACE("(%p)->()\n",This); 266 267 return IUnknown_AddRef(This->unk.punkControl); 268 } 269 270 static ULONG WINAPI 271 IReferenceClock_fnRelease(IReferenceClock* iface) 272 { 273 CSystemClock_THIS(iface,refclk); 274 275 TRACE("(%p)->()\n",This); 276 277 return IUnknown_Release(This->unk.punkControl); 278 } 279 280 static HRESULT WINAPI 281 IReferenceClock_fnGetTime(IReferenceClock* iface,REFERENCE_TIME* prtTime) 282 { 283 CSystemClock_THIS(iface,refclk); 284 DWORD dwTimeCur; 285 286 TRACE( "(%p)->(%p)\n", This, prtTime ); 287 288 if ( prtTime == NULL ) 289 return E_POINTER; 290 291 EnterCriticalSection( &This->m_csClock ); 292 293 dwTimeCur = GetTickCount(); 294 This->m_rtLast += (REFERENCE_TIME)(DWORD)(dwTimeCur - This->m_dwTimeLast) * (REFERENCE_TIME)10000; 295 296 This->m_dwTimeLast = dwTimeCur; 297 298 *prtTime = This->m_rtLast; 299 300 LeaveCriticalSection( &This->m_csClock ); 301 302 return NOERROR; 303 } 304 305 static HRESULT WINAPI 306 IReferenceClock_fnAdviseTime(IReferenceClock* iface,REFERENCE_TIME rtBase,REFERENCE_TIME rtStream,HEVENT hEvent,DWORD_PTR* pdwAdvCookie) 307 { 308 CSystemClock_THIS(iface,refclk); 309 QUARTZ_TimerEntry* pEntry; 310 HRESULT hr; 311 REFERENCE_TIME rtCur; 312 313 TRACE( "(%p)->()\n", This ); 314 315 if ( pdwAdvCookie == NULL ) 316 return E_POINTER; 317 if ( hEvent == (HANDLE)NULL ) 318 return E_INVALIDARG; 319 320 EnterCriticalSection( &This->m_csClock ); 321 322 *pdwAdvCookie = (DWORD_PTR)(This->m_dwAdvCookieNext ++); 323 324 hr = IReferenceClock_GetTime(iface,&rtCur); 325 if ( hr != NOERROR ) 326 goto err; 327 if ( rtCur >= (rtBase+rtStream) ) 328 { 329 SetEvent(hEvent); 330 hr = NOERROR; 331 goto err; 332 } 333 334 pEntry = IReferenceClock_AllocTimerEntry(This); 335 if ( pEntry == NULL ) 336 { 337 hr = E_FAIL; 338 goto err; 339 } 340 341 pEntry->dwAdvCookie = *pdwAdvCookie; 342 pEntry->fPeriodic = FALSE; 343 pEntry->hEvent = hEvent; 344 pEntry->rtStart = rtBase; 345 pEntry->rtInterval = rtStream; 346 347 if ( !PostThreadMessageA( 348 This->m_idThreadTimer, 349 QUARTZ_MSG_ADDTIMER, 350 0, 0 ) ) 351 { 352 pEntry->hEvent = (HANDLE)NULL; 353 hr = E_FAIL; 354 goto err; 355 } 356 357 hr = NOERROR; 358 err: 359 LeaveCriticalSection( &This->m_csClock ); 360 361 return hr; 362 } 363 364 static HRESULT WINAPI 365 IReferenceClock_fnAdvisePeriodic(IReferenceClock* iface,REFERENCE_TIME rtStart,REFERENCE_TIME rtPeriod,HSEMAPHORE hSemaphore,DWORD_PTR* pdwAdvCookie) 366 { 367 CSystemClock_THIS(iface,refclk); 368 QUARTZ_TimerEntry* pEntry; 369 HRESULT hr; 370 371 TRACE( "(%p)->()\n", This ); 372 373 if ( pdwAdvCookie == NULL ) 374 return E_POINTER; 375 if ( hSemaphore == (HSEMAPHORE)NULL ) 376 return E_INVALIDARG; 377 378 EnterCriticalSection( &This->m_csClock ); 379 380 *pdwAdvCookie = (DWORD_PTR)(This->m_dwAdvCookieNext ++); 381 382 pEntry = IReferenceClock_AllocTimerEntry(This); 383 if ( pEntry == NULL ) 384 { 385 hr = E_FAIL; 386 goto err; 387 } 388 389 pEntry->dwAdvCookie = *pdwAdvCookie; 390 pEntry->fPeriodic = TRUE; 391 pEntry->hEvent = (HANDLE)hSemaphore; 392 pEntry->rtStart = rtStart; 393 pEntry->rtInterval = rtPeriod; 394 395 if ( !PostThreadMessageA( 396 This->m_idThreadTimer, 397 QUARTZ_MSG_ADDTIMER, 398 0, 0 ) ) 399 { 400 pEntry->hEvent = (HANDLE)NULL; 401 hr = E_FAIL; 402 goto err; 403 } 404 405 hr = NOERROR; 406 err: 407 LeaveCriticalSection( &This->m_csClock ); 408 409 return hr; 410 } 411 412 static HRESULT WINAPI 413 IReferenceClock_fnUnadvise(IReferenceClock* iface,DWORD_PTR dwAdvCookie) 414 { 415 CSystemClock_THIS(iface,refclk); 416 QUARTZ_TimerEntry* pEntry; 417 418 TRACE( "(%p)->(%lu)\n", This, (DWORD)dwAdvCookie ); 419 420 EnterCriticalSection( &This->m_csClock ); 421 422 pEntry = IReferenceClock_SearchTimer(This,(DWORD)dwAdvCookie); 423 if ( pEntry != NULL ) 424 { 425 pEntry->hEvent = (HANDLE)NULL; 426 } 427 428 LeaveCriticalSection( &This->m_csClock ); 429 430 return NOERROR; 431 } 432 433 static ICOM_VTABLE(IReferenceClock) irefclk = 434 { 435 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE 436 /* IUnknown fields */ 437 IReferenceClock_fnQueryInterface, 438 IReferenceClock_fnAddRef, 439 IReferenceClock_fnRelease, 440 /* IReferenceClock fields */ 441 IReferenceClock_fnGetTime, 442 IReferenceClock_fnAdviseTime, 443 IReferenceClock_fnAdvisePeriodic, 444 IReferenceClock_fnUnadvise, 445 }; 446 447 448 HRESULT CSystemClock_InitIReferenceClock( CSystemClock* psc ) 449 { 450 HANDLE hEvents[2]; 451 452 TRACE("(%p)\n",psc); 453 ICOM_VTBL(&psc->refclk) = &irefclk; 454 455 InitializeCriticalSection( &psc->m_csClock ); 456 psc->m_dwTimeLast = GetTickCount(); 457 psc->m_rtLast = (REFERENCE_TIME)0; 458 psc->m_hThreadTimer = (HANDLE)NULL; 459 psc->m_hEventInit = (HANDLE)NULL; 460 psc->m_idThreadTimer = 0; 461 psc->m_dwAdvCookieNext = 1; 462 ZeroMemory( psc->m_timerEntries, sizeof(psc->m_timerEntries) ); 463 464 psc->m_hEventInit = CreateEventA( NULL, TRUE, FALSE, NULL ); 465 if ( psc->m_hEventInit == (HANDLE)NULL ) 466 goto err; 467 468 psc->m_hThreadTimer = CreateThread( 469 NULL, 0, 470 IReferenceClock_TimerEntry, 471 psc, 0, &psc->m_idThreadTimer ); 472 473 if ( psc->m_hThreadTimer == (HANDLE)NULL ) 474 { 475 CloseHandle( psc->m_hEventInit ); 476 psc->m_hEventInit = (HANDLE)NULL; 477 goto err; 478 } 479 480 hEvents[0] = psc->m_hEventInit; 481 hEvents[1] = psc->m_hThreadTimer; 482 if ( WaitForMultipleObjects( 2, hEvents, FALSE, INFINITE ) 483 != WAIT_OBJECT_0 ) 484 { 485 CloseHandle( psc->m_hEventInit ); 486 psc->m_hEventInit = (HANDLE)NULL; 487 CloseHandle( psc->m_hThreadTimer ); 488 psc->m_hThreadTimer = (HANDLE)NULL; 489 goto err; 490 } 491 492 return NOERROR; 493 494 err: 495 DeleteCriticalSection( &psc->m_csClock ); 496 return E_FAIL; 497 } 498 499 void CSystemClock_UninitIReferenceClock( CSystemClock* psc ) 500 { 501 TRACE("(%p)\n",psc); 502 503 if ( psc->m_hThreadTimer != (HANDLE)NULL ) 504 { 505 if ( PostThreadMessageA( 506 psc->m_idThreadTimer, 507 QUARTZ_MSG_EXITTHREAD, 508 0, 0 ) ) 509 { 510 WaitForSingleObject( psc->m_hThreadTimer, INFINITE ); 511 } 512 CloseHandle( psc->m_hThreadTimer ); 513 psc->m_hThreadTimer = (HANDLE)NULL; 514 } 515 516 DeleteCriticalSection( &psc->m_csClock ); 517 }
Note:
See TracChangeset
for help on using the changeset viewer.