* #36737: switch back to svn repo, remove assert in sip_transaction.c
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6401d0dd9e6001ae1fbabccb90811b5a221459e.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6401d0dd9e6001ae1fbabccb90811b5a221459e.svn-base
new file mode 100644
index 0000000..7e4719c
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6401d0dd9e6001ae1fbabccb90811b5a221459e.svn-base
@@ -0,0 +1,923 @@
+//------------------------------------------------------------------------------

+// File: CtlUtil.h

+//

+// Desc: DirectShow base classes.

+//

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

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

+

+

+// Base classes implementing IDispatch parsing for the basic control dual

+// interfaces. Derive from these and implement just the custom method and

+// property methods. We also implement CPosPassThru that can be used by

+// renderers and transforms to pass by IMediaPosition and IMediaSeeking

+

+#ifndef __CTLUTIL__

+#define __CTLUTIL__

+

+// OLE Automation has different ideas of TRUE and FALSE

+

+#define OATRUE (-1)

+#define OAFALSE (0)

+

+

+// It's possible that we could replace this class with CreateStdDispatch

+

+class CBaseDispatch

+{

+    ITypeInfo * m_pti;

+

+public:

+

+    CBaseDispatch() : m_pti(NULL) {}

+    ~CBaseDispatch();

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      REFIID riid,

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+};

+

+

+class AM_NOVTABLE CMediaControl :

+    public IMediaControl,

+    public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+public:

+

+    CMediaControl(const TCHAR *, LPUNKNOWN);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+};

+

+

+class AM_NOVTABLE CMediaEvent :

+    public IMediaEventEx,

+    public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+public:

+

+    CMediaEvent(__in_opt LPCTSTR, __in_opt LPUNKNOWN);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+};

+

+

+class AM_NOVTABLE CMediaPosition :

+    public IMediaPosition,

+    public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+

+public:

+

+    CMediaPosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN);

+    CMediaPosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT *phr);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+

+};

+

+

+// OA-compatibility means that we must use double as the RefTime value,

+// and REFERENCE_TIME (essentially a LONGLONG) within filters.

+// this class converts between the two

+

+class COARefTime : public CRefTime {

+public:

+

+    COARefTime() {

+    };

+

+    COARefTime(CRefTime t)

+        : CRefTime(t)

+    {

+    };

+

+    COARefTime(REFERENCE_TIME t)

+        : CRefTime(t)

+    {

+    };

+

+    COARefTime(double d) {

+        m_time = (LONGLONG) (d * 10000000);

+    };

+

+    operator double() {

+        return double(m_time) / 10000000;

+    };

+

+    operator REFERENCE_TIME() {

+        return m_time;

+    };

+

+    COARefTime& operator=(const double& rd)  {

+        m_time = (LONGLONG) (rd * 10000000);

+        return *this;

+    }

+

+    COARefTime& operator=(const REFERENCE_TIME& rt)  {

+        m_time = rt;

+        return *this;

+    }

+

+    inline BOOL operator==(const COARefTime& rt)

+    {

+        return m_time == rt.m_time;

+    };

+

+    inline BOOL operator!=(const COARefTime& rt)

+    {

+        return m_time != rt.m_time;

+    };

+

+    inline BOOL operator < (const COARefTime& rt)

+    {

+        return m_time < rt.m_time;

+    };

+

+    inline BOOL operator > (const COARefTime& rt)

+    {

+        return m_time > rt.m_time;

+    };

+

+    inline BOOL operator >= (const COARefTime& rt)

+    {

+        return m_time >= rt.m_time;

+    };

+

+    inline BOOL operator <= (const COARefTime& rt)

+    {

+        return m_time <= rt.m_time;

+    };

+

+    inline COARefTime operator+(const COARefTime& rt)

+    {

+        return COARefTime(m_time + rt.m_time);

+    };

+

+    inline COARefTime operator-(const COARefTime& rt)

+    {

+        return COARefTime(m_time - rt.m_time);

+    };

+

+    inline COARefTime operator*(LONG l)

+    {

+        return COARefTime(m_time * l);

+    };

+

+    inline COARefTime operator/(LONG l)

+    {

+        return COARefTime(m_time / l);

+    };

+

+private:

+    //  Prevent bugs from constructing from LONG (which gets

+    //  converted to double and then multiplied by 10000000

+    COARefTime(LONG);

+    LONG operator=(LONG);

+};

+

+

+// A utility class that handles IMediaPosition and IMediaSeeking on behalf

+// of single-input pin renderers, or transform filters.

+//

+// Renderers will expose this from the filter; transform filters will

+// expose it from the output pin and not the renderer.

+//

+// Create one of these, giving it your IPin* for your input pin, and delegate

+// all IMediaPosition methods to it. It will query the input pin for

+// IMediaPosition and respond appropriately.

+//

+// Call ForceRefresh if the pin connection changes.

+//

+// This class no longer caches the upstream IMediaPosition or IMediaSeeking

+// it acquires it on each method call. This means ForceRefresh is not needed.

+// The method is kept for source compatibility and to minimise the changes

+// if we need to put it back later for performance reasons.

+

+class CPosPassThru : public IMediaSeeking, public CMediaPosition

+{

+    IPin *m_pPin;

+

+    HRESULT GetPeer(__deref_out IMediaPosition **ppMP);

+    HRESULT GetPeerSeeking(__deref_out IMediaSeeking **ppMS);

+

+public:

+

+    CPosPassThru(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, IPin *);

+    DECLARE_IUNKNOWN

+

+    HRESULT ForceRefresh() {

+        return S_OK;

+    };

+

+    // override to return an accurate current position

+    virtual HRESULT GetMediaTime(__out LONGLONG *pStartTime, __out_opt LONGLONG *pEndTime) {

+        return E_FAIL;

+    }

+

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

+

+    // IMediaSeeking methods

+    STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities );

+    STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities );

+    STDMETHODIMP SetTimeFormat(const GUID * pFormat);

+    STDMETHODIMP GetTimeFormat(__out GUID *pFormat);

+    STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat);

+    STDMETHODIMP IsFormatSupported( const GUID * pFormat);

+    STDMETHODIMP QueryPreferredFormat( __out GUID *pFormat);

+    STDMETHODIMP ConvertTimeFormat(__out LONGLONG * pTarget, 

+                                   __in_opt const GUID * pTargetFormat,

+                                   LONGLONG Source, 

+                                   __in_opt const GUID * pSourceFormat );

+    STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent, DWORD CurrentFlags

+                             , __inout_opt LONGLONG * pStop, DWORD StopFlags );

+

+    STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );

+    STDMETHODIMP GetCurrentPosition( __out LONGLONG * pCurrent );

+    STDMETHODIMP GetStopPosition( __out LONGLONG * pStop );

+    STDMETHODIMP SetRate( double dRate);

+    STDMETHODIMP GetRate( __out double * pdRate);

+    STDMETHODIMP GetDuration( __out LONGLONG *pDuration);

+    STDMETHODIMP GetAvailable( __out_opt LONGLONG *pEarliest, __out_opt LONGLONG *pLatest );

+    STDMETHODIMP GetPreroll( __out LONGLONG *pllPreroll );

+

+    // IMediaPosition properties

+    STDMETHODIMP get_Duration(__out REFTIME * plength);

+    STDMETHODIMP put_CurrentPosition(REFTIME llTime);

+    STDMETHODIMP get_StopTime(__out REFTIME * pllTime);

+    STDMETHODIMP put_StopTime(REFTIME llTime);

+    STDMETHODIMP get_PrerollTime(__out REFTIME * pllTime);

+    STDMETHODIMP put_PrerollTime(REFTIME llTime);

+    STDMETHODIMP get_Rate(__out double * pdRate);

+    STDMETHODIMP put_Rate(double dRate);

+    STDMETHODIMP get_CurrentPosition(__out REFTIME * pllTime);

+    STDMETHODIMP CanSeekForward(__out LONG *pCanSeekForward);

+    STDMETHODIMP CanSeekBackward(__out LONG *pCanSeekBackward);

+

+private:

+    HRESULT GetSeekingLongLong( HRESULT (__stdcall IMediaSeeking::*pMethod)( LONGLONG * ),

+                                __out LONGLONG * pll );

+};

+

+

+// Adds the ability to return a current position

+

+class CRendererPosPassThru : public CPosPassThru

+{

+    CCritSec m_PositionLock;    // Locks access to our position

+    LONGLONG m_StartMedia;      // Start media time last seen

+    LONGLONG m_EndMedia;        // And likewise the end media

+    BOOL m_bReset;              // Have media times been set

+

+public:

+

+    // Used to help with passing media times through graph

+

+    CRendererPosPassThru(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, IPin *);

+    HRESULT RegisterMediaTime(IMediaSample *pMediaSample);

+    HRESULT RegisterMediaTime(LONGLONG StartTime,LONGLONG EndTime);

+    HRESULT GetMediaTime(__out LONGLONG *pStartTime,__out_opt LONGLONG *pEndTime);

+    HRESULT ResetMediaTime();

+    HRESULT EOS();

+};

+

+STDAPI CreatePosPassThru(

+    __in_opt LPUNKNOWN pAgg,

+    BOOL bRenderer,

+    IPin *pPin,

+    __deref_out IUnknown **ppPassThru

+);

+

+// A class that handles the IDispatch part of IBasicAudio and leaves the

+// properties and methods themselves pure virtual.

+

+class AM_NOVTABLE CBasicAudio : public IBasicAudio, public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+public:

+

+    CBasicAudio(__in_opt LPCTSTR, __in_opt LPUNKNOWN);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+};

+

+

+// A class that handles the IDispatch part of IBasicVideo and leaves the

+// properties and methods themselves pure virtual.

+

+class AM_NOVTABLE CBaseBasicVideo : public IBasicVideo2, public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+public:

+

+    CBaseBasicVideo(__in_opt LPCTSTR, __in_opt LPUNKNOWN);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+

+    STDMETHODIMP GetPreferredAspectRatio(

+      __out long *plAspectX,

+      __out long *plAspectY)

+    {

+        return E_NOTIMPL;

+    }

+};

+

+

+// A class that handles the IDispatch part of IVideoWindow and leaves the

+// properties and methods themselves pure virtual.

+

+class AM_NOVTABLE CBaseVideoWindow : public IVideoWindow, public CUnknown

