Debian Codegraph @

Xpjproject/pjsip/src/pjsua2/util.hpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #include <pjsua2/types.hpp>
20 #include <pjsua2/media.hpp>
21 #include <string>
22
23 #define PJ2BOOL(var) ((var) != PJ_FALSE)
24
25 namespace pj
26 {
27 using std::string;
28
29 inline pj_str_t str2Pj(const string &input_str)
30 {
31 pj_str_t output_str;
32 output_str.ptr = (char*)input_str.c_str();
33 output_str.slen = input_str.size();
34 return output_str;
35 }
36
37 inline string pj2Str(const pj_str_t &input_str)
38 {
39 if (input_str.ptr && input_str.slen>0)
40 return string(input_str.ptr, input_str.slen);
41 return string();
42 }
43
44 class AudioMediaHelper : public AudioMedia
45 {
46 public:
47 void setPortId(int port_id) { id = port_id; }
48 };
49
50 class VideoMediaHelper : public VideoMedia
51 {
52 public:
53 void setPortId(int port_id) { id = port_id; }
54 };
55
56 } // namespace pj