Changeset 4662
- Timestamp:
- Nov 29, 2013 3:05:48 AM (11 years ago)
- Location:
- pjproject/branches/projects/pjsua2
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/pjsua2.i
r4658 r4662 40 40 %feature("director") FindBuddyMatch; 41 41 42 43 42 // 44 43 // STL stuff. … … 46 45 %include "std_string.i" 47 46 %include "std_vector.i" 48 49 47 50 48 %template(StringVector) std::vector<std::string>; … … 74 72 %template(SipMultipartPartVector) std::vector<pj::SipMultipartPart>; 75 73 %template(BuddyVector) std::vector<pj::Buddy*>; 74 %template(AudioMediaVector) std::vector<pj::AudioMedia*>; 75 %template(MediaFormatVector) std::vector<pj::MediaFormat*>; 76 76 77 %include "pjsua2/media.hpp" 77 78 %include "pjsua2/endpoint.hpp" 78 79 %include "pjsua2/presence.hpp" -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/symbols.i
r4657 r4662 41 41 enum pjmedia_vid_dev_std_index {PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1, PJMEDIA_VID_DEFAULT_RENDER_DEV = -2, PJMEDIA_VID_INVALID_DEV = -3}; 42 42 43 enum pjmedia_file_writer_option {PJMEDIA_FILE_WRITE_PCM = 0, PJMEDIA_FILE_WRITE_ALAW = 1, PJMEDIA_FILE_WRITE_ULAW = 2}; 44 45 enum pjmedia_file_player_option {PJMEDIA_FILE_NO_LOOP = 1}; 46 47 typedef enum pjmedia_type {PJMEDIA_TYPE_NONE, PJMEDIA_TYPE_AUDIO, PJMEDIA_TYPE_VIDEO, PJMEDIA_TYPE_APPLICATION, PJMEDIA_TYPE_UNKNOWN} pjmedia_type; 48 49 typedef enum pjmedia_format_id {PJMEDIA_FORMAT_L16 = 0, PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16, PJMEDIA_FORMAT_PCMA = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'A', PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA, PJMEDIA_FORMAT_PCMU = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'u', PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU, PJMEDIA_FORMAT_AMR = ((('R' << 24) | ('M' << 16)) | ('A' << 8)) | ' ', PJMEDIA_FORMAT_G729 = ((('9' << 24) | ('2' << 16)) | ('7' << 8)) | 'G', PJMEDIA_FORMAT_ILBC = ((('C' << 24) | ('B' << 16)) | ('L' << 8)) | 'I', PJMEDIA_FORMAT_RGB24 = ((('3' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_RGBA = ((('A' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_BGRA = ((('A' << 24) | ('R' << 16)) | ('G' << 8)) | 'B', PJMEDIA_FORMAT_RGB32 = PJMEDIA_FORMAT_RGBA, PJMEDIA_FORMAT_DIB = (((' ' << 24) | ('B' << 16)) | ('I' << 8)) | 'D', PJMEDIA_FORMAT_GBRP = ((('P' << 24) | ('R' << 16)) | ('B' << 8)) | 'G', PJMEDIA_FORMAT_AYUV = ((('V' << 24) | ('U' << 16)) | ('Y' << 8)) | 'A', PJMEDIA_FORMAT_YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y', PJMEDIA_FORMAT_UYVY = ((('Y' << 24) | ('V' << 16)) | ('Y' << 8)) | 'U', PJMEDIA_FORMAT_YVYU = ((('U' << 24) | ('Y' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_I420 = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_IYUV = PJMEDIA_FORMAT_I420, PJMEDIA_FORMAT_YV12 = ((('2' << 24) | ('1' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_I422 = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_I420JPEG = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_I422JPEG = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_H261 = ((('1' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263 = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263P = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'P', PJMEDIA_FORMAT_H264 = ((('4' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_MJPEG = ((('G' << 24) | ('P' << 16)) | ('J' << 8)) | 'M', PJMEDIA_FORMAT_MPEG1VIDEO = ((('V' << 24) | ('1' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG2VIDEO = ((('V' << 24) | ('2' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG4 = ((('4' << 24) | ('G' << 16)) | ('P' << 8)) | 'M'} pjmedia_format_id; 50 43 51 typedef enum pjsip_cred_data_type {PJSIP_CRED_DATA_PLAIN_PASSWD = 0, PJSIP_CRED_DATA_DIGEST = 1, PJSIP_CRED_DATA_EXT_AKA = 16} pjsip_cred_data_type; 44 52 -
pjproject/branches/projects/pjsua2/pjsip-apps/src/swig/symbols.lst
r4657 r4662 1 pj/types.h pj_status_t pj_constants_ pj_uint8_t pj_int32_t 1 pj/types.h pj_status_t pj_constants_ pj_uint8_t pj_int32_t 2 2 pj/file_io.h pj_file_access 3 3 pj/log.h pj_log_decoration … … 5 5 pj/ssl_sock.h pj_ssl_cipher 6 6 7 pjnath/nat_detect.h 8 pjnath/turn_session.h 7 pjnath/nat_detect.h pj_stun_nat_type 8 pjnath/turn_session.h pj_turn_tp_type 9 9 10 pjmedia/transport_srtp.h pjmedia_srtp_use 11 pjmedia/vid_stream.h pjmedia_vid_stream_rc_method 12 pjmedia-videodev/videodev.h pjmedia_vid_dev_index pjmedia_vid_dev_std_index 10 pjmedia/transport_srtp.h pjmedia_srtp_use 11 pjmedia/vid_stream.h pjmedia_vid_stream_rc_method 12 pjmedia-videodev/videodev.h pjmedia_vid_dev_index pjmedia_vid_dev_std_index 13 pjmedia/wav_port.h pjmedia_file_writer_option pjmedia_file_player_option 14 pjmedia/types.h pjmedia_type 15 pjmedia/format.h pjmedia_format_id 13 16 14 pjsip/sip_auth.h 15 pjsip/sip_msg.h 16 pjsip/sip_transport.h 17 pjsip/sip_transport_tls.h pjsip_ssl_method17 pjsip/sip_auth.h pjsip_cred_data_type 18 pjsip/sip_msg.h pjsip_status_code 19 pjsip/sip_transport.h pjsip_transport_type_e pjsip_transport_flags_e pjsip_transport_state 20 pjsip/sip_transport_tls.h pjsip_ssl_method 18 21 19 pjsip-simple/rpid.h 22 pjsip-simple/rpid.h pjrpid_activity 20 23 pjsip-simple/evsub.h pjsip_evsub_state 21 24 -
pjproject/branches/projects/pjsua2/pjsip/build/Makefile
r4657 r4662 91 91 export PJSUA2_LIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 92 92 account.o endpoint.o json.o persistent.o types.o \ 93 siptypes.o presence.o 93 siptypes.o presence.o media.o 94 94 export PJSUA2_LIB_CFLAGS += $(_CFLAGS) $(PJ_VIDEO_CFLAGS) 95 95 export PJSUA2_LIB_CXXFLAGS = $(PJSUA2_LIB_CFLAGS) -
pjproject/branches/projects/pjsua2/pjsip/include/pjsua2.hpp
r4657 r4662 23 23 #include <pjsua2/account.hpp> 24 24 #include <pjsua2/presence.hpp> 25 #include <pjsua2/media.hpp> 25 26 #include <pjsua2/json.hpp> 26 27 -
pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/endpoint.hpp
r4657 r4662 25 25 */ 26 26 #include <pjsua2/persistent.hpp> 27 #include <pjsua2/media.hpp> 27 28 #include <pjsua2/siptypes.hpp> 28 29 … … 946 947 void transportClose(TransportId id) throw(Error); 947 948 949 /************************************************************************* 950 * Media operations 951 */ 952 953 /** 954 * Add media to the media list. 955 * 956 * @param media media to be added. 957 */ 958 void addMedia(AudioMedia &media); 959 960 /** 961 * Remove media from the media list. 962 * 963 * @param media media to be removed. 964 */ 965 void removeMedia(AudioMedia &media); 966 967 /** 968 * Check if media has been added to the media list. 969 * 970 * @param media media to be check. 971 * 972 * @return True if media has been added, false otherwise. 973 */ 974 bool mediaExists(const AudioMedia &media) const; 975 976 /** 977 * Get maximum number of media port. 978 * 979 * @return Maximum number of media port in the conference bridge. 980 */ 981 unsigned mediaMaxPorts() const; 982 983 /** 984 * Get current number of active media port in the bridge. 985 * 986 * @return The number of active media port. 987 */ 988 unsigned mediaActivePorts() const; 989 990 /** 991 * Enumerate all media port. 992 * 993 * @return The list of media port. 994 */ 995 const AudioMediaVector &mediaEnumPorts() const throw(Error); 996 948 997 public: 949 998 /* … … 1010 1059 1011 1060 private: 1012 static Endpoint *instance_; // static instance 1013 LogWriter *writer; // Custom writer, if any 1061 static Endpoint *instance_; // static instance 1062 LogWriter *writer; // Custom writer, if any 1063 AudioMediaVector mediaList; 1014 1064 1015 1065 /* Endpoint static callbacks */ … … 1071 1121 static void on_mwi_info(pjsua_acc_id acc_id, 1072 1122 pjsua_mwi_info *mwi_info); 1123 1073 1124 static void on_buddy_state(pjsua_buddy_id buddy_id); 1074 1075 1125 }; 1076 1126 -
pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/endpoint.cpp
r4659 r4662 20 20 #include <pjsua2/account.hpp> 21 21 #include <pjsua2/presence.hpp> 22 #include <algorithm> 22 23 #include "util.hpp" 23 24 … … 366 367 } 367 368 delete writer; 369 370 while(mediaList.size() > 0) { 371 AudioMedia *cur_media = mediaList[0]; 372 delete cur_media; 373 } 374 368 375 instance_ = NULL; 369 376 } … … 971 978 /////////////////////////////////////////////////////////////////////////////// 972 979 980 /* 981 * Media API 982 */ 983 unsigned Endpoint::mediaMaxPorts() const 984 { 985 return pjsua_conf_get_max_ports(); 986 } 987 988 unsigned Endpoint::mediaActivePorts() const 989 { 990 return pjsua_conf_get_active_ports(); 991 } 992 993 const AudioMediaVector &Endpoint::mediaEnumPorts() const throw(Error) 994 { 995 return mediaList; 996 } 997 998 void Endpoint::addMedia(AudioMedia &media) 999 { 1000 if (mediaExists(media)) 1001 return; 1002 1003 mediaList.push_back(&media); 1004 } 1005 1006 void Endpoint::removeMedia(AudioMedia &media) 1007 { 1008 AudioMediaVector::iterator it = std::find(mediaList.begin(), 1009 mediaList.end(), 1010 &media); 1011 1012 if (it != mediaList.end()) 1013 mediaList.erase(it); 1014 1015 } 1016 1017 bool Endpoint::mediaExists(const AudioMedia &media) const 1018 { 1019 AudioMediaVector::const_iterator it = std::find(mediaList.begin(), 1020 mediaList.end(), 1021 &media); 1022 1023 return (it != mediaList.end()); 1024 }
Note: See TracChangeset
for help on using the changeset viewer.