* #36737: switch back to svn repo, remove assert in sip_transaction.c
diff --git a/jni/pjproject-android/.svn/pristine/23/23086852b30501329a59df2b68b887c91afcadd9.svn-base b/jni/pjproject-android/.svn/pristine/23/23086852b30501329a59df2b68b887c91afcadd9.svn-base
new file mode 100644
index 0000000..79330b9
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/23086852b30501329a59df2b68b887c91afcadd9.svn-base
@@ -0,0 +1,60 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJ_COMPAT_M_AUTO_H__
+#define __PJ_COMPAT_M_AUTO_H__
+
+/**
+ * @file m_auto.h
+ * @brief Automatically generated process definition file.
+ */
+
+/* Machine name, filled in by autoconf script */
+#undef PJ_M_NAME
+
+/* Endianness. It's reported on pjsip list on 09/02/13 that autoconf
+ * endianness detection failed for universal build, so special case
+ * for it here. Thanks Ruud Klaver for the fix.
+ */
+#ifdef PJ_DARWINOS
+#  ifdef __BIG_ENDIAN__
+#    define WORDS_BIGENDIAN	1
+#  endif
+#else
+    /* Endianness, as detected by autoconf */
+#  undef WORDS_BIGENDIAN
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#  define PJ_IS_LITTLE_ENDIAN	0
+#  define PJ_IS_BIG_ENDIAN	1
+#else
+#  define PJ_IS_LITTLE_ENDIAN	1
+#  define PJ_IS_BIG_ENDIAN	0
+#endif
+
+
+/* Specify if floating point is present/desired */
+#undef PJ_HAS_FLOATING_POINT
+
+/* Deprecated */
+#define PJ_HAS_PENTIUM		0
+
+#endif	/* __PJ_COMPAT_M_AUTO_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/23/230c1c15d6a4419195e502945a878dacf06f88e8.svn-base b/jni/pjproject-android/.svn/pristine/23/230c1c15d6a4419195e502945a878dacf06f88e8.svn-base
new file mode 100644
index 0000000..6c07e96
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/230c1c15d6a4419195e502945a878dacf06f88e8.svn-base
@@ -0,0 +1,70 @@
+# $Id$
+#
+# SIP account and registration sample. In this sample, the program
+# will block to wait until registration is complete
+#
+# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+#
+import sys
+import pjsua as pj
+import threading
+
+
+def log_cb(level, str, len):
+    print str,
+
+class MyAccountCallback(pj.AccountCallback):
+    sem = None
+
+    def __init__(self, account):
+        pj.AccountCallback.__init__(self, account)
+
+    def wait(self):
+        self.sem = threading.Semaphore(0)
+        self.sem.acquire()
+
+    def on_reg_state(self):
+        if self.sem:
+            if self.account.info().reg_status >= 200:
+                self.sem.release()
+
+lib = pj.Lib()
+
+try:
+    lib.init(log_cfg = pj.LogConfig(level=4, callback=log_cb))
+    lib.create_transport(pj.TransportType.UDP, pj.TransportConfig(5080))
+    lib.start()
+
+    acc = lib.create_account(pj.AccountConfig("pjsip.org", "bennylp", "***"))
+
+    acc_cb = MyAccountCallback(acc)
+    acc.set_callback(acc_cb)
+    acc_cb.wait()
+
+    print "\n"
+    print "Registration complete, status=", acc.info().reg_status, \
+          "(" + acc.info().reg_reason + ")"
+    print "\nPress ENTER to quit"
+    sys.stdin.readline()
+
+    lib.destroy()
+    lib = None
+
+except pj.Error, e:
+    print "Exception: " + str(e)
+    lib.destroy()
+
diff --git a/jni/pjproject-android/.svn/pristine/23/230cd77565281637a8b9713f90b1acbcce067707.svn-base b/jni/pjproject-android/.svn/pristine/23/230cd77565281637a8b9713f90b1acbcce067707.svn-base
new file mode 100644
index 0000000..5eb0218
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/230cd77565281637a8b9713f90b1acbcce067707.svn-base
@@ -0,0 +1,176 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#include <pjmedia-codec/amr_sdp_match.h>
+#include <pjmedia/errno.h>
+#include <pj/pool.h>
+#include <pj/string.h>
+
+
+#define GET_FMTP_IVAL_BASE(ival, base, fmtp, param, default_val) \
+    do { \
+	pj_str_t s; \
+	char *p; \
+	p = pj_stristr(&fmtp.fmt_param, &param); \
+	if (!p) { \
+	    ival = default_val; \
+	    break; \
+	} \
+	pj_strset(&s, p + param.slen, fmtp.fmt_param.slen - \
+		  (p - fmtp.fmt_param.ptr) - param.slen); \
+	ival = pj_strtoul2(&s, NULL, base); \
+    } while (0)
+
+#define GET_FMTP_IVAL(ival, fmtp, param, default_val) \
+	GET_FMTP_IVAL_BASE(ival, 10, fmtp, param, default_val)
+
+
+/* Toggle AMR octet-align setting in the fmtp. */
+static pj_status_t amr_toggle_octet_align(pj_pool_t *pool,
+					  pjmedia_sdp_media *media,
+					  unsigned fmt_idx)
+{
+    pjmedia_sdp_attr *attr;
+    pjmedia_sdp_fmtp fmtp;
+    const pj_str_t STR_OCTET_ALIGN = {"octet-align=", 12};
+    
+    enum { MAX_FMTP_STR_LEN = 160 };
+
+    attr = pjmedia_sdp_media_find_attr2(media, "fmtp", 
+					&media->desc.fmt[fmt_idx]);
+    /* Check if the AMR media format has FMTP attribute */
+    if (attr) {
+	char *p;
+	pj_status_t status;
+
+	status = pjmedia_sdp_attr_get_fmtp(attr, &fmtp);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	/* Check if the fmtp has octet-align field. */
+	p = pj_stristr(&fmtp.fmt_param, &STR_OCTET_ALIGN);
+	if (p) {
+	    /* It has, just toggle the value */
+	    unsigned octet_align;
+	    pj_str_t s;
+
+	    pj_strset(&s, p + STR_OCTET_ALIGN.slen, fmtp.fmt_param.slen -
+		      (p - fmtp.fmt_param.ptr) - STR_OCTET_ALIGN.slen);
+	    octet_align = pj_strtoul(&s);
+	    *(p + STR_OCTET_ALIGN.slen) = (char)(octet_align? '0' : '1');
+	} else {
+	    /* It doesn't, append octet-align field */
+	    char buf[MAX_FMTP_STR_LEN];
+
+	    pj_ansi_snprintf(buf, MAX_FMTP_STR_LEN, "%.*s;octet-align=1",
+			     (int)fmtp.fmt_param.slen, fmtp.fmt_param.ptr);
+	    attr->value = pj_strdup3(pool, buf);
+	}
+    } else {
+	/* Add new attribute for the AMR media format with octet-align 
+	 * field set.
+	 */
+	char buf[MAX_FMTP_STR_LEN];
+
+	attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr);
+	attr->name = pj_str("fmtp");
+	pj_ansi_snprintf(buf, MAX_FMTP_STR_LEN, "%.*s octet-align=1",
+			 (int)media->desc.fmt[fmt_idx].slen,
+		         media->desc.fmt[fmt_idx].ptr);
+	attr->value = pj_strdup3(pool, buf);
+	media->attr[media->attr_count++] = attr;
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+PJ_DEF(pj_status_t) pjmedia_codec_amr_match_sdp( pj_pool_t *pool,
+						 pjmedia_sdp_media *offer,
+						 unsigned o_fmt_idx,
+						 pjmedia_sdp_media *answer,
+						 unsigned a_fmt_idx,
+						 unsigned option)
+{
+    /* Negotiated format-param field-names constants. */
+    const pj_str_t STR_OCTET_ALIGN	= {"octet-align=", 12};
+    const pj_str_t STR_CRC		= {"crc=", 4};
+    const pj_str_t STR_ROBUST_SORTING	= {"robust-sorting=", 15};
+    const pj_str_t STR_INTERLEAVING	= {"interleaving=", 13};
+
+    /* Negotiated params and their default values. */
+    unsigned a_octet_align = 0, o_octet_align = 0;
+    unsigned a_crc = 0, o_crc = 0;
+    unsigned a_robust_sorting = 0, o_robust_sorting = 0;
+    unsigned a_interleaving = 0, o_interleaving = 0;
+
+    const pjmedia_sdp_attr *attr_ans;
+    const pjmedia_sdp_attr *attr_ofr;
+    pjmedia_sdp_fmtp fmtp;
+    pj_status_t status;
+
+    /* Parse offerer FMTP */
+    attr_ofr = pjmedia_sdp_media_find_attr2(offer, "fmtp", 
+					    &offer->desc.fmt[o_fmt_idx]);
+    if (attr_ofr) {
+	status = pjmedia_sdp_attr_get_fmtp(attr_ofr, &fmtp);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	GET_FMTP_IVAL(o_octet_align, fmtp, STR_OCTET_ALIGN, 0);
+	GET_FMTP_IVAL(o_crc, fmtp, STR_CRC, 0);
+	GET_FMTP_IVAL(o_robust_sorting, fmtp, STR_ROBUST_SORTING, 0);
+	GET_FMTP_IVAL(o_interleaving, fmtp, STR_INTERLEAVING, 0);
+    }
+
+    /* Parse answerer FMTP */
+    attr_ans = pjmedia_sdp_media_find_attr2(answer, "fmtp", 
+					    &answer->desc.fmt[a_fmt_idx]);
+    if (attr_ans) {
+	status = pjmedia_sdp_attr_get_fmtp(attr_ans, &fmtp);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	GET_FMTP_IVAL(a_octet_align, fmtp, STR_OCTET_ALIGN, 0);
+	GET_FMTP_IVAL(a_crc, fmtp, STR_CRC, 0);
+	GET_FMTP_IVAL(a_robust_sorting, fmtp, STR_ROBUST_SORTING, 0);
+	GET_FMTP_IVAL(a_interleaving, fmtp, STR_INTERLEAVING, 0);
+    }
+
+    /* First, match crc, robust-sorting, interleaving settings */
+    if (a_crc != o_crc ||
+	a_robust_sorting != o_robust_sorting ||
+	a_interleaving != o_interleaving)
+    {
+	return PJMEDIA_SDP_EFORMATNOTEQUAL;
+    }
+
+    /* Match octet-align setting */
+    if (a_octet_align != o_octet_align) {
+	/* Check if answer can be modified to match to the offer */
+	if (option & PJMEDIA_SDP_NEG_FMT_MATCH_ALLOW_MODIFY_ANSWER) {
+	    status = amr_toggle_octet_align(pool, answer, a_fmt_idx);
+	    return status;
+	} else {
+	    return PJMEDIA_SDP_EFORMATNOTEQUAL;
+	}
+    }
+
+    return PJ_SUCCESS;
+}
diff --git a/jni/pjproject-android/.svn/pristine/23/23165d23bca57045348de45de5c50b945417d90c.svn-base b/jni/pjproject-android/.svn/pristine/23/23165d23bca57045348de45de5c50b945417d90c.svn-base
new file mode 100644
index 0000000..a3d2c81
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/23165d23bca57045348de45de5c50b945417d90c.svn-base
@@ -0,0 +1,11 @@
+# $Id$
+#
+from inc_cfg import *
+
+test_param = TestParam(
+		"Callee=optional SRTP, caller=optional (with duplicated offer) SRTP",
+		[
+			InstanceParam("callee", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1"),
+			InstanceParam("caller", "--null-audio --use-srtp=3 --srtp-secure=0 --max-calls=1")
+		]
+		)
diff --git a/jni/pjproject-android/.svn/pristine/23/234aee018c5563933928ab0d8fb67446bba9f4ab.svn-base b/jni/pjproject-android/.svn/pristine/23/234aee018c5563933928ab0d8fb67446bba9f4ab.svn-base
new file mode 100644
index 0000000..8d99697
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/234aee018c5563933928ab0d8fb67446bba9f4ab.svn-base
@@ -0,0 +1,483 @@
+//------------------------------------------------------------------------------

+// File: MType.cpp

+//

+// Desc: DirectShow base classes - implements a class that holds and 

+//       manages media type information.

+//

+// Copyright (c) 1992-2001 Microsoft Corporation.  All rights reserved.

+//------------------------------------------------------------------------------

+

+#include <pjmedia-videodev/config.h>

+

+#if defined(PJMEDIA_VIDEO_DEV_HAS_DSHOW) && PJMEDIA_VIDEO_DEV_HAS_DSHOW != 0

+

+// helper class that derived pin objects can use to compare media

+// types etc. Has same data members as the struct AM_MEDIA_TYPE defined

+// in the streams IDL file, but also has (non-virtual) functions

+

+#include <streams.h>

+#include <mmreg.h>

+

+CMediaType::~CMediaType(){

+    FreeMediaType(*this);

+}

+

+

+CMediaType::CMediaType()

+{

+    InitMediaType();

+}

+

+

+CMediaType::CMediaType(const GUID * type)

+{

+    InitMediaType();

+    majortype = *type;

+}

+

+

+// copy constructor does a deep copy of the format block

+

+CMediaType::CMediaType(const AM_MEDIA_TYPE& rt, __out_opt HRESULT* phr)

+{

+    HRESULT hr = CopyMediaType(this, &rt);

+    if (FAILED(hr) && (NULL != phr)) {

+        *phr = hr;

+    }

+}

+

+

+CMediaType::CMediaType(const CMediaType& rt, __out_opt HRESULT* phr)

+{

+    HRESULT hr = CopyMediaType(this, &rt);

+    if (FAILED(hr) && (NULL != phr)) {

+        *phr = hr;

+    }

+}

+

+

+// this class inherits publicly from AM_MEDIA_TYPE so the compiler could generate

+// the following assignment operator itself, however it could introduce some

+// memory conflicts and leaks in the process because the structure contains

+// a dynamically allocated block (pbFormat) which it will not copy correctly

+

+CMediaType&

+CMediaType::operator=(const AM_MEDIA_TYPE& rt)

+{

+    Set(rt);

+    return *this;

+}

+

+CMediaType&

+CMediaType::operator=(const CMediaType& rt)

+{

+    *this = (AM_MEDIA_TYPE &) rt;

+    return *this;

+}

+

+BOOL

+CMediaType::operator == (const CMediaType& rt) const

+{

+    // I don't believe we need to check sample size or

+    // temporal compression flags, since I think these must

+    // be represented in the type, subtype and format somehow. They

+    // are pulled out as separate flags so that people who don't understand

+    // the particular format representation can still see them, but

+    // they should duplicate information in the format block.

+

+    return ((IsEqualGUID(majortype,rt.majortype) == TRUE) &&

+        (IsEqualGUID(subtype,rt.subtype) == TRUE) &&

+        (IsEqualGUID(formattype,rt.formattype) == TRUE) &&

+        (cbFormat == rt.cbFormat) &&

+        ( (cbFormat == 0) ||

+          pbFormat != NULL && rt.pbFormat != NULL &&

+          (memcmp(pbFormat, rt.pbFormat, cbFormat) == 0)));

+}

+

+

+BOOL

+CMediaType::operator != (const CMediaType& rt) const

+{

+    /* Check to see if they are equal */

+

+    if (*this == rt) {

+        return FALSE;

+    }

+    return TRUE;

+}

+

+

+HRESULT

+CMediaType::Set(const CMediaType& rt)

+{

+    return Set((AM_MEDIA_TYPE &) rt);

+}

+

+

+HRESULT

+CMediaType::Set(const AM_MEDIA_TYPE& rt)

+{

+    if (&rt != this) {

+        FreeMediaType(*this);

+        HRESULT hr = CopyMediaType(this, &rt);

+        if (FAILED(hr)) {

+            return E_OUTOFMEMORY;

+        }

+    }

+

+    return S_OK;    

+}

+

+

+BOOL

+CMediaType::IsValid() const

+{

+    return (!IsEqualGUID(majortype,GUID_NULL));

+}

+

+

+void

+CMediaType::SetType(const GUID* ptype)

+{

+    majortype = *ptype;

+}

+

+

+void

+CMediaType::SetSubtype(const GUID* ptype)

+{

+    subtype = *ptype;

+}

+

+

+ULONG

+CMediaType::GetSampleSize() const {

+    if (IsFixedSize()) {

+        return lSampleSize;

+    } else {

+        return 0;

+    }

+}

+

+

+void

+CMediaType::SetSampleSize(ULONG sz) {

+    if (sz == 0) {

+        SetVariableSize();

+    } else {

+        bFixedSizeSamples = TRUE;

+        lSampleSize = sz;

+    }

+}

+

+

+void

+CMediaType::SetVariableSize() {

+    bFixedSizeSamples = FALSE;

+}

+

+

+void

+CMediaType::SetTemporalCompression(BOOL bCompressed) {

+    bTemporalCompression = bCompressed;

+}

+

+BOOL

+CMediaType::SetFormat(__in_bcount(cb) BYTE * pformat, ULONG cb)

+{

+    if (NULL == AllocFormatBuffer(cb))

+	return(FALSE);

+

+    ASSERT(pbFormat);

+    memcpy(pbFormat, pformat, cb);

+    return(TRUE);

+}

+

+

+// set the type of the media type format block, this type defines what you

+// will actually find in the format pointer. For example FORMAT_VideoInfo or

+// FORMAT_WaveFormatEx. In the future this may be an interface pointer to a

+// property set. Before sending out media types this should be filled in.

+

+void

+CMediaType::SetFormatType(const GUID *pformattype)

+{

+    formattype = *pformattype;

+}

+

+

+// reset the format buffer

+

+void CMediaType::ResetFormatBuffer()

+{

+    if (cbFormat) {

+        CoTaskMemFree((PVOID)pbFormat);

+    }

+    cbFormat = 0;

+    pbFormat = NULL;

+}

+

+

+// allocate length bytes for the format and return a read/write pointer

+// If we cannot allocate the new block of memory we return NULL leaving

+// the original block of memory untouched (as does ReallocFormatBuffer)

+

+BYTE*

+CMediaType::AllocFormatBuffer(ULONG length)

+{

+    ASSERT(length);

+

+    // do the types have the same buffer size

+

+    if (cbFormat == length) {

+        return pbFormat;

+    }

+

+    // allocate the new format buffer

+

+    BYTE *pNewFormat = (PBYTE)CoTaskMemAlloc(length);

+    if (pNewFormat == NULL) {

+        if (length <= cbFormat) return pbFormat; //reuse the old block anyway.

+        return NULL;

+    }

+

+    // delete the old format

+

+    if (cbFormat != 0) {

+        ASSERT(pbFormat);

+        CoTaskMemFree((PVOID)pbFormat);

+    }

+

+    cbFormat = length;

+    pbFormat = pNewFormat;

+    return pbFormat;

+}

+

+

+// reallocate length bytes for the format and return a read/write pointer

+// to it. We keep as much information as we can given the new buffer size

+// if this fails the original format buffer is left untouched. The caller

+// is responsible for ensuring the size of memory required is non zero

+

+BYTE*

+CMediaType::ReallocFormatBuffer(ULONG length)

+{

+    ASSERT(length);

+

+    // do the types have the same buffer size

+

+    if (cbFormat == length) {

+        return pbFormat;

+    }

+

+    // allocate the new format buffer

+

+    BYTE *pNewFormat = (PBYTE)CoTaskMemAlloc(length);

+    if (pNewFormat == NULL) {

+        if (length <= cbFormat) return pbFormat; //reuse the old block anyway.

+        return NULL;

+    }

+

+    // copy any previous format (or part of if new is smaller)

+    // delete the old format and replace with the new one

+

+    if (cbFormat != 0) {

+        ASSERT(pbFormat);

+        memcpy(pNewFormat,pbFormat,min(length,cbFormat));

+        CoTaskMemFree((PVOID)pbFormat);

+    }

+

+    cbFormat = length;

+    pbFormat = pNewFormat;

+    return pNewFormat;

+}

+

+// initialise a media type structure

+

+void CMediaType::InitMediaType()

+{

+    ZeroMemory((PVOID)this, sizeof(*this));

+    lSampleSize = 1;

+    bFixedSizeSamples = TRUE;

+}

+

+

+// a partially specified media type can be passed to IPin::Connect

+// as a constraint on the media type used in the connection.

+// the type, subtype or format type can be null.

+BOOL

+CMediaType::IsPartiallySpecified(void) const

+{

+    if ((majortype == GUID_NULL) ||

+        (formattype == GUID_NULL)) {

+            return TRUE;

+    } else {

+        return FALSE;

+    }

+}

+

+BOOL

+CMediaType::MatchesPartial(const CMediaType* ppartial) const

+{

+    if ((ppartial->majortype != GUID_NULL) &&

+        (majortype != ppartial->majortype)) {

+            return FALSE;

+    }

+    if ((ppartial->subtype != GUID_NULL) &&

+        (subtype != ppartial->subtype)) {

+            return FALSE;

+    }

+

+    if (ppartial->formattype != GUID_NULL) {

+        // if the format block is specified then it must match exactly

+        if (formattype != ppartial->formattype) {

+            return FALSE;

+        }

+        if (cbFormat != ppartial->cbFormat) {

+            return FALSE;

+        }

+        if ((cbFormat != 0) &&

+            (memcmp(pbFormat, ppartial->pbFormat, cbFormat) != 0)) {

+                return FALSE;

+        }

+    }

+

+    return TRUE;

+

+}

+

+

+

+// general purpose function to delete a heap allocated AM_MEDIA_TYPE structure

+// which is useful when calling IEnumMediaTypes::Next as the interface

+// implementation allocates the structures which you must later delete

+// the format block may also be a pointer to an interface to release

+

+void WINAPI DeleteMediaType(__inout_opt AM_MEDIA_TYPE *pmt)

+{

+    // allow NULL pointers for coding simplicity

+

+    if (pmt == NULL) {

+        return;

+    }

+

+    FreeMediaType(*pmt);

+    CoTaskMemFree((PVOID)pmt);

+}

+

+

+// this also comes in useful when using the IEnumMediaTypes interface so

+// that you can copy a media type, you can do nearly the same by creating

+// a CMediaType object but as soon as it goes out of scope the destructor

+// will delete the memory it allocated (this takes a copy of the memory)

+

+AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const *pSrc)

+{

+    ASSERT(pSrc);

+

+    // Allocate a block of memory for the media type

+

+    AM_MEDIA_TYPE *pMediaType =

+        (AM_MEDIA_TYPE *)CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));

