📄 hxcore.h
字号:
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
*
* The contents of this file, and the files included with this file, are
* subject to the current version of the RealNetworks Public Source License
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
* in which case the RCSL will apply. You may also obtain the license terms
* directly from RealNetworks. You may not use this file except in
* compliance with the RPSL or, if you have a valid RCSL with RealNetworks
* applicable to this file, the RCSL. Please see the applicable RPSL or
* RCSL for the rights, obligations and limitations governing use of the
* contents of the file.
*
* This file is part of the Helix DNA Technology. RealNetworks is the
* developer of the Original Code and owns the copyrights in the portions
* it created.
*
* This file, and the files included with this file, is distributed and made
* available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
*
* Technology Compatibility Kit Test Suite(s) Location:
* http://www.helixcommunity.org/content/tck
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
#ifndef _HXCORE_H_
#define _HXCORE_H_
/*
* Forward declarations of some interfaces defined or used here-in.
*/
typedef _INTERFACE IUnknown IUnknown;
typedef _INTERFACE IHXStream IHXStream;
typedef _INTERFACE IHXStreamSource IHXStreamSource;
typedef _INTERFACE IHXPlayer IHXPlayer;
typedef _INTERFACE IHXClientEngine IHXClientEngine;
typedef _INTERFACE IHXScheduler IHXScheduler;
typedef _INTERFACE IHXClientAdviseSink IHXClientAdviseSink;
typedef _INTERFACE IHXValues IHXValues;
typedef _INTERFACE IHXBuffer IHXBuffer;
typedef _INTERFACE IHXPacket IHXPacket;
// $Private:
typedef _INTERFACE IHXPersistenceManager IHXPersistenceManager;
typedef _INTERFACE IHXRendererAdviseSink IHXRendererAdviseSink;
typedef _INTERFACE IHXLayoutSite IHXLayoutSite;
typedef _INTERFACE IHXProtocolValidator IHXProtocolValidator;
typedef _INTERFACE IHXUpdateProperties IHXUpdateProperties;
typedef _INTERFACE IHXPersistentComponentManager IHXPersistentComponentManager;
typedef _INTERFACE IHXPersistentComponent IHXPersistentComponent;
typedef _INTERFACE IHXPersistentRenderer IHXPersistentRenderer;
typedef _INTERFACE IHXCoreMutex IHXCoreMutex;
typedef _INTERFACE IHXMacBlitMutex IHXMacBlitMutex;
// $EndPrivate.
typedef _INTERFACE IHXRenderer IHXRenderer;
typedef _INTERFACE IHXPlayer2 IHXPlayer2;
typedef _INTERFACE IHXRequest IHXrequest;
typedef _INTERFACE IHXPlayerNavigator IHXPlayerNavigator;
typedef _INTERFACE IHXGroupSink IHXGroupSink;
typedef struct _PersistentComponentInfo PersistentComponentInfo;
typedef struct _HXxEvent HXxEvent;
#ifdef _MAC_CFM
#pragma export on
#endif
#if defined _UNIX && !(defined _VXWORKS)
/* Includes needed for select() stuff */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#ifdef _BEOS // fd_set stuff
#include <net/socket.h>
#endif
#include "hxwin.h"
/* Used in renderer and advise sink interface */
enum BUFFERING_REASON
{
BUFFERING_START_UP = 0,
BUFFERING_SEEK,
BUFFERING_CONGESTION,
BUFFERING_LIVE_PAUSE
};
/****************************************************************************
*
* Function:
*
* CreateEngine()
*
* Purpose:
*
* Function implemented by the RMA core to return a pointer to the
* client engine. This function would be run by top level clients.
*/
STDAPI CreateEngine
(
IHXClientEngine** /*OUT*/ ppEngine
);
/****************************************************************************
*
* Function:
*
* CloseEngine()
*
* Purpose:
*
* Function implemented by the RMA core to close the engine which
* was returned in CreateEngine().
*/
STDAPI CloseEngine
(
IHXClientEngine* /*IN*/ pEngine
);
#ifdef _MAC_CFM
#pragma export off
#endif
/*
* Definitions of Function Pointers to CreateEngine() and Close Engine().
* These types are provided as a convenince to authors of top level clients.
*/
typedef HX_RESULT (HXEXPORT_PTR FPRMCREATEENGINE)(IHXClientEngine** ppEngine);
typedef HX_RESULT (HXEXPORT_PTR FPRMCLOSEENGINE) (IHXClientEngine* pEngine);
/****************************************************************************
*
* Interface:
*
* IHXStream
*
* Purpose:
*
* Interface provided by the client engine to the renderers. This
* interface allows access to stream related information and properties.
*
* IID_IHXStream:
*
* {00000400-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXStream, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXStream
DECLARE_INTERFACE_(IHXStream, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXStream methods
*/
/************************************************************************
* Method:
* IHXStream::GetSource
* Purpose:
* Get the interface to the source object of which the stream is
* a part of.
*
*/
STDMETHOD(GetSource) (THIS_
REF(IHXStreamSource*) pSource) PURE;
/************************************************************************
* Method:
* IHXStream::GetStreamNumber
* Purpose:
* Get the stream number for this stream relative to the source
* object of which the stream is a part of.
*
*/
STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE;
/************************************************************************
* Method:
* IHXStream::GetStreamType
* Purpose:
* Get the MIME type for this stream. NOTE: The returned string is
* assumed to be valid for the life of the IHXStream from which it
* was returned.
*
*/
STDMETHOD_(const char*,GetStreamType) (THIS) PURE;
/************************************************************************
* Method:
* IHXStream::GetHeader
* Purpose:
* Get the header for this stream.
*
*/
STDMETHOD_(IHXValues*,GetHeader) (THIS) PURE;
/************************************************************************
* Method:
* IHXStream::ReportQualityOfService
* Purpose:
* Call this method to report to the playback context that the
* quality of service for this stream has changed. The unQuality
* should be on a scale of 0 to 100, where 100 is the best possible
* quality for this stream. Although the transport engine can
* determine lost packets and report these through the user
* interface, only the renderer of this stream can determine the
* "real" perceived damage associated with this loss.
*
* NOTE: The playback context may use this value to indicate loss
* in quality to the user interface. When the effects of a lost
* packet are eliminated the renderer should call this method with
* a unQuality of 100.
*
*/
STDMETHOD(ReportQualityOfService) (THIS_
UINT8 unQuality) PURE;
/************************************************************************
* Method:
* IHXStream::ReportRebufferStatus
* Purpose:
* Call this method to report to the playback context that the
* available data has dropped to a critically low level, and that
* rebuffering should occur. The renderer should call back into this
* interface as it receives additional data packets to indicate the
* status of its rebuffering effort.
*
* NOTE: The values of unNeeded and unAvailable are used to indicate
* the general status of the rebuffering effort. For example, if a
* renderer has "run dry" and needs 5 data packets to play smoothly
* again, it should call ReportRebufferStatus() with 5,0 then as
* packet arrive it should call again with 5,1; 5,2... and eventually
* 5,5.
*
*/
STDMETHOD(ReportRebufferStatus) (THIS_
UINT8 unNeeded,
UINT8 unAvailable) PURE;
/************************************************************************
* Method:
* IHXStream::SetGranularity
* Purpose:
* Sets the desired Granularity for this stream. The actual
* granularity will be the lowest granularity of all streams.
* Valid to call before stream actually begins. Best to call during
* IHXRenderer::OnHeader().
*/
STDMETHOD(SetGranularity) (THIS_
ULONG32 ulGranularity) PURE;
/************************************************************************
* Method:
* IHXStream::GetRendererCount
* Purpose:
* Returns the current number of renderer instances supported by
* this stream instance.
*/
STDMETHOD_(UINT16, GetRendererCount)(THIS) PURE;
/************************************************************************
* Method:
* IHXStream::GetRenderer
* Purpose:
* Returns the Nth renderer instance supported by this stream.
*/
STDMETHOD(GetRenderer) (THIS_
UINT16 nIndex,
REF(IUnknown*) pUnknown) PURE;
};
/****************************************************************************
*
* Interface:
*
* IHXStreamSource
*
* Purpose:
*
* Interface provided by the client engine to the renderers. This
* interface allows access to source related information and properties.
*
* IID_IHXStreamSource:
*
* {00000401-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXStreamSource, 0x00000401, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXStreamSource
DECLARE_INTERFACE_(IHXStreamSource, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXStreamSource methods
*/
/************************************************************************
* Method:
* IHXStreamSource::IsLive
* Purpose:
* Ask the source whether it is live
*
*/
STDMETHOD_ (BOOL,IsLive) (THIS) PURE;
/************************************************************************
* Method:
* IHXStreamSource::GetPlayer
* Purpose:
* Get the interface to the player object of which the source is
* a part of.
*
*/
STDMETHOD(GetPlayer) (THIS_
REF(IHXPlayer*) pPlayer) PURE;
/************************************************************************
* Method:
* IHXStreamSource::GetURL
* Purpose:
* Get the URL for this source. NOTE: The returned string is
* assumed to be valid for the life of the IHXStreamSource from which
* it was returned.
*
*/
STDMETHOD_(const char*,GetURL) (THIS) PURE;
/************************************************************************
* Method:
* IHXStreamSource::GetStreamCount
* Purpose:
* Returns the current number of stream instances supported by
* this source instance.
*/
STDMETHOD_(UINT16, GetStreamCount)(THIS) PURE;
/************************************************************************
* Method:
* IHXStreamSource::GetStream
* Purpose:
* Returns the Nth stream instance supported by this source.
*/
STDMETHOD(GetStream) (THIS_
UINT16 nIndex,
REF(IUnknown*) pUnknown) PURE;
};
/****************************************************************************
*
* Interface:
*
* IHXPlayer
*
* Purpose:
*
* Interface provided by the client engine to the renderers. This
* interface allows access to player related information, properties,
* and operations.
*
* IID_IHXPlayer:
*
* {00000402-0901-11d1-8B06-00A024406D59}
*
*/
DEFINE_GUID(IID_IHXPlayer, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
0xa0, 0x24, 0x40, 0x6d, 0x59);
#undef INTERFACE
#define INTERFACE IHXPlayer
DECLARE_INTERFACE_(IHXPlayer, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE;
STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
STDMETHOD_(ULONG32,Release) (THIS) PURE;
/*
* IHXPlayer methods
*/
/************************************************************************
* Method:
* IHXPlayer::GetClientEngine
* Purpose:
* Get the interface to the client engine object of which the
* player is a part of.
*
*/
STDMETHOD(GetClientEngine) (THIS_
REF(IHXClientEngine*) pEngine) PURE;
/************************************************************************
* Method:
* IHXPlayer::IsDone
* Purpose:
* Ask the player if it is done with the current presentation
*
*/
STDMETHOD_(BOOL,IsDone) (THIS) PURE;
/************************************************************************
* Method:
* IHXPlayer::IsLive
* Purpose:
* Ask the player whether it contains the live source
*
*/
STDMETHOD_(BOOL,IsLive) (THIS) PURE;
/************************************************************************
* Method:
* IHXPlayer::GetCurrentPlayTime
* Purpose:
* Get the current time on the Player timeline
*
*/
STDMETHOD_(ULONG32,GetCurrentPlayTime) (THIS) PURE;
/************************************************************************
* Method:
* IHXPlayer::OpenURL
* Purpose:
* Tell the player to begin playback of all its sources.
*
*/
STDMETHOD(OpenURL) (THIS_
const char* pURL) PURE;
/************************************************************************
* Method:
* IHXPlayer::Begin
* Purpose:
* Tell the player to begin playback of all its sources.
*
*/
STDMETHOD(Begin) (THIS) PURE;
/************************************************************************
* Method:
* IHXPlayer::Stop
* Purpose:
* Tell the player to stop playback of all its sources.
*
*/
STDMETHOD(Stop) (THIS) PURE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -