Changeset 4570
- Timestamp:
- Jul 19, 2013 10:32:43 AM (11 years ago)
- Location:
- pjproject/branches/projects/jni
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/jni/pjsip-apps/src/jni/jni/callbacks.i
r4568 r4570 57 57 %ignore pjsip_tx_data::cb; 58 58 %ignore pjsip_transaction::state_handler; 59 60 /* Ignore some struct members with aux credential callbacks, at least temporarily */ 61 %ignore pjsip_cred_info::ext; 62 %ignore pjsip_cred_info_ext; 63 %ignore pjsip_cred_info_ext_aka; 64 65 %ignore pj_stun_auth_cred::data::dyn_cred; 66 %ignore pj_stun_auth_cred_data::dyn_cred; 67 %ignore pj_stun_auth_cred_data_dyn_cred; -
pjproject/branches/projects/jni/pjsip-apps/src/jni/jni/header.i
r4568 r4570 78 78 MY_JAVA_MEMBER_ARRAY_OF_POINTER(pjmedia_sdp_media, pjmedia_sdp_attr, attr, attr_count) 79 79 80 /* C++ SWIG target doesn't support nested class (C version does though!).81 * This is minimal workaround, ignore nested class as if it is not there.82 * TODO: proper workaround will be moving out inner classes to global scope.83 */84 #ifdef __cplusplus85 %nestedworkaround pjmedia_codec_fmtp::param;86 %nestedworkaround pjsip_cred_info::ext;87 %nestedworkaround pjsip_event::body;88 #endif89 90 80 %include "../callbacks.i" 91 81 -
pjproject/branches/projects/jni/pjsip-apps/src/jni/jni/my_typemaps.i
r4568 r4570 14 14 }; 15 15 %} 16 17 /* 18 * Typemap for setting member of inner struct/union. 19 */ 20 %typemap(memberin) NESTED_INNER "if ($input) pj_memcpy(&$1, $input, sizeof(*$input));" 21 16 22 17 23 /* -
pjproject/branches/projects/jni/pjsip-apps/src/jni/jni/swig_gen.py
r4568 r4570 262 262 return '' 263 263 264 265 # Move out inner struct/union 266 def _process_nested_struct_union(self, code): 267 if not (code.startswith('struct') or \ 268 code.startswith('typedef struct') or \ 269 code.startswith('typedef union')): 270 return code 271 272 # max nested level is 5 273 name = ['','','','',''] 274 type = ['','','','',''] 275 content = ['','','','',''] 276 level = 0 277 s = '' 278 for line in code.splitlines(): 279 line_s = line.lstrip() 280 if (not line_s) or (line_s == '{'): continue 281 282 last_level = level 283 level = (len(line) - len(line_s)) / 2 284 285 if level < last_level: 286 if not line_s.startswith('}'): 287 print "bad tabulation!" 288 289 # closing bracket, get var name 290 varname = '' 291 vartail = '' 292 m = re.match(r'\}\s*(\w+)(.*);', line_s) 293 if m: 294 varname = m.group(1) 295 vartail = m.group(2) 296 if level > 0: 297 name[level] = '$name' + str(level-1) + '$_' + varname 298 # print inner struct/union in outer 299 ss = type[level] + ' ' + name[level] + '\n' 300 ss += '{\n' + content[level] + '};\n' 301 if level > 0: 302 s += "%inline %{\n" + ss + '%}\n' 303 s += "%apply NESTED_INNER { " + name[level] + " " + varname + " };\n" 304 else: 305 s += ss 306 content[level] = '' 307 # print inner struct member var at global scope 308 if level > 0: 309 content[level-1] += ' '*level*2 + type[level] + ' ' + name[level] + ' ' + varname + vartail + ';\n' 310 s = s.replace('$name' + str(level) + '$', '$name' + str(level-1) + '$_' + varname) 311 else: 312 s = s.replace('$name' + str(level) + '$', name[level]) 313 314 elif level >= last_level: 315 if line_s.startswith('typedef'): line_s = line_s[8:] 316 if (line_s.startswith('union') or line_s.startswith('struct')) and not line_s.endswith(';'): 317 ll = line_s.split() 318 type[level] = ll[0] 319 name[level] = ll[1] if len(ll) > 1 else '' 320 else: 321 content[level-1] += line + '\n' 322 return s 323 324 264 325 # Generate code from the specified node. 265 326 def _print_node(self, node): … … 281 342 ss = self._process_opaque_struct(name, ss) 282 343 ss = self._process_pjsua_callback(name, ss) 344 ss = self._process_nested_struct_union(ss) 283 345 s += ss 284 346 return s -
pjproject/branches/projects/jni/pjsip-apps/src/jni/src/org/pjsip/hello/hello.java
r4568 r4570 47 47 public void on_log(int level, String data) 48 48 { 49 System.out.print("LOG : " + data);49 System.out.print("LOG" + level + ": " + data); 50 50 } 51 51 } … … 74 74 pjsua.destroy(); 75 75 System.exit(status); 76 } 77 78 protected static boolean check_active_call() { 79 if (app_config.cur_call_id == -1) 80 System.out.println("No active call"); 81 return (app_config.cur_call_id > -1); 76 82 } 77 83 … … 192 198 pjsua.dump(true); 193 199 } else if (userInput.equals("dq")) { 194 if (app_config.cur_call_id == -1) { 195 System.out.println("No active call"); 196 continue; 197 } 200 if (!check_active_call()) continue; 198 201 199 202 byte[] buf = new byte[1024*2]; … … 207 210 System.out.println("Statistics of call " + app_config.cur_call_id); 208 211 System.out.println(call_dump); 212 } else if (userInput.equals("si")) { 213 /* Test nested struct in pjsua_stream_info */ 214 if (!check_active_call()) continue; 215 216 pjsua_stream_info si = new pjsua_stream_info(); 217 pjsua.call_get_stream_info(app_config.cur_call_id, 0, si); 218 System.out.println("Audio codec being used: " + si.getInfo().getAud().getFmt().getEncoding_name()); 209 219 } 210 220 } -
pjproject/branches/projects/jni/pjsip/include/pjsip/sip_msg.h
r3553 r4570 790 790 { 791 791 /** Request Line. */ 792 structpjsip_request_line req;792 pjsip_request_line req; 793 793 794 794 /** Status Line. */ 795 structpjsip_status_line status;795 pjsip_status_line status; 796 796 } line; 797 797
Note: See TracChangeset
for help on using the changeset viewer.