* #27232: jni: added pjproject checkout as regular git content

We will remove it once the next release of pjsip (with Android support)
comes out and is merged into SFLphone.
diff --git a/jni/pjproject-android/.svn/pristine/9f/9f0a19dbf32814297a0ce0c2728dc7c576267834.svn-base b/jni/pjproject-android/.svn/pristine/9f/9f0a19dbf32814297a0ce0c2728dc7c576267834.svn-base
new file mode 100644
index 0000000..7dafd52
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9f0a19dbf32814297a0ce0c2728dc7c576267834.svn-base
@@ -0,0 +1,125 @@
+# $Id$
+import time
+import imp
+import sys
+import inc_const as const
+from inc_cfg import *
+
+# Load configuration
+cfg_file = imp.load_source("cfg_file", ARGS[1])
+
+
+# Test body function
+def test_func(t):
+	u1 = t.process[0]
+	uri1 = cfg_file.test_param.inst_params[0].uri
+	acc1 = "-1"
+	u2 = t.process[1]
+	uri2 = cfg_file.test_param.inst_params[1].uri
+	acc2 = "-1"
+
+	# if have_reg then wait for couple of seconds for PUBLISH
+	# to complete (just in case pUBLISH is used)
+	if u1.inst_param.have_reg:
+		time.sleep(1)
+	if u2.inst_param.have_reg:
+		time.sleep(1)
+
+	# U1 adds U2 as buddy
+	u1.send("+b")
+	u1.send(uri2)
+	u1.expect("Subscription state changed NULL --> SENT")
+	u1.expect("Presence subscription.*is ACCEPTED")
+	if not u2.inst_param.have_publish:
+		# Process incoming SUBSCRIBE in U2
+		# Finds out which account gets the subscription in U2
+		line = u2.expect("pjsua_pres.*subscription.*using account")
+		acc2 = line.split("using account ")[1]
+	# wait until we've got Online notification
+	u1.expect(uri2 + ".*Online")
+
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# U2 adds U1 as buddy
+	u2.send("+b")
+	u2.send(uri1)
+	u2.expect("Subscription state changed NULL --> SENT")
+	u2.expect("Presence subscription.*is ACCEPTED")
+	if not u1.inst_param.have_publish:
+		# Process incoming SUBSCRIBE in U1
+		# Finds out which account gets the subscription in U1
+		line = u1.expect("pjsua_pres.*subscription.*using account")
+		acc1 = line.split("using account ")[1]
+	# wait until we've got Online notification
+	u2.expect(uri1 + ".*Online")
+
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# Set current account in both U1 and U2
+	if acc1!="-1":
+		u1.send(">")
+		u1.send(acc1)
+		u1.expect("Current account changed")
+	if acc2!="-1":
+		u2.send(">")
+		u2.send(acc2)
+		u2.expect("Current account changed")
+
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# u2 toggles online status
+	u2.send("t")
+	u1.expect(uri2 + ".*status.*Offline")
+	u2.expect("offline")
+	
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# u1 toggles online status
+	u1.send("t")
+	u2.expect(uri1 + ".*status.*Offline")
+	u1.expect("offline")
+
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# u2 set online status to On the phone
+	u2.send("T")
+	u2.send("3")
+	u1.expect(uri2 + ".*status.*On the phone")
+	u2.expect("On the phone")
+	
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+	# U1 send IM
+	im_text = "Hello World from U1"
+	u1.send("i")
+	u1.send(uri2)
+	u2.expect(" is typing")
+	u1.send(im_text)
+	u1.expect(im_text+".*delivered successfully")
+	u2.expect("MESSAGE from.*"+im_text)
+	
+	# Synchronize stdout
+	u1.sync_stdout()
+	u2.sync_stdout()
+
+
+# Here where it all comes together
+test = cfg_file.test_param
+test.test_func = test_func
+
diff --git a/jni/pjproject-android/.svn/pristine/9f/9f347f756fb3686e8ceeb1afba2719cb4e55b99e.svn-base b/jni/pjproject-android/.svn/pristine/9f/9f347f756fb3686e8ceeb1afba2719cb4e55b99e.svn-base
new file mode 100644
index 0000000..c2f9f9a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9f347f756fb3686e8ceeb1afba2719cb4e55b99e.svn-base
@@ -0,0 +1,1054 @@
+/* $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/passthrough.h>
+#include <pjmedia-codec/amr_sdp_match.h>
+#include <pjmedia/codec.h>
+#include <pjmedia/errno.h>
+#include <pjmedia/endpoint.h>
+#include <pjmedia/port.h>
+#include <pj/assert.h>
+#include <pj/log.h>
+#include <pj/math.h>
+#include <pj/pool.h>
+#include <pj/string.h>
+#include <pj/os.h>
+
+/*
+ * Only build this file if PJMEDIA_HAS_PASSTHROUGH_CODECS != 0
+ */
+#if defined(PJMEDIA_HAS_PASSTHROUGH_CODECS) && PJMEDIA_HAS_PASSTHROUGH_CODECS!=0
+
+#define THIS_FILE   "passthrough.c"
+
+
+/* Prototypes for passthrough codecs factory */
+static pj_status_t test_alloc( pjmedia_codec_factory *factory, 
+			       const pjmedia_codec_info *id );
+static pj_status_t default_attr( pjmedia_codec_factory *factory, 
+				 const pjmedia_codec_info *id, 
+				 pjmedia_codec_param *attr );
+static pj_status_t enum_codecs( pjmedia_codec_factory *factory, 
+				unsigned *count, 
+				pjmedia_codec_info codecs[]);
+static pj_status_t alloc_codec( pjmedia_codec_factory *factory, 
+				const pjmedia_codec_info *id, 
+				pjmedia_codec **p_codec);
+static pj_status_t dealloc_codec( pjmedia_codec_factory *factory, 
+				  pjmedia_codec *codec );
+
+/* Prototypes for passthrough codecs implementation. */
+static pj_status_t codec_init( pjmedia_codec *codec, 
+			       pj_pool_t *pool );
+static pj_status_t codec_open( pjmedia_codec *codec, 
+			       pjmedia_codec_param *attr );
+static pj_status_t codec_close( pjmedia_codec *codec );
+static pj_status_t codec_modify(pjmedia_codec *codec, 
+			        const pjmedia_codec_param *attr );
+static pj_status_t codec_parse( pjmedia_codec *codec,
+			        void *pkt,
+				pj_size_t pkt_size,
+				const pj_timestamp *ts,
+				unsigned *frame_cnt,
+				pjmedia_frame frames[]);
+static pj_status_t codec_encode( pjmedia_codec *codec, 
+				 const struct pjmedia_frame *input,
+				 unsigned output_buf_len,
+				 struct pjmedia_frame *output);
+static pj_status_t codec_decode( pjmedia_codec *codec,
+				 const struct pjmedia_frame *input,
+				 unsigned output_buf_len, 
+				 struct pjmedia_frame *output);
+static pj_status_t codec_recover( pjmedia_codec *codec, 
+				  unsigned output_buf_len, 
+				  struct pjmedia_frame *output);
+
+/* Definition for passthrough codecs operations. */
+static pjmedia_codec_op codec_op = 
+{
+    &codec_init,
+    &codec_open,
+    &codec_close,
+    &codec_modify,
+    &codec_parse,
+    &codec_encode,
+    &codec_decode,
+    &codec_recover
+};
+
+/* Definition for passthrough codecs factory operations. */
+static pjmedia_codec_factory_op codec_factory_op =
+{
+    &test_alloc,
+    &default_attr,
+    &enum_codecs,
+    &alloc_codec,
+    &dealloc_codec,
+    &pjmedia_codec_passthrough_deinit
+};
+
+/* Passthrough codecs factory */
+static struct codec_factory {
+    pjmedia_codec_factory    base;
+    pjmedia_endpt	    *endpt;
+    pj_pool_t		    *pool;
+    pj_mutex_t		    *mutex;
+} codec_factory;
+
+/* Passthrough codecs private data. */
+typedef struct codec_private {
+    pj_pool_t		*pool;		    /**< Pool for each instance.    */
+    int			 codec_idx;	    /**< Codec index.		    */
+    void		*codec_setting;	    /**< Specific codec setting.    */
+    pj_uint16_t		 avg_frame_size;    /**< Average of frame size.	    */
+    unsigned		 samples_per_frame; /**< Samples per frame, for iLBC
+						 this can be 240 or 160, can
+						 only be known after codec is
+						 opened.		    */
+} codec_private_t;
+
+
+
+/* CUSTOM CALLBACKS */
+
+/* Parse frames from a packet. Default behaviour of frame parsing is 
+ * just separating frames based on calculating frame length derived 
+ * from bitrate. Implement this callback when the default behaviour is 
+ * unapplicable.
+ */
+typedef pj_status_t (*parse_cb)(codec_private_t *codec_data, void *pkt, 
+				pj_size_t pkt_size, const pj_timestamp *ts,
+				unsigned *frame_cnt, pjmedia_frame frames[]);
+
+/* Pack frames into a packet. Default behaviour of packing frames is 
+ * just stacking the frames with octet aligned without adding any 
+ * payload header. Implement this callback when the default behaviour is
+ * unapplicable.
+ */
+typedef pj_status_t (*pack_cb)(codec_private_t *codec_data, 
+			       const struct pjmedia_frame_ext *input,
+			       unsigned output_buf_len, 
+			       struct pjmedia_frame *output);
+
+
+/* Custom callback implementations. */
+static pj_status_t parse_amr( codec_private_t *codec_data, void *pkt, 
+			      pj_size_t pkt_size, const pj_timestamp *ts,
+			      unsigned *frame_cnt, pjmedia_frame frames[]);
+static pj_status_t pack_amr ( codec_private_t *codec_data,
+			      const struct pjmedia_frame_ext *input,
+			      unsigned output_buf_len, 
+			      struct pjmedia_frame *output);
+
+
+/* Passthrough codec implementation descriptions. */
+static struct codec_desc {
+    int		     enabled;		/* Is this codec enabled?	    */
+    const char	    *name;		/* Codec name.			    */
+    pj_uint8_t	     pt;		/* Payload type.		    */
+    pjmedia_format_id fmt_id;		/* Source format.		    */
+    unsigned	     clock_rate;	/* Codec's clock rate.		    */
+    unsigned	     channel_count;	/* Codec's channel count.	    */
+    unsigned	     samples_per_frame;	/* Codec's samples count.	    */
+    unsigned	     def_bitrate;	/* Default bitrate of this codec.   */
+    unsigned	     max_bitrate;	/* Maximum bitrate of this codec.   */
+    pj_uint8_t	     frm_per_pkt;	/* Default num of frames per packet.*/
+    pj_uint8_t	     vad;		/* VAD enabled/disabled.	    */
+    pj_uint8_t	     plc;		/* PLC enabled/disabled.	    */
+    parse_cb	     parse;		/* Callback to parse bitstream.	    */
+    pack_cb	     pack;		/* Callback to pack bitstream.	    */
+    pjmedia_codec_fmtp dec_fmtp;	/* Decoder's fmtp params.	    */
+}
+
+codec_desc[] = 
+{
+#   if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
+    {1, "AMR",	    PJMEDIA_RTP_PT_AMR,       PJMEDIA_FORMAT_AMR,
+		    8000, 1, 160, 
+		    7400, 12200, 2, 1, 1,
+		    &parse_amr, &pack_amr
+		    /*, {1, {{{"octet-align", 11}, {"1", 1}}} } */
+    },
+#   endif
+
+#   if PJMEDIA_HAS_PASSTHROUGH_CODEC_G729
+    {1, "G729",	    PJMEDIA_RTP_PT_G729,      PJMEDIA_FORMAT_G729,
+		    8000, 1,  80,
+		    8000, 8000, 2, 1, 1
+    },
+#   endif
+
+#   if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
+    {1, "iLBC",	    PJMEDIA_RTP_PT_ILBC,      PJMEDIA_FORMAT_ILBC,
+		    8000, 1,  240,
+		    13333, 15200, 1, 1, 1,
+		    NULL, NULL,
+		    {1, {{{"mode", 4}, {"30", 2}}} }
+    },
+#   endif
+
+#   if PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU
+    {1, "PCMU",	    PJMEDIA_RTP_PT_PCMU,      PJMEDIA_FORMAT_PCMU,
+		    8000, 1,  80,
+		    64000, 64000, 2, 1, 1
+    },
+#   endif
+
+#   if PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA
+    {1, "PCMA",	    PJMEDIA_RTP_PT_PCMA,      PJMEDIA_FORMAT_PCMA,
+		    8000, 1,  80,
+		    64000, 64000, 2, 1, 1
+    },
+#   endif
+};
+
+
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
+
+#include <pjmedia-codec/amr_helper.h>
+
+typedef struct amr_settings_t {
+    pjmedia_codec_amr_pack_setting enc_setting;
+    pjmedia_codec_amr_pack_setting dec_setting;
+    pj_int8_t enc_mode;
+} amr_settings_t;
+
+
+/* Pack AMR payload */
+static pj_status_t pack_amr ( codec_private_t *codec_data,
+			      const struct pjmedia_frame_ext *input,
+			      unsigned output_buf_len, 
+			      struct pjmedia_frame *output)
+{
+    enum {MAX_FRAMES_PER_PACKET = PJMEDIA_MAX_FRAME_DURATION_MS / 20};
+
+    pjmedia_frame frames[MAX_FRAMES_PER_PACKET];
+    amr_settings_t* setting = (amr_settings_t*)codec_data->codec_setting;
+    pjmedia_codec_amr_pack_setting *enc_setting = &setting->enc_setting;
+    pj_uint8_t SID_FT;
+    unsigned i;
+
+    pj_assert(input->subframe_cnt <= MAX_FRAMES_PER_PACKET);
+
+    SID_FT = (pj_uint8_t)(enc_setting->amr_nb? 8 : 9);
+
+    /* Get frames */
+    for (i = 0; i < input->subframe_cnt; ++i) {
+	pjmedia_frame_ext_subframe *sf;
+	pjmedia_codec_amr_bit_info *info;
+	unsigned len;
+	
+	sf = pjmedia_frame_ext_get_subframe(input, i);
+	len = (sf->bitlen + 7) >> 3;
+	
+	info = (pjmedia_codec_amr_bit_info*) &frames[i].bit_info;
+	pj_bzero(info, sizeof(*info));
+	
+	if (len == 0) {
+	    /* DTX */
+	    info->frame_type = 15;
+	} else {
+	    info->frame_type = pjmedia_codec_amr_get_mode2(enc_setting->amr_nb, 
+							   len);
+	}
+	info->good_quality = 1;
+	info->mode = setting->enc_mode;
+	if (info->frame_type == SID_FT)
+	    info->STI = (sf->data[4] >> 4) & 1;
+
+	frames[i].buf = sf->data;
+	frames[i].size = len;
+    }
+
+    output->size = output_buf_len;
+
+    return pjmedia_codec_amr_pack(frames, input->subframe_cnt, enc_setting, 
+				  output->buf, &output->size);
+}
+
+
+/* Parse AMR payload into frames. */
+static pj_status_t parse_amr(codec_private_t *codec_data, void *pkt, 
+			     pj_size_t pkt_size, const pj_timestamp *ts,
+			     unsigned *frame_cnt, pjmedia_frame frames[])
+{
+    amr_settings_t* s = (amr_settings_t*)codec_data->codec_setting;
+    pjmedia_codec_amr_pack_setting *setting;
+    pj_status_t status;
+    pj_uint8_t cmr;
+
+    setting = &s->dec_setting;
+
+    status = pjmedia_codec_amr_parse(pkt, pkt_size, ts, setting, frames, 
+				     frame_cnt, &cmr);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    // CMR is not supported for now. 
+    /* Check Change Mode Request. */
+    //if ((setting->amr_nb && cmr <= 7) || (!setting->amr_nb && cmr <= 8)) {
+    //	s->enc_mode = cmr;
+    //}
+
+    return PJ_SUCCESS;
+}
+
+#endif /* PJMEDIA_HAS_PASSTROUGH_CODEC_AMR */
+
+
+/*
+ * Initialize and register passthrough codec factory to pjmedia endpoint.
+ */
+PJ_DEF(pj_status_t) pjmedia_codec_passthrough_init( pjmedia_endpt *endpt )
+{
+    pjmedia_codec_mgr *codec_mgr;
+    pj_str_t codec_name;
+    pj_status_t status;
+
+    if (codec_factory.pool != NULL) {
+	/* Already initialized. */
+	return PJ_EEXISTS;
+    }
+
+    /* Create passthrough codec factory. */
+    codec_factory.base.op = &codec_factory_op;
+    codec_factory.base.factory_data = NULL;
+    codec_factory.endpt = endpt;
+
+    codec_factory.pool = pjmedia_endpt_create_pool(endpt, "Passthrough codecs",
+						   4000, 4000);
+    if (!codec_factory.pool)
+	return PJ_ENOMEM;
+
+    /* Create mutex. */
+    status = pj_mutex_create_simple(codec_factory.pool, "Passthrough codecs",
+				    &codec_factory.mutex);
+    if (status != PJ_SUCCESS)
+	goto on_error;
+
+    /* Get the codec manager. */
+    codec_mgr = pjmedia_endpt_get_codec_mgr(endpt);
+    if (!codec_mgr) {
+	status = PJ_EINVALIDOP;
+	goto on_error;
+    }
+
+    /* Register format match callback. */
+#if PJMEDIA_HAS_PASSTROUGH_CODEC_AMR
+    pj_cstr(&codec_name, "AMR");
+    status = pjmedia_sdp_neg_register_fmt_match_cb(
+					&codec_name,
+					&pjmedia_codec_amr_match_sdp);
+    if (status != PJ_SUCCESS)
+	goto on_error;
+#endif
+
+    /* Suppress compile warning */
+    PJ_UNUSED_ARG(codec_name);
+
+    /* Register codec factory to endpoint. */
+    status = pjmedia_codec_mgr_register_factory(codec_mgr, 
+						&codec_factory.base);
+    if (status != PJ_SUCCESS)
+	goto on_error;
+
+    /* Done. */
+    return PJ_SUCCESS;
+
+on_error:
+    pj_pool_release(codec_factory.pool);
+    codec_factory.pool = NULL;
+    return status;
+}
+
+/*
+ * Initialize and register passthrough codec factory to pjmedia endpoint.
+ */
+PJ_DEF(pj_status_t) pjmedia_codec_passthrough_init2( 
+		      pjmedia_endpt *endpt,
+		      const pjmedia_codec_passthrough_setting *setting)
+{
+    if (codec_factory.pool != NULL) {
+	/* Already initialized. */
+	return PJ_EEXISTS;
+    }
+
+    if (setting != NULL) {
+	unsigned i;
+
+	/* Enable/disable codecs based on the specified encoding formats */
+	for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	    pj_bool_t enabled = PJ_FALSE;
+	    unsigned j;
+
+	    for (j = 0; j < setting->fmt_cnt && !enabled; ++j) {
+		if ((pj_uint32_t)codec_desc[i].fmt_id == setting->fmts[j].id)
+		    enabled = PJ_TRUE;
+	    }
+
+	    codec_desc[i].enabled = enabled;
+	}
+
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
+	/* Update iLBC codec description based on default mode setting. */
+	for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	    if (codec_desc[i].enabled && 
+		codec_desc[i].fmt_id == PJMEDIA_FORMAT_ILBC)
+	    {
+		codec_desc[i].samples_per_frame = 
+				(setting->ilbc_mode == 20? 160 : 240);
+		codec_desc[i].def_bitrate = 
+				(setting->ilbc_mode == 20? 15200 : 13333);
+		pj_strset2(&codec_desc[i].dec_fmtp.param[0].val, 
+				(setting->ilbc_mode == 20? "20" : "30"));
+		break;
+	    }
+	}
+#endif
+    }
+
+    return pjmedia_codec_passthrough_init(endpt);
+}
+
+/*
+ * Unregister passthrough codecs factory from pjmedia endpoint.
+ */
+PJ_DEF(pj_status_t) pjmedia_codec_passthrough_deinit(void)
+{
+    pjmedia_codec_mgr *codec_mgr;
+    unsigned i;
+    pj_status_t status;
+
+    if (codec_factory.pool == NULL) {
+	/* Already deinitialized */
+	return PJ_SUCCESS;
+    }
+
+    pj_mutex_lock(codec_factory.mutex);
+
+    /* Get the codec manager. */
+    codec_mgr = pjmedia_endpt_get_codec_mgr(codec_factory.endpt);
+    if (!codec_mgr) {
+	pj_pool_release(codec_factory.pool);
+	codec_factory.pool = NULL;
+	return PJ_EINVALIDOP;
+    }
+
+    /* Unregister passthrough codecs factory. */
+    status = pjmedia_codec_mgr_unregister_factory(codec_mgr,
+						  &codec_factory.base);
+    
+    /* Destroy mutex. */
+    pj_mutex_destroy(codec_factory.mutex);
+
+    /* Destroy pool. */
+    pj_pool_release(codec_factory.pool);
+    codec_factory.pool = NULL;
+
+    /* Re-enable all codecs in the codec_desc. */
+    for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	codec_desc[i].enabled = PJ_TRUE;
+    }
+
+    return status;
+}
+
+/* 
+ * Check if factory can allocate the specified codec. 
+ */
+static pj_status_t test_alloc( pjmedia_codec_factory *factory, 
+			       const pjmedia_codec_info *info )
+{
+    unsigned i;
+
+    PJ_UNUSED_ARG(factory);
+
+    /* Type MUST be audio. */
+    if (info->type != PJMEDIA_TYPE_AUDIO)
+	return PJMEDIA_CODEC_EUNSUP;
+
+    for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	pj_str_t name = pj_str((char*)codec_desc[i].name);
+	if ((pj_stricmp(&info->encoding_name, &name) == 0) &&
+	    (info->clock_rate == (unsigned)codec_desc[i].clock_rate) &&
+	    (info->channel_cnt == (unsigned)codec_desc[i].channel_count) &&
+	    (codec_desc[i].enabled))
+	{
+	    return PJ_SUCCESS;
+	}
+    }
+    
+    /* Unsupported, or mode is disabled. */
+    return PJMEDIA_CODEC_EUNSUP;
+}
+
+/*
+ * Generate default attribute.
+ */
+static pj_status_t default_attr ( pjmedia_codec_factory *factory, 
+				  const pjmedia_codec_info *id, 
+				  pjmedia_codec_param *attr )
+{
+    unsigned i;
+
+    PJ_ASSERT_RETURN(factory==&codec_factory.base, PJ_EINVAL);
+
+    pj_bzero(attr, sizeof(pjmedia_codec_param));
+
+    for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	pj_str_t name = pj_str((char*)codec_desc[i].name);
+	if ((pj_stricmp(&id->encoding_name, &name) == 0) &&
+	    (id->clock_rate == (unsigned)codec_desc[i].clock_rate) &&
+	    (id->channel_cnt == (unsigned)codec_desc[i].channel_count) &&
+	    (id->pt == (unsigned)codec_desc[i].pt))
+	{
+	    attr->info.pt = (pj_uint8_t)id->pt;
+	    attr->info.channel_cnt = codec_desc[i].channel_count;
+	    attr->info.clock_rate = codec_desc[i].clock_rate;
+	    attr->info.avg_bps = codec_desc[i].def_bitrate;
+	    attr->info.max_bps = codec_desc[i].max_bitrate;
+	    attr->info.pcm_bits_per_sample = 16;
+	    attr->info.frm_ptime =  (pj_uint16_t)
+				    (codec_desc[i].samples_per_frame * 1000 / 
+				    codec_desc[i].channel_count / 
+				    codec_desc[i].clock_rate);
+	    attr->info.fmt_id = codec_desc[i].fmt_id;
+
+	    /* Default flags. */
+	    attr->setting.frm_per_pkt = codec_desc[i].frm_per_pkt;
+	    attr->setting.plc = codec_desc[i].plc;
+	    attr->setting.penh= 0;
+	    attr->setting.vad = codec_desc[i].vad;
+	    attr->setting.cng = attr->setting.vad;
+	    attr->setting.dec_fmtp = codec_desc[i].dec_fmtp;
+
+	    if (attr->setting.vad == 0) {
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_G729
+		if (id->pt == PJMEDIA_RTP_PT_G729) {
+		    /* Signal G729 Annex B is being disabled */
+		    attr->setting.dec_fmtp.cnt = 1;
+		    pj_strset2(&attr->setting.dec_fmtp.param[0].name, "annexb");
+		    pj_strset2(&attr->setting.dec_fmtp.param[0].val, "no");
+		}
+#endif
+	    }
+
+	    return PJ_SUCCESS;
+	}
+    }
+
+    return PJMEDIA_CODEC_EUNSUP;
+}
+
+/*
+ * Enum codecs supported by this factory.
+ */
+static pj_status_t enum_codecs( pjmedia_codec_factory *factory, 
+				unsigned *count, 
+				pjmedia_codec_info codecs[])
+{
+    unsigned max;
+    unsigned i;
+
+    PJ_UNUSED_ARG(factory);
+    PJ_ASSERT_RETURN(codecs && *count > 0, PJ_EINVAL);
+
+    max = *count;
+    
+    for (i = 0, *count = 0; i < PJ_ARRAY_SIZE(codec_desc) && *count < max; ++i) 
+    {
+	if (!codec_desc[i].enabled)
+	    continue;
+
+	pj_bzero(&codecs[*count], sizeof(pjmedia_codec_info));
+	codecs[*count].encoding_name = pj_str((char*)codec_desc[i].name);
+	codecs[*count].pt = codec_desc[i].pt;
+	codecs[*count].type = PJMEDIA_TYPE_AUDIO;
+	codecs[*count].clock_rate = codec_desc[i].clock_rate;
+	codecs[*count].channel_cnt = codec_desc[i].channel_count;
+
+	++*count;
+    }
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Allocate a new codec instance.
+ */
+static pj_status_t alloc_codec( pjmedia_codec_factory *factory, 
+				const pjmedia_codec_info *id,
+				pjmedia_codec **p_codec)
+{
+    codec_private_t *codec_data;
+    pjmedia_codec *codec;
+    int idx;
+    pj_pool_t *pool;
+    unsigned i;
+
+    PJ_ASSERT_RETURN(factory && id && p_codec, PJ_EINVAL);
+    PJ_ASSERT_RETURN(factory == &codec_factory.base, PJ_EINVAL);
+
+    pj_mutex_lock(codec_factory.mutex);
+
+    /* Find codec's index */
+    idx = -1;
+    for (i = 0; i < PJ_ARRAY_SIZE(codec_desc); ++i) {
+	pj_str_t name = pj_str((char*)codec_desc[i].name);
+	if ((pj_stricmp(&id->encoding_name, &name) == 0) &&
+	    (id->clock_rate == (unsigned)codec_desc[i].clock_rate) &&
+	    (id->channel_cnt == (unsigned)codec_desc[i].channel_count) &&
+	    (codec_desc[i].enabled))
+	{
+	    idx = i;
+	    break;
+	}
+    }
+    if (idx == -1) {
+	*p_codec = NULL;
+	return PJMEDIA_CODEC_EUNSUP;
+    }
+
+    /* Create pool for codec instance */
+    pool = pjmedia_endpt_create_pool(codec_factory.endpt, "passthroughcodec",
+				     512, 512);
+    codec = PJ_POOL_ZALLOC_T(pool, pjmedia_codec);
+    codec->op = &codec_op;
+    codec->factory = factory;
+    codec->codec_data = PJ_POOL_ZALLOC_T(pool, codec_private_t);
+    codec_data = (codec_private_t*) codec->codec_data;
+    codec_data->pool = pool;
+    codec_data->codec_idx = idx;
+
+    pj_mutex_unlock(codec_factory.mutex);
+
+    *p_codec = codec;
+    return PJ_SUCCESS;
+}
+
+/*
+ * Free codec.
+ */
+static pj_status_t dealloc_codec( pjmedia_codec_factory *factory, 
+				  pjmedia_codec *codec )
+{
+    codec_private_t *codec_data;
+
+    PJ_ASSERT_RETURN(factory && codec, PJ_EINVAL);
+    PJ_ASSERT_RETURN(factory == &codec_factory.base, PJ_EINVAL);
+
+    /* Close codec, if it's not closed. */
+    codec_data = (codec_private_t*) codec->codec_data;
+    codec_close(codec);
+
+    pj_pool_release(codec_data->pool);
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Init codec.
+ */
+static pj_status_t codec_init( pjmedia_codec *codec, 
+			       pj_pool_t *pool )
+{
+    PJ_UNUSED_ARG(codec);
+    PJ_UNUSED_ARG(pool);
+    return PJ_SUCCESS;
+}
+
+/*
+ * Open codec.
+ */
+static pj_status_t codec_open( pjmedia_codec *codec, 
+			       pjmedia_codec_param *attr )
+{
+    codec_private_t *codec_data = (codec_private_t*) codec->codec_data;
+    struct codec_desc *desc = &codec_desc[codec_data->codec_idx];
+    pj_pool_t *pool;
+    int i, j;
+
+    pool = codec_data->pool;
+
+    /* Cache samples per frame value */
+    codec_data->samples_per_frame = desc->samples_per_frame;
+
+    /* Calculate bitstream size */
+    i = attr->info.avg_bps * codec_data->samples_per_frame;
+    j = desc->clock_rate << 3;
+    codec_data->avg_frame_size = (pj_uint16_t)(i / j);
+    if (i % j) ++codec_data->avg_frame_size;
+
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
+    /* Init AMR settings */
+    if (desc->pt == PJMEDIA_RTP_PT_AMR || desc->pt == PJMEDIA_RTP_PT_AMRWB) {
+	amr_settings_t *s;
+	pj_uint8_t octet_align = 0;
+	pj_int8_t enc_mode;
+	
+	enc_mode = pjmedia_codec_amr_get_mode(attr->info.avg_bps);
+	pj_assert(enc_mode >= 0 && enc_mode <= 8);
+
+	for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) {
+	    const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11};
+	    
+	    /* Fetch octet-align setting. It should be fine to fetch only 
+	     * the decoder, since encoder & decoder must use the same setting 
+	     * (RFC 4867 section 8.3.1).
+	     */
+	    if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name, 
+			   &STR_FMTP_OCTET_ALIGN) == 0)
+	    {
+		octet_align=(pj_uint8_t)
+			    (pj_strtoul(&attr->setting.dec_fmtp.param[i].val));
+		break;
+	    }
+	}
+
+	for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) {
+	    const pj_str_t STR_FMTP_MODE_SET = {"mode-set", 8};
+
+	    /* mode-set, encoding mode is chosen based on local default mode 
+	     * setting:
+	     * - if local default mode is included in the mode-set, use it
+	     * - otherwise, find the closest mode to local default mode;
+	     *   if there are two closest modes, prefer to use the higher
+	     *   one, e.g: local default mode is 4, the mode-set param
+	     *   contains '2,3,5,6', then 5 will be chosen.
+	     */
+	    if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name, 
+			   &STR_FMTP_MODE_SET) == 0)
+	    {
+		const char *p;
+		pj_size_t l;
+		pj_int8_t diff = 99;
+		
+		p = pj_strbuf(&attr->setting.enc_fmtp.param[i].val);
+		l = pj_strlen(&attr->setting.enc_fmtp.param[i].val);
+
+		while (l--) {
+		    if ((desc->pt==PJMEDIA_RTP_PT_AMR && *p>='0' && *p<='7') ||
+		        (desc->pt==PJMEDIA_RTP_PT_AMRWB && *p>='0' && *p<='8'))
+		    {
+			pj_int8_t tmp = (pj_int8_t)(*p - '0' - enc_mode);
+
+			if (PJ_ABS(diff) > PJ_ABS(tmp) || 
+			    (PJ_ABS(diff) == PJ_ABS(tmp) && tmp > diff))
+			{
+			    diff = tmp;
+			    if (diff == 0) break;
+			}
+		    }
+		    ++p;
+		}
+
+		if (diff == 99)
+		    return PJMEDIA_CODEC_EFAILED;
+
+		enc_mode = (pj_int8_t)(enc_mode + diff);
+
+		break;
+	    }
+	}
+
+	s = PJ_POOL_ZALLOC_T(pool, amr_settings_t);
+	codec_data->codec_setting = s;
+
+	s->enc_mode = enc_mode;
+	if (s->enc_mode < 0)
+	    return PJMEDIA_CODEC_EINMODE;
+
+	s->enc_setting.amr_nb = (pj_uint8_t)(desc->pt == PJMEDIA_RTP_PT_AMR);
+	s->enc_setting.octet_aligned = octet_align;
+	s->enc_setting.reorder = PJ_FALSE; /* Note this! passthrough codec
+					      doesn't do sensitivity bits 
+					      reordering */
+	s->enc_setting.cmr = 15;
+	
+	s->dec_setting.amr_nb = (pj_uint8_t)(desc->pt == PJMEDIA_RTP_PT_AMR);
+	s->dec_setting.octet_aligned = octet_align;
+	s->dec_setting.reorder = PJ_FALSE; /* Note this! passthrough codec
+					      doesn't do sensitivity bits 
+					      reordering */
+	
+	/* Return back bitrate info to application */
+	attr->info.avg_bps = s->enc_setting.amr_nb?
+			     pjmedia_codec_amrnb_bitrates[s->enc_mode]:
+			     pjmedia_codec_amrwb_bitrates[s->enc_mode];
+    }
+#endif
+
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
+    /* Init iLBC settings */
+    if (desc->pt == PJMEDIA_RTP_PT_ILBC)
+    {
+	enum { DEFAULT_MODE = 30 };
+	static pj_str_t STR_MODE = {"mode", 4};
+	pj_uint16_t dec_fmtp_mode = DEFAULT_MODE, 
+		    enc_fmtp_mode = DEFAULT_MODE;
+
+	/* Get decoder mode */
+	for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) {
+	    if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name, &STR_MODE) == 0)
+	    {
+		dec_fmtp_mode = (pj_uint16_t)
+				pj_strtoul(&attr->setting.dec_fmtp.param[i].val);
+		break;
+	    }
+	}
+
+	/* Decoder mode must be set */
+	PJ_ASSERT_RETURN(dec_fmtp_mode == 20 || dec_fmtp_mode == 30, 
+			 PJMEDIA_CODEC_EINMODE);
+
+	/* Get encoder mode */
+	for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) {
+	    if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name, &STR_MODE) == 0)
+	    {
+		enc_fmtp_mode = (pj_uint16_t)
+				pj_strtoul(&attr->setting.enc_fmtp.param[i].val);
+		break;
+	    }
+	}
+
+	PJ_ASSERT_RETURN(enc_fmtp_mode==20 || enc_fmtp_mode==30, 
+			 PJMEDIA_CODEC_EINMODE);
+
+	/* Both sides of a bi-directional session MUST use the same "mode" value.
+	 * In this point, possible values are only 20 or 30, so when encoder and
+	 * decoder modes are not same, just use the default mode, it is 30.
+	 */
+	if (enc_fmtp_mode != dec_fmtp_mode) {
+	    enc_fmtp_mode = dec_fmtp_mode = DEFAULT_MODE;
+	    PJ_LOG(4,(pool->obj_name, 
+		      "Normalized iLBC encoder and decoder modes to %d", 
+		      DEFAULT_MODE));
+	}
+
+	/* Update some attributes based on negotiated mode. */
+	attr->info.avg_bps = (dec_fmtp_mode == 30? 13333 : 15200);
+	attr->info.frm_ptime = dec_fmtp_mode;
+
+	/* Override average frame size */
+	codec_data->avg_frame_size = (dec_fmtp_mode == 30? 50 : 38);
+
+	/* Override samples per frame */
+	codec_data->samples_per_frame = (dec_fmtp_mode == 30? 240 : 160);
+    }
+#endif
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Close codec.
+ */
+static pj_status_t codec_close( pjmedia_codec *codec )
+{
+    PJ_UNUSED_ARG(codec);
+
+    return PJ_SUCCESS;
+}
+
+
+/*
+ * Modify codec settings.
+ */
+static pj_status_t codec_modify( pjmedia_codec *codec, 
+				 const pjmedia_codec_param *attr )
+{
+    /* Not supported yet. */
+    PJ_UNUSED_ARG(codec);
+    PJ_UNUSED_ARG(attr);
+
+    return PJ_ENOTSUP;
+}
+
+/*
+ * Get frames in the packet.
+ */
+static pj_status_t codec_parse( pjmedia_codec *codec,
+				void *pkt,
+				pj_size_t pkt_size,
+				const pj_timestamp *ts,
+				unsigned *frame_cnt,
+				pjmedia_frame frames[])
+{
+    codec_private_t *codec_data = (codec_private_t*) codec->codec_data;
+    struct codec_desc *desc = &codec_desc[codec_data->codec_idx];
+    unsigned count = 0;
+
+    PJ_ASSERT_RETURN(frame_cnt, PJ_EINVAL);
+
+    if (desc->parse != NULL) {
+	return desc->parse(codec_data, pkt,  pkt_size, ts, frame_cnt, frames);
+    }
+
+    while (pkt_size >= codec_data->avg_frame_size && count < *frame_cnt) {
+	frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO;
+	frames[count].buf = pkt;
+	frames[count].size = codec_data->avg_frame_size;
+	frames[count].timestamp.u64 = ts->u64 + 
+				      count * codec_data->samples_per_frame;
+
+	pkt = (pj_uint8_t*)pkt + codec_data->avg_frame_size;
+	pkt_size -= codec_data->avg_frame_size;
+
+	++count;
+    }
+
+    if (pkt_size && count < *frame_cnt) {
+	frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO;
+	frames[count].buf = pkt;
+	frames[count].size = pkt_size;
+	frames[count].timestamp.u64 = ts->u64 + 
+				       count * codec_data->samples_per_frame;
+	++count;
+    }
+
+    *frame_cnt = count;
+    return PJ_SUCCESS;
+}
+
+/*
+ * Encode frames.
+ */
+static pj_status_t codec_encode( pjmedia_codec *codec, 
+				 const struct pjmedia_frame *input,
+				 unsigned output_buf_len, 
+				 struct pjmedia_frame *output)
+{
+    codec_private_t *codec_data = (codec_private_t*) codec->codec_data;
+    struct codec_desc *desc = &codec_desc[codec_data->codec_idx];
+    const pjmedia_frame_ext *input_ = (const pjmedia_frame_ext*) input;
+
+    pj_assert(input && input->type == PJMEDIA_FRAME_TYPE_EXTENDED);
+
+    if (desc->pack != NULL) {
+	desc->pack(codec_data, input_, output_buf_len, output);
+    } else {
+	if (input_->subframe_cnt == 0) {
+	    /* DTX */
+	    output->buf = NULL;
+	    output->size = 0;
+	    output->type = PJMEDIA_FRAME_TYPE_NONE;
+	} else {
+	    unsigned i;
+	    pj_uint8_t *p = output->buf;
+
+	    output->type = PJMEDIA_FRAME_TYPE_AUDIO;
+	    output->size = 0;
+	    
+	    for (i = 0; i < input_->subframe_cnt; ++i) {
+		pjmedia_frame_ext_subframe *sf;
+		unsigned sf_len;
+
+		sf = pjmedia_frame_ext_get_subframe(input_, i);
+		pj_assert(sf);
+
+		sf_len = (sf->bitlen + 7) >> 3;
+
+		pj_memcpy(p, sf->data, sf_len);
+		p += sf_len;
+		output->size += sf_len;
+
+		/* If there is SID or DTX frame, break the loop. */
+		if (desc->pt == PJMEDIA_RTP_PT_G729 && 
+		    sf_len < codec_data->avg_frame_size)
+		{
+		    break;
+		}
+		
+	    }
+	}
+    }
+
+    output->timestamp = input->timestamp;
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * Decode frame.
+ */
+static pj_status_t codec_decode( pjmedia_codec *codec, 
+				 const struct pjmedia_frame *input,
+				 unsigned output_buf_len, 
+				 struct pjmedia_frame *output)
+{
+    codec_private_t *codec_data = (codec_private_t*) codec->codec_data;
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
+    struct codec_desc *desc = &codec_desc[codec_data->codec_idx];
+#endif
+    pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output;
+
+    pj_assert(input);
+    PJ_UNUSED_ARG(output_buf_len);
+
+#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
+    /* Need to rearrange the AMR bitstream, since the bitstream may not be 
+     * started from bit 0 or may need to be reordered from sensitivity order 
+     * into encoder bits order.
+     */
+    if (desc->pt == PJMEDIA_RTP_PT_AMR || desc->pt == PJMEDIA_RTP_PT_AMRWB) {
+	pjmedia_frame input_;
+	pjmedia_codec_amr_pack_setting *setting;
+
+	setting = &((amr_settings_t*)codec_data->codec_setting)->dec_setting;
+
+	input_ = *input;
+	pjmedia_codec_amr_predecode(input, setting, &input_);
+	
+	pjmedia_frame_ext_append_subframe(output_, input_.buf, 
+					  (pj_uint16_t)(input_.size << 3),
+					  (pj_uint16_t)codec_data->samples_per_frame);
+	output->timestamp = input->timestamp;
+	
+	return PJ_SUCCESS;
+    }
+#endif
+    
+    pjmedia_frame_ext_append_subframe(output_, input->buf, 
+				      (pj_uint16_t)(input->size << 3),
+				      (pj_uint16_t)codec_data->samples_per_frame);
+    output->timestamp = input->timestamp;
+
+    return PJ_SUCCESS;
+}
+
+/* 
+ * Recover lost frame.
+ */
+static pj_status_t codec_recover( pjmedia_codec *codec, 
+				  unsigned output_buf_len, 
+				  struct pjmedia_frame *output)
+{
+    codec_private_t *codec_data = (codec_private_t*) codec->codec_data;
+    pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output;
+
+    PJ_UNUSED_ARG(output_buf_len);
+
+    pjmedia_frame_ext_append_subframe(output_, NULL, 0,
+				      (pj_uint16_t)codec_data->samples_per_frame);
+
+    return PJ_SUCCESS;
+}
+
+#endif	/* PJMEDIA_HAS_PASSTHROUGH_CODECS */
+
diff --git a/jni/pjproject-android/.svn/pristine/9f/9f4beabd38280c7a09abbb00b0d7480cdad5b994.svn-base b/jni/pjproject-android/.svn/pristine/9f/9f4beabd38280c7a09abbb00b0d7480cdad5b994.svn-base
new file mode 100644
index 0000000..8489894
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9f4beabd38280c7a09abbb00b0d7480cdad5b994.svn-base
@@ -0,0 +1,3732 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="pjmedia_codec"

+	ProjectGUID="{855DC8C0-D3E9-4A2E-AE47-116605A7BC9B}"

+	RootNamespace="pjmedia_codec"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="Pocket PC 2003 (ARMV4)"

+		/>

+		<Platform

+			Name="Smartphone 2003 (ARMV4)"

+		/>

+		<Platform

+			Name="x64"

+		/>

+		<Platform

+			Name="Windows Mobile 6 Standard SDK (ARMV4I)"

+		/>

+		<Platform

+			Name="Windows Mobile 6 Professional SDK (ARMV4I)"

+		/>

+		<Platform

+			Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+		/>

+		<Platform

+			Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-common-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Win32"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Pocket PC 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Smartphone 2003 (ARMV4)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|x64"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win64-release-defaults.vsprops"

+			UseOfMFC="0"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"

+			ConfigurationType="4"

+			InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				ExecutionBucket="7"

+				AdditionalIncludeDirectories="../include;../../pjlib/include;../../third_party/speex/include;../../third_party"

+				PreprocessorDefinitions="_LIB;"

+				PrecompiledHeaderFile=""

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="..\lib\pjmedia-codec-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCCodeSignTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+			<DeploymentTool

+				ForceDirty="-1"

+				RemoteDirectory=""

+				RegisterOutput="0"

+				AdditionalFiles=""

+			/>

+			<DebuggerTool

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

+			>

+			<File

+				RelativePath="..\src\pjmedia-codec\amr_sdp_match.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\audio_codecs.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\ffmpeg_vid_codecs.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\g722.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\g7221.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\g7221_sdp_match.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\gsm.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\h263_packetizer.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\h264_packetizer.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\ilbc.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\ipp_codecs.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\l16.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\opencore_amr.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\passthrough.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\silk.c"

+				>

+			</File>

+			<File

+				RelativePath="..\src\pjmedia-codec\speex_codec.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug-Dynamic|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release-Static|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						AdditionalIncludeDirectories=""

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<Filter

+				Name="g722 Files"

+				>

+				<File

+					RelativePath="..\src\pjmedia-codec\g722\g722_dec.c"

+					>

+				</File>

+				<File

+					RelativePath="..\src\pjmedia-codec\g722\g722_dec.h"

+					>

+				</File>

+				<File

+					RelativePath="..\src\pjmedia-codec\g722\g722_enc.c"

+					>

+				</File>

+				<File

+					RelativePath="..\src\pjmedia-codec\g722\g722_enc.h"

+					>

+				</File>

+			</Filter>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl"

+			>

+			<File

+				RelativePath="..\include\pjmedia-codec\amr_helper.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\amr_sdp_match.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\audio_codecs.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\config.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\ffmpeg_vid_codecs.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\g722.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\g7221.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\g7221_sdp_match.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\gsm.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\h263_packetizer.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\h264_packetizer.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\ilbc.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\ipp_codecs.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\l16.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\opencore_amr.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\passthrough.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\silk.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\speex.h"

+				>

+			</File>

+			<File

+				RelativePath="..\include\pjmedia-codec\types.h"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/jni/pjproject-android/.svn/pristine/9f/9f5122850959e8bc3c655897638890118de412c7.svn-base b/jni/pjproject-android/.svn/pristine/9f/9f5122850959e8bc3c655897638890118de412c7.svn-base
new file mode 100644
index 0000000..b30f6d3
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9f5122850959e8bc3c655897638890118de412c7.svn-base
@@ -0,0 +1,1913 @@
+/*
+ * srtp.c
+ *
+ * the secure real-time transport protocol
+ *
+ * David A. McGrew
+ * Cisco Systems, Inc.
+ */
+/*
+ *	
+ * Copyright (c) 2001-2006, Cisco Systems, Inc.
+ * All rights reserved.
+ * 
+ * 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 Cisco Systems, Inc. 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
+ * COPYRIGHT HOLDERS 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.
+ *
+ */
+
+
+#include "srtp_priv.h"
+#include "aes_icm.h"         /* aes_icm is used in the KDF  */
+#include "alloc.h"           /* for crypto_alloc()          */
+
+#ifndef SRTP_KERNEL
+# include <limits.h>
+# ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>
+# elif defined(HAVE_WINSOCK2_H)
+#  include <winsock2.h>
+# endif
+#endif /* ! SRTP_KERNEL */
+
+
+extern cipher_type_t aes_icm;
+extern auth_type_t   tmmhv2;
+
+/* the debug module for srtp */
+
+debug_module_t mod_srtp = {
+  0,                  /* debugging is off by default */
+  "srtp"              /* printable name for module   */
+};
+
+#define octets_in_rtp_header   12
+#define uint32s_in_rtp_header  3
+#define octets_in_rtcp_header  8
+#define uint32s_in_rtcp_header 2
+
+
+err_status_t
+srtp_stream_alloc(srtp_stream_ctx_t **str_ptr,
+		  const srtp_policy_t *p) {
+  srtp_stream_ctx_t *str;
+  err_status_t stat;
+
+  /*
+   * This function allocates the stream context, rtp and rtcp ciphers
+   * and auth functions, and key limit structure.  If there is a
+   * failure during allocation, we free all previously allocated
+   * memory and return a failure code.  The code could probably 
+   * be improved, but it works and should be clear.
+   */
+
+  /* allocate srtp stream and set str_ptr */
+  str = (srtp_stream_ctx_t *) crypto_alloc(sizeof(srtp_stream_ctx_t));
+  if (str == NULL)
+    return err_status_alloc_fail;
+  *str_ptr = str;  
+  
+  /* allocate cipher */
+  stat = crypto_kernel_alloc_cipher(p->rtp.cipher_type, 
+				    &str->rtp_cipher, 
+				    p->rtp.cipher_key_len); 
+  if (stat) {
+    crypto_free(str);
+    return stat;
+  }
+
+  /* allocate auth function */
+  stat = crypto_kernel_alloc_auth(p->rtp.auth_type, 
+				  &str->rtp_auth,
+				  p->rtp.auth_key_len, 
+				  p->rtp.auth_tag_len); 
+  if (stat) {
+    cipher_dealloc(str->rtp_cipher);
+    crypto_free(str);
+    return stat;
+  }
+  
+  /* allocate key limit structure */
+  str->limit = (key_limit_ctx_t*) crypto_alloc(sizeof(key_limit_ctx_t));
+  if (str->limit == NULL) {
+    auth_dealloc(str->rtp_auth);
+    cipher_dealloc(str->rtp_cipher);
+    crypto_free(str); 
+    return err_status_alloc_fail;
+  }
+
+  /*
+   * ...and now the RTCP-specific initialization - first, allocate
+   * the cipher 
+   */
+  stat = crypto_kernel_alloc_cipher(p->rtcp.cipher_type, 
+				    &str->rtcp_cipher, 
+				    p->rtcp.cipher_key_len); 
+  if (stat) {
+    auth_dealloc(str->rtp_auth);
+    cipher_dealloc(str->rtp_cipher);
+    crypto_free(str->limit);
+    crypto_free(str);
+    return stat;
+  }
+
+  /* allocate auth function */
+  stat = crypto_kernel_alloc_auth(p->rtcp.auth_type, 
+				  &str->rtcp_auth,
+				  p->rtcp.auth_key_len, 
+				  p->rtcp.auth_tag_len); 
+  if (stat) {
+    cipher_dealloc(str->rtcp_cipher);
+    auth_dealloc(str->rtp_auth);
+    cipher_dealloc(str->rtp_cipher);
+    crypto_free(str->limit);
+    crypto_free(str);
+   return stat;
+  }  
+
+  return err_status_ok;
+}
+
+err_status_t
+srtp_stream_dealloc(srtp_t session, srtp_stream_ctx_t *stream) { 
+  err_status_t status;
+  
+  /*
+   * we use a conservative deallocation strategy - if any deallocation
+   * fails, then we report that fact without trying to deallocate
+   * anything else
+   */
+
+  /* deallocate cipher, if it is not the same as that in template */
+  if (session->stream_template
+      && stream->rtp_cipher == session->stream_template->rtp_cipher) {
+    /* do nothing */
+  } else {
+    status = cipher_dealloc(stream->rtp_cipher); 
+    if (status) 
+      return status;
+  }
+
+  /* deallocate auth function, if it is not the same as that in template */
+  if (session->stream_template
+      && stream->rtp_auth == session->stream_template->rtp_auth) {
+    /* do nothing */
+  } else {
+    status = auth_dealloc(stream->rtp_auth);
+    if (status)
+      return status;
+  }
+
+  /* deallocate key usage limit, if it is not the same as that in template */
+  if (session->stream_template
+      && stream->limit == session->stream_template->limit) {
+    /* do nothing */
+  } else {
+    crypto_free(stream->limit);
+  }   
+
+  /* 
+   * deallocate rtcp cipher, if it is not the same as that in
+   * template 
+   */
+  if (session->stream_template
+      && stream->rtcp_cipher == session->stream_template->rtcp_cipher) {
+    /* do nothing */
+  } else {
+    status = cipher_dealloc(stream->rtcp_cipher); 
+    if (status) 
+      return status;
+  }
+
+  /*
+   * deallocate rtcp auth function, if it is not the same as that in
+   * template 
+   */
+  if (session->stream_template
+      && stream->rtcp_auth == session->stream_template->rtcp_auth) {
+    /* do nothing */
+  } else {
+    status = auth_dealloc(stream->rtcp_auth);
+    if (status)
+      return status;
+  }
+  
+  /* deallocate srtp stream context */
+  crypto_free(stream);
+
+  return err_status_ok;
+}
+
+
+/*
+ * srtp_stream_clone(stream_template, new) allocates a new stream and
+ * initializes it using the cipher and auth of the stream_template
+ * 
+ * the only unique data in a cloned stream is the replay database and
+ * the SSRC
+ */
+
+err_status_t
+srtp_stream_clone(const srtp_stream_ctx_t *stream_template, 
+		  uint32_t ssrc, 
+		  srtp_stream_ctx_t **str_ptr) {
+  err_status_t status;
+  srtp_stream_ctx_t *str;
+
+  debug_print(mod_srtp, "cloning stream (SSRC: 0x%08x)", ssrc);
+
+  /* allocate srtp stream and set str_ptr */
+  str = (srtp_stream_ctx_t *) crypto_alloc(sizeof(srtp_stream_ctx_t));
+  if (str == NULL)
+    return err_status_alloc_fail;
+  *str_ptr = str;  
+
+  /* set cipher and auth pointers to those of the template */
+  str->rtp_cipher  = stream_template->rtp_cipher;
+  str->rtp_auth    = stream_template->rtp_auth;
+  str->rtcp_cipher = stream_template->rtcp_cipher;
+  str->rtcp_auth   = stream_template->rtcp_auth;
+
+  /* set key limit to point to that of the template */
+  status = key_limit_clone(stream_template->limit, &str->limit);
+  if (status) 
+    return status;
+
+  /* initialize replay databases */
+  rdbx_init(&str->rtp_rdbx);
+  rdb_init(&str->rtcp_rdb);
+  
+  /* set ssrc to that provided */
+  str->ssrc = ssrc;
+
+  /* set direction and security services */
+  str->direction     = stream_template->direction;
+  str->rtp_services  = stream_template->rtp_services;
+  str->rtcp_services = stream_template->rtcp_services;
+
+  /* defensive coding */
+  str->next = NULL;
+
+  return err_status_ok;
+}
+
+
+/*
+ * key derivation functions, internal to libSRTP
+ *
+ * srtp_kdf_t is a key derivation context
+ *
+ * srtp_kdf_init(&kdf, k) initializes kdf with the key k
+ * 
+ * srtp_kdf_generate(&kdf, l, kl, keylen) derives the key
+ * corresponding to label l and puts it into kl; the length
+ * of the key in octets is provided as keylen.  this function
+ * should be called once for each subkey that is derived.
+ *
+ * srtp_kdf_clear(&kdf) zeroizes the kdf state
+ */
+
+typedef enum {
+  label_rtp_encryption  = 0x00,
+  label_rtp_msg_auth    = 0x01,
+  label_rtp_salt        = 0x02,
+  label_rtcp_encryption = 0x03,
+  label_rtcp_msg_auth   = 0x04,
+  label_rtcp_salt       = 0x05
+} srtp_prf_label;
+
+
+/*
+ * srtp_kdf_t represents a key derivation function.  The SRTP
+ * default KDF is the only one implemented at present.
+ */
+
+typedef struct { 
+  aes_icm_ctx_t c;    /* cipher used for key derivation  */  
+} srtp_kdf_t;
+
+err_status_t
+srtp_kdf_init(srtp_kdf_t *kdf, const uint8_t key[30]) {
+
+  aes_icm_context_init(&kdf->c, key);
+
+  return err_status_ok;
+}
+
+err_status_t
+srtp_kdf_generate(srtp_kdf_t *kdf, srtp_prf_label label,
+		  uint8_t *key, int length) {
+
+  v128_t nonce;
+  
+  /* set eigth octet of nonce to <label>, set the rest of it to zero */
+  v128_set_to_zero(&nonce);
+  nonce.v8[7] = label;
+ 
+  aes_icm_set_iv(&kdf->c, &nonce);  
+  
+  /* generate keystream output */
+  aes_icm_output(&kdf->c, key, length);
+
+  return err_status_ok;
+}
+
+err_status_t
+srtp_kdf_clear(srtp_kdf_t *kdf) {
+  
+  /* zeroize aes context */
+  octet_string_set_to_zero((uint8_t *)kdf, sizeof(srtp_kdf_t));
+
+  return err_status_ok;  
+}
+
+/*
+ *  end of key derivation functions 
+ */
+
+#define MAX_SRTP_KEY_LEN 256
+
+
+err_status_t
+srtp_stream_init_keys(srtp_stream_ctx_t *srtp, const void *key) {
+  err_status_t stat;
+  srtp_kdf_t kdf;
+  uint8_t tmp_key[MAX_SRTP_KEY_LEN];
+  
+  /* initialize KDF state     */
+  srtp_kdf_init(&kdf, (const uint8_t *)key);
+  
+  /* generate encryption key  */
+  srtp_kdf_generate(&kdf, label_rtp_encryption, 
+		    tmp_key, cipher_get_key_length(srtp->rtp_cipher));
+  /* 
+   * if the cipher in the srtp context is aes_icm, then we need
+   * to generate the salt value
+   */
+  if (srtp->rtp_cipher->type == &aes_icm) {
+    /* FIX!!! this is really the cipher key length; rest is salt */
+    int base_key_len = 16;
+    int salt_len = cipher_get_key_length(srtp->rtp_cipher) - base_key_len;
+    
+    debug_print(mod_srtp, "found aes_icm, generating salt", NULL);
+
+    /* generate encryption salt, put after encryption key */
+    srtp_kdf_generate(&kdf, label_rtp_salt, 
+		      tmp_key + base_key_len, salt_len);
+  }
+  debug_print(mod_srtp, "cipher key: %s", 
+	      octet_string_hex_string(tmp_key, 
+		      cipher_get_key_length(srtp->rtp_cipher)));  
+
+  /* initialize cipher */
+  stat = cipher_init(srtp->rtp_cipher, tmp_key, direction_any);
+  if (stat) {
+    /* zeroize temp buffer */
+    octet_string_set_to_zero(tmp_key, MAX_SRTP_KEY_LEN);
+    return err_status_init_fail;
+  }
+
+  /* generate authentication key */
+  srtp_kdf_generate(&kdf, label_rtp_msg_auth,
+		    tmp_key, auth_get_key_length(srtp->rtp_auth));
+  debug_print(mod_srtp, "auth key:   %s",
+	      octet_string_hex_string(tmp_key, 
+				      auth_get_key_length(srtp->rtp_auth))); 
+
+  /* initialize auth function */
+  stat = auth_init(srtp->rtp_auth, tmp_key);
+  if (stat) {
+    /* zeroize temp buffer */
+    octet_string_set_to_zero(tmp_key, MAX_SRTP_KEY_LEN);
+    return err_status_init_fail;
+  }
+
+  /*
+   * ...now initialize SRTCP keys
+   */
+
+  /* generate encryption key  */
+  srtp_kdf_generate(&kdf, label_rtcp_encryption, 
+		    tmp_key, cipher_get_key_length(srtp->rtcp_cipher));
+  /* 
+   * if the cipher in the srtp context is aes_icm, then we need
+   * to generate the salt value
+   */
+  if (srtp->rtcp_cipher->type == &aes_icm) {
+    /* FIX!!! this is really the cipher key length; rest is salt */
+    int base_key_len = 16;
+    int salt_len = cipher_get_key_length(srtp->rtcp_cipher) - base_key_len;
+
+    debug_print(mod_srtp, "found aes_icm, generating rtcp salt", NULL);
+
+    /* generate encryption salt, put after encryption key */
+    srtp_kdf_generate(&kdf, label_rtcp_salt, 
+		      tmp_key + base_key_len, salt_len);
+  }
+  debug_print(mod_srtp, "rtcp cipher key: %s", 
+	      octet_string_hex_string(tmp_key, 
+		   cipher_get_key_length(srtp->rtcp_cipher)));  
+
+  /* initialize cipher */
+  stat = cipher_init(srtp->rtcp_cipher, tmp_key, direction_any);
+  if (stat) {
+    /* zeroize temp buffer */
+    octet_string_set_to_zero(tmp_key, MAX_SRTP_KEY_LEN);
+    return err_status_init_fail;
+  }
+
+  /* generate authentication key */
+  srtp_kdf_generate(&kdf, label_rtcp_msg_auth,
+		    tmp_key, auth_get_key_length(srtp->rtcp_auth));
+  debug_print(mod_srtp, "rtcp auth key:   %s",
+	      octet_string_hex_string(tmp_key, 
+		     auth_get_key_length(srtp->rtcp_auth))); 
+
+  /* initialize auth function */
+  stat = auth_init(srtp->rtcp_auth, tmp_key);
+  if (stat) {
+    /* zeroize temp buffer */
+    octet_string_set_to_zero(tmp_key, MAX_SRTP_KEY_LEN);
+    return err_status_init_fail;
+  }
+
+  /* clear memory then return */
+  srtp_kdf_clear(&kdf);
+  octet_string_set_to_zero(tmp_key, MAX_SRTP_KEY_LEN);  
+
+  return err_status_ok;
+}
+
+err_status_t
+srtp_stream_init(srtp_stream_ctx_t *srtp, 
+		  const srtp_policy_t *p) {
+  err_status_t err;
+
+   debug_print(mod_srtp, "initializing stream (SSRC: 0x%08x)", 
+	       p->ssrc.value);
+
+   /* initialize replay database */
+   rdbx_init(&srtp->rtp_rdbx);
+
+   /* initialize key limit to maximum value */
+#ifdef NO_64BIT_MATH
+{
+   uint64_t temp;
+   temp = make64(UINT_MAX,UINT_MAX);
+   key_limit_set(srtp->limit, temp);
+}
+#else
+   key_limit_set(srtp->limit, PJ_UINT64(0xffffffffffff));
+#endif
+
+   /* set the SSRC value */
+   srtp->ssrc = htonl(p->ssrc.value);
+
+   /* set the security service flags */
+   srtp->rtp_services  = p->rtp.sec_serv;
+   srtp->rtcp_services = p->rtcp.sec_serv;
+
+   /*
+    * set direction to unknown - this flag gets checked in srtp_protect(),
+    * srtp_unprotect(), srtp_protect_rtcp(), and srtp_unprotect_rtcp(), and 
+    * gets set appropriately if it is set to unknown.
+    */
+   srtp->direction = dir_unknown;
+
+   /* initialize SRTCP replay database */
+   rdb_init(&srtp->rtcp_rdb);
+
+   /* DAM - no RTCP key limit at present */
+
+   /* initialize keys */
+   err = srtp_stream_init_keys(srtp, p->key);
+   if (err) return err;
+
+   return err_status_ok;  
+ }
+
+
+ /*
+  * srtp_event_reporter is an event handler function that merely
+  * reports the events that are reported by the callbacks
+  */
+
+ void
+ srtp_event_reporter(srtp_event_data_t *data) {
+
+   err_report(err_level_warning, "srtp: in stream 0x%x: ", 
+	      data->stream->ssrc);
+
+   switch(data->event) {
+   case event_ssrc_collision:
+     err_report(err_level_warning, "\tSSRC collision\n");
+     break;
+   case event_key_soft_limit:
+     err_report(err_level_warning, "\tkey usage soft limit reached\n");
+     break;
+   case event_key_hard_limit:
+     err_report(err_level_warning, "\tkey usage hard limit reached\n");
+     break;
+   case event_packet_index_limit:
+     err_report(err_level_warning, "\tpacket index limit reached\n");
+     break;
+   default:
+     err_report(err_level_warning, "\tunknown event reported to handler\n");
+   }
+ }
+
+ /*
+  * srtp_event_handler is a global variable holding a pointer to the
+  * event handler function; this function is called for any unexpected
+  * event that needs to be handled out of the SRTP data path.  see
+  * srtp_event_t in srtp.h for more info
+  *
+  * it is okay to set srtp_event_handler to NULL, but we set 
+  * it to the srtp_event_reporter.
+  */
+
+ static srtp_event_handler_func_t *srtp_event_handler = srtp_event_reporter;
+
+ err_status_t
+ srtp_install_event_handler(srtp_event_handler_func_t func) {
+
+   /* 
+    * note that we accept NULL arguments intentionally - calling this
+    * function with a NULL arguments removes an event handler that's
+    * been previously installed
+    */
+
+   /* set global event handling function */
+   srtp_event_handler = func;
+   return err_status_ok;
+ }
+
+ err_status_t
+ srtp_protect(srtp_ctx_t *ctx, void *rtp_hdr, int *pkt_octet_len) {
+   srtp_hdr_t *hdr = (srtp_hdr_t *)rtp_hdr;
+   uint32_t *enc_start;        /* pointer to start of encrypted portion  */
+   uint32_t *auth_start;       /* pointer to start of auth. portion      */
+   unsigned enc_octet_len = 0; /* number of octets in encrypted portion  */
+   xtd_seq_num_t est;          /* estimated xtd_seq_num_t of *hdr        */
+   int delta;                  /* delta of local pkt idx and that in hdr */
+   uint8_t *auth_tag = NULL;   /* location of auth_tag within packet     */
+   err_status_t status;   
+   int tag_len;
+   srtp_stream_ctx_t *stream;
+   int prefix_len;
+
+   debug_print(mod_srtp, "function srtp_protect", NULL);
+
+  /* we assume the hdr is 32-bit aligned to start */
+
+   /* check the packet length - it must at least contain a full header */
+   if (*pkt_octet_len < octets_in_rtp_header)
+     return err_status_bad_param;
+
+   /*
+    * look up ssrc in srtp_stream list, and process the packet with
+    * the appropriate stream.  if we haven't seen this stream before,
+    * there's a template key for this srtp_session, and the cipher
+    * supports key-sharing, then we assume that a new stream using
+    * that key has just started up
+    */
+   stream = srtp_get_stream(ctx, hdr->ssrc);
+   if (stream == NULL) {
+     if (ctx->stream_template != NULL) {
+       srtp_stream_ctx_t *new_stream;
+
+       /* allocate and initialize a new stream */
+       status = srtp_stream_clone(ctx->stream_template, 
+				  hdr->ssrc, &new_stream); 
+       if (status)
+	 return status;
+
+       /* add new stream to the head of the stream_list */
+       new_stream->next = ctx->stream_list;
+       ctx->stream_list = new_stream;
+
+       /* set direction to outbound */
+       new_stream->direction = dir_srtp_sender;
+
+       /* set stream (the pointer used in this function) */
+       stream = new_stream;
+     } else {
+       /* no template stream, so we return an error */
+       return err_status_no_ctx;
+     } 
+   }
+
+   /* 
+    * verify that stream is for sending traffic - this check will
+    * detect SSRC collisions, since a stream that appears in both
+    * srtp_protect() and srtp_unprotect() will fail this test in one of
+    * those functions.
+    */
+   if (stream->direction != dir_srtp_sender) {
+     if (stream->direction == dir_unknown) {
+       stream->direction = dir_srtp_sender;
+     } else {
+       srtp_handle_event(ctx, stream, event_ssrc_collision);
+     }
+   }
+
+  /* 
+   * update the key usage limit, and check it to make sure that we
+   * didn't just hit either the soft limit or the hard limit, and call
+   * the event handler if we hit either.
+   */
+  switch(key_limit_update(stream->limit)) {
+  case key_event_normal:
+    break;
+  case key_event_soft_limit: 
+    srtp_handle_event(ctx, stream, event_key_soft_limit);
+    break; 
+  case key_event_hard_limit:
+    srtp_handle_event(ctx, stream, event_key_hard_limit);
+	return err_status_key_expired;
+  default:
+    break;
+  }
+
+   /* get tag length from stream */
+   tag_len = auth_get_tag_length(stream->rtp_auth); 
+
+   /*
+    * find starting point for encryption and length of data to be
+    * encrypted - the encrypted portion starts after the rtp header
+    * extension, if present; otherwise, it starts after the last csrc,
+    * if any are present
+    *
+    * if we're not providing confidentiality, set enc_start to NULL
+    */
+   if (stream->rtp_services & sec_serv_conf) {
+     enc_start = (uint32_t *)hdr + uint32s_in_rtp_header + hdr->cc;  
+     if (hdr->x == 1) {
+       srtp_hdr_xtnd_t *xtn_hdr = (srtp_hdr_xtnd_t *)enc_start;
+       enc_start += (ntohs(xtn_hdr->length) + 1);
+     }
+     enc_octet_len = (unsigned int)(*pkt_octet_len 
+				    - ((enc_start - (uint32_t *)hdr) << 2));
+   } else {
+     enc_start = NULL;
+   }
+
+   /* 
+    * if we're providing authentication, set the auth_start and auth_tag
+    * pointers to the proper locations; otherwise, set auth_start to NULL
+    * to indicate that no authentication is needed
+    */
+   if (stream->rtp_services & sec_serv_auth) {
+     auth_start = (uint32_t *)hdr;
+     auth_tag = (uint8_t *)hdr + *pkt_octet_len;
+   } else {
+     auth_start = NULL;
+     auth_tag = NULL;
+   }
+
+   /*
+    * estimate the packet index using the start of the replay window   
+    * and the sequence number from the header
+    */
+   delta = rdbx_estimate_index(&stream->rtp_rdbx, &est, ntohs(hdr->seq));
+   status = rdbx_check(&stream->rtp_rdbx, delta);
+   if (status)
+     return status;  /* we've been asked to reuse an index */
+   rdbx_add_index(&stream->rtp_rdbx, delta);
+
+#ifdef NO_64BIT_MATH
+   debug_print2(mod_srtp, "estimated packet index: %08x%08x", 
+		high32(est),low32(est));
+#else
+   debug_print(mod_srtp, "estimated packet index: %016llx", est);
+#endif
+
+   /* 
+    * if we're using rindael counter mode, set nonce and seq 
+    */
+   if (stream->rtp_cipher->type == &aes_icm) {
+     v128_t iv;
+
+     iv.v32[0] = 0;
+     iv.v32[1] = hdr->ssrc;
+#ifdef NO_64BIT_MATH
+     iv.v64[1] = be64_to_cpu(make64((high32(est) << 16) | (low32(est) >> 16),
+								 low32(est) << 16));
+#else
+     iv.v64[1] = be64_to_cpu(est << 16);
+#endif
+     status = cipher_set_iv(stream->rtp_cipher, &iv);
+
+   } else {  
+     v128_t iv;
+
+     /* otherwise, set the index to est */  
+#ifdef NO_64BIT_MATH
+     iv.v32[0] = 0;
+     iv.v32[1] = 0;
+#else
+     iv.v64[0] = 0;
+#endif
+     iv.v64[1] = be64_to_cpu(est);
+     status = cipher_set_iv(stream->rtp_cipher, &iv);
+   }
+   if (status)
+     return err_status_cipher_fail;
+
+   /* shift est, put into network byte order */
+#ifdef NO_64BIT_MATH
+   est = be64_to_cpu(make64((high32(est) << 16) |
+						 (low32(est) >> 16),
+						 low32(est) << 16));
+#else
+   est = be64_to_cpu(est << 16);
+#endif
+   
+   /* 
+    * if we're authenticating using a universal hash, put the keystream
+    * prefix into the authentication tag
+    */
+   if (auth_start) {
+     
+    prefix_len = auth_get_prefix_length(stream->rtp_auth);    
+    if (prefix_len) {
+      status = cipher_output(stream->rtp_cipher, auth_tag, prefix_len);
+      if (status)
+	return err_status_cipher_fail;
+      debug_print(mod_srtp, "keystream prefix: %s", 
+		  octet_string_hex_string(auth_tag, prefix_len));
+    }
+  }
+
+  /* if we're encrypting, exor keystream into the message */
+  if (enc_start) {
+    status = cipher_encrypt(stream->rtp_cipher, 
+			    (uint8_t *)enc_start, &enc_octet_len);
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /*
+   *  if we're authenticating, run authentication function and put result
+   *  into the auth_tag 
+   */
+  if (auth_start) {        
+
+    /* initialize auth func context */
+    status = auth_start(stream->rtp_auth);
+    if (status) return status;
+
+    /* run auth func over packet */
+    status = auth_update(stream->rtp_auth, 
+			 (uint8_t *)auth_start, *pkt_octet_len);
+    if (status) return status;
+    
+    /* run auth func over ROC, put result into auth_tag */
+    debug_print(mod_srtp, "estimated packet index: %016llx", est);
+    status = auth_compute(stream->rtp_auth, (uint8_t *)&est, 4, auth_tag); 
+    debug_print(mod_srtp, "srtp auth tag:    %s", 
+		octet_string_hex_string(auth_tag, tag_len));
+    if (status)
+      return err_status_auth_fail;   
+
+  }
+
+  if (auth_tag) {
+
+    /* increase the packet length by the length of the auth tag */
+    *pkt_octet_len += tag_len;
+  }
+
+  return err_status_ok;  
+}
+
+
+err_status_t
+srtp_unprotect(srtp_ctx_t *ctx, void *srtp_hdr, int *pkt_octet_len) {
+  srtp_hdr_t *hdr = (srtp_hdr_t *)srtp_hdr;
+  uint32_t *enc_start;      /* pointer to start of encrypted portion  */
+  uint32_t *auth_start;     /* pointer to start of auth. portion      */
+  unsigned enc_octet_len = 0;/* number of octets in encrypted portion */
+  uint8_t *auth_tag = NULL; /* location of auth_tag within packet     */
+  xtd_seq_num_t est;        /* estimated xtd_seq_num_t of *hdr        */
+  int delta;                /* delta of local pkt idx and that in hdr */
+  v128_t iv;
+  err_status_t status;
+  srtp_stream_ctx_t *stream;
+  uint8_t tmp_tag[SRTP_MAX_TAG_LEN];
+  int tag_len, prefix_len;
+
+  debug_print(mod_srtp, "function srtp_unprotect", NULL);
+
+  /* we assume the hdr is 32-bit aligned to start */
+
+  /* check the packet length - it must at least contain a full header */
+  if (*pkt_octet_len < octets_in_rtp_header)
+    return err_status_bad_param;
+
+  /*
+   * look up ssrc in srtp_stream list, and process the packet with 
+   * the appropriate stream.  if we haven't seen this stream before,
+   * there's only one key for this srtp_session, and the cipher
+   * supports key-sharing, then we assume that a new stream using
+   * that key has just started up
+   */
+  stream = srtp_get_stream(ctx, hdr->ssrc);
+  if (stream == NULL) {
+    if (ctx->stream_template != NULL) {
+      stream = ctx->stream_template;
+      debug_print(mod_srtp, "using provisional stream (SSRC: 0x%08x)",
+		  hdr->ssrc);
+      
+      /* 
+       * set estimated packet index to sequence number from header,
+       * and set delta equal to the same value
+       */
+#ifdef NO_64BIT_MATH
+      est = (xtd_seq_num_t) make64(0,ntohs(hdr->seq));
+      delta = low32(est);
+#else
+      est = (xtd_seq_num_t) ntohs(hdr->seq);
+      delta = (int)est;
+#endif
+    } else {
+      
+      /*
+       * no stream corresponding to SSRC found, and we don't do
+       * key-sharing, so return an error
+       */
+      return err_status_no_ctx;
+    }
+  } else {
+  
+    /* estimate packet index from seq. num. in header */
+    delta = rdbx_estimate_index(&stream->rtp_rdbx, &est, ntohs(hdr->seq));
+    
+    /* check replay database */
+    status = rdbx_check(&stream->rtp_rdbx, delta);
+    if (status)
+      return status;
+  }
+
+#ifdef NO_64BIT_MATH
+  debug_print2(mod_srtp, "estimated u_packet index: %08x%08x", high32(est),low32(est));
+#else
+  debug_print(mod_srtp, "estimated u_packet index: %016llx", est);
+#endif
+
+  /* get tag length from stream */
+  tag_len = auth_get_tag_length(stream->rtp_auth); 
+
+  /* 
+   * set the cipher's IV properly, depending on whatever cipher we
+   * happen to be using
+   */
+  if (stream->rtp_cipher->type == &aes_icm) {
+
+    /* aes counter mode */
+    iv.v32[0] = 0;
+    iv.v32[1] = hdr->ssrc;  /* still in network order */
+#ifdef NO_64BIT_MATH
+    iv.v64[1] = be64_to_cpu(make64((high32(est) << 16) | (low32(est) >> 16),
+			         low32(est) << 16));
+#else
+    iv.v64[1] = be64_to_cpu(est << 16);
+#endif
+    status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtp_cipher->state, &iv);
+  } else {  
+    
+    /* no particular format - set the iv to the pakcet index */  
+#ifdef NO_64BIT_MATH
+    iv.v32[0] = 0;
+    iv.v32[1] = 0;
+#else
+    iv.v64[0] = 0;
+#endif
+    iv.v64[1] = be64_to_cpu(est);
+    status = cipher_set_iv(stream->rtp_cipher, &iv);
+  }
+  if (status)
+    return err_status_cipher_fail;
+
+  /* shift est, put into network byte order */
+#ifdef NO_64BIT_MATH
+  est = be64_to_cpu(make64((high32(est) << 16) |
+					    (low32(est) >> 16),
+					    low32(est) << 16));
+#else
+  est = be64_to_cpu(est << 16);
+#endif
+
+  /*
+   * find starting point for decryption and length of data to be
+   * decrypted - the encrypted portion starts after the rtp header
+   * extension, if present; otherwise, it starts after the last csrc,
+   * if any are present
+   *
+   * if we're not providing confidentiality, set enc_start to NULL
+   */
+  if (stream->rtp_services & sec_serv_conf) {
+    enc_start = (uint32_t *)hdr + uint32s_in_rtp_header + hdr->cc;  
+    if (hdr->x == 1) {
+      srtp_hdr_xtnd_t *xtn_hdr = (srtp_hdr_xtnd_t *)enc_start;
+      enc_start += (ntohs(xtn_hdr->length) + 1);
+    }  
+    enc_octet_len = (uint32_t)(*pkt_octet_len - tag_len 
+			       - ((enc_start - (uint32_t *)hdr) << 2));
+  } else {
+    enc_start = NULL;
+  }
+
+  /* 
+   * if we're providing authentication, set the auth_start and auth_tag
+   * pointers to the proper locations; otherwise, set auth_start to NULL
+   * to indicate that no authentication is needed
+   */
+  if (stream->rtp_services & sec_serv_auth) {
+    auth_start = (uint32_t *)hdr;
+    auth_tag = (uint8_t *)hdr + *pkt_octet_len - tag_len;
+  } else {
+    auth_start = NULL;
+    auth_tag = NULL;
+  } 
+
+  /*
+   * if we expect message authentication, run the authentication
+   * function and compare the result with the value of the auth_tag
+   */
+  if (auth_start) {        
+
+    /* 
+     * if we're using a universal hash, then we need to compute the
+     * keystream prefix for encrypting the universal hash output
+     *
+     * if the keystream prefix length is zero, then we know that
+     * the authenticator isn't using a universal hash function
+     */  
+    if (stream->rtp_auth->prefix_len != 0) {
+      
+      prefix_len = auth_get_prefix_length(stream->rtp_auth);    
+      status = cipher_output(stream->rtp_cipher, tmp_tag, prefix_len);
+      debug_print(mod_srtp, "keystream prefix: %s", 
+		  octet_string_hex_string(tmp_tag, prefix_len));
+      if (status)
+	return err_status_cipher_fail;
+    } 
+
+    /* initialize auth func context */
+    status = auth_start(stream->rtp_auth);
+    if (status) return status;
+ 
+    /* now compute auth function over packet */
+    status = auth_update(stream->rtp_auth, (uint8_t *)auth_start,  
+			 *pkt_octet_len - tag_len);
+
+    /* run auth func over ROC, then write tmp tag */
+    status = auth_compute(stream->rtp_auth, (uint8_t *)&est, 4, tmp_tag);  
+
+    debug_print(mod_srtp, "computed auth tag:    %s", 
+		octet_string_hex_string(tmp_tag, tag_len));
+    debug_print(mod_srtp, "packet auth tag:      %s", 
+		octet_string_hex_string(auth_tag, tag_len));
+    if (status)
+      return err_status_auth_fail;   
+
+    if (octet_string_is_eq(tmp_tag, auth_tag, tag_len))
+      return err_status_auth_fail;
+  }
+
+  /* 
+   * update the key usage limit, and check it to make sure that we
+   * didn't just hit either the soft limit or the hard limit, and call
+   * the event handler if we hit either.
+   */
+  switch(key_limit_update(stream->limit)) {
+  case key_event_normal:
+    break;
+  case key_event_soft_limit: 
+    srtp_handle_event(ctx, stream, event_key_soft_limit);
+    break; 
+  case key_event_hard_limit:
+    srtp_handle_event(ctx, stream, event_key_hard_limit);
+    return err_status_key_expired;
+  default:
+    break;
+  }
+
+  /* if we're encrypting, add keystream into ciphertext */
+  if (enc_start) {
+    status = cipher_encrypt(stream->rtp_cipher, 
+			    (uint8_t *)enc_start, &enc_octet_len);
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /* 
+   * verify that stream is for received traffic - this check will
+   * detect SSRC collisions, since a stream that appears in both
+   * srtp_protect() and srtp_unprotect() will fail this test in one of
+   * those functions.
+   *
+   * we do this check *after* the authentication check, so that the
+   * latter check will catch any attempts to fool us into thinking
+   * that we've got a collision
+   */
+  if (stream->direction != dir_srtp_receiver) {
+    if (stream->direction == dir_unknown) {
+      stream->direction = dir_srtp_receiver;
+    } else {
+      srtp_handle_event(ctx, stream, event_ssrc_collision);
+    }
+  }
+
+  /* 
+   * if the stream is a 'provisional' one, in which the template context
+   * is used, then we need to allocate a new stream at this point, since
+   * the authentication passed
+   */
+  if (stream == ctx->stream_template) {  
+    srtp_stream_ctx_t *new_stream;
+
+    /* 
+     * allocate and initialize a new stream 
+     * 
+     * note that we indicate failure if we can't allocate the new
+     * stream, and some implementations will want to not return
+     * failure here
+     */
+    status = srtp_stream_clone(ctx->stream_template, hdr->ssrc, &new_stream); 
+    if (status)
+      return status;
+    
+    /* add new stream to the head of the stream_list */
+    new_stream->next = ctx->stream_list;
+    ctx->stream_list = new_stream;
+    
+    /* set stream (the pointer used in this function) */
+    stream = new_stream;
+  }
+  
+  /* 
+   * the message authentication function passed, so add the packet
+   * index into the replay database 
+   */
+  rdbx_add_index(&stream->rtp_rdbx, delta);
+
+  /* decrease the packet length by the length of the auth tag */
+  *pkt_octet_len -= tag_len;
+
+  return err_status_ok;  
+}
+
+err_status_t
+srtp_init() {
+  err_status_t status;
+
+  /* initialize crypto kernel */
+  status = crypto_kernel_init();
+  if (status) 
+    return status;
+
+  /* load srtp debug module into the kernel */
+  status = crypto_kernel_load_debug_module(&mod_srtp);
+  if (status)
+    return status;
+
+  return err_status_ok;
+}
+
+err_status_t
+srtp_deinit() {
+  err_status_t status;
+
+  status = crypto_kernel_shutdown();
+
+  return status;
+}
+
+/* 
+ * The following code is under consideration for removal.  See
+ * SRTP_MAX_TRAILER_LEN 
+ */
+#if 0
+
+/*
+ * srtp_get_trailer_length(&a) returns the number of octets that will
+ * be added to an RTP packet by the SRTP processing.  This value
+ * is constant for a given srtp_stream_t (i.e. between initializations).
+ */
+
+int
+srtp_get_trailer_length(const srtp_stream_t s) {
+  return auth_get_tag_length(s->rtp_auth);
+}
+
+#endif
+
+/*
+ * srtp_get_stream(ssrc) returns a pointer to the stream corresponding
+ * to ssrc, or NULL if no stream exists for that ssrc
+ *
+ * this is an internal function 
+ */
+
+srtp_stream_ctx_t *
+srtp_get_stream(srtp_t srtp, uint32_t ssrc) {
+  srtp_stream_ctx_t *stream;
+
+  /* walk down list until ssrc is found */
+  stream = srtp->stream_list;
+  while (stream != NULL) {
+    if (stream->ssrc == ssrc)
+      return stream;
+    stream = stream->next;
+  }
+  
+  /* we haven't found our ssrc, so return a null */
+  return NULL;
+}
+
+err_status_t
+srtp_dealloc(srtp_t session) {
+  srtp_stream_ctx_t *stream;
+  err_status_t status;
+
+  /*
+   * we take a conservative deallocation strategy - if we encounter an
+   * error deallocating a stream, then we stop trying to deallocate
+   * memory and just return an error
+   */
+
+  /* walk list of streams, deallocating as we go */
+  stream = session->stream_list;
+  while (stream != NULL) {
+    srtp_stream_t next = stream->next;
+    status = srtp_stream_dealloc(session, stream);
+    if (status)
+      return status;
+    stream = next;
+  }
+  
+  /* deallocate stream template, if there is one */
+  if (session->stream_template != NULL) {
+    status = auth_dealloc(session->stream_template->rtcp_auth); 
+    if (status) 
+      return status; 
+    status = cipher_dealloc(session->stream_template->rtcp_cipher); 
+    if (status) 
+      return status; 
+    crypto_free(session->stream_template->limit);
+    status = cipher_dealloc(session->stream_template->rtp_cipher); 
+    if (status) 
+      return status; 
+    status = auth_dealloc(session->stream_template->rtp_auth);
+    if (status)
+      return status;
+    crypto_free(session->stream_template);
+  }
+
+  /* deallocate session context */
+  crypto_free(session);
+
+  return err_status_ok;
+}
+
+
+err_status_t
+srtp_add_stream(srtp_t session, 
+		const srtp_policy_t *policy)  {
+  err_status_t status;
+  srtp_stream_t tmp;
+
+  /* sanity check arguments */
+  if ((session == NULL) || (policy == NULL) || (policy->key == NULL))
+    return err_status_bad_param;
+
+  /* allocate stream  */
+  status = srtp_stream_alloc(&tmp, policy);
+  if (status) {
+    return status;
+  }
+  
+  /* initialize stream  */
+  status = srtp_stream_init(tmp, policy);
+  if (status) {
+    crypto_free(tmp);
+    return status;
+  }
+  
+  /* 
+   * set the head of the stream list or the template to point to the
+   * stream that we've just alloced and init'ed, depending on whether
+   * or not it has a wildcard SSRC value or not
+   *
+   * if the template stream has already been set, then the policy is
+   * inconsistent, so we return a bad_param error code
+   */
+  switch (policy->ssrc.type) {
+  case (ssrc_any_outbound):
+    if (session->stream_template) {
+      return err_status_bad_param;
+    }
+    session->stream_template = tmp;
+    session->stream_template->direction = dir_srtp_sender;
+    break;
+  case (ssrc_any_inbound):
+    if (session->stream_template) {
+      return err_status_bad_param;
+    }
+    session->stream_template = tmp;
+    session->stream_template->direction = dir_srtp_receiver;
+    break;
+  case (ssrc_specific):
+    tmp->next = session->stream_list;
+    session->stream_list = tmp;
+    break;
+  case (ssrc_undefined):
+  default:
+    crypto_free(tmp);
+    return err_status_bad_param;
+  }
+    
+  return err_status_ok;
+}
+
+
+err_status_t
+srtp_create(srtp_t *session,               /* handle for session     */ 
+	    const srtp_policy_t *policy) { /* SRTP policy (list)     */
+  err_status_t stat;
+  srtp_ctx_t *ctx;
+
+  /* sanity check arguments */
+  if (session == NULL)
+    return err_status_bad_param;
+
+  /* allocate srtp context and set ctx_ptr */
+  ctx = (srtp_ctx_t *) crypto_alloc(sizeof(srtp_ctx_t));
+  if (ctx == NULL)
+    return err_status_alloc_fail;
+  *session = ctx;
+
+  /* 
+   * loop over elements in the policy list, allocating and
+   * initializing a stream for each element
+   */
+  ctx->stream_template = NULL;
+  ctx->stream_list = NULL;
+  while (policy != NULL) {    
+
+    stat = srtp_add_stream(ctx, policy);
+    if (stat) {
+      /* clean up everything */
+      srtp_dealloc(*session);
+      return stat;
+    }    
+
+    /* set policy to next item in list  */
+    policy = policy->next;
+  }
+
+  return err_status_ok;
+}
+
+
+err_status_t
+srtp_remove_stream(srtp_t session, uint32_t ssrc) {
+  srtp_stream_ctx_t *stream, *last_stream;
+  err_status_t status;
+
+  /* sanity check arguments */
+  if (session == NULL)
+    return err_status_bad_param;
+  
+  /* find stream in list; complain if not found */
+  last_stream = stream = session->stream_list;
+  while ((stream != NULL) && (ssrc != stream->ssrc)) {
+    last_stream = stream;
+    stream = stream->next;
+  }
+  if (stream == NULL)
+    return err_status_no_ctx;
+
+  /* remove stream from the list */
+  last_stream->next = stream->next;
+
+  /* deallocate the stream */
+  status = srtp_stream_dealloc(session, stream);
+  if (status)
+    return status;
+
+  return err_status_ok;
+}
+
+
+/*
+ * the default policy - provides a convenient way for callers to use
+ * the default security policy
+ * 
+ * this policy is that defined in the current SRTP internet draft.
+ *
+ */
+
+/* 
+ * NOTE: cipher_key_len is really key len (128 bits) plus salt len
+ *  (112 bits)
+ */
+/* There are hard-coded 16's for base_key_len in the key generation code */
+
+void
+crypto_policy_set_rtp_default(crypto_policy_t *p) {
+
+  p->cipher_type     = AES_128_ICM;           
+  p->cipher_key_len  = 30;                /* default 128 bits per RFC 3711 */
+  p->auth_type       = HMAC_SHA1;             
+  p->auth_key_len    = 20;                /* default 160 bits per RFC 3711 */
+  p->auth_tag_len    = 10;                /* default 80 bits per RFC 3711 */
+  p->sec_serv        = sec_serv_conf_and_auth;
+  
+}
+
+void
+crypto_policy_set_rtcp_default(crypto_policy_t *p) {
+
+  p->cipher_type     = AES_128_ICM;           
+  p->cipher_key_len  = 30;                 /* default 128 bits per RFC 3711 */
+  p->auth_type       = HMAC_SHA1;             
+  p->auth_key_len    = 20;                 /* default 160 bits per RFC 3711 */
+  p->auth_tag_len    = 10;                 /* default 80 bits per RFC 3711 */
+  p->sec_serv        = sec_serv_conf_and_auth;
+  
+}
+
+void
+crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p) {
+
+  /*
+   * corresponds to draft-ietf-mmusic-sdescriptions-12.txt
+   *
+   * note that this crypto policy is intended for SRTP, but not SRTCP
+   */
+
+  p->cipher_type     = AES_128_ICM;           
+  p->cipher_key_len  = 30;                /* 128 bit key, 112 bit salt */
+  p->auth_type       = HMAC_SHA1;             
+  p->auth_key_len    = 20;                /* 160 bit key               */
+  p->auth_tag_len    = 4;                 /* 32 bit tag                */
+  p->sec_serv        = sec_serv_conf_and_auth;
+  
+}
+
+
+void
+crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p) {
+
+  /*
+   * corresponds to draft-ietf-mmusic-sdescriptions-12.txt
+   *
+   * note that this crypto policy is intended for SRTP, but not SRTCP
+   */
+
+  p->cipher_type     = AES_128_ICM;           
+  p->cipher_key_len  = 30;                /* 128 bit key, 112 bit salt */
+  p->auth_type       = NULL_AUTH;             
+  p->auth_key_len    = 0; 
+  p->auth_tag_len    = 0; 
+  p->sec_serv        = sec_serv_conf;
+  
+}
+
+
+void
+crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p) {
+
+  /*
+   * corresponds to draft-ietf-mmusic-sdescriptions-12.txt
+   */
+
+  p->cipher_type     = NULL_CIPHER;           
+  p->cipher_key_len  = 0;
+  p->auth_type       = HMAC_SHA1;             
+  p->auth_key_len    = 20; 
+  p->auth_tag_len    = 10; 
+  p->sec_serv        = sec_serv_auth;
+  
+}
+
+
+/* 
+ * secure rtcp functions
+ */
+
+err_status_t 
+srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len) {
+  srtcp_hdr_t *hdr = (srtcp_hdr_t *)rtcp_hdr;
+  uint32_t *enc_start;      /* pointer to start of encrypted portion  */
+  uint32_t *auth_start;     /* pointer to start of auth. portion      */
+  uint32_t *trailer;        /* pointer to start of trailer            */
+  unsigned enc_octet_len = 0;/* number of octets in encrypted portion */
+  uint8_t *auth_tag = NULL; /* location of auth_tag within packet     */
+  err_status_t status;   
+  int tag_len;
+  srtp_stream_ctx_t *stream;
+  int prefix_len;
+  uint32_t seq_num;
+
+  /* we assume the hdr is 32-bit aligned to start */
+  /*
+   * look up ssrc in srtp_stream list, and process the packet with 
+   * the appropriate stream.  if we haven't seen this stream before,
+   * there's only one key for this srtp_session, and the cipher
+   * supports key-sharing, then we assume that a new stream using
+   * that key has just started up
+   */
+  stream = srtp_get_stream(ctx, hdr->ssrc);
+  if (stream == NULL) {
+    if (ctx->stream_template != NULL) {
+      srtp_stream_ctx_t *new_stream;
+      
+      /* allocate and initialize a new stream */
+      status = srtp_stream_clone(ctx->stream_template,
+				 hdr->ssrc, &new_stream); 
+      if (status)
+	return status;
+      
+      /* add new stream to the head of the stream_list */
+      new_stream->next = ctx->stream_list;
+      ctx->stream_list = new_stream;
+      
+      /* set stream (the pointer used in this function) */
+      stream = new_stream;
+    } else {
+      /* no template stream, so we return an error */
+      return err_status_no_ctx;
+    } 
+  }
+  
+  /* 
+   * verify that stream is for sending traffic - this check will
+   * detect SSRC collisions, since a stream that appears in both
+   * srtp_protect() and srtp_unprotect() will fail this test in one of
+   * those functions.
+   */
+  if (stream->direction != dir_srtp_sender) {
+    if (stream->direction == dir_unknown) {
+      stream->direction = dir_srtp_sender;
+    } else {
+      srtp_handle_event(ctx, stream, event_ssrc_collision);
+    }
+  }  
+
+  /* get tag length from stream context */
+  tag_len = auth_get_tag_length(stream->rtcp_auth); 
+
+  /*
+   * set encryption start and encryption length - if we're not
+   * providing confidentiality, set enc_start to NULL
+   */
+  enc_start = (uint32_t *)hdr + uint32s_in_rtcp_header;  
+  enc_octet_len = *pkt_octet_len - octets_in_rtcp_header;
+
+  /* all of the packet, except the header, gets encrypted */
+  /* NOTE: hdr->length is not usable - it refers to only the first
+	 RTCP report in the compound packet! */
+  /* NOTE: trailer is 32-bit aligned because RTCP 'packets' are always
+	 multiples of 32-bits (RFC 3550 6.1) */
+  trailer = (uint32_t *) ((char *)enc_start + enc_octet_len);
+
+  if (stream->rtcp_services & sec_serv_conf) {
+    *trailer = htonl(SRTCP_E_BIT);     /* set encrypt bit */    
+  } else {
+    enc_start = NULL;
+    enc_octet_len = 0;
+	/* 0 is network-order independant */
+    *trailer = 0x00000000;     /* set encrypt bit */    
+  }
+
+  /* 
+   * set the auth_start and auth_tag pointers to the proper locations
+   * (note that srtpc *always* provides authentication, unlike srtp)
+   */
+  /* Note: This would need to change for optional mikey data */
+  auth_start = (uint32_t *)hdr;
+  auth_tag = (uint8_t *)hdr + *pkt_octet_len + sizeof(srtcp_trailer_t); 
+
+  /* 
+   * check sequence number for overruns, and copy it into the packet
+   * if its value isn't too big
+   */
+  status = rdb_increment(&stream->rtcp_rdb);
+  if (status)
+    return status;
+  seq_num = rdb_get_value(&stream->rtcp_rdb);
+  *trailer |= htonl(seq_num);
+  debug_print(mod_srtp, "srtcp index: %x", seq_num);
+
+  /* 
+   * if we're using rindael counter mode, set nonce and seq 
+   */
+  if (stream->rtcp_cipher->type == &aes_icm) {
+    v128_t iv;
+    
+    iv.v32[0] = 0;
+    iv.v32[1] = hdr->ssrc;  /* still in network order! */
+    iv.v32[2] = htonl(seq_num >> 16);
+    iv.v32[3] = htonl(seq_num << 16);
+    status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtcp_cipher->state, &iv);
+
+  } else {  
+    v128_t iv;
+    
+    /* otherwise, just set the index to seq_num */  
+    iv.v32[0] = 0;
+    iv.v32[1] = 0;
+    iv.v32[2] = 0;
+    iv.v32[3] = htonl(seq_num);
+    status = cipher_set_iv(stream->rtcp_cipher, &iv);
+  }
+  if (status)
+    return err_status_cipher_fail;
+
+  /* 
+   * if we're authenticating using a universal hash, put the keystream
+   * prefix into the authentication tag
+   */
+  
+  /* if auth_start is non-null, then put keystream into tag  */
+  if (auth_start) {
+
+    /* put keystream prefix into auth_tag */
+    prefix_len = auth_get_prefix_length(stream->rtcp_auth);    
+    status = cipher_output(stream->rtcp_cipher, auth_tag, prefix_len);
+
+    debug_print(mod_srtp, "keystream prefix: %s", 
+		octet_string_hex_string(auth_tag, prefix_len));
+
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /* if we're encrypting, exor keystream into the message */
+  if (enc_start) {
+    status = cipher_encrypt(stream->rtcp_cipher, 
+			    (uint8_t *)enc_start, &enc_octet_len);
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /* initialize auth func context */
+  auth_start(stream->rtcp_auth);
+
+  /* 
+   * run auth func over packet (including trailer), and write the
+   * result at auth_tag 
+   */
+  status = auth_compute(stream->rtcp_auth, 
+			(uint8_t *)auth_start, 
+			(*pkt_octet_len) + sizeof(srtcp_trailer_t), 
+			auth_tag);
+  debug_print(mod_srtp, "srtcp auth tag:    %s", 
+	      octet_string_hex_string(auth_tag, tag_len));
+  if (status)
+    return err_status_auth_fail;   
+    
+  /* increase the packet length by the length of the auth tag and seq_num*/
+  *pkt_octet_len += (tag_len + sizeof(srtcp_trailer_t));
+    
+  return err_status_ok;  
+}
+
+
+err_status_t 
+srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len) {
+  srtcp_hdr_t *hdr = (srtcp_hdr_t *)srtcp_hdr;
+  uint32_t *enc_start;      /* pointer to start of encrypted portion  */
+  uint32_t *auth_start;     /* pointer to start of auth. portion      */
+  uint32_t *trailer;        /* pointer to start of trailer            */
+  unsigned enc_octet_len = 0;/* number of octets in encrypted portion */
+  uint8_t *auth_tag = NULL; /* location of auth_tag within packet     */
+  uint8_t tmp_tag[SRTP_MAX_TAG_LEN];
+  err_status_t status;   
+  int tag_len;
+  srtp_stream_ctx_t *stream;
+  int prefix_len;
+  uint32_t seq_num;
+
+  /* we assume the hdr is 32-bit aligned to start */
+  /*
+   * look up ssrc in srtp_stream list, and process the packet with 
+   * the appropriate stream.  if we haven't seen this stream before,
+   * there's only one key for this srtp_session, and the cipher
+   * supports key-sharing, then we assume that a new stream using
+   * that key has just started up
+   */
+  stream = srtp_get_stream(ctx, hdr->ssrc);
+  if (stream == NULL) {
+    if (ctx->stream_template != NULL) {
+      stream = ctx->stream_template;
+      debug_print(mod_srtp, "srtcp using provisional stream (SSRC: 0x%08x)", 
+		  hdr->ssrc);
+    } else {
+      /* no template stream, so we return an error */
+      return err_status_no_ctx;
+    } 
+  }
+  
+  /* get tag length from stream context */
+  tag_len = auth_get_tag_length(stream->rtcp_auth); 
+
+  /*
+   * set encryption start, encryption length, and trailer
+   */
+  enc_octet_len = *pkt_octet_len - 
+                  (octets_in_rtcp_header + tag_len + sizeof(srtcp_trailer_t));
+  /* index & E (encryption) bit follow normal data.  hdr->len
+	 is the number of words (32-bit) in the normal packet minus 1 */
+  /* This should point trailer to the word past the end of the
+	 normal data. */
+  /* This would need to be modified for optional mikey data */
+  /*
+   * NOTE: trailer is 32-bit aligned because RTCP 'packets' are always
+   *	 multiples of 32-bits (RFC 3550 6.1)
+   */
+  trailer = (uint32_t *) ((char *) hdr +
+		     *pkt_octet_len -(tag_len + sizeof(srtcp_trailer_t)));
+  if (*((unsigned char *) trailer) & SRTCP_E_BYTE_BIT) {
+    enc_start = (uint32_t *)hdr + uint32s_in_rtcp_header;  
+  } else {
+    enc_octet_len = 0;
+    enc_start = NULL; /* this indicates that there's no encryption */
+  }
+
+  /* 
+   * set the auth_start and auth_tag pointers to the proper locations
+   * (note that srtcp *always* uses authentication, unlike srtp)
+   */
+  auth_start = (uint32_t *)hdr;
+  auth_tag = (uint8_t *)hdr + *pkt_octet_len - tag_len;
+
+  /* 
+   * check the sequence number for replays
+   */
+  /* this is easier than dealing with bitfield access */
+  seq_num = ntohl(*trailer) & SRTCP_INDEX_MASK;
+  debug_print(mod_srtp, "srtcp index: %x", seq_num);
+  status = rdb_check(&stream->rtcp_rdb, seq_num);
+  if (status)
+    return status;
+
+  /* 
+   * if we're using aes counter mode, set nonce and seq 
+   */
+  if (stream->rtcp_cipher->type == &aes_icm) {
+    v128_t iv;
+
+    iv.v32[0] = 0;
+    iv.v32[1] = hdr->ssrc; /* still in network order! */
+    iv.v32[2] = htonl(seq_num >> 16);
+    iv.v32[3] = htonl(seq_num << 16);
+    status = aes_icm_set_iv((aes_icm_ctx_t*)stream->rtcp_cipher->state, &iv);
+
+  } else {  
+    v128_t iv;
+    
+    /* otherwise, just set the index to seq_num */  
+    iv.v32[0] = 0;
+    iv.v32[1] = 0;
+    iv.v32[2] = 0;
+    iv.v32[3] = htonl(seq_num);
+    status = cipher_set_iv(stream->rtcp_cipher, &iv);
+
+  }
+  if (status)
+    return err_status_cipher_fail;
+
+  /* initialize auth func context */
+  auth_start(stream->rtcp_auth);
+
+  /* run auth func over packet, put result into tmp_tag */
+  status = auth_compute(stream->rtcp_auth, (uint8_t *)auth_start,  
+			*pkt_octet_len - tag_len,
+			tmp_tag);
+  debug_print(mod_srtp, "srtcp computed tag:       %s", 
+	      octet_string_hex_string(tmp_tag, tag_len));
+  if (status)
+    return err_status_auth_fail;   
+  
+  /* compare the tag just computed with the one in the packet */
+  debug_print(mod_srtp, "srtcp tag from packet:    %s", 
+	      octet_string_hex_string(auth_tag, tag_len));  
+  if (octet_string_is_eq(tmp_tag, auth_tag, tag_len))
+    return err_status_auth_fail;
+
+  /* 
+   * if we're authenticating using a universal hash, put the keystream
+   * prefix into the authentication tag
+   */
+  prefix_len = auth_get_prefix_length(stream->rtcp_auth);    
+  if (prefix_len) {
+    status = cipher_output(stream->rtcp_cipher, auth_tag, prefix_len);
+    debug_print(mod_srtp, "keystream prefix: %s", 
+		octet_string_hex_string(auth_tag, prefix_len));
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /* if we're decrypting, exor keystream into the message */
+  if (enc_start) {
+    status = cipher_encrypt(stream->rtcp_cipher, 
+			    (uint8_t *)enc_start, &enc_octet_len);
+    if (status)
+      return err_status_cipher_fail;
+  }
+
+  /* decrease the packet length by the length of the auth tag and seq_num*/
+  *pkt_octet_len -= (tag_len + sizeof(srtcp_trailer_t));
+
+  /* 
+   * verify that stream is for received traffic - this check will
+   * detect SSRC collisions, since a stream that appears in both
+   * srtp_protect() and srtp_unprotect() will fail this test in one of
+   * those functions.
+   *
+   * we do this check *after* the authentication check, so that the
+   * latter check will catch any attempts to fool us into thinking
+   * that we've got a collision
+   */
+  if (stream->direction != dir_srtp_receiver) {
+    if (stream->direction == dir_unknown) {
+      stream->direction = dir_srtp_receiver;
+    } else {
+      srtp_handle_event(ctx, stream, event_ssrc_collision);
+    }
+  }
+
+  /* 
+   * if the stream is a 'provisional' one, in which the template context
+   * is used, then we need to allocate a new stream at this point, since
+   * the authentication passed
+   */
+  if (stream == ctx->stream_template) {  
+    srtp_stream_ctx_t *new_stream;
+
+    /* 
+     * allocate and initialize a new stream 
+     * 
+     * note that we indicate failure if we can't allocate the new
+     * stream, and some implementations will want to not return
+     * failure here
+     */
+    status = srtp_stream_clone(ctx->stream_template, hdr->ssrc, &new_stream); 
+    if (status)
+      return status;
+    
+    /* add new stream to the head of the stream_list */
+    new_stream->next = ctx->stream_list;
+    ctx->stream_list = new_stream;
+    
+    /* set stream (the pointer used in this function) */
+    stream = new_stream;
+  }
+
+  /* we've passed the authentication check, so add seq_num to the rdb */
+  rdb_add_index(&stream->rtcp_rdb, seq_num);
+    
+    
+  return err_status_ok;  
+}
+
+
+
+/*
+ * dtls keying for srtp 
+ */
+
+err_status_t
+crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, 
+				       srtp_profile_t profile) {
+
+  /* set SRTP policy from the SRTP profile in the key set */
+  switch(profile) {
+  case srtp_profile_aes128_cm_sha1_80:
+    crypto_policy_set_aes_cm_128_hmac_sha1_80(policy);
+    break;
+  case srtp_profile_aes128_cm_sha1_32:
+    crypto_policy_set_aes_cm_128_hmac_sha1_32(policy);
+    break;
+  case srtp_profile_null_sha1_80:
+    crypto_policy_set_null_cipher_hmac_sha1_80(policy);
+    break;
+    /* the following profiles are not (yet) supported */
+  case srtp_profile_null_sha1_32:
+  case srtp_profile_aes256_cm_sha1_80:
+  case srtp_profile_aes256_cm_sha1_32:
+  default:
+    return err_status_bad_param;
+  }
+
+  return err_status_ok;
+}
+
+err_status_t
+crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy, 
+					srtp_profile_t profile) {
+
+  /* set SRTP policy from the SRTP profile in the key set */
+  switch(profile) {
+  case srtp_profile_aes128_cm_sha1_80:
+    crypto_policy_set_aes_cm_128_hmac_sha1_80(policy);
+    break;
+  case srtp_profile_aes128_cm_sha1_32:
+    crypto_policy_set_aes_cm_128_hmac_sha1_32(policy);
+    break;
+  case srtp_profile_null_sha1_80:
+    crypto_policy_set_null_cipher_hmac_sha1_80(policy);
+    break;
+    /* the following profiles are not (yet) supported */
+  case srtp_profile_null_sha1_32:
+  case srtp_profile_aes256_cm_sha1_80:
+  case srtp_profile_aes256_cm_sha1_32:
+  default:
+    return err_status_bad_param;
+  }
+
+  return err_status_ok;
+}
+
+void
+append_salt_to_key(uint8_t *key, unsigned int bytes_in_key,
+		   uint8_t *salt, unsigned int bytes_in_salt) {
+
+  memcpy(key + bytes_in_key, salt, bytes_in_salt);
+
+}
+
+unsigned int
+srtp_profile_get_master_key_length(srtp_profile_t profile) {
+
+  switch(profile) {
+  case srtp_profile_aes128_cm_sha1_80:
+    return 16;
+    break;
+  case srtp_profile_aes128_cm_sha1_32:
+    return 16;
+    break;
+  case srtp_profile_null_sha1_80:
+    return 16;
+    break;
+    /* the following profiles are not (yet) supported */
+  case srtp_profile_null_sha1_32:
+  case srtp_profile_aes256_cm_sha1_80:
+  case srtp_profile_aes256_cm_sha1_32:
+  default:
+    return 0;  /* indicate error by returning a zero */
+  }
+}
+
+unsigned int
+srtp_profile_get_master_salt_length(srtp_profile_t profile) {
+
+  switch(profile) {
+  case srtp_profile_aes128_cm_sha1_80:
+    return 14;
+    break;
+  case srtp_profile_aes128_cm_sha1_32:
+    return 14;
+    break;
+  case srtp_profile_null_sha1_80:
+    return 14;
+    break;
+    /* the following profiles are not (yet) supported */
+  case srtp_profile_null_sha1_32:
+  case srtp_profile_aes256_cm_sha1_80:
+  case srtp_profile_aes256_cm_sha1_32:
+  default:
+    return 0;  /* indicate error by returning a zero */
+  }
+}
diff --git a/jni/pjproject-android/.svn/pristine/9f/9f926e862b0d869f490e9fafbfd83a18323a264f.svn-base b/jni/pjproject-android/.svn/pristine/9f/9f926e862b0d869f490e9fafbfd83a18323a264f.svn-base
new file mode 100644
index 0000000..f5208b6
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9f926e862b0d869f490e9fafbfd83a18323a264f.svn-base
@@ -0,0 +1,18 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by pjsystest_wince.rc
+//
+#define IDD_MAIN_DIALOG                 101
+#define IDS_MAIN_TITLE                  102
+#define IDC_EDIT1                       1001
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        103
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1002
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/jni/pjproject-android/.svn/pristine/9f/9fa7bda04dbe84b039b932b9f08a2b7b32671218.svn-base b/jni/pjproject-android/.svn/pristine/9f/9fa7bda04dbe84b039b932b9f08a2b7b32671218.svn-base
new file mode 100644
index 0000000..14f17cd
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/9f/9fa7bda04dbe84b039b932b9f08a2b7b32671218.svn-base
@@ -0,0 +1,1587 @@
+//------------------------------------------------------------------------------

