⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hxntsrc.h

📁 著名的 helix realplayer 基于手机 symbian 系统的 播放器全套源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* ***** 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 _HX_NET_SOURCE_
#define _HX_NET_SOURCE_

struct IHXPacket;
struct IHXPendingStatus;
#include "hxpac.h"
#include "pacutil.h"
#include "ihxcookies.h"
#include "ihxcookies2.h"
#include "hxbsrc.h"
#include "hxsrc.h"
#include "hxprotocol.h"
#include "hxstrutl.h"
#include "hxbufctl.h"

typedef enum
{
    NETSRC_READY,
    // PAC
    NETSRC_PACREADY,
    NETSRC_PACPENDING,
    // Preferred Transport
    NETSRC_TRANSPORTREADY,
    NETSRC_TRANSPORTPENDING,
    // Reconnect
    NETSRC_RECONNECTSTARTED,
    NETSRC_RECONNECTPENDING,
    NETSRC_RECONNECTFORCED
} NetSourceState;

typedef enum
{
    PUSHDOWN_NONE = 0,
    PUSHDOWN_AUDIO_DONE,
    PUSHDOWN_VIDEO_DONE,
    PUSHDOWN_ALL_DONE
} PushDownStatus;

class ReconnectCallback;

class HXNetSource :  public HXSource
		     ,public IHXPreferredTransportSink
		     ,public IHXProxyAutoConfigCallback
{
public:
					HXNetSource(void);

	STDMETHOD(QueryInterface)	(THIS_
					REFIID riid,
					void** ppvObj);

	STDMETHOD_(ULONG32,AddRef)	(THIS);

	STDMETHOD_(ULONG32,Release)	(THIS);

	// IHXPendingStatus methods

	/************************************************************************
	*	Method:
	*	    IHXPendingStatus::GetStatus
	*	Purpose:
	*	    Called by the user to get the current pending status from an object
	*/
	STDMETHOD(GetStatus)	(THIS_
				REF(UINT16) uStatusCode, 
				REF(IHXBuffer*) pStatusDesc, 
				REF(UINT16) ulPercentDone);
	/*
	 *	IHXRegistryID methods
	 */

	/************************************************************************
	 *	Method:
	 *	    IHXRegistryID::GetID
	 *	Purpose:
	 *	    Get registry ID(hash_key) of the objects(player, source and stream)
	 *
	 */
	STDMETHOD(GetID)	(THIS_
				REF(UINT32) /*OUT*/  ulRegistryID);

	/************************************************************************
	 *	Method:
	 *	    IHXInfoLogger::LogInformation
	 *	Purpose:
	 *	    Logs any user defined information in form of action and 
	 *	    associated data.
	 */
	STDMETHOD(LogInformation)	    (THIS_				
					    const char* /*IN*/ pAction,
					    const char* /*IN*/ pData);

	/*
	 * IHXPreferredTransportSink methods
	 */
	STDMETHOD(TransportSucceeded)	    (TransportMode			/* IN */   prefTransportType,
					    UINT16				/* IN */   uCloakPort);

	STDMETHOD(TransportFailed)	    (THIS);

		HX_RESULT	Setup( 	const char*	host, 
					const char*	resource,
					UINT16 		port, 
					BOOL 		LossCorrection,
					const CHXURL*	pURL,
					BOOL		bAltURL);

        /************************************************************************
         *	Method:
         *	    IHXSourceBufferingStats::GetCurrentBuffering
         *	Purpose:
         *	    Get the current buffering information
         */

        STDMETHOD(GetCurrentBuffering) (THIS_ 
                                        UINT16  uStreamNumber,
                                        REF(INT64)  llLowestTimestamp, 
                                        REF(INT64)  llHighestTimestamp,
                                        REF(UINT32) ulNumBytes,
                                        REF(BOOL)   bDone);

	/*
	 *  IHXProxyAutoConfigCallback methods
	 */
	/************************************************************************
	*  Method:
	*      IHXProxyAutoConfigCallback::GetProxyInfoDone
	*  Purpose:
	*/
	STDMETHOD(GetProxyInfoDone)	(THIS_
					HX_RESULT   status,
					char*	    pszProxyInfo);

				HXNetSource(HXPlayer* player);

        virtual HX_RESULT	DoCleanup(EndCode endCode = END_STOP);

	virtual HX_RESULT	DoSeek(ULONG32 seekTime);
	
	virtual HX_RESULT	DoPause(void);

	virtual HX_RESULT	DoResume(void);

	virtual HX_RESULT	StartInitialization(void);

	virtual UINT16		GetNumStreams(void);

	virtual	HX_RESULT	GetStreamInfo(ULONG32 ulStreamNumber,
					      STREAM_INFO*& theStreamInfo);

	virtual HX_RESULT	GetEvent(UINT16 usStreamNumber, CHXEvent*& theEvent);

////// Interface to the Protocol object...
	virtual HX_RESULT	FileHeaderReady(IHXValues* pHeader);

	virtual HX_RESULT	TACInfoFromHeader(IHXValues* pValues);

        BOOL CanSendToDataCallback(IHXPacket* packet) const;
	virtual	HX_RESULT	DataCallback(IHXPacket* packet);

	virtual HX_RESULT	HeaderCallback(IHXValues* header);

	// tell about end of source...
	virtual void		SetEndOfClip(BOOL bForcedEndofClip = FALSE);
	
	// The protocol object needs to know the current playback time
	// for a retry()
	virtual ULONG32		GetCurrentPlayTime(void);
	
	// set various options received from server...
	virtual HX_RESULT	SetOption(UINT16 option, void* value);

	virtual HX_RESULT	SetCookie(IHXBuffer* pCookie);
	
	// for auto transport switch... protocol object needs to tell
	// what protocol are we actually using to get data...
	virtual HX_RESULT	TransportStarted(TransportMode mode);
	
	virtual HX_RESULT	HandleRetry(char* pszHost, UINT16 ulPort);
	
	virtual	BOOL		CheckTransportTimeout(ULONG32 ulTime);
////// End of Interface to the Protocol object...

	virtual BOOL		IsLocalSource() { return FALSE; };
	virtual BOOL		IsPNAProtocol()  {return (BOOL) (!m_bRTSPProtocol);};

	virtual	void		StartDataWait(BOOL bConnectionWait = FALSE);
	virtual void		StopDataWait();
	virtual	void		FirstDataArrives();

		HX_RESULT	SetRedirectURL(char* pHost, UINT16 nPort, char* pPath, CHXURL* pURL);
		HX_RESULT	SetReconnectInfo(IHXValues* pValues);

	        BOOL		IsSourceDone(void);
		BOOL		IsPlaying();

		void		SetNoLatency();

		void		EnterBufferedPlay(void);
		void		LeaveBufferedPlay(void);

		void		statistics_cat(char* stats,LONG32 Data);

		void		Initialize();

		void		SetAuthenicationInfo(const char* pszUserName, const char* pszPassword)
				{
				    memset(m_szUserName, 0, MAX_DISPLAY_NAME);
				    memset(m_szPassword, 0, MAX_DISPLAY_NAME);

				    if (pszUserName) SafeStrCpy(m_szUserName, pszUserName, MAX_DISPLAY_NAME);
				    if (pszPassword) SafeStrCpy(m_szPassword, pszPassword, MAX_DISPLAY_NAME);
				};

		void		GetAuthenicationInfo(char** pszUserName, char** pszPassword)
	    			{
				    *pszUserName = &m_szUserName[0];
				    *pszPassword = &m_szPassword[0];

				    m_bResendAuthenticationInfo = FALSE;
				};
			
		BOOL		IsAuthenticationInfoResended(void)
				{
				    return m_bResendAuthenticationInfo;
				};


		void		AdjustClipBandwidthStats(BOOL bActivate = FALSE);

		BOOL		CanBeResumed(void);

	virtual HX_RESULT	UpdateRegistry(UINT32 ulRegistryID);
	virtual void		LeavePrefetch(void);	
	virtual BOOL		IsPrefetchDone(void) { return !m_bPrefetch; };

	virtual void		EnterFastStart(void);
	virtual void		LeaveFastStart(TurboPlayOffReason leftReason);
	virtual	BOOL		CanBeFastStarted(void);

	virtual HX_RESULT	FillRecordControl();

protected:

	virtual 			~HXNetSource(void);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -