hxsmbw.h
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:14k
源码类别:

Symbian

开发平台:

C/C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef _HXSMBW_H_
  36. #define _HXSMBW_H_
  37. #include "hxcom.h"
  38. /*
  39.  * Forward declarations of some interfaces defined here-in.
  40.  */
  41. typedef _INTERFACE IHXPlayer     IHXPlayer;
  42. typedef _INTERFACE IHXBandwidthManagerInput   IHXBandwidthManagerInput;
  43. class HXSource;
  44. class CHXSimpleList;
  45. /****************************************************************************
  46.  * 
  47.  *  Interface:
  48.  *
  49.  * IHXBandwidthManager
  50.  *
  51.  *  Purpose:
  52.  *
  53.  * Implemented by the ASM Manager to allow sources to register
  54.  * themselves.
  55.  *
  56.  *  IID_IHXBandwidthManager:
  57.  *
  58.  * {00000800-b4c8-11d0-9995-00a0248da5f0}
  59.  *
  60.  */
  61. DEFINE_GUID(IID_IHXBandwidthManager, 0x00000800, 0xb4c8, 0x11d0,
  62.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  63. #undef  INTERFACE
  64. #define INTERFACE   IHXBandwidthManager
  65. DECLARE_INTERFACE_(IHXBandwidthManager, IUnknown)
  66. {
  67.     /*
  68.      * IUnknown methods
  69.      */
  70.     STDMETHOD(QueryInterface) (THIS_
  71. REFIID riid,
  72. void** ppvObj) PURE;
  73.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  74.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  75.     /*
  76.      * IHXBandwidthManager methods
  77.      */
  78.     STDMETHOD(RegisterSource) (THIS_
  79. HXSource* pSource,
  80. IUnknown* pUnknown) PURE;
  81.     STDMETHOD(RegisterSourcesDone) (THIS) PURE;
  82.     STDMETHOD_(BOOL, NotEnoughBandwidth)(THIS) PURE;
  83.     STDMETHOD(UnRegisterSource) (THIS_
  84. HXSource* pSource) PURE;
  85.     /* If the source has enough data, it may tell the bandwidth
  86.      * manager to cut down on accelerated buffering. 
  87.      */
  88.     STDMETHOD(ChangeAccelerationStatus) (THIS_
  89. HXSource* pSource,
  90. BOOL    bMayBeAccelerated,
  91. BOOL    bUseAccelerationFactor,
  92. UINT32    ulAccelerationFactor) PURE;
  93.     /* Called by HXPlayer at end of each presentation.  */
  94.     STDMETHOD(PresentationDone) (THIS) PURE;
  95.     STDMETHOD(ChangeBW) (THIS_ 
  96. UINT32 newBW, 
  97. HXSource* pSource) PURE;
  98. };
  99. /****************************************************************************
  100.  * 
  101.  *  Interface:
  102.  *
  103.  * IHXSourceBandwidthInfo
  104.  *
  105.  *  Purpose:
  106.  *
  107.  * Implemented by RTSP Transport to associate it with the ASM
  108.  * manager and set the transmission rate.
  109.  *
  110.  *  IID_IHXSourceBandwidthInfo:
  111.  *
  112.  * {00000801-b4c8-11d0-9995-00a0248da5f0}
  113.  *
  114.  */
  115. DEFINE_GUID(IID_IHXSourceBandwidthInfo, 0x00000801, 0xb4c8, 0x11d0,
  116.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  117. #undef  INTERFACE
  118. #define INTERFACE   IHXSourceBandwidthInfo
  119. DECLARE_INTERFACE_(IHXSourceBandwidthInfo, IUnknown)
  120. {
  121.     /*
  122.      * IUnknown methods
  123.      */
  124.     STDMETHOD(QueryInterface) (THIS_
  125. REFIID riid,
  126. void** ppvObj) PURE;
  127.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  128.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  129.     /*
  130.      * IHXSourceBandwidthInfo methods
  131.      */
  132.     STDMETHOD(InitBw) (THIS_
  133. IHXBandwidthManagerInput* pBwMgr) PURE;
  134.     STDMETHOD(SetTransmitRate) (THIS_
  135. UINT32 ulBitRate) PURE;
  136. };
  137. /****************************************************************************
  138.  * 
  139.  *  Interface:
  140.  *
  141.  * IHXBandwidthManagerInput
  142.  *
  143.  *  Purpose:
  144.  *
  145.  * Implemented by ASM Managers to allow the transport to report
  146.  * information about bandwidth usage & stats.
  147.  *
  148.  *  IID_IHXBandwidthManagerInput:
  149.  *
  150.  * {00000802-b4c8-11d0-9995-00a0248da5f0}
  151.  *
  152.  */
  153. DEFINE_GUID(IID_IHXBandwidthManagerInput, 0x00000802, 0xb4c8, 0x11d0,
  154.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  155. #undef  INTERFACE
  156. #define INTERFACE   IHXBandwidthManagerInput
  157. typedef enum _transport_type
  158. {
  159.     TNG_TCP, TNG_UDP
  160. } TRANSPORT_TYPE;
  161. #define REPORT_DATA_PACKET_LOST 0xffffffff
  162. DECLARE_INTERFACE_(IHXBandwidthManagerInput, IUnknown)
  163. {
  164.     /*
  165.      * IUnknown methods
  166.      */
  167.     STDMETHOD(QueryInterface) (THIS_
  168. REFIID riid,
  169. void** ppvObj) PURE;
  170.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  171.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  172.     /*
  173.      * IHXBandwidthManagerInput methods
  174.      */
  175.     STDMETHOD(ReportDataPacket) (THIS_
  176. UINT32 ulTimeStamp,
  177. UINT32 ulArrivedTimeStamp,
  178. UINT32 ulSize) PURE;
  179.     STDMETHOD(ReportUpshiftInfo) (THIS_
  180. UINT32 ulTimeStamp,
  181. UINT32 ulSize) PURE;
  182.     STDMETHOD(ReportLatency) (THIS_
  183. UINT32 ulServerTime,
  184. UINT32 ulClientTime) PURE;
  185.     STDMETHOD(SetCongestionFactor) (THIS_
  186. UINT32 ulFactor) PURE;
  187.     STDMETHOD(SetTransportType) (THIS_
  188. TRANSPORT_TYPE type) PURE;
  189. };
  190. /****************************************************************************
  191.  * 
  192.  *  Interface:
  193.  *
  194.  * IHXStreamBandwidthNegotiator
  195.  *
  196.  *  Purpose:
  197.  *
  198.  * Implemented by ASM Stream objects to give basic information to
  199.  * the ASM manager.
  200.  *
  201.  *  IID_IHXStreamBandwidthNegotiator:
  202.  *
  203.  * {00000803-b4c8-11d0-9995-00a0248da5f0}
  204.  *
  205.  */
  206. DEFINE_GUID(IID_IHXStreamBandwidthNegotiator, 0x00000803, 0xb4c8, 0x11d0,
  207.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  208. #undef  INTERFACE
  209. #define INTERFACE   IHXStreamBandwidthNegotiator
  210. DECLARE_INTERFACE_(IHXStreamBandwidthNegotiator, IUnknown)
  211. {
  212.     /*
  213.      * IUnknown methods
  214.      */
  215.     STDMETHOD(QueryInterface) (THIS_
  216. REFIID riid,
  217. void** ppvObj) PURE;
  218.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  219.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  220.     /*
  221.      * IHXStreamBandwidthNegotiator methods
  222.      */
  223.     STDMETHOD(SetBandwidthUsage) (THIS_
  224. REF(UINT32) ulRecvBitRate,
  225. REF(BOOL)   bTimeStampDelivery) PURE;
  226.     STDMETHOD(HandleSlowSource)         (THIS_
  227. UINT32 ulRecvBitRate) PURE;
  228.     STDMETHOD(GetFixedBandwidth) (THIS_
  229. REF(UINT32) ulBitRate) PURE;
  230.     STDMETHOD(GetThresholdInfo) (THIS_
  231. float*     pThreshold,
  232. REF(UINT32) ulNumThreshold) PURE;
  233.     STDMETHOD(UnRegister) (THIS) PURE;
  234.     STDMETHOD_(ULONG32,GetNumThresholds)(THIS) PURE;
  235. };
  236. /****************************************************************************
  237.  * 
  238.  *  Interface:
  239.  *
  240.  * IHXStreamBandwidthBias
  241.  *
  242.  *  Purpose:
  243.  *
  244.  * Implemented by the ASM stmeams (queried from IHXStream)
  245.  * in order to set/get the current bias factor for
  246.  *      allocation.
  247.  *
  248.  *  IID_IHXStreamBandwidthBias:
  249.  *
  250.  * {00000804-b4c8-11d0-9995-00a0248da5f0}
  251.  *
  252.  */
  253. DEFINE_GUID(IID_IHXStreamBandwidthBias, 0x00000804, 0xb4c8, 0x11d0,
  254.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  255. #undef  INTERFACE
  256. #define INTERFACE   IHXStreamBandwidthBias
  257. DECLARE_INTERFACE_(IHXStreamBandwidthBias, IUnknown)
  258. {
  259.     /*
  260.      * IUnknown methods
  261.      */
  262.     STDMETHOD(QueryInterface) (THIS_
  263. REFIID riid,
  264. void** ppvObj) PURE;
  265.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  266.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  267.     /*
  268.      * IHXStreamBandwidthBias methods
  269.      */
  270.     STDMETHOD(GetBiasFactor) (THIS_
  271. REF(INT32) lBiasFactor) PURE;
  272.     STDMETHOD(SetBiasFactor) (THIS_
  273. INT32 lBiasFactor) PURE;
  274. };
  275. /****************************************************************************
  276.  * 
  277.  *  Interface:
  278.  *
  279.  * IHXThinnableSource
  280.  *
  281.  *  Purpose:
  282.  *
  283.  * Implemented by protocols that allow infinite thinnability through
  284.  *      LimitBandwidthByDropping
  285.  *
  286.  *  IID_IHXThinnableSource
  287.  *
  288.  * {00000805-b4c8-11d0-9995-00a0248da5f0}
  289.  *
  290.  */
  291. DEFINE_GUID(IID_IHXThinnableSource, 0x00000805, 0xb4c8, 0x11d0,
  292.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  293. #undef  INTERFACE
  294. #define INTERFACE   IHXThinnableSource
  295. DECLARE_INTERFACE_(IHXThinnableSource, IUnknown)
  296. {
  297.     /*
  298.      * IUnknown methods
  299.      */
  300.     STDMETHOD(QueryInterface) (THIS_
  301. REFIID riid,
  302. void** ppvObj) PURE;
  303.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  304.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  305.     /*
  306.      * IHXThinnableSource methods
  307.      */
  308.     STDMETHOD(LimitBandwidthByDropping) (THIS_
  309. UINT32 ulStreamNo,
  310. UINT32 ulBandwidthLimit) PURE;
  311.     STDMETHOD(SetDeliveryBandwidth) (THIS_
  312. UINT32 ulBandwidth,
  313. UINT32 ulMsBackOff) PURE;
  314. };
  315. /****************************************************************************
  316.  * 
  317.  *  Interface:
  318.  *
  319.  * IHXBandwidthNudger
  320.  *
  321.  *  Purpose:
  322.  *
  323.  * Implemented by the ASM Bandwidth manager (query off IHXPlayer).
  324.  *      This interface allows you to artifically simulate bandwidth
  325.  * constrained conditions.
  326.  *
  327.  *  IID_IHXBandwidthNudger
  328.  *
  329.  * {00000806-b4c8-11d0-9995-00a0248da5f0}
  330.  *
  331.  */
  332. DEFINE_GUID(IID_IHXBandwidthNudger, 0x00000806, 0xb4c8, 0x11d0,
  333.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  334. #undef  INTERFACE
  335. #define INTERFACE   IHXBandwidthNudger
  336. DECLARE_INTERFACE_(IHXBandwidthNudger, IUnknown)
  337. {
  338.     /*
  339.      * IUnknown methods
  340.      */
  341.     STDMETHOD(QueryInterface) (THIS_
  342. REFIID riid,
  343. void** ppvObj) PURE;
  344.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  345.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  346.     /*
  347.      * IHXBandwidthNudger methods
  348.      */
  349.     STDMETHOD(GetBandwidth) (THIS_
  350. REF(UINT32) ulBandwidth) PURE;
  351.     STDMETHOD(SetBandwidth) (THIS_
  352. UINT32 ulBandwidth) PURE;
  353. };
  354. /****************************************************************************
  355.  * 
  356.  *  Interface:
  357.  *
  358.  * IHXASMProps
  359.  *
  360.  *  Purpose:
  361.  *
  362.  * Implemented by the ASM Stream Object (query off IHXStream).
  363.  *      This interface allows you to get the current predata as stated
  364.  * in the rulebook.
  365.  *
  366.  *  IID_IHXASMProps
  367.  *
  368.  * {00000807-b4c8-11d0-9995-00a0248da5f0}
  369.  *
  370.  */
  371. DEFINE_GUID(IID_IHXASMProps, 0x00000807, 0xb4c8, 0x11d0,
  372.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  373. #undef  INTERFACE
  374. #define INTERFACE   IHXASMProps
  375. DECLARE_INTERFACE_(IHXASMProps, IUnknown)
  376. {
  377.     /*
  378.      * IUnknown methods
  379.      */
  380.     STDMETHOD(QueryInterface) (THIS_
  381. REFIID riid,
  382. void** ppvObj) PURE;
  383.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  384.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  385.     /*
  386.      * IHXASMProps methods
  387.      */
  388.     STDMETHOD(GetPreData) (THIS_
  389. REF(UINT32) ulPreData) PURE;
  390.     STDMETHOD(GetBandwidth) (THIS_
  391. REF(UINT32) ulBandwidth) PURE;
  392. };
  393. /****************************************************************************
  394.  * 
  395.  *  Interface:
  396.  *
  397.  * IHXAtomicRuleChange
  398.  *
  399.  *  Purpose:
  400.  *
  401.  * Implemented by the RTSP layer in rmacore.
  402.  *      This interface allows you to atomically subscribe and unsubscribe
  403.  * to a bunch of rules.
  404.  *
  405.  *  IID_IHXAtomicRuleChange
  406.  *
  407.  * {00000808-b4c8-11d0-9995-00a0248da5f0}
  408.  *
  409.  */
  410. DEFINE_GUID(IID_IHXAtomicRuleChange, 0x00000808, 0xb4c8, 0x11d0,
  411.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  412. #undef  INTERFACE
  413. #define INTERFACE   IHXAtomicRuleChange
  414. DECLARE_INTERFACE_(IHXAtomicRuleChange, IUnknown)
  415. {
  416.     /*
  417.      * IUnknown methods
  418.      */
  419.     STDMETHOD(QueryInterface) (THIS_
  420. REFIID riid,
  421. void** ppvObj) PURE;
  422.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  423.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  424.     /*
  425.      * IHXAtomicRuleChange methods
  426.      */
  427.     STDMETHOD(RuleChange)    (THIS_
  428.      REF(CHXSimpleList) RuleChanges) PURE;
  429. };
  430. /****************************************************************************
  431.  * 
  432.  *  Interface:
  433.  *
  434.  * IHXAtomicRuleGather
  435.  *
  436.  *  Purpose:
  437.  *
  438.  * Implemented by the RTSP layer in rmacore.
  439.  *      This interface allows you to atomically subscribe and unsubscribe
  440.  * to a bunch of rules.
  441.  *
  442.  *  IID_IHXAtomicRuleGather
  443.  *
  444.  * {00000809-b4c8-11d0-9995-00a0248da5f0}
  445.  *
  446.  */
  447. DEFINE_GUID(IID_IHXAtomicRuleGather, 0x00000809, 0xb4c8, 0x11d0,
  448.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  449. #undef  INTERFACE
  450. #define INTERFACE   IHXAtomicRuleGather
  451. DECLARE_INTERFACE_(IHXAtomicRuleGather, IUnknown)
  452. {
  453.     /*
  454.      * IUnknown methods
  455.      */
  456.     STDMETHOD(QueryInterface) (THIS_
  457. REFIID riid,
  458. void** ppvObj) PURE;
  459.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  460.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  461.     /*
  462.      * IHXAtomicRuleGather methods
  463.      */
  464.     STDMETHOD(RuleGather)    (THIS_
  465.      CHXSimpleList* pList) PURE;
  466.     STDMETHOD(RuleFlush)    (THIS_
  467.      CHXSimpleList* pList) PURE;
  468. };
  469. /****************************************************************************
  470.  * 
  471.  *  Interface:
  472.  *
  473.  * IHXPlayerState
  474.  *
  475.  *  Purpose:
  476.  *
  477.  * Implemented by the HXPlayer object in rmacore.
  478.  *      This interface allows you to determine if we are in a playing
  479.  * state.
  480.  *
  481.  *  IID_IHXPlayerState
  482.  *
  483.  * {0000080A-b4c8-11d0-9995-00a0248da5f0}
  484.  *
  485.  */
  486. DEFINE_GUID(IID_IHXPlayerState, 0x0000080A, 0xb4c8, 0x11d0,
  487.     0x99, 0x95, 0x0, 0xa0, 0x24, 0x8d, 0xa5, 0xf0);
  488. #undef  INTERFACE
  489. #define INTERFACE   IHXPlayerState
  490. DECLARE_INTERFACE_(IHXPlayerState, IUnknown)
  491. {
  492.     /*
  493.      * IUnknown methods
  494.      */
  495.     STDMETHOD(QueryInterface) (THIS_
  496. REFIID riid,
  497. void** ppvObj) PURE;
  498.     STDMETHOD_(ULONG32,AddRef) (THIS) PURE;
  499.     STDMETHOD_(ULONG32,Release) (THIS) PURE;
  500.     /*
  501.      * IHXPlayerState methods
  502.      */
  503.     STDMETHOD_(BOOL, IsPlaying)    (THIS) PURE;
  504. };
  505. #endif /* _HXSMBW_H_ */