summaryrefslogtreecommitdiff
path: root/pjlib/include/pj
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/include/pj')
-rw-r--r--pjlib/include/pj/compat/os_symbian.h1
-rw-r--r--pjlib/include/pj/config.h8
-rw-r--r--pjlib/include/pj/config_site_sample.h23
-rw-r--r--pjlib/include/pj/errno.h12
4 files changed, 42 insertions, 2 deletions
diff --git a/pjlib/include/pj/compat/os_symbian.h b/pjlib/include/pj/compat/os_symbian.h
index 2871fe0a..b1b1cd1a 100644
--- a/pjlib/include/pj/compat/os_symbian.h
+++ b/pjlib/include/pj/compat/os_symbian.h
@@ -121,6 +121,7 @@
#define PJ_OS_HAS_CHECK_STACK 0
#define PJ_TERM_HAS_COLOR 0
#define PJ_NATIVE_STRING_IS_UNICODE 0
+#define PJ_NATIVE_ERR_POSITIVE 0
#define PJ_ATOMIC_VALUE_TYPE int
#define PJ_THREAD_DESC_SIZE 128
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index e6d4fd4c..197e525c 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -599,6 +599,14 @@
#endif
/**
+ * Is native platform error positive number?
+ * Default: 1 (yes)
+ */
+#ifndef PJ_NATIVE_ERR_POSITIVE
+# define PJ_NATIVE_ERR_POSITIVE 1
+#endif
+
+/**
* Include error message string in the library (pj_strerror()).
* This is very much desirable!
*
diff --git a/pjlib/include/pj/config_site_sample.h b/pjlib/include/pj/config_site_sample.h
index c4821de4..439d3512 100644
--- a/pjlib/include/pj/config_site_sample.h
+++ b/pjlib/include/pj/config_site_sample.h
@@ -26,23 +26,46 @@
# define PJMEDIA_HAS_SPEEX_AEC 0
#endif
+
/*
* Typical configuration for Symbian OS target
*/
#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+ /* We don't want to use float, for now */
# undef PJ_HAS_FLOATING_POINT
# define PJ_HAS_FLOATING_POINT 0
# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
+
+ /* Disable these */
# define PJMEDIA_HAS_LIBRESAMPLE 0
# define PJMEDIA_HAS_SPEEX_AEC 0
+ /* Disable all codecs but G.711, for now */
# define PJMEDIA_HAS_L16_CODEC 0
# define PJMEDIA_HAS_GSM_CODEC 0
# define PJMEDIA_HAS_ILBC_CODEC 0
# define PJMEDIA_HAS_SPEEX_CODEC 0
+# define PJSIP_MAX_PKT_LEN 8000
+
+ /* Since we don't have threads, log buffer can use static buffer */
+# define PJ_LOG_USE_STACK_BUFFER 0
+
+ /* Symbian has problem with too many large blocks */
+# define PJSIP_POOL_LEN_ENDPT 1000
+# define PJSIP_POOL_INC_ENDPT 1000
+# define PJSIP_POOL_RDATA_LEN 2000
+# define PJSIP_POOL_RDATA_INC 2000
+# define PJSIP_POOL_LEN_TDATA 2000
+# define PJSIP_POOL_INC_TDATA 512
+# define PJSIP_POOL_LEN_UA 2000
+# define PJSIP_POOL_INC_UA 1000
+# define PJSIP_POOL_TSX_LAYER_LEN 256
+# define PJSIP_POOL_TSX_LAYER_INC 256
+# define PJSIP_POOL_TSX_LEN 512
+# define PJSIP_POOL_TSX_INC 128
#endif
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index 71ba69fd..cd5d9164 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -167,7 +167,11 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* @warning Macro implementation; the syserr argument may be evaluated
* multiple times.
*/
-#define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : e + PJ_ERRNO_START_SYS)
+#if PJ_NATIVE_ERR_POSITIVE
+# define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : e + PJ_ERRNO_START_SYS)
+#else
+# define PJ_STATUS_FROM_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
+#endif
/**
* @hideinitializer
@@ -179,7 +183,11 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* multiple times. If the statcode was not created by
* pj_get_os_error or PJ_STATUS_FROM_OS, the results are undefined.
*/
-#define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : e - PJ_ERRNO_START_SYS)
+#if PJ_NATIVE_ERR_POSITIVE
+# define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : e - PJ_ERRNO_START_SYS)
+#else
+# define PJ_STATUS_TO_OS(e) (e == 0 ? PJ_SUCCESS : PJ_ERRNO_START_SYS - e)
+#endif
/**