+{

+    CBaseDispatch m_basedisp;

+

+public:

+

+    CBaseVideoWindow(__in_opt LPCTSTR, __in_opt LPUNKNOWN);

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    /* IDispatch methods */

+    STDMETHODIMP GetTypeInfoCount(__out UINT * pctinfo);

+

+    STDMETHODIMP GetTypeInfo(

+      UINT itinfo,

+      LCID lcid,

+      __deref_out ITypeInfo ** pptinfo);

+

+    STDMETHODIMP GetIDsOfNames(

+      REFIID riid,

+      __in_ecount(cNames) LPOLESTR * rgszNames,

+      UINT cNames,

+      LCID lcid,

+      __out_ecount(cNames) DISPID * rgdispid);

+

+    STDMETHODIMP Invoke(

+      DISPID dispidMember,

+      REFIID riid,

+      LCID lcid,

+      WORD wFlags,

+      __in DISPPARAMS * pdispparams,

+      __out_opt VARIANT * pvarResult,

+      __out_opt EXCEPINFO * pexcepinfo,

+      __out_opt UINT * puArgErr);

+};

+

+

+// abstract class to help source filters with their implementation

+// of IMediaPosition. Derive from this and set the duration (and stop

+// position). Also override NotifyChange to do something when the properties

+// change.

+

+class AM_NOVTABLE CSourcePosition : public CMediaPosition

+{

+

+public:

+    CSourcePosition(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, __in CCritSec *);

+

+    // IMediaPosition methods

+    STDMETHODIMP get_Duration(__out REFTIME * plength);

+    STDMETHODIMP put_CurrentPosition(REFTIME llTime);

+    STDMETHODIMP get_StopTime(__out REFTIME * pllTime);

+    STDMETHODIMP put_StopTime(REFTIME llTime);

+    STDMETHODIMP get_PrerollTime(__out REFTIME * pllTime);

+    STDMETHODIMP put_PrerollTime(REFTIME llTime);

+    STDMETHODIMP get_Rate(__out double * pdRate);

+    STDMETHODIMP put_Rate(double dRate);

+    STDMETHODIMP CanSeekForward(__out LONG *pCanSeekForward);

+    STDMETHODIMP CanSeekBackward(__out LONG *pCanSeekBackward);

+

+    // override if you can return the data you are actually working on

+    STDMETHODIMP get_CurrentPosition(__out REFTIME * pllTime) {

+        return E_NOTIMPL;

+    };

+

+protected:

+

+    // we call this to notify changes. Override to handle them

+    virtual HRESULT ChangeStart() PURE;

+    virtual HRESULT ChangeStop() PURE;

+    virtual HRESULT ChangeRate() PURE;

+

+    COARefTime m_Duration;

+    COARefTime m_Start;

+    COARefTime m_Stop;

+    double m_Rate;

+

+    CCritSec * m_pLock;

+};

+

+class AM_NOVTABLE CSourceSeeking :

+    public IMediaSeeking,

+    public CUnknown

+{

+

+public:

+

+    DECLARE_IUNKNOWN;

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

+

+    // IMediaSeeking methods

+

+    STDMETHODIMP IsFormatSupported(const GUID * pFormat);

+    STDMETHODIMP QueryPreferredFormat(__out GUID *pFormat);

+    STDMETHODIMP SetTimeFormat(const GUID * pFormat);

+    STDMETHODIMP IsUsingTimeFormat(const GUID * pFormat);

+    STDMETHODIMP GetTimeFormat(__out GUID *pFormat);

+    STDMETHODIMP GetDuration(__out LONGLONG *pDuration);

+    STDMETHODIMP GetStopPosition(__out LONGLONG *pStop);

+    STDMETHODIMP GetCurrentPosition(__out LONGLONG *pCurrent);

+    STDMETHODIMP GetCapabilities( __out DWORD * pCapabilities );

+    STDMETHODIMP CheckCapabilities( __inout DWORD * pCapabilities );

+    STDMETHODIMP ConvertTimeFormat( __out LONGLONG * pTarget, 

+                                    __in_opt const GUID * pTargetFormat,

+                                    LONGLONG Source, 

+                                    __in_opt const GUID * pSourceFormat );

+

+    STDMETHODIMP SetPositions( __inout_opt LONGLONG * pCurrent,  DWORD CurrentFlags

+			     , __inout_opt LONGLONG * pStop,  DWORD StopFlags );

+

+    STDMETHODIMP GetPositions( __out_opt LONGLONG * pCurrent, __out_opt LONGLONG * pStop );

+

+    STDMETHODIMP GetAvailable( __out_opt LONGLONG * pEarliest, __out_opt LONGLONG * pLatest );

+    STDMETHODIMP SetRate( double dRate);

+    STDMETHODIMP GetRate( __out double * pdRate);

+    STDMETHODIMP GetPreroll(__out LONGLONG *pPreroll);

+

+

+protected:

+

+    // ctor

+    CSourceSeeking(__in_opt LPCTSTR, __in_opt LPUNKNOWN, __inout HRESULT*, __in CCritSec *);

+

+    // we call this to notify changes. Override to handle them

+    virtual HRESULT ChangeStart() PURE;

+    virtual HRESULT ChangeStop() PURE;

+    virtual HRESULT ChangeRate() PURE;

+

+    CRefTime m_rtDuration;      // length of stream

+    CRefTime m_rtStart;         // source will start here

+    CRefTime m_rtStop;          // source will stop here

+    double m_dRateSeeking;

+

+    // seeking capabilities

+    DWORD m_dwSeekingCaps;

+

+    CCritSec * m_pLock;

+};

+

+

+// Base classes supporting Deferred commands.

+

+// Deferred commands are queued by calls to methods on the IQueueCommand

+// interface, exposed by the filtergraph and by some filters. A successful

+// call to one of these methods will return an IDeferredCommand interface

+// representing the queued command.

+//

+// A CDeferredCommand object represents a single deferred command, and exposes

+// the IDeferredCommand interface as well as other methods permitting time

+// checks and actual execution. It contains a reference to the CCommandQueue

+// object on which it is queued.

+//

+// CCommandQueue is a base class providing a queue of CDeferredCommand

+// objects, and methods to add, remove, check status and invoke the queued

+// commands. A CCommandQueue object would be part of an object that

+// implemented IQueueCommand.

+

+class CCmdQueue;

+

+// take a copy of the params and store them. Release any allocated

+// memory in destructor

+

+class CDispParams : public DISPPARAMS

+{

+public:

+    CDispParams(UINT nArgs, __in_ecount(nArgs) VARIANT* pArgs, __inout_opt HRESULT *phr = NULL);

+    ~CDispParams();

+};

+

+

+// CDeferredCommand lifetime is controlled by refcounts. Caller of

+// InvokeAt.. gets a refcounted interface pointer, and the CCmdQueue

+// object also holds a refcount on us. Calling Cancel or Invoke takes

+// us off the CCmdQueue and thus reduces the refcount by 1. Once taken

+// off the queue we cannot be put back on the queue.

+

+class CDeferredCommand

+    : public CUnknown,

+      public IDeferredCommand

+{

+public:

+

+    CDeferredCommand(

+        __inout CCmdQueue * pQ,

+        __in_opt LPUNKNOWN   pUnk,               // aggregation outer unk

+        __inout HRESULT *   phr,

+        __in LPUNKNOWN   pUnkExecutor,       // object that will execute this cmd

+        REFTIME     time,

+        __in GUID*       iid,

+        long        dispidMethod,

+        short       wFlags,

+        long        cArgs,

+        __in_ecount(cArgs) VARIANT*    pDispParams,

+        __out VARIANT*    pvarResult,

+        __out short*      puArgErr,

+        BOOL        bStream

+        );

+

+    DECLARE_IUNKNOWN

+

+    // override this to publicise our interfaces

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

+

+    // IDeferredCommand methods

+    STDMETHODIMP Cancel();

+    STDMETHODIMP Confidence(

+                    __out LONG* pConfidence);

+    STDMETHODIMP Postpone(

+                    REFTIME newtime);

+    STDMETHODIMP GetHResult(

+                    __out HRESULT* phrResult);

+

+    // other public methods

+

+    HRESULT Invoke();

+

+    // access methods

+

+    // returns TRUE if streamtime, FALSE if presentation time

+    BOOL IsStreamTime() {

+       return m_bStream;

+    };

+

+    CRefTime GetTime() {

+        return m_time;

+    };

+

+    REFIID GetIID() {

+        return *m_iid;

+    };

+

+    long GetMethod() {

+        return m_dispidMethod;

+    };

+

+    short GetFlags() {

+        return m_wFlags;

+    };

+

+    DISPPARAMS* GetParams() {

+        return &m_DispParams;

+    };

+

+    VARIANT* GetResult() {

+        return m_pvarResult;

+    };

+

+protected:

+

+    CCmdQueue* m_pQueue;

+

+    // pUnk for the interface that we will execute the command on

+    LPUNKNOWN   m_pUnk;

+

+    // stored command data

+    REFERENCE_TIME     m_time;

+    GUID*       m_iid;

+    long        m_dispidMethod;

+    short       m_wFlags;

+    VARIANT*    m_pvarResult;

+    BOOL        m_bStream;

+    CDispParams m_DispParams;

+    DISPID      m_DispId;         //  For get and put

+

+    // we use this for ITypeInfo access

+    CBaseDispatch   m_Dispatch;

+

+    // save retval here

+    HRESULT     m_hrResult;

+};

+

+

+// a list of CDeferredCommand objects. this is a base class providing

+// the basics of access to the list. If you want to use CDeferredCommand

+// objects then your queue needs to be derived from this class.

+

+class AM_NOVTABLE CCmdQueue

