Support sub-pixel in drawing commands and more check
[xy_vsfilter.git] / include / realmedia / rmaengin.h
blobabcf8a54221de8404b7fc408b0b21cd857e69e39
1 /****************************************************************************
2 *
3 * $Id: rmaengin.h 7 2003-05-30 02:18:02Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
6 *
7 * http://www.real.com/devzone
9 * This program contains proprietary
10 * information of Progressive Networks, Inc, and is licensed
11 * subject to restrictions on use and distribution.
14 * RealMedia Architecture Callback, Networking, and Scheduling interfaces.
18 #ifndef _RMAENGIN_H_
19 #define _RMAENGIN_H_
22 * Forward declarations of some interfaces used here-in.
25 typedef _INTERFACE IRMABuffer IRMABuffer;
26 typedef _INTERFACE IRMACallback IRMACallback;
27 typedef _INTERFACE IRMAScheduler IRMAScheduler;
28 typedef _INTERFACE IRMATCPResponse IRMATCPResponse;
29 typedef _INTERFACE IRMALBoundTCPSocket IRMALBoundTCPSocket;
30 typedef _INTERFACE IRMATCPSocket IRMATCPSocket;
31 typedef _INTERFACE IRMAListenResponse IRMAListenResponse;
32 typedef _INTERFACE IRMAListenSocket IRMAListenSocket;
33 typedef _INTERFACE IRMANetworkServices IRMANetworkServices;
34 typedef _INTERFACE IRMANetworkServices2 IRMANetworkServices2;
35 typedef _INTERFACE IRMAUDPResponse IRMAUDPResponse;
36 typedef _INTERFACE IRMAUDPSocket IRMAUDPSocket;
37 typedef _INTERFACE IRMAResolver IRMAResolver;
38 typedef _INTERFACE IRMAResolverResponse IRMAResolverResponse;
39 typedef _INTERFACE IRMAInterruptSafe IRMAInterruptSafe;
40 typedef _INTERFACE IRMAAsyncIOSelection IRMAAsyncIOSelection;
41 typedef _INTERFACE IRMAUDPMulticastInit IRMAUDPMulticastInit;
42 typedef _INTERFACE IRMAInterruptState IRMAInterruptState;
43 typedef _INTERFACE IRMAOptimizedScheduler IRMAOptimizedScheduler;
47 * Address flags starting with PNR are depricated.
49 #define PNR_INADDR_ANY (UINT32)0x00000000 //THIS FLAG IS DEPRICATED
50 #define PN_INADDR_ANY (UINT32)0x00000000
53 * 255.255.255.254
55 * Bind to all ports in IPBindings list from
56 * server config.
58 #define PNR_INADDR_IPBINDINGS (UINT32)0xfffffffe //THIS FLAG IS DEPRICATED
59 #define PN_INADDR_IPBINDINGS (UINT32)0xfffffffe
62 /* Async IO Selection Type (Unix Only) */
64 #define PNAIO_READ 1
65 #define PNAIO_WRITE 2
66 #define PNAIO_EXCEPTION 4
68 /****************************************************************************
70 * Interface:
72 * IRMACallback
74 * Purpose:
76 * This interface defines a simple callback which will be used in
77 * various interfaces such as IRMAScheduler.
79 * IID_IRMACallback:
81 * {00000100-0901-11d1-8B06-00A024406D59}
84 DEFINE_GUID(IID_IRMACallback, 0x00000100, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
85 0xa0, 0x24, 0x40, 0x6d, 0x59);
87 #undef INTERFACE
88 #define INTERFACE IRMACallback
90 DECLARE_INTERFACE_(IRMACallback, IUnknown)
93 * IUnknown methods
95 STDMETHOD(QueryInterface) (THIS_
96 REFIID riid,
97 void** ppvObj) PURE;
99 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
101 STDMETHOD_(ULONG,Release) (THIS) PURE;
104 * IRMACallback methods
107 /************************************************************************
108 * Method:
109 * IRMACallback::Func
110 * Purpose:
111 * This is the function that will be called when a callback is
112 * to be executed.
114 STDMETHOD(Func) (THIS) PURE;
118 /****************************************************************************
120 * Interface:
122 * IRMAScheduler
124 * Purpose:
126 * This interface provides the user with a way of scheduling callbacks
127 * that will be executed at some time in the future.
129 * IID_IRMAScheduler:
131 * {00000101-0901-11d1-8B06-00A024406D59}
134 DEFINE_GUID(IID_IRMAScheduler, 0x00000101, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
135 0xa0, 0x24, 0x40, 0x6d, 0x59);
137 #undef INTERFACE
138 #define INTERFACE IRMAScheduler
140 typedef ULONG32 CallbackHandle;
142 typedef struct _RMATimeval
144 UINT32 tv_sec;
145 UINT32 tv_usec;
146 } RMATimeval;
148 DECLARE_INTERFACE_(IRMAScheduler, IUnknown)
151 * IUnknown methods
153 STDMETHOD(QueryInterface) (THIS_
154 REFIID riid,
155 void** ppvObj) PURE;
157 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
159 STDMETHOD_(ULONG,Release) (THIS) PURE;
162 * IRMAScheduler methods
165 /************************************************************************
166 * Method:
167 * IRMAScheduler::RelativeEnter
168 * Purpose:
169 * Schedule a callback to be executed "ms" milliseconds from now
170 * This function is less percise then AbsoluteEnter and should only
171 * be used when accurate timing is not critical.
173 STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
174 IRMACallback* pCallback,
175 UINT32 ms) PURE;
177 /************************************************************************
178 * Method:
179 * IRMAScheduler::AbsoluteEnter
180 * Purpose:
181 * Schedule a callback to be executed at time "tVal".
183 STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
184 IRMACallback* pCallback,
185 RMATimeval tVal) PURE;
187 /************************************************************************
188 * Method:
189 * IRMAScheduler::Remove
190 * Purpose:
191 * Remove a callback from the scheduler.
193 STDMETHOD(Remove) (THIS_
194 CallbackHandle Handle) PURE;
196 /************************************************************************
197 * Method:
198 * IRMAScheduler::GetCurrentSchedulerTime
199 * Purpose:
200 * Gives the current time (in the timeline of the scheduler).
202 STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE;
206 /****************************************************************************
208 * Interface:
210 * IRMATCPResponse
212 * Purpose:
214 * This is the response interface for the asynchronous TCP networking
215 * interface.
217 * IID_IRMATCPResponse:
219 * {00000102-0901-11d1-8B06-00A024406D59}
222 DEFINE_GUID(IID_IRMATCPResponse, 0x00000102, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
223 0xa0, 0x24, 0x40, 0x6d, 0x59);
225 #undef INTERFACE
226 #define INTERFACE IRMATCPResponse
228 DECLARE_INTERFACE_(IRMATCPResponse, IUnknown)
231 * IUnknown methods
233 STDMETHOD(QueryInterface) (THIS_
234 REFIID riid,
235 void** ppvObj) PURE;
237 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
239 STDMETHOD_(ULONG,Release) (THIS) PURE;
242 * IRMATCPResponse methods
245 /************************************************************************
246 * Method:
247 * IRMATCPResponse::ConnectDone
248 * Purpose:
249 * A Connect operation has been completed or an error has occurred.
251 STDMETHOD(ConnectDone) (THIS_
252 PN_RESULT status) PURE;
254 /************************************************************************
255 * Method:
256 * IRMATCPResponse::ReadDone
257 * Purpose:
258 * A Read operation has been completed or an error has occurred.
259 * The data is returned in the IRMABuffer.
261 STDMETHOD(ReadDone) (THIS_
262 PN_RESULT status,
263 IRMABuffer* pBuffer) PURE;
265 /************************************************************************
266 * Method:
267 * IRMATCPResponse::WriteReady
268 * Purpose:
269 * This is the response method for WantWrite.
270 * If PN_RESULT is ok, then the TCP channel is ok to Write to.
272 STDMETHOD(WriteReady) (THIS_
273 PN_RESULT status) PURE;
275 /************************************************************************
276 * Method:
277 * IRMATCPResponse::Closed
278 * Purpose:
279 * This method is called to inform you that the TCP channel has
280 * been closed by the peer or closed due to error.
282 STDMETHOD(Closed) (THIS_
283 PN_RESULT status) PURE;
287 /****************************************************************************
289 * Interface:
291 * IRMATCPSocket
293 * Purpose:
295 * Provides the user with an asynchronous TCP networking interface.
297 * IID_IRMATCPSocket:
299 * {00000103-0901-11d1-8B06-00A024406D59}
302 DEFINE_GUID(IID_IRMATCPSocket, 0x00000103, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
303 0xa0, 0x24, 0x40, 0x6d, 0x59);
305 #undef INTERFACE
306 #define INTERFACE IRMATCPSocket
308 DECLARE_INTERFACE_(IRMATCPSocket, IUnknown)
311 * IUnknown methods
313 STDMETHOD(QueryInterface) (THIS_
314 REFIID riid,
315 void** ppvObj) PURE;
317 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
319 STDMETHOD_(ULONG,Release) (THIS) PURE;
322 * IRMATCPSocket methods
324 * Network addresses and ports are in native byte order
328 STDMETHOD(Init) (THIS_
329 IRMATCPResponse* /*IN*/ pTCPResponse) PURE;
331 STDMETHOD(SetResponse) (THIS_
332 IRMATCPResponse* pTCPResponse) PURE;
334 STDMETHOD(Bind) (THIS_
335 UINT32 ulLocalAddr,
336 UINT16 nPort) PURE;
339 * pDestination is a string containing host name or dotted-ip notation
341 STDMETHOD(Connect) (THIS_
342 const char* pDestination,
343 UINT16 nPort) PURE;
345 STDMETHOD(Read) (THIS_
346 UINT16 Size) PURE;
348 STDMETHOD(Write) (THIS_
349 IRMABuffer* pBuffer) PURE;
351 /************************************************************************
352 * Method:
353 * IRMATCPSocket::WantWrite
354 * Purpose:
355 * This method is called when you wish to write a large amount of
356 * data. If you are only writing small amounts of data, you can
357 * just call Write (all data not ready to be transmitted will be
358 * buffered on your behalf). When the TCP channel is ready to be
359 * written to, the response interfaces WriteReady method will be
360 * called.
362 STDMETHOD(WantWrite) (THIS) PURE;
364 /************************************************************************
365 * Method:
366 * IRMATCPSocket::GetForeignAddress
367 * Purpose:
368 * Returns the address of the other end of the TCP socket as a
369 * ULONG32 in local host order
371 STDMETHOD(GetForeignAddress) (THIS_
372 REF(ULONG32) lAddress) PURE;
374 STDMETHOD(GetLocalAddress) (THIS_
375 REF(ULONG32) lAddress) PURE;
377 /************************************************************************
378 * Method:
379 * IRMATCPSocket::GetForeignPort
380 * Purpose:
381 * Returns the port of the other end of the TCP socket in local
382 * host order.
384 STDMETHOD(GetForeignPort) (THIS_
385 REF(UINT16) port) PURE;
387 STDMETHOD(GetLocalPort) (THIS_
388 REF(UINT16) port) PURE;
392 /****************************************************************************
394 * Interface:
396 * IRMAListenResponse
398 * Purpose:
400 * This is the response interface for the asynchronous TCP listening
401 * socket interface.
403 * IID_IRMAListenResponse:
405 * {00000104-0901-11d1-8B06-00A024406D59}
408 DEFINE_GUID(IID_IRMAListenResponse, 0x00000104, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
409 0xa0, 0x24, 0x40, 0x6d, 0x59);
411 #undef INTERFACE
412 #define INTERFACE IRMAListenResponse
414 DECLARE_INTERFACE_(IRMAListenResponse, IUnknown)
417 * IUnknown methods
419 STDMETHOD(QueryInterface) (THIS_
420 REFIID riid,
421 void** ppvObj) PURE;
423 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
425 STDMETHOD_(ULONG,Release) (THIS) PURE;
428 * IRMAListenResponse methods
431 STDMETHOD(NewConnection) (THIS_
432 PN_RESULT status,
433 IRMATCPSocket* pTCPSocket) PURE;
436 /****************************************************************************
438 * Interface:
440 * IRMAListenSocket
442 * Purpose:
444 * This interfaces allows you to asynchronously listen on a port for
445 * TCP connections.
447 * IID_IRMAListenSocket:
449 * {00000105-0901-11d1-8B06-00A024406D59}
452 DEFINE_GUID(IID_IRMAListenSocket, 0x00000105, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
453 0xa0, 0x24, 0x40, 0x6d, 0x59);
455 #undef INTERFACE
456 #define INTERFACE IRMAListenSocket
458 DECLARE_INTERFACE_(IRMAListenSocket, IUnknown)
461 * IUnknown methods
463 STDMETHOD(QueryInterface) (THIS_
464 REFIID riid,
465 void** ppvObj) PURE;
467 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
469 STDMETHOD_(ULONG,Release) (THIS) PURE;
472 * IRMAListenSocket methods
475 STDMETHOD(Init) (THIS_
476 UINT32 ulLocalAddr,
477 UINT16 port,
478 IRMAListenResponse* /*IN*/ pListenResponse
479 ) PURE;
483 /****************************************************************************
485 * Interface:
487 * IRMANetworkServices
489 * Purpose:
491 * This is a factory interface for the various types of networking
492 * interfaces described above.
494 * IID_IRMANetworkServices:
496 * {00000106-0901-11d1-8B06-00A024406D59}
499 DEFINE_GUID(IID_IRMANetworkServices, 0x00000106, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
500 0xa0, 0x24, 0x40, 0x6d, 0x59);
502 #undef INTERFACE
503 #define INTERFACE IRMANetworkServices
505 DECLARE_INTERFACE_(IRMANetworkServices, IUnknown)
508 * IUnknown methods
510 STDMETHOD(QueryInterface) (THIS_
511 REFIID riid,
512 void** ppvObj) PURE;
514 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
516 STDMETHOD_(ULONG,Release) (THIS) PURE;
519 * IRMANetworkServices methods
522 /************************************************************************
523 * Method:
524 * IRMANetworkServices::CreateTCPSocket
525 * Purpose:
526 * Create a new TCP socket.
528 STDMETHOD(CreateTCPSocket) (THIS_
529 IRMATCPSocket** /*OUT*/ ppTCPSocket) PURE;
531 /************************************************************************
532 * Method:
533 * IRMANetworkServices::CreateUDPSocket
534 * Purpose:
535 * Create a new UDP socket.
537 STDMETHOD(CreateUDPSocket) (THIS_
538 IRMAUDPSocket** /*OUT*/ ppUDPSocket) PURE;
540 /************************************************************************
541 * Method:
542 * IRMANetworkServices::CreateListenSocket
543 * Purpose:
544 * Create a new TCP socket that will listen for connections on a
545 * particular port.
547 STDMETHOD(CreateListenSocket) (THIS_
548 IRMAListenSocket** /*OUT*/ ppListenSocket
549 ) PURE;
551 /************************************************************************
552 * Method:
553 * IRMANetworkServices::CreateResolver
554 * Purpose:
555 * Create a new resolver that can lookup host names
557 STDMETHOD(CreateResolver) (THIS_
558 IRMAResolver** /*OUT*/ ppResolver) PURE;
562 /****************************************************************************
564 * Interface:
566 * IRMANetworkServices2
568 * Purpose:
570 * This is a factory interface for the various types of networking
571 * interfaces described above.
573 * IID_IRMANetworkServices:
575 * {17951551-5683-11d3-B6BA-00C0F031C237}
579 // {17951551-5683-11d3-B6BA-00C0F031C237}
580 DEFINE_GUID(IID_IRMANetworkServices2, 0x17951551, 0x5683, 0x11d3, 0xb6, 0xba, 0x0, 0xc0, 0xf0, 0x31, 0xc2, 0x37);
582 #undef INTERFACE
583 #define INTERFACE IRMANetworkServices2
585 DECLARE_INTERFACE_(IRMANetworkServices2, IRMANetworkServices)
587 /************************************************************************
588 * Method:
589 * IRMANetworkServices2::CreateLBoundTCPSocket
590 * Purpose:
591 * Create a new local bound TCP socket.
593 STDMETHOD(CreateLBoundTCPSocket) (THIS_
594 IRMATCPSocket** /*OUT*/ ppTCPSocket) PURE;
599 /****************************************************************************
601 * Interface:
603 * IRMAUDPResponse
605 * Purpose:
607 * This is the response interface for the asynchronous UDP networking
608 * interface.
610 * IID_IRMAUDPResponse:
612 * {00000107-0901-11d1-8B06-00A024406D59}
615 DEFINE_GUID(IID_IRMAUDPResponse, 0x00000107, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
616 0xa0, 0x24, 0x40, 0x6d, 0x59);
618 #undef INTERFACE
619 #define INTERFACE IRMAUDPResponse
621 DECLARE_INTERFACE_(IRMAUDPResponse, IUnknown)
624 * IUnknown methods
626 STDMETHOD(QueryInterface) (THIS_
627 REFIID riid,
628 void** ppvObj) PURE;
630 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
632 STDMETHOD_(ULONG,Release) (THIS) PURE;
635 * IRMAUDPResponse methods
638 STDMETHOD(ReadDone) (THIS_
639 PN_RESULT status,
640 IRMABuffer* pBuffer,
641 ULONG32 ulAddr,
642 UINT16 nPort) PURE;
646 /****************************************************************************
648 * Interface:
650 * IRMAUDPSocket
652 * Purpose:
654 * Provides the user with an asynchronous UDP networking interface.
656 * IID_IRMAUDPSocket:
658 * {00000108-0901-11d1-8B06-00A024406D59}
661 DEFINE_GUID(IID_IRMAUDPSocket, 0x00000108, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
662 0xa0, 0x24, 0x40, 0x6d, 0x59);
664 #undef INTERFACE
665 #define INTERFACE IRMAUDPSocket
667 DECLARE_INTERFACE_(IRMAUDPSocket, IUnknown)
670 * IUnknown methods
672 STDMETHOD(QueryInterface) (THIS_
673 REFIID riid,
674 void** ppvObj) PURE;
676 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
678 STDMETHOD_(ULONG,Release) (THIS) PURE;
681 * IRMAUDPSocket methods
683 * Network addresses and ports are in native byte order
686 STDMETHOD(Init) (THIS_
687 ULONG32 ulAddr,
688 UINT16 nPort,
689 IRMAUDPResponse* pUDPResponse) PURE;
691 STDMETHOD(Bind) (THIS_
692 UINT32 ulLocalAddr,
693 UINT16 nPort) PURE;
695 STDMETHOD(Read) (THIS_
696 UINT16 Size) PURE;
698 STDMETHOD(Write) (THIS_
699 IRMABuffer* pBuffer) PURE;
701 STDMETHOD(WriteTo) (THIS_
702 ULONG32 ulAddr,
703 UINT16 nPort,
704 IRMABuffer* pBuffer) PURE;
706 STDMETHOD(GetLocalPort) (THIS_
707 REF(UINT16) port) PURE;
709 STDMETHOD(JoinMulticastGroup) (THIS_
710 ULONG32 ulMulticastAddr,
711 ULONG32 ulInterfaceAddr) PURE;
713 STDMETHOD(LeaveMulticastGroup) (THIS_
714 ULONG32 ulMulticastAddr,
715 ULONG32 ulInterfaceAddr) PURE;
719 /****************************************************************************
721 * Interface:
723 * IRMAResolver
725 * Purpose:
727 * This interface allows you to asynchronously resolve hostnames.
729 * IID_IRMAResolver:
731 * {00000109-0901-11d1-8B06-00A024406D59}
734 DEFINE_GUID(IID_IRMAResolver, 0x00000109, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
735 0xa0, 0x24, 0x40, 0x6d, 0x59);
737 #undef INTERFACE
738 #define INTERFACE IRMAResolver
740 DECLARE_INTERFACE_(IRMAResolver, IUnknown)
743 * IUnknown methods
745 STDMETHOD(QueryInterface) (THIS_
746 REFIID riid,
747 void** ppvObj) PURE;
749 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
751 STDMETHOD_(ULONG,Release) (THIS) PURE;
754 * IRMAResolver methods
757 STDMETHOD(Init) (THIS_
758 IRMAResolverResponse* pResponse) PURE;
760 STDMETHOD(GetHostByName) (THIS_
761 const char* pHostName) PURE;
765 /****************************************************************************
767 * Interface:
769 * IRMAResolverResponse
771 * Purpose:
773 * This is the response interface for the asynchronous DNS hostname
774 * resolver.
776 * IID_IRMAResolverResponse:
778 * {0000010A-0901-11d1-8B06-00A024406D59}
781 DEFINE_GUID(IID_IRMAResolverResponse, 0x0000010A, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
782 0xa0, 0x24, 0x40, 0x6d, 0x59);
784 #undef INTERFACE
785 #define INTERFACE IRMAResolverResponse
787 DECLARE_INTERFACE_(IRMAResolverResponse, IUnknown)
790 * IUnknown methods
792 STDMETHOD(QueryInterface) (THIS_
793 REFIID riid,
794 void** ppvObj) PURE;
796 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
798 STDMETHOD_(ULONG,Release) (THIS) PURE;
801 * IRMAResolverResponse methods
804 STDMETHOD(GetHostByNameDone) (THIS_
805 PN_RESULT status,
806 ULONG32 ulAddr) PURE;
810 /****************************************************************************
812 * Interface:
814 * IRMAInterruptSafe
816 * Purpose:
818 * This interface is used in Macintosh implementations of callback
819 * functions, renderers, etc... to determine if interrupt time execution
820 * is supported. If this interface is not implemented then it is assumed
821 * that interrupt time execution is NOT supported. There are restrictions
822 * on what may be executed at interrupt time; please consult the Macintosh
823 * Deferred Task Manager tech notes from Apple.
825 * IID_IRMAInterruptSafe:
827 * {0000010B-0901-11d1-8B06-00A024406D59}
830 DEFINE_GUID(IID_IRMAInterruptSafe, 0x0000010B, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
831 0xa0, 0x24, 0x40, 0x6d, 0x59);
833 #undef INTERFACE
834 #define INTERFACE IRMAInterruptSafe
836 DECLARE_INTERFACE_(IRMAInterruptSafe, IUnknown)
839 * IUnknown methods
841 STDMETHOD(QueryInterface) (THIS_
842 REFIID riid,
843 void** ppvObj) PURE;
845 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
847 STDMETHOD_(ULONG,Release) (THIS) PURE;
850 * IRMAInterruptSafe methods
853 /************************************************************************
854 * Method:
855 * IRMAInterruptSafe::IsInterruptSafe
856 * Purpose:
857 * This is the function that will be called to determine if
858 * interrupt time execution is supported.
860 STDMETHOD_(BOOL,IsInterruptSafe) (THIS) PURE;
864 /****************************************************************************
866 * Interface:
868 * IRMAAsyncIOSelection
870 * Purpose:
872 * This interface is implemented by the server/player context on Unix
873 * platforms. This interface allows your plugin to get callbacks based
874 * I/O events that are normally handled by select(). This interface
875 * allows you to setup callbacks which will be executed when a file
876 * descriptor is ready for reading, writing, or has an exception.
878 * IID_IRMAAsyncIOSelection:
880 * {0000010C-0901-11d1-8B06-00A024406D59}
883 DEFINE_GUID(IID_IRMAAsyncIOSelection, 0x0000010C, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
884 0xa0, 0x24, 0x40, 0x6d, 0x59);
886 #undef INTERFACE
887 #define INTERFACE IRMAAsyncIOSelection
889 DECLARE_INTERFACE_(IRMAAsyncIOSelection, IUnknown)
892 * IUnknown methods
894 STDMETHOD(QueryInterface) (THIS_
895 REFIID riid,
896 void** ppvObj) PURE;
898 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
900 STDMETHOD_(ULONG,Release) (THIS) PURE;
903 * IRMAAsyncIOSelection methods
906 /************************************************************************
907 * Method:
908 * IRMAAsyncIOSelection::Add
909 * Purpose:
910 * This function will allow you to receive a callback when the
911 * given descriptor is ready for read, write, or has an
912 * exception. This function is only available on Unix, and is
913 * intended to replace the functionality of select().
915 STDMETHOD(Add) (THIS_
916 IRMACallback* pCallback,
917 INT32 lFileDescriptor,
918 UINT32 ulType) PURE;
920 /************************************************************************
921 * Method:
922 * IRMAAsyncIOSelection::Remove
923 * Purpose:
924 * This function will allow you remove the callback associated
925 * with the given descriptor from the event handler.
926 * This function is only available on Unix, and is intended to
927 * replace the functionality of select().
929 STDMETHOD(Remove) (THIS_
930 INT32 lFileDescriptor,
931 UINT32 ulType) PURE;
935 /****************************************************************************
937 * Interface:
939 * IRMAUDPMulticastInit
941 * Purpose:
943 * Provides the user with a way to set the TTL for outgoing multicast
944 * UDP packets. Usually shared with IRMAUDPSocket.
946 * IID_IRMAUDPMulticastInit:
948 * {0000010D-0901-11d1-8B06-00A024406D59}
951 DEFINE_GUID(IID_IRMAUDPMulticastInit, 0x0000010D, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
952 0xa0, 0x24, 0x40, 0x6d, 0x59);
954 #undef INTERFACE
955 #define INTERFACE IRMAUDPMulticastInit
957 DECLARE_INTERFACE_(IRMAUDPMulticastInit, IUnknown)
960 * IUnknown methods
962 STDMETHOD(QueryInterface) (THIS_
963 REFIID riid,
964 void** ppvObj) PURE;
966 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
968 STDMETHOD_(ULONG,Release) (THIS) PURE;
971 * IRMAUDPMulticastInit methods
975 /************************************************************************
976 * Method:
977 * IRMAUDPMulticastInit::InitMulticast
978 * Purpose:
979 * This function will set the TTL (time to live) for the UDP socket
980 * so it can be used as a multicast socket, sending packets across
981 * the number of routers specified in the ulTTL parameter.
984 STDMETHOD(InitMulticast) (THIS_
985 UINT8 chTTL) PURE;
988 /****************************************************************************
990 * Interface:
992 * IRMAInterruptState
994 * Purpose:
996 * This interface is used in Macintosh implementations to inform the
997 * the client engine when entering & leaving an interupt task. It is
998 * also used to determine if it is currently at interrupt time.
999 * Please consult the Macintosh Deferred Task Manager tech notes from Apple
1000 * for information on interrupt tasks.
1002 * IID_IRMAInterruptState:
1004 * {0000010E-0901-11d1-8B06-00A024406D59}
1007 DEFINE_GUID(IID_IRMAInterruptState, 0x0000010E, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1008 0xa0, 0x24, 0x40, 0x6d, 0x59);
1010 #undef INTERFACE
1011 #define INTERFACE IRMAInterruptState
1013 DECLARE_INTERFACE_(IRMAInterruptState, IUnknown)
1016 * IUnknown methods
1018 STDMETHOD(QueryInterface) (THIS_
1019 REFIID riid,
1020 void** ppvObj) PURE;
1022 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1024 STDMETHOD_(ULONG,Release) (THIS) PURE;
1027 * IRMAInterruptState methods
1030 /************************************************************************
1031 * Method:
1032 * IRMAInterruptState::AtInterruptTime
1033 * Purpose:
1034 * This function is called to determine if we are currently at
1035 * interrupt task time.
1037 STDMETHOD_(BOOL,AtInterruptTime) (THIS) PURE;
1039 /************************************************************************
1040 * Method:
1041 * IRMAInterruptState::EnterInterruptState
1042 * Purpose:
1043 * This function is called when starting a deferred/interrupt task
1045 STDMETHOD(EnterInterruptState) (THIS) PURE;
1047 /************************************************************************
1048 * Method:
1049 * IRMAInterruptState::LeaveInterruptState
1050 * Purpose:
1051 * This function is called when leaving a deferred/interrupt task
1053 STDMETHOD(LeaveInterruptState) (THIS) PURE;
1055 /************************************************************************
1056 * Method:
1057 * IRMAInterruptState::EnableInterrupt
1058 * Purpose:
1059 * This function can be called to enable/disable interrupt time
1060 * processsing
1062 STDMETHOD(EnableInterrupt) (THIS_
1063 BOOL bEnable) PURE;
1065 /************************************************************************
1066 * Method:
1067 * IRMAInterruptState::IsInterruptEnabled
1068 * Purpose:
1069 * This function can be called to find if the core is currently
1070 * interrupt enabled.
1072 STDMETHOD_(BOOL, IsInterruptEnabled) (THIS) PURE;
1076 /****************************************************************************
1078 * Interface:
1080 * IRMAOptimizedScheduler
1082 * Purpose:
1084 * This interface provides the user with a way of scheduling callbacks
1085 * that will be executed at some time in the future.
1087 * This interface should ONLY be used if you need accurately timed
1088 * callbacks. These callbacks should be efficient and should not consume
1089 * much time/CPU. This is not a thread safe interface. The user has to
1090 * take care of synchronization in their callbacks.
1092 * IID_IRMAOptimizedScheduler:
1094 * {0000010F-0901-11d1-8B06-00A024406D59}
1097 DEFINE_GUID(IID_IRMAOptimizedScheduler, 0x0000010F, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1098 0xa0, 0x24, 0x40, 0x6d, 0x59);
1100 #undef INTERFACE
1101 #define INTERFACE IRMAOptimizedScheduler
1103 DECLARE_INTERFACE_(IRMAOptimizedScheduler, IUnknown)
1106 * IUnknown methods
1108 STDMETHOD(QueryInterface) (THIS_
1109 REFIID riid,
1110 void** ppvObj) PURE;
1112 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1114 STDMETHOD_(ULONG,Release) (THIS) PURE;
1117 * IRMAOptimizedScheduler methods
1120 /************************************************************************
1121 * Method:
1122 * IRMAOptimizedScheduler::RelativeEnter
1123 * Purpose:
1124 * Schedule a callback to be executed "ms" milliseconds from now
1125 * This function is less percise then AbsoluteEnter and should only
1126 * be used when accurate timing is not critical.
1128 STDMETHOD_(CallbackHandle,RelativeEnter) (THIS_
1129 IRMACallback* pCallback,
1130 UINT32 ms) PURE;
1132 /************************************************************************
1133 * Method:
1134 * IRMAOptimizedScheduler::AbsoluteEnter
1135 * Purpose:
1136 * Schedule a callback to be executed at time "tVal".
1138 STDMETHOD_(CallbackHandle,AbsoluteEnter) (THIS_
1139 IRMACallback* pCallback,
1140 RMATimeval tVal) PURE;
1142 /************************************************************************
1143 * Method:
1144 * IRMAOptimizedScheduler::Remove
1145 * Purpose:
1146 * Remove a callback from the scheduler.
1148 STDMETHOD(Remove) (THIS_
1149 CallbackHandle Handle) PURE;
1151 /************************************************************************
1152 * Method:
1153 * IRMAOptimizedScheduler::GetCurrentSchedulerTime
1154 * Purpose:
1155 * Gives the current time (in the timeline of the scheduler).
1157 STDMETHOD_(RMATimeval,GetCurrentSchedulerTime) (THIS) PURE;
1161 /****************************************************************************
1163 * Interface:
1165 * IRMALoadBalancedListen
1167 * Purpose:
1169 * This interface is queried off of IRMAListenSocket. It allows
1170 * a plugin to specify that it wants the server to load balance
1171 * multiple instances of itself. The server will instantiate multiple
1172 * instances of the plugin as needed based on socket / descriptor limits.
1173 * Each plugin instance should attempt to listen on the same port as
1174 * other instances (they will share the port).
1176 * IID_IRMALoadBalancedListen:
1178 * {00000110-0901-11d1-8B06-00A024406D59}
1181 DEFINE_GUID(IID_IRMALoadBalancedListen, 0x00000110, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1182 0xa0, 0x24, 0x40, 0x6d, 0x59);
1184 #undef INTERFACE
1185 #define INTERFACE IRMALoadBalancedListen
1187 DECLARE_INTERFACE_(IRMALoadBalancedListen, IUnknown)
1190 * IUnknown methods
1192 STDMETHOD(QueryInterface) (THIS_
1193 REFIID riid,
1194 void** ppvObj) PURE;
1196 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1198 STDMETHOD_(ULONG,Release) (THIS) PURE;
1201 * IRMALoadBalancedListen methods
1204 /************************************************************************
1205 * Method:
1206 * IRMALoadBalancedListen::SetID
1207 * Purpose:
1208 * This function set's the unique ID for this listen socket. This
1209 * ID is used to determine whether or not different instances of
1210 * a plugin trying to listen on a single port are actually the
1211 * same plugin. Without this function, it would be possible for
1212 * two completely different plugins to listen on the same port using
1213 * the load balanced listener.
1215 STDMETHOD(SetID) (THIS_
1216 REFIID ID) PURE;
1218 /************************************************************************
1219 * Method:
1220 * IRMALoadBalancedListen::SetReserveLimit
1221 * Purpose:
1222 * Sets the reserve limit for descriptors / sockets. If less
1223 * than reserve limit descriptors / sockets are left then a new
1224 * instance of the plugin will be created.
1226 STDMETHOD(SetReserveLimit) (THIS_
1227 UINT32 ulDescriptors,
1228 UINT32 ulSockets) PURE;
1232 /****************************************************************************
1234 * Interface:
1236 * IRMAOverrideDefaultServices
1238 * Purpose:
1240 * This interface is queried off of the context. It allows
1241 * a plugin to override any default services provided by the G2 system.
1242 * Currently, it is supported only on the client side.
1243 * You may currently override IRMANetworkServices using this interface
1244 * You can use the same interface to later restore back the overriden services.
1245 * This is done by calling the same OverrideServices() function with the
1246 * original service QIed before the initial override.
1248 * IID_IRMAOverrideDefaultServices:
1250 * {00000111-0901-11d1-8B06-00A024406D59}
1253 DEFINE_GUID(IID_IRMAOverrideDefaultServices, 0x00000111, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1254 0xa0, 0x24, 0x40, 0x6d, 0x59);
1256 #undef INTERFACE
1257 #define INTERFACE IRMAOverrideDefaultServices
1259 DECLARE_INTERFACE_(IRMAOverrideDefaultServices, IUnknown)
1262 * IUnknown methods
1264 STDMETHOD(QueryInterface) (THIS_
1265 REFIID riid,
1266 void** ppvObj) PURE;
1268 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1270 STDMETHOD_(ULONG,Release) (THIS) PURE;
1273 * IRMAOverrideDefaultServices methods
1276 /************************************************************************
1277 * Method:
1278 * IRMAOverrideDefaultServices::OverrideServices
1279 * Purpose:
1280 * Override default services provided by the G2 system.
1283 STDMETHOD(OverrideServices) (THIS_
1284 IUnknown* pContext) PURE;
1287 enum PN_SOCKET_OPTION
1289 PN_SOCKOPT_REUSE_ADDR,
1290 PN_SOCKOPT_REUSE_PORT,
1291 PN_SOCKOPT_BROADCAST,
1292 PN_SOCKOPT_SET_RECVBUF_SIZE,
1293 PN_SOCKOPT_SET_SENDBUF_SIZE
1296 /****************************************************************************
1298 * Interface:
1300 * IRMASetSocketOption
1302 * Purpose:
1304 * Set sockt option
1306 * IID_IRMASetSocketOption:
1308 * IID_IRMASetSocketOption: {00000114-0901-11d1-8B06-00A024406D59}
1311 DEFINE_GUID(IID_IRMASetSocketOption,
1312 0x00000114, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
1314 #undef INTERFACE
1315 #define INTERFACE IRMASetSocketOption
1316 DECLARE_INTERFACE_(IRMASetSocketOption, IUnknown)
1319 * IUnknown methods
1321 STDMETHOD(QueryInterface) (THIS_
1322 REFIID riid,
1323 void** ppvObj) PURE;
1325 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1327 STDMETHOD_(ULONG,Release) (THIS) PURE;
1330 * IRMAListenSocket methods
1333 STDMETHOD(SetOption) (THIS_
1334 PN_SOCKET_OPTION option,
1335 UINT32 ulValue) PURE;
1338 #define RMA_THREADSAFE_METHOD_FF_GETPACKET 0x00000001
1340 * FileFormat::GetPacket() only calls:
1341 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1342 * FS->Read(), FS->Close(), FS->Seek(),
1343 * FFR->PacketReady(), FFR->StreamDone()
1344 * Context->Scheduler->*,
1345 * CCF->CI(Mutex), Mutex->*
1346 * Context->ErrorMessages
1348 * XXXSMPNOW
1351 #define RMA_THREADSAFE_METHOD_FS_READ 0x00000002
1353 * FileSystem::Read()/Seek()/Close() only calls:
1354 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1355 * FS->Read(), FS->Close(), FS->Seek(),
1356 * Context->Scheduler->*,
1357 * CCF->CI(Mutex), Mutex->*
1358 * Context->ErrorMessages
1360 * XXXSMPNOW
1362 #define RMA_THREADSAFE_METHOD_FSR_READDONE 0x00000004
1364 * FileFormat::ReadDone()/SeekDone()/CloseDone() only calls:
1365 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1366 * FS->Read(), FS->Close(), FS->Seek(),
1367 * FFR->PacketReady(), FFR->StreamDone()
1368 * Context->Scheduler->*,
1369 * CCF->CI(Mutex), Mutex->*
1370 * Context->ErrorMessages
1372 * XXXSMPNOW
1374 #define RMA_THREADSAFE_METHOD_CACHE_FILE 0x00000008
1376 * FileSystem::Read()/Seek()/Close() only calls:
1377 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1378 * FS->Read(), FS->Close(), FS->Seek(),
1379 * IRMACacheFile->*, IRMACacheFileResponse->*,
1380 * Context->Scheduler->*,
1381 * CCF->CI(Mutex), Mutex->*
1382 * Context->ErrorMessages
1384 * XXXSMPNOW
1386 #define RMA_THREADSAFE_METHOD_CACHE_FILE_RESPONSE 0x00000010
1388 * FileSystem::Read()/Seek()/Close() only calls:
1389 * CCF->CI(Buffer), CCF->CI(Packet), CCF->CI(Values), *Alloc, *Free,
1390 * FS->Read(), FS->Close(), FS->Seek(),
1391 * IRMACacheFile->*, IRMACacheFileResponse->*,
1392 * Context->Scheduler->*,
1393 * CCF->CI(Mutex), Mutex->*
1394 * Context->ErrorMessages
1396 * XXXSMPNOW
1399 /****************************************************************************
1401 * Interface:
1403 * IRMAThreadSafeMethods
1405 * Purpose:
1407 * XXXSMPNOW
1409 * IID_IRMAThreadSafeMethods:
1411 * {00000115-0901-11d1-8B06-00A024406D59}
1414 DEFINE_GUID(IID_IRMAThreadSafeMethods, 0x00000115, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1415 0xa0, 0x24, 0x40, 0x6d, 0x59);
1417 #undef INTERFACE
1418 #define INTERFACE IRMAThreadSafeMethods
1420 DECLARE_INTERFACE_(IRMAThreadSafeMethods, IUnknown)
1423 * IUnknown methods
1425 STDMETHOD(QueryInterface) (THIS_
1426 REFIID riid,
1427 void** ppvObj) PURE;
1429 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1431 STDMETHOD_(ULONG,Release) (THIS) PURE;
1434 * IRMAThreadSafeMethods methods
1437 /************************************************************************
1438 * Method:
1439 * IRMAThreadSafeMethods::IsThreadSafe
1440 * Purpose:
1441 * XXXSMPNOW
1443 STDMETHOD_(UINT32,IsThreadSafe) (THIS) PURE;
1447 /****************************************************************************
1449 * Interface:
1451 * IRMAMutex
1453 * Purpose:
1455 * XXXSMPNOW
1457 * IID_IRMAMutex:
1459 * {00000116-0901-11d1-8B06-00A024406D59}
1462 DEFINE_GUID(IID_IRMAMutex, 0x00000116, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
1463 0xa0, 0x24, 0x40, 0x6d, 0x59);
1465 #undef INTERFACE
1466 #define INTERFACE IRMAMutex
1469 * The IRMACommonClassFactory supports creating an instance
1470 * of this object.
1472 #define CLSID_IRMAMutex IID_IRMAMutex
1474 DECLARE_INTERFACE_(IRMAMutex, IUnknown)
1477 * IUnknown methods
1479 STDMETHOD(QueryInterface) (THIS_
1480 REFIID riid,
1481 void** ppvObj) PURE;
1483 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
1485 STDMETHOD_(ULONG,Release) (THIS) PURE;
1488 * IRMAMutex methods
1491 /* XXXSMPNOW Comments */
1492 STDMETHOD(Lock) (THIS) PURE;
1494 STDMETHOD(TryLock) (THIS) PURE;
1496 STDMETHOD(Unlock) (THIS) PURE;
1500 #endif /* _RMAENGIN_H_ */