+// File: AMFilter.h

+//

+// Desc: DirectShow base classes - efines class hierarchy for streams

+//       architecture.

+//

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

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

+

+

+#ifndef __FILTER__

+#define __FILTER__

+

+/* The following classes are declared in this header: */

+

+class CBaseMediaFilter;     // IMediaFilter support

+class CBaseFilter;          // IBaseFilter,IMediaFilter support

+class CBasePin;             // Abstract base class for IPin interface

+class CEnumPins;            // Enumerate input and output pins

+class CEnumMediaTypes;      // Enumerate the pin's preferred formats

+class CBaseOutputPin;       // Adds data provider member functions

+class CBaseInputPin;        // Implements IMemInputPin interface

+class CMediaSample;         // Basic transport unit for IMemInputPin

+class CBaseAllocator;       // General list guff for most allocators

+class CMemAllocator;        // Implements memory buffer allocation

+

+

+//=====================================================================

+//=====================================================================

+//

+// QueryFilterInfo and QueryPinInfo AddRef the interface pointers

+// they return.  You can use the macro below to release the interface.

+//

+//=====================================================================

+//=====================================================================

+

+#define QueryFilterInfoReleaseGraph(fi) if ((fi).pGraph) (fi).pGraph->Release();

+

+#define QueryPinInfoReleaseFilter(pi) if ((pi).pFilter) (pi).pFilter->Release();

