Changeset 3664 for pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
- Timestamp:
- Jul 19, 2011 3:42:28 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
- Property svn:mergeinfo changed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r3553 r3664 40 40 41 41 /** Running (media_start() has been called) */ 42 PJSUA_MED_TP_RUNNING 42 PJSUA_MED_TP_RUNNING, 43 44 /** Disabled (transport is initialized, but media is being disabled) */ 45 PJSUA_MED_TP_DISABLED 43 46 44 47 } pjsua_med_tp_st; 48 49 /** Forward decl of pjsua call */ 50 typedef struct pjsua_call pjsua_call; 51 52 53 /** 54 * Call's media stream. 55 */ 56 typedef struct pjsua_call_media 57 { 58 pjsua_call *call; /**< Parent call. */ 59 pjmedia_type type; /**< Media type. */ 60 unsigned idx; /**< This media index in parent call. */ 61 pjsua_call_media_status state; /**< Media state. */ 62 pjmedia_dir dir; /**< Media direction. */ 63 64 /** The stream */ 65 struct { 66 /** Audio stream */ 67 struct { 68 pjmedia_stream *stream; /**< The audio stream. */ 69 int conf_slot; /**< Slot # in conference bridge. */ 70 } a; 71 72 /** Video stream */ 73 struct { 74 pjmedia_vid_stream *stream; /**< The video stream. */ 75 pjsua_vid_win_id cap_win_id;/**< The video capture window */ 76 pjsua_vid_win_id rdr_win_id;/**< The video render window */ 77 pjmedia_vid_dev_index cap_dev; /**< The video capture device */ 78 pjmedia_vid_dev_index rdr_dev; /**< The video-in render device */ 79 } v; 80 81 } strm; 82 83 pj_uint32_t ssrc; /**< RTP SSRC */ 84 pj_uint32_t rtp_tx_ts; /**< Initial RTP timestamp for sender. */ 85 pj_uint16_t rtp_tx_seq;/**< Initial RTP sequence for sender. */ 86 pj_uint8_t rtp_tx_seq_ts_set; 87 /**< Bitmask flags if initial RTP sequence 88 and/or timestamp for sender are set. 89 bit 0/LSB : sequence flag 90 bit 1 : timestamp flag */ 91 92 pjmedia_transport *tp; /**< Current media transport (can be 0) */ 93 pj_status_t tp_ready; /**< Media transport status. */ 94 pjmedia_transport *tp_orig; /**< Original media transport */ 95 pj_bool_t tp_auto_del; /**< May delete media transport */ 96 pjsua_med_tp_st tp_st; /**< Media transport state */ 97 pj_sockaddr rtp_addr; /**< Current RTP source address 98 (used to update ICE default 99 address) */ 100 pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */ 101 102 pjmedia_event_subscription esub_rend;/**< Subscribe renderer events. */ 103 pjmedia_event_subscription esub_cap;/**< Subscribe capture events. */ 104 } pjsua_call_media; 105 106 /** 107 * Maximum number of SDP "m=" lines to be supported. 108 */ 109 #define PJSUA_MAX_CALL_MEDIA PJMEDIA_MAX_SDP_MEDIA 45 110 46 111 /** … … 49 114 * by accessing dlg->mod_data[pjsua.mod.id]. 50 115 */ 51 typedefstruct pjsua_call116 struct pjsua_call 52 117 { 53 118 unsigned index; /**< Index in pjsua array. */ … … 64 129 pjsua_call_hold_type call_hold_type; /**< How to do call hold. */ 65 130 pj_bool_t local_hold;/**< Flag for call-hold by local. */ 66 pjsua_call_media_status media_st;/**< Media state. */ 67 pjmedia_dir media_dir; /**< Media direction. */ 68 pjmedia_session *session; /**< The media session. */ 69 int audio_idx; /**< Index of m=audio in SDP. */ 70 pj_uint32_t ssrc; /**< RTP SSRC */ 71 pj_uint32_t rtp_tx_ts; /**< Initial RTP timestamp for sender. */ 72 pj_uint16_t rtp_tx_seq;/**< Initial RTP sequence for sender. */ 73 pj_uint8_t rtp_tx_seq_ts_set; 74 /**< Bitmask flags if initial RTP sequence 75 and/or timestamp for sender are set. 76 bit 0/LSB : sequence flag 77 bit 1 : timestamp flag */ 78 int conf_slot; /**< Slot # in conference bridge. */ 131 132 unsigned med_cnt; /**< Number of media in SDP. */ 133 pjsua_call_media media[PJSUA_MAX_CALL_MEDIA]; /**< Array of media */ 134 int audio_idx; /**< First active audio media. */ 135 79 136 pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this 80 137 call was triggered by xfer. */ 81 pjmedia_transport *med_tp; /**< Current media transport. */82 pj_status_t med_tp_ready;/**< Media transport status. */83 pjmedia_transport *med_orig; /**< Original media transport */84 pj_bool_t med_tp_auto_del; /**< May delete media transport */85 pjsua_med_tp_st med_tp_st; /**< Media transport state */86 pj_sockaddr med_rtp_addr; /**< Current RTP source address87 (used to update ICE default88 address) */89 138 pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */ 90 pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */91 139 92 140 char last_text_buf_[128]; /**< Buffer for last_text. */ … … 100 148 contains multiple codecs. */ 101 149 102 } pjsua_call;150 }; 103 151 104 152 … … 260 308 } pjsua_stun_resolve; 261 309 310 typedef enum pjsua_vid_win_type 311 { 312 PJSUA_WND_TYPE_NONE, 313 PJSUA_WND_TYPE_PREVIEW, 314 PJSUA_WND_TYPE_STREAM 315 } pjsua_vid_win_type; 316 317 typedef struct pjsua_vid_win 318 { 319 pjsua_vid_win_type type; /**< Type. */ 320 pj_pool_t *pool; /**< Own pool. */ 321 unsigned ref_cnt; /**< Reference counter. */ 322 pjmedia_vid_port *vp_cap; /**< Capture vidport. */ 323 pjmedia_vid_port *vp_rend; /**< Renderer vidport */ 324 pjmedia_port *tee; /**< Video tee */ 325 pjmedia_vid_dev_index preview_cap_id;/* Capture dev id */ 326 } pjsua_vid_win; 262 327 263 328 /** … … 271 336 pj_pool_t *pool; /**< pjsua's private pool. */ 272 337 pj_mutex_t *mutex; /**< Mutex protection for this data */ 338 pjsua_state state; /**< Library state. */ 273 339 274 340 /* Logging: */ … … 340 406 pjmedia_master_port *null_snd; /**< Master port for null sound. */ 341 407 pjmedia_port *null_port; /**< Null port. */ 342 408 pj_bool_t snd_is_on; /**< Media flow is currently active */ 409 410 /* Video device */ 411 pjmedia_vid_dev_index vcap_dev; /**< Capture device ID. */ 412 pjmedia_vid_dev_index vrdr_dev; /**< Playback device ID. */ 343 413 344 414 /* File players: */ … … 349 419 unsigned rec_cnt; /**< Number of file recorders. */ 350 420 pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/ 421 422 /* Video windows */ 423 #if PJSUA_HAS_VIDEO 424 pjsua_vid_win win[PJSUA_MAX_VID_WINS]; /**< Array of windows */ 425 #endif 351 426 }; 352 427 … … 402 477 #define PJSUA_UNLOCK() 403 478 #endif 479 480 /* Core */ 481 void pjsua_set_state(pjsua_state new_state); 404 482 405 483 /****** … … 439 517 pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); 440 518 519 pj_status_t pjsua_call_media_init(pjsua_call_media *call_med, 520 pjmedia_type type, 521 const pjsua_transport_config *tcfg, 522 int security_level, 523 int *sip_err_code); 524 pj_status_t video_channel_update(pjsua_call_media *call_med, 525 pj_pool_t *tmp_pool, 526 const pjmedia_sdp_session *local_sdp, 527 const pjmedia_sdp_session *remote_sdp); 528 void stop_video_stream(pjsua_call_media *call_med); 529 441 530 442 531 /** … … 580 669 char *buf, pj_size_t size); 581 670 671 /* 672 * Video 673 */ 674 pj_status_t pjsua_vid_subsys_init(void); 675 pj_status_t pjsua_vid_subsys_start(void); 676 pj_status_t pjsua_vid_subsys_destroy(void); 677 678 PJ_INLINE(void) pjsua_vid_win_reset(pjsua_vid_win_id wid) 679 { 680 #if PJSUA_HAS_VIDEO 681 pjsua_vid_win *w = &pjsua_var.win[wid]; 682 pj_pool_t *pool = w->pool; 683 684 pj_bzero(w, sizeof(*w)); 685 if (pool) pj_pool_reset(pool); 686 w->ref_cnt = 0; 687 w->pool = pool; 688 w->preview_cap_id = PJMEDIA_VID_INVALID_DEV; 689 #endif 690 } 691 582 692 583 693 PJ_END_DECL
Note: See TracChangeset
for help on using the changeset viewer.