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

📄 avstreams_i.h

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 H
📖 第 1 页 / 共 5 页
字号:
                     AVStreams::noSuchFlow));

  /// unbind the stream. Same effect as Basic_StreamCtrl::destroy ()
  virtual void unbind (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpFailed));

  virtual AVStreams::VDev_ptr get_related_vdev (AVStreams::MMDevice_ptr adev,
                                                AVStreams::StreamEndPoint_out sep
                                                ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpFailed));

  /// Changes the QoS associated with the stream
  /// Empty the_spec means apply operation to all flows
  virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
                                     const AVStreams::flowSpec &the_spec
                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed));

protected:

  struct MMDevice_Map_Entry
  {
    AVStreams::StreamEndPoint_var sep_;
    AVStreams::VDev_var vdev_;
    AVStreams::flowSpec flowspec_;
    AVStreams::streamQoS qos_;
  };

  typedef ACE_Hash_Map_Manager <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map;
  typedef ACE_Hash_Map_Iterator <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map_Iterator;

  MMDevice_Map mmdevice_a_map_;
  MMDevice_Map mmdevice_b_map_;
  TAO_MCastConfigIf *mcastconfigif_;
  AVStreams::MCastConfigIf_var mcastconfigif_ptr_;
  AVStreams::StreamCtrl_var streamctrl_;
  CORBA::ULong source_id_;
};

class TAO_AV_Export TAO_MCastConfigIf
  : public virtual POA_AVStreams::MCastConfigIf,
    public virtual TAO_PropertySet,
    public virtual PortableServer::RefCountServantBase
{
public:

  enum Peer_Interface {VDEV = 0, FLOWENDPOINT=1};
  struct Peer_Info
  {
    AVStreams::VDev_var peer_;
    AVStreams::FlowEndPoint_var fep_;
    AVStreams::streamQoS qos_;
    AVStreams::flowSpec flow_spec_;
    Peer_Interface interface_;
  };

  /// Default constructor.
  TAO_MCastConfigIf (void);

  /// Dtor
  ~TAO_MCastConfigIf (void);

  virtual CORBA::Boolean set_peer (CORBA::Object_ptr peer,
                                   AVStreams::streamQoS & the_qos,
                                   const AVStreams::flowSpec & the_spec
                                   ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::QoSRequestFailed,
                     AVStreams::streamOpFailed));

  virtual void configure (const CosPropertyService::Property & a_configuration
                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
  ACE_THROW_SPEC ((CORBA::SystemException));

  virtual void set_initial_configuration (const CosPropertyService::Properties & initial
                                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));

  virtual void set_format (const char * flowName,
                           const char * format_name
                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::notSupported));

  virtual void set_dev_params (const char * flowName,
                               const CosPropertyService::Properties & new_params
                               ACE_ENV_ARG_DECL_WITH_DEFAULTS)

    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::PropertyException,
                     AVStreams::streamOpFailed));

protected:
  /// checks whether the flowname is  in the flow_spec.
  int in_flowSpec (const AVStreams::flowSpec& flow_spec, const char *flow_name);

  /// Multicast socket.
  ACE_SOCK_Dgram_Mcast sock_mcast_;

  /// Initial configuration to be distributed to all B parties when they join.
  CosPropertyService::Properties initial_configuration_;

  ACE_DLList<Peer_Info> peer_list_;
  ACE_DLList_Iterator<Peer_Info> peer_list_iterator_;
};

/**
 * @class TAO_AV_QoS
 * @brief Class for getting and setting the QoS characteristics of
 *        an AV Stream.
 */
class TAO_AV_Export TAO_AV_QoS
{
public:
  /// constructor.
  TAO_AV_QoS (void);

  /// constructor taking a stream qos parameter.
  TAO_AV_QoS (AVStreams::streamQoS &stream_qos);

  /// sets the maps with the QoS paramter.
  int set (AVStreams::streamQoS &stream_qos);

  /// gets the flow_qos.
  int get_flow_qos (const char *flowname,AVStreams::QoS &flow_qos);

  /// converts the application level QoS to Network-level QoS.
  int convert (AVStreams::streamQoS &network_qos);


protected:
  /// Stream Qos.
  AVStreams::streamQoS stream_qos_;

  ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex> qos_map_;
};


// Forward declarations.
class TAO_AV_TCP_Flow_Handler;
class TAO_AV_UDP_Flow_Handler;
class TAO_AV_UDP_MCast_Flow_Handler;
class TAO_AV_Protocol_Object;
class TAO_AV_Callback;
class TAO_AV_SourceManager;
class TAO_AV_Source;
class TAO_AV_RTP_State;
class TAO_AV_Flow_Handler;

/**
 * @class TAO_Base_StreamEndPoint
 *
 * Base class for the A/V StreamEndPoint class. this class
 * is used to control the stream. It should be subclassed
 * by applications that want to provide more control features.
 */