+

+//=====================================================================

+//=====================================================================

+// Defines CBaseMediaFilter

+//

+// Abstract base class implementing IMediaFilter.

+//

+// Typically you will derive your filter from CBaseFilter rather than

+// this,  unless you are implementing an object such as a plug-in

+// distributor that needs to support IMediaFilter but not IBaseFilter.

+//

+// Note that IMediaFilter is derived from IPersist to allow query of

+// class id.

+//=====================================================================

+//=====================================================================

+

+class AM_NOVTABLE CBaseMediaFilter : public CUnknown,

+                                     public IMediaFilter

+{

+

+protected:

+

+    FILTER_STATE    m_State;            // current state: running, paused

+    IReferenceClock *m_pClock;          // this filter's reference clock

+    // note: all filters in a filter graph use the same clock

+

+    // offset from stream time to reference time

+    CRefTime        m_tStart;

+

+    CLSID	    m_clsid;            // This filters clsid

+                                        // used for serialization

+    CCritSec        *m_pLock;           // Object we use for locking

+

+public:

+

+    CBaseMediaFilter(

+        __in_opt LPCTSTR pName,

+        __inout_opt LPUNKNOWN pUnk,

+        __in CCritSec  *pLock,

+	REFCLSID   clsid);

+

+    virtual ~CBaseMediaFilter();

+

+    DECLARE_IUNKNOWN

+

+    // override this to say what interfaces we support where

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv);