+

+    if (pMediaType == NULL) {

+        return NULL;

+    }

+    // Copy the variable length format block

+

+    HRESULT hr = CopyMediaType(pMediaType,pSrc);

+    if (FAILED(hr)) {

+        CoTaskMemFree((PVOID)pMediaType);

+        return NULL;

+    }

+

+    return pMediaType;

+}

+

+

+//  Copy 1 media type to another

+

+HRESULT WINAPI CopyMediaType(__out AM_MEDIA_TYPE *pmtTarget, const AM_MEDIA_TYPE *pmtSource)

+{

+    //  We'll leak if we copy onto one that already exists - there's one

+    //  case we can check like that - copying to itself.

+    ASSERT(pmtSource != pmtTarget);

+    *pmtTarget = *pmtSource;

+    if (pmtSource->cbFormat != 0) {

+        ASSERT(pmtSource->pbFormat != NULL);

+        pmtTarget->pbFormat = (PBYTE)CoTaskMemAlloc(pmtSource->cbFormat);

+        if (pmtTarget->pbFormat == NULL) {

+            pmtTarget->cbFormat = 0;

+            return E_OUTOFMEMORY;

+        } else {

+            CopyMemory((PVOID)pmtTarget->pbFormat, (PVOID)pmtSource->pbFormat,

+                       pmtTarget->cbFormat);

+        }

+    }

+    if (pmtTarget->pUnk != NULL) {

+        pmtTarget->pUnk->AddRef();

+    }

+

+    return S_OK;

+}