class TAO_AV_Export TAO_Base_StreamEndPoint
  :public virtual TAO_PropertySet
{

  // @@Naga: Rename this class to TAO_Base_EndPoint since both stream and flowendpoints derive from it.
public:
  TAO_Base_StreamEndPoint (void);
  virtual ~TAO_Base_StreamEndPoint (void);

  /// called when streamendpoint is instantiated
  virtual int handle_open (void);

  /// called when streamendpoint is being destructed
  virtual int handle_close (void);

  /// Application needs to define this
  virtual int handle_stop (const AVStreams::flowSpec &the_spec
                            ACE_ENV_ARG_DECL_WITH_DEFAULTS);

  /// Application needs to define this
  virtual int handle_start (const AVStreams::flowSpec &the_spec
                             ACE_ENV_ARG_DECL_WITH_DEFAULTS);

  /// Application needs to define this
  virtual int handle_destroy (const AVStreams::flowSpec &the_spec
                               ACE_ENV_ARG_DECL_WITH_DEFAULTS);

  /// Application needs to define this
  virtual CORBA::Boolean handle_preconnect (AVStreams::flowSpec &the_spec);

  /// Application needs to define this
  virtual CORBA::Boolean handle_postconnect (AVStreams::flowSpec &the_spec);

  /// Application needs to define this
  virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec
                                                      ACE_ENV_ARG_DECL_WITH_DEFAULTS);

  virtual int get_callback (const char *flowname,
                            TAO_AV_Callback *&callback);

  virtual int get_control_callback (const char *flowname,
                                    TAO_AV_Callback *&callback);

  virtual int set_protocol_object (const char *flowname,
                                   TAO_AV_Protocol_Object *object);

  virtual void set_flow_handler (const char *flowname,
                                 TAO_AV_Flow_Handler *handler);

  virtual void set_control_flow_handler (const char *flowname,
                                         TAO_AV_Flow_Handler *handler);

  TAO_AV_QoS &qos (void);


protected:
  TAO_AV_QoS qos_;
  Flow_Handler_Map flow_handler_map_;
  Flow_Handler_Map control_flow_handler_map_;

};

// Forward declarations.
class TAO_AV_Acceptor;
class TAO_AV_Connector;
class TAO_Forward_FlowSpec_Entry;
class TAO_Reverse_FlowSpec_Entry;

/**
 * @class TAO_StreamEndPoint
 * @brief The Stream EndPoint. Used to implement one endpoint of a stream
 *        that implements the transport layer.
 */
class TAO_AV_Export TAO_StreamEndPoint
  : public virtual POA_AVStreams::StreamEndPoint,
    public virtual TAO_Base_StreamEndPoint,
    public virtual PortableServer::RefCountServantBase
{

public:
  /// Constructor
  TAO_StreamEndPoint (void);

   /// Stop the stream. Empty the_spec means, for all the flows
  virtual void stop (const AVStreams::flowSpec &the_spec
                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Start the stream, Empty the_spec means, for all the flows
  virtual void start (const AVStreams::flowSpec &the_spec
                      ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Destroy the stream, Empty the_spec means, for all the flows
  virtual void destroy (const AVStreams::flowSpec &the_spec
                        ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow));

  /// Called by StreamCtrl. responder is the peer to connect to
  virtual CORBA::Boolean connect (AVStreams::StreamEndPoint_ptr responder,
                                  AVStreams::streamQoS& qos_spec,
                                  const AVStreams::flowSpec& the_spec
                                  ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed,
                     AVStreams::streamOpFailed));

  /// Called by the peer StreamEndPoint. The flow_spec indicates the
  /// flows (which contain transport addresses etc.)
  virtual CORBA::Boolean request_connection (AVStreams::StreamEndPoint_ptr initiator,
                                             CORBA::Boolean is_mcast,
                                             AVStreams::streamQoS &qos,
                                             AVStreams::flowSpec &the_spec
                                             ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::streamOpDenied,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed,
                     AVStreams::FPError));

  /// Change the transport qos on a stream
  virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
                                     const AVStreams::flowSpec &the_flows
                                     ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::QoSRequestFailed));

  virtual int change_qos (AVStreams::streamQoS &new_qos,
                          const AVStreams::flowSpec &the_flows
                          ACE_ENV_ARG_DECL_WITH_DEFAULTS);

  /// Used to restrict the set of protocols
  virtual CORBA::Boolean set_protocol_restriction (const AVStreams::protocolSpec &the_pspec
                                                   ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException));

  /// disconnect the flows
  virtual void disconnect (const AVStreams::flowSpec &the_spec
                           ACE_ENV_ARG_DECL_WITH_DEFAULTS)
    ACE_THROW_SPEC ((CORBA::SystemException,
                     AVStreams::noSuchFlow,
                     AVStreams::streamOpFailed));

  /// Used to control the flow
  virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
                             const char *fp_name,
                             const CORBA::Any &fp_settings

⌨️ 快捷键说明

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