+

+    //

+    // --- IPersist method ---

+    //

+

+    STDMETHODIMP GetClassID(__out CLSID *pClsID);

+

+    // --- IMediaFilter methods ---

+

+    STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State);

+

+    STDMETHODIMP SetSyncSource(__inout_opt IReferenceClock *pClock);

+

+    STDMETHODIMP GetSyncSource(__deref_out_opt IReferenceClock **pClock);

+

+    // default implementation of Stop and Pause just record the

+    // state. Override to activate or de-activate your filter.

+    // Note that Run when called from Stopped state will call Pause

+    // to ensure activation, so if you are a source or transform

+    // you will probably not need to override Run.

+    STDMETHODIMP Stop();

+    STDMETHODIMP Pause();

+

+

+    // the start parameter is the difference to be added to the

+    // sample's stream time to get the reference time for

+    // its presentation

+    STDMETHODIMP Run(REFERENCE_TIME tStart);

+

+    // --- helper methods ---

+

+    // return the current stream time - ie find out what

+    // stream time should be appearing now

+    virtual HRESULT StreamTime(CRefTime& rtStream);

+

+    // Is the filter currently active? (running or paused)

+    BOOL IsActive() {

+        CAutoLock cObjectLock(m_pLock);

+        return ((m_State == State_Paused) || (m_State == State_Running));

+    };