+

+//  Free an existing media type (ie free resources it holds)

+

+void WINAPI FreeMediaType(__inout AM_MEDIA_TYPE& mt)

+{

+    if (mt.cbFormat != 0) {

+        CoTaskMemFree((PVOID)mt.pbFormat);

+

+        // Strictly unnecessary but tidier

+        mt.cbFormat = 0;

+        mt.pbFormat = NULL;

+    }

+    if (mt.pUnk != NULL) {

+        mt.pUnk->Release();

+        mt.pUnk = NULL;

+    }

+}

+

+//  Initialize a media type from a WAVEFORMATEX

+

+STDAPI CreateAudioMediaType(

+    const WAVEFORMATEX *pwfx,

+    __out AM_MEDIA_TYPE *pmt,

+    BOOL bSetFormat

+)

+{

+    pmt->majortype            = MEDIATYPE_Audio;

+    if (pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) {

+        pmt->subtype = ((PWAVEFORMATEXTENSIBLE)pwfx)->SubFormat;

+    } else {

+        pmt->subtype              = FOURCCMap(pwfx->wFormatTag);

+    }

+    pmt->formattype           = FORMAT_WaveFormatEx;

+    pmt->bFixedSizeSamples    = TRUE;

+    pmt->bTemporalCompression = FALSE;

+    pmt->lSampleSize          = pwfx->nBlockAlign;

+    pmt->pUnk                 = NULL;

+    if (bSetFormat) {

+        if (pwfx->wFormatTag == WAVE_FORMAT_PCM) {

+            pmt->cbFormat         = sizeof(WAVEFORMATEX);

+        } else {

+            pmt->cbFormat         = sizeof(WAVEFORMATEX) + pwfx->cbSize;

+        }

+        pmt->pbFormat             = (PBYTE)CoTaskMemAlloc(pmt->cbFormat);

+        if (pmt->pbFormat == NULL) {

+            return E_OUTOFMEMORY;

+        }

+        if (pwfx->wFormatTag == WAVE_FORMAT_PCM) {

+            CopyMemory(pmt->pbFormat, pwfx, sizeof(PCMWAVEFORMAT));

+            ((WAVEFORMATEX *)pmt->pbFormat)->cbSize = 0;

+        } else {

+            CopyMemory(pmt->pbFormat, pwfx, pmt->cbFormat);

+        }

+    }

+    return S_OK;

+}