+{

+public:

+    CCmdQueue(__inout_opt HRESULT *phr = NULL);

+    virtual ~CCmdQueue();

+

+    // returns a new CDeferredCommand object that will be initialised with

+    // the parameters and will be added to the queue during construction.

+    // returns S_OK if successfully created otherwise an error and

+    // no object has been queued.

+    virtual HRESULT  New(

+        __out CDeferredCommand **ppCmd,

+        __in LPUNKNOWN   pUnk,

+        REFTIME     time,

+        __in GUID*       iid,

+        long        dispidMethod,

+        short       wFlags,

+        long        cArgs,

+        __in_ecount(cArgs) VARIANT*    pDispParams,

+        __out VARIANT*    pvarResult,

+        __out short*      puArgErr,

+        BOOL        bStream

+    );

+

+    // called by the CDeferredCommand object to add and remove itself

+    // from the queue

+    virtual HRESULT Insert(__in CDeferredCommand* pCmd);

+    virtual HRESULT Remove(__in CDeferredCommand* pCmd);

+

+    // Command-Due Checking

+    //

+    // There are two schemes of synchronisation: coarse and accurate. In

+    // coarse mode, you wait till the time arrives and then execute the cmd.

+    // In accurate mode, you wait until you are processing the sample that

+    // will appear at the time, and then execute the command. It's up to the

+    // filter which one it will implement. The filtergraph will always

+    // implement coarse mode for commands queued at the filtergraph.

+    //

+    // If you want coarse sync, you probably want to wait until there is a

+    // command due, and then execute it. You can do this by calling

+    // GetDueCommand. If you have several things to wait for, get the

+    // event handle from GetDueHandle() and when this is signalled then call

+    // GetDueCommand. Stream time will only advance between calls to Run and

+    // EndRun. Note that to avoid an extra thread there is no guarantee that

+    // if the handle is set there will be a command ready. Each time the

+    // event is signalled, call GetDueCommand (probably with a 0 timeout);

+    // This may return E_ABORT.

+    //

+    // If you want accurate sync, you must call GetCommandDueFor, passing

+    // as a parameter the stream time of the samples you are about to process.

+    // This will return:

+    //   -- a stream-time command due at or before that stream time

+    //   -- a presentation-time command due at or before the

+    //      time that stream time will be presented (only between Run

+    //      and EndRun calls, since outside of this, the mapping from

+    //      stream time to presentation time is not known.

+    //   -- any presentation-time command due now.

+    // This means that if you want accurate synchronisation on samples that

+    // might be processed during Paused mode, you need to use

+    // stream-time commands.

+    //

+    // In all cases, commands remain queued until Invoked or Cancelled. The

+    // setting and resetting of the event handle is managed entirely by this

+    // queue object.

+

+    // set the clock used for timing

+    virtual HRESULT SetSyncSource(__in_opt IReferenceClock*);

+

+    // switch to run mode. Streamtime to Presentation time mapping known.

+    virtual HRESULT Run(REFERENCE_TIME tStreamTimeOffset);

+

+    // switch to Stopped or Paused mode. Time mapping not known.

+    virtual HRESULT EndRun();

+

+    // return a pointer to the next due command. Blocks for msTimeout

+    // milliseconds until there is a due command.

+    // Stream-time commands will only become due between Run and Endrun calls.

+    // The command remains queued until invoked or cancelled.

+    // Returns E_ABORT if timeout occurs, otherwise S_OK (or other error).

+    // Returns an AddRef-ed object

+    virtual HRESULT GetDueCommand(__out CDeferredCommand ** ppCmd, long msTimeout);

+

+    // return the event handle that will be signalled whenever

+    // there are deferred commands due for execution (when GetDueCommand

+    // will not block).

+    HANDLE GetDueHandle() {

+        return HANDLE(m_evDue);

+    };

+

+    // return a pointer to a command that will be due for a given time.

+    // Pass in a stream time here. The stream time offset will be passed

+    // in via the Run method.

+    // Commands remain queued until invoked or cancelled.

+    // This method will not block. It will report VFW_E_NOT_FOUND if there

+    // are no commands due yet.

+    // Returns an AddRef-ed object

+    virtual HRESULT GetCommandDueFor(REFERENCE_TIME tStream, __out CDeferredCommand**ppCmd);

+

+    // check if a given time is due (TRUE if it is due yet)

+    BOOL CheckTime(CRefTime time, BOOL bStream) {

+

+        // if no clock, nothing is due!

+        if (!m_pClock) {

+            return FALSE;

+        }

+

+        // stream time

+        if (bStream) {

+

+            // not valid if not running

+            if (!m_bRunning) {

+                return FALSE;

+            }

+            // add on known stream time offset to get presentation time

+            time += m_StreamTimeOffset;

+        }

+

+        CRefTime Now;

+        m_pClock->GetTime((REFERENCE_TIME*)&Now);

+        return (time <= Now);

+    };

+

+protected:

+

+    // protect access to lists etc

+    CCritSec m_Lock;

+

+    // commands queued in presentation time are stored here

+    CGenericList<CDeferredCommand> m_listPresentation;

+

+    // commands queued in stream time are stored here

+    CGenericList<CDeferredCommand> m_listStream;

+

+    // set when any commands are due

+    CAMEvent m_evDue;

+

+    // creates an advise for the earliest time required, if any

+    void SetTimeAdvise(void);

+

+    // advise id from reference clock (0 if no outstanding advise)

+    DWORD_PTR m_dwAdvise;

+

+    // advise time is for this presentation time

+    CRefTime m_tCurrentAdvise;

+

+    // the reference clock we are using (addrefed)

+    IReferenceClock* m_pClock;

+

+    // true when running

+    BOOL m_bRunning;

+

+    // contains stream time offset when m_bRunning is true

+    CRefTime m_StreamTimeOffset;

+};

+

+#endif // __CTLUTIL__