+};

+

+//=====================================================================

+//=====================================================================

+// Defines CBaseFilter

+//

+// An abstract class providing basic IBaseFilter support for pin

+// enumeration and filter information reading.

+//

+// We cannot derive from CBaseMediaFilter since methods in IMediaFilter

+// are also in IBaseFilter and would be ambiguous. Since much of the code

+// assumes that they derive from a class that has m_State and other state

+// directly available, we duplicate code from CBaseMediaFilter rather than

+// having a member variable.

+//

+// Derive your filter from this, or from a derived object such as

+// CTransformFilter.

+//=====================================================================

+//=====================================================================

+

+

+class AM_NOVTABLE CBaseFilter : public CUnknown,        // Handles an IUnknown

+                    public IBaseFilter,     // The Filter Interface

+                    public IAMovieSetup     // For un/registration

+{

+

+friend class CBasePin;

+

+protected:

+    FILTER_STATE    m_State;            // current state: running, paused

+    IReferenceClock *m_pClock;          // this graph's ref clock

+    CRefTime        m_tStart;           // offset from stream time to reference time

+    CLSID	    m_clsid;            // This filters clsid

+                                        // used for serialization

+    CCritSec        *m_pLock;           // Object we use for locking

+

+    WCHAR           *m_pName;           // Full filter name

+    IFilterGraph    *m_pGraph;          // Graph we belong to

+    IMediaEventSink *m_pSink;           // Called with notify events

+    LONG            m_PinVersion;       // Current pin version

+

+public:

+

+    CBaseFilter(

+        __in_opt LPCTSTR pName,   // Object description

+        __inout_opt LPUNKNOWN pUnk,  // IUnknown of delegating object

+        __in CCritSec  *pLock,    // Object who maintains lock

+	REFCLSID   clsid);        // The clsid to be used to serialize this filter

+

+    CBaseFilter(

+        __in_opt LPCTSTR pName,    // Object description

+        __in_opt LPUNKNOWN pUnk,  // IUnknown of delegating object

+        __in CCritSec  *pLock,    // Object who maintains lock

+	REFCLSID   clsid,         // The clsid to be used to serialize this filter

+        __inout HRESULT   *phr);  // General OLE return code

+#ifdef UNICODE

+    CBaseFilter(

+        __in_opt LPCSTR pName,    // Object description

+        __in_opt LPUNKNOWN pUnk,  // IUnknown of delegating object

+        __in CCritSec  *pLock,    // Object who maintains lock

+	REFCLSID   clsid);        // The clsid to be used to serialize this filter

+

+    CBaseFilter(

+        __in_opt LPCSTR pName,     // Object description

+        __in_opt LPUNKNOWN pUnk,  // IUnknown of delegating object

+        __in CCritSec  *pLock,    // Object who maintains lock

+	REFCLSID   clsid,         // The clsid to be used to serialize this filter

+        __inout HRESULT   *phr);  // General OLE return code

+#endif

+    ~CBaseFilter();

+

+    DECLARE_IUNKNOWN

+

+    // override this to say what interfaces we support where

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv);