+

+// eliminate very many spurious warnings from MS compiler

+#pragma warning(disable:4514)

+

+#endif /* PJMEDIA_VIDEO_DEV_HAS_DSHOW */

diff --git a/jni/pjproject-android/.svn/pristine/23/2392e9e2f94768d3f59876ada25b27fdc6bcdb98.svn-base b/jni/pjproject-android/.svn/pristine/23/2392e9e2f94768d3f59876ada25b27fdc6bcdb98.svn-base
new file mode 100644
index 0000000..087b466
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/2392e9e2f94768d3f59876ada25b27fdc6bcdb98.svn-base
@@ -0,0 +1,165 @@
+/* Copyright (C) 2006 David Rowe */
+/**
+   @file quant_lsp_bfin.h
+   @author David Rowe
+   @brief Various compatibility routines for Speex (Blackfin version)
+*/
+/*
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+   
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+   
+   - Neither the name of the Xiph.org Foundation nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+   
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#define OVERRIDE_LSP_QUANT
+#ifdef OVERRIDE_LSP_QUANT
+
+/*
+  Note http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
+  well tell you all the magic resgister constraints used below
+  for gcc in-line asm.
+*/
+
+static int lsp_quant(
+  spx_word16_t      *x, 
+  const signed char *cdbk, 
+  int                nbVec, 
+  int                nbDim
+)
+{
+   int          j;
+   spx_word32_t best_dist=1<<30;
+   int          best_id=0;
+
+   __asm__ __volatile__
+     (
+"	%0 = 1 (X);\n\t"                       /* %0: best_dist */    
+"	%0 <<= 30;\n\t"     
+"	%1 = 0 (X);\n\t"                       /* %1: best_i         */
+"       P2 = %3\n\t"                           /* P2: ptr to cdbk    */
+"       R5 = 0;\n\t"                           /* R5: best cb entry  */
+
+"       R0 = %5;\n\t"                          /* set up circ addr   */
+"       R0 <<= 1;\n\t"
+"       L0 = R0;\n\t"                          
+"       I0 = %2;\n\t"                          /* %2: &x[0]          */
+"       B0 = %2;\n\t"                          
+
+"       R2.L = W [I0++];\n\t"
+"	LSETUP (1f, 2f) LC0 = %4;\n\t"
+"1:	  R3 = 0;\n\t"                         /* R3: dist           */
+"	  LSETUP (3f, 4f) LC1 = %5;\n\t"
+"3:       R1 = B [P2++] (X);\n\t"            
+"	    R1 <<= 5;\n\t"
+"	    R0.L = R2.L - R1.L || R2.L = W [I0++];\n\t"
+"	    R0 = R0.L*R0.L;\n\t"
+"4:	    R3 = R3 + R0;\n\t"
+
+"	  cc =R3<%0;\n\t"
+"	  if cc %0=R3;\n\t"
+"	  if cc %1=R5;\n\t"
+"2:     R5 += 1;\n\t"
+"         L0 = 0;\n\t"
+   : "=&d" (best_dist), "=&d" (best_id)
+   : "a" (x), "b" (cdbk), "a" (nbVec), "a" (nbDim)
+   : "I0", "P2", "R0", "R1", "R2", "R3", "R5", "L0", "B0", "A0"
+   );
+
+   for (j=0;j<nbDim;j++) {
+      x[j] = SUB16(x[j],SHL16((spx_word16_t)cdbk[best_id*nbDim+j],5));
+   }
+   return best_id;
+}
+#endif
+
+#define OVERRIDE_LSP_WEIGHT_QUANT
+#ifdef OVERRIDE_LSP_WEIGHT_QUANT
+
+/*
+  Note http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
+  well tell you all the magic resgister constraints used below
+  for gcc in-line asm.
+*/
+
+static int lsp_weight_quant(
+  spx_word16_t      *x, 
+  spx_word16_t      *weight, 
+  const signed char *cdbk, 
+  int                nbVec, 
+  int                nbDim
+)
+{
+   int          j;
+   spx_word32_t best_dist=1<<30;
+   int          best_id=0;
+
+   __asm__ __volatile__
+     (
+"	%0 = 1 (X);\n\t"                       /* %0: best_dist */    
+"	%0 <<= 30;\n\t"     
+"	%1 = 0 (X);\n\t"                       /* %1: best_i         */
+"       P2 = %4\n\t"                           /* P2: ptr to cdbk    */
+"       R5 = 0;\n\t"                           /* R5: best cb entry  */
+
+"       R0 = %6;\n\t"                          /* set up circ addr   */
+"       R0 <<= 1;\n\t"
+"       L0 = R0;\n\t"                          
+"       L1 = R0;\n\t"
+"       I0 = %2;\n\t"                          /* %2: &x[0]          */
+"	I1 = %3;\n\t"                          /* %3: &weight[0]     */
+"       B0 = %2;\n\t"                          
+"	B1 = %3;\n\t"                          
+
+"	LSETUP (1f, 2f) LC0 = %5;\n\t"
+"1:	  R3 = 0 (X);\n\t"                     /* R3: dist           */
+"	  LSETUP (3f, 4f) LC1 = %6;\n\t"
+"3:	    R0.L = W [I0++] || R2.L = W [I1++];\n\t"
+"           R1 = B [P2++] (X);\n\t"            
+"	    R1 <<= 5;\n\t"
+"	    R0.L = R0.L - R1.L;\n\t"
+"           R0 = R0.L*R0.L;\n\t"
+"	    A1 = R2.L*R0.L (M,IS);\n\t"
+"	    A1 = A1 >>> 16;\n\t"
+"	    R1 = (A1 += R2.L*R0.H) (IS);\n\t"
+"4:	    R3 = R3 + R1;\n\t"
+
+"	  cc =R3<%0;\n\t"
+"	  if cc %0=R3;\n\t"
+"	  if cc %1=R5;\n\t"
+"2:    R5 += 1;\n\t"
+"         L0 = 0;\n\t"
+"         L1 = 0;\n\t"
+   : "=&d" (best_dist), "=&d" (best_id)
+   : "a" (x), "a" (weight), "b" (cdbk), "a" (nbVec), "a" (nbDim)
+   : "I0", "I1", "P2", "R0", "R1", "R2", "R3", "R5", "A1",
+     "L0", "L1", "B0", "B1"
+   );
+
+   for (j=0;j<nbDim;j++) {
+      x[j] = SUB16(x[j],SHL16((spx_word16_t)cdbk[best_id*nbDim+j],5));
+   }
+   return best_id;
+}
+#endif
diff --git a/jni/pjproject-android/.svn/pristine/23/23b51a463d005c6a70c78a3d9bb1f1ec916638bc.svn-base b/jni/pjproject-android/.svn/pristine/23/23b51a463d005c6a70c78a3d9bb1f1ec916638bc.svn-base
new file mode 100644
index 0000000..4e728a5
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/23b51a463d005c6a70c78a3d9bb1f1ec916638bc.svn-base
@@ -0,0 +1,26 @@
+/*-------------------------------------------------------------------
+ *          Example algorithms f1, f1*, f2, f3, f4, f5, f5*
+ *-------------------------------------------------------------------
+ *
+ *  A sample implementation of the example 3GPP authentication and
+ *  key agreement functions f1, f1*, f2, f3, f4, f5 and f5*.  This is
+ *  a byte-oriented implementation of the functions, and of the block
+ *  cipher kernel function Rijndael.
+ *
+ *  This has been coded for clarity, not necessarily for efficiency.
+ *
+ *  The functions f2, f3, f4 and f5 share the same inputs and have
+ *  been coded together as a single function.  f1, f1* and f5* are
+ *  all coded separately.
+ *
+ *-----------------------------------------------------------------*/
+
+#ifndef RIJNDAEL_H
+#define RIJNDAEL_H
+
+
+void RijndaelKeySchedule( u8 key[16] );
+void RijndaelEncrypt( u8 input[16], u8 output[16] );
+
+
+#endif
diff --git a/jni/pjproject-android/.svn/pristine/23/23b5cad17b43cb4edcd89639cf0fe5ff0c5988c8.svn-base b/jni/pjproject-android/.svn/pristine/23/23b5cad17b43cb4edcd89639cf0fe5ff0c5988c8.svn-base
new file mode 100644
index 0000000..0ec7021
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/23b5cad17b43cb4edcd89639cf0fe5ff0c5988c8.svn-base
@@ -0,0 +1,33 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_AUDIODEV_H__
+#define __PJMEDIA_AUDIODEV_H__
+
+/**
+ * @file pjmedia_audiodev.h
+ * @brief PJMEDIA main header file.
+ */
+
+#include <pjmedia-audiodev/audiodev.h>
+#include <pjmedia-audiodev/audiodev_imp.h>
+#include <pjmedia-audiodev/audiotest.h>
+
+#endif	/* __PJMEDIA_AUDIODEV_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/23/23bbf802e0a5617afc962eb61ae1caa1c7c56041.svn-base b/jni/pjproject-android/.svn/pristine/23/23bbf802e0a5617afc962eb61ae1caa1c7c56041.svn-base
new file mode 100644
index 0000000..d4dc8ff
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/23/23bbf802e0a5617afc962eb61ae1caa1c7c56041.svn-base
@@ -0,0 +1,24 @@
+<?xml version="1.0" ?>
+<Scenario site="$(HOSTNAME)" url="http://my.cdash.org/submit.php?project=PJSIP" wdir="$(PJDIR)">
+ 
+	<Submit group="Experimental" build="$(OS)-$(VS)-$(VSTARGET)-default" exclude="(.*amr.*)">
+		<Update />
+		<FileWrite file="pjlib/include/pj/config_site.h">
+		  <![CDATA[
+/* Written by ccdash */
+#define PJ_HAS_IPV6		1
+#define PJMEDIA_HAS_G7221_CODEC 1
+#define PJ_TODO(x)
+]]>			
+		</FileWrite>
+		<Configure cmd="cmd /c echo success" />
+		<Build cmd='vcbuild.exe /nologo /nohtmllog /nocolor /rebuild pjproject-vs8.sln "$(VSTARGET)|Win32"' />
+		<Test name="pjlib-test" info="" wdir="pjlib/bin" cmd="pjlib-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST)/>
+		<Test name="pjlib-util-test" info="" wdir="pjlib-util/bin" cmd="pjlib-util-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) />
+		<Test name="pjnath-test" info="" wdir="pjnath/bin" cmd="pjnath-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) />
+		<Test name="pjmedia-test" info="" wdir="pjmedia/bin" cmd="pjmedia-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) />
+		<Test name="pjsip-test" info="" wdir="pjsip/bin" cmd="pjsip-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) />
+		$(PJSUA-TESTS)
+	</Submit>
+	
+</Scenario>