diff --git a/jni/pjproject-android/.svn/pristine/e6/e6633f4d3e2cbac340c8364dac94d18355107144.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6633f4d3e2cbac340c8364dac94d18355107144.svn-base
new file mode 100644
index 0000000..7b5f845
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6633f4d3e2cbac340c8364dac94d18355107144.svn-base
@@ -0,0 +1,24 @@
+/*
+ * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
+ * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
+ * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
+ */
+
+/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast_lin.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */
+
+#include	"toast.h"
+
+/*  toast_linear.c -- read and write 16 bit linear sound in host byte order.
+ */
+
+extern FILE	*in, *out;
+
+int linear_input (buf) gsm_signal * buf;
+{
+	return fread( (char *)buf, sizeof(*buf), 160, in );
+}
+
+int linear_output P1((buf), gsm_signal * buf) 
+{
+	return -( fwrite( (char *)buf, sizeof(*buf), 160, out ) != 160 );
+}
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6716b33d56974c9e92dca3f86b30700ab7cadf2.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6716b33d56974c9e92dca3f86b30700ab7cadf2.svn-base
new file mode 100644
index 0000000..2fac07a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6716b33d56974c9e92dca3f86b30700ab7cadf2.svn-base
@@ -0,0 +1,111 @@
+/*
+ * aes_calc.c
+ * 
+ * A simple AES calculator for generating AES encryption values
+ *
+ * David A. McGrew
+ * Cisco Systems, Inc.
+ */
+
+/*
+  
+ Example usage (with first NIST FIPS 197 test case):
+ 
+[sh]$ test/aes_calc 000102030405060708090a0b0c0d0e0f 00112233445566778899aabbccddeeff -v
+ plaintext:      00112233445566778899aabbccddeeff
+ key:            000102030405060708090a0b0c0d0e0f
+ ciphertext:     69c4e0d86a7b0430d8cdb78070b4c55a
+
+ */
+
+#include "aes.h"
+#include <stdio.h>
+#include <string.h>
+
+void
+usage(char *prog_name) {
+  printf("usage: %s <key> <plaintext> [-v]\n", prog_name);
+  exit(255);
+}
+
+#define AES_KEY_LEN 16
+
+int
+main (int argc, char *argv[]) {
+  v128_t data, key;
+  aes_expanded_key_t exp_key;
+  int len;
+  int verbose;
+
+  if (argc == 3) {
+    /* we're not in verbose mode */
+    verbose = 0;
+  } else if (argc == 4) {
+    if (strncmp(argv[3], "-v", 2) == 0) {
+      /* we're in verbose mode */
+      verbose = 1;
+    } else {
+      /* unrecognized flag, complain and exit */
+      usage(argv[0]);
+    }
+  } else {
+    /* we've been fed the wrong number of arguments - compain and exit */
+    usage(argv[0]);
+  }
+  
+  /* read in key, checking length */
+  if (strlen(argv[1]) > AES_KEY_LEN*2) {
+    fprintf(stderr, 
+	    "error: too many digits in key "
+	    "(should be %d hexadecimal digits, found %u)\n",
+	    AES_KEY_LEN*2, (unsigned)strlen(argv[1]));
+    exit(1);    
+  }
+  len = hex_string_to_octet_string((char *)&key, argv[1], AES_KEY_LEN*2);
+  /* check that hex string is the right length */
+  if (len < AES_KEY_LEN*2) {
+    fprintf(stderr, 
+	    "error: too few digits in key "
+	    "(should be %d hexadecimal digits, found %d)\n",
+	    AES_KEY_LEN*2, len);
+    exit(1);    
+  } 
+      
+  /* read in plaintext, checking length */
+  if (strlen(argv[2]) > 16*2) {
+    fprintf(stderr, 
+	    "error: too many digits in plaintext "
+	    "(should be %d hexadecimal digits, found %u)\n",
+	    16*2, (unsigned)strlen(argv[2]));
+    exit(1);    
+  }
+  len = hex_string_to_octet_string((char *)(&data), argv[2], 16*2);
+  /* check that hex string is the right length */
+  if (len < 16*2) {
+    fprintf(stderr, 
+	    "error: too few digits in plaintext "
+	    "(should be %d hexadecimal digits, found %d)\n",
+	    16*2, len);
+    exit(1);    
+  }
+
+  if (verbose) {
+    /* print out plaintext */
+    printf("plaintext:\t%s\n", octet_string_hex_string((uint8_t *)&data, 16));
+  }
+
+  /* encrypt plaintext */
+  aes_expand_encryption_key(&key, exp_key);
+
+  aes_encrypt(&data, exp_key);
+
+  /* write ciphertext to output */
+  if (verbose) {
+    printf("key:\t\t%s\n", v128_hex_string(&key));
+    printf("ciphertext:\t");
+  }
+  printf("%s\n", v128_hex_string(&data));
+
+  return 0;
+}
+
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6864744f5c34c546451c896ab966a58a4afa234.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6864744f5c34c546451c896ab966a58a4afa234.svn-base
new file mode 100644
index 0000000..f9fdf34
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6864744f5c34c546451c896ab966a58a4afa234.svn-base
@@ -0,0 +1,17 @@
+include ../../../build.mak
+
+lib_dir:
+	@for token in `echo $(APP_LDFLAGS)`; do \
+		echo $$token | grep '\-L' | sed 's/-L//'; \
+	done
+
+inc_dir:
+	@for token in `echo $(APP_CFLAGS)`; do \
+		echo $$token | grep '\-I' | sed 's/-I//'; \
+	done
+
+libs:
+	@for token in `echo $(APP_LDLIBS)`; do \
+		echo $$token | grep '\-l' | sed 's/-l//'; \
+	done
+
diff --git a/jni/pjproject-android/.svn/pristine/e6/e69870ada65a49a2c0ee76ad68d1cf82e6c4ca10.svn-base b/jni/pjproject-android/.svn/pristine/e6/e69870ada65a49a2c0ee76ad68d1cf82e6c4ca10.svn-base
new file mode 100644
index 0000000..1f78715
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e69870ada65a49a2c0ee76ad68d1cf82e6c4ca10.svn-base
@@ -0,0 +1,1232 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJ_CONFIG_H__
+#define __PJ_CONFIG_H__
+
+
+/**
+ * @file config.h
+ * @brief PJLIB Main configuration settings.
+ */
+
+/********************************************************************
+ * Include compiler specific configuration.
+ */
+#if defined(_MSC_VER)
+#  include <pj/compat/cc_msvc.h>
+#elif defined(__GNUC__)
+#  include <pj/compat/cc_gcc.h>
+#elif defined(__CW32__)
+#  include <pj/compat/cc_mwcc.h>
+#elif defined(__MWERKS__)
+#  include <pj/compat/cc_codew.h>
+#elif defined(__GCCE__)
+#  include <pj/compat/cc_gcce.h>
+#elif defined(__ARMCC__)
+#  include <pj/compat/cc_armcc.h>
+#else
+#  error "Unknown compiler."
+#endif
+
+/* PJ_ALIGN_DATA is compiler specific directive to align data address */
+#ifndef PJ_ALIGN_DATA
+#  error "PJ_ALIGN_DATA is not defined!"
+#endif
+
+/********************************************************************
+ * Include target OS specific configuration.
+ */
+#if defined(PJ_AUTOCONF)
+    /*
+     * Autoconf
+     */
+#   include <pj/compat/os_auto.h>
+
+#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+    /*
+     * SymbianOS
+     */
+#  include <pj/compat/os_symbian.h>
+
+#elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
+    /*
+     * Windows CE
+     */
+#   undef PJ_WIN32_WINCE
+#   define PJ_WIN32_WINCE   1
+#   include <pj/compat/os_win32_wince.h>
+
+    /* Also define Win32 */
+#   define PJ_WIN32 1
+
+#elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
+	defined(WIN32) || defined(PJ_WIN64) || defined(_WIN64) || \
+	defined(WIN64) || defined(__TOS_WIN__) 
+#   if defined(PJ_WIN64) || defined(_WIN64) || defined(WIN64)
+	/*
+	 * Win64
+	 */
+#	undef PJ_WIN64
+#	define PJ_WIN64 1
+#   endif
+#   undef PJ_WIN32
+#   define PJ_WIN32 1
+#   include <pj/compat/os_win32.h>
+
+#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
+    /*
+     * Linux kernel
+     */
+#  include <pj/compat/os_linux_kernel.h>
+
+#elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
+    /*
+     * Linux
+     */
+#   undef PJ_LINUX
+#   define PJ_LINUX	    1
+#   include <pj/compat/os_linux.h>
+
+#elif defined(PJ_PALMOS) && PJ_PALMOS!=0
+    /*
+     * Palm
+     */
+#  include <pj/compat/os_palmos.h>
+
+#elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
+    /*
+     * SunOS
+     */
+#   undef PJ_SUNOS
+#   define PJ_SUNOS	    1
+#   include <pj/compat/os_sunos.h>
+
+#elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
+      defined (__APPLE__) || defined (__MACH__)
+    /*
+     * MacOS X
+     */
+#   undef PJ_DARWINOS
+#   define PJ_DARWINOS	    1
+#   include <pj/compat/os_darwinos.h>
+
+#elif defined(PJ_RTEMS) && PJ_RTEMS!=0
+    /*
+     * RTEMS
+     */
+#  include <pj/compat/os_rtems.h>
+#else
+#   error "Please specify target os."
+#endif
+
+
+/********************************************************************
+ * Target machine specific configuration.
+ */
+#if defined(PJ_AUTOCONF)
+    /*
+     * Autoconf configured
+     */
+#include <pj/compat/m_auto.h>
+
+#elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
+	defined(_X86_) || defined(x86) || defined(__i386__) || \
+	defined(__i386) || defined(_M_IX86) || defined(__I86__)
+    /*
+     * Generic i386 processor family, little-endian
+     */
+#   undef PJ_M_I386
+#   define PJ_M_I386		1
+#   define PJ_M_NAME		"i386"
+#   define PJ_HAS_PENTIUM	1
+#   define PJ_IS_LITTLE_ENDIAN	1
+#   define PJ_IS_BIG_ENDIAN	0
+
+
+#elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
+	defined(__x86_64__) || defined(__x86_64)
+    /*
+     * AMD 64bit processor, little endian
+     */
+#   undef PJ_M_X86_64
+#   define PJ_M_X86_64		1
+#   define PJ_M_NAME		"x86_64"
+#   define PJ_HAS_PENTIUM	1
+#   define PJ_IS_LITTLE_ENDIAN	1
+#   define PJ_IS_BIG_ENDIAN	0
+
+#elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
+	defined(__IA64__) || defined( 	_M_IA64)
+    /*
+     * Intel IA64 processor, default to little endian
+     */
+#   undef PJ_M_IA64
+#   define PJ_M_IA64		1
+#   define PJ_M_NAME		"ia64"
+#   define PJ_HAS_PENTIUM	1
+#   define PJ_IS_LITTLE_ENDIAN	1
+#   define PJ_IS_BIG_ENDIAN	0
+
+#elif defined (PJ_M_M68K) && PJ_M_M68K != 0
+
+    /*
+     * Motorola m68k processor, big endian
+     */
+#   undef PJ_M_M68K
+#   define PJ_M_M68K		1
+#   define PJ_M_NAME		"m68k"
+#   define PJ_HAS_PENTIUM	0
+#   define PJ_IS_LITTLE_ENDIAN	0
+#   define PJ_IS_BIG_ENDIAN	1
+
+
+#elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
+	defined (_M_ALPHA)
+    /*
+     * DEC Alpha processor, little endian
+     */
+#   undef PJ_M_ALPHA
+#   define PJ_M_ALPHA		1
+#   define PJ_M_NAME		"alpha"
+#   define PJ_HAS_PENTIUM	0
+#   define PJ_IS_LITTLE_ENDIAN	1
+#   define PJ_IS_BIG_ENDIAN	0
+
+
+#elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
+	defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
+    /*
+     * MIPS, bi-endian, so raise error if endianness is not configured
+     */
+#   undef PJ_M_MIPS
+#   define PJ_M_MIPS		1
+#   define PJ_M_NAME		"mips"
+#   define PJ_HAS_PENTIUM	0
+#   if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
+#   	error Endianness must be declared for this processor
+#   endif
+
+
+#elif defined (PJ_M_SPARC) || defined( 	__sparc__) || defined(__sparc)
+    /*
+     * Sun Sparc, big endian
+     */
+#   undef PJ_M_SPARC
+#   define PJ_M_SPARC		1
+#   define PJ_M_NAME		"sparc"
+#   define PJ_HAS_PENTIUM	0
+#   define PJ_IS_LITTLE_ENDIAN	0
+#   define PJ_IS_BIG_ENDIAN	1
+
+#elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) ||  \
+	defined(ARMV4) || defined(__arm__)
+    /*
+     * ARM, bi-endian, so raise error if endianness is not configured
+     */
+#   undef PJ_M_ARMV4
+#   define PJ_M_ARMV4		1
+#   define PJ_M_NAME		"armv4"
+#   define PJ_HAS_PENTIUM	0
+#   if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
+#   	error Endianness must be declared for this processor
+#   endif
+
+#elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
+	defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
+	defined(_ARCH_PPC)
+    /*
+     * PowerPC, bi-endian, so raise error if endianness is not configured
+     */
+#   undef PJ_M_POWERPC
+#   define PJ_M_POWERPC		1
+#   define PJ_M_NAME		"powerpc"
+#   define PJ_HAS_PENTIUM	0
+#   if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
+#   	error Endianness must be declared for this processor
+#   endif
+
+#elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
+      defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
+    /*
+     * Nios2, little endian
+     */
+#   undef PJ_M_NIOS2
+#   define PJ_M_NIOS2		1
+#   define PJ_M_NAME		"nios2"
+#   define PJ_HAS_PENTIUM	0
+#   define PJ_IS_LITTLE_ENDIAN	1
+#   define PJ_IS_BIG_ENDIAN	0
+		
+#else
+#   error "Please specify target machine."
+#endif
+
+/* Include size_t definition. */
+#include <pj/compat/size_t.h>
+
+/* Include site/user specific configuration to control PJLIB features.
+ * YOU MUST CREATE THIS FILE YOURSELF!!
+ */
+#include <pj/config_site.h>
+
+/********************************************************************
+ * PJLIB Features.
+ */
+
+/* Overrides for DOXYGEN */
+#ifdef DOXYGEN
+#   undef PJ_FUNCTIONS_ARE_INLINED
+#   undef PJ_HAS_FLOATING_POINT
+#   undef PJ_LOG_MAX_LEVEL
+#   undef PJ_LOG_MAX_SIZE
+#   undef PJ_LOG_USE_STACK_BUFFER
+#   undef PJ_TERM_HAS_COLOR
+#   undef PJ_POOL_DEBUG
+#   undef PJ_HAS_TCP
+#   undef PJ_MAX_HOSTNAME
+#   undef PJ_IOQUEUE_MAX_HANDLES
+#   undef FD_SETSIZE
+#   undef PJ_HAS_SEMAPHORE
+#   undef PJ_HAS_EVENT_OBJ
+#   undef PJ_ENABLE_EXTRA_CHECK
+#   undef PJ_EXCEPTION_USE_WIN32_SEH
+#   undef PJ_HAS_ERROR_STRING
+
+#   define PJ_HAS_IPV6	1
+#endif
+
+/**
+ * @defgroup pj_config Build Configuration
+ * @{
+ *
+ * This section contains macros that can set during PJLIB build process
+ * to controll various aspects of the library.
+ *
+ * <b>Note</b>: the values in this page does NOT necessarily reflect to the
+ * macro values during the build process.
+ */
+
+/**
+ * If this macro is set to 1, it will enable some debugging checking
+ * in the library.
+ *
+ * Default: equal to (NOT NDEBUG).
+ */
+#ifndef PJ_DEBUG
+#  ifndef NDEBUG
+#    define PJ_DEBUG		    1
+#  else
+#    define PJ_DEBUG		    0
+#  endif
+#endif
+
+/**
+ * Enable this macro to activate logging to mutex/semaphore related events.
+ * This is useful to troubleshoot concurrency problems such as deadlocks.
+ * In addition, you should also add PJ_LOG_HAS_THREAD_ID flag to the
+ * log decoration to assist the troubleshooting.
+ *
+ * Default: 0
+ */
+#ifndef PJ_DEBUG_MUTEX
+#   define PJ_DEBUG_MUTEX	    0
+#endif
+
+/**
+ * Expand functions in *_i.h header files as inline.
+ *
+ * Default: 0.
+ */
+#ifndef PJ_FUNCTIONS_ARE_INLINED
+#  define PJ_FUNCTIONS_ARE_INLINED  0
+#endif
+
+/**
+ * Use floating point computations in the library.
+ *
+ * Default: 1.
+ */
+#ifndef PJ_HAS_FLOATING_POINT
+#  define PJ_HAS_FLOATING_POINT	    1
+#endif
+
+/**
+ * Declare maximum logging level/verbosity. Lower number indicates higher
+ * importance, with the highest importance has level zero. The least
+ * important level is five in this implementation, but this can be extended
+ * by supplying the appropriate implementation.
+ *
+ * The level conventions:
+ *  - 0: fatal error
+ *  - 1: error
+ *  - 2: warning
+ *  - 3: info
+ *  - 4: debug
+ *  - 5: trace
+ *  - 6: more detailed trace
+ *
+ * Default: 4
+ */
+#ifndef PJ_LOG_MAX_LEVEL
+#  define PJ_LOG_MAX_LEVEL   5
+#endif
+
+/**
+ * Maximum message size that can be sent to output device for each call
+ * to PJ_LOG(). If the message size is longer than this value, it will be cut.
+ * This may affect the stack usage, depending whether PJ_LOG_USE_STACK_BUFFER
+ * flag is set.
+ *
+ * Default: 4000
+ */
+#ifndef PJ_LOG_MAX_SIZE
+#  define PJ_LOG_MAX_SIZE	    4000
+#endif
+
+/**
+ * Log buffer.
+ * Does the log get the buffer from the stack? (default is yes).
+ * If the value is set to NO, then the buffer will be taken from static
+ * buffer, which in this case will make the log function non-reentrant.
+ *
+ * Default: 1
+ */
+#ifndef PJ_LOG_USE_STACK_BUFFER
+#  define PJ_LOG_USE_STACK_BUFFER   1
+#endif
+
+/**
+ * Enable log indentation feature.
+ *
+ * Default: 1
+ */
+#ifndef PJ_LOG_ENABLE_INDENT
+#   define PJ_LOG_ENABLE_INDENT        1
+#endif
+
+/**
+ * Number of PJ_LOG_INDENT_CHAR to put every time pj_log_push_indent()
+ * is called.
+ *
+ * Default: 1
+ */
+#ifndef PJ_LOG_INDENT_SIZE
+#   define PJ_LOG_INDENT_SIZE        1
+#endif
+
+/**
+ * Log indentation character.
+ *
+ * Default: space
+ */
+#ifndef PJ_LOG_INDENT_CHAR
+#   define PJ_LOG_INDENT_CHAR	    '.'
+#endif
+
+/**
+ * Colorfull terminal (for logging etc).
+ *
+ * Default: 1
+ */
+#ifndef PJ_TERM_HAS_COLOR
+#  define PJ_TERM_HAS_COLOR	    1
+#endif
+
+
+/**
+ * Set this flag to non-zero to enable various checking for pool
+ * operations. When this flag is set, assertion must be enabled
+ * in the application.
+ *
+ * This will slow down pool creation and destruction and will add
+ * few bytes of overhead, so application would normally want to 
+ * disable this feature on release build.
+ *
+ * Default: 0
+ */
+#ifndef PJ_SAFE_POOL
+#   define PJ_SAFE_POOL		    0
+#endif
+
+
+/**
+ * If pool debugging is used, then each memory allocation from the pool
+ * will call malloc(), and pool will release all memory chunks when it
+ * is destroyed. This works better when memory verification programs
+ * such as Rational Purify is used.
+ *
+ * Default: 0
+ */
+#ifndef PJ_POOL_DEBUG
+#  define PJ_POOL_DEBUG		    0
+#endif
+
+
+/**
+ * Enable timer heap debugging facility. When this is enabled, application
+ * can call pj_timer_heap_dump() to show the contents of the timer heap
+ * along with the source location where the timer entries were scheduled.
+ * See https://trac.pjsip.org/repos/ticket/1527 for more info.
+ *
+ * Default: 0
+ */
+#ifndef PJ_TIMER_DEBUG
+#  define PJ_TIMER_DEBUG	    0
+#endif
+
+
+/**
+ * Set this to 1 to enable debugging on the group lock. Default: 0
+ */
+#ifndef PJ_GRP_LOCK_DEBUG
+#  define PJ_GRP_LOCK_DEBUG	0
+#endif
+
+
+/**
+ * Specify this as \a stack_size argument in #pj_thread_create() to specify
+ * that thread should use default stack size for the current platform.
+ *
+ * Default: 8192
+ */
+#ifndef PJ_THREAD_DEFAULT_STACK_SIZE 
+#  define PJ_THREAD_DEFAULT_STACK_SIZE    8192
+#endif
+
+
+/**
+ * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of 
+ * the stack. The OS implementation may check that no stack overflow 
+ * occurs, and it also may collect statistic about stack usage. Note
+ * that this will increase the footprint of the libraries since it
+ * tracks the filename and line number of each functions.
+ */
+#ifndef PJ_OS_HAS_CHECK_STACK
+#	define PJ_OS_HAS_CHECK_STACK		0
+#endif
+
+/**
+ * Do we have alternate pool implementation?
+ *
+ * Default: 0
+ */
+#ifndef PJ_HAS_POOL_ALT_API
+#   define PJ_HAS_POOL_ALT_API	    PJ_POOL_DEBUG
+#endif
+
+
+/**
+ * Support TCP in the library.
+ * Disabling TCP will reduce the footprint slightly (about 6KB).
+ *
+ * Default: 1
+ */
+#ifndef PJ_HAS_TCP
+#  define PJ_HAS_TCP		    1
+#endif
+
+/**
+ * Support IPv6 in the library. If this support is disabled, some IPv6 
+ * related functions will return PJ_EIPV6NOTSUP.
+ *
+ * Default: 0 (disabled, for now)
+ */
+#ifndef PJ_HAS_IPV6
+#  define PJ_HAS_IPV6		    0
+#endif
+
+ /**
+ * Maximum hostname length.
+ * Libraries sometimes needs to make copy of an address to stack buffer;
+ * the value here affects the stack usage.
+ *
+ * Default: 128
+ */
+#ifndef PJ_MAX_HOSTNAME
+#  define PJ_MAX_HOSTNAME	    (128)
+#endif
+
+/**
+ * Maximum consecutive identical error for accept() operation before
+ * activesock stops calling the next ioqueue accept.
+ *
+ * Default: 50
+ */
+#ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
+#   define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
+#endif
+
+/**
+ * Constants for declaring the maximum handles that can be supported by
+ * a single IOQ framework. This constant might not be relevant to the 
+ * underlying I/O queue impelementation, but still, developers should be 
+ * aware of this constant, to make sure that the program will not break when
+ * the underlying implementation changes.
+ */
+#ifndef PJ_IOQUEUE_MAX_HANDLES
+#   define PJ_IOQUEUE_MAX_HANDLES	(64)
+#endif
+
+
+/**
+ * If PJ_IOQUEUE_HAS_SAFE_UNREG macro is defined, then ioqueue will do more
+ * things to ensure thread safety of handle unregistration operation by
+ * employing reference counter to each handle.
+ *
+ * In addition, the ioqueue will preallocate memory for the handles, 
+ * according to the maximum number of handles that is specified during 
+ * ioqueue creation.
+ *
+ * All applications would normally want this enabled, but you may disable
+ * this if:
+ *  - there is no dynamic unregistration to all ioqueues.
+ *  - there is no threading, or there is no preemptive multitasking.
+ *
+ * Default: 1
+ */
+#ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
+#   define PJ_IOQUEUE_HAS_SAFE_UNREG	1
+#endif
+
+
+/**
+ * Default concurrency setting for sockets/handles registered to ioqueue.
+ * This controls whether the ioqueue is allowed to call the key's callback
+ * concurrently/in parallel. The default is yes, which means that if there
+ * are more than one pending operations complete simultaneously, more
+ * than one threads may call the key's callback at the same time. This
+ * generally would promote good scalability for application, at the 
+ * expense of more complexity to manage the concurrent accesses.
+ *
+ * Please see the ioqueue documentation for more info.
+ */
+#ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
+#   define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY   1
+#endif
+
+
+/* Sanity check:
+ *  if ioqueue concurrency is disallowed, PJ_IOQUEUE_HAS_SAFE_UNREG
+ *  must be enabled.
+ */
+#if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
+#   error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
+	  is disabled
+#endif
+
+
+/**
+ * When safe unregistration (PJ_IOQUEUE_HAS_SAFE_UNREG) is configured in
+ * ioqueue, the PJ_IOQUEUE_KEY_FREE_DELAY macro specifies how long the
+ * ioqueue key is kept in closing state before it can be reused.
+ *
+ * The value is in miliseconds.
+ *
+ * Default: 500 msec.
+ */
+#ifndef PJ_IOQUEUE_KEY_FREE_DELAY
+#   define PJ_IOQUEUE_KEY_FREE_DELAY	500
+#endif
+
+
+/**
+ * Determine if FD_SETSIZE is changeable/set-able. If so, then we will
+ * set it to PJ_IOQUEUE_MAX_HANDLES. Currently we detect this by checking
+ * for Winsock.
+ */
+#ifndef PJ_FD_SETSIZE_SETABLE
+#   if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
+       (defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
+#	define PJ_FD_SETSIZE_SETABLE	1
+#   else
+#	define PJ_FD_SETSIZE_SETABLE	0
+#   endif
+#endif
+
+/**
+ * Overrides FD_SETSIZE so it is consistent throughout the library.
+ * We only do this if we detected that FD_SETSIZE is changeable. If
+ * FD_SETSIZE is not set-able, then PJ_IOQUEUE_MAX_HANDLES must be
+ * set to value lower than FD_SETSIZE.
+ */
+#if PJ_FD_SETSIZE_SETABLE
+    /* Only override FD_SETSIZE if the value has not been set */
+#   ifndef FD_SETSIZE
+#	define FD_SETSIZE		PJ_IOQUEUE_MAX_HANDLES
+#   endif
+#else
+    /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
+     * is lower than FD_SETSIZE value.
+     */
+#   ifdef FD_SETSIZE
+#	if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
+#	    error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
+#	endif
+#   endif
+#endif
+
+
+/**
+ * Specify whether #pj_enum_ip_interface() function should exclude
+ * loopback interfaces.
+ *
+ * Default: 1
+ */
+#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
+#   define PJ_IP_HELPER_IGNORE_LOOPBACK_IF	1
+#endif
+
+
+/**
+ * Has semaphore functionality?
+ *
+ * Default: 1
+ */
+#ifndef PJ_HAS_SEMAPHORE
+#  define PJ_HAS_SEMAPHORE	    1
+#endif
+
+
+/**
+ * Event object (for synchronization, e.g. in Win32)
+ *
+ * Default: 1
+ */
+#ifndef PJ_HAS_EVENT_OBJ
+#  define PJ_HAS_EVENT_OBJ	    1
+#endif
+
+
+/**
+ * Maximum file name length.
+ */
+#ifndef PJ_MAXPATH
+#   define PJ_MAXPATH		    260
+#endif
+
+
+/**
+ * Enable library's extra check.
+ * If this macro is enabled, #PJ_ASSERT_RETURN macro will expand to
+ * run-time checking. If this macro is disabled, #PJ_ASSERT_RETURN
+ * will simply evaluate to #pj_assert().
+ *
+ * You can disable this macro to reduce size, at the risk of crashes
+ * if invalid value (e.g. NULL) is passed to the library.
+ *
+ * Default: 1
+ */
+#ifndef PJ_ENABLE_EXTRA_CHECK
+#   define PJ_ENABLE_EXTRA_CHECK    1
+#endif
+
+
+/**
+ * Enable name registration for exceptions with #pj_exception_id_alloc().
+ * If this feature is enabled, then the library will keep track of
+ * names associated with each exception ID requested by application via
+ * #pj_exception_id_alloc().
+ *
+ * Disabling this macro will reduce the code and .bss size by a tad bit.
+ * See also #PJ_MAX_EXCEPTION_ID.
+ *
+ * Default: 1
+ */
+#ifndef PJ_HAS_EXCEPTION_NAMES
+#   define PJ_HAS_EXCEPTION_NAMES   1
+#endif
+
+/**
+ * Maximum number of unique exception IDs that can be requested
+ * with #pj_exception_id_alloc(). For each entry, a small record will
+ * be allocated in the .bss segment.
+ *
+ * Default: 16
+ */
+#ifndef PJ_MAX_EXCEPTION_ID
+#   define PJ_MAX_EXCEPTION_ID      16
+#endif
+
+/**
+ * Should we use Windows Structured Exception Handling (SEH) for the
+ * PJLIB exceptions.
+ *
+ * Default: 0
+ */
+#ifndef PJ_EXCEPTION_USE_WIN32_SEH
+#  define PJ_EXCEPTION_USE_WIN32_SEH 0
+#endif
+
+/**
+ * Should we attempt to use Pentium's rdtsc for high resolution
+ * timestamp.
+ *
+ * Default: 0
+ */
+#ifndef PJ_TIMESTAMP_USE_RDTSC
+#   define PJ_TIMESTAMP_USE_RDTSC   0
+#endif
+
+/**
+ * Is native platform error positive number?
+ * Default: 1 (yes)
+ */
+#ifndef PJ_NATIVE_ERR_POSITIVE
+#   define PJ_NATIVE_ERR_POSITIVE   1
+#endif
+ 
+/**
+ * Include error message string in the library (pj_strerror()).
+ * This is very much desirable!
+ *
+ * Default: 1
+ */
+#ifndef PJ_HAS_ERROR_STRING
+#   define PJ_HAS_ERROR_STRING	    1
+#endif
+
+
+/**
+ * Include pj_stricmp_alnum() and pj_strnicmp_alnum(), i.e. custom
+ * functions to compare alnum strings. On some systems, they're faster
+ * then stricmp/strcasecmp, but they can be slower on other systems.
+ * When disabled, pjlib will fallback to stricmp/strnicmp.
+ * 
+ * Default: 0
+ */
+#ifndef PJ_HAS_STRICMP_ALNUM
+#   define PJ_HAS_STRICMP_ALNUM	    0
+#endif
+
+
+/*
+ * Types of QoS backend implementation.
+ */
+
+/** 
+ * Dummy QoS backend implementation, will always return error on all
+ * the APIs.
+ */
+#define PJ_QOS_DUMMY	    1
+
+/** QoS backend based on setsockopt(IP_TOS) */
+#define PJ_QOS_BSD	    2
+
+/** QoS backend for Windows Mobile 6 */
+#define PJ_QOS_WM	    3
+
+/** QoS backend for Symbian */
+#define PJ_QOS_SYMBIAN	    4
+
+/**
+ * Force the use of some QoS backend API for some platforms.
+ */
+#ifndef PJ_QOS_IMPLEMENTATION
+#   if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
+	/* Windows Mobile 6 or later */
+#	define PJ_QOS_IMPLEMENTATION    PJ_QOS_WM
+#   endif
+#endif
+
+
+/**
+ * Enable secure socket. For most platforms, this is implemented using
+ * OpenSSL, so this will require OpenSSL to be installed. For Symbian
+ * platform, this is implemented natively using CSecureSocket.
+ *
+ * Default: 0 (for now)
+ */
+#ifndef PJ_HAS_SSL_SOCK
+#  define PJ_HAS_SSL_SOCK	    0
+#endif
+
+
+/**
+ * Disable WSAECONNRESET error for UDP sockets on Win32 platforms. See
+ * https://trac.pjsip.org/repos/ticket/1197.
+ *
+ * Default: 1
+ */
+#ifndef PJ_SOCK_DISABLE_WSAECONNRESET
+#   define PJ_SOCK_DISABLE_WSAECONNRESET    1
+#endif
+
+
+/** @} */
+
+/********************************************************************
+ * General macros.
+ */
+
+/**
+ * @defgroup pj_dll_target Building Dynamic Link Libraries (DLL/DSO)
+ * @ingroup pj_config
+ * @{
+ *
+ * The libraries support generation of dynamic link libraries for
+ * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian
+ * terms). Similar procedures may be applied for Win32 DLL with some 
+ * modification.
+ *
+ * Depending on the platforms, these steps may be necessary in order to
+ * produce the dynamic libraries:
+ *  - Create the (Visual Studio) projects to produce DLL output. PJLIB
+ *    does not provide ready to use project files to produce DLL, so
+ *    you need to create these projects yourself. For Symbian, the MMP
+ *    files have been setup to produce DSO files for targets that 
+ *    require them.
+ *  - In the (Visual Studio) projects, some macros need to be declared
+ *    so that appropriate modifiers are added to symbol declarations
+ *    and definitions. Please see the macro section below for information
+ *    regarding these macros. For Symbian, these have been taken care by the
+ *    MMP files.
+ *  - Some build systems require .DEF file to be specified when creating
+ *    the DLL. For Symbian, .DEF files are included in pjlib distribution,
+ *    in <tt>pjlib/build.symbian</tt> directory. These DEF files are 
+ *    created by running <tt>./makedef.sh all</tt> from this directory,
+ *    inside Mingw.
+ *
+ * Macros related for building DLL/DSO files:
+ *  - For platforms that supports dynamic link libraries generation,
+ *    it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains
+ *    the prefix to be added to symbol definition, to export this 
+ *    symbol in the DLL/DSO. For example, on Win32/Visual Studio, the
+ *    value of this macro is \a __declspec(dllexport), and for ARM 
+ *    ABIv2/Symbian, the value is \a EXPORT_C. 
+ *  - For platforms that supports linking with dynamic link libraries,
+ *    it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains
+ *    the prefix to be added to symbol declaration, to import this 
+ *    symbol from a DLL/DSO. For example, on Win32/Visual Studio, the
+ *    value of this macro is \a __declspec(dllimport), and for ARM 
+ *    ABIv2/Symbian, the value is \a IMPORT_C. 
+ *  - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> 
+ *    macros above can be declared in your \a config_site.h if they are not
+ *    declared by pjlib.
+ *  - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and 
+ *    <tt>PJ_EXPORTING</tt> macros must be declared, so that 
+ *     <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function
+ *    definition.
+ *  - When application wants to link dynamically with PJLIB, then it
+ *    must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header,
+ *    so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into 
+ *    symbol declarations.
+ *
+ * When <b>PJ_DLL</b> macro is not declared, static linking is assumed.
+ *
+ * For example, here are some settings to produce DLLs with Visual Studio
+ * on Windows/Win32:
+ *  - Create Visual Studio projects to produce DLL. Add the appropriate 
+ *    project dependencies to avoid link errors.
+ *  - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> 
+ *    macros.
+ *  - Declare these macros in your <tt>config_site.h</tt>:
+ \verbatim
+	#define PJ_EXPORT_SPECIFIER  __declspec(dllexport)
+	#define PJ_IMPORT_SPECIFIER  __declspec(dllimport)
+ \endverbatim
+ *  - And in the application (that links with the DLL) project, add 
+ *    <tt>PJ_DLL</tt> in the macro declarations.
+ */
+
+/** @} */
+
+/**
+ * @defgroup pj_config Build Configuration
+ * @{
+ */
+
+/**
+ * @def PJ_INLINE(type)
+ * @param type The return type of the function.
+ * Expand the function as inline.
+ */
+#define PJ_INLINE(type)	  PJ_INLINE_SPECIFIER type
+
+/**
+ * This macro declares platform/compiler specific specifier prefix
+ * to be added to symbol declaration to export the symbol when PJLIB
+ * is built as dynamic library.
+ *
+ * This macro should have been added by platform specific headers,
+ * if the platform supports building dynamic library target. 
+ */
+#ifndef PJ_EXPORT_DECL_SPECIFIER
+#   define PJ_EXPORT_DECL_SPECIFIER
+#endif
+
+
+/**
+ * This macro declares platform/compiler specific specifier prefix
+ * to be added to symbol definition to export the symbol when PJLIB
+ * is built as dynamic library.
+ *
+ * This macro should have been added by platform specific headers,
+ * if the platform supports building dynamic library target. 
+ */
+#ifndef PJ_EXPORT_DEF_SPECIFIER
+#   define PJ_EXPORT_DEF_SPECIFIER
+#endif
+
+
+/**
+ * This macro declares platform/compiler specific specifier prefix
+ * to be added to symbol declaration to import the symbol.
+ *
+ * This macro should have been added by platform specific headers,
+ * if the platform supports building dynamic library target.
+ */
+#ifndef PJ_IMPORT_DECL_SPECIFIER
+#   define PJ_IMPORT_DECL_SPECIFIER
+#endif
+
+
+/**
+ * This macro has been deprecated. It will evaluate to nothing.
+ */
+#ifndef PJ_EXPORT_SYMBOL
+#   define PJ_EXPORT_SYMBOL(x)
+#endif
+
+
+/**
+ * @def PJ_DECL(type)
+ * @param type The return type of the function.
+ * Declare a function.
+ */
+#if defined(PJ_DLL)
+#   if defined(PJ_EXPORTING)
+#	define PJ_DECL(type)	    PJ_EXPORT_DECL_SPECIFIER type
+#   else
+#	define PJ_DECL(type)	    PJ_IMPORT_DECL_SPECIFIER type
+#   endif
+#elif !defined(PJ_DECL)
+#   if defined(__cplusplus)
+#	define PJ_DECL(type)	    type
+#   else
+#	define PJ_DECL(type)	    extern type
+#   endif
+#endif
+
+
+/**
+ * @def PJ_DEF(type)
+ * @param type The return type of the function.
+ * Define a function.
+ */
+#if defined(PJ_DLL) && defined(PJ_EXPORTING)
+#   define PJ_DEF(type)		    PJ_EXPORT_DEF_SPECIFIER type
+#elif !defined(PJ_DEF)
+#   define PJ_DEF(type)		    type
+#endif
+
+
+/**
+ * @def PJ_DECL_NO_RETURN(type)
+ * @param type The return type of the function.
+ * Declare a function that will not return.
+ */
+/**
+ * @def PJ_IDECL_NO_RETURN(type)
+ * @param type The return type of the function.
+ * Declare an inline function that will not return.
+ */
+/**
+ * @def PJ_BEGIN_DECL
+ * Mark beginning of declaration section in a header file.
+ */
+/**
+ * @def PJ_END_DECL
+ * Mark end of declaration section in a header file.
+ */
+#ifdef __cplusplus
+#  define PJ_DECL_NO_RETURN(type)   PJ_DECL(type) PJ_NORETURN
+#  define PJ_IDECL_NO_RETURN(type)  PJ_INLINE(type) PJ_NORETURN
+#  define PJ_BEGIN_DECL		    extern "C" {
+#  define PJ_END_DECL		    }
+#else
+#  define PJ_DECL_NO_RETURN(type)   PJ_NORETURN PJ_DECL(type)
+#  define PJ_IDECL_NO_RETURN(type)  PJ_NORETURN PJ_INLINE(type)
+#  define PJ_BEGIN_DECL
+#  define PJ_END_DECL
+#endif
+
+
+
+/**
+ * @def PJ_DECL_DATA(type)
+ * @param type The data type.
+ * Declare a global data.
+ */ 
+#if defined(PJ_DLL)
+#   if defined(PJ_EXPORTING)
+#	define PJ_DECL_DATA(type)   PJ_EXPORT_DECL_SPECIFIER extern type
+#   else
+#	define PJ_DECL_DATA(type)   PJ_IMPORT_DECL_SPECIFIER extern type
+#   endif
+#elif !defined(PJ_DECL_DATA)
+#   define PJ_DECL_DATA(type)	    extern type
+#endif
+
+
+/**
+ * @def PJ_DEF_DATA(type)
+ * @param type The data type.
+ * Define a global data.
+ */ 
+#if defined(PJ_DLL) && defined(PJ_EXPORTING)
+#   define PJ_DEF_DATA(type)	    PJ_EXPORT_DEF_SPECIFIER type
+#elif !defined(PJ_DEF_DATA)
+#   define PJ_DEF_DATA(type)	    type
+#endif
+
+
+/**
+ * @def PJ_IDECL(type)
+ * @param type  The function's return type.
+ * Declare a function that may be expanded as inline.
+ */
+/**
+ * @def PJ_IDEF(type)
+ * @param type  The function's return type.
+ * Define a function that may be expanded as inline.
+ */
+
+#if PJ_FUNCTIONS_ARE_INLINED
+#  define PJ_IDECL(type)  PJ_INLINE(type)
+#  define PJ_IDEF(type)   PJ_INLINE(type)
+#else
+#  define PJ_IDECL(type)  PJ_DECL(type)
+#  define PJ_IDEF(type)   PJ_DEF(type)
+#endif
+
+
+/**
+ * @def PJ_UNUSED_ARG(arg)
+ * @param arg   The argument name.
+ * PJ_UNUSED_ARG prevents warning about unused argument in a function.
+ */
+#define PJ_UNUSED_ARG(arg)  (void)arg
+
+/**
+ * @def PJ_TODO(id)
+ * @param id    Any identifier that will be printed as TODO message.
+ * PJ_TODO macro will display TODO message as warning during compilation.
+ * Example: PJ_TODO(CLEAN_UP_ERROR);
+ */
+#ifndef PJ_TODO
+#  define PJ_TODO(id)	    TODO___##id:
+#endif
+
+/**
+ * Simulate race condition by sleeping the thread in strategic locations.
+ * Default: no!
+ */
+#ifndef PJ_RACE_ME
+#  define PJ_RACE_ME(x)
+#endif
+
+/**
+ * Function attributes to inform that the function may throw exception.
+ *
+ * @param x     The exception list, enclosed in parenthesis.
+ */
+#define __pj_throw__(x)
+
+/** @} */
+
+/********************************************************************
+ * Sanity Checks
+ */
+#ifndef PJ_HAS_HIGH_RES_TIMER
+#  error "PJ_HAS_HIGH_RES_TIMER is not defined!"
+#endif
+
+#if !defined(PJ_HAS_PENTIUM)
+#  error "PJ_HAS_PENTIUM is not defined!"
+#endif
+
+#if !defined(PJ_IS_LITTLE_ENDIAN)
+#  error "PJ_IS_LITTLE_ENDIAN is not defined!"
+#endif
+
+#if !defined(PJ_IS_BIG_ENDIAN)
+#  error "PJ_IS_BIG_ENDIAN is not defined!"
+#endif
+
+#if !defined(PJ_EMULATE_RWMUTEX)
+#  error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
+#endif
+
+#if !defined(PJ_THREAD_SET_STACK_SIZE)
+#  error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
+#endif
+
+#if !defined(PJ_THREAD_ALLOCATE_STACK)
+#  error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
+#endif
+
+PJ_BEGIN_DECL
+
+/** PJLIB version major number. */
+#define PJ_VERSION_NUM_MAJOR	2
+
+/** PJLIB version minor number. */
+#define PJ_VERSION_NUM_MINOR	1
+
+/** PJLIB version revision number. */
+#define PJ_VERSION_NUM_REV	0
+
+/**
+ * Extra suffix for the version (e.g. "-trunk"), or empty for
+ * web release version.
+ */
+#define PJ_VERSION_NUM_EXTRA	"-svn"
+
+/**
+ * PJLIB version number consists of three bytes with the following format:
+ * 0xMMIIRR00, where MM: major number, II: minor number, RR: revision
+ * number, 00: always zero for now.
+ */
+#define PJ_VERSION_NUM	((PJ_VERSION_NUM_MAJOR << 24) |	\
+			 (PJ_VERSION_NUM_MINOR << 16) | \
+			 (PJ_VERSION_NUM_REV << 8))
+
+/**
+ * PJLIB version string constant. @see pj_get_version()
+ */
+PJ_DECL_DATA(const char*) PJ_VERSION;
+
+/**
+ * Get PJLIB version string.
+ *
+ * @return #PJ_VERSION constant.
+ */
+PJ_DECL(const char*) pj_get_version(void);
+
+/**
+ * Dump configuration to log with verbosity equal to info(3).
+ */
+PJ_DECL(void) pj_dump_config(void);
+
+PJ_END_DECL
+
+
+#endif	/* __PJ_CONFIG_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6a660a278ef59e4d1d170d29fcb9b377118e5ce.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6a660a278ef59e4d1d170d29fcb9b377118e5ce.svn-base
new file mode 100644
index 0000000..1968ca9
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6a660a278ef59e4d1d170d29fcb9b377118e5ce.svn-base
@@ -0,0 +1,187 @@
+# $Id$
+import os
+import sys
+import time
+import re
+import shutil
+
+PYTHON = os.path.basename(sys.executable)
+
+# Usage:
+#  runall.py [test-to-resume]
+
+
+# Initialize test list
+tests = []
+
+# Excluded tests (because they fail?)
+excluded_tests = [ "svn",
+		   "pyc",
+		   "scripts-call/150_srtp_2_1",				# SRTP optional 'cannot' call SRTP mandatory
+                   "scripts-call/150_srtp_2_3.py",                      # temporarily disabled until #1267 done
+		   "scripts-call/301_ice_public_a.py",			# Unreliable, proxy returns 408 sometimes
+		   "scripts-call/301_ice_public_b.py",			# Doesn't work because OpenSER modifies SDP
+		   "scripts-pres/200_publish.py",			# Ok from cmdline, error from runall.py
+		   "scripts-media-playrec/100_resample_lf_8_11.py",	# related to clock-rate 11 kHz problem
+		   "scripts-media-playrec/100_resample_lf_8_22.py",	# related to clock-rate 22 kHz problem
+		   "scripts-media-playrec/100_resample_lf_11"		# related to clock-rate 11 kHz problem
+                   ]
+
+# Add basic tests
+for f in os.listdir("scripts-run"):
+    tests.append("mod_run.py scripts-run/" + f)
+
+# Add basic call tests
+for f in os.listdir("scripts-call"):
+    tests.append("mod_call.py scripts-call/" + f)
+
+# Add presence tests
+for f in os.listdir("scripts-pres"):
+    tests.append("mod_pres.py scripts-pres/" + f)
+
+# Add mod_sendto tests
+for f in os.listdir("scripts-sendto"):
+    tests.append("mod_sendto.py scripts-sendto/" + f)
+
+# Add mod_media_playrec tests
+for f in os.listdir("scripts-media-playrec"):
+    tests.append("mod_media_playrec.py scripts-media-playrec/" + f)
+
+# Add mod_pesq tests
+for f in os.listdir("scripts-pesq"):
+    tests.append("mod_pesq.py scripts-pesq/" + f)
+
+# Add recvfrom tests
+for f in os.listdir("scripts-recvfrom"):
+    tests.append("mod_recvfrom.py scripts-recvfrom/" + f)
+
+# Add sipp tests
+for f in os.listdir("scripts-sipp"):
+    if f.endswith(".xml"):
+	tests.append("mod_sipp.py scripts-sipp/" + f)
+
+# Filter-out excluded tests
+for pat in excluded_tests:
+    tests = [t for t in tests if t.find(pat)==-1]
+
+
+resume_script=""
+shell_cmd=""
+
+# Parse arguments
+sys.argv.pop(0)
+while len(sys.argv):
+        if sys.argv[0]=='/h' or sys.argv[0]=='-h' or sys.argv[0]=='--help' or sys.argv[0]=='/help':
+                sys.argv.pop(0)
+                print "Usage:"
+                print "  runall.py [OPTIONS] [run.py-OPTIONS]"
+                print "OPTIONS:"
+                print " --list"
+                print "     List the tests"
+                print "  --list-xml"
+                print "     List the tests as XML format suitable for ccdash"
+                print "  --resume,-r RESUME"
+                print "      RESUME is string/substring to specify where to resume tests."
+                print "      If this argument is omited, tests will start from the beginning."
+                print "  --shell,-s SHELL"
+                print "      Run the tests with the specified SHELL cmd. This can also be"
+                print "      used to run the test with ccdash. Example:"
+                print "        --shell '/bin/sh -c'"
+                print "  run.py-OPTIONS are applicable here"
+                sys.exit(0)
+	elif sys.argv[0] == '-r' or sys.argv[0] == '--resume':
+	        if len(sys.argv) > 1:
+			resume_script=sys.argv[1]
+			sys.argv.pop(0)
+			sys.argv.pop(0)
+	        else:
+	                sys.argv.pop(0)
+                        sys.stderr.write("Error: argument value required")
+                        sys.exit(1)
+	elif sys.argv[0] == '--list':
+	        sys.argv.pop(0)
+		for t in tests:
+		      print t
+		sys.exit(0)
+        elif sys.argv[0] == '--list-xml':
+                sys.argv.pop(0)
+                for t in tests:
+                        (mod,param) = t.split(None,2)
+		        tname = mod[4:mod.find(".py")] + "_" + \
+		                param[param.find("/")+1:param.rfind(".")]
+			c = ""
+			if len(sys.argv):
+				c = " ".join(sys.argv) + " "
+                        tcmd = PYTHON + ' run.py ' + c + t
+                        print '\t\t<Test name="%s" cmd="%s" wdir="tests/pjsua" />' % (tname, tcmd)
+                sys.exit(0)
+        elif sys.argv[0] == '-s' or sys.argv[0] == '--shell':
+                if len(sys.argv) > 1:
+			shell_cmd = sys.argv[1]
+			sys.argv.pop(0)
+			sys.argv.pop(0)
+                else:
+                        sys.argv.pop(0)
+                        sys.stderr.write("Error: argument value required")
+                        sys.exit(1)
+	else:
+		# should be run.py options
+		break
+
+
+# Generate arguments for run.py
+argv_st = " ".join(sys.argv) + " "
+
+# Init vars
+fails_cnt = 0
+tests_cnt = 0
+
+# Re-create "logs" directory
+try:
+    shutil.rmtree("logs")
+except:
+    print "Warning: failed in removing directory 'logs'"
+
+try:
+    os.mkdir("logs")
+except:
+    print "Warning: failed in creating directory 'logs'"
+
+# Now run the tests
+total_cnt = len(tests)
+for t in tests:
+	if resume_script!="" and t.find(resume_script)==-1:
+	    print "Skipping " + t +".."
+            total_cnt = total_cnt - 1
+	    continue
+	resume_script=""
+	cmdline = "python run.py " + argv_st + t
+        if shell_cmd:
+                cmdline = "%s '%s'" % (shell_cmd, cmdline)
+	t0 = time.time()
+	msg = "Running %d/%d: %s..." % (tests_cnt+1, total_cnt, cmdline)
+        sys.stdout.write(msg)
+        sys.stdout.flush()
+	ret = os.system(cmdline + " > output.log")
+	t1 = time.time()
+	if ret != 0:
+		dur = int(t1 - t0)
+		print " failed!! [" + str(dur) + "s]"
+		logname = re.search(".*\s+(.*)", t).group(1)
+		logname = re.sub("[\\\/]", "_", logname)
+		logname = re.sub("\.py$", ".log", logname)
+		logname = re.sub("\.xml$", ".log", logname)
+		logname = "logs/" + logname
+		shutil.move("output.log", logname)
+		print "Please see '" + logname + "' for the test log."
+		fails_cnt += 1
+	else:
+		dur = int(t1 - t0)
+		print " ok [" + str(dur) + "s]"
+	tests_cnt += 1
+
+if fails_cnt == 0:
+	print "All " + str(tests_cnt) + " tests completed successfully"
+else:
+	print str(tests_cnt) + " tests completed, " +  str(fails_cnt) + " test(s) failed"
+
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6dc1238f7d21fb62fceed18a7f0dc750ba50af6.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6dc1238f7d21fb62fceed18a7f0dc750ba50af6.svn-base
new file mode 100644
index 0000000..523cf19
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6dc1238f7d21fb62fceed18a7f0dc750ba50af6.svn-base
@@ -0,0 +1,116 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_AUDIODEV_AUDIOTEST_H__
+#define __PJMEDIA_AUDIODEV_AUDIOTEST_H__
+
+/**
+ * @file audiotest.h
+ * @brief Audio test utility.
+ */
+#include <pjmedia-audiodev/audiodev.h>
+
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup s30_audio_test_utility Audio tests utility.
+ * @ingroup audio_device_api
+ * @brief Audio test utility.
+ * @{
+ */
+
+/**
+ * Statistic for each direction.
+ */
+typedef struct pjmedia_aud_test_stat
+{
+    /**
+     * Number of frames processed during the test.
+     */
+    unsigned frame_cnt;
+
+    /** 
+     * Minimum inter-frame arrival time, in milliseconds 
+     */
+    unsigned min_interval;
+
+    /** 
+     * Maximum inter-frame arrival time, in milliseconds 
+     */
+    unsigned max_interval;
+
+    /** 
+     * Average inter-frame arrival time, in milliseconds 
+     */
+    unsigned avg_interval;
+
+    /** 
+     * Standard deviation of inter-frame arrival time, in milliseconds 
+     */
+    unsigned dev_interval;
+
+    /** 
+     * Maximum number of frame burst 
+     */
+    unsigned max_burst;
+
+} pjmedia_aud_test_stat;
+
+
+/**
+ * Test results.
+ */
+typedef struct pjmedia_aud_test_results
+{
+    /**
+     * Recording statistic.
+     */
+    pjmedia_aud_test_stat rec;
+
+    /**
+     * Playback statistic.
+     */
+    pjmedia_aud_test_stat play;
+
+    /** 
+     * Clock drifts per second, in samples. Positive number indicates rec
+     * device is running faster than playback device.
+     */
+    pj_int32_t rec_drift_per_sec;
+
+} pjmedia_aud_test_results;
+
+
+/**
+ * Perform audio device testing.
+ */
+PJ_DECL(pj_status_t) pjmedia_aud_test(const pjmedia_aud_param *param,
+				      pjmedia_aud_test_results *result);
+
+/**
+ * @}
+ */
+
+PJ_END_DECL
+
+
+#endif	/* __PJMEDIA_AUDIODEV_AUDIOTEST_H__ */
+
+
diff --git a/jni/pjproject-android/.svn/pristine/e6/e6eb834f7703c015a4a4c3c583ccd1a51147359e.svn-base b/jni/pjproject-android/.svn/pristine/e6/e6eb834f7703c015a4a4c3c583ccd1a51147359e.svn-base
new file mode 100644
index 0000000..b27da31
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e6/e6eb834f7703c015a4a4c3c583ccd1a51147359e.svn-base
@@ -0,0 +1,67 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_CODECS_FFMPEG_VID_H__
+#define __PJMEDIA_CODECS_FFMPEG_VID_H__
+
+
+#include <pjmedia-codec/types.h>
+#include <pjmedia/vid_codec.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJMEDIA_CODEC_VID_FFMPEG FFmpeg Codecs
+ * @ingroup PJMEDIA_CODEC_VID_CODECS
+ * @{
+ */
+
+/**
+ * Initialize and register FFMPEG video codecs factory to pjmedia endpoint.
+ *
+ * @param mgr	    The video codec manager instance where this codec will
+ * 		    be registered to. Specify NULL to use default instance
+ * 		    (in that case, an instance of video codec manager must
+ * 		    have been created beforehand).
+ * @param pf	    Pool factory.
+ *
+ * @return	    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_ffmpeg_vid_init(pjmedia_vid_codec_mgr *mgr,
+                                                   pj_pool_factory *pf);
+
+
+/**
+ * Unregister FFMPEG video codecs factory from the video codec manager and
+ * deinitialize the codecs library.
+ *
+ * @return	    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_ffmpeg_vid_deinit(void);
+
+
+PJ_END_DECL
+
+
+/**
+ * @}
+ */
+
+#endif	/* __PJMEDIA_CODECS_FFMPEG_VID_H__ */
+