+#ifdef DEBUG

+    STDMETHODIMP_(ULONG) NonDelegatingRelease();

+#endif

+

+    //

+    // --- IPersist method ---

+    //

+

+    STDMETHODIMP GetClassID(__out CLSID *pClsID);

+

+    // --- IMediaFilter methods ---

+

+    STDMETHODIMP GetState(DWORD dwMSecs, __out FILTER_STATE *State);

+

+    STDMETHODIMP SetSyncSource(__in_opt IReferenceClock *pClock);

+

+    STDMETHODIMP GetSyncSource(__deref_out_opt IReferenceClock **pClock);

+

+

+    // override Stop and Pause so we can activate the pins.

+    // Note that Run will call Pause first if activation needed.

+    // Override these if you want to activate your filter rather than

+    // your pins.

+    STDMETHODIMP Stop();

+    STDMETHODIMP Pause();

+

+    // the start parameter is the difference to be added to the

+    // sample's stream time to get the reference time for

+    // its presentation

+    STDMETHODIMP Run(REFERENCE_TIME tStart);

+

+    // --- helper methods ---

+

+    // return the current stream time - ie find out what

+    // stream time should be appearing now

+    virtual HRESULT StreamTime(CRefTime& rtStream);

+

+    // Is the filter currently active?

+    BOOL IsActive() {

+        CAutoLock cObjectLock(m_pLock);

+        return ((m_State == State_Paused) || (m_State == State_Running));

+    };

+

+    // Is this filter stopped (without locking)

+    BOOL IsStopped() {

+        return (m_State == State_Stopped);

+    };

+

+    //

+    // --- IBaseFilter methods ---

+    //

+

+    // pin enumerator

+    STDMETHODIMP EnumPins(

+                    __deref_out IEnumPins ** ppEnum);

+

+

+    // default behaviour of FindPin assumes pin ids are their names

+    STDMETHODIMP FindPin(

+        LPCWSTR Id,

+        __deref_out IPin ** ppPin

+    );

+

+    STDMETHODIMP QueryFilterInfo(

+                    __out FILTER_INFO * pInfo);

+

+    STDMETHODIMP JoinFilterGraph(

+                    __inout_opt IFilterGraph * pGraph,

+                    __in_opt LPCWSTR pName);

+

+    // return a Vendor information string. Optional - may return E_NOTIMPL.

+    // memory returned should be freed using CoTaskMemFree

+    // default implementation returns E_NOTIMPL

+    STDMETHODIMP QueryVendorInfo(

+                    __deref_out LPWSTR* pVendorInfo

+            );

+

+    // --- helper methods ---

+

+    // send an event notification to the filter graph if we know about it.

+    // returns S_OK if delivered, S_FALSE if the filter graph does not sink

+    // events, or an error otherwise.

+    HRESULT NotifyEvent(

+        long EventCode,

+        LONG_PTR EventParam1,

+        LONG_PTR EventParam2);

+

+    // return the filter graph we belong to

+    __out_opt IFilterGraph *GetFilterGraph() {

+        return m_pGraph;

+    }

+

+    // Request reconnect

+    // pPin is the pin to reconnect

+    // pmt is the type to reconnect with - can be NULL

+    // Calls ReconnectEx on the filter graph

+    HRESULT ReconnectPin(IPin *pPin, __in_opt AM_MEDIA_TYPE const *pmt);

+

+    // find out the current pin version (used by enumerators)

+    virtual LONG GetPinVersion();

+    void IncrementPinVersion();

+

+    // you need to supply these to access the pins from the enumerator

+    // and for default Stop and Pause/Run activation.

+    virtual int GetPinCount() PURE;

+    virtual CBasePin *GetPin(int n) PURE;

+

+    // --- IAMovieSetup methods ---

+

+    STDMETHODIMP Register();    // ask filter to register itself

+    STDMETHODIMP Unregister();  // and unregister itself

+

+    // --- setup helper methods ---

+    // (override to return filters setup data)

+

+    virtual __out_opt LPAMOVIESETUP_FILTER GetSetupData(){ return NULL; }

+

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CBasePin

+//

+// Abstract class that supports the basics of IPin

+//=====================================================================

+//=====================================================================

+

+class  AM_NOVTABLE CBasePin : public CUnknown, public IPin, public IQualityControl

+{

+

+protected:

+

+    WCHAR *         m_pName;		        // This pin's name

+    IPin            *m_Connected;               // Pin we have connected to

+    PIN_DIRECTION   m_dir;                      // Direction of this pin

+    CCritSec        *m_pLock;                   // Object we use for locking

+    bool            m_bRunTimeError;            // Run time error generated

+    bool            m_bCanReconnectWhenActive;  // OK to reconnect when active

+    bool            m_bTryMyTypesFirst;         // When connecting enumerate

+                                                // this pin's types first

+    CBaseFilter    *m_pFilter;                  // Filter we were created by

+    IQualityControl *m_pQSink;                  // Target for Quality messages

+    LONG            m_TypeVersion;              // Holds current type version

+    CMediaType      m_mt;                       // Media type of connection

+

+    CRefTime        m_tStart;                   // time from NewSegment call

+    CRefTime        m_tStop;                    // time from NewSegment

+    double          m_dRate;                    // rate from NewSegment

+

+#ifdef DEBUG

+    LONG            m_cRef;                     // Ref count tracing

+#endif

+

+    // displays pin connection information

+

+#ifdef DEBUG

+    void DisplayPinInfo(IPin *pReceivePin);

+    void DisplayTypeInfo(IPin *pPin, const CMediaType *pmt);

+#else

+    void DisplayPinInfo(IPin *pReceivePin) {};

+    void DisplayTypeInfo(IPin *pPin, const CMediaType *pmt) {};

+#endif

+

+    // used to agree a media type for a pin connection

+

+    // given a specific media type, attempt a connection (includes

+    // checking that the type is acceptable to this pin)

+    HRESULT

+    AttemptConnection(

+        IPin* pReceivePin,      // connect to this pin

+        const CMediaType* pmt   // using this type

+    );

+

+    // try all the media types in this enumerator - for each that

+    // we accept, try to connect using ReceiveConnection.

+    HRESULT TryMediaTypes(

+                        IPin *pReceivePin,          // connect to this pin

+                        __in_opt const CMediaType *pmt,  // proposed type from Connect

+                        IEnumMediaTypes *pEnum);    // try this enumerator

+

+    // establish a connection with a suitable mediatype. Needs to

+    // propose a media type if the pmt pointer is null or partially

+    // specified - use TryMediaTypes on both our and then the other pin's

+    // enumerator until we find one that works.

+    HRESULT AgreeMediaType(

+                        IPin *pReceivePin,      // connect to this pin

+                        const CMediaType *pmt);      // proposed type from Connect

+

+public:

+

+    CBasePin(

+        __in_opt LPCTSTR pObjectName,         // Object description

+        __in CBaseFilter *pFilter,       // Owning filter who knows about pins

+        __in CCritSec *pLock,            // Object who implements the lock

+        __inout HRESULT *phr,               // General OLE return code

+        __in_opt LPCWSTR pName,              // Pin name for us

+        PIN_DIRECTION dir);         // Either PINDIR_INPUT or PINDIR_OUTPUT

+#ifdef UNICODE

+    CBasePin(

+        __in_opt LPCSTR pObjectName,         // Object description

+        __in CBaseFilter *pFilter,       // Owning filter who knows about pins

+        __in CCritSec *pLock,            // Object who implements the lock

+        __inout HRESULT *phr,               // General OLE return code

+        __in_opt LPCWSTR pName,              // Pin name for us

+        PIN_DIRECTION dir);         // Either PINDIR_INPUT or PINDIR_OUTPUT

+#endif

+    virtual ~CBasePin();

+

+    DECLARE_IUNKNOWN

+

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv);

