1 /****************************************************************************
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
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
;
46 #if defined _UNIX && !(defined _VXWORKS)
47 /* Includes needed for select() stuff */
49 #include <sys/types.h>
53 #ifdef _BEOS // fd_set stuff
54 #include <net/socket.h>
57 /* Used in renderer and advise sink interface */
60 BUFFERING_START_UP
= 0,
66 /****************************************************************************
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.
79 IRMAClientEngine
** /*OUT*/ ppEngine
82 /****************************************************************************
90 * Function implemented by the RMA core to close the engine which
91 * was returned in CreateEngine().
95 IRMAClientEngine
* /*IN*/ pEngine
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 /****************************************************************************
118 * Interface provided by the client engine to the renderers. This
119 * interface allows access to stream related information and properties.
123 * {00000400-0901-11d1-8B06-00A024406D59}
126 DEFINE_GUID(IID_IRMAStream
, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
127 0xa0, 0x24, 0x40, 0x6d, 0x59);
130 #define INTERFACE IRMAStream
132 DECLARE_INTERFACE_(IRMAStream
, IUnknown
)
137 STDMETHOD(QueryInterface
) (THIS_
141 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
143 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
149 /************************************************************************
151 * IRMAStream::GetSource
153 * Get the interface to the source object of which the stream is
157 STDMETHOD(GetSource
) (THIS_
158 REF(IRMAStreamSource
*) pSource
) PURE
;
160 /************************************************************************
162 * IRMAStream::GetStreamNumber
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 /************************************************************************
172 * IRMAStream::GetStreamType
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
179 STDMETHOD_(const char*,GetStreamType
) (THIS
) PURE
;
181 /************************************************************************
183 * IRMAStream::GetHeader
185 * Get the header for this stream.
188 STDMETHOD_(IRMAValues
*,GetHeader
) (THIS
) PURE
;
190 /************************************************************************
192 * IRMAStream::ReportQualityOfService
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 /************************************************************************
213 * IRMAStream::ReportRebufferStatus
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
229 STDMETHOD(ReportRebufferStatus
) (THIS_
231 UINT8 unAvailable
) PURE
;
233 /************************************************************************
235 * IRMAStream::SetGranularity
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 /************************************************************************
247 * IRMAStream::GetRendererCount
249 * Returns the current number of renderer instances supported by
250 * this stream instance.
252 STDMETHOD_(UINT16
, GetRendererCount
)(THIS
) PURE
;
254 /************************************************************************
256 * IRMAStream::GetRenderer
258 * Returns the Nth renderer instance supported by this stream.
260 STDMETHOD(GetRenderer
) (THIS_
262 REF(IUnknown
*) pUnknown
) PURE
;
266 /****************************************************************************
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);
286 #define INTERFACE IRMAStreamSource
288 DECLARE_INTERFACE_(IRMAStreamSource
, IUnknown
)
293 STDMETHOD(QueryInterface
) (THIS_
297 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
299 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
302 * IRMAStreamSource methods
305 /************************************************************************
307 * IRMAStreamSource::IsLive
309 * Ask the source whether it is live
312 STDMETHOD_ (BOOL
,IsLive
) (THIS
) PURE
;
314 /************************************************************************
316 * IRMAStreamSource::GetPlayer
318 * Get the interface to the player object of which the source is
322 STDMETHOD(GetPlayer
) (THIS_
323 REF(IRMAPlayer
*) pPlayer
) PURE
;
325 /************************************************************************
327 * IRMAStreamSource::GetURL
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
334 STDMETHOD_(const char*,GetURL
) (THIS
) PURE
;
336 /************************************************************************
338 * IRMAStreamSource::GetStreamCount
340 * Returns the current number of stream instances supported by
341 * this source instance.
343 STDMETHOD_(UINT16
, GetStreamCount
)(THIS
) PURE
;
345 /************************************************************************
347 * IRMAStreamSource::GetStream
349 * Returns the Nth stream instance supported by this source.
351 STDMETHOD(GetStream
) (THIS_
353 REF(IUnknown
*) pUnknown
) PURE
;
357 /****************************************************************************
365 * Interface provided by the client engine to the renderers. This
366 * interface allows access to player related information, properties,
371 * {00000402-0901-11d1-8B06-00A024406D59}
374 DEFINE_GUID(IID_IRMAPlayer
, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
375 0xa0, 0x24, 0x40, 0x6d, 0x59);
378 #define INTERFACE IRMAPlayer
380 DECLARE_INTERFACE_(IRMAPlayer
, IUnknown
)
385 STDMETHOD(QueryInterface
) (THIS_
389 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
391 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
397 /************************************************************************
399 * IRMAPlayer::GetClientEngine
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 /************************************************************************
412 * Ask the player if it is done with the current presentation
415 STDMETHOD_(BOOL
,IsDone
) (THIS
) PURE
;
417 /************************************************************************
421 * Ask the player whether it contains the live source
424 STDMETHOD_(BOOL
,IsLive
) (THIS
) PURE
;
426 /************************************************************************
428 * IRMAPlayer::GetCurrentPlayTime
430 * Get the current time on the Player timeline
433 STDMETHOD_(ULONG32
,GetCurrentPlayTime
) (THIS
) PURE
;
435 /************************************************************************
437 * IRMAPlayer::OpenURL
439 * Tell the player to begin playback of all its sources.
442 STDMETHOD(OpenURL
) (THIS_
443 const char* pURL
) PURE
;
445 /************************************************************************
449 * Tell the player to begin playback of all its sources.
452 STDMETHOD(Begin
) (THIS
) PURE
;
454 /************************************************************************
458 * Tell the player to stop playback of all its sources.
461 STDMETHOD(Stop
) (THIS
) PURE
;
463 /************************************************************************
467 * Tell the player to pause playback of all its sources.
470 STDMETHOD(Pause
) (THIS
) PURE
;
472 /************************************************************************
476 * Tell the player to seek in the playback timeline of all its
480 STDMETHOD(Seek
) (THIS_
481 ULONG32 ulTime
) PURE
;
483 /************************************************************************
485 * IRMAPlayer::GetSourceCount
487 * Returns the current number of source instances supported by
488 * this player instance.
490 STDMETHOD_(UINT16
, GetSourceCount
)(THIS
) PURE
;
492 /************************************************************************
494 * IRMAPlayer::GetSource
496 * Returns the Nth source instance supported by this player.
498 STDMETHOD(GetSource
) (THIS_
500 REF(IUnknown
*) pUnknown
) PURE
;
502 /************************************************************************
504 * IRMAPlayer::SetClientContext
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 /************************************************************************
515 * IRMAPlayer::GetClientContext
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 /************************************************************************
525 * IRMAPlayer::AddAdviseSink
527 * Call this method to add a client advise sink.
530 STDMETHOD(AddAdviseSink
) (THIS_
531 IRMAClientAdviseSink
* pAdviseSink
) PURE
;
533 /************************************************************************
535 * IRMAPlayer::RemoveAdviseSink
537 * Call this method to remove a client advise sink.
539 STDMETHOD(RemoveAdviseSink
) (THIS_
540 IRMAClientAdviseSink
* pAdviseSink
) PURE
;
544 /****************************************************************************
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);
563 #define INTERFACE IRMAClientEngine
565 DECLARE_INTERFACE_(IRMAClientEngine
, IUnknown
)
570 STDMETHOD(QueryInterface
) (THIS_
574 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
576 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
579 * IRMAClientEngine methods
582 /************************************************************************
584 * IRMAClientEngine::CreatePlayer
586 * Creates a new IRMAPlayer instance.
589 STDMETHOD(CreatePlayer
) (THIS_
590 REF(IRMAPlayer
*) pPlayer
) PURE
;
592 /************************************************************************
594 * IRMAClientEngine::ClosePlayer
596 * Called by the client when it is done using the player...
599 STDMETHOD(ClosePlayer
) (THIS_
600 IRMAPlayer
* pPlayer
) PURE
;
602 /************************************************************************
604 * IRMAClientEngine::GetPlayerCount
606 * Returns the current number of IRMAPlayer instances supported by
607 * this client engine instance.
609 STDMETHOD_(UINT16
, GetPlayerCount
)(THIS
) PURE
;
611 /************************************************************************
613 * IRMAClientEngine::GetPlayer
615 * Returns the Nth IRMAPlayer instances supported by this client
618 STDMETHOD(GetPlayer
) (THIS_
619 UINT16 nPlayerNumber
,
620 REF(IUnknown
*) pUnknown
) PURE
;
622 /************************************************************************
624 * IRMAClientEngine::EventOccurred
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);
638 #define INTERFACE IRMAClientEngineSelector
640 DECLARE_INTERFACE_(IRMAClientEngineSelector
, IUnknown
)
645 STDMETHOD(QueryInterface
) (THIS_
649 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
651 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
653 /************************************************************************
655 * IRMAClientEngine::Select
657 * Top level clients under Unix should use this instead of
658 * select() to select for events.
660 STDMETHOD_(INT32
, Select
) (THIS_
665 struct timeval
* timeout
) PURE
;
669 /****************************************************************************
673 * IRMAClientEngineSetup
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);
688 #define INTERFACE IRMAClientEngineSetup
690 DECLARE_INTERFACE_(IRMAClientEngineSetup
, IUnknown
)
695 STDMETHOD(QueryInterface
) (THIS_
699 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
701 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
704 * IRMAClientEngineSetup methods
707 /************************************************************************
709 * IRMAClientEngineSetup::Setup
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 /****************************************************************************
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);
739 #define INTERFACE IRMAInfoLogger
741 DECLARE_INTERFACE_(IRMAInfoLogger
, IUnknown
)
746 STDMETHOD(QueryInterface
) (THIS_
750 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
752 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
755 * IRMAInfoLogger methods
758 /************************************************************************
760 * IRMAInfoLogger::LogInformation
762 * Logs any user defined information in form of action and
765 STDMETHOD(LogInformation
) (THIS_
766 const char* /*IN*/ pAction
,
767 const char* /*IN*/ pData
) PURE
;
772 /****************************************************************************
780 * Extra methods in addition to IRMAPlayer
784 * {00000411-0901-11d1-8B06-00A024406D59}
787 DEFINE_GUID(IID_IRMAPlayer2
, 0x00000411, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
788 0xa0, 0x24, 0x40, 0x6d, 0x59);
791 #define INTERFACE IRMAPlayer2
793 DECLARE_INTERFACE_(IRMAPlayer2
, IUnknown
)
798 STDMETHOD(QueryInterface
) (THIS_
802 STDMETHOD_(ULONG
,AddRef
) (THIS
) PURE
;
804 STDMETHOD_(ULONG
,Release
) (THIS
) PURE
;
806 /************************************************************************
808 * IID_IRMAPlayer2::SetMinimumPreroll
810 * Call this method to set the minimum preroll of this clip
812 STDMETHOD(SetMinimumPreroll
) (THIS_
813 UINT32 ulMinPreroll
) PURE
;
815 /************************************************************************
817 * IID_IRMAPlayer2::GetMinimumPreroll
819 * Call this method to get the minimum preroll of this clip
821 STDMETHOD(GetMinimumPreroll
) (THIS_
822 REF(UINT32
) ulMinPreroll
) PURE
;
824 /************************************************************************
826 * IID_IRMAPlayer2::OpenRequest
828 * Call this method to open the IRMARequest
830 STDMETHOD(OpenRequest
) (THIS_
831 IRMARequest
* pRequest
) PURE
;
833 /************************************************************************
835 * IID_IRMAPlayer2::GetRequest
837 * Call this method to get the IRMARequest
839 STDMETHOD(GetRequest
) (THIS_
840 REF(IRMARequest
*) pRequest
) PURE
;
843 #endif /* _RMACORE_H_ */