Support sub-pixel in drawing commands and more check
[xy_vsfilter.git] / include / realmedia / rmacore.h
blob8461dafba835a3556c6c960338743d127de8be1d
1 /****************************************************************************
2 *
3 * $Id: rmacore.h 74 2003-07-02 02:42:47Z gabest $
5 * Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
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 * Client Core interfaces
18 #ifndef _RMACORE_H_
19 #define _RMACORE_H_
23 * Forward declarations of some interfaces defined or used here-in.
25 typedef _INTERFACE IUnknown IUnknown;
26 typedef _INTERFACE IRMAStream IRMAStream;
27 typedef _INTERFACE IRMAStreamSource IRMAStreamSource;
28 typedef _INTERFACE IRMAPlayer IRMAPlayer;
29 typedef _INTERFACE IRMAClientEngine IRMAClientEngine;
30 typedef _INTERFACE IRMAScheduler IRMAScheduler;
31 typedef _INTERFACE IRMAClientAdviseSink IRMAClientAdviseSink;
32 typedef _INTERFACE IRMAValues IRMAValues;
33 typedef _INTERFACE IRMABuffer IRMABuffer;
34 typedef _INTERFACE IRMAPacket IRMAPacket;
35 typedef _INTERFACE IRMARenderer IRMARenderer;
36 typedef _INTERFACE IRMAPlayer2 IRMAPlayer2;
37 typedef _INTERFACE IRMARequest IRMArequest;
39 typedef struct _PNxEvent PNxEvent;
42 #ifdef _MACINTOSH
43 #pragma export on
44 #endif
46 #if defined _UNIX && !(defined _VXWORKS)
47 /* Includes needed for select() stuff */
48 #include <sys/time.h>
49 #include <sys/types.h>
50 #include <unistd.h>
51 #endif
53 #ifdef _BEOS // fd_set stuff
54 #include <net/socket.h>
55 #endif
57 /* Used in renderer and advise sink interface */
58 enum BUFFERING_REASON
60 BUFFERING_START_UP = 0,
61 BUFFERING_SEEK,
62 BUFFERING_CONGESTION,
63 BUFFERING_LIVE_PAUSE
66 /****************************************************************************
68 * Function:
70 * CreateEngine()
72 * Purpose:
74 * Function implemented by the RMA core to return a pointer to the
75 * client engine. This function would be run by top level clients.
77 STDAPI CreateEngine
79 IRMAClientEngine** /*OUT*/ ppEngine
82 /****************************************************************************
84 * Function:
86 * CloseEngine()
88 * Purpose:
90 * Function implemented by the RMA core to close the engine which
91 * was returned in CreateEngine().
93 STDAPI CloseEngine
95 IRMAClientEngine* /*IN*/ pEngine
98 #ifdef _MACINTOSH
99 #pragma export off
100 #endif
103 * Definitions of Function Pointers to CreateEngine() and Close Engine().
104 * These types are provided as a convenince to authors of top level clients.
106 typedef PN_RESULT (PNEXPORT_PTR FPRMCREATEENGINE)(IRMAClientEngine** ppEngine);
107 typedef PN_RESULT (PNEXPORT_PTR FPRMCLOSEENGINE) (IRMAClientEngine* pEngine);
108 typedef PN_RESULT (PNEXPORT_PTR FPRMSETDLLACCESSPATH) (const char*);
110 /****************************************************************************
112 * Interface:
114 * IRMAStream
116 * Purpose:
118 * Interface provided by the client engine to the renderers. This
119 * interface allows access to stream related information and properties.
121 * IID_IRMAStream:
123 * {00000400-0901-11d1-8B06-00A024406D59}
126 DEFINE_GUID(IID_IRMAStream, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
127 0xa0, 0x24, 0x40, 0x6d, 0x59);
129 #undef INTERFACE
130 #define INTERFACE IRMAStream
132 DECLARE_INTERFACE_(IRMAStream, IUnknown)
135 * IUnknown methods
137 STDMETHOD(QueryInterface) (THIS_
138 REFIID riid,
139 void** ppvObj) PURE;
141 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
143 STDMETHOD_(ULONG,Release) (THIS) PURE;
146 * IRMAStream methods
149 /************************************************************************
150 * Method:
151 * IRMAStream::GetSource
152 * Purpose:
153 * Get the interface to the source object of which the stream is
154 * a part of.
157 STDMETHOD(GetSource) (THIS_
158 REF(IRMAStreamSource*) pSource) PURE;
160 /************************************************************************
161 * Method:
162 * IRMAStream::GetStreamNumber
163 * Purpose:
164 * Get the stream number for this stream relative to the source
165 * object of which the stream is a part of.
168 STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE;
170 /************************************************************************
171 * Method:
172 * IRMAStream::GetStreamType
173 * Purpose:
174 * Get the MIME type for this stream. NOTE: The returned string is
175 * assumed to be valid for the life of the IRMAStream from which it
176 * was returned.
179 STDMETHOD_(const char*,GetStreamType) (THIS) PURE;
181 /************************************************************************
182 * Method:
183 * IRMAStream::GetHeader
184 * Purpose:
185 * Get the header for this stream.
188 STDMETHOD_(IRMAValues*,GetHeader) (THIS) PURE;
190 /************************************************************************
191 * Method:
192 * IRMAStream::ReportQualityOfService
193 * Purpose:
194 * Call this method to report to the playback context that the
195 * quality of service for this stream has changed. The unQuality
196 * should be on a scale of 0 to 100, where 100 is the best possible
197 * quality for this stream. Although the transport engine can
198 * determine lost packets and report these through the user
199 * interface, only the renderer of this stream can determine the
200 * "real" perceived damage associated with this loss.
202 * NOTE: The playback context may use this value to indicate loss
203 * in quality to the user interface. When the effects of a lost
204 * packet are eliminated the renderer should call this method with
205 * a unQuality of 100.
208 STDMETHOD(ReportQualityOfService) (THIS_
209 UINT8 unQuality) PURE;
211 /************************************************************************
212 * Method:
213 * IRMAStream::ReportRebufferStatus
214 * Purpose:
215 * Call this method to report to the playback context that the
216 * available data has dropped to a critically low level, and that
217 * rebuffering should occur. The renderer should call back into this
218 * interface as it receives additional data packets to indicate the
219 * status of its rebuffering effort.
221 * NOTE: The values of unNeeded and unAvailable are used to indicate
222 * the general status of the rebuffering effort. For example, if a
223 * renderer has "run dry" and needs 5 data packets to play smoothly
224 * again, it should call ReportRebufferStatus() with 5,0 then as
225 * packet arrive it should call again with 5,1; 5,2... and eventually
226 * 5,5.
229 STDMETHOD(ReportRebufferStatus) (THIS_
230 UINT8 unNeeded,
231 UINT8 unAvailable) PURE;
233 /************************************************************************
234 * Method:
235 * IRMAStream::SetGranularity
236 * Purpose:
237 * Sets the desired Granularity for this stream. The actual
238 * granularity will be the lowest granularity of all streams.
239 * Valid to call before stream actually begins. Best to call during
240 * IRMARenderer::OnHeader().
242 STDMETHOD(SetGranularity) (THIS_
243 ULONG32 ulGranularity) PURE;
245 /************************************************************************
246 * Method:
247 * IRMAStream::GetRendererCount
248 * Purpose:
249 * Returns the current number of renderer instances supported by
250 * this stream instance.
252 STDMETHOD_(UINT16, GetRendererCount)(THIS) PURE;
254 /************************************************************************
255 * Method:
256 * IRMAStream::GetRenderer
257 * Purpose:
258 * Returns the Nth renderer instance supported by this stream.
260 STDMETHOD(GetRenderer) (THIS_
261 UINT16 nIndex,
262 REF(IUnknown*) pUnknown) PURE;
266 /****************************************************************************
268 * Interface:
270 * IRMAStreamSource
272 * Purpose:
274 * Interface provided by the client engine to the renderers. This
275 * interface allows access to source related information and properties.
277 * IID_IRMAStreamSource:
279 * {00000401-0901-11d1-8B06-00A024406D59}
282 DEFINE_GUID(IID_IRMAStreamSource, 0x00000401, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
283 0xa0, 0x24, 0x40, 0x6d, 0x59);
285 #undef INTERFACE
286 #define INTERFACE IRMAStreamSource
288 DECLARE_INTERFACE_(IRMAStreamSource, IUnknown)
291 * IUnknown methods
293 STDMETHOD(QueryInterface) (THIS_
294 REFIID riid,
295 void** ppvObj) PURE;
297 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
299 STDMETHOD_(ULONG,Release) (THIS) PURE;
302 * IRMAStreamSource methods
305 /************************************************************************
306 * Method:
307 * IRMAStreamSource::IsLive
308 * Purpose:
309 * Ask the source whether it is live
312 STDMETHOD_ (BOOL,IsLive) (THIS) PURE;
314 /************************************************************************
315 * Method:
316 * IRMAStreamSource::GetPlayer
317 * Purpose:
318 * Get the interface to the player object of which the source is
319 * a part of.
322 STDMETHOD(GetPlayer) (THIS_
323 REF(IRMAPlayer*) pPlayer) PURE;
325 /************************************************************************
326 * Method:
327 * IRMAStreamSource::GetURL
328 * Purpose:
329 * Get the URL for this source. NOTE: The returned string is
330 * assumed to be valid for the life of the IRMAStreamSource from which
331 * it was returned.
334 STDMETHOD_(const char*,GetURL) (THIS) PURE;
336 /************************************************************************
337 * Method:
338 * IRMAStreamSource::GetStreamCount
339 * Purpose:
340 * Returns the current number of stream instances supported by
341 * this source instance.
343 STDMETHOD_(UINT16, GetStreamCount)(THIS) PURE;
345 /************************************************************************
346 * Method:
347 * IRMAStreamSource::GetStream
348 * Purpose:
349 * Returns the Nth stream instance supported by this source.
351 STDMETHOD(GetStream) (THIS_
352 UINT16 nIndex,
353 REF(IUnknown*) pUnknown) PURE;
357 /****************************************************************************
359 * Interface:
361 * IRMAPlayer
363 * Purpose:
365 * Interface provided by the client engine to the renderers. This
366 * interface allows access to player related information, properties,
367 * and operations.
369 * IID_IRMAPlayer:
371 * {00000402-0901-11d1-8B06-00A024406D59}
374 DEFINE_GUID(IID_IRMAPlayer, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
375 0xa0, 0x24, 0x40, 0x6d, 0x59);
377 #undef INTERFACE
378 #define INTERFACE IRMAPlayer
380 DECLARE_INTERFACE_(IRMAPlayer, IUnknown)
383 * IUnknown methods
385 STDMETHOD(QueryInterface) (THIS_
386 REFIID riid,
387 void** ppvObj) PURE;
389 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
391 STDMETHOD_(ULONG,Release) (THIS) PURE;
394 * IRMAPlayer methods
397 /************************************************************************
398 * Method:
399 * IRMAPlayer::GetClientEngine
400 * Purpose:
401 * Get the interface to the client engine object of which the
402 * player is a part of.
405 STDMETHOD(GetClientEngine) (THIS_
406 REF(IRMAClientEngine*) pEngine) PURE;
408 /************************************************************************
409 * Method:
410 * IRMAPlayer::IsDone
411 * Purpose:
412 * Ask the player if it is done with the current presentation
415 STDMETHOD_(BOOL,IsDone) (THIS) PURE;
417 /************************************************************************
418 * Method:
419 * IRMAPlayer::IsLive
420 * Purpose:
421 * Ask the player whether it contains the live source
424 STDMETHOD_(BOOL,IsLive) (THIS) PURE;
426 /************************************************************************
427 * Method:
428 * IRMAPlayer::GetCurrentPlayTime
429 * Purpose:
430 * Get the current time on the Player timeline
433 STDMETHOD_(ULONG32,GetCurrentPlayTime) (THIS) PURE;
435 /************************************************************************
436 * Method:
437 * IRMAPlayer::OpenURL
438 * Purpose:
439 * Tell the player to begin playback of all its sources.
442 STDMETHOD(OpenURL) (THIS_
443 const char* pURL) PURE;
445 /************************************************************************
446 * Method:
447 * IRMAPlayer::Begin
448 * Purpose:
449 * Tell the player to begin playback of all its sources.
452 STDMETHOD(Begin) (THIS) PURE;
454 /************************************************************************
455 * Method:
456 * IRMAPlayer::Stop
457 * Purpose:
458 * Tell the player to stop playback of all its sources.
461 STDMETHOD(Stop) (THIS) PURE;
463 /************************************************************************
464 * Method:
465 * IRMAPlayer::Pause
466 * Purpose:
467 * Tell the player to pause playback of all its sources.
470 STDMETHOD(Pause) (THIS) PURE;
472 /************************************************************************
473 * Method:
474 * IRMAPlayer::Seek
475 * Purpose:
476 * Tell the player to seek in the playback timeline of all its
477 * sources.
480 STDMETHOD(Seek) (THIS_
481 ULONG32 ulTime) PURE;
483 /************************************************************************
484 * Method:
485 * IRMAPlayer::GetSourceCount
486 * Purpose:
487 * Returns the current number of source instances supported by
488 * this player instance.
490 STDMETHOD_(UINT16, GetSourceCount)(THIS) PURE;
492 /************************************************************************
493 * Method:
494 * IRMAPlayer::GetSource
495 * Purpose:
496 * Returns the Nth source instance supported by this player.
498 STDMETHOD(GetSource) (THIS_
499 UINT16 nIndex,
500 REF(IUnknown*) pUnknown) PURE;
502 /************************************************************************
503 * Method:
504 * IRMAPlayer::SetClientContext
505 * Purpose:
506 * Called by the client to install itself as the provider of client
507 * services to the core. This is traditionally called by the top
508 * level client application.
510 STDMETHOD(SetClientContext) (THIS_
511 IUnknown* pUnknown) PURE;
513 /************************************************************************
514 * Method:
515 * IRMAPlayer::GetClientContext
516 * Purpose:
517 * Called to get the client context for this player. This is
518 * set by the top level client application.
520 STDMETHOD(GetClientContext) (THIS_
521 REF(IUnknown*) pUnknown) PURE;
523 /************************************************************************
524 * Method:
525 * IRMAPlayer::AddAdviseSink
526 * Purpose:
527 * Call this method to add a client advise sink.
530 STDMETHOD(AddAdviseSink) (THIS_
531 IRMAClientAdviseSink* pAdviseSink) PURE;
533 /************************************************************************
534 * Method:
535 * IRMAPlayer::RemoveAdviseSink
536 * Purpose:
537 * Call this method to remove a client advise sink.
539 STDMETHOD(RemoveAdviseSink) (THIS_
540 IRMAClientAdviseSink* pAdviseSink) PURE;
544 /****************************************************************************
546 * Interface:
548 * IRMAClientEngine
550 * Purpose:
552 * Interface to the basic client engine. Provided to the renderers and
553 * other client side components.
555 * IID_IRMAClientEngine:
557 * {00000403-0901-11d1-8B06-00A024406D59}
559 DEFINE_GUID(IID_IRMAClientEngine, 0x00000403, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
560 0xa0, 0x24, 0x40, 0x6d, 0x59);
562 #undef INTERFACE
563 #define INTERFACE IRMAClientEngine
565 DECLARE_INTERFACE_(IRMAClientEngine, IUnknown)
568 * IUnknown methods
570 STDMETHOD(QueryInterface) (THIS_
571 REFIID riid,
572 void** ppvObj) PURE;
574 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
576 STDMETHOD_(ULONG,Release) (THIS) PURE;
579 * IRMAClientEngine methods
582 /************************************************************************
583 * Method:
584 * IRMAClientEngine::CreatePlayer
585 * Purpose:
586 * Creates a new IRMAPlayer instance.
589 STDMETHOD(CreatePlayer) (THIS_
590 REF(IRMAPlayer*) pPlayer) PURE;
592 /************************************************************************
593 * Method:
594 * IRMAClientEngine::ClosePlayer
595 * Purpose:
596 * Called by the client when it is done using the player...
599 STDMETHOD(ClosePlayer) (THIS_
600 IRMAPlayer* pPlayer) PURE;
602 /************************************************************************
603 * Method:
604 * IRMAClientEngine::GetPlayerCount
605 * Purpose:
606 * Returns the current number of IRMAPlayer instances supported by
607 * this client engine instance.
609 STDMETHOD_(UINT16, GetPlayerCount)(THIS) PURE;
611 /************************************************************************
612 * Method:
613 * IRMAClientEngine::GetPlayer
614 * Purpose:
615 * Returns the Nth IRMAPlayer instances supported by this client
616 * engine instance.
618 STDMETHOD(GetPlayer) (THIS_
619 UINT16 nPlayerNumber,
620 REF(IUnknown*) pUnknown) PURE;
622 /************************************************************************
623 * Method:
624 * IRMAClientEngine::EventOccurred
625 * Purpose:
626 * Clients call this to pass OS events to all players. PNxEvent
627 * defines a cross-platform event.
629 STDMETHOD(EventOccurred) (THIS_
630 PNxEvent* /*IN*/ pEvent) PURE;
633 #if defined _UNIX && !defined (_VXWORKS)
634 DEFINE_GUID(IID_IRMAClientEngineSelector, 0x00000404, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
635 0xa0, 0x24, 0x40, 0x6d, 0x59);
637 #undef INTERFACE
638 #define INTERFACE IRMAClientEngineSelector
640 DECLARE_INTERFACE_(IRMAClientEngineSelector, IUnknown)
643 * IUnknown methods
645 STDMETHOD(QueryInterface) (THIS_
646 REFIID riid,
647 void** ppvObj) PURE;
649 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
651 STDMETHOD_(ULONG,Release) (THIS) PURE;
653 /************************************************************************
654 * Method:
655 * IRMAClientEngine::Select
656 * Purpose:
657 * Top level clients under Unix should use this instead of
658 * select() to select for events.
660 STDMETHOD_(INT32, Select) (THIS_
661 INT32 n,
662 fd_set *readfds,
663 fd_set *writefds,
664 fd_set *exceptfds,
665 struct timeval* timeout) PURE;
667 #endif /* _UNIX */
669 /****************************************************************************
671 * Interface:
673 * IRMAClientEngineSetup
675 * Purpose:
677 * Interface to the basic client engine. Provided to the renderers and
678 * other client side components.
680 * IID_IRMAClientEngineSetup:
682 * {00000405-0901-11d1-8B06-00A024406D59}
684 DEFINE_GUID(IID_IRMAClientEngineSetup, 0x00000405, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
685 0xa0, 0x24, 0x40, 0x6d, 0x59);
687 #undef INTERFACE
688 #define INTERFACE IRMAClientEngineSetup
690 DECLARE_INTERFACE_(IRMAClientEngineSetup, IUnknown)
693 * IUnknown methods
695 STDMETHOD(QueryInterface) (THIS_
696 REFIID riid,
697 void** ppvObj) PURE;
699 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
701 STDMETHOD_(ULONG,Release) (THIS) PURE;
704 * IRMAClientEngineSetup methods
707 /************************************************************************
708 * Method:
709 * IRMAClientEngineSetup::Setup
710 * Purpose:
711 * Top level clients use this interface to over-ride certain basic
712 * interfaces implemented by the core. Current over-ridable
713 * interfaces are: IRMAPreferences, IRMAHyperNavigate
715 STDMETHOD(Setup) (THIS_
716 IUnknown* pContext) PURE;
720 /****************************************************************************
722 * Interface:
724 * IRMAInfoLogger
726 * Purpose:
728 * Interface to send any logging information back to the server.
729 * This information will appear in the server's access log.
731 * IID_IRMAInfoLogger:
733 * {00000409-0901-11d1-8B06-00A024406D59}
735 DEFINE_GUID(IID_IRMAInfoLogger, 0x00000409, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
736 0xa0, 0x24, 0x40, 0x6d, 0x59);
738 #undef INTERFACE
739 #define INTERFACE IRMAInfoLogger
741 DECLARE_INTERFACE_(IRMAInfoLogger, IUnknown)
744 * IUnknown methods
746 STDMETHOD(QueryInterface) (THIS_
747 REFIID riid,
748 void** ppvObj) PURE;
750 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
752 STDMETHOD_(ULONG,Release) (THIS) PURE;
755 * IRMAInfoLogger methods
758 /************************************************************************
759 * Method:
760 * IRMAInfoLogger::LogInformation
761 * Purpose:
762 * Logs any user defined information in form of action and
763 * associated data.
765 STDMETHOD(LogInformation) (THIS_
766 const char* /*IN*/ pAction,
767 const char* /*IN*/ pData) PURE;
772 /****************************************************************************
774 * Interface:
776 * IRMAPlayer2
778 * Purpose:
780 * Extra methods in addition to IRMAPlayer
782 * IID_IRMAPlayer2:
784 * {00000411-0901-11d1-8B06-00A024406D59}
787 DEFINE_GUID(IID_IRMAPlayer2, 0x00000411, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
788 0xa0, 0x24, 0x40, 0x6d, 0x59);
790 #undef INTERFACE
791 #define INTERFACE IRMAPlayer2
793 DECLARE_INTERFACE_(IRMAPlayer2, IUnknown)
796 * IUnknown methods
798 STDMETHOD(QueryInterface) (THIS_
799 REFIID riid,
800 void** ppvObj) PURE;
802 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
804 STDMETHOD_(ULONG,Release) (THIS) PURE;
806 /************************************************************************
807 * Method:
808 * IID_IRMAPlayer2::SetMinimumPreroll
809 * Purpose:
810 * Call this method to set the minimum preroll of this clip
812 STDMETHOD(SetMinimumPreroll) (THIS_
813 UINT32 ulMinPreroll) PURE;
815 /************************************************************************
816 * Method:
817 * IID_IRMAPlayer2::GetMinimumPreroll
818 * Purpose:
819 * Call this method to get the minimum preroll of this clip
821 STDMETHOD(GetMinimumPreroll) (THIS_
822 REF(UINT32) ulMinPreroll) PURE;
824 /************************************************************************
825 * Method:
826 * IID_IRMAPlayer2::OpenRequest
827 * Purpose:
828 * Call this method to open the IRMARequest
830 STDMETHOD(OpenRequest) (THIS_
831 IRMARequest* pRequest) PURE;
833 /************************************************************************
834 * Method:
835 * IID_IRMAPlayer2::GetRequest
836 * Purpose:
837 * Call this method to get the IRMARequest
839 STDMETHOD(GetRequest) (THIS_
840 REF(IRMARequest*) pRequest) PURE;
843 #endif /* _RMACORE_H_ */