+    STDMETHODIMP_(ULONG) NonDelegatingRelease();

+    STDMETHODIMP_(ULONG) NonDelegatingAddRef();

+

+    // --- IPin methods ---

+

+    // take lead role in establishing a connection. Media type pointer

+    // may be null, or may point to partially-specified mediatype

+    // (subtype or format type may be GUID_NULL).

+    STDMETHODIMP Connect(

+        IPin * pReceivePin,

+        __in_opt const AM_MEDIA_TYPE *pmt   // optional media type

+    );

+

+    // (passive) accept a connection from another pin

+    STDMETHODIMP ReceiveConnection(

+        IPin * pConnector,      // this is the initiating connecting pin

+        const AM_MEDIA_TYPE *pmt   // this is the media type we will exchange

+    );

+

+    STDMETHODIMP Disconnect();

+

+    STDMETHODIMP ConnectedTo(__deref_out IPin **pPin);

+

+    STDMETHODIMP ConnectionMediaType(__out AM_MEDIA_TYPE *pmt);

+

+    STDMETHODIMP QueryPinInfo(

+        __out PIN_INFO * pInfo

+    );

+

+    STDMETHODIMP QueryDirection(

+    	__out PIN_DIRECTION * pPinDir

+    );

+

+    STDMETHODIMP QueryId(

+        __deref_out LPWSTR * Id

+    );

+

+    // does the pin support this media type

+    STDMETHODIMP QueryAccept(

+        const AM_MEDIA_TYPE *pmt

+    );

+

+    // return an enumerator for this pins preferred media types

+    STDMETHODIMP EnumMediaTypes(

+        __deref_out IEnumMediaTypes **ppEnum

+    );

+

+    // return an array of IPin* - the pins that this pin internally connects to

+    // All pins put in the array must be AddReffed (but no others)

+    // Errors: "Can't say" - FAIL, not enough slots - return S_FALSE

+    // Default: return E_NOTIMPL

+    // The filter graph will interpret NOT_IMPL as any input pin connects to

+    // all visible output pins and vice versa.

+    // apPin can be NULL if nPin==0 (not otherwise).

+    STDMETHODIMP QueryInternalConnections(

+        __out_ecount_part(*nPin,*nPin) IPin* *apPin,     // array of IPin*

+        __inout ULONG *nPin                  // on input, the number of slots

+                                             // on output  the number of pins

+    ) { return E_NOTIMPL; }

+

+    // Called when no more data will be sent

+    STDMETHODIMP EndOfStream(void);

+

+    // Begin/EndFlush still PURE

+

+    // NewSegment notifies of the start/stop/rate applying to the data

+    // about to be received. Default implementation records data and

+    // returns S_OK.

+    // Override this to pass downstream.

+    STDMETHODIMP NewSegment(

+                    REFERENCE_TIME tStart,

+                    REFERENCE_TIME tStop,

+                    double dRate);

+

+    //================================================================================

+    // IQualityControl methods

+    //================================================================================

+

+    STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);

+

+    STDMETHODIMP SetSink(IQualityControl * piqc);

+

+    // --- helper methods ---

+

+    // Returns true if the pin is connected. false otherwise.

+    BOOL IsConnected(void) {return (m_Connected != NULL); };

+    // Return the pin this is connected to (if any)

+    IPin * GetConnected() { return m_Connected; };

+

+    // Check if our filter is currently stopped

+    BOOL IsStopped() {

+        return (m_pFilter->m_State == State_Stopped);

+    };

+

+    // find out the current type version (used by enumerators)

+    virtual LONG GetMediaTypeVersion();

+    void IncrementTypeVersion();

+

+    // switch the pin to active (paused or running) mode

+    // not an error to call this if already active

+    virtual HRESULT Active(void);

+

+    // switch the pin to inactive state - may already be inactive

+    virtual HRESULT Inactive(void);

+

+    // Notify of Run() from filter

+    virtual HRESULT Run(REFERENCE_TIME tStart);

+

+    // check if the pin can support this specific proposed type and format

+    virtual HRESULT CheckMediaType(const CMediaType *) PURE;

+

+    // set the connection to use this format (previously agreed)

+    virtual HRESULT SetMediaType(const CMediaType *);

+

+    // check that the connection is ok before verifying it

+    // can be overridden eg to check what interfaces will be supported.

+    virtual HRESULT CheckConnect(IPin *);

+

+    // Set and release resources required for a connection

+    virtual HRESULT BreakConnect();

+    virtual HRESULT CompleteConnect(IPin *pReceivePin);

+

+    // returns the preferred formats for a pin

+    virtual HRESULT GetMediaType(int iPosition, __inout CMediaType *pMediaType);

+

+    // access to NewSegment values

+    REFERENCE_TIME CurrentStopTime() {

+        return m_tStop;

+    }

+    REFERENCE_TIME CurrentStartTime() {

+        return m_tStart;

+    }

+    double CurrentRate() {

+        return m_dRate;

+    }

+

+    //  Access name

+    LPWSTR Name() { return m_pName; };

+

+    //  Can reconnectwhen active?

+    void SetReconnectWhenActive(bool bCanReconnect)

+    {

+        m_bCanReconnectWhenActive = bCanReconnect;

+    }

+

+    bool CanReconnectWhenActive()

+    {

+        return m_bCanReconnectWhenActive;

+    }

+

+protected:

+    STDMETHODIMP DisconnectInternal();

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CEnumPins

+//

+// Pin enumerator class that works by calling CBaseFilter. This interface

+// is provided by CBaseFilter::EnumPins and calls GetPinCount() and

+// GetPin() to enumerate existing pins. Needs to be a separate object so

+// that it can be cloned (creating an existing object at the same

+// position in the enumeration)

+//

+//=====================================================================

+//=====================================================================

+

+class CEnumPins : public IEnumPins      // The interface we support

