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