+{

+    int m_Position;                 // Current ordinal position

+    int m_PinCount;                 // Number of pins available

+    CBaseFilter *m_pFilter;         // The filter who owns us

+    LONG m_Version;                 // Pin version information

+    LONG m_cRef;

+

+    typedef CGenericList<CBasePin> CPinList;

+

+    CPinList m_PinCache;	    // These pointers have not been AddRef'ed and

+				    // so they should not be dereferenced.  They are

+				    // merely kept to ID which pins have been enumerated.

+

+#ifdef DEBUG

+    DWORD m_dwCookie;

+#endif

+

+    /* If while we are retrieving a pin for example from the filter an error

+       occurs we assume that our internal state is stale with respect to the

+       filter (someone may have deleted all the pins). We can check before

+       starting whether or not the operation is likely to fail by asking the

+       filter what it's current version number is. If the filter has not

+       overriden the GetPinVersion method then this will always match */

+

+    BOOL AreWeOutOfSync() {

+        return (m_pFilter->GetPinVersion() == m_Version ? FALSE : TRUE);

+    };

+

+    /* This method performs the same operations as Reset, except is does not clear

+       the cache of pins already enumerated. */

+

+    STDMETHODIMP Refresh();

+

+public:

+

+    CEnumPins(

+        __in CBaseFilter *pFilter,

+        __in_opt CEnumPins *pEnumPins);

+

+    virtual ~CEnumPins();

+

+    // IUnknown

+    STDMETHODIMP QueryInterface(REFIID riid, __deref_out void **ppv);

+    STDMETHODIMP_(ULONG) AddRef();

+    STDMETHODIMP_(ULONG) Release();

+

+    // IEnumPins

+    STDMETHODIMP Next(

+        ULONG cPins,         // place this many pins...

+        __out_ecount(cPins) IPin ** ppPins,    // ...in this array of IPin*

+        __out_opt ULONG * pcFetched    // actual count passed returned here

+    );

+

+    STDMETHODIMP Skip(ULONG cPins);

+    STDMETHODIMP Reset();

+    STDMETHODIMP Clone(__deref_out IEnumPins **ppEnum);

+

+

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CEnumMediaTypes

+//

+// Enumerates the preferred formats for input and output pins

+//=====================================================================

+//=====================================================================

+

+class CEnumMediaTypes : public IEnumMediaTypes    // The interface we support

+{

+    int m_Position;           // Current ordinal position

+    CBasePin *m_pPin;         // The pin who owns us

+    LONG m_Version;           // Media type version value

+    LONG m_cRef;

+#ifdef DEBUG

+    DWORD m_dwCookie;

+#endif

+

+    /* The media types a filter supports can be quite dynamic so we add to

+       the general IEnumXXXX interface the ability to be signaled when they

+       change via an event handle the connected filter supplies. Until the

+       Reset method is called after the state changes all further calls to

+       the enumerator (except Reset) will return E_UNEXPECTED error code */

+

+    BOOL AreWeOutOfSync() {

+        return (m_pPin->GetMediaTypeVersion() == m_Version ? FALSE : TRUE);

+    };

+

+public:

+

+    CEnumMediaTypes(

+        __in CBasePin *pPin,

+        __in_opt CEnumMediaTypes *pEnumMediaTypes);

+

+    virtual ~CEnumMediaTypes();

+

+    // IUnknown

+    STDMETHODIMP QueryInterface(REFIID riid, __deref_out void **ppv);

+    STDMETHODIMP_(ULONG) AddRef();

+    STDMETHODIMP_(ULONG) Release();

+

+    // IEnumMediaTypes

+    STDMETHODIMP Next(

+        ULONG cMediaTypes,          // place this many pins...

+        __out_ecount(cMediaTypes) AM_MEDIA_TYPE ** ppMediaTypes,  // ...in this array

+        __out_opt ULONG * pcFetched           // actual count passed

+    );

+

+    STDMETHODIMP Skip(ULONG cMediaTypes);

+    STDMETHODIMP Reset();

+    STDMETHODIMP Clone(__deref_out IEnumMediaTypes **ppEnum);

+};

+

+

+

+

+//=====================================================================

+//=====================================================================

+// Defines CBaseOutputPin

+//

+// class derived from CBasePin that can pass buffers to a connected pin

+// that supports IMemInputPin. Supports IPin.

+//

+// Derive your output pin from this.

+//

+//=====================================================================

+//=====================================================================

+

+class  AM_NOVTABLE CBaseOutputPin : public CBasePin

+{

+

+protected:

+

+    IMemAllocator *m_pAllocator;

+    IMemInputPin *m_pInputPin;        // interface on the downstreaminput pin

+                                      // set up in CheckConnect when we connect.

+

+public:

+

+    CBaseOutputPin(

+        __in_opt LPCTSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+#ifdef UNICODE

+    CBaseOutputPin(

+        __in_opt LPCSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+#endif

+    // override CompleteConnect() so we can negotiate an allocator

+    virtual HRESULT CompleteConnect(IPin *pReceivePin);

+

+    // negotiate the allocator and its buffer size/count and other properties

+    // Calls DecideBufferSize to set properties

+    virtual HRESULT DecideAllocator(IMemInputPin * pPin, __deref_out IMemAllocator ** pAlloc);

+

+    // override this to set the buffer size and count. Return an error

+    // if the size/count is not to your liking.

+    // The allocator properties passed in are those requested by the

+    // input pin - use eg the alignment and prefix members if you have

+    // no preference on these.

+    virtual HRESULT DecideBufferSize(

+        IMemAllocator * pAlloc,

+        __inout ALLOCATOR_PROPERTIES * ppropInputRequest

+    ) PURE;

+

+    // returns an empty sample buffer from the allocator

+    virtual HRESULT GetDeliveryBuffer(__deref_out IMediaSample ** ppSample,

+                                      __in_opt REFERENCE_TIME * pStartTime,

+                                      __in_opt REFERENCE_TIME * pEndTime,

+                                      DWORD dwFlags);

+

+    // deliver a filled-in sample to the connected input pin

+    // note - you need to release it after calling this. The receiving

+    // pin will addref the sample if it needs to hold it beyond the

+    // call.

+    virtual HRESULT Deliver(IMediaSample *);

+

+    // override this to control the connection

+    virtual HRESULT InitAllocator(__deref_out IMemAllocator **ppAlloc);

+    HRESULT CheckConnect(IPin *pPin);

+    HRESULT BreakConnect();

+

+    // override to call Commit and Decommit

+    HRESULT Active(void);

+    HRESULT Inactive(void);

+

+    // we have a default handling of EndOfStream which is to return

+    // an error, since this should be called on input pins only

+    STDMETHODIMP EndOfStream(void);

+

+    // called from elsewhere in our filter to pass EOS downstream to

+    // our connected input pin

+    virtual HRESULT DeliverEndOfStream(void);

+

+    // same for Begin/EndFlush - we handle Begin/EndFlush since it

+    // is an error on an output pin, and we have Deliver methods to

+    // call the methods on the connected pin

+    STDMETHODIMP BeginFlush(void);

+    STDMETHODIMP EndFlush(void);

+    virtual HRESULT DeliverBeginFlush(void);

+    virtual HRESULT DeliverEndFlush(void);

+

+    // deliver NewSegment to connected pin - you will need to

+    // override this if you queue any data in your output pin.

+    virtual HRESULT DeliverNewSegment(

+                        REFERENCE_TIME tStart,

+                        REFERENCE_TIME tStop,

+                        double dRate);

+

+    //================================================================================

+    // IQualityControl methods

+    //================================================================================

+

+    // All inherited from CBasePin and not overridden here.

+    // STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);

+    // STDMETHODIMP SetSink(IQualityControl * piqc);

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CBaseInputPin

+//

+// derive your standard input pin from this.

+// you need to supply GetMediaType and CheckConnect etc (see CBasePin),

+// and you need to supply Receive to do something more useful.

+//

+//=====================================================================

+//=====================================================================

+

+class AM_NOVTABLE CBaseInputPin : public CBasePin,

+                                  public IMemInputPin

+{

+

+protected:

+

+    IMemAllocator *m_pAllocator;    // Default memory allocator

+

+    // allocator is read-only, so received samples

+    // cannot be modified (probably only relevant to in-place

+    // transforms

+    BYTE m_bReadOnly;

+

+    // in flushing state (between BeginFlush and EndFlush)

+    // if TRUE, all Receives are returned with S_FALSE

+    BYTE m_bFlushing;

+

+    // Sample properties - initalized in Receive

+    AM_SAMPLE2_PROPERTIES m_SampleProps;

+

+public:

+

+    CBaseInputPin(

+        __in_opt LPCTSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+#ifdef UNICODE

+    CBaseInputPin(

+        __in_opt LPCSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+#endif

+    virtual ~CBaseInputPin();

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);

+

+    // return the allocator interface that this input pin

+    // would like the output pin to use

+    STDMETHODIMP GetAllocator(__deref_out IMemAllocator ** ppAllocator);

+

+    // tell the input pin which allocator the output pin is actually

+    // going to use.

+    STDMETHODIMP NotifyAllocator(

+                    IMemAllocator * pAllocator,

+                    BOOL bReadOnly);

+

+    // do something with this media sample

+    STDMETHODIMP Receive(IMediaSample *pSample);

+

+    // do something with these media samples

+    STDMETHODIMP ReceiveMultiple (

+        __in_ecount(nSamples) IMediaSample **pSamples,

+        long nSamples,

+        __out long *nSamplesProcessed);

+

+    // See if Receive() blocks

+    STDMETHODIMP ReceiveCanBlock();

+

+    // Default handling for BeginFlush - call at the beginning

+    // of your implementation (makes sure that all Receive calls

+    // fail). After calling this, you need to free any queued data

+    // and then call downstream.

+    STDMETHODIMP BeginFlush(void);

+

+    // default handling for EndFlush - call at end of your implementation

+    // - before calling this, ensure that there is no queued data and no thread

+    // pushing any more without a further receive, then call downstream,

+    // then call this method to clear the m_bFlushing flag and re-enable

+    // receives

+    STDMETHODIMP EndFlush(void);

+

+    // this method is optional (can return E_NOTIMPL).

+    // default implementation returns E_NOTIMPL. Override if you have

+    // specific alignment or prefix needs, but could use an upstream

+    // allocator

+    STDMETHODIMP GetAllocatorRequirements(__out ALLOCATOR_PROPERTIES*pProps);

+

+    // Release the pin's allocator.

+    HRESULT BreakConnect();

+

+    // helper method to check the read-only flag

+    BOOL IsReadOnly() {

+        return m_bReadOnly;

+    };

+

+    // helper method to see if we are flushing

+    BOOL IsFlushing() {

+        return m_bFlushing;

+    };

+

+    //  Override this for checking whether it's OK to process samples

+    //  Also call this from EndOfStream.

+    virtual HRESULT CheckStreaming();

+

+    // Pass a Quality notification on to the appropriate sink

+    HRESULT PassNotify(Quality& q);

+

+

+    //================================================================================

+    // IQualityControl methods (from CBasePin)

+    //================================================================================

+

+    STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);

+

+    // no need to override:

+    // STDMETHODIMP SetSink(IQualityControl * piqc);

+

+

+    // switch the pin to inactive state - may already be inactive

+    virtual HRESULT Inactive(void);

+

+    // Return sample properties pointer

+    AM_SAMPLE2_PROPERTIES * SampleProps() {

+        ASSERT(m_SampleProps.cbData != 0);

+        return &m_SampleProps;

+    }

+

+};

+

+///////////////////////////////////////////////////////////////////////////

+// CDynamicOutputPin

+//

+

+class CDynamicOutputPin : public CBaseOutputPin,

+                          public IPinFlowControl

+{

+public:

+#ifdef UNICODE

+    CDynamicOutputPin(

+        __in_opt LPCSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+#endif

+

+    CDynamicOutputPin(

+        __in_opt LPCTSTR pObjectName,

+        __in CBaseFilter *pFilter,

+        __in CCritSec *pLock,

+        __inout HRESULT *phr,

+        __in_opt LPCWSTR pName);

+

+    ~CDynamicOutputPin();

+

+    // IUnknown Methods

+    DECLARE_IUNKNOWN

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);

+

+    // IPin Methods

+    STDMETHODIMP Disconnect(void);

+

+    // IPinFlowControl Methods

+    STDMETHODIMP Block(DWORD dwBlockFlags, HANDLE hEvent);

+

+    //  Set graph config info

+    void SetConfigInfo(IGraphConfig *pGraphConfig, HANDLE hStopEvent);

+

+    #ifdef DEBUG

+    virtual HRESULT Deliver(IMediaSample *pSample);

+    virtual HRESULT DeliverEndOfStream(void);

+    virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);

+    #endif // DEBUG

+

+    HRESULT DeliverBeginFlush(void);

+    HRESULT DeliverEndFlush(void);

+

+    HRESULT Inactive(void);

+    HRESULT Active(void);

+    virtual HRESULT CompleteConnect(IPin *pReceivePin);

+

+    virtual HRESULT StartUsingOutputPin(void);

+    virtual void StopUsingOutputPin(void);

+    virtual bool StreamingThreadUsingOutputPin(void);

+

+    HRESULT ChangeOutputFormat

+        (

+        const AM_MEDIA_TYPE *pmt,

+        REFERENCE_TIME tSegmentStart,

+        REFERENCE_TIME tSegmentStop,

+        double dSegmentRate

+        );

+    HRESULT ChangeMediaType(const CMediaType *pmt);

+    HRESULT DynamicReconnect(const CMediaType *pmt);

+

+protected:

+    HRESULT SynchronousBlockOutputPin(void);

+    HRESULT AsynchronousBlockOutputPin(HANDLE hNotifyCallerPinBlockedEvent);

+    HRESULT UnblockOutputPin(void);

+

+    void BlockOutputPin(void);

+    void ResetBlockState(void);

+

+    static HRESULT WaitEvent(HANDLE hEvent);

+

+    enum BLOCK_STATE

+    {

+        NOT_BLOCKED,

+        PENDING,

+        BLOCKED

+    };

+

+    // This lock should be held when the following class members are

+    // being used: m_hNotifyCallerPinBlockedEvent, m_BlockState,

+    // m_dwBlockCallerThreadID and m_dwNumOutstandingOutputPinUsers.

+    CCritSec m_BlockStateLock;

+

+    // This event should be signaled when the output pin is

+    // not blocked.  This is a manual reset event.  For more

+    // information on events, see the documentation for

+    // CreateEvent() in the Windows SDK.

+    HANDLE m_hUnblockOutputPinEvent;

+

+    // This event will be signaled when block operation succeedes or

+    // when the user cancels the block operation.  The block operation

+    // can be canceled by calling IPinFlowControl2::Block( 0, NULL )

+    // while the block operation is pending.

+    HANDLE m_hNotifyCallerPinBlockedEvent;

+

+    // The state of the current block operation.

+    BLOCK_STATE m_BlockState;

+

+    // The ID of the thread which last called IPinFlowControl::Block().

+    // For more information on thread IDs, see the documentation for

+    // GetCurrentThreadID() in the Windows SDK.

+    DWORD m_dwBlockCallerThreadID;

+

+    // The number of times StartUsingOutputPin() has been sucessfully

+    // called and a corresponding call to StopUsingOutputPin() has not

+    // been made.  When this variable is greater than 0, the streaming

+    // thread is calling IPin::NewSegment(), IPin::EndOfStream(),

+    // IMemInputPin::Receive() or IMemInputPin::ReceiveMultiple().  The

+    // streaming thread could also be calling: DynamicReconnect(),

+    // ChangeMediaType() or ChangeOutputFormat().  The output pin cannot

+    // be blocked while the output pin is being used.

+    DWORD m_dwNumOutstandingOutputPinUsers;

+

+    // This event should be set when the IMediaFilter::Stop() is called.

+    // This is a manual reset event.  It is also set when the output pin

+    // delivers a flush to the connected input pin.

+    HANDLE m_hStopEvent;

+    IGraphConfig* m_pGraphConfig;

+

+    // TRUE if the output pin's allocator's samples are read only.

+    // Otherwise FALSE.  For more information, see the documentation

+    // for IMemInputPin::NotifyAllocator().

+    BOOL m_bPinUsesReadOnlyAllocator;

+

+private:

+    HRESULT Initialize(void);

+    HRESULT ChangeMediaTypeHelper(const CMediaType *pmt);

+

+    #ifdef DEBUG

+    void AssertValid(void);

+    #endif // DEBUG

+};

+

+class CAutoUsingOutputPin

+{

+public:

+    CAutoUsingOutputPin( __in CDynamicOutputPin* pOutputPin, __inout HRESULT* phr );

+    ~CAutoUsingOutputPin();

+

+private:

+    CDynamicOutputPin* m_pOutputPin;

+};

+

+inline CAutoUsingOutputPin::CAutoUsingOutputPin( __in CDynamicOutputPin* pOutputPin, __inout HRESULT* phr ) :

+    m_pOutputPin(NULL)

+{

+    // The caller should always pass in valid pointers.

+    ASSERT( NULL != pOutputPin );

+    ASSERT( NULL != phr );

+

+    // Make sure the user initialized phr.

+    ASSERT( S_OK == *phr );

+

+    HRESULT hr = pOutputPin->StartUsingOutputPin();

+    if( FAILED( hr ) )

+    {

+        *phr = hr;

+        return;

+    }

+

+    m_pOutputPin = pOutputPin;

+}

+

+inline CAutoUsingOutputPin::~CAutoUsingOutputPin()

+{

+    if( NULL != m_pOutputPin )

+    {

+        m_pOutputPin->StopUsingOutputPin();

+    }

+}

+

+#ifdef DEBUG

+

+inline HRESULT CDynamicOutputPin::Deliver(IMediaSample *pSample)

+{

+    // The caller should call StartUsingOutputPin() before calling this

+    // method.

+    ASSERT(StreamingThreadUsingOutputPin());

+

+    return CBaseOutputPin::Deliver(pSample);

+}

+

+inline HRESULT CDynamicOutputPin::DeliverEndOfStream(void)

+{

+    // The caller should call StartUsingOutputPin() before calling this

+    // method.

+    ASSERT( StreamingThreadUsingOutputPin() );

+

+    return CBaseOutputPin::DeliverEndOfStream();

+}

+

+inline HRESULT CDynamicOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)

+{

+    // The caller should call StartUsingOutputPin() before calling this

+    // method.

+    ASSERT(StreamingThreadUsingOutputPin());

+

+    return CBaseOutputPin::DeliverNewSegment(tStart, tStop, dRate);

+}

+

+#endif // DEBUG

+

+//=====================================================================

+//=====================================================================

+// Memory allocators

+//

+// the shared memory transport between pins requires the input pin

+// to provide a memory allocator that can provide sample objects. A

+// sample object supports the IMediaSample interface.

+//

+// CBaseAllocator handles the management of free and busy samples. It

+// allocates CMediaSample objects. CBaseAllocator is an abstract class:

+// in particular it has no method of initializing the list of free

+// samples. CMemAllocator is derived from CBaseAllocator and initializes

+// the list of samples using memory from the standard IMalloc interface.

+//

+// If you want your buffers to live in some special area of memory,

+// derive your allocator object from CBaseAllocator. If you derive your

+// IMemInputPin interface object from CBaseMemInputPin, you will get

+// CMemAllocator-based allocation etc for free and will just need to

+// supply the Receive handling, and media type / format negotiation.

+//=====================================================================

+//=====================================================================

+

+

+//=====================================================================

+//=====================================================================

+// Defines CMediaSample

+//

+// an object of this class supports IMediaSample and represents a buffer

+// for media data with some associated properties. Releasing it returns

+// it to a freelist managed by a CBaseAllocator derived object.

+//=====================================================================

+//=====================================================================

+

+class CMediaSample : public IMediaSample2    // The interface we support

+{

+

+protected:

+

+    friend class CBaseAllocator;

+

+    /*  Values for dwFlags - these are used for backward compatiblity

+        only now - use AM_SAMPLE_xxx

+    */

+    enum { Sample_SyncPoint       = 0x01,   /* Is this a sync point */

+           Sample_Preroll         = 0x02,   /* Is this a preroll sample */

+           Sample_Discontinuity   = 0x04,   /* Set if start of new segment */

+           Sample_TypeChanged     = 0x08,   /* Has the type changed */

+           Sample_TimeValid       = 0x10,   /* Set if time is valid */

+           Sample_MediaTimeValid  = 0x20,   /* Is the media time valid */

+           Sample_TimeDiscontinuity = 0x40, /* Time discontinuity */

+           Sample_StopValid       = 0x100,  /* Stop time valid */

+           Sample_ValidFlags      = 0x1FF

+         };

+

+    /* Properties, the media sample class can be a container for a format

+       change in which case we take a copy of a type through the SetMediaType

+       interface function and then return it when GetMediaType is called. As

+       we do no internal processing on it we leave it as a pointer */

+

+    DWORD            m_dwFlags;         /* Flags for this sample */

+                                        /* Type specific flags are packed

+                                           into the top word

+                                        */

+    DWORD            m_dwTypeSpecificFlags; /* Media type specific flags */

+    __field_ecount_opt(m_cbBuffer) LPBYTE           m_pBuffer;         /* Pointer to the complete buffer */

+    LONG             m_lActual;         /* Length of data in this sample */

+    LONG             m_cbBuffer;        /* Size of the buffer */

+    CBaseAllocator  *m_pAllocator;      /* The allocator who owns us */

+    CMediaSample     *m_pNext;          /* Chaining in free list */

+    REFERENCE_TIME   m_Start;           /* Start sample time */

+    REFERENCE_TIME   m_End;             /* End sample time */

+    LONGLONG         m_MediaStart;      /* Real media start position */

+    LONG             m_MediaEnd;        /* A difference to get the end */

+    AM_MEDIA_TYPE    *m_pMediaType;     /* Media type change data */

+    DWORD            m_dwStreamId;      /* Stream id */

+public:

+    LONG             m_cRef;            /* Reference count */

+

+

+public:

+

+    CMediaSample(

+        __in_opt LPCTSTR pName,

+        __in_opt CBaseAllocator *pAllocator,

+        __inout_opt HRESULT *phr,

+        __in_bcount_opt(length) LPBYTE pBuffer = NULL,

+        LONG length = 0);

+#ifdef UNICODE

+    CMediaSample(

+        __in_opt LPCSTR pName,

+        __in_opt CBaseAllocator *pAllocator,

+        __inout_opt HRESULT *phr,

+        __in_bcount_opt(length) LPBYTE pBuffer = NULL,

+        LONG length = 0);

+#endif

+

+    virtual ~CMediaSample();

+

+    /* Note the media sample does not delegate to its owner */

+

+    STDMETHODIMP QueryInterface(REFIID riid, __deref_out void **ppv);

+    STDMETHODIMP_(ULONG) AddRef();

+    STDMETHODIMP_(ULONG) Release();

+

+    // set the buffer pointer and length. Used by allocators that

+    // want variable sized pointers or pointers into already-read data.

+    // This is only available through a CMediaSample* not an IMediaSample*

+    // and so cannot be changed by clients.

+    HRESULT SetPointer(__in_bcount(cBytes) BYTE * ptr, LONG cBytes);

+

+    // Get me a read/write pointer to this buffer's memory.

+    STDMETHODIMP GetPointer(__deref_out BYTE ** ppBuffer);

+

+    STDMETHODIMP_(LONG) GetSize(void);

+

+    // get the stream time at which this sample should start and finish.

+    STDMETHODIMP GetTime(

+        __out REFERENCE_TIME * pTimeStart,     // put time here

+        __out REFERENCE_TIME * pTimeEnd

+    );

+

+    // Set the stream time at which this sample should start and finish.

+    STDMETHODIMP SetTime(

+        __in_opt REFERENCE_TIME * pTimeStart,     // put time here

+        __in_opt REFERENCE_TIME * pTimeEnd

+    );

+    STDMETHODIMP IsSyncPoint(void);

+    STDMETHODIMP SetSyncPoint(BOOL bIsSyncPoint);

+    STDMETHODIMP IsPreroll(void);

+    STDMETHODIMP SetPreroll(BOOL bIsPreroll);

+

+    STDMETHODIMP_(LONG) GetActualDataLength(void);

+    STDMETHODIMP SetActualDataLength(LONG lActual);

+

+    // these allow for limited format changes in band

+

+    STDMETHODIMP GetMediaType(__deref_out AM_MEDIA_TYPE **ppMediaType);

+    STDMETHODIMP SetMediaType(__in_opt AM_MEDIA_TYPE *pMediaType);

+

+    // returns S_OK if there is a discontinuity in the data (this same is

+    // not a continuation of the previous stream of data

+    // - there has been a seek).

+    STDMETHODIMP IsDiscontinuity(void);

+    // set the discontinuity property - TRUE if this sample is not a

+    // continuation, but a new sample after a seek.

+    STDMETHODIMP SetDiscontinuity(BOOL bDiscontinuity);

+

+    // get the media times for this sample

+    STDMETHODIMP GetMediaTime(

+    	__out LONGLONG * pTimeStart,

+	    __out LONGLONG * pTimeEnd

+    );

+

+    // Set the media times for this sample

+    STDMETHODIMP SetMediaTime(

+    	__in_opt LONGLONG * pTimeStart,

+	    __in_opt LONGLONG * pTimeEnd

+    );

+

+    // Set and get properties (IMediaSample2)

+    STDMETHODIMP GetProperties(

+        DWORD cbProperties,

+        __out_bcount(cbProperties) BYTE * pbProperties

+    );

+

+    STDMETHODIMP SetProperties(

+        DWORD cbProperties,

+        __in_bcount(cbProperties) const BYTE * pbProperties

+    );

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CBaseAllocator

+//

+// Abstract base class that manages a list of media samples

+//

+// This class provides support for getting buffers from the free list,

+// including handling of commit and (asynchronous) decommit.

+//

+// Derive from this class and override the Alloc and Free functions to

+// allocate your CMediaSample (or derived) objects and add them to the

+// free list, preparing them as necessary.

+//=====================================================================

+//=====================================================================

+

+class AM_NOVTABLE CBaseAllocator : public CUnknown,// A non delegating IUnknown

+                       public IMemAllocatorCallbackTemp, // The interface we support

+                       public CCritSec             // Provides object locking

+{

+    class CSampleList;

+    friend class CSampleList;

+

+    /*  Trick to get at protected member in CMediaSample */

+    static CMediaSample * &NextSample(__in CMediaSample *pSample)

+    {

+        return pSample->m_pNext;

+    };

+

+    /*  Mini list class for the free list */

+    class CSampleList

+    {

+    public:

+        CSampleList() : m_List(NULL), m_nOnList(0) {};

+#ifdef DEBUG

+        ~CSampleList()

+        {

+            ASSERT(m_nOnList == 0);

+        };

+#endif

+        CMediaSample *Head() const { return m_List; };

+        CMediaSample *Next(__in CMediaSample *pSample) const { return CBaseAllocator::NextSample(pSample); };

+        int GetCount() const { return m_nOnList; };

+        void Add(__inout CMediaSample *pSample)

+        {

+            ASSERT(pSample != NULL);

+            CBaseAllocator::NextSample(pSample) = m_List;

+            m_List = pSample;

+            m_nOnList++;

+        };

+        CMediaSample *RemoveHead()

+        {

+            CMediaSample *pSample = m_List;

+            if (pSample != NULL) {

+                m_List = CBaseAllocator::NextSample(m_List);

+                m_nOnList--;

+            }

+            return pSample;

+        };

+        void Remove(__inout CMediaSample *pSample);

+

+    public:

+        CMediaSample *m_List;

+        int           m_nOnList;

+    };

+protected:

+

+    CSampleList m_lFree;        // Free list

+

+    /*  Note to overriders of CBaseAllocator.

+

+        We use a lazy signalling mechanism for waiting for samples.

+        This means we don't call the OS if no waits occur.

+

+        In order to implement this:

+

+        1. When a new sample is added to m_lFree call NotifySample() which

+           calls ReleaseSemaphore on m_hSem with a count of m_lWaiting and

+           sets m_lWaiting to 0.

+           This must all be done holding the allocator's critical section.

+

+        2. When waiting for a sample call SetWaiting() which increments

+           m_lWaiting BEFORE leaving the allocator's critical section.

+

+        3. Actually wait by calling WaitForSingleObject(m_hSem, INFINITE)

+           having left the allocator's critical section.  The effect of

+           this is to remove 1 from the semaphore's count.  You MUST call

+           this once having incremented m_lWaiting.

+

+        The following are then true when the critical section is not held :

+            (let nWaiting = number about to wait or waiting)

+

+            (1) if (m_lFree.GetCount() != 0) then (m_lWaiting == 0)

+            (2) m_lWaiting + Semaphore count == nWaiting

+

+        We would deadlock if

+           nWaiting != 0 &&

+           m_lFree.GetCount() != 0 &&

+           Semaphore count == 0

+

+           But from (1) if m_lFree.GetCount() != 0 then m_lWaiting == 0 so

+           from (2) Semaphore count == nWaiting (which is non-0) so the

+           deadlock can't happen.

+    */

+

+    HANDLE m_hSem;              // For signalling

+    long m_lWaiting;            // Waiting for a free element

+    long m_lCount;              // how many buffers we have agreed to provide

+    long m_lAllocated;          // how many buffers are currently allocated

+    long m_lSize;               // agreed size of each buffer

+    long m_lAlignment;          // agreed alignment

+    long m_lPrefix;             // agreed prefix (preceeds GetPointer() value)

+    BOOL m_bChanged;            // Have the buffer requirements changed

+

+    // if true, we are decommitted and can't allocate memory

+    BOOL m_bCommitted;

+    // if true, the decommit has happened, but we haven't called Free yet

+    // as there are still outstanding buffers

+    BOOL m_bDecommitInProgress;

+

+    //  Notification interface

+    IMemAllocatorNotifyCallbackTemp *m_pNotify;

+

+    BOOL m_fEnableReleaseCallback;

+

+    // called to decommit the memory when the last buffer is freed

+    // pure virtual - need to override this

+    virtual void Free(void) PURE;

+

+    // override to allocate the memory when commit called

+    virtual HRESULT Alloc(void);

+

+public:

+

+    CBaseAllocator(

+        __in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *,

+        BOOL bEvent = TRUE, BOOL fEnableReleaseCallback = FALSE);

+#ifdef UNICODE

+    CBaseAllocator(

+        __in_opt LPCSTR , __inout_opt LPUNKNOWN, __inout HRESULT *,

+        BOOL bEvent = TRUE, BOOL fEnableReleaseCallback = FALSE);

+#endif

+    virtual ~CBaseAllocator();

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

+    STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv);

+

+    STDMETHODIMP SetProperties(

+		    __in ALLOCATOR_PROPERTIES* pRequest,

+		    __out ALLOCATOR_PROPERTIES* pActual);

+

+    // return the properties actually being used on this allocator

+    STDMETHODIMP GetProperties(

+		    __out ALLOCATOR_PROPERTIES* pProps);

+

+    // override Commit to allocate memory. We handle the GetBuffer

+    //state changes

+    STDMETHODIMP Commit();

+

+    // override this to handle the memory freeing. We handle any outstanding

+    // GetBuffer calls

+    STDMETHODIMP Decommit();

+

+    // get container for a sample. Blocking, synchronous call to get the

+    // next free buffer (as represented by an IMediaSample interface).

+    // on return, the time etc properties will be invalid, but the buffer

+    // pointer and size will be correct. The two time parameters are

+    // optional and either may be NULL, they may alternatively be set to

+    // the start and end times the sample will have attached to it

+    // bPrevFramesSkipped is not used (used only by the video renderer's

+    // allocator where it affects quality management in direct draw).

+

+    STDMETHODIMP GetBuffer(__deref_out IMediaSample **ppBuffer,

+                           __in_opt REFERENCE_TIME * pStartTime,

+                           __in_opt REFERENCE_TIME * pEndTime,

+                           DWORD dwFlags);

+

+    // final release of a CMediaSample will call this

+    STDMETHODIMP ReleaseBuffer(IMediaSample *pBuffer);

+    // obsolete:: virtual void PutOnFreeList(CMediaSample * pSample);

+

+    STDMETHODIMP SetNotify(IMemAllocatorNotifyCallbackTemp *pNotify);

+

+    STDMETHODIMP GetFreeCount(__out LONG *plBuffersFree);

+

+    // Notify that a sample is available

+    void NotifySample();

+

+    // Notify that we're waiting for a sample

+    void SetWaiting() { m_lWaiting++; };

+};

+

+

+//=====================================================================

+//=====================================================================

+// Defines CMemAllocator

+//

+// this is an allocator based on CBaseAllocator that allocates sample

+// buffers in main memory (from 'new'). You must call SetProperties

+// before calling Commit.

+//

+// we don't free the memory when going into Decommit state. The simplest

+// way to implement this without complicating CBaseAllocator is to

+// have a Free() function, called to go into decommit state, that does

+// nothing and a ReallyFree function called from our destructor that

+// actually frees the memory.

+//=====================================================================

+//=====================================================================

+

+//  Make me one from quartz.dll

+STDAPI CreateMemoryAllocator(__deref_out IMemAllocator **ppAllocator);

+

+class CMemAllocator : public CBaseAllocator

+{

+

+protected:

+

+    LPBYTE m_pBuffer;   // combined memory for all buffers

+

+    // override to free the memory when decommit completes

+    // - we actually do nothing, and save the memory until deletion.

+    void Free(void);

+

+    // called from the destructor (and from Alloc if changing size/count) to

+    // actually free up the memory

+    void ReallyFree(void);

+

+    // overriden to allocate the memory when commit called

+    HRESULT Alloc(void);

+

+public:

+    /* This goes in the factory template table to create new instances */

+    static CUnknown *CreateInstance(__inout_opt LPUNKNOWN, __inout HRESULT *);

+

+    STDMETHODIMP SetProperties(

+		    __in ALLOCATOR_PROPERTIES* pRequest,

+		    __out ALLOCATOR_PROPERTIES* pActual);

+

+    CMemAllocator(__in_opt LPCTSTR , __inout_opt LPUNKNOWN, __inout HRESULT *);

+#ifdef UNICODE

+    CMemAllocator(__in_opt LPCSTR , __inout_opt LPUNKNOWN, __inout HRESULT *);

+#endif

+    ~CMemAllocator();

+};

+

+// helper used by IAMovieSetup implementation

+STDAPI

+AMovieSetupRegisterFilter( const AMOVIESETUP_FILTER * const psetupdata

+                         , IFilterMapper *                  pIFM

+                         , BOOL                             bRegister  );

+

+

+///////////////////////////////////////////////////////////////////////////

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

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

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

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

+///////////////////////////////////////////////////////////////////////////

+

+#endif /* __FILTER__ */

+

+

+