Adds support for Windows Phone 8 and Surface Pro

This commit is contained in:
bossiel 2013-02-17 18:56:03 +00:00
parent 57d8449de7
commit 5702098bc8
364 changed files with 19131 additions and 1172 deletions

View File

@ -46,6 +46,14 @@ bool ActionConfig::addPayload(const void* payload, unsigned len)
TSIP_ACTION_SET_NULL()) == 0);
}
bool ActionConfig::setActiveMedia(twrap_media_type_t type)
{
tmedia_type_t media_type = twrap_get_media_type(type);
return (tsip_action_set(m_pHandle,
TSIP_ACTION_SET_MEDIA_TYPE(media_type),
TSIP_ACTION_SET_NULL()) == 0);
}
ActionConfig* ActionConfig::setResponseLine(short code, const char* phrase)
{
int32_t _code = code;

View File

@ -1,7 +1,4 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
/* Copyright (C) 2010-2011 Mamadou Diop.
*
* This file is part of Open Source Doubango Framework.
*
@ -17,15 +14,16 @@
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
#ifndef TINYWRAP_ACTIONCONFIG_H
#define TINYWRAP_ACTIONCONFIG_H
#include "tinyWRAP_config.h"
#include "tinysip.h"
#include "Common.h"
class ActionConfig
class TINYWRAP_API ActionConfig
{
public:
ActionConfig();
@ -33,6 +31,7 @@ public:
bool addHeader(const char* name, const char* value);
bool addPayload(const void* payload, unsigned len);
bool setActiveMedia(twrap_media_type_t type);
ActionConfig* setResponseLine(short code, const char* phrase);
ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);

View File

@ -40,7 +40,7 @@ m_nQuality(nQuality)
{
if((m_pWrappedResampler = tmedia_resampler_create())){
int ret;
if((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, m_nQuality))){
if((ret = tmedia_resampler_open(m_pWrappedResampler, nInFreq, nOutFreq, nFrameDuration, nChannels, nChannels, m_nQuality))){
TSK_DEBUG_ERROR("Failed to open audio resampler (%d)", ret);
TSK_OBJECT_SAFE_FREE(m_pWrappedResampler);
}

View File

@ -22,12 +22,14 @@
#ifndef TINYWRAP_MEDIA_SESSIONMGR_H
#define TINYWRAP_MEDIA_SESSIONMGR_H
#include "tinyWRAP_config.h"
#include "tinymedia.h"
#include "Common.h"
class ProxyPlugin;
class Codec
class TINYWRAP_API Codec
{
public:
#if !defined(SWIG)
@ -36,6 +38,7 @@ public:
virtual ~Codec();
public:
const struct tmedia_codec_s* getWrappedCodec(){ return m_pWrappedCodec; }
twrap_media_type_t getMediaType();
const char* getName();
const char* getDescription();
@ -48,7 +51,7 @@ private:
struct tmedia_codec_s* m_pWrappedCodec;
};
class MediaSessionMgr
class TINYWRAP_API MediaSessionMgr
{
public:
#if !defined(SWIG)

View File

@ -22,11 +22,13 @@
#ifndef TINYWRAP_MSRP_H
#define TINYWRAP_MSRP_H
#include "tinyWRAP_config.h"
#include "tinymsrp.h"
class MsrpSession;
class MsrpMessage
class TINYWRAP_API MsrpMessage
{
public:
MsrpMessage();
@ -52,6 +54,8 @@ public:
unsigned getMsrpContentLength();
unsigned getMsrpContent(void* output, unsigned maxsize);
const tmsrp_message_t* getWrappedMsrpMessage() { return m_pMessage; }
private:
const tmsrp_header_t* getMsrpHeader(const char* name, unsigned index = 0);
@ -59,7 +63,7 @@ private:
tmsrp_message_t *m_pMessage;
};
class MsrpEvent
class TINYWRAP_API MsrpEvent
{
public:
#if !defined(SWIG)
@ -76,7 +80,7 @@ protected:
MsrpMessage* m_pMessage;
};
class MsrpCallback
class TINYWRAP_API MsrpCallback
{
public:
MsrpCallback() { }

View File

@ -22,9 +22,11 @@
#ifndef TINYWRAP_SAFEOBJECT_H
#define TINYWRAP_SAFEOBJECT_H
#include "tinyWRAP_config.h"
#include "tsk_mutex.h"
class SafeObject
class TINYWRAP_API SafeObject
{
public:
SafeObject();

View File

@ -25,6 +25,20 @@
#include "SipStack.h"
#define takeOwnership_Implement(cls, name, session) \
name##Session* cls##Event::take##session##Ownership() const \
{ \
if(this->sipevent && this->sipevent->ss /*&& !tsip_ssession_have_ownership(this->sipevent->ss)*/){ \
SipStack* stack = this->getStack(); \
if(stack){ \
/* The constructor will call take_ownerhip() */ \
return new name##Session(stack, this->sipevent->ss); \
} \
} \
return tsk_null; \
} \
/* ======================== SipEvent ========================*/
SipEvent::SipEvent(const tsip_event_t *_sipevent)
{
@ -132,31 +146,8 @@ const InviteSession* InviteEvent::getSession() const
return dyn_cast<const InviteSession*>(this->getBaseSession());
}
CallSession* InviteEvent::takeCallSessionOwnership() const
{
// TODO: Factor all takeSessionOwnership() functions
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new CallSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
MsrpSession* InviteEvent::takeMsrpSessionOwnership() const
{
// TODO: Factor all takeSessionOwnership() functions
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new MsrpSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
takeOwnership_Implement(Invite, Call, CallSession);
takeOwnership_Implement(Invite, Msrp, MsrpSession);
/* ======================== MessagingEvent ========================*/
MessagingEvent::MessagingEvent(const tsip_event_t *_sipevent)
@ -178,18 +169,7 @@ const MessagingSession* MessagingEvent::getSession() const
return dyn_cast<const MessagingSession*>(this->getBaseSession());
}
MessagingSession* MessagingEvent::takeSessionOwnership() const
{
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new MessagingSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
takeOwnership_Implement(Messaging, Messaging, Session);
/* ======================== InfoEvent ========================*/
@ -212,17 +192,7 @@ const InfoSession* InfoEvent::getSession() const
return dyn_cast<const InfoSession*>(this->getBaseSession());
}
InfoSession* InfoEvent::takeSessionOwnership() const
{
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new InfoSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
takeOwnership_Implement(Info, Info, Session);
@ -246,17 +216,7 @@ const OptionsSession* OptionsEvent::getSession() const
return dyn_cast<const OptionsSession*>(this->getBaseSession());
}
OptionsSession* OptionsEvent::takeSessionOwnership() const
{
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new OptionsSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
takeOwnership_Implement(Options, Options, Session);
/* ======================== PublicationEvent ========================*/
@ -279,6 +239,7 @@ const PublicationSession* PublicationEvent::getSession() const
return dyn_cast<const PublicationSession*>(this->getBaseSession());
}
takeOwnership_Implement(Publication, Publication, Session);
/* ======================== RegistrationEvent ========================*/
@ -301,18 +262,7 @@ const RegistrationSession* RegistrationEvent::getSession() const
return dyn_cast<const RegistrationSession*>(this->getBaseSession());
}
RegistrationSession* RegistrationEvent::takeSessionOwnership() const
{
// TODO: Factor all takeSessionOwnership() functions
if(this->sipevent && this->sipevent->ss && !tsip_ssession_have_ownership(this->sipevent->ss)){
SipStack* stack = this->getStack();
if(stack){
/* The constructor will call take_ownerhip() */
return new RegistrationSession(stack, this->sipevent->ss);
}
}
return tsk_null;
}
takeOwnership_Implement(Registration, Registration, Session);
/* ======================== SubscriptionEvent ========================*/
@ -333,4 +283,6 @@ tsip_subscribe_event_type_t SubscriptionEvent::getType() const
const SubscriptionSession* SubscriptionEvent::getSession() const
{
return dyn_cast<const SubscriptionSession*>(this->getBaseSession());
}
}
takeOwnership_Implement(Subscription, Subscription, Session);

View File

@ -22,6 +22,8 @@
#ifndef TINYWRAP_SIPEVENT_H
#define TINYWRAP_SIPEVENT_H
#include "tinyWRAP_config.h"
#include "tinysip.h"
#include "Common.h"
@ -42,7 +44,7 @@ class SipMessage;
/* ======================== SipEvent ========================*/
class SipEvent
class TINYWRAP_API SipEvent
{
public:
#if !defined(SWIG)
@ -55,8 +57,9 @@ public:
const char* getPhrase() const;
const SipSession* getBaseSession() const;
const SipMessage* getSipMessage() const;
protected:
#if !defined(SWIG)
const tsip_event_t * getWrappedEvent(){ return sipevent; }
#endif
#if !defined(SWIG)
SipStack* getStack()const;
#endif
@ -68,7 +71,7 @@ protected:
/* ======================== DialogEvent ========================*/
class DialogEvent: public SipEvent
class TINYWRAP_API DialogEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -80,7 +83,7 @@ public: /* Public API functions */
};
/* ======================== StackEvent ========================*/
class StackEvent: public SipEvent
class TINYWRAP_API StackEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -94,7 +97,7 @@ public: /* Public API functions */
/* ======================== InviteEvent ========================*/
class InviteEvent: public SipEvent
class TINYWRAP_API InviteEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -113,7 +116,7 @@ public: /* Public API functions */
/* ======================== MessagingEvent ========================*/
class MessagingEvent: public SipEvent
class TINYWRAP_API MessagingEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -128,7 +131,7 @@ public: /* Public API functions */
};
/* ======================== InfoEvent ========================*/
class InfoEvent: public SipEvent
class TINYWRAP_API InfoEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -145,7 +148,7 @@ public: /* Public API functions */
/* ======================== OptionsEvent ========================*/
class OptionsEvent: public SipEvent
class TINYWRAP_API OptionsEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -162,7 +165,7 @@ public: /* Public API functions */
/* ======================== PublicationEvent ========================*/
class PublicationEvent: public SipEvent
class TINYWRAP_API PublicationEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -173,12 +176,13 @@ public:
public: /* Public API functions */
tsip_publish_event_type_t getType() const;
const PublicationSession* getSession() const;
PublicationSession* takeSessionOwnership() const;
};
/* ======================== RegistrationEvent ========================*/
class RegistrationEvent: public SipEvent
class TINYWRAP_API RegistrationEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -195,7 +199,7 @@ public: /* Public API functions */
/* ======================== SubscriptionEvent ========================*/
class SubscriptionEvent: public SipEvent
class TINYWRAP_API SubscriptionEvent: public SipEvent
{
public:
#if !defined(SWIG)
@ -206,6 +210,7 @@ public:
public: /* Public API functions */
tsip_subscribe_event_type_t getType() const;
const SubscriptionSession* getSession() const;
SubscriptionSession* takeSessionOwnership() const;
};
#endif /* TINYWRAP_SIPEVENT_H */

View File

@ -22,9 +22,10 @@
#ifndef TINYWRAP_SIPMESSAGE_H
#define TINYWRAP_SIPMESSAGE_H
#include "tinyWRAP_config.h"
#include "tinysip.h"
class SdpMessage
class TINYWRAP_API SdpMessage
{
public:
SdpMessage();
@ -35,12 +36,15 @@ public:
char* getSdpHeaderValue(const char* media, char name, unsigned index = 0);
char* getSdpHeaderAValue(const char* media, const char* attributeName);
#if !defined(SWIG)
const tsdp_message_t * getWrappedSdpMessage(){ return m_pSdpMessage; }
#endif
private:
tsdp_message_t *m_pSdpMessage;
};
class SipMessage
class TINYWRAP_API SipMessage
{
public:
SipMessage();

View File

@ -59,7 +59,10 @@ void SipSession::init(SipStack* pStack, tsip_ssession_handle_t* pHandle/*=tsk_nu
{
if(pHandle){
/* "server-side-session" */
if(tsip_ssession_take_ownership(pHandle)){ /* should never happen */
if(tsip_ssession_have_ownership(pHandle)){
tsk_object_ref(pHandle);
}
else if(tsip_ssession_take_ownership(pHandle) != 0){ /* should never happen */
TSK_DEBUG_ERROR("Failed to take ownership");
return;
}
@ -965,6 +968,12 @@ PublicationSession::PublicationSession(SipStack* Stack)
{
}
PublicationSession::PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
: SipSession(pStack, pHandle)
{
}
PublicationSession::~PublicationSession()
{
}
@ -1053,6 +1062,13 @@ SubscriptionSession::SubscriptionSession(SipStack* pStack)
{
}
SubscriptionSession::SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
: SipSession(pStack, pHandle)
{
}
SubscriptionSession::~SubscriptionSession()
{
}

View File

@ -22,6 +22,8 @@
#ifndef TINYWRAP_SIPSESSION_H
#define TINYWRAP_SIPSESSION_H
#include "tinyWRAP_config.h"
#include "tinysip.h"
#include "tinymedia/tmedia_qos.h"
#include "ActionConfig.h"
@ -32,7 +34,7 @@ class MsrpCallback;
class MediaSessionMgr;
/* ======================== T140Callback ========================*/
class T140CallbackData{
class TINYWRAP_API T140CallbackData{
public:
#if !defined(SWIG)
T140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size){
@ -60,7 +62,7 @@ class T140CallbackData{
unsigned m_nSize;
};
class T140Callback
class TINYWRAP_API T140Callback
{
public:
T140Callback() {}
@ -83,7 +85,7 @@ class RtcpCallbackData{
uint32_t m_nSSRC;
};
class RtcpCallback
class TINYWRAP_API RtcpCallback
{
public:
RtcpCallback() {}
@ -95,7 +97,7 @@ public:
/* ======================== SipSession ========================*/
class SipSession
class TINYWRAP_API SipSession
{
public:
SipSession(SipStack* stack);
@ -127,6 +129,7 @@ public:
#if !defined(SWIG)
bool setWebSocketSrc(const char* host, int32_t port, const char* proto);
const SipStack* getStack() const;
const tsip_ssession_handle_t* getWrappedSession() { return m_pHandle; }
#endif
private:
@ -138,7 +141,7 @@ protected:
};
/* ======================== InviteSession ========================*/
class InviteSession : public SipSession
class TINYWRAP_API InviteSession : public SipSession
{
public: /* ctor() and dtor() */
InviteSession(SipStack* Stack);
@ -160,7 +163,7 @@ private:
/* ======================== CallSession ========================*/
class CallSession : public InviteSession
class TINYWRAP_API CallSession : public InviteSession
{
public: /* ctor() and dtor() */
CallSession(SipStack* pStack);
@ -214,7 +217,7 @@ private:
};
/* ======================== MsrpSession ========================*/
class MsrpSession : public InviteSession
class TINYWRAP_API MsrpSession : public InviteSession
{
public: /* ctor() and dtor() */
MsrpSession(SipStack* pStack, MsrpCallback* pCallback);
@ -244,7 +247,7 @@ private:
/* ======================== MessagingSession ========================*/
class MessagingSession : public SipSession
class TINYWRAP_API MessagingSession : public SipSession
{
public: /* ctor() and dtor() */
MessagingSession(SipStack* pStack);
@ -260,7 +263,7 @@ public: /* Public functions */
};
/* ======================== InfoSession ========================*/
class InfoSession : public SipSession
class TINYWRAP_API InfoSession : public SipSession
{
public: /* ctor() and dtor() */
InfoSession(SipStack* pStack);
@ -276,7 +279,7 @@ public: /* Public functions */
};
/* ======================== OptionsSession ========================*/
class OptionsSession : public SipSession
class TINYWRAP_API OptionsSession : public SipSession
{
public: /* ctor() and dtor() */
OptionsSession(SipStack* pStack);
@ -294,10 +297,13 @@ public: /* Public functions */
/* ======================== PublicationSession ========================*/
class PublicationSession : public SipSession
class TINYWRAP_API PublicationSession : public SipSession
{
public: /* ctor() and dtor() */
PublicationSession(SipStack* pStack);
#if !defined(SWIG)
PublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
virtual ~PublicationSession();
public: /* Public functions */
@ -307,7 +313,7 @@ public: /* Public functions */
/* ======================== RegistrationSession ========================*/
class RegistrationSession : public SipSession
class TINYWRAP_API RegistrationSession : public SipSession
{
public: /* ctor() and dtor() */
RegistrationSession(SipStack* pStack);
@ -325,10 +331,13 @@ public: /* Public functions */
/* ======================== SubscriptionSession ========================*/
class SubscriptionSession : public SipSession
class TINYWRAP_API SubscriptionSession : public SipSession
{
public: /* ctor() and dtor() */
SubscriptionSession(SipStack* pStack);
#if !defined(SWIG)
SubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
#endif
virtual ~SubscriptionSession();
public: /* Public functions */

View File

@ -88,6 +88,14 @@ bool SipStack::setDebugCallback(DDebugCallback* pCallback)
return true;
}
bool SipStack::setDisplayName(const char* display_name)
{
int ret = tsip_stack_set(m_pHandle,
TSIP_STACK_SET_DISPLAY_NAME(display_name),
TSIP_STACK_SET_NULL());
return (ret == 0);
}
bool SipStack::setRealm(const char* realm_uri)
{
int ret = tsip_stack_set(m_pHandle,

View File

@ -22,6 +22,8 @@
#ifndef TINYWRAP_SIPSTACK_H
#define TINYWRAP_SIPSTACK_H
#include "tinyWRAP_config.h"
#include "SipCallback.h"
#include "SafeObject.h"
@ -30,7 +32,7 @@
class DDebugCallback;
class SipStack: public SafeObject
class TINYWRAP_API SipStack: public SafeObject
{
public: /* ctor() and dtor() */
SipStack(SipCallback* pCallback, const char* realm_uri, const char* impi_uri, const char* impu_uri);
@ -39,6 +41,7 @@ public: /* ctor() and dtor() */
public: /* API functions */
bool start();
bool setDebugCallback(DDebugCallback* pCallback);
bool setDisplayName(const char* display_name);
bool setRealm(const char* realm_uri);
bool setIMPI(const char* impi);
bool setIMPU(const char* impu_uri);

View File

@ -22,9 +22,11 @@
#ifndef TINYWRAP_SIPURI_H
#define TINYWRAP_SIPURI_H
#include "tinyWRAP_config.h"
#include "tinysip.h"
class SipUri
class TINYWRAP_API SipUri
{
public:
SipUri(const char* uriString, const char* displayName=tsk_null);

View File

@ -27,16 +27,18 @@
#undef _WIN32 /* Because of WINSCW */
#endif
/* Windows (XP/Vista/7/CE and Windows Mobile) macro definition.
*/
// Windows (XP/Vista/7/CE and Windows Mobile) macro definition.
#if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
# define TWRAP_UNDER_WINDOWS 1
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP)
# define TWRAP_UNDER_WINDOWS_RT 1
# endif
#endif
#if (TWRAP_UNDER_WINDOWS || defined(__SYMBIAN32__)) && defined(TINYWRAP_EXPORTS)
# define TINYWRAP_API __declspec(dllexport)
# define TINYWRAP_GEXTERN __declspec(dllexport)
#elif (TWRAP_UNDER_WINDOWS || defined(__SYMBIAN32__)) /*&& defined(TINYWRAP_IMPORTS)*/
# define TINYWRAP_GEXTERN extern __declspec(dllexport)
#elif (TWRAP_UNDER_WINDOWS || defined(__SYMBIAN32__)) && !defined(TINYWRAP_IMPORTS_IGNORE)
# define TINYWRAP_API __declspec(dllimport)
# define TINYWRAP_GEXTERN __declspec(dllimport)
#else

View File

@ -0,0 +1,55 @@
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
namespace System.Runtime.InteropServices
{
using System;
[System.Runtime.InteropServices.ComVisible(true)]
public struct HandleRef
{
// ! Do not add or rearrange fields as the EE depends on this layout.
//------------------------------------------------------------------
internal Object m_wrapper;
internal IntPtr m_handle;
//-----------------------------------------------------------------
public HandleRef(Object wrapper, IntPtr handle)
{
m_wrapper = wrapper;
m_handle = handle;
}
public Object Wrapper
{
get
{
return m_wrapper;
}
}
public IntPtr Handle
{
get
{
return m_handle;
}
}
public static explicit operator IntPtr(HandleRef value)
{
return value.m_handle;
}
public static IntPtr ToIntPtr(HandleRef value)
{
return value.m_handle;
}
}
}

View File

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9ef0fc75-baab-4f71-ac0c-dbd185463ff8}</ProjectGuid>
<RootNamespace>doubango_rt</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<WinMDAssembly>true</WinMDAssembly>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<AdditionalIncludeDirectories>include;..\..\_common;..\..\.;..\..\..\thirdparties\winrt\include;..\..\..\tinySAK\src;..\..\..\tinyNET\src;..\..\..\tinyHTTP\include;..\..\..\tinySIP\include;..\..\..\tinyDAV\include;..\..\..\tinySDP\include;..\..\..\tinyMEDIA\include;..\..\..\tinyXCAP\include;..\..\..\tinySMS\include;..\..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<AdditionalIncludeDirectories>include;..\..\_common;..\..\.;..\..\..\thirdparties\winrt\include;..\..\..\tinySAK\src;..\..\..\tinyNET\src;..\..\..\tinyHTTP\include;..\..\..\tinySIP\include;..\..\..\tinyDAV\include;..\..\..\tinySDP\include;..\..\..\tinyMEDIA\include;..\..\..\tinyXCAP\include;..\..\..\tinySMS\include;..\..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<AdditionalIncludeDirectories>include;..\..\_common;..\..\.;..\..\..\thirdparties\winrt\include;..\..\..\tinySAK\src;..\..\..\tinyNET\src;..\..\..\tinyHTTP\include;..\..\..\tinySIP\include;..\..\..\tinyDAV\include;..\..\..\tinySDP\include;..\..\..\tinyMEDIA\include;..\..\..\tinyXCAP\include;..\..\..\tinySMS\include;..\..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<CompileAsWinRT>true</CompileAsWinRT>
<AdditionalIncludeDirectories>include;..\..\_common;..\..\.;..\..\..\thirdparties\winrt\include;..\..\..\tinySAK\src;..\..\..\tinyNET\src;..\..\..\tinyHTTP\include;..\..\..\tinySIP\include;..\..\..\tinyDAV\include;..\..\..\tinySDP\include;..\..\..\tinyMEDIA\include;..\..\..\tinyXCAP\include;..\..\..\tinySMS\include;..\..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>ole32.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="platform.winmd">
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\rt_ActionConfig.h" />
<ClInclude Include="include\rt_Config.h" />
<ClInclude Include="include\rt_DDebug.h" />
<ClInclude Include="include\rt_Enums.h" />
<ClInclude Include="include\rt_MediaContent.h" />
<ClInclude Include="include\rt_MediaSessionMgr.h" />
<ClInclude Include="include\rt_Msrp.h" />
<ClInclude Include="include\rt_SipCallback.h" />
<ClInclude Include="include\rt_SipEvent.h" />
<ClInclude Include="include\rt_SipMessage.h" />
<ClInclude Include="include\rt_SipSession.h" />
<ClInclude Include="include\rt_SipStack.h" />
<ClInclude Include="include\rt_SipUri.h" />
<ClInclude Include="include\rt_SMSEncoder.h" />
<ClInclude Include="include\rt_String.h" />
<ClInclude Include="include\rt_Xcap.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\rt_ActionConfig.cxx" />
<ClCompile Include="src\rt_DDebug.cxx" />
<ClCompile Include="src\rt_Enums.cxx" />
<ClCompile Include="src\rt_MediaContent.cxx" />
<ClCompile Include="src\rt_MediaSessionMgr.cxx" />
<ClCompile Include="src\rt_Msrp.cxx" />
<ClCompile Include="src\rt_SipCallback.cxx" />
<ClCompile Include="src\rt_SipEvent.cxx" />
<ClCompile Include="src\rt_SipMessage.cxx" />
<ClCompile Include="src\rt_SipSession.cxx" />
<ClCompile Include="src\rt_SipStack.cxx" />
<ClCompile Include="src\rt_SipUri.cxx" />
<ClCompile Include="src\rt_SMSEncoder.cxx" />
<ClCompile Include="src\rt_String.cxx" />
<ClCompile Include="src\rt_Xcap.cxx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\tinyDAV\winrt\tinyDAV.vcxproj">
<Project>{0f2c458a-1edb-4e09-9a22-c2209731cff2}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyHTTP\winrt\tinyHTTP.vcxproj">
<Project>{1a27423c-6535-4a49-96ec-5d209fe125f2}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyIPSec\winrt\tinyIPSec.vcxproj">
<Project>{0875a083-5118-40cc-941e-722b00295a5b}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyMEDIA\winrt\tinyMEDIA.vcxproj">
<Project>{52e43eeb-a549-4159-b254-dca225d7638b}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyMSRP\winrt\tinyMSRP.vcxproj">
<Project>{be41d117-1d61-4c12-ad9d-b20d02c79687}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyNET\winrt\tinyNET.vcxproj">
<Project>{06e58f9d-28a1-4dd4-af11-2f5239222ccc}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyRTP\winrt\tinyRTP.vcxproj">
<Project>{77a24977-079c-4e02-9717-8b2f684baa21}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinySAK\winrt\tinySAK.vcxproj">
<Project>{19279f5b-cdaf-4187-9f09-2a896a828b05}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinySDP\winrt\tinySDP.vcxproj">
<Project>{982d737a-0649-4c32-a00e-08992a0b7673}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinySIGCOMP\winrt\tinySIGCOMP.vcxproj">
<Project>{f623cbdb-707a-4fdc-ace0-3d616e239f16}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinySIP\winrt\tinySIP.vcxproj">
<Project>{1137a808-dac8-4af7-b8bb-aee8abff2f67}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinySMS\winrt\tinySMS.vcxproj">
<Project>{65cdf0ff-3b84-45f3-9bb6-468c79b8e0bc}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\tinyXCAP\winrt\tinyXCAP.vcxproj">
<Project>{49843b78-0ceb-445d-bacc-c5c5c2f6c26f}</Project>
</ProjectReference>
<ProjectReference Include="..\tinyWRAP.vcxproj">
<Project>{5004ba7e-950d-4d60-a030-29acd38dca08}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resources">
<UniqueIdentifier>5fd0e509-b6ae-4f29-bd2a-4d2cc10f3aa0</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="include">
<UniqueIdentifier>{98c8b78c-011e-40c4-91a2-a9fcf6d9fa24}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{a8badfe7-5114-4a27-bb07-76772da8a9d1}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\rt_SipStack.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_Enums.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_ActionConfig.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_DDebug.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_MediaContent.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_Msrp.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SipCallback.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SipMessage.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SipSession.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SipUri.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SMSEncoder.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_Xcap.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_String.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_MediaSessionMgr.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\rt_SipEvent.cxx">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\rt_SipStack.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_Enums.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_ActionConfig.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_DDebug.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_MediaContent.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_Msrp.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SipCallback.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SipEvent.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SipMessage.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SipSession.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SipUri.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_SMSEncoder.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_Xcap.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_String.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_MediaSessionMgr.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\rt_Config.h">
<Filter>include</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,53 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Enums.h"
class ActionConfig;
namespace doubango_rt
{
namespace BackEnd
{
public ref class rtActionConfig sealed
{
public:
rtActionConfig();
virtual ~rtActionConfig();
bool addHeader(Platform::String^ name, Platform::String^ value);
#if COM_VISIBLE
bool addPayload(Platform::String^ payload);
#else
bool addPayload(Platform::IntPtr payload, unsigned len);
#endif
bool setActiveMedia(rt_twrap_media_type_t type);
rtActionConfig^ setResponseLine(short code, Platform::String^ phrase);
rtActionConfig^ setMediaString(rt_twrap_media_type_t type, Platform::String^ key, Platform::String^ value);
rtActionConfig^ setMediaInt(rt_twrap_media_type_t type, Platform::String^ key, int value);
internal:
ActionConfig* getWrappedActionConfig(){ return m_pActionConfig; }
private:
ActionConfig* m_pActionConfig;
};
}
}

View File

@ -0,0 +1,31 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#define rtSafeDelete(ptr) if((ptr)) delete (ptr), (ptr) = nullptr;
#if COM_VISIBLE
# define OVERRIDE_FUNC(fun)
# define VISIBLE_VOID_PTR Platform::String^
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) rtString::toUtf8((ptr)).data()
#else
# define OVERRIDE_FUNC(fun) fun
# define VISIBLE_VOID_PTR Platform::IntPtr
# define VISIBLE_VOID_PTR_2_VOID_PTR(ptr) (void*)((ptr))
#endif

View File

@ -0,0 +1,53 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Config.h"
class DDebugCallback;
class DDebugCallbackProxy;
namespace doubango_rt
{
namespace BackEnd
{
public interface class rtIDDebugCallback
{
virtual int OnDebugInfo(Platform::String^ message);
virtual int OnDebugWarn(Platform::String^ message);
virtual int OnDebugError(Platform::String^ message);
virtual int OnDebugFatal(Platform::String^ message);
};
public ref class rtDDebugCallback sealed
{
internal:
rtDDebugCallback(rtIDDebugCallback^ pI);
public:
virtual ~rtDDebugCallback();
friend class DDebugCallbackProxy;
internal:
const DDebugCallback* getWrappedCallback();
private:
rtIDDebugCallback^ m_pI;
DDebugCallbackProxy* m_pCallback;
};
}
}

View File

@ -0,0 +1,331 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_config.h"
#include "tinysip.h"
#include "tinymsrp.h"
#include "tinymedia.h"
#include "Common.h"
namespace doubango_rt
{
namespace BackEnd
{
public enum class rtConstants
{
rt_tsip_event_code_dialog_transport_error = tsip_event_code_dialog_transport_error,
rt_tsip_event_code_dialog_global_error = tsip_event_code_dialog_global_error,
rt_tsip_event_code_dialog_message_error = tsip_event_code_dialog_message_error,
// 8xx ==> success
rt_tsip_event_code_dialog_request_incoming = tsip_event_code_dialog_request_incoming,
rt_tsip_event_code_dialog_request_outgoing = tsip_event_code_dialog_request_outgoing,
rt_tsip_event_code_dialog_request_cancelled = tsip_event_code_dialog_request_cancelled,
rt_tsip_event_code_dialog_request_sent = tsip_event_code_dialog_request_sent,
// 9xx ==> Informational
rt_tsip_event_code_dialog_connecting = tsip_event_code_dialog_connecting,
rt_tsip_event_code_dialog_connected = tsip_event_code_dialog_connected,
rt_tsip_event_code_dialog_terminating = tsip_event_code_dialog_terminating,
rt_tsip_event_code_dialog_terminated = tsip_event_code_dialog_terminated,
rt_tsip_event_code_stack_starting = tsip_event_code_stack_starting,
rt_tsip_event_code_stack_started = tsip_event_code_stack_started,
rt_tsip_event_code_stack_stopping = tsip_event_code_stack_stopping,
rt_tsip_event_code_stack_stopped = tsip_event_code_stack_stopped,
rt_tsip_event_code_stack_failed_to_start = tsip_event_code_stack_failed_to_start,
rt_tsip_event_code_stack_failed_to_stop = tsip_event_code_stack_failed_to_stop
};
public enum class rt_twrap_media_type_t
{
twrap_media_none = twrap_media_none,
twrap_media_audio = twrap_media_audio,
twrap_media_video = twrap_media_video,
twrap_media_msrp = twrap_media_msrp,
twrap_media_t140 = twrap_media_t140,
twrap_media_audio_t140 = twrap_media_audio_t140,
twrap_media_video_t140 = twrap_media_video_t140,
twrap_media_audiovideo = twrap_media_audiovideo, /* @deprecated */
twrap_media_audio_video = twrap_media_audio_video,
twrap_media_audio_video_t140 = twrap_media_audio_video_t140
};
public enum class rt_tmedia_bandwidth_level_t
{
tmedia_bl_low = tmedia_bl_low,
tmedia_bl_medium = tmedia_bl_medium,
tmedia_bl_hight = tmedia_bl_hight,
tmedia_bl_unrestricted = tmedia_bl_unrestricted
};
public enum class rt_tmedia_pref_video_size_t
{
tmedia_pref_video_size_sqcif = tmedia_pref_video_size_sqcif, // 128 x 98
tmedia_pref_video_size_qcif = tmedia_pref_video_size_qcif, // 176 x 144
tmedia_pref_video_size_qvga = tmedia_pref_video_size_qvga, // 320 x 240
tmedia_pref_video_size_cif = tmedia_pref_video_size_cif, // 352 x 288
tmedia_pref_video_size_hvga = tmedia_pref_video_size_hvga, // 480 x 320
tmedia_pref_video_size_vga = tmedia_pref_video_size_vga, // 640 x 480
tmedia_pref_video_size_4cif = tmedia_pref_video_size_4cif, // 704 x 576
tmedia_pref_video_size_svga = tmedia_pref_video_size_svga, // 800 x 600
tmedia_pref_video_size_480p = tmedia_pref_video_size_480p, // 852 x 480
tmedia_pref_video_size_720p = tmedia_pref_video_size_720p, // 1280 x 720
tmedia_pref_video_size_16cif = tmedia_pref_video_size_16cif, // 1408 x 1152
tmedia_pref_video_size_1080p = tmedia_pref_video_size_1080p, // 1920 x 1080
};
public enum class rt_tmedia_profile_t
{
tmedia_profile_default = tmedia_profile_default,
tmedia_profile_rtcweb = tmedia_profile_rtcweb
};
public enum class rt_tmedia_qos_strength_t
{
tmedia_qos_strength_none = tmedia_qos_strength_none,
tmedia_qos_strength_failure = tmedia_qos_strength_failure,
tmedia_qos_strength_unknown = tmedia_qos_strength_unknown,
tmedia_qos_strength_optional = tmedia_qos_strength_optional,
tmedia_qos_strength_mandatory = tmedia_qos_strength_mandatory
};
public enum class rt_tmedia_qos_stype_t
{
tmedia_qos_stype_none = tmedia_qos_stype_none,
tmedia_qos_stype_segmented = tmedia_qos_stype_segmented,
tmedia_qos_stype_e2e = tmedia_qos_stype_e2e,
};
public enum class rt_tmedia_srtp_mode_t
{
tmedia_srtp_mode_none = tmedia_srtp_mode_none,
tmedia_srtp_mode_optional = tmedia_srtp_mode_optional,
tmedia_srtp_mode_mandatory = tmedia_srtp_mode_mandatory
};
public enum class rt_tmedia_srtp_type_t
{
tmedia_srtp_type_none = tmedia_srtp_type_none,
tmedia_srtp_type_sdes = tmedia_srtp_type_sdes,
tmedia_srtp_type_dtls = tmedia_srtp_type_dtls,
tmedia_srtp_type_sdes_dtls = tmedia_srtp_type_sdes_dtls
};
public enum class rt_tmedia_t140_data_type_t
{
tmedia_t140_data_type_utf8 = tmedia_t140_data_type_utf8,
tmedia_t140_data_type_zero_width_no_break_space = tmedia_t140_data_type_zero_width_no_break_space,
tmedia_t140_data_type_backspace = tmedia_t140_data_type_backspace,
tmedia_t140_data_type_esc = tmedia_t140_data_type_esc,
tmedia_t140_data_type_cr = tmedia_t140_data_type_cr,
tmedia_t140_data_type_lf = tmedia_t140_data_type_lf,
tmedia_t140_data_type_cr_lf = tmedia_t140_data_type_cr_lf,
tmedia_t140_data_type_bell = tmedia_t140_data_type_bell,
tmedia_t140_data_type_sos = tmedia_t140_data_type_sos,
tmedia_t140_data_type_string_term = tmedia_t140_data_type_string_term,
tmedia_t140_data_type_graphic_start = tmedia_t140_data_type_graphic_start,
tmedia_t140_data_type_graphic_end = tmedia_t140_data_type_graphic_end,
tmedia_t140_data_type_loss_char_char = tmedia_t140_data_type_loss_char_char,
tmedia_t140_data_type_loss_utf8 = tmedia_t140_data_type_loss_utf8,
};
public enum class rt_tmedia_type_t
{
tmedia_none = tmedia_none,
tmedia_ghost = tmedia_ghost,
tmedia_audio = tmedia_audio,
tmedia_video = tmedia_video,
tmedia_chat = tmedia_chat,
tmedia_file = tmedia_file,
tmedia_t38 = tmedia_t38,
tmedia_t140 = tmedia_t140,
tmedia_msrp = tmedia_msrp,
tmedia_audiovideo = tmedia_audiovideo,
tmedia_all = tmedia_all
};
public enum class rt_tmsrp_event_type_t
{
tmsrp_event_type_none = tmsrp_event_type_none,
tmsrp_event_type_connected = tmsrp_event_type_connected,
tmsrp_event_type_disconnected = tmsrp_event_type_disconnected,
tmsrp_event_type_message = tmsrp_event_type_message,
};
public enum class rt_tmsrp_request_type_t
{
tmsrp_NONE = tmsrp_NONE,
tmsrp_SEND = tmsrp_SEND,
tmsrp_REPORT = tmsrp_REPORT,
tmsrp_AUTH = tmsrp_AUTH
};
public enum class rt_tsip_info_event_type_t
{
tsip_i_info = tsip_i_info,
tsip_ao_info = tsip_ao_info,
};
public enum class rt_tsip_invite_event_type_t
{
tsip_i_newcall = tsip_i_newcall,
tsip_i_request = tsip_i_request,
tsip_ao_request = tsip_ao_request,
tsip_o_ect_trying = tsip_o_ect_trying,
tsip_o_ect_accepted = tsip_o_ect_accepted,
tsip_o_ect_completed = tsip_o_ect_completed,
tsip_o_ect_failed = tsip_o_ect_failed,
tsip_o_ect_notify = tsip_o_ect_notify,
tsip_i_ect_requested = tsip_i_ect_requested,
tsip_i_ect_newcall = tsip_i_ect_newcall,
tsip_i_ect_completed = tsip_i_ect_completed,
tsip_i_ect_failed = tsip_i_ect_failed,
tsip_i_ect_notify = tsip_i_ect_notify,
tsip_m_early_media = tsip_m_early_media,
tsip_m_updating = tsip_m_updating,
tsip_m_updated = tsip_m_updated,
tsip_m_local_hold_ok = tsip_m_local_hold_ok,
tsip_m_local_hold_nok = tsip_m_local_hold_nok,
tsip_m_local_resume_ok = tsip_m_local_resume_ok,
tsip_m_local_resume_nok = tsip_m_local_resume_nok,
tsip_m_remote_hold = tsip_m_remote_hold,
tsip_m_remote_resume = tsip_m_remote_resume,
};
public enum class rt_tsip_message_event_type_t
{
tsip_i_message = tsip_i_message,
tsip_ao_message = tsip_ao_message,
};
public enum class rt_tsip_options_event_type_t
{
tsip_i_options = tsip_i_options,
tsip_ao_options = tsip_ao_options,
};
public enum class rt_tsip_publish_event_type_t
{
tsip_i_publish = tsip_i_publish,
tsip_ao_publish = tsip_ao_publish,
tsip_i_unpublish = tsip_i_unpublish,
tsip_ao_unpublish = tsip_ao_unpublish
};
public enum class rt_tsip_register_event_type_t
{
tsip_i_newreg = tsip_i_newreg,
tsip_i_register = tsip_i_register,
tsip_ao_register = tsip_ao_register,
tsip_i_unregister = tsip_i_unregister,
tsip_ao_unregister = tsip_ao_unregister,
};
public enum class rt_tsip_request_type_t
{
tsip_NONE = tsip_NONE,
tsip_ACK = tsip_ACK,
tsip_BYE = tsip_BYE,
tsip_CANCEL = tsip_CANCEL,
tsip_INVITE = tsip_INVITE,
tsip_OPTIONS = tsip_OPTIONS,
tsip_REGISTER = tsip_REGISTER,
tsip_SUBSCRIBE = tsip_SUBSCRIBE,
tsip_NOTIFY = tsip_NOTIFY,
tsip_REFER = tsip_REFER,
tsip_INFO = tsip_INFO,
tsip_UPDATE = tsip_UPDATE,
tsip_MESSAGE = tsip_MESSAGE,
tsip_PUBLISH = tsip_PUBLISH,
tsip_PRACK = tsip_PRACK
};
public enum class rt_tsip_subscribe_event_type_t
{
tsip_i_subscribe = tsip_i_subscribe,
tsip_ao_subscribe = tsip_ao_subscribe,
tsip_i_unsubscribe = tsip_i_unsubscribe,
tsip_ao_unsubscribe = tsip_ao_unsubscribe,
tsip_i_notify = tsip_i_notify,
tsip_ao_notify = tsip_ao_notify
};
public enum class rt_tdav_codec_id_t
{
tdav_codec_id_none = tmedia_codec_id_none,
tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
tdav_codec_id_gsm = tmedia_codec_id_gsm,
tdav_codec_id_pcma = tmedia_codec_id_pcma,
tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
tdav_codec_id_bv16 = tmedia_codec_id_bv16,
tdav_codec_id_bv32 = tmedia_codec_id_bv32,
tdav_codec_id_opus = tmedia_codec_id_opus,
tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
tdav_codec_id_g722 = tmedia_codec_id_g722,
tdav_codec_id_h261 = tmedia_codec_id_h261,
tdav_codec_id_h263 = tmedia_codec_id_h263,
tdav_codec_id_h263p = tmedia_codec_id_h263p,
tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
tdav_codec_id_theora = tmedia_codec_id_theora,
tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
tdav_codec_id_vp8 = tmedia_codec_id_vp8,
tdav_codec_id_t140 = tmedia_codec_id_t140,
#if !COM_VISIBLE
tdav_codec_id_red = tmedia_codec_id_red,
#endif
tdav_codec_id_all = tmedia_codec_id_all,
};
}
}

View File

@ -0,0 +1,18 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once

View File

@ -0,0 +1,129 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
class MediaSessionMgr;
class Codec;
struct tmedia_codec_s;
struct tmedia_session_mgr_s;
namespace doubango_rt
{
namespace BackEnd
{
enum class rt_twrap_media_type_t;
enum class rt_tmedia_profile_t;
enum class rt_tmedia_srtp_mode_t;
enum class rt_tmedia_srtp_type_t;
enum class rt_tmedia_profile_t;
enum class rt_tmedia_pref_video_size_t;
public ref class rtCodec sealed
{
internal:
rtCodec(struct tmedia_codec_s* pCodec);
public:
virtual ~rtCodec();
enum class rt_twrap_media_type_t getMediaType();
Platform::String^ getName();
Platform::String^ getDescription();
Platform::String^ getNegFormat();
int getAudioSamplingRate();
int getAudioChannels();
int getAudioPTime();
private:
Codec* m_pCodec;
};
public ref class rtMediaSessionMgr sealed
{
internal:
rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr);
public:
virtual ~rtMediaSessionMgr();
bool sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
int32 sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key);
bool consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
bool consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
bool producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value);
bool producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value);
rtCodec^ producerGetCodec(rt_twrap_media_type_t media);
static unsigned int registerAudioPluginFromFile(Platform::String^ path);
uint64 getSessionId(rt_twrap_media_type_t media);
static bool defaultsSetProfile(rt_tmedia_profile_t profile);
static rt_tmedia_profile_t defaultsGetProfile();
static bool defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size);
static bool defaultsSetJbMargin(uint32 jb_margin_ms);
static bool defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent);
static bool defaultsSetEchoTail(uint32 echo_tail);
static uint32 defaultsGetEchoTail();
static bool defaultsSetEchoSkew(uint32 echo_skew);
static bool defaultsSetEchoSuppEnabled(bool echo_supp_enabled);
static bool defaultsGetEchoSuppEnabled();
static bool defaultsSetAgcEnabled(bool agc_enabled);
static bool defaultsGetAgcEnabled();
static bool defaultsSetAgcLevel(float agc_level);
static float defaultsGetAgcLevel();
static bool defaultsSetVadEnabled(bool vad_enabled);
static bool defaultsGetGetVadEnabled();
static bool defaultsSetNoiseSuppEnabled(bool noise_supp_enabled);
static bool defaultsGetNoiseSuppEnabled();
static bool defaultsSetNoiseSuppLevel(int32 noise_supp_level);
static int32 defaultsGetNoiseSuppLevel();
static bool defaultsSet100relEnabled(bool _100rel_enabled);
static bool defaultsGet100relEnabled();
static bool defaultsSetScreenSize(int32 sx, int32 sy);
static bool defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain);
static bool defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop);
static bool defaultsSetRtpSymetricEnabled(bool enabled);
static bool defaultsSetMediaType(enum class rt_twrap_media_type_t media_type);
static bool defaultsSetVolume(int32 volume);
static int32 defaultsGetVolume();
static bool defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher);
static bool defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode);
static enum class rt_tmedia_srtp_mode_t defaultsGetSRtpMode();
static bool defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type);
static enum class rt_tmedia_srtp_type_t defaultsGetSRtpType();
static bool defaultsSetRtcpEnabled(bool enabled);
static bool defaultsGetRtcpEnabled();
static bool defaultsSetRtcpMuxEnabled(bool enabled);
static bool defaultsGetRtcpMuxEnabled();
static bool defaultsSetIceEnabled(bool ice_enabled);
static bool defaultsSetByPassEncoding(bool enabled);
static bool defaultsGetByPassEncoding();
static bool defaultsSetByPassDecoding(bool enabled);
static bool defaultsGetByPassDecoding();
static bool defaultsSetVideoJbEnabled(bool enabled);
static bool defaultsGetVideoJbEnabled(bool enabled);
static bool defaultsSetRtpBuffSize(unsigned buffSize);
static unsigned defaultsGetRtpBuffSize();
static bool defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max);
private:
MediaSessionMgr* m_pMediaSessionMgr;
};
}
}

View File

@ -0,0 +1,109 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Enums.h"
class MsrpCallback;
class MsrpMessage;
class MsrpEvent;
namespace doubango_rt
{
namespace BackEnd
{
ref class rtMsrpSession;
public ref class rtMsrpByteRange sealed
{
internal:
rtMsrpByteRange(int64 start, int64 end, int64 total):_start(start),_end(end),_total(total){}
public:
property int64 Start{ int64 get() { return _start; }; }
property int64 End{ int64 get() { return _end; }; }
property int64 Total{ int64 get() { return _total; }; }
private:
int64 _start, _end, _total;
};
public ref class rtMsrpMessage sealed
{
public:
virtual ~rtMsrpMessage();
internal:
rtMsrpMessage(struct tmsrp_message_s *message);
public:
bool isRequest();
short getCode();
Platform::String^ getPhrase();
rt_tmsrp_request_type_t getRequestType();
#if COM_VISIBLE
rtMsrpByteRange^ getByteRange();
#else
void getByteRange(Platform::IntPtr start, Platform::IntPtr end, Platform::IntPtr total);
#endif
bool isLastChunck();
bool isFirstChunck();
bool isSuccessReport();
Platform::String^ getMsrpHeaderValue(Platform::String^ name);
Platform::String^ getMsrpHeaderParamValue(Platform::String^ name, Platform::String^ param);
unsigned getMsrpContentLength();
#if COM_VISIBLE
Platform::String^ getMsrpContent(unsigned maxsize);
#else
unsigned getMsrpContent(Platform::IntPtr output, unsigned maxsize);
#endif
private:
MsrpMessage* m_pMsrpMessage;
};
public ref class rtMsrpEvent sealed
{
internal:
rtMsrpEvent(const struct tmsrp_event_s *event);
public:
virtual ~rtMsrpEvent();
rt_tmsrp_event_type_t getType();
rtMsrpSession^ getSipSession();
rtMsrpMessage^ getMessage();
private:
MsrpEvent* m_pMsrpEvent;
};
public interface class rtIMsrpCallback
{
virtual int OnEvent(rtMsrpEvent^ pEvent);
};
public ref class rtMsrpCallback sealed
{
internal:
rtMsrpCallback(rtIMsrpCallback^ pI);
const MsrpCallback* getWrappedCallback(){ return m_pCallback; }
public:
virtual ~rtMsrpCallback();
private:
MsrpCallback* m_pCallback;
rtIMsrpCallback^ m_pI;
};
}
}

View File

@ -0,0 +1,18 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once

View File

@ -0,0 +1,70 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
class SipCallback;
class SipCallbackProxy;
namespace doubango_rt
{
namespace BackEnd
{
ref class rtDialogEvent;
ref class rtStackEvent;
ref class rtInviteEvent;
ref class rtMessagingEvent;
ref class rtInfoEvent;
ref class rtOptionsEvent;
ref class rtPublicationEvent;
ref class rtRegistrationEvent;
ref class rtSubscriptionEvent;
public interface class rtISipCallback
{
virtual int OnDialogEvent(rtDialogEvent^ e);
virtual int OnStackEvent(rtStackEvent^ e);
virtual int OnInviteEvent(rtInviteEvent^ e);
virtual int OnMessagingEvent(rtMessagingEvent^ e);
virtual int OnInfoEvent(rtInfoEvent^ e);
virtual int OnOptionsEvent(rtOptionsEvent^ e);
virtual int OnPublicationEvent(rtPublicationEvent^ e);
virtual int OnRegistrationEvent(rtRegistrationEvent^ e);
virtual int OnSubscriptionEvent(rtSubscriptionEvent^ e);
};
public ref class rtSipCallback sealed
{
internal:
rtSipCallback(rtISipCallback^ pI);
public:
virtual ~rtSipCallback();
friend class SipCallbackProxy;
internal:
const SipCallback* getWrappedCallback();
private:
rtISipCallback^ m_pI;
SipCallbackProxy* m_pCallback;
};
}
}

View File

@ -0,0 +1,244 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Config.h"
#include "rt_Enums.h"
struct tsip_event_s;
class SipEvent;
class DialogEvent;
class StackEvent;
class InviteEvent;
class MessagingEvent;
class InfoEvent;
class OptionsEvent;
class PublicationEvent;
class RegistrationEvent;
class SubscriptionEvent;
#define rtISipEvent_Declare() \
virtual short getCode(); \
virtual Platform::String^ getPhrase(); \
virtual rtISipSession^ getBaseSession(); \
virtual rtSipMessage^ getSipMessage(); \
#define rtISipEvent_Implement(cls) \
short cls##::getCode(){ \
return m_pEvent->getCode(); \
} \
Platform::String^ cls##::getPhrase(){ \
return rtString::toString(m_pEvent->getPhrase()); \
} \
rtISipSession^ cls##::getBaseSession(){ \
return ref new rtSipSession(const_cast<SipStack*>(m_pEvent->getStack()), const_cast<tsip_ssession_handle_t*>(m_pEvent->getWrappedEvent()->ss)); \
} \
rtSipMessage^ cls##::getSipMessage(){ \
return ref new rtSipMessage(const_cast<struct tsip_message_s*>(const_cast<SipMessage*>(m_pEvent->getSipMessage())->getWrappedSipMessage())); \
} \
namespace doubango_rt
{
namespace BackEnd
{
interface class rtISipSession;
ref class rtSipMessage;
ref class rtInviteSession;
ref class rtMsrpSession;
ref class rtCallSession;
ref class rtMessagingSession;
ref class rtInfoSession;
ref class rtOptionsSession;
ref class rtPublicationSession;
ref class rtRegistrationSession;
ref class rtSubscriptionSession;
/* ======================== rtISipEvent ========================*/
public interface class rtISipEvent
{
short getCode();
Platform::String^ getPhrase();
rtISipSession^ getBaseSession();
rtSipMessage^ getSipMessage();
};
/* ======================== rtDialogEvent ========================*/
public ref class rtDialogEvent sealed : rtISipEvent
{
internal:
rtDialogEvent(const struct tsip_event_s *e);
public:
virtual ~rtDialogEvent();
rtISipEvent_Declare();
private:
DialogEvent* m_pEvent;
};
/* ======================== rtStackEvent ========================*/
public ref class rtStackEvent sealed : rtISipEvent
{
internal:
rtStackEvent(const struct tsip_event_s *e);
public:
virtual ~rtStackEvent();
rtISipEvent_Declare();
private:
StackEvent* m_pEvent;
};
/* ======================== rtInviteEvent ========================*/
public ref class rtInviteEvent sealed : rtISipEvent
{
internal:
rtInviteEvent(const struct tsip_event_s *e);
public:
virtual ~rtInviteEvent();
rtISipEvent_Declare();
rt_tsip_invite_event_type_t getType();
rt_twrap_media_type_t getMediaType();
rtInviteSession^ getSession();
rtCallSession^ takeCallSessionOwnership();
rtMsrpSession^ takeMsrpSessionOwnership();
private:
InviteEvent* m_pEvent;
};
/* ======================== rtMessagingEvent ========================*/
public ref class rtMessagingEvent sealed : rtISipEvent
{
internal:
rtMessagingEvent(const struct tsip_event_s *e);
public:
virtual ~rtMessagingEvent();
rtISipEvent_Declare();
rt_tsip_message_event_type_t getType();
rtMessagingSession^ getSession();
rtMessagingSession^ takeSessionOwnership();
private:
MessagingEvent* m_pEvent;
};
/* ======================== rtInfoEvent ========================*/
public ref class rtInfoEvent sealed : rtISipEvent
{
internal:
rtInfoEvent(const struct tsip_event_s *e);
public:
virtual ~rtInfoEvent();
rtISipEvent_Declare();
rt_tsip_info_event_type_t getType();
rtInfoSession^ getSession();
rtInfoSession^ takeSessionOwnership();
private:
InfoEvent* m_pEvent;
};
/* ======================== rtOptionsEvent ========================*/
public ref class rtOptionsEvent sealed : rtISipEvent
{
internal:
rtOptionsEvent(const struct tsip_event_s *e);
public:
virtual ~rtOptionsEvent();
rtISipEvent_Declare();
rt_tsip_options_event_type_t getType();
rtOptionsSession^ getSession();
rtOptionsSession^ takeSessionOwnership();
private:
OptionsEvent* m_pEvent;
};
/* ======================== rtPublicationEvent ========================*/
public ref class rtPublicationEvent sealed : rtISipEvent
{
internal:
rtPublicationEvent(const struct tsip_event_s *e);
public:
virtual ~rtPublicationEvent();
rtISipEvent_Declare();
rt_tsip_publish_event_type_t getType();
rtPublicationSession^ getSession();
rtPublicationSession^ takeSessionOwnership();
private:
PublicationEvent* m_pEvent;
};
/* ======================== rtRegistrationEvent ========================*/
public ref class rtRegistrationEvent sealed : rtISipEvent
{
internal:
rtRegistrationEvent(const struct tsip_event_s *e);
public:
virtual ~rtRegistrationEvent();
rtISipEvent_Declare();
rt_tsip_register_event_type_t getType();
rtRegistrationSession^ getSession();
rtRegistrationSession^ takeSessionOwnership();
private:
RegistrationEvent* m_pEvent;
};
/* ======================== rtSubscriptionEvent ========================*/
public ref class rtSubscriptionEvent sealed : rtISipEvent
{
internal:
rtSubscriptionEvent(const struct tsip_event_s *e);
public:
virtual ~rtSubscriptionEvent();
rtISipEvent_Declare();
rt_tsip_subscribe_event_type_t getType();
rtSubscriptionSession^ getSession();
rtSubscriptionSession^ takeSessionOwnership();
private:
SubscriptionEvent* m_pEvent;
};
}
}

View File

@ -0,0 +1,78 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Enums.h"
class SdpMessage;
class SipMessage;
struct tsdp_message_s;
struct tsip_message_s;
namespace doubango_rt
{
namespace BackEnd
{
public ref class rtSdpMessage sealed
{
internal:
rtSdpMessage();
rtSdpMessage(struct tsdp_message_s *message);
public:
virtual ~rtSdpMessage();
public:
Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name, unsigned index);
Platform::String^ getSdpHeaderValue(Platform::String^ media, Platform::String^ name);
Platform::String^ getSdpHeaderAValue(Platform::String^ media, Platform::String^ attributeName);
private:
SdpMessage* m_pSdpMessage;
};
public ref class rtSipMessage sealed
{
internal:
rtSipMessage();
rtSipMessage(struct tsip_message_s* message);
public:
virtual ~rtSipMessage();
public:
bool isResponse();
rt_tsip_request_type_t getRequestType();
short getResponseCode();
Platform::String^ getResponsePhrase();
Platform::String^ getSipHeaderValue(Platform::String^ name, unsigned index);
Platform::String^ getSipHeaderValue(Platform::String^ name);
Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param, unsigned index);
Platform::String^ getSipHeaderParamValue(Platform::String^ name, Platform::String^ param);
unsigned getSipContentLength();
#if COM_VISIBLE
Platform::String^ getSipContent();
#else
unsigned getSipContent(Platform::IntPtr output, unsigned maxsize);
#endif
rtSdpMessage^ getSdpMessage();
private:
SipMessage* m_pSipMessage;
};
}
}

View File

@ -0,0 +1,506 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Config.h"
#include "rt_SipStack.h"
#include "rt_SipUri.h"
#include "rt_String.h"
#include "rt_ActionConfig.h"
#include "rt_MediaSessionMgr.h"
#include "tinysip.h"
class SipSession;
class InviteSession;
class CallSession;
class MsrpSession;
class MessagingSession;
class InfoSession;
class OptionsSession;
class PublicationSession;
class RegistrationSession;
class SubscriptionSession;
class SipStack;
class T140CallbackData;
class T140Callback;
// error C4585: 'doubango_rt::rtSipSession' : A WinRT 'public ref class' must either be sealed or derive from an existing unsealed class
#define rtISession_Declare() \
virtual unsigned getId(); \
virtual bool haveOwnership(); \
virtual bool addHeader(Platform::String^ name, Platform::String^ value); \
virtual bool removeHeader(Platform::String^ name); \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool addCaps(Platform::String^ name, Platform::String^ value); \
OVERRIDE_FUNC(virtual bool addCaps(Platform::String^ name);) \
virtual bool removeCaps(Platform::String^ name); \
virtual bool setExpires(unsigned expires); \
OVERRIDE_FUNC(virtual bool setFromUri(Platform::String^ fromUriString);) \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool setFromUri(rtSipUri^ fromUri); \
OVERRIDE_FUNC(virtual bool setToUri(Platform::String^ toUriString);) \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool setToUri(rtSipUri^ toUri); \
virtual bool setSilentHangup(bool silent); \
virtual bool addSigCompCompartment(Platform::String^ compId); \
virtual bool removeSigCompCompartment(); \
#define rtISession_Implement(cls) \
unsigned cls##::getId(){ \
return m_pSipSession->getId(); \
} \
bool cls##::haveOwnership(){ \
return m_pSipSession->haveOwnership(); \
} \
bool cls##::addHeader(Platform::String^ name, Platform::String^ value){ \
return m_pSipSession->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data()); \
} \
bool cls##::removeHeader(Platform::String^ name){ \
return m_pSipSession->removeHeader(rtString::toUtf8(name).data()); \
} \
bool cls##::addCaps(Platform::String^ name, Platform::String^ value){ \
return m_pSipSession->addCaps(rtString::toUtf8(name).data(), rtString::toUtf8(value).data()); \
} \
OVERRIDE_FUNC(bool cls##::addCaps(Platform::String^ name){ \
return addCaps(name, nullptr); \
}) \
bool cls##::removeCaps(Platform::String^ name){ \
return m_pSipSession->removeCaps(rtString::toUtf8(name).data()); \
} \
bool cls##::setExpires(unsigned expires){ \
return m_pSipSession->setExpires(expires); \
} \
OVERRIDE_FUNC(bool cls##::setFromUri(Platform::String^ fromUriString){ \
return m_pSipSession->setFromUri(rtString::toUtf8(fromUriString).data()); \
}) \
bool cls##::setFromUri(rtSipUri^ fromUri){ \
return m_pSipSession->setFromUri(fromUri->getWrappedUri()); \
} \
OVERRIDE_FUNC(bool cls##::setToUri(Platform::String^ toUriString){ \
return m_pSipSession->setToUri(rtString::toUtf8(toUriString).data()); \
}) \
bool cls##::setToUri(rtSipUri^ toUri){ \
return m_pSipSession->setToUri(toUri->getWrappedUri()); \
} \
bool cls##::setSilentHangup(bool silent){ \
return m_pSipSession->setSilentHangup(silent); \
} \
bool cls##::addSigCompCompartment(Platform::String^ compId){ \
return m_pSipSession->addSigCompCompartment(rtString::toUtf8(compId).data()); \
} \
bool cls##::removeSigCompCompartment(){ \
return m_pSipSession->removeSigCompCompartment(); \
}\
#define rtIInviteSession_Declare() \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool accept(rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool accept();) \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool hangup(rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool hangup();) \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool reject(rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool reject();) \
[Windows::Foundation::Metadata::DefaultOverload] \
virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len, rtActionConfig^ config); \
OVERRIDE_FUNC(virtual bool sendInfo(VISIBLE_VOID_PTR payload, unsigned len);) \
virtual rtMediaSessionMgr^ getMediaMgr(); \
#define rtIInviteSession_Implement(cls) \
bool cls##::accept(rtActionConfig^ config){ \
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null); \
} \
OVERRIDE_FUNC(bool cls##::accept(){ \
return accept(nullptr); \
}) \
bool cls##::hangup(rtActionConfig^ config){ \
return m_pSipSession->hangup(config ? config->getWrappedActionConfig() : tsk_null); \
} \
OVERRIDE_FUNC(bool cls##::hangup(){ \
return hangup(nullptr); \
}) \
bool cls##::reject(rtActionConfig^ config){ \
return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null); \
} \
OVERRIDE_FUNC(bool cls##::reject(){ \
return reject(nullptr); \
}) \
bool cls##::sendInfo(VISIBLE_VOID_PTR payload, unsigned len, rtActionConfig^ config){ \
return m_pSipSession->sendInfo(VISIBLE_VOID_PTR_2_VOID_PTR(payload), len, config ? config->getWrappedActionConfig() : tsk_null); \
} \
OVERRIDE_FUNC(bool cls##::sendInfo(VISIBLE_VOID_PTR payload, unsigned len){ \
return sendInfo(payload, len, nullptr); \
}) \
rtMediaSessionMgr^ cls##::getMediaMgr(){ \
if(m_pSipSession->getMediaMgr()){ \
return ref new rtMediaSessionMgr(const_cast<struct tmedia_session_mgr_s*>(m_pSipSession->getMediaMgr()->getWrappedMgr())); \
} \
return nullptr; \
} \
namespace doubango_rt
{
namespace BackEnd
{
ref class rtMsrpCallback;
interface class rtIMsrpCallback;
/* ======================== rtT140CallbackData ========================*/
public ref class rtT140CallbackData sealed
{
internal:
rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size);
public:
virtual ~rtT140CallbackData();
private:
T140CallbackData* m_pData;
};
/* ======================== rtT140Callback ========================*/
public interface class rtIT140Callback
{
virtual int ondata(rtT140CallbackData^ pData);
};
public ref class rtT140Callback sealed
{
internal:
rtT140Callback();
const T140Callback* getWrappedCallback(){ return m_pCallback; }
public:
rtT140Callback(rtIT140Callback^ pI)
{
m_pI = pI;
}
virtual ~rtT140Callback();
protected:
virtual int ondata(rtT140CallbackData^ pData){
if(m_pI)
{
return m_pI->ondata(pData);
}
return 0;
}
private:
T140Callback* m_pCallback;
rtIT140Callback^ m_pI;
};
/* ======================== rtISipSession ========================*/
public interface class rtISipSession
{
rtISession_Declare();
};
/* ======================== rtIInviteSession ========================*/
public interface class rtIInviteSession : rtISipSession
{
rtIInviteSession_Declare();
};
/* ======================== rtSipSession ========================*/
public ref class rtSipSession sealed: rtISipSession
{
public:
rtSipSession(rtSipStack^ pStack);
virtual ~rtSipSession();
internal:
rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
SipSession* getWrappedSession(){ return m_pSipSession; }
public:
rtISession_Declare();
private:
SipSession* m_pSipSession;
};
/* ======================== rtInviteSession ========================*/
public ref class rtInviteSession sealed: rtIInviteSession
{
public:
rtInviteSession(rtSipStack^ pStack);
virtual ~rtInviteSession();
internal:
rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
InviteSession* getWrappedSession(){ return m_pSipSession; }
public:
rtISession_Declare();
rtIInviteSession_Declare();
private:
InviteSession* m_pSipSession;
};
/* ======================== CallSession ========================*/
public ref class rtCallSession sealed : rtIInviteSession
{
public:
rtCallSession(rtSipStack^ pStack);
virtual ~rtCallSession();
internal:
rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
CallSession* getWrappedSession(){ return m_pSipSession; }
public:
rtISession_Declare();
rtIInviteSession_Declare();
[Windows::Foundation::Metadata::DefaultOverload]
bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config);
[Windows::Foundation::Metadata::DefaultOverload]
bool call(Platform::String^ remoteUriString, rt_twrap_media_type_t media);
bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config);
bool call(rtSipUri^ remoteUri, rt_twrap_media_type_t media);
bool setSessionTimer(unsigned timeout, Platform::String^ refresher);
bool set100rel(bool enabled);
bool setRtcp(bool enabled);
bool setRtcpMux(bool enabled);
bool setICE(bool enabled);
bool setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength);
bool hold(rtActionConfig^ config);
bool hold();
bool resume(rtActionConfig^ config);
bool resume();
bool transfer(Platform::String^ referToUriString, rtActionConfig^ config);
bool transfer(Platform::String^ referToUriString);
bool acceptTransfer(rtActionConfig^ config);
bool acceptTransfer();
bool rejectTransfer(rtActionConfig^ config);
bool rejectTransfer();
bool sendDTMF(int number);
unsigned getSessionTransferId();
#if COM_VISIBLE
bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::String^ data);
#else
bool sendT140Data(rt_tmedia_t140_data_type_t data_type, Platform::IntPtr data_ptr, unsigned data_size);
#endif
bool sendT140Data(rt_tmedia_t140_data_type_t data_type);
bool setT140Callback(rtT140Callback^ pT140Callback);
private:
CallSession* m_pSipSession;
};
/* ======================== rtMsrpSession ========================*/
public ref class rtMsrpSession sealed : rtIInviteSession
{
public:
rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback);
virtual ~rtMsrpSession();
internal:
rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
MsrpSession* getWrappedSession(){ return m_pSipSession; }
public:
rtISession_Declare();
rtIInviteSession_Declare();
bool setCallback(rtIMsrpCallback^ pCallback);
[Windows::Foundation::Metadata::DefaultOverload]
bool callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config);
[Windows::Foundation::Metadata::DefaultOverload]
bool callMsrp(Platform::String^ remoteUriString);
bool callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config);
bool callMsrp(rtSipUri^ remoteUri);
#if COM_VISIBLE
bool sendMessage(Platform::String^ payload, rtActionConfig^ config);
bool sendMessage(Platform::String^ payload);
#else
bool sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
bool sendMessage(Platform::IntPtr payload, unsigned len);
#endif
private:
MsrpSession* m_pSipSession;
rtMsrpCallback^ m_pCallback;
};
/* ======================== rtMessagingSession ========================*/
public ref class rtMessagingSession sealed : rtISipSession
{
internal:
rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtMessagingSession(rtSipStack^ pStack);
virtual ~rtMessagingSession();
rtISession_Declare();
#if COM_VISIBLE
bool send(Platform::String^ payload, rtActionConfig^ config);
bool send(Platform::String^ payload);
#else
[Windows::Foundation::Metadata::DefaultOverload]
bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
bool send(Platform::IntPtr payload, unsigned len);
#endif
[Windows::Foundation::Metadata::DefaultOverload]
bool accept(rtActionConfig^ config);
bool accept();
[Windows::Foundation::Metadata::DefaultOverload]
bool reject(rtActionConfig^ config);
bool reject();
private:
MessagingSession* m_pSipSession;
};
/* ======================== rtInfoSession ========================*/
public ref class rtInfoSession sealed : rtISipSession
{
internal:
rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtInfoSession(rtSipStack^ pStack);
virtual ~rtInfoSession();
rtISession_Declare();
#if COM_VISIBLE
bool send(Platform::String^ payload, rtActionConfig^ config);
bool send(Platform::String^ payload);
#else
[Windows::Foundation::Metadata::DefaultOverload]
bool send(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
bool send(Platform::IntPtr payload, unsigned len);
#endif
[Windows::Foundation::Metadata::DefaultOverload]
bool accept(rtActionConfig^ config);
bool accept();
[Windows::Foundation::Metadata::DefaultOverload]
bool reject(rtActionConfig^ config);
bool reject();
private:
InfoSession* m_pSipSession;
};
/* ======================== rtOptionsSession ========================*/
public ref class rtOptionsSession sealed : rtISipSession
{
internal:
rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtOptionsSession(rtSipStack^ pStack);
virtual ~rtOptionsSession();
rtISession_Declare();
[Windows::Foundation::Metadata::DefaultOverload]
bool send(rtActionConfig^ config);
bool send();
[Windows::Foundation::Metadata::DefaultOverload]
bool accept(rtActionConfig^ config);
bool accept();
[Windows::Foundation::Metadata::DefaultOverload]
bool reject(rtActionConfig^ config);
bool reject();
private:
OptionsSession* m_pSipSession;
};
/* ======================== rtPublicationSession ========================*/
public ref class rtPublicationSession sealed : rtISipSession
{
internal:
rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtPublicationSession(rtSipStack^ pStack);
virtual ~rtPublicationSession();
rtISession_Declare();
#if COM_VISIBLE
bool publish(Platform::String^ payload, rtActionConfig^ config);
bool publish(Platform::String^ payload);
#else
[Windows::Foundation::Metadata::DefaultOverload]
bool publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config);
bool publish(Platform::IntPtr payload, unsigned len);
#endif
[Windows::Foundation::Metadata::DefaultOverload]
bool unPublish(rtActionConfig^ config);
bool unPublish();
private:
PublicationSession* m_pSipSession;
};
/* ======================== rtRegistrationSession ========================*/
public ref class rtRegistrationSession sealed : rtISipSession
{
internal:
rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtRegistrationSession(rtSipStack^ pStack);
virtual ~rtRegistrationSession();
rtISession_Declare();
bool register_(rtActionConfig^ config);
bool register_();
bool unRegister(rtActionConfig^ config);
bool unRegister();
bool accept(rtActionConfig^ config);
bool accept();
bool reject(rtActionConfig^ config);
bool reject();
private:
RegistrationSession* m_pSipSession;
};
/* ======================== rtSubscriptionSession ========================*/
public ref class rtSubscriptionSession sealed : rtISipSession
{
internal:
rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle);
public:
rtSubscriptionSession(rtSipStack^ pStack);
virtual ~rtSubscriptionSession();
rtISession_Declare();
bool subscribe();
bool unSubscribe();
private:
SubscriptionSession* m_pSipSession;
};
}
}

View File

@ -0,0 +1,120 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include <mutex>
class SipStack;
namespace doubango_rt
{
namespace BackEnd
{
ref class rtSipCallback;
interface class rtISipCallback;
ref class rtDDebugCallback;
interface class rtIDDebugCallback;
enum class rt_tdav_codec_id_t;
public ref class rtDnsResult sealed
{
internal:
rtDnsResult(uint16 port, Platform::String^ address):_port(port), _address(address){}
public:
property uint16 Port{ uint16 get() { return _port; }; }
property Platform::String^ Address{ Platform::String^ get() { return _address; }; }
private:
uint16 _port;
Platform::String^ _address;
};
public ref class rtSipStack sealed
{
public:
virtual ~rtSipStack();
internal:
rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri);
const SipStack* getWrappedStack() { return m_pSipStack; }
public:
bool start();
bool setDebugCallback(rtIDDebugCallback^ pCallback);
bool setDisplayName(Platform::String^ display_name);
bool setRealm(Platform::String^ realm_uri);
bool setIMPI(Platform::String^ impi);
bool setIMPU(Platform::String^ impu_uri);
bool setPassword(Platform::String^ password);
bool setAMF(Platform::String^ amf);
bool setOperatorId(Platform::String^ opid);
bool setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion);
bool setLocalIP(Platform::String^ ip, Platform::String^ transport);
bool setLocalIP(Platform::String^ ip);
bool setLocalPort(unsigned short port, Platform::String^ transport);
bool setLocalPort(unsigned short port);
bool setEarlyIMS(bool enabled);
bool addHeader(Platform::String^ name, Platform::String^ value);
bool removeHeader(Platform::String^ name);
bool addDnsServer(Platform::String^ ip);
bool setDnsDiscovery(bool enabled);
bool setAoR(Platform::String^ ip, int port);
bool setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict);
bool addSigCompCompartment(Platform::String^ compId);
bool removeSigCompCompartment(Platform::String^ compId);
bool setSTUNServer(Platform::String^ ip, unsigned short port);
bool setSTUNCred(Platform::String^ login, Platform::String^ password);
bool setTLSSecAgree(bool enabled);
bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify);
bool setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey);
bool setIPSecSecAgree(bool enabled);
bool setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto);
Platform::String^ dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain);
#if COM_VISIBLE
rtDnsResult^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service);
rtDnsResult^ dnsSrv(Platform::String^ service);
Platform::String^ getLocalIP(Platform::String^ protocol);
uint16 getLocalPort(Platform::String^ protocol);
#else
Platform::String^ dnsNaptrSrv(Platform::String^ domain, Platform::String^ service, Platform::IntPtr port);
Platform::String^ dnsSrv(Platform::String^ service, Platform::IntPtr port);
Platform::String^ getLocalIPnPort(Platform::String^ protocol, Platform::IntPtr port);
#endif
Platform::String^ getPreferredIdentity();
bool isValid();
bool stop();
static bool initialize();
static bool deInitialize();
static void setCodecs(enum class rt_tdav_codec_id_t codecs);
static bool setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority);
static bool isCodecSupported(enum class rt_tdav_codec_id_t codec_id);
private:
SipStack* m_pSipStack;
rtSipCallback^ m_pSipCallback;
rtDDebugCallback^ m_pDebugCallback;
std::recursive_mutex mLock;
};
}
}

View File

@ -0,0 +1,60 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include "rt_Config.h"
class SipUri;
namespace doubango_rt
{
namespace BackEnd
{
public ref class rtSipUri sealed
{
public:
virtual ~rtSipUri();
rtSipUri(Platform::String^ uriString, Platform::String^ displayName);
rtSipUri(Platform::String^ uriString);
public:
static bool isValid(Platform::String^ uri);
#if COM_VISIBLE
bool isValid_();
#else
bool isValid();
#endif
Platform::String^ getScheme();
Platform::String^ getHost();
unsigned short getPort();
Platform::String^ getUserName();
Platform::String^ getPassword();
Platform::String^ getDisplayName();
Platform::String^ getParamValue(Platform::String^ name);
void setDisplayName(Platform::String^ displayName);
internal:
const SipUri* getWrappedUri(){ return m_pSipUri; }
private:
SipUri* m_pSipUri;
};
}
}

View File

@ -0,0 +1,33 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once
#include <vector>
namespace doubango_rt
{
namespace BackEnd
{
ref class rtString sealed
{
internal:
static std::vector<char> toUtf8(Platform::String^ str);
static Platform::String^ toString(char const* str);
};
}
}

View File

@ -0,0 +1,18 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#pragma once

View File

@ -0,0 +1,76 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_ActionConfig.h"
#include "rt_String.h"
#include "ActionConfig.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
rtActionConfig::rtActionConfig()
{
m_pActionConfig = new ActionConfig();
}
rtActionConfig::~rtActionConfig()
{
rtSafeDelete(m_pActionConfig);
}
bool rtActionConfig::addHeader(String^ name, String^ value)
{
return m_pActionConfig->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtActionConfig::setActiveMedia(rt_twrap_media_type_t type)
{
return m_pActionConfig->setActiveMedia((twrap_media_type_t)type);
}
#if COM_VISIBLE
bool rtActionConfig::addPayload(Platform::String^ payload)
{
static std::vector<char> _payload = rtString::toUtf8(payload);
return m_pActionConfig->addPayload(_payload.data(), _payload.size());
}
#else
bool rtActionConfig::addPayload(IntPtr payload, unsigned len)
{
return m_pActionConfig->addPayload((const void*)payload, len);
}
#endif /* COM_VISIBLE */
rtActionConfig^ rtActionConfig::setResponseLine(short code, String^ phrase)
{
m_pActionConfig->setResponseLine(code, rtString::toUtf8(phrase).data());
return this;
}
rtActionConfig^ rtActionConfig::setMediaString(rt_twrap_media_type_t type, String^ key, String^ value)
{
m_pActionConfig->setMediaString((twrap_media_type_t)type, rtString::toUtf8(key).data(), rtString::toUtf8(value).data());
return this;
}
rtActionConfig^ rtActionConfig::setMediaInt(rt_twrap_media_type_t type, String^ key, int value)
{
m_pActionConfig->setMediaInt((twrap_media_type_t)type, rtString::toUtf8(key).data(), value);
return this;
}

View File

@ -0,0 +1,78 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_DDebug.h"
#include "rt_String.h"
#include "DDebug.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
class DDebugCallbackProxy : public DDebugCallback
{
public:
DDebugCallbackProxy(rtDDebugCallback^ pCallback)
{
m_pCallback = pCallback;
}
~DDebugCallbackProxy()
{
}
virtual int OnDebugInfo(const char* message)
{
return m_pCallback->m_pI->OnDebugInfo(rtString::toString(message));
}
virtual int OnDebugWarn(const char* message)
{
return m_pCallback->m_pI->OnDebugWarn(rtString::toString(message));
}
virtual int OnDebugError(const char* message)
{
return m_pCallback->m_pI->OnDebugError(rtString::toString(message));
}
virtual int OnDebugFatal(const char* message)
{
return m_pCallback->m_pI->OnDebugFatal(rtString::toString(message));
}
private:
rtDDebugCallback^ m_pCallback;
};
rtDDebugCallback::rtDDebugCallback(rtIDDebugCallback^ pI)
{
m_pI = pI;
m_pCallback = new DDebugCallbackProxy(this);
}
rtDDebugCallback::~rtDDebugCallback()
{
rtSafeDelete(m_pCallback);
}
const DDebugCallback* rtDDebugCallback::getWrappedCallback()
{
return dynamic_cast<const DDebugCallback*>(m_pCallback);
}

View File

@ -0,0 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/#include "rt_enums.h"

View File

@ -0,0 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/

View File

@ -0,0 +1,374 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_MediaSessionMgr.h"
#include "rt_Enums.h"
#include "rt_String.h"
#include "MediaSessionMgr.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
rtCodec::rtCodec(struct tmedia_codec_s* pCodec)
{
m_pCodec = new Codec(pCodec);
}
rtCodec::~rtCodec()
{
rtSafeDelete(m_pCodec);
}
enum class rt_twrap_media_type_t rtCodec::getMediaType()
{
return (rt_twrap_media_type_t)m_pCodec->getMediaType();
}
Platform::String^ rtCodec::getName()
{
return rtString::toString(m_pCodec->getName());
}
Platform::String^ rtCodec::getDescription()
{
return rtString::toString(m_pCodec->getDescription());
}
Platform::String^ rtCodec::getNegFormat()
{
return rtString::toString(m_pCodec->getNegFormat());
}
int rtCodec::getAudioSamplingRate()
{
return m_pCodec->getAudioSamplingRate();
}
int rtCodec::getAudioChannels()
{
return m_pCodec->getAudioChannels();
}
int rtCodec::getAudioPTime()
{
return m_pCodec->getAudioPTime();
}
rtMediaSessionMgr::rtMediaSessionMgr(struct tmedia_session_mgr_s* pWrappedMgr)
{
m_pMediaSessionMgr = new MediaSessionMgr(pWrappedMgr);
}
rtMediaSessionMgr::~rtMediaSessionMgr()
{
rtSafeDelete(m_pMediaSessionMgr);
}
bool rtMediaSessionMgr::sessionSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->sessionSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
int32 rtMediaSessionMgr::sessionGetInt32(rt_twrap_media_type_t media, Platform::String^ key)
{
return m_pMediaSessionMgr->sessionGetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data());
}
bool rtMediaSessionMgr::consumerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->consumerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::consumerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
return m_pMediaSessionMgr->consumerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt32(rt_twrap_media_type_t media, Platform::String^ key, int32 value)
{
return m_pMediaSessionMgr->producerSetInt32((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
bool rtMediaSessionMgr::producerSetInt64(rt_twrap_media_type_t media, Platform::String^ key, int64 value)
{
return m_pMediaSessionMgr->producerSetInt64((twrap_media_type_t)media, rtString::toUtf8(key).data(), value);
}
rtCodec^ rtMediaSessionMgr::producerGetCodec(rt_twrap_media_type_t media)
{
Codec* c = m_pMediaSessionMgr->producerGetCodec((twrap_media_type_t)media);
if(c)
{
rtCodec^ codec = ref new rtCodec(const_cast<struct tmedia_codec_s*>(c->getWrappedCodec()));
rtSafeDelete(c);
return codec;
}
return nullptr;
}
unsigned int rtMediaSessionMgr::registerAudioPluginFromFile(Platform::String^ path)
{
return MediaSessionMgr::registerAudioPluginFromFile(rtString::toUtf8(path).data());
}
uint64 rtMediaSessionMgr::getSessionId(rt_twrap_media_type_t media)
{
return m_pMediaSessionMgr->getSessionId((twrap_media_type_t)media);
}
bool rtMediaSessionMgr::defaultsSetProfile(rt_tmedia_profile_t profile)
{
return MediaSessionMgr::defaultsSetProfile((tmedia_profile_t) profile);
}
rt_tmedia_profile_t rtMediaSessionMgr::defaultsGetProfile()
{
return (rt_tmedia_profile_t)MediaSessionMgr::defaultsGetProfile();
}
bool rtMediaSessionMgr::defaultsSetPrefVideoSize(enum class rt_tmedia_pref_video_size_t pref_video_size)
{
return MediaSessionMgr::defaultsSetPrefVideoSize((tmedia_pref_video_size_t) pref_video_size);
}
bool rtMediaSessionMgr::defaultsSetJbMargin(uint32 jb_margin_ms)
{
return MediaSessionMgr::defaultsSetJbMargin(jb_margin_ms);
}
bool rtMediaSessionMgr::defaultsSetJbMaxLateRate(uint32 jb_late_rate_percent)
{
return MediaSessionMgr::defaultsSetJbMaxLateRate(jb_late_rate_percent);
}
bool rtMediaSessionMgr::defaultsSetEchoTail(uint32 echo_tail)
{
return MediaSessionMgr::defaultsSetEchoTail(echo_tail);
}
uint32 rtMediaSessionMgr::defaultsGetEchoTail()
{
return MediaSessionMgr::defaultsGetEchoTail();
}
bool rtMediaSessionMgr::defaultsSetEchoSkew(uint32 echo_skew)
{
return MediaSessionMgr::defaultsSetEchoSkew(echo_skew);
}
bool rtMediaSessionMgr::defaultsSetEchoSuppEnabled(bool echo_supp_enabled)
{
return MediaSessionMgr::defaultsSetEchoSuppEnabled(echo_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetEchoSuppEnabled()
{
return MediaSessionMgr::defaultsGetEchoSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcEnabled(bool agc_enabled)
{
return MediaSessionMgr::defaultsSetAgcEnabled(agc_enabled);
}
bool rtMediaSessionMgr::defaultsGetAgcEnabled()
{
return MediaSessionMgr::defaultsGetAgcEnabled();
}
bool rtMediaSessionMgr::defaultsSetAgcLevel(float agc_level)
{
return MediaSessionMgr::defaultsSetAgcLevel(agc_level);
}
float rtMediaSessionMgr::defaultsGetAgcLevel()
{
return MediaSessionMgr::defaultsGetAgcLevel();
}
bool rtMediaSessionMgr::defaultsSetVadEnabled(bool vad_enabled)
{
return MediaSessionMgr::defaultsSetVadEnabled(vad_enabled);
}
bool rtMediaSessionMgr::defaultsGetGetVadEnabled()
{
return MediaSessionMgr::defaultsGetGetVadEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppEnabled(bool noise_supp_enabled)
{
return MediaSessionMgr::defaultsSetNoiseSuppEnabled(noise_supp_enabled);
}
bool rtMediaSessionMgr::defaultsGetNoiseSuppEnabled()
{
return MediaSessionMgr::defaultsGetNoiseSuppEnabled();
}
bool rtMediaSessionMgr::defaultsSetNoiseSuppLevel(int32 noise_supp_level)
{
return MediaSessionMgr::defaultsSetNoiseSuppLevel(noise_supp_level);
}
int32 rtMediaSessionMgr::defaultsGetNoiseSuppLevel()
{
return MediaSessionMgr::defaultsGetNoiseSuppLevel();
}
bool rtMediaSessionMgr::defaultsSet100relEnabled(bool _100rel_enabled)
{
return MediaSessionMgr::defaultsSet100relEnabled(_100rel_enabled);
}
bool rtMediaSessionMgr::defaultsGet100relEnabled()
{
return MediaSessionMgr::defaultsGet100relEnabled();
}
bool rtMediaSessionMgr::defaultsSetScreenSize(int32 sx, int32 sy)
{
return MediaSessionMgr::defaultsSetScreenSize(sx, sy);
}
bool rtMediaSessionMgr::defaultsSetAudioGain(int32 producer_gain, int32 consumer_gain)
{
return MediaSessionMgr::defaultsSetAudioGain(producer_gain, consumer_gain);
}
bool rtMediaSessionMgr::defaultsSetRtpPortRange(uint16 range_start, uint16 range_stop)
{
return MediaSessionMgr::defaultsSetRtpPortRange(range_start, range_stop);
}
bool rtMediaSessionMgr::defaultsSetRtpSymetricEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtpSymetricEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsSetMediaType(enum class rt_twrap_media_type_t media_type)
{
return MediaSessionMgr::defaultsSetMediaType((twrap_media_type_t) media_type);
}
bool rtMediaSessionMgr::defaultsSetVolume(int32 volume)
{
return MediaSessionMgr::defaultsSetVolume(volume);
}
int32 rtMediaSessionMgr::defaultsGetVolume()
{
return MediaSessionMgr::defaultsGetVolume();
}
bool rtMediaSessionMgr::defaultsSetInviteSessionTimers(int32 timeout, Platform::String^ refresher)
{
return MediaSessionMgr::defaultsSetInviteSessionTimers(timeout, rtString::toUtf8(refresher).data());
}
bool rtMediaSessionMgr::defaultsSetSRtpMode(enum class rt_tmedia_srtp_mode_t mode)
{
return MediaSessionMgr::defaultsSetSRtpMode((tmedia_srtp_mode_t) mode);
}
enum class rt_tmedia_srtp_mode_t rtMediaSessionMgr::defaultsGetSRtpMode()
{
return (rt_tmedia_srtp_mode_t)MediaSessionMgr::defaultsGetSRtpMode();
}
bool rtMediaSessionMgr::defaultsSetSRtpType(enum class rt_tmedia_srtp_type_t srtp_type)
{
return MediaSessionMgr::defaultsSetSRtpType((tmedia_srtp_type_t) srtp_type);
}
enum class rt_tmedia_srtp_type_t rtMediaSessionMgr::defaultsGetSRtpType()
{
return (rt_tmedia_srtp_type_t)MediaSessionMgr::defaultsGetSRtpType();
}
bool rtMediaSessionMgr::defaultsSetRtcpEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtcpEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpEnabled()
{
return MediaSessionMgr::defaultsGetRtcpEnabled();
}
bool rtMediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetRtcpMuxEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetRtcpMuxEnabled()
{
return MediaSessionMgr::defaultsGetRtcpMuxEnabled();
}
bool rtMediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled)
{
return MediaSessionMgr::defaultsSetIceEnabled(ice_enabled);
}
bool rtMediaSessionMgr::defaultsSetByPassEncoding(bool enabled)
{
return MediaSessionMgr::defaultsSetByPassEncoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassEncoding()
{
return MediaSessionMgr::defaultsGetByPassEncoding();
}
bool rtMediaSessionMgr::defaultsSetByPassDecoding(bool enabled)
{
return MediaSessionMgr::defaultsSetByPassDecoding(enabled);
}
bool rtMediaSessionMgr::defaultsGetByPassDecoding()
{
return MediaSessionMgr::defaultsGetByPassDecoding();
}
bool rtMediaSessionMgr::defaultsSetVideoJbEnabled(bool enabled)
{
return MediaSessionMgr::defaultsSetVideoJbEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsGetVideoJbEnabled(bool enabled)
{
return MediaSessionMgr::defaultsGetVideoJbEnabled(enabled);
}
bool rtMediaSessionMgr::defaultsSetRtpBuffSize(unsigned buffSize)
{
return MediaSessionMgr::defaultsSetRtpBuffSize(buffSize);
}
unsigned rtMediaSessionMgr::defaultsGetRtpBuffSize()
{
return MediaSessionMgr::defaultsGetRtpBuffSize();
}
bool rtMediaSessionMgr::defaultsSetAvpfTail(unsigned tail_min, unsigned tail_max)
{
return MediaSessionMgr::defaultsSetAvpfTail(tail_min, tail_max);
}

View File

@ -0,0 +1,194 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_Msrp.h"
#include "rt_String.h"
#include "rt_SipSession.h"
#include "SipSession.h"
#include "Msrp.h"
#include <assert.h>
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
//
// rtMsrpMessage
//
rtMsrpMessage::rtMsrpMessage(struct tmsrp_message_s *message)
{
m_pMsrpMessage= new MsrpMessage(message);
}
rtMsrpMessage::~rtMsrpMessage()
{
rtSafeDelete(m_pMsrpMessage);
}
bool rtMsrpMessage::isRequest()
{
return m_pMsrpMessage->isRequest();
}
short rtMsrpMessage::getCode()
{
return m_pMsrpMessage->getCode();
}
String^ rtMsrpMessage::getPhrase()
{
return rtString::toString(m_pMsrpMessage->getPhrase());
}
rt_tmsrp_request_type_t rtMsrpMessage::getRequestType()
{
return (rt_tmsrp_request_type_t)m_pMsrpMessage->getRequestType();
}
#if COM_VISIBLE
rtMsrpByteRange^ rtMsrpMessage::getByteRange()
{
int64_t _start = -1, _end = -1, _total = -1;
m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
return ref new rtMsrpByteRange(_start, _end, _total);
}
#else
void rtMsrpMessage::getByteRange(IntPtr start, IntPtr end, IntPtr total)
{
int64_t _start = -1, _end = -1, _total = -1;
m_pMsrpMessage->getByteRange(&_start, &_end, &_total);
// IntPtr is 32bit or 64bit -> 32 to be sure not memory errors will raise
*((int32_t*)(void*)start) = (int32_t)_start;
*((int32_t*)(void*)end) = (int32_t)_end;
*((int32_t*)(void*)total) = (int32_t)_total;
}
#endif /* COM_VISIBLE */
bool rtMsrpMessage::isLastChunck()
{
return m_pMsrpMessage->isLastChunck();
}
bool rtMsrpMessage::isFirstChunck()
{
return m_pMsrpMessage->isFirstChunck();
}
bool rtMsrpMessage::isSuccessReport()
{
return m_pMsrpMessage->isSuccessReport();
}
String^ rtMsrpMessage::getMsrpHeaderValue(String^ name)
{
return rtString::toString(m_pMsrpMessage->getMsrpHeaderValue(rtString::toUtf8(name).data()));
}
String^ rtMsrpMessage::getMsrpHeaderParamValue(String^ name, String^ param)
{
return rtString::toString(m_pMsrpMessage->getMsrpHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data()));
}
unsigned rtMsrpMessage::getMsrpContentLength()
{
return m_pMsrpMessage->getMsrpContentLength();
}
#if COM_VISIBLE
String^ rtMsrpMessage::getMsrpContent(unsigned maxsize)
{
if(maxsize)
{
void* _s = calloc(maxsize + 1, 1);
if(_s)
{
unsigned len = m_pMsrpMessage->getMsrpContent(_s, maxsize);
String^ s = rtString::toString((const char*)_s);
free(_s);
return s;
}
}
return nullptr;
}
#else
unsigned rtMsrpMessage::getMsrpContent(IntPtr output, unsigned maxsize)
{
return m_pMsrpMessage->getMsrpContent((void*)output, maxsize);
}
#endif /* COM_VISIBLE */
//
// rtMsrpEvent
//
rtMsrpEvent::rtMsrpEvent(const struct tmsrp_event_s *event)
{
m_pMsrpEvent = new MsrpEvent(event);
}
rtMsrpEvent::~rtMsrpEvent()
{
rtSafeDelete(m_pMsrpEvent);
}
rt_tmsrp_event_type_t rtMsrpEvent::getType()
{
return (rt_tmsrp_event_type_t)m_pMsrpEvent->getType();
}
rtMsrpSession^ rtMsrpEvent::getSipSession()
{
if(m_pMsrpEvent->getSipSession())
{
assert(0); // FIXME: Not implemented
return nullptr;
// return ref new rtMsrpSession(m_pMsrpEvent->getSipSession()->getWrappedSession());
}
return nullptr;
}
rtMsrpMessage^ rtMsrpEvent::getMessage()
{
if(m_pMsrpEvent->getMessage())
{
return ref new rtMsrpMessage(const_cast<struct tmsrp_message_s *>(const_cast<MsrpMessage*>(m_pMsrpEvent->getMessage())->getWrappedMsrpMessage()));
}
return nullptr;
}
//
// rtMsrpCallback
//
rtMsrpCallback::rtMsrpCallback(rtIMsrpCallback^ pI)
{
m_pI = pI;
m_pCallback = new MsrpCallback();
}
rtMsrpCallback::~rtMsrpCallback()
{
rtSafeDelete(m_pCallback);
}

View File

@ -0,0 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/

View File

@ -0,0 +1,135 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipCallback.h"
#include "rt_SipEvent.h"
#include "SipEvent.h"
#include "SipCallback.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
class SipCallbackProxy : public SipCallback
{
public:
SipCallbackProxy(rtSipCallback^ rtCallback)
{
m_pCallback = rtCallback;
}
virtual int OnDialogEvent(const DialogEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnDialogEvent(ref new rtDialogEvent(const_cast<tsip_event_t*>(const_cast<DialogEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnStackEvent(const StackEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnStackEvent(ref new rtStackEvent(const_cast<tsip_event_t*>(const_cast<StackEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnInviteEvent(const InviteEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnInviteEvent(ref new rtInviteEvent(const_cast<tsip_event_t*>(const_cast<InviteEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnMessagingEvent(const MessagingEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnMessagingEvent(ref new rtMessagingEvent(const_cast<tsip_event_t*>(const_cast<MessagingEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnInfoEvent(const InfoEvent* e) override
{
if(m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnInfoEvent(ref new rtInfoEvent(const_cast<tsip_event_t*>(const_cast<InfoEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnOptionsEvent(const OptionsEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnOptionsEvent(ref new rtOptionsEvent(const_cast<tsip_event_t*>(const_cast<OptionsEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnPublicationEvent(const PublicationEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnPublicationEvent(ref new rtPublicationEvent(const_cast<tsip_event_t*>(const_cast<PublicationEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnRegistrationEvent(const RegistrationEvent* e) override
{
if(m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnRegistrationEvent(ref new rtRegistrationEvent(const_cast<tsip_event_t*>(const_cast<RegistrationEvent*>(e)->getWrappedEvent())));
}
return 0;
}
virtual int OnSubscriptionEvent(const SubscriptionEvent* e) override
{
if(e && m_pCallback && m_pCallback->m_pI)
{
return m_pCallback->m_pI->OnSubscriptionEvent(ref new rtSubscriptionEvent(const_cast<tsip_event_t*>(const_cast<SubscriptionEvent*>(e)->getWrappedEvent())));
}
return 0;
}
private:
rtSipCallback^ m_pCallback;
};
rtSipCallback::rtSipCallback(rtISipCallback^ pI)
{
m_pI = pI;
m_pCallback = new SipCallbackProxy(this);
}
rtSipCallback::~rtSipCallback()
{
rtSafeDelete(m_pCallback);
}
const SipCallback* rtSipCallback::getWrappedCallback()
{
return dynamic_cast<const SipCallback*>(m_pCallback);
}

View File

@ -0,0 +1,239 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipEvent.h"
#include "rt_String.h"
#include "rt_SipMessage.h"
#include "rt_SipSession.h"
#include "tinysip/tsip_event.h"
#include "SipMessage.h"
#include "SipSession.h"
#include "SipEvent.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
#define rt_getSession_Implement(cls) \
rt##cls##Session^ rt##cls##Event::getSession(){ \
const cls##Session* s = m_pEvent->getSession(); \
if(s){ \
return ref new rt##cls##Session(const_cast<SipStack*>(const_cast<##cls##Session*>(s)->getStack()), const_cast<tsip_ssession_handle_t*>(const_cast<##cls##Session*>(s)->getWrappedSession())); \
} \
return nullptr; \
} \
#define rt_takeOwnership_Implement(cls, name, session) \
rt##name##Session^ rt##cls##Event::take##session##Ownership(){ \
name##Session* s = m_pEvent->take##session##Ownership(); \
if(s){ \
rt##name##Session^ _s = ref new rt##name##Session(const_cast<SipStack*>(s->getStack()), const_cast<tsip_ssession_handle_t*>(s->getWrappedSession())); \
rtSafeDelete(s); \
return _s; \
} \
return nullptr; \
} \
/* ======================== rtDialogEvent ========================*/
rtISipEvent_Implement(rtDialogEvent);
rtDialogEvent::rtDialogEvent(const struct tsip_event_s *e)
{
m_pEvent = new DialogEvent(e);
}
rtDialogEvent::~rtDialogEvent()
{
rtSafeDelete(m_pEvent);
}
/* ======================== rtStackEvent ========================*/
rtISipEvent_Implement(rtStackEvent);
rtStackEvent::rtStackEvent(const struct tsip_event_s *e)
{
m_pEvent = new StackEvent(e);
}
rtStackEvent::~rtStackEvent()
{
rtSafeDelete(m_pEvent);
}
/* ======================== rtInviteEvent ========================*/
rtISipEvent_Implement(rtInviteEvent);
rtInviteEvent::rtInviteEvent(const struct tsip_event_s *e)
{
m_pEvent = new InviteEvent(e);
}
rtInviteEvent::~rtInviteEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_invite_event_type_t rtInviteEvent::getType()
{
return (rt_tsip_invite_event_type_t)m_pEvent->getType();
}
rt_twrap_media_type_t rtInviteEvent::getMediaType()
{
return (rt_twrap_media_type_t)m_pEvent->getMediaType();
}
rt_getSession_Implement(Invite);
rt_takeOwnership_Implement(Invite, Call, CallSession);
rt_takeOwnership_Implement(Invite, Msrp, MsrpSession);
/* ======================== rtMessagingEvent ========================*/
rtISipEvent_Implement(rtMessagingEvent);
rtMessagingEvent::rtMessagingEvent(const struct tsip_event_s *e)
{
m_pEvent = new MessagingEvent(e);
}
rtMessagingEvent::~rtMessagingEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_message_event_type_t rtMessagingEvent::getType()
{
return (rt_tsip_message_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Messaging);
rt_takeOwnership_Implement(Messaging, Messaging, Session);
/* ======================== rtInfoEvent ========================*/
rtISipEvent_Implement(rtInfoEvent);
rtInfoEvent::rtInfoEvent(const struct tsip_event_s *e)
{
m_pEvent = new InfoEvent(e);
}
rtInfoEvent::~rtInfoEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_info_event_type_t rtInfoEvent::getType()
{
return (rt_tsip_info_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Info);
rt_takeOwnership_Implement(Info, Info, Session);
/* ======================== rtOptionsEvent ========================*/
rtISipEvent_Implement(rtOptionsEvent);
rtOptionsEvent::rtOptionsEvent(const struct tsip_event_s *e)
{
m_pEvent = new OptionsEvent(e);
}
rtOptionsEvent::~rtOptionsEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_options_event_type_t rtOptionsEvent::getType()
{
return (rt_tsip_options_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Options);
rt_takeOwnership_Implement(Options, Options, Session);
/* ======================== rtPublicationEvent ========================*/
rtISipEvent_Implement(rtPublicationEvent);
rtPublicationEvent::rtPublicationEvent(const struct tsip_event_s *e)
{
m_pEvent = new PublicationEvent(e);
}
rtPublicationEvent::~rtPublicationEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_publish_event_type_t rtPublicationEvent::getType()
{
return (rt_tsip_publish_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Publication);
rt_takeOwnership_Implement(Publication, Publication, Session);
/* ======================== rtRegistrationEvent ========================*/
rtISipEvent_Implement(rtRegistrationEvent);
rtRegistrationEvent::rtRegistrationEvent(const struct tsip_event_s *e)
{
m_pEvent = new RegistrationEvent(e);
}
rtRegistrationEvent::~rtRegistrationEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_register_event_type_t rtRegistrationEvent::getType()
{
return (rt_tsip_register_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Registration);
rt_takeOwnership_Implement(Registration, Registration, Session);
/* ======================== rtSubscriptionEvent ========================*/
rtISipEvent_Implement(rtSubscriptionEvent);
rtSubscriptionEvent::rtSubscriptionEvent(const struct tsip_event_s *e)
{
m_pEvent = new SubscriptionEvent(e);
}
rtSubscriptionEvent::~rtSubscriptionEvent()
{
rtSafeDelete(m_pEvent);
}
rt_tsip_subscribe_event_type_t rtSubscriptionEvent::getType()
{
return (rt_tsip_subscribe_event_type_t)m_pEvent->getType();
}
rt_getSession_Implement(Subscription);
rt_takeOwnership_Implement(Subscription, Subscription, Session);

View File

@ -0,0 +1,171 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipMessage.h"
#include "rt_String.h"
#include "SipMessage.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
//
// rtSdpMessage
//
rtSdpMessage::rtSdpMessage()
:m_pSdpMessage(NULL)
{
}
rtSdpMessage::rtSdpMessage(struct tsdp_message_s *message)
{
m_pSdpMessage = new SdpMessage(message);
}
rtSdpMessage::~rtSdpMessage()
{
rtSafeDelete(m_pSdpMessage);
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name, unsigned index)
{
if(m_pSdpMessage)
{
char * _str = m_pSdpMessage->getSdpHeaderValue
(rtString::toUtf8(media).data(),
rtString::toUtf8(media).data()[0],
index);
String^ str = rtString::toString(_str);
TSK_FREE(str);
return str;
}
return nullptr;
}
String^ rtSdpMessage::getSdpHeaderValue(String^ media, String^ name)
{
return getSdpHeaderValue(media, name, 0);
}
String^ rtSdpMessage::getSdpHeaderAValue(String^ media, String^ attributeName)
{
if(m_pSdpMessage)
{
char * _str = m_pSdpMessage->getSdpHeaderAValue
(rtString::toUtf8(media).data(),
rtString::toUtf8(attributeName).data());
String^ str = rtString::toString(_str);
TSK_FREE(str);
return str;
}
return nullptr;
}
//
// rtSipMessage
//
rtSipMessage::rtSipMessage()
:m_pSipMessage(NULL)
{
}
rtSipMessage::rtSipMessage(struct tsip_message_s* message)
{
m_pSipMessage = new SipMessage(message);
}
rtSipMessage::~rtSipMessage()
{
rtSafeDelete(m_pSipMessage);
}
bool rtSipMessage::isResponse()
{
return m_pSipMessage ? m_pSipMessage->isResponse() : false;
}
rt_tsip_request_type_t rtSipMessage::getRequestType()
{
return (rt_tsip_request_type_t)(m_pSipMessage ? m_pSipMessage->getRequestType() : 0);
}
short rtSipMessage::getResponseCode()
{
return m_pSipMessage ? m_pSipMessage->getResponseCode() : 0;
}
String^ rtSipMessage::getResponsePhrase()
{
return m_pSipMessage ? rtString::toString(m_pSipMessage->getResponsePhrase()) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name, unsigned index)
{
return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderValue(rtString::toUtf8(name).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderValue(String^ name)
{
return getSipHeaderValue(name, 0);
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param, unsigned index)
{
return m_pSipMessage ? rtString::toString(m_pSipMessage->getSipHeaderParamValue(rtString::toUtf8(name).data(), rtString::toUtf8(param).data(), index)) : nullptr;
}
String^ rtSipMessage::getSipHeaderParamValue(String^ name, String^ param)
{
return getSipHeaderParamValue(name, param, 0);
}
unsigned rtSipMessage::getSipContentLength()
{
return m_pSipMessage ? m_pSipMessage->getSipContentLength() : 0;
}
#if COM_VISIBLE
String^ rtSipMessage::getSipContent()
{
unsigned len = getSipContentLength();
if(len > 0)
{
void* data_ptr = calloc(len, 1);
if(data_ptr)
{
m_pSipMessage->getSipContent(data_ptr, len);
String^ s = rtString::toString((const char*)data_ptr);
free(data_ptr);
return s;
}
}
return nullptr;
}
#else
unsigned rtSipMessage::getSipContent(IntPtr output, unsigned maxsize)
{
return m_pSipMessage ? m_pSipMessage->getSipContent((void*)output, maxsize) : 0;
}
#endif
rtSdpMessage^ rtSipMessage::getSdpMessage()
{
return m_pSipMessage ? ref new rtSdpMessage(const_cast<struct tsdp_message_s *>(const_cast<SdpMessage*>(m_pSipMessage->getSdpMessage())->getWrappedSdpMessage())) : nullptr;
}

View File

@ -0,0 +1,642 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipSession.h"
#include "rt_String.h"
#include "rt_SipStack.h"
#include "rt_SipUri.h"
#include "rt_Msrp.h"
#include "SipSession.h"
#include "MediaSessionMgr.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
/* ======================== T140Callback ========================*/
rtT140CallbackData::rtT140CallbackData(enum tmedia_t140_data_type_e data_type, const void* data_ptr, unsigned data_size)
{
m_pData = new T140CallbackData(data_type, data_ptr, data_size);
}
rtT140CallbackData::~rtT140CallbackData()
{
rtSafeDelete(m_pData);
}
/* ======================== rtT140Callback ========================*/
rtT140Callback::rtT140Callback()
{
m_pCallback = new T140Callback();
}
rtT140Callback::~rtT140Callback()
{
rtSafeDelete(m_pCallback);
}
/* ======================== rtSipSession ========================*/
rtISession_Implement(rtSipSession);
rtSipSession::rtSipSession(rtSipStack^ pStack)
{
m_pSipSession = new SipSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSipSession::rtSipSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new SipSession(pStack, pHandle);
}
rtSipSession::~rtSipSession()
{
rtSafeDelete(m_pSipSession);
}
/* ======================== rtInviteSession ========================*/
rtISession_Implement(rtInviteSession);
rtIInviteSession_Implement(rtInviteSession);
rtInviteSession::rtInviteSession(rtSipStack^ pStack)
{
m_pSipSession = new InviteSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInviteSession::rtInviteSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new InviteSession(pStack, pHandle);
}
rtInviteSession::~rtInviteSession()
{
rtSafeDelete(m_pSipSession);
}
/* ======================== rtCallSession ========================*/
rtISession_Implement(rtCallSession);
rtIInviteSession_Implement(rtCallSession);
rtCallSession::rtCallSession(rtSipStack^ pStack)
{
m_pSipSession = new CallSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtCallSession::rtCallSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new CallSession(pStack, pHandle);
}
rtCallSession::~rtCallSession()
{
rtSafeDelete(m_pSipSession);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media, rtActionConfig^ config)
{
return m_pSipSession->call(rtString::toUtf8(remoteUriString).data(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(String^ remoteUriString, rt_twrap_media_type_t media)
{
return call(remoteUriString, media, nullptr);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media, rtActionConfig^ config)
{
return m_pSipSession->call(remoteUri->getWrappedUri(), (twrap_media_type_t)media, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::call(rtSipUri^ remoteUri, rt_twrap_media_type_t media)
{
return call(remoteUri, media, nullptr);
}
bool rtCallSession::setSessionTimer(unsigned timeout, String^ refresher)
{
return m_pSipSession->setSessionTimer(timeout, rtString::toUtf8(refresher).data());
}
bool rtCallSession::set100rel(bool enabled)
{
return m_pSipSession->set100rel(enabled);
}
bool rtCallSession::setRtcp(bool enabled)
{
return m_pSipSession->setRtcp(enabled);
}
bool rtCallSession::setRtcpMux(bool enabled)
{
return m_pSipSession->setRtcpMux(enabled);
}
bool rtCallSession::setICE(bool enabled)
{
return m_pSipSession->setICE(enabled);
}
bool rtCallSession::setQoS(rt_tmedia_qos_stype_t type, rt_tmedia_qos_strength_t strength)
{
return m_pSipSession->setQoS((tmedia_qos_stype_t) type, (tmedia_qos_strength_t) strength);
}
bool rtCallSession::hold(rtActionConfig^ config)
{
return m_pSipSession->hold(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::hold()
{
return hold(nullptr);
}
bool rtCallSession::resume(rtActionConfig^ config)
{
return m_pSipSession->resume(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::resume()
{
return resume(nullptr);
}
bool rtCallSession::transfer(String^ referToUriString, rtActionConfig^ config)
{
return m_pSipSession->transfer(rtString::toUtf8(referToUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::transfer(String^ referToUriString)
{
return transfer(referToUriString, nullptr);
}
bool rtCallSession::acceptTransfer(rtActionConfig^ config)
{
return m_pSipSession->acceptTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::acceptTransfer()
{
return acceptTransfer(nullptr);
}
bool rtCallSession::rejectTransfer(rtActionConfig^ config)
{
return m_pSipSession->rejectTransfer(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtCallSession::rejectTransfer()
{
return rejectTransfer(nullptr);
}
bool rtCallSession::sendDTMF(int number)
{
return m_pSipSession->sendDTMF(number);
}
unsigned rtCallSession::getSessionTransferId()
{
return m_pSipSession->getSessionTransferId();
}
#if COM_VISIBLE
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, String^ data)
{
std::vector<char> _data = rtString::toUtf8(data);
return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)_data.data(), _data.size());
}
#else
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type, IntPtr data_ptr, unsigned data_size)
{
return m_pSipSession->sendT140Data((tmedia_t140_data_type_t) data_type, (const void*)data_ptr, data_size);
}
#endif
bool rtCallSession::sendT140Data(rt_tmedia_t140_data_type_t data_type)
{
return sendT140Data(data_type, nullptr
#if !COM_VISIBLE
, 0
#endif
);
}
bool rtCallSession::setT140Callback(rtT140Callback^ pT140Callback)
{
return m_pSipSession->setT140Callback(const_cast<T140Callback*>(pT140Callback->getWrappedCallback()));
}
/* ======================== rtMsrpSession ========================*/
rtISession_Implement(rtMsrpSession);
rtIInviteSession_Implement(rtMsrpSession);
rtMsrpSession::rtMsrpSession(rtSipStack^ pStack, rtIMsrpCallback^ pCallback)
{
m_pCallback = ref new rtMsrpCallback(pCallback);
m_pSipSession = new MsrpSession(const_cast<SipStack*>(pStack->getWrappedStack()), const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
rtMsrpSession::rtMsrpSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new MsrpSession(pStack, pHandle);
}
rtMsrpSession::~rtMsrpSession()
{
rtSafeDelete(m_pSipSession);
rtSafeDelete(m_pCallback);
}
bool rtMsrpSession::setCallback(rtIMsrpCallback^ pCallback)
{
rtSafeDelete(m_pCallback);
if(!pCallback)
{
return m_pSipSession->setCallback(tsk_null);
return true;
}
m_pCallback = ref new rtMsrpCallback(pCallback);
return m_pSipSession->setCallback(const_cast<MsrpCallback*>(m_pCallback->getWrappedCallback()));
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString, rtActionConfig^ config)
{
return m_pSipSession->callMsrp(rtString::toUtf8(remoteUriString).data(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(Platform::String^ remoteUriString)
{
return callMsrp(remoteUriString, nullptr);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri, rtActionConfig^ config)
{
return m_pSipSession->callMsrp(remoteUri->getWrappedUri(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::callMsrp(rtSipUri^ remoteUri)
{
return callMsrp(remoteUri, nullptr);
}
#if COM_VISIBLE
bool rtMsrpSession::sendMessage(String^ payload, rtActionConfig^ config)
{
std::vector<char> _payload = rtString::toUtf8(payload);
return m_pSipSession->sendMessage((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::String^ payload)
{
return sendMessage(payload, nullptr);
}
#else
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
return m_pSipSession->sendMessage((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMsrpSession::sendMessage(Platform::IntPtr payload, unsigned len)
{
return sendMessage(payload, len, nullptr);
}
#endif /* COM_VISIBLE */
/* ======================== rtMessagingSession ========================*/
rtISession_Implement(rtMessagingSession);
rtMessagingSession::rtMessagingSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new MessagingSession(pStack, pHandle);
}
rtMessagingSession::rtMessagingSession(rtSipStack^ pStack)
{
m_pSipSession = new MessagingSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtMessagingSession::~rtMessagingSession()
{
rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtMessagingSession::send(String^ payload, rtActionConfig^ config)
{
std::vector<char>_payload = rtString::toUtf8(payload);
return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(Platform::String^ payload)
{
return send(payload, nullptr);
}
#else
bool rtMessagingSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::send(IntPtr payload, unsigned len)
{
return send(payload, len, nullptr);
}
#endif
bool rtMessagingSession::accept(rtActionConfig^ config)
{
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::accept()
{
return accept(nullptr);
}
bool rtMessagingSession::reject(rtActionConfig^ config)
{
return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtMessagingSession::reject()
{
return reject(nullptr);
}
/* ======================== rtInfoSession ========================*/
rtISession_Implement(rtInfoSession);
rtInfoSession::rtInfoSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new InfoSession(pStack, pHandle);
}
rtInfoSession::rtInfoSession(rtSipStack^ pStack)
{
m_pSipSession = new InfoSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtInfoSession::~rtInfoSession()
{
rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtInfoSession::send(Platform::String^ payload, rtActionConfig^ config)
{
std::vector<char>_payload = rtString::toUtf8(payload);
return m_pSipSession->send((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(Platform::String^ payload)
{
return send(payload, nullptr);
}
#else
bool rtInfoSession::send(IntPtr payload, unsigned len, rtActionConfig^ config)
{
return m_pSipSession->send((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::send(IntPtr payload, unsigned len)
{
return send(payload, len, nullptr);
}
#endif
bool rtInfoSession::accept(rtActionConfig^ config)
{
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::accept()
{
return accept(nullptr);
}
bool rtInfoSession::reject(rtActionConfig^ config)
{
return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtInfoSession::reject()
{
return reject(nullptr);
}
/* ======================== rtOptionsSession ========================*/
rtISession_Implement(rtOptionsSession);
rtOptionsSession::rtOptionsSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new OptionsSession(pStack, pHandle);
}
rtOptionsSession::rtOptionsSession(rtSipStack^ pStack)
{
m_pSipSession = new OptionsSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtOptionsSession::~rtOptionsSession()
{
rtSafeDelete(m_pSipSession);
}
bool rtOptionsSession::send(rtActionConfig^ config)
{
return m_pSipSession->send(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::send()
{
return send(nullptr);
}
bool rtOptionsSession::accept(rtActionConfig^ config)
{
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::accept()
{
return accept(nullptr);
}
bool rtOptionsSession::reject(rtActionConfig^ config)
{
return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtOptionsSession::reject()
{
return reject(nullptr);
}
/* ======================== rtPublicationSession ========================*/
rtISession_Implement(rtPublicationSession);
rtPublicationSession::rtPublicationSession(rtSipStack^ pStack)
{
m_pSipSession = new PublicationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtPublicationSession::rtPublicationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new PublicationSession(pStack, pHandle);
}
rtPublicationSession::~rtPublicationSession()
{
rtSafeDelete(m_pSipSession);
}
#if COM_VISIBLE
bool rtPublicationSession::publish(String^ payload, rtActionConfig^ config)
{
std::vector<char>_payload = rtString::toUtf8(payload);
return m_pSipSession->publish((const void*)_payload.data(), _payload.size(), config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::String^ payload)
{
return publish(payload, nullptr);
}
#else
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len, rtActionConfig^ config)
{
return m_pSipSession->publish((const void*)payload, len, config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::publish(Platform::IntPtr payload, unsigned len)
{
return publish(payload, len, nullptr);
}
#endif
bool rtPublicationSession::unPublish(rtActionConfig^ config)
{
return m_pSipSession->unPublish(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtPublicationSession::unPublish()
{
return unPublish(nullptr);
}
/* ======================== rtRegistrationSession ========================*/
rtISession_Implement(rtRegistrationSession);
rtRegistrationSession::rtRegistrationSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new RegistrationSession(pStack, pHandle);
}
rtRegistrationSession::rtRegistrationSession(rtSipStack^ pStack)
{
m_pSipSession = new RegistrationSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtRegistrationSession::~rtRegistrationSession()
{
rtSafeDelete(m_pSipSession);
}
bool rtRegistrationSession::register_(rtActionConfig^ config)
{
return m_pSipSession->register_(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::register_()
{
return register_(nullptr);
}
bool rtRegistrationSession::unRegister(rtActionConfig^ config)
{
return m_pSipSession->unRegister(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::unRegister()
{
return unRegister(nullptr);
}
bool rtRegistrationSession::accept(rtActionConfig^ config)
{
return m_pSipSession->accept(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::accept()
{
return accept(nullptr);
}
bool rtRegistrationSession::reject(rtActionConfig^ config)
{
return m_pSipSession->reject(config ? config->getWrappedActionConfig() : tsk_null);
}
bool rtRegistrationSession::reject()
{
return reject(nullptr);
}
/* ======================== rtSubscriptionSession ========================*/
rtISession_Implement(rtSubscriptionSession);
rtSubscriptionSession::rtSubscriptionSession(rtSipStack^ pStack)
{
m_pSipSession = new SubscriptionSession(const_cast<SipStack*>(pStack->getWrappedStack()));
}
rtSubscriptionSession::rtSubscriptionSession(SipStack* pStack, tsip_ssession_handle_t* pHandle)
{
m_pSipSession = new SubscriptionSession(pStack, pHandle);
}
rtSubscriptionSession::~rtSubscriptionSession()
{
rtSafeDelete(m_pSipSession);
}
bool rtSubscriptionSession::subscribe()
{
return m_pSipSession->subscribe();
}
bool rtSubscriptionSession::unSubscribe()
{
return m_pSipSession->unSubscribe();
}

View File

@ -0,0 +1,390 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipStack.h"
#include "rt_SipCallback.h"
#include "rt_DDebug.h"
#include "rt_String.h"
#include "rt_Enums.h"
#include "SipStack.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
rtSipStack::rtSipStack(rtISipCallback^ callback, Platform::String^ realmUri, Platform::String^ impiString, Platform::String^ impuUri)
{
m_pSipCallback = ref new rtSipCallback(callback);
m_pSipStack = new SipStack(
const_cast<SipCallback*>(m_pSipCallback->getWrappedCallback()),
rtString::toUtf8(realmUri).data(),
rtString::toUtf8(impiString).data(),
rtString::toUtf8(impuUri).data()
);
}
rtSipStack::~rtSipStack()
{
std::lock_guard<std::recursive_mutex> lock(mLock);
rtSafeDelete(m_pSipStack);
rtSafeDelete(m_pSipCallback);
rtSafeDelete(m_pDebugCallback);
}
bool rtSipStack::start()
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->start();
}
bool rtSipStack::setDebugCallback(rtIDDebugCallback^ pCallback)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
m_pSipStack->setDebugCallback(tsk_null);
rtSafeDelete(m_pDebugCallback);
if(!pCallback)
{
return true;
}
m_pDebugCallback = ref new rtDDebugCallback(pCallback);
return m_pSipStack->setDebugCallback(const_cast<DDebugCallback*>(m_pDebugCallback->getWrappedCallback()));
}
bool rtSipStack::setDisplayName(Platform::String^ display_name)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setDisplayName(rtString::toUtf8(display_name).data());
}
bool rtSipStack::setRealm(Platform::String^ realm_uri)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setRealm(rtString::toUtf8(realm_uri).data());
}
bool rtSipStack::setIMPI(Platform::String^ impi)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setIMPI(rtString::toUtf8(impi).data());
}
bool rtSipStack::setIMPU(Platform::String^ impu_uri)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setIMPU(rtString::toUtf8(impu_uri).data());
}
bool rtSipStack::setPassword(Platform::String^ password)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setPassword(rtString::toUtf8(password).data());
}
bool rtSipStack::setAMF(Platform::String^ amf)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setAMF(rtString::toUtf8(amf).data());
}
bool rtSipStack::setOperatorId(Platform::String^ opid)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setOperatorId(rtString::toUtf8(opid).data());
}
bool rtSipStack::setProxyCSCF(Platform::String^ fqdn, unsigned short port, Platform::String^ transport, Platform::String^ ipversion)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setProxyCSCF(
rtString::toUtf8(fqdn).data(),
port,
rtString::toUtf8(transport).data(),
rtString::toUtf8(ipversion).data()
);
}
bool rtSipStack::setLocalIP(Platform::String^ ip, Platform::String^ transport)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data(), rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalIP(Platform::String^ ip)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setLocalIP(rtString::toUtf8(ip).data());
}
bool rtSipStack::setLocalPort(unsigned short port, Platform::String^ transport)
{
return m_pSipStack->setLocalPort(port, rtString::toUtf8(transport).data());
}
bool rtSipStack::setLocalPort(unsigned short port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setLocalPort(port);
}
bool rtSipStack::setEarlyIMS(bool enabled)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setEarlyIMS(enabled);
}
bool rtSipStack::addHeader(Platform::String^ name, Platform::String^ value)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->addHeader(rtString::toUtf8(name).data(), rtString::toUtf8(value).data());
}
bool rtSipStack::removeHeader(Platform::String^ name)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->removeHeader(rtString::toUtf8(name).data());
}
bool rtSipStack::addDnsServer(Platform::String^ ip)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->removeHeader(rtString::toUtf8(ip).data());
}
bool rtSipStack::setDnsDiscovery(bool enabled)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setDnsDiscovery(enabled);
}
bool rtSipStack::setAoR(Platform::String^ ip, int port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setAoR(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSigCompParams(unsigned dms, unsigned sms, unsigned cpb, bool enablePresDict)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setSigCompParams(dms, sms, cpb, enablePresDict);
}
bool rtSipStack::addSigCompCompartment(Platform::String^ compId)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->addSigCompCompartment(rtString::toUtf8(compId).data());
}
bool rtSipStack::removeSigCompCompartment(Platform::String^ compId)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->removeSigCompCompartment(rtString::toUtf8(compId).data());
}
bool rtSipStack::setSTUNServer(Platform::String^ ip, unsigned short port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setSTUNServer(rtString::toUtf8(ip).data(), port);
}
bool rtSipStack::setSTUNCred(Platform::String^ login, Platform::String^ password)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setSTUNCred(rtString::toUtf8(login).data(), rtString::toUtf8(password).data());
}
bool rtSipStack::setTLSSecAgree(bool enabled)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setTLSSecAgree(enabled);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey, bool verify)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setSSLCertificates(rtString::toUtf8(privKey).data(), rtString::toUtf8(pubKey).data(), rtString::toUtf8(caKey).data(), verify);
}
bool rtSipStack::setSSLCertificates(Platform::String^ privKey, Platform::String^ pubKey, Platform::String^ caKey)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return setSSLCertificates(privKey, pubKey, caKey, false);
}
bool rtSipStack::setIPSecSecAgree(bool enabled)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setIPSecSecAgree(enabled);
}
bool rtSipStack::setIPSecParameters(Platform::String^ algo, Platform::String^ ealgo, Platform::String^ mode, Platform::String^ proto)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->setIPSecParameters(rtString::toUtf8(algo).data(), rtString::toUtf8(ealgo).data(), rtString::toUtf8(mode).data(), rtString::toUtf8(proto).data());
}
Platform::String^ rtSipStack::dnsENUM(Platform::String^ service, Platform::String^ e164num, Platform::String^ domain)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return rtString::toString(m_pSipStack->dnsENUM(rtString::toUtf8(service).data(), rtString::toUtf8(e164num).data(), rtString::toUtf8(domain).data()));
}
#if COM_VISIBLE
rtDnsResult^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
unsigned short _port = 0;
String^ address = rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), &_port));
return ref new rtDnsResult(_port, address);
}
rtDnsResult^ rtSipStack::dnsSrv(String^ service)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
unsigned short _port = 0;
String^ address = rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), &_port));
return ref new rtDnsResult(_port, address);
}
String^ rtSipStack::getLocalIP(String^ protocol)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), tsk_null);
String^ ip = rtString::toString(_ip);
TSK_FREE(_ip);
return ip;
}
uint16 rtSipStack::getLocalPort(String^ protocol)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
uint16 port = 0;
char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), &port);
TSK_FREE(_ip);
return port;
}
#else
String^ rtSipStack::dnsNaptrSrv(String^ domain, String^ service, IntPtr port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return rtString::toString(m_pSipStack->dnsNaptrSrv(rtString::toUtf8(domain).data(), rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
String^ rtSipStack::dnsSrv(String^ service, IntPtr port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return rtString::toString(m_pSipStack->dnsSrv(rtString::toUtf8(service).data(), ((unsigned short*)(void*)port)));
}
Platform::String^ rtSipStack::getLocalIPnPort(String^ protocol, IntPtr port)
{
std::lock_guard<std::recursive_mutex> lock(mLock);
char* _ip = m_pSipStack->getLocalIPnPort(rtString::toUtf8(protocol).data(), ((unsigned short*)(void*)port));
String^ ip = rtString::toString();
TSK_FREE(_ip);
return ip;
}
#endif /* COM_VISIBLE */
Platform::String^ rtSipStack::getPreferredIdentity()
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return rtString::toString(m_pSipStack->getPreferredIdentity());
}
bool rtSipStack::isValid()
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->isValid();
}
bool rtSipStack::stop()
{
std::lock_guard<std::recursive_mutex> lock(mLock);
return m_pSipStack->stop();
}
bool rtSipStack::initialize()
{
return SipStack::initialize();
}
bool rtSipStack::deInitialize()
{
return SipStack::deInitialize();
}
void rtSipStack::setCodecs(enum class rt_tdav_codec_id_t codecs)
{
return SipStack::setCodecs((tdav_codec_id_t) codecs);
}
bool rtSipStack::setCodecPriority(enum class rt_tdav_codec_id_t codec_id, int priority)
{
return SipStack::setCodecPriority((tdav_codec_id_t)codec_id, priority);
}
bool rtSipStack::isCodecSupported(enum class rt_tdav_codec_id_t codec_id)
{
return SipStack::isCodecSupported((tdav_codec_id_t) codec_id);
}

View File

@ -0,0 +1,103 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_SipUri.h"
#include "rt_String.h"
#include "SipUri.h"
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
rtSipUri::rtSipUri(Platform::String^ uriString, Platform::String^ displayName)
{
m_pSipUri = new SipUri(
rtString::toUtf8(uriString).data(),
rtString::toUtf8(displayName).data());
}
rtSipUri::rtSipUri(Platform::String^ uriString)
{
m_pSipUri = new SipUri(rtString::toUtf8(uriString).data());
}
rtSipUri::~rtSipUri()
{
rtSafeDelete(m_pSipUri);
}
bool rtSipUri::isValid(Platform::String^ uri)
{
return SipUri::isValid(rtString::toUtf8(uri).data());
}
// MIDL4069: Static members and instance members cannot have the same name on a runtime class. isValid
#if COM_VISIBLE
bool rtSipUri::isValid_()
#else
bool rtSipUri::isValid()
#endif
{
return (m_pSipUri && m_pSipUri->isValid());
}
Platform::String^ rtSipUri::getScheme()
{
return m_pSipUri ? rtString::toString(m_pSipUri->getScheme()) : nullptr;
}
Platform::String^ rtSipUri::getHost()
{
return m_pSipUri ? rtString::toString(m_pSipUri->getHost()) : nullptr;
}
unsigned short rtSipUri::getPort()
{
return m_pSipUri ? m_pSipUri->getPort() : 0;
}
Platform::String^ rtSipUri::getUserName()
{
return m_pSipUri ? rtString::toString(m_pSipUri->getUserName()) : nullptr;
}
Platform::String^ rtSipUri::getPassword()
{
return m_pSipUri ? rtString::toString(m_pSipUri->getPassword()) : nullptr;
}
Platform::String^ rtSipUri::getDisplayName()
{
return m_pSipUri ? rtString::toString(m_pSipUri->getDisplayName()) : nullptr;
}
Platform::String^ rtSipUri::getParamValue(Platform::String^ name)
{
return m_pSipUri ? rtString::toString(m_pSipUri->getParamValue(rtString::toUtf8(name).data())) : nullptr;
}
void rtSipUri::setDisplayName(Platform::String^ displayName)
{
if(m_pSipUri)
{
m_pSipUri->setDisplayName(rtString::toUtf8(displayName).data());
}
}

View File

@ -0,0 +1,58 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
#include "rt_String.h"
#include <Windows.h>
using namespace doubango_rt::BackEnd;
using namespace Platform;
using namespace std;
vector<char> rtString::toUtf8(String^ str)
{
if(str != nullptr && !str->IsEmpty())
{
int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), nullptr, 0, nullptr, nullptr);
if (len > 0)
{
vector<char> vec(len + 1);
if (WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str->Data(), str->Length(), vec.data(), len, nullptr, nullptr) == len)
{
return std::move(vec);
}
}
}
return std::move(vector<char>(0));
}
String^ rtString::toString(char const* str)
{
if(str)
{
int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nullptr, 0);
if (len > 0)
{
vector<wchar_t> vec(len);
if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, vec.data(), len) == len)
{
return ref new String(vec.data());
}
}
}
return nullptr;
}

View File

@ -0,0 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/

View File

@ -0,0 +1,229 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Phone
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyWRAP", "tinyWRAP.vcxproj", "{5004BA7E-950D-4D60-A030-29ACD38DCA08}"
ProjectSection(ProjectDependencies) = postProject
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67} = {1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}
{BE41D117-1D61-4C12-AD9D-B20D02C79687} = {BE41D117-1D61-4C12-AD9D-B20D02C79687}
{1A27423C-6535-4A49-96EC-5D209FE125F2} = {1A27423C-6535-4A49-96EC-5D209FE125F2}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{77A24977-079C-4E02-9717-8B2F684BAA21} = {77A24977-079C-4E02-9717-8B2F684BAA21}
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F} = {49843B78-0CEB-445D-BACC-C5C5C2F6C26F}
{982D737A-0649-4C32-A00E-08992A0B7673} = {982D737A-0649-4C32-A00E-08992A0B7673}
{0875A083-5118-40CC-941E-722B00295A5B} = {0875A083-5118-40CC-941E-722B00295A5B}
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2} = {0F2C458A-1EDB-4E09-9A22-C2209731CFF2}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{F623CBDB-707A-4FDC-ACE0-3D616E239F16} = {F623CBDB-707A-4FDC-ACE0-3D616E239F16}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC} = {65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyDAV", "..\..\tinyDAV\winrt\tinyDAV.vcxproj", "{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}"
ProjectSection(ProjectDependencies) = postProject
{BE41D117-1D61-4C12-AD9D-B20D02C79687} = {BE41D117-1D61-4C12-AD9D-B20D02C79687}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{77A24977-079C-4E02-9717-8B2F684BAA21} = {77A24977-079C-4E02-9717-8B2F684BAA21}
{982D737A-0649-4C32-A00E-08992A0B7673} = {982D737A-0649-4C32-A00E-08992A0B7673}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyHTTP", "..\..\tinyHTTP\winrt\tinyHTTP.vcxproj", "{1A27423C-6535-4A49-96EC-5D209FE125F2}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyIPSec", "..\..\tinyIPSec\winrt\tinyIPSec.vcxproj", "{0875A083-5118-40CC-941E-722B00295A5B}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyMEDIA", "..\..\tinyMEDIA\winrt\tinyMEDIA.vcxproj", "{52E43EEB-A549-4159-B254-DCA225D7638B}"
ProjectSection(ProjectDependencies) = postProject
{BE41D117-1D61-4C12-AD9D-B20D02C79687} = {BE41D117-1D61-4C12-AD9D-B20D02C79687}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{982D737A-0649-4C32-A00E-08992A0B7673} = {982D737A-0649-4C32-A00E-08992A0B7673}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyMSRP", "..\..\tinyMSRP\winrt\tinyMSRP.vcxproj", "{BE41D117-1D61-4C12-AD9D-B20D02C79687}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyNET", "..\..\tinyNET\winrt\tinyNET.vcxproj", "{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyRTP", "..\..\tinyRTP\winrt\tinyRTP.vcxproj", "{77A24977-079C-4E02-9717-8B2F684BAA21}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySAK", "..\..\tinySAK\winrt\tinySAK.vcxproj", "{19279F5B-CDAF-4187-9F09-2A896A828B05}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySDP", "..\..\tinySDP\winrt\tinySDP.vcxproj", "{982D737A-0649-4C32-A00E-08992A0B7673}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySIGCOMP", "..\..\tinySIGCOMP\winrt\tinySIGCOMP.vcxproj", "{F623CBDB-707A-4FDC-ACE0-3D616E239F16}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySIP", "..\..\tinySIP\winrt\tinySIP.vcxproj", "{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}"
ProjectSection(ProjectDependencies) = postProject
{BE41D117-1D61-4C12-AD9D-B20D02C79687} = {BE41D117-1D61-4C12-AD9D-B20D02C79687}
{1A27423C-6535-4A49-96EC-5D209FE125F2} = {1A27423C-6535-4A49-96EC-5D209FE125F2}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{982D737A-0649-4C32-A00E-08992A0B7673} = {982D737A-0649-4C32-A00E-08992A0B7673}
{0875A083-5118-40CC-941E-722B00295A5B} = {0875A083-5118-40CC-941E-722B00295A5B}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{F623CBDB-707A-4FDC-ACE0-3D616E239F16} = {F623CBDB-707A-4FDC-ACE0-3D616E239F16}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC} = {65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySMS", "..\..\tinySMS\winrt\tinySMS.vcxproj", "{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyXCAP", "..\..\tinyXCAP\winrt\tinyXCAP.vcxproj", "{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}"
ProjectSection(ProjectDependencies) = postProject
{1A27423C-6535-4A49-96EC-5D209FE125F2} = {1A27423C-6535-4A49-96EC-5D209FE125F2}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|Win32 = Debug|Win32
Release|ARM = Release|ARM
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Debug|ARM.ActiveCfg = Debug|ARM
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Debug|ARM.Build.0 = Debug|ARM
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Debug|Win32.ActiveCfg = Debug|Win32
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Debug|Win32.Build.0 = Debug|Win32
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Release|ARM.ActiveCfg = Release|ARM
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Release|ARM.Build.0 = Release|ARM
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Release|Win32.ActiveCfg = Release|Win32
{5004BA7E-950D-4D60-A030-29ACD38DCA08}.Release|Win32.Build.0 = Release|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|ARM.ActiveCfg = Debug|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|ARM.Build.0 = Debug|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|Win32.ActiveCfg = Debug|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|Win32.Build.0 = Debug|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|ARM.ActiveCfg = Release|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|ARM.Build.0 = Release|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|Win32.ActiveCfg = Release|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|Win32.Build.0 = Release|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|ARM.ActiveCfg = Debug|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|ARM.Build.0 = Debug|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|Win32.ActiveCfg = Debug|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|Win32.Build.0 = Debug|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|ARM.ActiveCfg = Release|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|ARM.Build.0 = Release|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|Win32.ActiveCfg = Release|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|Win32.Build.0 = Release|Win32
{0875A083-5118-40CC-941E-722B00295A5B}.Debug|ARM.ActiveCfg = Debug|ARM
{0875A083-5118-40CC-941E-722B00295A5B}.Debug|ARM.Build.0 = Debug|ARM
{0875A083-5118-40CC-941E-722B00295A5B}.Debug|Win32.ActiveCfg = Debug|Win32
{0875A083-5118-40CC-941E-722B00295A5B}.Debug|Win32.Build.0 = Debug|Win32
{0875A083-5118-40CC-941E-722B00295A5B}.Release|ARM.ActiveCfg = Release|ARM
{0875A083-5118-40CC-941E-722B00295A5B}.Release|ARM.Build.0 = Release|ARM
{0875A083-5118-40CC-941E-722B00295A5B}.Release|Win32.ActiveCfg = Release|Win32
{0875A083-5118-40CC-941E-722B00295A5B}.Release|Win32.Build.0 = Release|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|ARM.ActiveCfg = Debug|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|ARM.Build.0 = Debug|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|Win32.ActiveCfg = Debug|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|Win32.Build.0 = Debug|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|ARM.ActiveCfg = Release|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|ARM.Build.0 = Release|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|Win32.ActiveCfg = Release|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|Win32.Build.0 = Release|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|ARM.ActiveCfg = Debug|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|ARM.Build.0 = Debug|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|Win32.ActiveCfg = Debug|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|Win32.Build.0 = Debug|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|ARM.ActiveCfg = Release|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|ARM.Build.0 = Release|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|Win32.ActiveCfg = Release|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|Win32.Build.0 = Release|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|ARM.ActiveCfg = Debug|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|ARM.Build.0 = Debug|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|Win32.ActiveCfg = Debug|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|Win32.Build.0 = Debug|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|ARM.ActiveCfg = Release|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|ARM.Build.0 = Release|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|Win32.ActiveCfg = Release|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|Win32.Build.0 = Release|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|ARM.ActiveCfg = Debug|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|ARM.Build.0 = Debug|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|Win32.ActiveCfg = Debug|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|Win32.Build.0 = Debug|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|ARM.ActiveCfg = Release|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|ARM.Build.0 = Release|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|Win32.ActiveCfg = Release|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|Win32.Build.0 = Release|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|ARM.ActiveCfg = Debug|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|ARM.Build.0 = Debug|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|Win32.ActiveCfg = Debug|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|Win32.Build.0 = Debug|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|ARM.ActiveCfg = Release|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|ARM.Build.0 = Release|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|Win32.ActiveCfg = Release|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|Win32.Build.0 = Release|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|ARM.ActiveCfg = Debug|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|ARM.Build.0 = Debug|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|Win32.ActiveCfg = Debug|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|Win32.Build.0 = Debug|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|ARM.ActiveCfg = Release|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|ARM.Build.0 = Release|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|Win32.ActiveCfg = Release|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|Win32.Build.0 = Release|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|ARM.ActiveCfg = Debug|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|ARM.Build.0 = Debug|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|Win32.ActiveCfg = Debug|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|Win32.Build.0 = Debug|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|ARM.ActiveCfg = Release|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|ARM.Build.0 = Release|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|Win32.ActiveCfg = Release|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|Win32.Build.0 = Release|Win32
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Debug|ARM.ActiveCfg = Debug|ARM
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Debug|ARM.Build.0 = Debug|ARM
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Debug|Win32.ActiveCfg = Debug|Win32
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Debug|Win32.Build.0 = Debug|Win32
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Release|ARM.ActiveCfg = Release|ARM
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Release|ARM.Build.0 = Release|ARM
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Release|Win32.ActiveCfg = Release|Win32
{1137A808-DAC8-4AF7-B8BB-AEE8ABFF2F67}.Release|Win32.Build.0 = Release|Win32
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Debug|ARM.ActiveCfg = Debug|ARM
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Debug|ARM.Build.0 = Debug|ARM
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Debug|Win32.ActiveCfg = Debug|Win32
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Debug|Win32.Build.0 = Debug|Win32
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Release|ARM.ActiveCfg = Release|ARM
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Release|ARM.Build.0 = Release|ARM
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Release|Win32.ActiveCfg = Release|Win32
{65CDF0FF-3B84-45F3-9BB6-468C79B8E0BC}.Release|Win32.Build.0 = Release|Win32
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Debug|ARM.ActiveCfg = Debug|ARM
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Debug|ARM.Build.0 = Debug|ARM
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Debug|Win32.ActiveCfg = Debug|Win32
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Debug|Win32.Build.0 = Debug|Win32
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Release|ARM.ActiveCfg = Release|ARM
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Release|ARM.Build.0 = Release|ARM
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Release|Win32.ActiveCfg = Release|Win32
{49843B78-0CEB-445D-BACC-C5C5C2F6C26F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{5004ba7e-950d-4d60-a030-29acd38dca08}</ProjectGuid>
<RootNamespace>tinyWRAP</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;TINYWRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\_common;..\.;..\..\thirdparties\winrt\include;..\..\tinySAK\src;..\..\tinyNET\src;..\..\tinyHTTP\include;..\..\tinySIP\include;..\..\tinyDAV\include;..\..\tinySDP\include;..\..\tinyMEDIA\include;..\..\tinyXCAP\include;..\..\tinySMS\include;..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinySIP\tinySIP.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyDAV\tinyDAV.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib";"$(SolutionDir)$(Configuration)\tinyHTTP\tinyHTTP.lib";"$(SolutionDir)$(Configuration)\tinyXCAP\tinyXCAP.lib";"$(SolutionDir)$(Configuration)\tinySMS\tinySMS.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib"</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;TINYWRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\_common;..\.;..\..\thirdparties\winrt\include;..\..\tinySAK\src;..\..\tinyNET\src;..\..\tinyHTTP\include;..\..\tinySIP\include;..\..\tinyDAV\include;..\..\tinySDP\include;..\..\tinyMEDIA\include;..\..\tinyXCAP\include;..\..\tinySMS\include;..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinySIP\tinySIP.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyDAV\tinyDAV.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib";"$(SolutionDir)$(Configuration)\tinyHTTP\tinyHTTP.lib";"$(SolutionDir)$(Configuration)\tinyXCAP\tinyXCAP.lib";"$(SolutionDir)$(Configuration)\tinySMS\tinySMS.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib"</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;TINYWRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\_common;..\.;..\..\thirdparties\winrt\include;..\..\tinySAK\src;..\..\tinyNET\src;..\..\tinyHTTP\include;..\..\tinySIP\include;..\..\tinyDAV\include;..\..\tinySDP\include;..\..\tinyMEDIA\include;..\..\tinyXCAP\include;..\..\tinySMS\include;..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinySIP\tinySIP.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyDAV\tinyDAV.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib";"$(SolutionDir)$(Configuration)\tinyHTTP\tinyHTTP.lib";"$(SolutionDir)$(Configuration)\tinyXCAP\tinyXCAP.lib";"$(SolutionDir)$(Configuration)\tinySMS\tinySMS.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib"</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PreprocessorDefinitions>_USRDLL;TINYWRAP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\_common;..\.;..\..\thirdparties\winrt\include;..\..\tinySAK\src;..\..\tinyNET\src;..\..\tinyHTTP\include;..\..\tinySIP\include;..\..\tinyDAV\include;..\..\tinySDP\include;..\..\tinyMEDIA\include;..\..\tinyXCAP\include;..\..\tinySMS\include;..\..\tinyMSRP\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinySIP\tinySIP.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyDAV\tinyDAV.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib";"$(SolutionDir)$(Configuration)\tinyHTTP\tinyHTTP.lib";"$(SolutionDir)$(Configuration)\tinyXCAP\tinyXCAP.lib";"$(SolutionDir)$(Configuration)\tinySMS\tinySMS.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib"</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="Windows">
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="platform.winmd">
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\csharp\tinyWRAP_wrap.h" />
<ClInclude Include="..\_common\ActionConfig.h" />
<ClInclude Include="..\_common\AudioResampler.h" />
<ClInclude Include="..\_common\Common.h" />
<ClInclude Include="..\_common\DDebug.h" />
<ClInclude Include="..\_common\MediaContent.h" />
<ClInclude Include="..\_common\MediaSessionMgr.h" />
<ClInclude Include="..\_common\Msrp.h" />
<ClInclude Include="..\_common\ProxyConsumer.h" />
<ClInclude Include="..\_common\ProxyPluginMgr.h" />
<ClInclude Include="..\_common\ProxyProducer.h" />
<ClInclude Include="..\_common\SafeObject.h" />
<ClInclude Include="..\_common\SipCallback.h" />
<ClInclude Include="..\_common\SipEvent.h" />
<ClInclude Include="..\_common\SipMessage.h" />
<ClInclude Include="..\_common\SipSession.h" />
<ClInclude Include="..\_common\SipStack.h" />
<ClInclude Include="..\_common\SipUri.h" />
<ClInclude Include="..\_common\SMSEncoder.h" />
<ClInclude Include="..\_common\tinyWRAP_config.h" />
<ClInclude Include="..\_common\Xcap.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\csharp\tinyWRAP_wrap.cxx" />
<ClCompile Include="..\_common\ActionConfig.cxx" />
<ClCompile Include="..\_common\AudioResampler.cxx" />
<ClCompile Include="..\_common\DDebug.cxx" />
<ClCompile Include="..\_common\MediaContent.cxx" />
<ClCompile Include="..\_common\MediaSessionMgr.cxx" />
<ClCompile Include="..\_common\Msrp.cxx" />
<ClCompile Include="..\_common\ProxyConsumer.cxx" />
<ClCompile Include="..\_common\ProxyPluginMgr.cxx" />
<ClCompile Include="..\_common\ProxyProducer.cxx" />
<ClCompile Include="..\_common\SafeObject.cxx" />
<ClCompile Include="..\_common\SipCallback.cxx" />
<ClCompile Include="..\_common\SipEvent.cxx" />
<ClCompile Include="..\_common\SipMessage.cxx" />
<ClCompile Include="..\_common\SipSession.cxx" />
<ClCompile Include="..\_common\SipStack.cxx" />
<ClCompile Include="..\_common\SipUri.cxx" />
<ClCompile Include="..\_common\SMSEncoder.cxx" />
<ClCompile Include="..\_common\Xcap.cxx" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="include">
<UniqueIdentifier>{a58a2275-bd4d-4d21-98b1-e3729f6e71ef}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{1c6acf3c-a6a2-4eea-9828-1b02bf401bb7}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\_common\ActionConfig.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\AudioResampler.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\Common.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\DDebug.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\MediaContent.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\MediaSessionMgr.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\Msrp.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\ProxyConsumer.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\ProxyPluginMgr.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\ProxyProducer.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SafeObject.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipCallback.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipEvent.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipMessage.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipSession.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipStack.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SipUri.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\SMSEncoder.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\tinyWRAP_config.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\_common\Xcap.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\csharp\tinyWRAP_wrap.h">
<Filter>include</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\_common\ActionConfig.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\AudioResampler.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\DDebug.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\MediaContent.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\MediaSessionMgr.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\Msrp.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\ProxyConsumer.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\ProxyPluginMgr.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\ProxyProducer.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SafeObject.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipCallback.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipEvent.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipMessage.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipSession.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipStack.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SipUri.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\SMSEncoder.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\_common\Xcap.cxx">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\csharp\tinyWRAP_wrap.cxx">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,424 @@
/* Copyright (C) 2002-2006 Jean-Marc Valin*/
/**
@file speex.h
@brief Describes the different modes of the codec
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SPEEX_H
#define SPEEX_H
/** @defgroup Codec Speex encoder and decoder
* This is the Speex codec itself.
* @{
*/
#include "speex/speex_bits.h"
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Values allowed for *ctl() requests */
/** Set enhancement on/off (decoder only) */
#define SPEEX_SET_ENH 0
/** Get enhancement state (decoder only) */
#define SPEEX_GET_ENH 1
/*Would be SPEEX_SET_FRAME_SIZE, but it's (currently) invalid*/
/** Obtain frame size used by encoder/decoder */
#define SPEEX_GET_FRAME_SIZE 3
/** Set quality value */
#define SPEEX_SET_QUALITY 4
/** Get current quality setting */
/* #define SPEEX_GET_QUALITY 5 -- Doesn't make much sense, does it? */
/** Set sub-mode to use */
#define SPEEX_SET_MODE 6
/** Get current sub-mode in use */
#define SPEEX_GET_MODE 7
/** Set low-band sub-mode to use (wideband only)*/
#define SPEEX_SET_LOW_MODE 8
/** Get current low-band mode in use (wideband only)*/
#define SPEEX_GET_LOW_MODE 9
/** Set high-band sub-mode to use (wideband only)*/
#define SPEEX_SET_HIGH_MODE 10
/** Get current high-band mode in use (wideband only)*/
#define SPEEX_GET_HIGH_MODE 11
/** Set VBR on (1) or off (0) */
#define SPEEX_SET_VBR 12
/** Get VBR status (1 for on, 0 for off) */
#define SPEEX_GET_VBR 13
/** Set quality value for VBR encoding (0-10) */
#define SPEEX_SET_VBR_QUALITY 14
/** Get current quality value for VBR encoding (0-10) */
#define SPEEX_GET_VBR_QUALITY 15
/** Set complexity of the encoder (0-10) */
#define SPEEX_SET_COMPLEXITY 16
/** Get current complexity of the encoder (0-10) */
#define SPEEX_GET_COMPLEXITY 17
/** Set bit-rate used by the encoder (or lower) */
#define SPEEX_SET_BITRATE 18
/** Get current bit-rate used by the encoder or decoder */
#define SPEEX_GET_BITRATE 19
/** Define a handler function for in-band Speex request*/
#define SPEEX_SET_HANDLER 20
/** Define a handler function for in-band user-defined request*/
#define SPEEX_SET_USER_HANDLER 22
/** Set sampling rate used in bit-rate computation */
#define SPEEX_SET_SAMPLING_RATE 24
/** Get sampling rate used in bit-rate computation */
#define SPEEX_GET_SAMPLING_RATE 25
/** Reset the encoder/decoder memories to zero*/
#define SPEEX_RESET_STATE 26
/** Get VBR info (mostly used internally) */
#define SPEEX_GET_RELATIVE_QUALITY 29
/** Set VAD status (1 for on, 0 for off) */
#define SPEEX_SET_VAD 30
/** Get VAD status (1 for on, 0 for off) */
#define SPEEX_GET_VAD 31
/** Set Average Bit-Rate (ABR) to n bits per seconds */
#define SPEEX_SET_ABR 32
/** Get Average Bit-Rate (ABR) setting (in bps) */
#define SPEEX_GET_ABR 33
/** Set DTX status (1 for on, 0 for off) */
#define SPEEX_SET_DTX 34
/** Get DTX status (1 for on, 0 for off) */
#define SPEEX_GET_DTX 35
/** Set submode encoding in each frame (1 for yes, 0 for no, setting to no breaks the standard) */
#define SPEEX_SET_SUBMODE_ENCODING 36
/** Get submode encoding in each frame */
#define SPEEX_GET_SUBMODE_ENCODING 37
/*#define SPEEX_SET_LOOKAHEAD 38*/
/** Returns the lookahead used by Speex */
#define SPEEX_GET_LOOKAHEAD 39
/** Sets tuning for packet-loss concealment (expected loss rate) */
#define SPEEX_SET_PLC_TUNING 40
/** Gets tuning for PLC */
#define SPEEX_GET_PLC_TUNING 41
/** Sets the max bit-rate allowed in VBR mode */
#define SPEEX_SET_VBR_MAX_BITRATE 42
/** Gets the max bit-rate allowed in VBR mode */
#define SPEEX_GET_VBR_MAX_BITRATE 43
/** Turn on/off input/output high-pass filtering */
#define SPEEX_SET_HIGHPASS 44
/** Get status of input/output high-pass filtering */
#define SPEEX_GET_HIGHPASS 45
/** Get "activity level" of the last decoded frame, i.e.
how much damage we cause if we remove the frame */
#define SPEEX_GET_ACTIVITY 47
/* Preserving compatibility:*/
/** Equivalent to SPEEX_SET_ENH */
#define SPEEX_SET_PF 0
/** Equivalent to SPEEX_GET_ENH */
#define SPEEX_GET_PF 1
/* Values allowed for mode queries */
/** Query the frame size of a mode */
#define SPEEX_MODE_FRAME_SIZE 0
/** Query the size of an encoded frame for a particular sub-mode */
#define SPEEX_SUBMODE_BITS_PER_FRAME 1
/** Get major Speex version */
#define SPEEX_LIB_GET_MAJOR_VERSION 1
/** Get minor Speex version */
#define SPEEX_LIB_GET_MINOR_VERSION 3
/** Get micro Speex version */
#define SPEEX_LIB_GET_MICRO_VERSION 5
/** Get extra Speex version */
#define SPEEX_LIB_GET_EXTRA_VERSION 7
/** Get Speex version string */
#define SPEEX_LIB_GET_VERSION_STRING 9
/*#define SPEEX_LIB_SET_ALLOC_FUNC 10
#define SPEEX_LIB_GET_ALLOC_FUNC 11
#define SPEEX_LIB_SET_FREE_FUNC 12
#define SPEEX_LIB_GET_FREE_FUNC 13
#define SPEEX_LIB_SET_WARNING_FUNC 14
#define SPEEX_LIB_GET_WARNING_FUNC 15
#define SPEEX_LIB_SET_ERROR_FUNC 16
#define SPEEX_LIB_GET_ERROR_FUNC 17
*/
/** Number of defined modes in Speex */
#define SPEEX_NB_MODES 3
/** modeID for the defined narrowband mode */
#define SPEEX_MODEID_NB 0
/** modeID for the defined wideband mode */
#define SPEEX_MODEID_WB 1
/** modeID for the defined ultra-wideband mode */
#define SPEEX_MODEID_UWB 2
struct SpeexMode;
/* Prototypes for mode function pointers */
/** Encoder state initialization function */
typedef void *(*encoder_init_func)(const struct SpeexMode *mode);
/** Encoder state destruction function */
typedef void (*encoder_destroy_func)(void *st);
/** Main encoding function */
typedef int (*encode_func)(void *state, void *in, SpeexBits *bits);
/** Function for controlling the encoder options */
typedef int (*encoder_ctl_func)(void *state, int request, void *ptr);
/** Decoder state initialization function */
typedef void *(*decoder_init_func)(const struct SpeexMode *mode);
/** Decoder state destruction function */
typedef void (*decoder_destroy_func)(void *st);
/** Main decoding function */
typedef int (*decode_func)(void *state, SpeexBits *bits, void *out);
/** Function for controlling the decoder options */
typedef int (*decoder_ctl_func)(void *state, int request, void *ptr);
/** Query function for a mode */
typedef int (*mode_query_func)(const void *mode, int request, void *ptr);
/** Struct defining a Speex mode */
typedef struct SpeexMode {
/** Pointer to the low-level mode data */
const void *mode;
/** Pointer to the mode query function */
mode_query_func query;
/** The name of the mode (you should not rely on this to identify the mode)*/
const char *modeName;
/**ID of the mode*/
int modeID;
/**Version number of the bitstream (incremented every time we break
bitstream compatibility*/
int bitstream_version;
/** Pointer to encoder initialization function */
encoder_init_func enc_init;
/** Pointer to encoder destruction function */
encoder_destroy_func enc_destroy;
/** Pointer to frame encoding function */
encode_func enc;
/** Pointer to decoder initialization function */
decoder_init_func dec_init;
/** Pointer to decoder destruction function */
decoder_destroy_func dec_destroy;
/** Pointer to frame decoding function */
decode_func dec;
/** ioctl-like requests for encoder */
encoder_ctl_func enc_ctl;
/** ioctl-like requests for decoder */
decoder_ctl_func dec_ctl;
} SpeexMode;
/**
* Returns a handle to a newly created Speex encoder state structure. For now,
* the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* encode, you need one state per channel.
*
* @param mode The mode to use (either speex_nb_mode or speex_wb.mode)
* @return A newly created encoder state or NULL if state allocation fails
*/
void *speex_encoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing Speex encoder state.
* @param state Encoder state to be destroyed */
void speex_encoder_destroy(void *state);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
@param in Frame that will be encoded with a +-2^15 range. This data MAY be
overwritten by the encoder and should be considered uninitialised
after the call.
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
*/
int speex_encode(void *state, float *in, SpeexBits *bits);
/** Uses an existing encoder state to encode one frame of speech pointed to by
"in". The encoded bit-stream is saved in "bits".
@param state Encoder state
@param in Frame that will be encoded with a +-2^15 range
@param bits Bit-stream where the data will be written
@return 0 if frame needs not be transmitted (DTX only), 1 otherwise
*/
int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits);
/** Used like the ioctl function to control the encoder parameters
*
* @param state Encoder state
* @param request ioctl-type request (one of the SPEEX_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown, -2 for invalid parameter
*/
int speex_encoder_ctl(void *state, int request, void *ptr);
/** Returns a handle to a newly created decoder state structure. For now,
* the mode argument can be &nb_mode or &wb_mode . In the future, more modes
* may be added. Note that for now if you have more than one channels to
* decode, you need one state per channel.
*
* @param mode Speex mode (one of speex_nb_mode or speex_wb_mode)
* @return A newly created decoder state or NULL if state allocation fails
*/
void *speex_decoder_init(const SpeexMode *mode);
/** Frees all resources associated to an existing decoder state.
*
* @param state State to be destroyed
*/
void speex_decoder_destroy(void *state);
/** Uses an existing decoder state to decode one frame of speech from
* bit-stream bits. The output speech is saved written to out.
*
* @param state Decoder state
* @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
* @param out Where to write the decoded frame
* @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
*/
int speex_decode(void *state, SpeexBits *bits, float *out);
/** Uses an existing decoder state to decode one frame of speech from
* bit-stream bits. The output speech is saved written to out.
*
* @param state Decoder state
* @param bits Bit-stream from which to decode the frame (NULL if the packet was lost)
* @param out Where to write the decoded frame
* @return return status (0 for no error, -1 for end of stream, -2 corrupt stream)
*/
int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out);
/** Used like the ioctl function to control the encoder parameters
*
* @param state Decoder state
* @param request ioctl-type request (one of the SPEEX_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown, -2 for invalid parameter
*/
int speex_decoder_ctl(void *state, int request, void *ptr);
/** Query function for mode information
*
* @param mode Speex mode
* @param request ioctl-type request (one of the SPEEX_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown, -2 for invalid parameter
*/
int speex_mode_query(const SpeexMode *mode, int request, void *ptr);
/** Functions for controlling the behavior of libspeex
* @param request ioctl-type request (one of the SPEEX_LIB_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown, -2 for invalid parameter
*/
int speex_lib_ctl(int request, void *ptr);
/** Default narrowband mode */
extern const SpeexMode speex_nb_mode;
/** Default wideband mode */
extern const SpeexMode speex_wb_mode;
/** Default "ultra-wideband" mode */
extern const SpeexMode speex_uwb_mode;
/** List of all modes available */
extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES];
/** Obtain one of the modes available */
const SpeexMode * speex_lib_get_mode (int mode);
#ifndef WIN32
/* We actually override the function in the narrowband case so that we can avoid linking in the wideband stuff */
#define speex_lib_get_mode(mode) ((mode)==SPEEX_MODEID_NB ? &speex_nb_mode : speex_lib_get_mode (mode))
#endif
#ifdef __cplusplus
}
#endif
/** @}*/
#endif

View File

@ -0,0 +1,174 @@
/* Copyright (C) 2002 Jean-Marc Valin */
/**
@file speex_bits.h
@brief Handles bit packing/unpacking
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BITS_H
#define BITS_H
/** @defgroup SpeexBits SpeexBits: Bit-stream manipulations
* This is the structure that holds the bit-stream when encoding or decoding
* with Speex. It allows some manipulations as well.
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** Bit-packing data structure representing (part of) a bit-stream. */
typedef struct SpeexBits {
char *chars; /**< "raw" data */
int nbBits; /**< Total number of bits stored in the stream*/
int charPtr; /**< Position of the byte "cursor" */
int bitPtr; /**< Position of the bit "cursor" within the current char */
int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */
int overflow;/**< Set to one if we try to read past the valid data */
int buf_size;/**< Allocated size for buffer */
int reserved1; /**< Reserved for future use */
void *reserved2; /**< Reserved for future use */
} SpeexBits;
/** Initializes and allocates resources for a SpeexBits struct */
void speex_bits_init(SpeexBits *bits);
/** Initializes SpeexBits struct using a pre-allocated buffer*/
void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size);
/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */
void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size);
/** Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.*/
void speex_bits_destroy(SpeexBits *bits);
/** Resets bits to initial value (just after initialization, erasing content)*/
void speex_bits_reset(SpeexBits *bits);
/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */
void speex_bits_rewind(SpeexBits *bits);
/** Initializes the bit-stream from the data in an area of memory */
void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
/** Append bytes to the bit-stream
*
* @param bits Bit-stream to operate on
* @param bytes pointer to the bytes what will be appended
* @param len Number of bytes of append
*/
void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len);
/** Write the content of a bit-stream to an area of memory
*
* @param bits Bit-stream to operate on
* @param bytes Memory location where to write the bits
* @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer)
* @return Number of bytes written to the "bytes" buffer
*/
int speex_bits_write(SpeexBits *bits, char *bytes, int max_len);
/** Like speex_bits_write, but writes only the complete bytes in the stream. Also removes the written bytes from the stream */
int speex_bits_write_whole_bytes(SpeexBits *bits, char *bytes, int max_len);
/** Append bits to the bit-stream
* @param bits Bit-stream to operate on
* @param data Value to append as integer
* @param nbBits number of bits to consider in "data"
*/
void speex_bits_pack(SpeexBits *bits, int data, int nbBits);
/** Interpret the next bits in the bit-stream as a signed integer
*
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to interpret
* @return A signed integer represented by the bits read
*/
int speex_bits_unpack_signed(SpeexBits *bits, int nbBits);
/** Interpret the next bits in the bit-stream as an unsigned integer
*
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to interpret
* @return An unsigned integer represented by the bits read
*/
unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
/** Returns the number of bytes in the bit-stream, including the last one even if it is not "full"
*
* @param bits Bit-stream to operate on
* @return Number of bytes in the stream
*/
int speex_bits_nbytes(SpeexBits *bits);
/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
*
* @param bits Bit-stream to operate on
* @param nbBits Number of bits to look for
* @return Value of the bits peeked, interpreted as unsigned
*/
unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
/** Get the value of the next bit in the stream, without modifying the
* "cursor" position
*
* @param bits Bit-stream to operate on
* @return Value of the bit peeked (one bit only)
*/
int speex_bits_peek(SpeexBits *bits);
/** Advances the position of the "bit cursor" in the stream
*
* @param bits Bit-stream to operate on
* @param n Number of bits to advance
*/
void speex_bits_advance(SpeexBits *bits, int n);
/** Returns the number of bits remaining to be read in a stream
*
* @param bits Bit-stream to operate on
* @return Number of bits that can still be read from the stream
*/
int speex_bits_remaining(SpeexBits *bits);
/** Insert a terminator so that the data can be sent as a packet while auto-detecting
* the number of frames in each packet
*
* @param bits Bit-stream to operate on
*/
void speex_bits_insert_terminator(SpeexBits *bits);
#ifdef __cplusplus
}
#endif
/* @} */
#endif

View File

@ -0,0 +1,68 @@
/* Copyright (C) 2007 Jean-Marc Valin
File: speex_buffer.h
This is a very simple ring buffer implementation. It is not thread-safe
so you need to do your own locking.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#ifndef SPEEX_BUFFER_H
#define SPEEX_BUFFER_H
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
struct SpeexBuffer_;
typedef struct SpeexBuffer_ SpeexBuffer;
SpeexBuffer *speex_buffer_init(int size);
void speex_buffer_destroy(SpeexBuffer *st);
int speex_buffer_write(SpeexBuffer *st, void *data, int len);
int speex_buffer_writezeros(SpeexBuffer *st, int len);
int speex_buffer_read(SpeexBuffer *st, void *data, int len);
int speex_buffer_get_available(SpeexBuffer *st);
int speex_buffer_resize(SpeexBuffer *st, int len);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,134 @@
/* Copyright (C) 2002 Jean-Marc Valin*/
/**
@file speex_callbacks.h
@brief Describes callback handling and in-band signalling
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SPEEX_CALLBACKS_H
#define SPEEX_CALLBACKS_H
/** @defgroup SpeexCallbacks Various definitions for Speex callbacks supported by the decoder.
* @{
*/
#include "speex.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Total number of callbacks */
#define SPEEX_MAX_CALLBACKS 16
/* Describes all the in-band requests */
/*These are 1-bit requests*/
/** Request for perceptual enhancement (1 for on, 0 for off) */
#define SPEEX_INBAND_ENH_REQUEST 0
/** Reserved */
#define SPEEX_INBAND_RESERVED1 1
/*These are 4-bit requests*/
/** Request for a mode change */
#define SPEEX_INBAND_MODE_REQUEST 2
/** Request for a low mode change */
#define SPEEX_INBAND_LOW_MODE_REQUEST 3
/** Request for a high mode change */
#define SPEEX_INBAND_HIGH_MODE_REQUEST 4
/** Request for VBR (1 on, 0 off) */
#define SPEEX_INBAND_VBR_QUALITY_REQUEST 5
/** Request to be sent acknowledge */
#define SPEEX_INBAND_ACKNOWLEDGE_REQUEST 6
/** Request for VBR (1 for on, 0 for off) */
#define SPEEX_INBAND_VBR_REQUEST 7
/*These are 8-bit requests*/
/** Send a character in-band */
#define SPEEX_INBAND_CHAR 8
/** Intensity stereo information */
#define SPEEX_INBAND_STEREO 9
/*These are 16-bit requests*/
/** Transmit max bit-rate allowed */
#define SPEEX_INBAND_MAX_BITRATE 10
/*These are 32-bit requests*/
/** Acknowledge packet reception */
#define SPEEX_INBAND_ACKNOWLEDGE 12
/** Callback function type */
typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
/** Callback information */
typedef struct SpeexCallback {
int callback_id; /**< ID associated to the callback */
speex_callback_func func; /**< Callback handler function */
void *data; /**< Data that will be sent to the handler */
void *reserved1; /**< Reserved for future use */
int reserved2; /**< Reserved for future use */
} SpeexCallback;
/** Handle in-band request */
int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state);
/** Standard handler for mode request (change mode, no questions asked) */
int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for high mode request (change high mode, no questions asked) */
int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for in-band characters (write to stderr) */
int speex_std_char_handler(SpeexBits *bits, void *state, void *data);
/** Default handler for user-defined requests: in this case, just ignore */
int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for low mode request (change low mode, no questions asked) */
int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for VBR request (Set VBR, no questions asked) */
int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for enhancer request (Turn enhancer on/off, no questions asked) */
int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data);
/** Standard handler for VBR quality request (Set VBR quality, no questions asked) */
int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data);
#ifdef __cplusplus
}
#endif
/** @} */
#endif

View File

@ -0,0 +1,170 @@
/* Copyright (C) Jean-Marc Valin */
/**
@file speex_echo.h
@brief Echo cancellation
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#ifndef SPEEX_ECHO_H
#define SPEEX_ECHO_H
/** @defgroup SpeexEchoState SpeexEchoState: Acoustic echo canceller
* This is the acoustic echo canceller module.
* @{
*/
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Obtain frame size used by the AEC */
#define SPEEX_ECHO_GET_FRAME_SIZE 3
/** Set sampling rate */
#define SPEEX_ECHO_SET_SAMPLING_RATE 24
/** Get sampling rate */
#define SPEEX_ECHO_GET_SAMPLING_RATE 25
/* Can't set window sizes */
/** Get size of impulse response (int32) */
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE_SIZE 27
/* Can't set window content */
/** Get impulse response (int32[]) */
#define SPEEX_ECHO_GET_IMPULSE_RESPONSE 29
/** Internal echo canceller state. Should never be accessed directly. */
struct SpeexEchoState_;
/** @class SpeexEchoState
* This holds the state of the echo canceller. You need one per channel.
*/
/** Internal echo canceller state. Should never be accessed directly. */
typedef struct SpeexEchoState_ SpeexEchoState;
/** Creates a new echo canceller state
* @param frame_size Number of samples to process at one time (should correspond to 10-20 ms)
* @param filter_length Number of samples of echo to cancel (should generally correspond to 100-500 ms)
* @return Newly-created echo canceller state
*/
SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length);
/** Creates a new multi-channel echo canceller state
* @param frame_size Number of samples to process at one time (should correspond to 10-20 ms)
* @param filter_length Number of samples of echo to cancel (should generally correspond to 100-500 ms)
* @param nb_mic Number of microphone channels
* @param nb_speakers Number of speaker channels
* @return Newly-created echo canceller state
*/
SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers);
/** Destroys an echo canceller state
* @param st Echo canceller state
*/
void speex_echo_state_destroy(SpeexEchoState *st);
/** Performs echo cancellation a frame, based on the audio sent to the speaker (no delay is added
* to playback in this form)
*
* @param st Echo canceller state
* @param rec Signal from the microphone (near end + far end echo)
* @param play Signal played to the speaker (received from far end)
* @param out Returns near-end signal with echo removed
*/
void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out);
/** Performs echo cancellation a frame (deprecated) */
void speex_echo_cancel(SpeexEchoState *st, const spx_int16_t *rec, const spx_int16_t *play, spx_int16_t *out, spx_int32_t *Yout);
/** Perform echo cancellation using internal playback buffer, which is delayed by two frames
* to account for the delay introduced by most soundcards (but it could be off!)
* @param st Echo canceller state
* @param rec Signal from the microphone (near end + far end echo)
* @param out Returns near-end signal with echo removed
*/
void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t *out);
/** Let the echo canceller know that a frame was just queued to the soundcard
* @param st Echo canceller state
* @param play Signal played to the speaker (received from far end)
*/
void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play);
/** Reset the echo canceller to its original state
* @param st Echo canceller state
*/
void speex_echo_state_reset(SpeexEchoState *st);
/** Used like the ioctl function to control the echo canceller parameters
*
* @param st Echo canceller state
* @param request ioctl-type request (one of the SPEEX_ECHO_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown
*/
int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr);
struct SpeexDecorrState_;
typedef struct SpeexDecorrState_ SpeexDecorrState;
/** Create a state for the channel decorrelation algorithm
This is useful for multi-channel echo cancellation only
* @param rate Sampling rate
* @param channels Number of channels (it's a bit pointless if you don't have at least 2)
* @param frame_size Size of the frame to process at ones (counting samples *per* channel)
*/
SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size);
/** Remove correlation between the channels by modifying the phase and possibly
adding noise in a way that is not (or little) perceptible.
* @param st Decorrelator state
* @param in Input audio in interleaved format
* @param out Result of the decorrelation (out *may* alias in)
* @param strength How much alteration of the audio to apply from 0 to 100.
*/
void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength);
/** Destroy a Decorrelation state
* @param st State to destroy
*/
void speex_decorrelate_destroy(SpeexDecorrState *st);
#ifdef __cplusplus
}
#endif
/** @}*/
#endif

View File

@ -0,0 +1,94 @@
/* Copyright (C) 2002 Jean-Marc Valin */
/**
@file speex_header.h
@brief Describes the Speex header
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SPEEX_HEADER_H
#define SPEEX_HEADER_H
/** @defgroup SpeexHeader SpeexHeader: Makes it easy to write/parse an Ogg/Speex header
* This is the Speex header for the Ogg encapsulation. You don't need that if you just use RTP.
* @{
*/
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
struct SpeexMode;
/** Length of the Speex header identifier */
#define SPEEX_HEADER_STRING_LENGTH 8
/** Maximum number of characters for encoding the Speex version number in the header */
#define SPEEX_HEADER_VERSION_LENGTH 20
/** Speex header info for file-based formats */
typedef struct SpeexHeader {
char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */
char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */
spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */
spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */
spx_int32_t rate; /**< Sampling rate used */
spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */
spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */
spx_int32_t nb_channels; /**< Number of channels encoded */
spx_int32_t bitrate; /**< Bit-rate used */
spx_int32_t frame_size; /**< Size of frames */
spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */
spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */
spx_int32_t extra_headers; /**< Number of additional headers after the comments */
spx_int32_t reserved1; /**< Reserved for future use, must be zero */
spx_int32_t reserved2; /**< Reserved for future use, must be zero */
} SpeexHeader;
/** Initializes a SpeexHeader using basic information */
void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const struct SpeexMode *m);
/** Creates the header packet from the header itself (mostly involves endianness conversion) */
char *speex_header_to_packet(SpeexHeader *header, int *size);
/** Creates a SpeexHeader from a packet */
SpeexHeader *speex_packet_to_header(char *packet, int size);
/** Frees the memory allocated by either speex_header_to_packet() or speex_packet_to_header() */
void speex_header_free(void *ptr);
#ifdef __cplusplus
}
#endif
/** @} */
#endif

View File

@ -0,0 +1,197 @@
/* Copyright (C) 2002 Jean-Marc Valin */
/**
@file speex_jitter.h
@brief Adaptive jitter buffer for Speex
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SPEEX_JITTER_H
#define SPEEX_JITTER_H
/** @defgroup JitterBuffer JitterBuffer: Adaptive jitter buffer
* This is the jitter buffer that reorders UDP/RTP packets and adjusts the buffer size
* to maintain good quality and low latency.
* @{
*/
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Generic adaptive jitter buffer state */
struct JitterBuffer_;
/** Generic adaptive jitter buffer state */
typedef struct JitterBuffer_ JitterBuffer;
/** Definition of an incoming packet */
typedef struct _JitterBufferPacket JitterBufferPacket;
/** Definition of an incoming packet */
struct _JitterBufferPacket {
char *data; /**< Data bytes contained in the packet */
spx_uint32_t len; /**< Length of the packet in bytes */
spx_uint32_t timestamp; /**< Timestamp for the packet */
spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */
spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */
spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */
};
/** Packet has been retrieved */
#define JITTER_BUFFER_OK 0
/** Packet is lost or is late */
#define JITTER_BUFFER_MISSING 1
/** A "fake" packet is meant to be inserted here to increase buffering */
#define JITTER_BUFFER_INSERTION 2
/** There was an error in the jitter buffer */
#define JITTER_BUFFER_INTERNAL_ERROR -1
/** Invalid argument */
#define JITTER_BUFFER_BAD_ARGUMENT -2
/** Set minimum amount of extra buffering required (margin) */
#define JITTER_BUFFER_SET_MARGIN 0
/** Get minimum amount of extra buffering required (margin) */
#define JITTER_BUFFER_GET_MARGIN 1
/* JITTER_BUFFER_SET_AVAILABLE_COUNT wouldn't make sense */
/** Get the amount of available packets currently buffered */
#define JITTER_BUFFER_GET_AVAILABLE_COUNT 3
/** Included because of an early misspelling (will remove in next release) */
#define JITTER_BUFFER_GET_AVALIABLE_COUNT 3
/** Assign a function to destroy unused packet. When setting that, the jitter
buffer no longer copies packet data. */
#define JITTER_BUFFER_SET_DESTROY_CALLBACK 4
/** */
#define JITTER_BUFFER_GET_DESTROY_CALLBACK 5
/** Tell the jitter buffer to only adjust the delay in multiples of the step parameter provided */
#define JITTER_BUFFER_SET_DELAY_STEP 6
/** */
#define JITTER_BUFFER_GET_DELAY_STEP 7
/** Tell the jitter buffer to only do concealment in multiples of the size parameter provided */
#define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8
#define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9
/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss
should be half of that or less. */
#define JITTER_BUFFER_SET_MAX_LATE_RATE 10
#define JITTER_BUFFER_GET_MAX_LATE_RATE 11
/** Equivalent cost of one percent late packet in timestamp units */
#define JITTER_BUFFER_SET_LATE_COST 12
#define JITTER_BUFFER_GET_LATE_COST 13
/** Initialises jitter buffer
*
* @param step_size Starting value for the size of concleanment packets and delay
adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP
and JITTER_BUFFER_GET_CONCEALMENT_SIZE.
* @return Newly created jitter buffer state
*/
JitterBuffer *jitter_buffer_init(int step_size);
/** Restores jitter buffer to its original state
*
* @param jitter Jitter buffer state
*/
void jitter_buffer_reset(JitterBuffer *jitter);
/** Destroys jitter buffer
*
* @param jitter Jitter buffer state
*/
void jitter_buffer_destroy(JitterBuffer *jitter);
/** Put one packet into the jitter buffer
*
* @param jitter Jitter buffer state
* @param packet Incoming packet
*/
void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet);
/** Get one packet from the jitter buffer
*
* @param jitter Jitter buffer state
* @param packet Returned packet
* @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee)
* @param current_timestamp Timestamp for the returned packet
*/
int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset);
/** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp.
* This is mainly useful for media where a single "frame" can be split into several packets.
*
* @param jitter Jitter buffer state
* @param packet Returned packet
*/
int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet);
/** Get pointer timestamp of jitter buffer
*
* @param jitter Jitter buffer state
*/
int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter);
/** Advance by one tick
*
* @param jitter Jitter buffer state
*/
void jitter_buffer_tick(JitterBuffer *jitter);
/** Telling the jitter buffer about the remaining data in the application buffer
* @param jitter Jitter buffer state
* @param rem Amount of data buffered by the application (timestamp units)
*/
void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem);
/** Used like the ioctl function to control the jitter buffer parameters
*
* @param jitter Jitter buffer state
* @param request ioctl-type request (one of the JITTER_BUFFER_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown
*/
int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr);
int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset);
/* @} */
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,219 @@
/* Copyright (C) 2003 Epic Games
Written by Jean-Marc Valin */
/**
* @file speex_preprocess.h
* @brief Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#ifndef SPEEX_PREPROCESS_H
#define SPEEX_PREPROCESS_H
/** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor
* This is the Speex preprocessor. The preprocess can do noise suppression,
* residual echo suppression (after using the echo canceller), automatic
* gain control (AGC) and voice activity detection (VAD).
* @{
*/
#include "speex/speex_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/** State of the preprocessor (one per channel). Should never be accessed directly. */
struct SpeexPreprocessState_;
/** State of the preprocessor (one per channel). Should never be accessed directly. */
typedef struct SpeexPreprocessState_ SpeexPreprocessState;
/** Creates a new preprocessing state. You MUST create one state per channel processed.
* @param frame_size Number of samples to process at one time (should correspond to 10-20 ms). Must be
* the same value as that used for the echo canceller for residual echo cancellation to work.
* @param sampling_rate Sampling rate used for the input.
* @return Newly created preprocessor state
*/
SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate);
/** Destroys a preprocessor state
* @param st Preprocessor state to destroy
*/
void speex_preprocess_state_destroy(SpeexPreprocessState *st);
/** Preprocess a frame
* @param st Preprocessor state
* @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init().
* @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on.
*/
int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x);
/** Preprocess a frame (deprecated, use speex_preprocess_run() instead)*/
int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo);
/** Update preprocessor state, but do not compute the output
* @param st Preprocessor state
* @param x Audio sample vector (in only). Must be same size as specified in speex_preprocess_state_init().
*/
void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x);
/** Used like the ioctl function to control the preprocessor parameters
* @param st Preprocessor state
* @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros)
* @param ptr Data exchanged to-from function
* @return 0 if no error, -1 if request in unknown
*/
int speex_preprocess_ctl(SpeexPreprocessState *st, int request, void *ptr);
/** Set preprocessor denoiser state */
#define SPEEX_PREPROCESS_SET_DENOISE 0
/** Get preprocessor denoiser state */
#define SPEEX_PREPROCESS_GET_DENOISE 1
/** Set preprocessor Automatic Gain Control state */
#define SPEEX_PREPROCESS_SET_AGC 2
/** Get preprocessor Automatic Gain Control state */
#define SPEEX_PREPROCESS_GET_AGC 3
/** Set preprocessor Voice Activity Detection state */
#define SPEEX_PREPROCESS_SET_VAD 4
/** Get preprocessor Voice Activity Detection state */
#define SPEEX_PREPROCESS_GET_VAD 5
/** Set preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_SET_AGC_LEVEL 6
/** Get preprocessor Automatic Gain Control level (float) */
#define SPEEX_PREPROCESS_GET_AGC_LEVEL 7
/** Set preprocessor dereverb state */
#define SPEEX_PREPROCESS_SET_DEREVERB 8
/** Get preprocessor dereverb state */
#define SPEEX_PREPROCESS_GET_DEREVERB 9
/** Set preprocessor dereverb level */
#define SPEEX_PREPROCESS_SET_DEREVERB_LEVEL 10
/** Get preprocessor dereverb level */
#define SPEEX_PREPROCESS_GET_DEREVERB_LEVEL 11
/** Set preprocessor dereverb decay */
#define SPEEX_PREPROCESS_SET_DEREVERB_DECAY 12
/** Get preprocessor dereverb decay */
#define SPEEX_PREPROCESS_GET_DEREVERB_DECAY 13
/** Set probability required for the VAD to go from silence to voice */
#define SPEEX_PREPROCESS_SET_PROB_START 14
/** Get probability required for the VAD to go from silence to voice */
#define SPEEX_PREPROCESS_GET_PROB_START 15
/** Set probability required for the VAD to stay in the voice state (integer percent) */
#define SPEEX_PREPROCESS_SET_PROB_CONTINUE 16
/** Get probability required for the VAD to stay in the voice state (integer percent) */
#define SPEEX_PREPROCESS_GET_PROB_CONTINUE 17
/** Set maximum attenuation of the noise in dB (negative number) */
#define SPEEX_PREPROCESS_SET_NOISE_SUPPRESS 18
/** Get maximum attenuation of the noise in dB (negative number) */
#define SPEEX_PREPROCESS_GET_NOISE_SUPPRESS 19
/** Set maximum attenuation of the residual echo in dB (negative number) */
#define SPEEX_PREPROCESS_SET_ECHO_SUPPRESS 20
/** Get maximum attenuation of the residual echo in dB (negative number) */
#define SPEEX_PREPROCESS_GET_ECHO_SUPPRESS 21
/** Set maximum attenuation of the residual echo in dB when near end is active (negative number) */
#define SPEEX_PREPROCESS_SET_ECHO_SUPPRESS_ACTIVE 22
/** Get maximum attenuation of the residual echo in dB when near end is active (negative number) */
#define SPEEX_PREPROCESS_GET_ECHO_SUPPRESS_ACTIVE 23
/** Set the corresponding echo canceller state so that residual echo suppression can be performed (NULL for no residual echo suppression) */
#define SPEEX_PREPROCESS_SET_ECHO_STATE 24
/** Get the corresponding echo canceller state */
#define SPEEX_PREPROCESS_GET_ECHO_STATE 25
/** Set maximal gain increase in dB/second (int32) */
#define SPEEX_PREPROCESS_SET_AGC_INCREMENT 26
/** Get maximal gain increase in dB/second (int32) */
#define SPEEX_PREPROCESS_GET_AGC_INCREMENT 27
/** Set maximal gain decrease in dB/second (int32) */
#define SPEEX_PREPROCESS_SET_AGC_DECREMENT 28
/** Get maximal gain decrease in dB/second (int32) */
#define SPEEX_PREPROCESS_GET_AGC_DECREMENT 29
/** Set maximal gain in dB (int32) */
#define SPEEX_PREPROCESS_SET_AGC_MAX_GAIN 30
/** Get maximal gain in dB (int32) */
#define SPEEX_PREPROCESS_GET_AGC_MAX_GAIN 31
/* Can't set loudness */
/** Get loudness */
#define SPEEX_PREPROCESS_GET_AGC_LOUDNESS 33
/* Can't set gain */
/** Get current gain (int32 percent) */
#define SPEEX_PREPROCESS_GET_AGC_GAIN 35
/* Can't set spectrum size */
/** Get spectrum size for power spectrum (int32) */
#define SPEEX_PREPROCESS_GET_PSD_SIZE 37
/* Can't set power spectrum */
/** Get power spectrum (int32[] of squared values) */
#define SPEEX_PREPROCESS_GET_PSD 39
/* Can't set noise size */
/** Get spectrum size for noise estimate (int32) */
#define SPEEX_PREPROCESS_GET_NOISE_PSD_SIZE 41
/* Can't set noise estimate */
/** Get noise estimate (int32[] of squared values) */
#define SPEEX_PREPROCESS_GET_NOISE_PSD 43
/* Can't set speech probability */
/** Get speech probability in last frame (int32). */
#define SPEEX_PREPROCESS_GET_PROB 45
/** Set preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_SET_AGC_TARGET 46
/** Get preprocessor Automatic Gain Control level (int32) */
#define SPEEX_PREPROCESS_GET_AGC_TARGET 47
#ifdef __cplusplus
}
#endif
/** @}*/
#endif

View File

@ -0,0 +1,340 @@
/* Copyright (C) 2007 Jean-Marc Valin
File: speex_resampler.h
Resampling code
The design goals of this code are:
- Very fast algorithm
- Low memory requirement
- Good *perceptual* quality (and not best SNR)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. 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.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
#ifndef SPEEX_RESAMPLER_H
#define SPEEX_RESAMPLER_H
#ifdef OUTSIDE_SPEEX
/********* WARNING: MENTAL SANITY ENDS HERE *************/
/* If the resampler is defined outside of Speex, we change the symbol names so that
there won't be any clash if linking with Speex later on. */
/* #define RANDOM_PREFIX your software name here */
#ifndef RANDOM_PREFIX
#error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes"
#endif
#define CAT_PREFIX2(a,b) a ## b
#define CAT_PREFIX(a,b) CAT_PREFIX2(a, b)
#define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init)
#define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac)
#define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy)
#define speex_resampler_process_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_float)
#define speex_resampler_process_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_int)
#define speex_resampler_process_interleaved_float CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_float)
#define speex_resampler_process_interleaved_int CAT_PREFIX(RANDOM_PREFIX,_resampler_process_interleaved_int)
#define speex_resampler_set_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate)
#define speex_resampler_get_rate CAT_PREFIX(RANDOM_PREFIX,_resampler_get_rate)
#define speex_resampler_set_rate_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_set_rate_frac)
#define speex_resampler_get_ratio CAT_PREFIX(RANDOM_PREFIX,_resampler_get_ratio)
#define speex_resampler_set_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_set_quality)
#define speex_resampler_get_quality CAT_PREFIX(RANDOM_PREFIX,_resampler_get_quality)
#define speex_resampler_set_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_input_stride)
#define speex_resampler_get_input_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_stride)
#define speex_resampler_set_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_set_output_stride)
#define speex_resampler_get_output_stride CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_stride)
#define speex_resampler_get_input_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_input_latency)
#define speex_resampler_get_output_latency CAT_PREFIX(RANDOM_PREFIX,_resampler_get_output_latency)
#define speex_resampler_skip_zeros CAT_PREFIX(RANDOM_PREFIX,_resampler_skip_zeros)
#define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
#define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)
#define spx_int16_t short
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
#else /* OUTSIDE_SPEEX */
#include "speex/speex_types.h"
#endif /* OUTSIDE_SPEEX */
#ifdef __cplusplus
extern "C" {
#endif
#define SPEEX_RESAMPLER_QUALITY_MAX 10
#define SPEEX_RESAMPLER_QUALITY_MIN 0
#define SPEEX_RESAMPLER_QUALITY_DEFAULT 4
#define SPEEX_RESAMPLER_QUALITY_VOIP 3
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
enum {
RESAMPLER_ERR_SUCCESS = 0,
RESAMPLER_ERR_ALLOC_FAILED = 1,
RESAMPLER_ERR_BAD_STATE = 2,
RESAMPLER_ERR_INVALID_ARG = 3,
RESAMPLER_ERR_PTR_OVERLAP = 4,
RESAMPLER_ERR_MAX_ERROR
};
struct SpeexResamplerState_;
typedef struct SpeexResamplerState_ SpeexResamplerState;
/** Create a new resampler with integer input and output rates.
* @param nb_channels Number of channels to be processed
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
* @param quality Resampling quality between 0 and 10, where 0 has poor quality
* and 10 has very high quality.
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels,
spx_uint32_t in_rate,
spx_uint32_t out_rate,
int quality,
int *err);
/** Create a new resampler with fractional input/output rates. The sampling
* rate ratio is an arbitrary rational number with both the numerator and
* denominator being 32-bit integers.
* @param nb_channels Number of channels to be processed
* @param ratio_num Numerator of the sampling rate ratio
* @param ratio_den Denominator of the sampling rate ratio
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
* @param quality Resampling quality between 0 and 10, where 0 has poor quality
* and 10 has very high quality.
* @return Newly created resampler state
* @retval NULL Error: not enough memory
*/
SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate,
int quality,
int *err);
/** Destroy a resampler state.
* @param st Resampler state
*/
void speex_resampler_destroy(SpeexResamplerState *st);
/** Resample a float array. The input and output buffers must *not* overlap.
* @param st Resampler state
* @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the
* number of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
int speex_resampler_process_float(SpeexResamplerState *st,
spx_uint32_t channel_index,
const float *in,
spx_uint32_t *in_len,
float *out,
spx_uint32_t *out_len);
/** Resample an int array. The input and output buffers must *not* overlap.
* @param st Resampler state
* @param channel_index Index of the channel to process for the multi-channel
* base (0 otherwise)
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
* of samples processed
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written
*/
int speex_resampler_process_int(SpeexResamplerState *st,
spx_uint32_t channel_index,
const spx_int16_t *in,
spx_uint32_t *in_len,
spx_int16_t *out,
spx_uint32_t *out_len);
/** Resample an interleaved float array. The input and output buffers must *not* overlap.
* @param st Resampler state
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
* of samples processed. This is all per-channel.
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
int speex_resampler_process_interleaved_float(SpeexResamplerState *st,
const float *in,
spx_uint32_t *in_len,
float *out,
spx_uint32_t *out_len);
/** Resample an interleaved int array. The input and output buffers must *not* overlap.
* @param st Resampler state
* @param in Input buffer
* @param in_len Number of input samples in the input buffer. Returns the number
* of samples processed. This is all per-channel.
* @param out Output buffer
* @param out_len Size of the output buffer. Returns the number of samples written.
* This is all per-channel.
*/
int speex_resampler_process_interleaved_int(SpeexResamplerState *st,
const spx_int16_t *in,
spx_uint32_t *in_len,
spx_int16_t *out,
spx_uint32_t *out_len);
/** Set (change) the input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz).
* @param out_rate Output sampling rate (integer number of Hz).
*/
int speex_resampler_set_rate(SpeexResamplerState *st,
spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current input/output sampling rates (integer value).
* @param st Resampler state
* @param in_rate Input sampling rate (integer number of Hz) copied.
* @param out_rate Output sampling rate (integer number of Hz) copied.
*/
void speex_resampler_get_rate(SpeexResamplerState *st,
spx_uint32_t *in_rate,
spx_uint32_t *out_rate);
/** Set (change) the input/output sampling rates and resampling ratio
* (fractional values in Hz supported).
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio
* @param ratio_den Denominator of the sampling rate ratio
* @param in_rate Input sampling rate rounded to the nearest integer (in Hz).
* @param out_rate Output sampling rate rounded to the nearest integer (in Hz).
*/
int speex_resampler_set_rate_frac(SpeexResamplerState *st,
spx_uint32_t ratio_num,
spx_uint32_t ratio_den,
spx_uint32_t in_rate,
spx_uint32_t out_rate);
/** Get the current resampling ratio. This will be reduced to the least
* common denominator.
* @param st Resampler state
* @param ratio_num Numerator of the sampling rate ratio copied
* @param ratio_den Denominator of the sampling rate ratio copied
*/
void speex_resampler_get_ratio(SpeexResamplerState *st,
spx_uint32_t *ratio_num,
spx_uint32_t *ratio_den);
/** Set (change) the conversion quality.
* @param st Resampler state
* @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
int speex_resampler_set_quality(SpeexResamplerState *st,
int quality);
/** Get the conversion quality.
* @param st Resampler state
* @param quality Resampling quality between 0 and 10, where 0 has poor
* quality and 10 has very high quality.
*/
void speex_resampler_get_quality(SpeexResamplerState *st,
int *quality);
/** Set (change) the input stride.
* @param st Resampler state
* @param stride Input stride
*/
void speex_resampler_set_input_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the input stride.
* @param st Resampler state
* @param stride Input stride copied
*/
void speex_resampler_get_input_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Set (change) the output stride.
* @param st Resampler state
* @param stride Output stride
*/
void speex_resampler_set_output_stride(SpeexResamplerState *st,
spx_uint32_t stride);
/** Get the output stride.
* @param st Resampler state copied
* @param stride Output stride
*/
void speex_resampler_get_output_stride(SpeexResamplerState *st,
spx_uint32_t *stride);
/** Get the latency in input samples introduced by the resampler.
* @param st Resampler state
*/
int speex_resampler_get_input_latency(SpeexResamplerState *st);
/** Get the latency in output samples introduced by the resampler.
* @param st Resampler state
*/
int speex_resampler_get_output_latency(SpeexResamplerState *st);
/** Make sure that the first samples to go out of the resamplers don't have
* leading zeros. This is only useful before starting to use a newly created
* resampler. It is recommended to use that when resampling an audio file, as
* it will generate a file with the same length. For real-time processing,
* it is probably easier not to use this call (so that the output duration
* is the same for the first frame).
* @param st Resampler state
*/
int speex_resampler_skip_zeros(SpeexResamplerState *st);
/** Reset a resampler so a new (unrelated) stream can be processed.
* @param st Resampler state
*/
int speex_resampler_reset_mem(SpeexResamplerState *st);
/** Returns the English meaning for an error code
* @param err Error code
* @return English string
*/
const char *speex_resampler_strerror(int err);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,91 @@
/* Copyright (C) 2002 Jean-Marc Valin*/
/**
@file speex_stereo.h
@brief Describes the handling for intensity stereo
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STEREO_H
#define STEREO_H
/** @defgroup SpeexStereoState SpeexStereoState: Handling Speex stereo files
* This describes the Speex intensity stereo encoding/decoding
* @{
*/
#include "speex/speex_types.h"
#include "speex/speex_bits.h"
#ifdef __cplusplus
extern "C" {
#endif
/** If you access any of these fields directly, I'll personally come and bite you */
typedef struct SpeexStereoState {
float balance; /**< Left/right balance info */
float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */
float smooth_left; /**< Smoothed left channel gain */
float smooth_right; /**< Smoothed right channel gain */
float reserved1; /**< Reserved for future use */
float reserved2; /**< Reserved for future use */
} SpeexStereoState;
/** Deprecated. Use speex_stereo_state_init() instead. */
#define SPEEX_STEREO_STATE_INIT {1,.5,1,1,0,0}
/** Initialise/create a stereo stereo state */
SpeexStereoState *speex_stereo_state_init();
/** Reset/re-initialise an already allocated stereo state */
void speex_stereo_state_reset(SpeexStereoState *stereo);
/** Destroy a stereo stereo state */
void speex_stereo_state_destroy(SpeexStereoState *stereo);
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits);
/** Transforms a stereo frame into a mono frame and stores intensity stereo info in 'bits' */
void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits);
/** Transforms a mono frame into a stereo frame using intensity stereo info */
void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *stereo);
/** Transforms a mono frame into a stereo frame using intensity stereo info */
void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *stereo);
/** Callback handler for intensity stereo info */
int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data);
#ifdef __cplusplus
}
#endif
/** @} */
#endif

View File

@ -0,0 +1,126 @@
/* speex_types.h taken from libogg */
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $
********************************************************************/
/**
@file speex_types.h
@brief Speex types
*/
#ifndef _SPEEX_TYPES_H
#define _SPEEX_TYPES_H
#if defined(_WIN32)
# if defined(__CYGWIN__)
# include <_G_config.h>
typedef _G_int32_t spx_int32_t;
typedef _G_uint32_t spx_uint32_t;
typedef _G_int16_t spx_int16_t;
typedef _G_uint16_t spx_uint16_t;
# elif defined(__MINGW32__)
typedef short spx_int16_t;
typedef unsigned short spx_uint16_t;
typedef int spx_int32_t;
typedef unsigned int spx_uint32_t;
# elif defined(__MWERKS__)
typedef int spx_int32_t;
typedef unsigned int spx_uint32_t;
typedef short spx_int16_t;
typedef unsigned short spx_uint16_t;
# else
/* MSVC/Borland */
typedef __int32 spx_int32_t;
typedef unsigned __int32 spx_uint32_t;
typedef __int16 spx_int16_t;
typedef unsigned __int16 spx_uint16_t;
# endif
#elif defined(__MACOS__)
# include <sys/types.h>
typedef SInt16 spx_int16_t;
typedef UInt16 spx_uint16_t;
typedef SInt32 spx_int32_t;
typedef UInt32 spx_uint32_t;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# include <sys/types.h>
typedef int16_t spx_int16_t;
typedef u_int16_t spx_uint16_t;
typedef int32_t spx_int32_t;
typedef u_int32_t spx_uint32_t;
#elif defined(__BEOS__)
/* Be */
# include <inttypes.h>
typedef int16_t spx_int16_t;
typedef u_int16_t spx_uint16_t;
typedef int32_t spx_int32_t;
typedef u_int32_t spx_uint32_t;
#elif defined (__EMX__)
/* OS/2 GCC */
typedef short spx_int16_t;
typedef unsigned short spx_uint16_t;
typedef int spx_int32_t;
typedef unsigned int spx_uint32_t;
#elif defined (DJGPP)
/* DJGPP */
typedef short spx_int16_t;
typedef int spx_int32_t;
typedef unsigned int spx_uint32_t;
#elif defined(R5900)
/* PS2 EE */
typedef int spx_int32_t;
typedef unsigned spx_uint32_t;
typedef short spx_int16_t;
#elif defined(__SYMBIAN32__)
/* Symbian GCC */
typedef signed short spx_int16_t;
typedef unsigned short spx_uint16_t;
typedef signed int spx_int32_t;
typedef unsigned int spx_uint32_t;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
typedef short spx_int16_t;
typedef unsigned short spx_uint16_t;
typedef long spx_int32_t;
typedef unsigned long spx_uint32_t;
#elif defined(CONFIG_TI_C6X)
typedef short spx_int16_t;
typedef unsigned short spx_uint16_t;
typedef int spx_int32_t;
typedef unsigned int spx_uint32_t;
#else
# include <speex/speex_config_types.h>
#endif
#endif /* _SPEEX_TYPES_H */

View File

@ -25,14 +25,13 @@
*
* @author Mamadou Diop <diopmamadou(at)doubango.org>
*
*/
*/
#ifndef TINYDAV_PRODUCER_DSOUND_H
#define TINYDAV_PRODUCER_DSOUND_H
#include "tinydav_config.h"
#if HAVE_DSOUND_H
#if HAVE_DSOUND_H || HAVE_DSOUND
#include "tinydav/audio/tdav_producer_audio.h"
@ -62,6 +61,6 @@ TINYDAV_GEXTERN const tmedia_producer_plugin_def_t *tdav_producer_dsound_plugin_
TDAV_END_DECLS
#endif /* HAVE_DSOUND_H */
#endif /* HAVE_DSOUND_H || HAVE_DSOUND */
#endif /* TINYDAV_PRODUCER_DSOUND_H */

View File

@ -45,7 +45,13 @@ typedef struct tdav_speex_resampler_s
tsk_size_t in_size;
tsk_size_t out_size;
int8_t channels;
uint32_t in_channels;
uint32_t out_channels;
struct{
spx_int16_t* ptr;
tsk_size_t size_in_samples;
} tmp_buffer;
SpeexResamplerState *state;
}

View File

@ -38,7 +38,7 @@
#include "tsk_safeobj.h"
/* Speex denoiser works better than WebRTC's denoiser. This is flagrant on Android. */
/* Speex denoiser works better than WebRTC's denoiser. This is obvious on Android. */
#if !defined(PREFER_SPEEX_DENOISER)
# define PREFER_SPEEX_DENOISER 1
#endif

View File

@ -0,0 +1,39 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_consumer_wasapi.h
* @brief Microsoft Windows Audio Session API (WASAPI) consumer.
*
*/
#ifndef TINYDAV_CONSUMER_WASAPI_H
#define TINYDAV_CONSUMER_WASAPI_H
#include "tinydav_config.h"
#if HAVE_WASAPI
#include "tinydav/audio/tdav_consumer_audio.h"
TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const struct tmedia_consumer_plugin_def_s *tdav_consumer_wasapi_plugin_def_t;
TDAV_END_DECLS
#endif /* HAVE_WASAPI */
#endif /* TINYDAV_CONSUMER_WASAPI_H */

View File

@ -0,0 +1,40 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_producer_wasapi.h
* @brief Microsoft Windows Audio Session API (WASAPI) producer.
*
*/
#ifndef TINYDAV_PRODUCER_WASAPI_H
#define TINYDAV_PRODUCER_WASAPI_H
#include "tinydav_config.h"
#if HAVE_WASAPI
#include "tinydav/audio/tdav_producer_audio.h"
TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const struct tmedia_producer_plugin_def_s *tdav_producer_wasapi_plugin_def_t;
TDAV_END_DECLS
#endif /* HAVE_WASAPI */
#endif /* TINYDAV_PRODUCER_WASAPI_H */

View File

@ -32,7 +32,7 @@
#include "tinydav_config.h"
#if HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
#include "tinydav/codecs/h264/tdav_codec_h264_common.h"
@ -48,6 +48,6 @@ static inline tsk_bool_t tdav_codec_h264_is_ffmpeg_plugin(const tmedia_codec_plu
TDAV_END_DECLS
#endif /* HAVE_FFMPEG */
#endif /* HAVE_FFMPEG || HAVE_H264_PASSTHROUGH */
#endif /* TINYDAV_CODEC_H264_H */

View File

@ -0,0 +1,39 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_consumer_winm.h
* @brief Microsoft Windows Media (WinM) consumer.
*
*/
#ifndef TINYDAV_CONSUMER_WINM_H
#define TINYDAV_CONSUMER_WINM_H
#include "tinydav_config.h"
#if HAVE_WINM
#include "tinydav/video/tdav_consumer_video.h"
TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const struct tmedia_consumer_plugin_def_s *tdav_consumer_winm_plugin_def_t;
TDAV_END_DECLS
#endif /* HAVE_WINM */
#endif /* TINYDAV_CONSUMER_WINM_H */

View File

@ -0,0 +1,39 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_producer_winm.h
* @brief Microsoft Windows Media (WinM) producer.
*
*/
#ifndef TINYDAV_PRODUCER_WINM_H
#define TINYDAV_PRODUCER_WINM_H
#include "tinydav_config.h"
#if HAVE_WINM
#include "tinymedia/tmedia_producer.h"
TDAV_BEGIN_DECLS
TINYDAV_GEXTERN const struct tmedia_producer_plugin_def_s *tdav_producer_winm_plugin_def_t;
TDAV_END_DECLS
#endif /* HAVE_WINM */
#endif /* TINYDAV_PRODUCER_WINM_H */

View File

@ -29,7 +29,13 @@
// Windows (XP/Vista/7/CE and Windows Mobile) macro definition
#if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
# define TDAV_UNDER_WINDOWS 1
# define TDAV_UNDER_WINDOWS 1
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP)
# define TDAV_UNDER_WINDOWS_RT 1
# if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
# define TDAV_UNDER_WINDOWS_PHONE 1
# endif
# endif
#endif
// OS X or iOS
@ -58,8 +64,8 @@
#if (TDAV_UNDER_WINDOWS || defined(__SYMBIAN32__)) && defined(TINYDAV_EXPORTS)
# define TINYDAV_API __declspec(dllexport)
# define TINYDAV_GEXTERN __declspec(dllexport)
#elif (TDAV_UNDER_WINDOWS || defined(__SYMBIAN32__)) /*&& defined(TINYDAV_IMPORTS)*/
# define TINYDAV_GEXTERN extern __declspec(dllexport)
#elif (TDAV_UNDER_WINDOWS || defined(__SYMBIAN32__)) && !defined(TINYDAV_IMPORTS_IGNORE)
# define TINYDAV_API __declspec(dllimport)
# define TINYDAV_GEXTERN __declspec(dllimport)
#else
@ -80,7 +86,9 @@
#if HAVE_FFMPEG // FFMPeg warnings (treated as errors)
# pragma warning (disable:4244)
#endif
# if !defined(__cplusplus)
# define inline __inline
# endif
# define _CRT_SECURE_NO_WARNINGS
#endif

View File

@ -21,6 +21,8 @@
*/
#include "tinydav/audio/coreaudio/tdav_audiounit.h"
#if HAVE_COREAUDIO_AUDIO_UNIT
#include "tsk_string.h"
#include "tsk_list.h"
#include "tsk_safeobj.h"
@ -31,18 +33,17 @@ static UInt32 kOne = 1;
static UInt32 kZero = 0;
#endif /* TARGET_OS_IPHONE */
#if HAVE_COREAUDIO_AUDIO_UNIT
#if TARGET_OS_IPHONE
#if TARGET_IPHONE_SIMULATOR // VoiceProcessingIO will give unexpected result on the simulator when using iOS 5
#define kDoubangoAudioUnitSubType kAudioUnitSubType_RemoteIO
#else // Echo cancellation, AGC, ...
#define kDoubangoAudioUnitSubType kAudioUnitSubType_VoiceProcessingIO
#endif
#elif TARGET_OS_MAC
#define kDoubangoAudioUnitSubType kAudioUnitSubType_HALOutput
#else
#error "Unknown target"
#if TARGET_OS_IPHONE
#if TARGET_IPHONE_SIMULATOR // VoiceProcessingIO will give unexpected result on the simulator when using iOS 5
#define kDoubangoAudioUnitSubType kAudioUnitSubType_RemoteIO
#else // Echo cancellation, AGC, ...
#define kDoubangoAudioUnitSubType kAudioUnitSubType_VoiceProcessingIO
#endif
#elif TARGET_OS_MAC
#define kDoubangoAudioUnitSubType kAudioUnitSubType_HALOutput
#else
#error "Unknown target"
#endif
#undef kInputBus
#define kInputBus 1

View File

@ -49,7 +49,7 @@ static _inline int32_t __convert_volume(int32_t volume)
return (volume * __step) + DSBVOLUME_MIN;
}
static void *_tdav_consumer_dsound_playback_thread(void *param)
static void* TSK_STDCALL _tdav_consumer_dsound_playback_thread(void *param)
{
tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)param;

View File

@ -47,7 +47,7 @@
extern void tdav_win32_print_error(const char* func, HRESULT hr);
static void *_tdav_producer_dsound_record_thread(void *param)
static void* TSK_STDCALL _tdav_producer_dsound_record_thread(void *param)
{
tdav_producer_dsound_t* dsound = (tdav_producer_dsound_t*)param;

View File

@ -50,7 +50,7 @@
static int _tdav_session_audio_dtmfe_timercb(const void* arg, tsk_timer_id_t timer_id);
static struct tdav_session_audio_dtmfe_s* _tdav_session_audio_dtmfe_create(const tdav_session_audio_t* session, uint8_t event, uint16_t duration, uint32_t seq, uint32_t timestamp, uint8_t format, tsk_bool_t M, tsk_bool_t E);
static void _tdav_session_audio_apply_gain(void* buffer, int len, int bps, int gain);
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size);
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size);
/* DTMF event object */
typedef struct tdav_session_audio_dtmfe_s
@ -115,7 +115,7 @@ static int tdav_session_audio_rtp_cb(const void* callback_data, const struct trt
int bytesPerSample = (base->consumer->audio.bits_per_sample >> 3);
if(!audio->decoder.resampler.instance){
audio->decoder.resampler.instance = _tdav_session_audio_resampler_create(bytesPerSample, audio->decoder.codec->plugin->rate, base->consumer->audio.out.rate, base->consumer->audio.ptime, base->consumer->audio.out.channels, TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY, &audio->decoder.resampler.buffer, &audio->decoder.resampler.buffer_size);
audio->decoder.resampler.instance = _tdav_session_audio_resampler_create(bytesPerSample, audio->decoder.codec->plugin->rate, base->consumer->audio.out.rate, base->consumer->audio.ptime, base->consumer->audio.in.channels, base->consumer->audio.out.channels, TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY, &audio->decoder.resampler.buffer, &audio->decoder.resampler.buffer_size);
}
if(!audio->decoder.resampler.instance){
TSK_DEBUG_ERROR("No resampler to handle data");
@ -184,7 +184,7 @@ static int tdav_session_audio_producer_enc_cb(const void* callback_data, const v
int bytesPerSample = (base->producer->audio.bits_per_sample >> 3);
if(!audio->encoder.resampler.instance){
audio->encoder.resampler.instance = _tdav_session_audio_resampler_create(bytesPerSample, base->producer->audio.rate, audio->encoder.codec->plugin->rate,base->producer->audio.ptime, base->producer->audio.channels, TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY, &audio->encoder.resampler.buffer, &audio->encoder.resampler.buffer_size);
audio->encoder.resampler.instance = _tdav_session_audio_resampler_create(bytesPerSample, base->producer->audio.rate, audio->encoder.codec->plugin->rate,base->producer->audio.ptime, base->producer->audio.channels, base->producer->audio.channels, TDAV_AUDIO_RESAMPLER_DEFAULT_QUALITY, &audio->encoder.resampler.buffer, &audio->encoder.resampler.buffer_size);
}
if(!audio->encoder.resampler.instance){
TSK_DEBUG_ERROR("No resampler to handle data");
@ -636,9 +636,9 @@ static int _tdav_session_audio_dtmfe_timercb(const void* arg, tsk_timer_id_t tim
return 0;
}
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size)
static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_per_sample, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality, void** resampler_buffer, tsk_size_t *resampler_buffer_size)
{
uint32_t resampler_buff_size = ((out_freq * frame_duration)/1000) * bytes_per_sample;
uint32_t resampler_buff_size = (((out_freq * frame_duration)/1000) * bytes_per_sample) * (out_channels / in_channels);
tmedia_resampler_t* resampler;
int ret;
@ -647,8 +647,8 @@ static tmedia_resampler_t* _tdav_session_audio_resampler_create(int32_t bytes_pe
return tsk_null;
}
else {
if((ret = tmedia_resampler_open(resampler, in_freq, out_freq, frame_duration, channels, quality))){
TSK_DEBUG_ERROR("Failed to open audio resampler (%d, %d, %d, %d, %d) with retcode=%d", in_freq, out_freq, frame_duration, channels, quality, ret);
if((ret = tmedia_resampler_open(resampler, in_freq, out_freq, frame_duration, in_channels, out_channels, quality))){
TSK_DEBUG_ERROR("Failed to open audio resampler (%d, %d, %d, %d, %d,%d) with retcode=%d", in_freq, out_freq, frame_duration, in_channels, out_channels, quality, ret);
TSK_OBJECT_SAFE_FREE(resampler);
goto done;
}

View File

@ -35,19 +35,37 @@
#define TDAV_SPEEX_RESAMPLER_MAX_QUALITY 10
int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, tsk_size_t frame_duration, int8_t _channels, uint32_t quality)
int tdav_speex_resampler_open(tmedia_resampler_t* self, uint32_t in_freq, uint32_t out_freq, uint32_t frame_duration, uint32_t in_channels, uint32_t out_channels, uint32_t quality)
{
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
int ret = 0;
if(!(resampler->state = speex_resampler_init(_channels, in_freq, out_freq, quality>10 ? TDAV_SPEEX_RESAMPLER_MAX_QUALITY : quality, &ret))){
if(in_channels != 1 && in_channels != 2){
TSK_DEBUG_ERROR("%d not valid as input channel", in_channels);
return -1;
}
if(out_channels != 1 && out_channels != 2){
TSK_DEBUG_ERROR("%d not valid as output channel", out_channels);
return -1;
}
if(!(resampler->state = speex_resampler_init(in_channels, in_freq, out_freq, quality>10 ? TDAV_SPEEX_RESAMPLER_MAX_QUALITY : quality, &ret))){
TSK_DEBUG_ERROR("speex_resampler_init() returned %d", ret);
return -2;
}
resampler->in_size = (in_freq * frame_duration)/1000;
resampler->out_size = (out_freq * frame_duration) / 1000;
resampler->channels = _channels;
resampler->out_size = ((out_freq * frame_duration) / 1000) * (out_channels / in_channels);
resampler->in_channels = in_channels;
resampler->out_channels = out_channels;
if(in_channels != out_channels){
resampler->tmp_buffer.size_in_samples = TSK_MAX(resampler->out_size, resampler->in_size);
if(!(resampler->tmp_buffer.ptr = (spx_int16_t*)tsk_realloc(resampler->tmp_buffer.ptr, resampler->tmp_buffer.size_in_samples * sizeof(spx_int16_t)))){
resampler->tmp_buffer.size_in_samples = 0;
return -2;
}
}
return 0;
}
@ -72,7 +90,31 @@ tsk_size_t tdav_speex_resampler_process(tmedia_resampler_t* self, const uint16_t
return 0;
}
err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size, (spx_int16_t *)out_data, &out_len);
if(resampler->out_channels != resampler->in_channels){
spx_uint32_t i, j;
spx_int16_t* pout_data = (spx_int16_t*)(out_data);
out_len = resampler->tmp_buffer.size_in_samples;
err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size, resampler->tmp_buffer.ptr, &out_len);
if(err == RESAMPLER_ERR_SUCCESS){
if(resampler->in_channels == 1){
// in_channels = 1, out_channels = 2
for(i = 0, j = 0; i < out_len; ++i, j+=2){
pout_data[j] = pout_data[j + 1] = resampler->tmp_buffer.ptr[i];
}
}
else{
// in_channels = 2, out_channels = 1
for(i = 0, j = 0; i < out_len; ++i, j+=2){
pout_data[i] = resampler->tmp_buffer.ptr[j];
}
}
}
}
else{
err = speex_resampler_process_int(resampler->state, 0, (const spx_int16_t *)in_data, (spx_uint32_t *)&in_size, (spx_int16_t *)out_data, &out_len);
}
if(err != RESAMPLER_ERR_SUCCESS){
TSK_DEBUG_ERROR("speex_resampler_process_int() failed with error code %d", err);
return 0;
@ -100,7 +142,7 @@ int tdav_speex_resampler_close(tmedia_resampler_t* self)
/* constructor */
static tsk_object_t* tdav_speex_resampler_ctor(tsk_object_t * self, va_list * app)
{
tdav_speex_resampler_t *resampler = self;
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
if(resampler){
/* init base */
tmedia_resampler_init(TMEDIA_RESAMPLER(resampler));
@ -111,7 +153,7 @@ static tsk_object_t* tdav_speex_resampler_ctor(tsk_object_t * self, va_list * ap
/* destructor */
static tsk_object_t* tdav_speex_resampler_dtor(tsk_object_t * self)
{
tdav_speex_resampler_t *resampler = self;
tdav_speex_resampler_t *resampler = (tdav_speex_resampler_t *)self;
if(resampler){
/* deinit base */
tmedia_resampler_deinit(TMEDIA_RESAMPLER(resampler));
@ -120,6 +162,7 @@ static tsk_object_t* tdav_speex_resampler_dtor(tsk_object_t * self)
speex_resampler_destroy(resampler->state);
resampler->state = tsk_null;
}
TSK_FREE(resampler->tmp_buffer.ptr);
}
return self;

View File

@ -0,0 +1,671 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_consumer_wasapi.h
* @brief Microsoft Windows Audio Session API (WASAPI) consumer.
* http://msdn.microsoft.com/en-us/library/windows/desktop/dd316551(v=vs.85).aspx
*/
#include "tinydav/audio/wasapi/tdav_consumer_wasapi.h"
#if HAVE_WASAPI
#include "tinydav/audio/tdav_consumer_audio.h"
#include "tsk_memory.h"
#include "tsk_string.h"
#include "tsk_condwait.h"
#include "tsk_debug.h"
#include <windows.h>
#include <audioclient.h>
#include <phoneaudioclient.h>
#include <speex/speex_buffer.h>
#if !defined(TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT)
# define TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT 13
#endif
#define WASAPI_MILLIS_TO_100NS(MILLIS) (((LONGLONG)(MILLIS)) * 10000ui64)
#define WASAPI_100NS_TO_MILLIS(NANOS) (((LONGLONG)(NANOS)) / 10000ui64)
struct tdav_consumer_wasapi_s;
namespace Doubango
{
namespace VoIP
{
ref class AudioRender sealed
{
public:
virtual ~AudioRender();
internal:
AudioRender();
int Prepare(struct tdav_consumer_wasapi_s* wasapi, const tmedia_codec_t* codec);
int UnPrepare();
int Start();
int Stop();
int Pause();
int Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr);
private:
tsk_size_t Read(void* data, tsk_size_t size);
void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
private:
tsk_mutex_handle_t* m_hMutex;
const struct tdav_consumer_wasapi_s* m_pWrappedConsumer; // Must not take ref() otherwise dtor() will be never called (circular reference)
IAudioClient2* m_pDevice;
IAudioRenderClient* m_pClient;
tsk_condwait_handle_t* m_hCondWait;
Windows::Foundation::IAsyncAction^ m_pAsyncThread;
INT32 m_nBytesPerNotif;
INT32 m_nSourceFrameSizeInBytes;
UINT32 m_nMaxFrameCount;
UINT32 m_nPtime;
struct {
struct {
void* buffer;
tsk_size_t size;
} chunck;
tsk_ssize_t leftBytes;
SpeexBuffer* buffer;
tsk_size_t size;
tsk_mutex_handle_t* mutex;
} m_ring;
bool m_bStarted;
bool m_bPrepared;
bool m_bPaused;
};
}
}
typedef struct tdav_consumer_wasapi_s
{
TDAV_DECLARE_CONSUMER_AUDIO;
Doubango::VoIP::AudioRender ^AudioRender;
}
tdav_consumer_wasapi_t;
extern "C" void tdav_win32_print_error(const char* func, HRESULT hr);
/* ============ Media consumer Interface ================= */
static int tdav_consumer_wasapi_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
}
static int tdav_consumer_wasapi_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
if(!wasapi || !codec || !wasapi->AudioRender){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
TMEDIA_CONSUMER(wasapi)->audio.ptime = codec->plugin->audio.ptime;
TMEDIA_CONSUMER(wasapi)->audio.in.channels = TMEDIA_CONSUMER(wasapi)->audio.out.channels = codec->plugin->audio.channels;
TMEDIA_CONSUMER(wasapi)->audio.in.rate = TMEDIA_CONSUMER(wasapi)->audio.out.rate = codec->plugin->rate;
return wasapi->AudioRender->Prepare(wasapi, codec);
}
static int tdav_consumer_wasapi_start(tmedia_consumer_t* self)
{
tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
TSK_DEBUG_INFO("tdav_consumer_wasapi_start()");
if(!wasapi || !wasapi->AudioRender){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->AudioRender->Start();
}
static int tdav_consumer_wasapi_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
if(!wasapi || !wasapi->AudioRender || !buffer || !size){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->AudioRender->Consume(buffer, size, proto_hdr);
}
static int tdav_consumer_wasapi_pause(tmedia_consumer_t* self)
{
tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
if(!wasapi || !wasapi->AudioRender){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->AudioRender->Pause();
}
static int tdav_consumer_wasapi_stop(tmedia_consumer_t* self)
{
tdav_consumer_wasapi_t* wasapi = (tdav_consumer_wasapi_t*)self;
TSK_DEBUG_INFO("tdav_consumer_wasapi_stop()");
if(!wasapi || !wasapi->AudioRender){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->AudioRender->Stop();
}
Doubango::VoIP::AudioRender::AudioRender()
: m_pDevice(nullptr)
, m_hMutex(nullptr)
, m_pClient(nullptr)
, m_hCondWait(nullptr)
, m_pAsyncThread(nullptr)
, m_pWrappedConsumer(nullptr)
, m_nBytesPerNotif(0)
, m_nSourceFrameSizeInBytes(0)
, m_nMaxFrameCount(0)
, m_nPtime(0)
, m_bStarted(false)
, m_bPrepared(false)
, m_bPaused(false)
{
memset(&m_ring, 0, sizeof(m_ring));
if(!(m_hMutex = tsk_mutex_create())){
throw ref new Platform::FailureException(L"Failed to create mutex");
}
}
Doubango::VoIP::AudioRender::~AudioRender()
{
Stop();
UnPrepare();
tsk_mutex_destroy(&m_hMutex);
}
int Doubango::VoIP::AudioRender::Prepare(tdav_consumer_wasapi_t* wasapi, const tmedia_codec_t* codec)
{
HRESULT hr = E_FAIL;
int ret = 0;
WAVEFORMATEX wfx = {0};
AudioClientProperties properties = {0};
LPCWSTR pwstrRenderId = nullptr;
#define WASAPI_SET_ERROR(code) ret = (code); goto bail;
tsk_mutex_lock(m_hMutex);
if(m_bPrepared)
{
TSK_DEBUG_INFO("#WASAPI: Audio consumer already prepared");
goto bail;
}
if(!wasapi || !codec)
{
TSK_DEBUG_ERROR("Invalid parameter");
WASAPI_SET_ERROR(-1);
}
if(m_pDevice || m_pClient){
TSK_DEBUG_ERROR("consumer already prepared");
WASAPI_SET_ERROR(-2);
}
pwstrRenderId = GetDefaultAudioRenderId(AudioDeviceRole::Communications);
if (NULL == pwstrRenderId){
tdav_win32_print_error("GetDefaultAudioRenderId", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-3);
}
hr = ActivateAudioInterface(pwstrRenderId, __uuidof(IAudioClient2), (void**)&m_pDevice);
if(!SUCCEEDED(hr)){
tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-4);
}
if (SUCCEEDED(hr)){
properties.cbSize = sizeof AudioClientProperties;
properties.eCategory = AudioCategory_Communications;
hr = m_pDevice->SetClientProperties(&properties);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-5);
}
}
else{
tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-6);
}
/* Set best format */
{
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nChannels = TMEDIA_CONSUMER(wasapi)->audio.in.channels;
wfx.nSamplesPerSec = TMEDIA_CONSUMER(wasapi)->audio.in.rate;
wfx.wBitsPerSample = TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample;
wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
PWAVEFORMATEX pwfxClosestMatch = NULL;
hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
if(hr != S_OK && hr != S_FALSE)
{
tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-8);
}
if(hr == S_FALSE)
{
if(!pwfxClosestMatch)
{
TSK_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
WASAPI_SET_ERROR(-7);
}
wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
wfx.nChannels = pwfxClosestMatch->nChannels;
#if 0
wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
// Request resampler
TMEDIA_CONSUMER(wasapi)->audio.out.rate = (uint32_t)wfx.nSamplesPerSec;
TMEDIA_CONSUMER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
TMEDIA_CONSUMER(wasapi)->audio.out.channels = (uint8_t)wfx.nChannels;
TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
}
if(pwfxClosestMatch)
{
CoTaskMemFree(pwfxClosestMatch);
}
}
m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_CONSUMER(wasapi)->audio.ptime)/1000);
// Initialize
hr = m_pDevice->Initialize(
AUDCLNT_SHAREMODE_SHARED,
0x00000000,
(TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_CONSUMER(wasapi)->audio.ptime)) ,
0,
&wfx,
NULL);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("#WASAPI: Render::Initialize", hr);
WASAPI_SET_ERROR(-9);
}
REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("GetDevicePeriod", hr);
WASAPI_SET_ERROR(-10);
}
hr = m_pDevice->GetBufferSize(&m_nMaxFrameCount);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("GetBufferSize", hr);
WASAPI_SET_ERROR(-10);
}
TSK_DEBUG_INFO("#WASAPI (Playback): BufferSize=%u, DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", m_nMaxFrameCount, WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
if(!m_hCondWait){
if(!(m_hCondWait = tsk_condwait_create())){
tdav_win32_print_error("tsk_condwait_create(Render)", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-11);
}
}
hr = m_pDevice->GetService(__uuidof(IAudioRenderClient), (void**)&m_pClient);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("GetService", hr);
WASAPI_SET_ERROR(-14);
}
int packetperbuffer = (1000 / TMEDIA_CONSUMER(wasapi)->audio.ptime);
m_ring.chunck.size = wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer;
m_ring.size = TDAV_WASAPI_CONSUMER_NOTIF_POS_COUNT * m_ring.chunck.size;
if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))){
m_ring.size = 0;
TSK_DEBUG_ERROR("Failed to allocate new buffer");
WASAPI_SET_ERROR(-15);
}
if(!m_ring.buffer){
m_ring.buffer = speex_buffer_init(m_ring.size);
}
else {
int sret;
if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0){
TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
WASAPI_SET_ERROR(-16);
}
}
if(!m_ring.buffer){
TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
WASAPI_SET_ERROR(-17);
}
if(!m_ring.mutex && !(m_ring.mutex = tsk_mutex_create_2(tsk_false))){
TSK_DEBUG_ERROR("Failed to create mutex");
WASAPI_SET_ERROR(-18);
}
bail:
if (pwstrRenderId){
CoTaskMemFree((LPVOID)pwstrRenderId);
}
if(ret != 0){
UnPrepare();
}
if((m_bPrepared = (ret == 0)))
{
m_pWrappedConsumer = wasapi;
m_nPtime = TMEDIA_CONSUMER(wasapi)->audio.ptime;
}
tsk_mutex_unlock(m_hMutex);
return ret;
}
int Doubango::VoIP::AudioRender::UnPrepare()
{
tsk_mutex_lock(m_hMutex);
if(m_hCondWait)
{
tsk_condwait_destroy(&m_hCondWait);
}
if(m_pDevice)
{
m_pDevice->Release(), m_pDevice = nullptr;
}
if(m_pClient)
{
m_pClient->Release(), m_pClient = nullptr;
}
TSK_FREE(m_ring.chunck.buffer);
if(m_ring.buffer){
speex_buffer_destroy(m_ring.buffer);
m_ring.buffer = nullptr;
}
if(m_ring.mutex){
tsk_mutex_destroy(&m_ring.mutex);
}
m_pWrappedConsumer = nullptr;
m_bPrepared = false;
tsk_mutex_unlock(m_hMutex);
return 0;
}
int Doubango::VoIP::AudioRender::Start()
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
TSK_DEBUG_INFO("#WASAPI: Audio consumer already started");
goto bail;
}
if(!m_bPrepared)
{
TSK_DEBUG_ERROR("Audio consumer not prepared");
goto bail;
}
m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioRender::AsyncThread),
Windows::System::Threading::WorkItemPriority::High,
Windows::System::Threading::WorkItemOptions::TimeSliced);
if((m_bStarted = (m_pAsyncThread != nullptr)))
{
HRESULT hr = m_pDevice->Start();
if(!SUCCEEDED(hr))
{
tdav_win32_print_error("Device::Start", hr);
Stop();
}
m_bPaused = false;
}
bail:
tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int Doubango::VoIP::AudioRender::Stop()
{
m_bStarted = false;
tsk_mutex_lock(m_hMutex);
if (m_hCondWait)
{
tsk_condwait_broadcast(m_hCondWait);
}
if (m_pAsyncThread)
{
m_pAsyncThread->Cancel();
m_pAsyncThread->Close();
m_pAsyncThread = nullptr;
}
if(m_pDevice)
{
m_pDevice->Stop();
}
// will be prepared again before next start()
UnPrepare();
tsk_mutex_unlock(m_hMutex);
return 0;
}
int Doubango::VoIP::AudioRender::Pause()
{
m_bPaused = true;
return 0;
}
int Doubango::VoIP::AudioRender::Consume(const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
tsk_mutex_lock(m_ring.mutex);
speex_buffer_write(m_ring.buffer, (void*)buffer, size);
tsk_mutex_unlock(m_ring.mutex);
return 0;
}
tsk_size_t Doubango::VoIP::AudioRender::Read(void* data, tsk_size_t size)
{
tsk_ssize_t retSize = 0;
m_ring.leftBytes += size;
while (m_ring.leftBytes >= (tsk_ssize_t)m_ring.chunck.size) {
m_ring.leftBytes -= m_ring.chunck.size;
retSize = (tsk_ssize_t)tdav_consumer_audio_get(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer), m_ring.chunck.buffer, m_ring.chunck.size);
tdav_consumer_audio_tick(TDAV_CONSUMER_AUDIO(m_pWrappedConsumer));
speex_buffer_write(m_ring.buffer, m_ring.chunck.buffer, retSize);
}
// IMPORTANT: looks like there is a bug in speex: continously trying to read more than avail
// many times can corrupt the buffer. At least on OS X 1.5
if(speex_buffer_get_available(m_ring.buffer) >= (tsk_ssize_t)size){
retSize = speex_buffer_read(m_ring.buffer, data, size);
}
else{
memset(data, 0, size);
}
return retSize;
}
void Doubango::VoIP::AudioRender::AsyncThread(Windows::Foundation::IAsyncAction^ operation)
{
HRESULT hr = S_OK;
INT32 nFramesToWrite;
UINT32 nPadding, nRead;
int waitResult = 0;
TSK_DEBUG_INFO("#WASAPI: __playback_thread -- START");
#define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
while(m_bStarted && SUCCEEDED(hr)){
waitResult = tsk_condwait_timedwait(m_hCondWait, m_nPtime);
tsk_mutex_lock(m_hMutex);
if(!m_bStarted){
BREAK_WHILE;
}
if(waitResult == 0) {
hr = m_pDevice->GetCurrentPadding(&nPadding);
if (SUCCEEDED(hr)){
BYTE* pRenderBuffer = NULL;
nFramesToWrite = m_nMaxFrameCount - nPadding;
if (nFramesToWrite > 0){
hr = m_pClient->GetBuffer(nFramesToWrite, &pRenderBuffer);
if (SUCCEEDED(hr)){
nRead = Read(pRenderBuffer, (nFramesToWrite * m_nSourceFrameSizeInBytes));
// Release the buffer
hr = m_pClient->ReleaseBuffer(nFramesToWrite, (nRead == 0) ? AUDCLNT_BUFFERFLAGS_SILENT: 0);
}
}
}
}
else{
BREAK_WHILE;
}
tsk_mutex_lock(m_hMutex);
}// end-of-while
if (!SUCCEEDED(hr)){
tdav_win32_print_error("AsyncThread: ", hr);
}
TSK_DEBUG_INFO("WASAPI: __playback_thread(%s) -- STOP", (SUCCEEDED(hr) && waitResult == 0) ? "OK": "NOK");
}
//
// WaveAPI consumer object definition
//
/* constructor */
static tsk_object_t* tdav_consumer_wasapi_ctor(tsk_object_t * self, va_list * app)
{
tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
if(wasapi){
/* init base */
tdav_consumer_audio_init(TDAV_CONSUMER_AUDIO(wasapi));
/* init self */
wasapi->AudioRender = ref new Doubango::VoIP::AudioRender();
}
return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_wasapi_dtor(tsk_object_t * self)
{
tdav_consumer_wasapi_t *wasapi = (tdav_consumer_wasapi_t*)self;
if(wasapi){
/* stop */
tdav_consumer_wasapi_stop((tmedia_consumer_t*)self);
/* deinit base */
tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(wasapi));
/* deinit self */
if(wasapi->AudioRender){
delete wasapi->AudioRender;
wasapi->AudioRender = nullptr;
}
}
return self;
}
/* object definition */
static const tsk_object_def_t tdav_consumer_wasapi_def_s =
{
sizeof(tdav_consumer_wasapi_t),
tdav_consumer_wasapi_ctor,
tdav_consumer_wasapi_dtor,
tdav_consumer_audio_cmp,
};
/* plugin definition*/
static const tmedia_consumer_plugin_def_t tdav_consumer_wasapi_plugin_def_s =
{
&tdav_consumer_wasapi_def_s,
tmedia_audio,
"Microsoft Windows Audio Session API (WASAPI) consumer",
tdav_consumer_wasapi_set,
tdav_consumer_wasapi_prepare,
tdav_consumer_wasapi_start,
tdav_consumer_wasapi_consume,
tdav_consumer_wasapi_pause,
tdav_consumer_wasapi_stop
};
const tmedia_consumer_plugin_def_t *tdav_consumer_wasapi_plugin_def_t = &tdav_consumer_wasapi_plugin_def_s;
#endif /* HAVE_WASAPI */

View File

@ -0,0 +1,669 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_producer_wasapi.h
* @brief Microsoft Windows Audio Session API (WASAPI) producer.
* http://msdn.microsoft.com/en-us/library/windows/desktop/dd316551(v=vs.85).aspx
*/
#include "tinydav/audio/wasapi/tdav_producer_wasapi.h"
#if HAVE_WASAPI
#include "tinydav/audio/tdav_producer_audio.h"
#include "tsk_memory.h"
#include "tsk_string.h"
#include "tsk_debug.h"
#include <windows.h>
#include <audioclient.h>
#include <phoneaudioclient.h>
#include <speex/speex_buffer.h>
#if !defined(TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT)
# define TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT 10
#endif
#define WASAPI_MILLIS_TO_100NS(MILLIS) (((LONGLONG)(MILLIS)) * 10000ui64)
#define WASAPI_100NS_TO_MILLIS(NANOS) (((LONGLONG)(NANOS)) / 10000ui64)
struct tdav_producer_wasapi_s;
namespace Doubango
{
namespace VoIP
{
ref class AudioCapture sealed
{
public:
virtual ~AudioCapture();
internal:
AudioCapture();
int Prepare(struct tdav_producer_wasapi_s* wasapi, const tmedia_codec_t* codec);
int UnPrepare();
int Start();
int Stop();
int Pause();
private:
void AsyncThread(Windows::Foundation::IAsyncAction^ operation);
private:
tsk_mutex_handle_t* m_hMutex;
IAudioClient2* m_pDevice;
IAudioCaptureClient* m_pClient;
HANDLE m_hCaptureEvent;
HANDLE m_hShutdownEvent;
Windows::Foundation::IAsyncAction^ m_pAsyncThread;
INT32 m_nBytesPerNotif;
INT32 m_nSourceFrameSizeInBytes;
struct{
tmedia_producer_enc_cb_f fn;
const void* pcData;
} m_callback;
struct {
struct {
void* buffer;
tsk_size_t size;
} chunck;
SpeexBuffer* buffer;
tsk_size_t size;
} m_ring;
bool m_bStarted;
bool m_bPrepared;
bool m_bPaused;
};
}
}
typedef struct tdav_producer_wasapi_s
{
TDAV_DECLARE_PRODUCER_AUDIO;
Doubango::VoIP::AudioCapture ^audioCapture;
}
tdav_producer_wasapi_t;
extern "C" void tdav_win32_print_error(const char* func, HRESULT hr);
/* ============ Media Producer Interface ================= */
static int tdav_producer_wasapi_set(tmedia_producer_t* self, const tmedia_param_t* param)
{
tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
if(param->plugin_type == tmedia_ppt_producer){
if(param->value_type == tmedia_pvt_int32){
if(tsk_striequals(param->key, "volume")){
return 0;
}
else if(tsk_striequals(param->key, "mute")){
//wasapi->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
#if !FIXME_SEND_SILENCE_ON_MUTE
//if(wasapi->started){
// if(wasapi->mute){
//IDirectSoundCaptureBuffer_Stop(wasapi->captureBuffer);
// }
// else{
//IDirectSoundCaptureBuffer_Start(wasapi->captureBuffer, DSBPLAY_LOOPING);
// }
//}
#endif
return 0;
}
}
}
return tdav_producer_audio_set(TDAV_PRODUCER_AUDIO(self), param);
}
static int tdav_producer_wasapi_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
if(!wasapi || !codec || !wasapi->audioCapture){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
TMEDIA_PRODUCER(wasapi)->audio.channels = codec->plugin->audio.channels;
TMEDIA_PRODUCER(wasapi)->audio.rate = codec->plugin->rate;
TMEDIA_PRODUCER(wasapi)->audio.ptime = codec->plugin->audio.ptime;
return wasapi->audioCapture->Prepare(wasapi, codec);
}
static int tdav_producer_wasapi_start(tmedia_producer_t* self)
{
tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
TSK_DEBUG_INFO("tdav_producer_wasapi_start()");
if(!wasapi || !wasapi->audioCapture){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->audioCapture->Start();
}
static int tdav_producer_wasapi_pause(tmedia_producer_t* self)
{
tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
if(!wasapi || !wasapi->audioCapture){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->audioCapture->Pause();
}
static int tdav_producer_wasapi_stop(tmedia_producer_t* self)
{
tdav_producer_wasapi_t* wasapi = (tdav_producer_wasapi_t*)self;
TSK_DEBUG_INFO("tdav_producer_wasapi_stop()");
if(!wasapi || !wasapi->audioCapture){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return wasapi->audioCapture->Stop();
}
Doubango::VoIP::AudioCapture::AudioCapture()
: m_pDevice(nullptr)
, m_hMutex(nullptr)
, m_pClient(nullptr)
, m_hCaptureEvent(nullptr)
, m_hShutdownEvent(nullptr)
, m_pAsyncThread(nullptr)
, m_nBytesPerNotif(0)
, m_nSourceFrameSizeInBytes(0)
, m_bStarted(false)
, m_bPrepared(false)
, m_bPaused(false)
{
m_callback.fn = nullptr, m_callback.pcData = nullptr;
if(!(m_hMutex = tsk_mutex_create())){
throw ref new Platform::FailureException(L"Failed to create mutex");
}
}
Doubango::VoIP::AudioCapture::~AudioCapture()
{
Stop();
UnPrepare();
tsk_mutex_destroy(&m_hMutex);
}
int Doubango::VoIP::AudioCapture::Prepare(tdav_producer_wasapi_t* wasapi, const tmedia_codec_t* codec)
{
HRESULT hr = E_FAIL;
int ret = 0;
WAVEFORMATEX wfx = {0};
AudioClientProperties properties = {0};
LPCWSTR pwstrCaptureId = nullptr;
#define WASAPI_SET_ERROR(code) ret = (code); goto bail;
tsk_mutex_lock(m_hMutex);
if(m_bPrepared)
{
TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
goto bail;
}
if(!wasapi || !codec)
{
TSK_DEBUG_ERROR("Invalid parameter");
WASAPI_SET_ERROR(-1);
}
if(m_pDevice || m_pClient){
TSK_DEBUG_ERROR("Producer already prepared");
WASAPI_SET_ERROR(-2);
}
pwstrCaptureId = GetDefaultAudioCaptureId(AudioDeviceRole::Communications);
if (NULL == pwstrCaptureId){
tdav_win32_print_error("GetDefaultAudioCaptureId", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-3);
}
hr = ActivateAudioInterface(pwstrCaptureId, __uuidof(IAudioClient2), (void**)&m_pDevice);
if(!SUCCEEDED(hr)){
tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-4);
}
if (SUCCEEDED(hr)){
properties.cbSize = sizeof AudioClientProperties;
properties.eCategory = AudioCategory_Communications;
hr = m_pDevice->SetClientProperties(&properties);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("SetClientProperties", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-5);
}
}
else{
tdav_win32_print_error("ActivateAudioInterface", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-6);
}
/* Set best format */
{
wfx.wFormatTag = WAVE_FORMAT_PCM;
wfx.nChannels = TMEDIA_PRODUCER(wasapi)->audio.channels;
wfx.nSamplesPerSec = TMEDIA_PRODUCER(wasapi)->audio.rate;
wfx.wBitsPerSample = TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample;
wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample/8);
wfx.nAvgBytesPerSec = (wfx.nSamplesPerSec * wfx.nBlockAlign);
PWAVEFORMATEX pwfxClosestMatch = NULL;
hr = m_pDevice->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &wfx, &pwfxClosestMatch);
if(hr != S_OK && hr != S_FALSE)
{
tdav_win32_print_error("IsFormatSupported", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-8);
}
if(hr == S_FALSE)
{
if(!pwfxClosestMatch)
{
TSK_DEBUG_ERROR("malloc(%d) failed", sizeof(WAVEFORMATEX));
WASAPI_SET_ERROR(-7);
}
wfx.nChannels = pwfxClosestMatch->nChannels;
wfx.nSamplesPerSec = pwfxClosestMatch->nSamplesPerSec;
#if 0
wfx.wBitsPerSample = pwfxClosestMatch->wBitsPerSample;
#endif
wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
// Request resampler
TMEDIA_PRODUCER(wasapi)->audio.rate = (uint32_t)wfx.nSamplesPerSec;
TMEDIA_PRODUCER(wasapi)->audio.bits_per_sample = (uint8_t)wfx.wBitsPerSample;
TMEDIA_PRODUCER(wasapi)->audio.channels = (uint8_t)wfx.nChannels;
TSK_DEBUG_INFO("Audio device format fallback: rate=%d, bps=%d, channels=%d", wfx.nSamplesPerSec, wfx.wBitsPerSample, wfx.nChannels);
}
if(pwfxClosestMatch)
{
CoTaskMemFree(pwfxClosestMatch);
}
}
m_nSourceFrameSizeInBytes = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
m_nBytesPerNotif = ((wfx.nAvgBytesPerSec * TMEDIA_PRODUCER(wasapi)->audio.ptime)/1000);
// Initialize
hr = m_pDevice->Initialize(
AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
(TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * WASAPI_MILLIS_TO_100NS(TMEDIA_PRODUCER(wasapi)->audio.ptime)),
0,
&wfx,
NULL);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("#WASAPI: Capture::SetClientProperties", hr);
WASAPI_SET_ERROR(-9);
}
REFERENCE_TIME DefaultDevicePeriod, MinimumDevicePeriod;
hr = m_pDevice->GetDevicePeriod(&DefaultDevicePeriod, &MinimumDevicePeriod);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("GetDevicePeriod", hr);
WASAPI_SET_ERROR(-10);
}
TSK_DEBUG_INFO("#WASAPI(Capture): DefaultDevicePeriod=%lld ms, MinimumDevicePeriod=%lldms", WASAPI_100NS_TO_MILLIS(DefaultDevicePeriod), WASAPI_100NS_TO_MILLIS(MinimumDevicePeriod));
if(!m_hCaptureEvent){
if(!(m_hCaptureEvent = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS))){
tdav_win32_print_error("CreateEventEx(Capture)", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-11);
}
}
if(!m_hShutdownEvent){
if(!(m_hShutdownEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS))){
tdav_win32_print_error("CreateEventEx(Shutdown)", HRESULT_FROM_WIN32(GetLastError()));
WASAPI_SET_ERROR(-12);
}
}
hr = m_pDevice->SetEventHandle(m_hCaptureEvent);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("SetEventHandle", hr);
WASAPI_SET_ERROR(-13);
}
hr = m_pDevice->GetService(__uuidof(IAudioCaptureClient), (void**)&m_pClient);
if (!SUCCEEDED(hr)){
tdav_win32_print_error("GetService", hr);
WASAPI_SET_ERROR(-14);
}
int packetperbuffer = (1000 / codec->plugin->audio.ptime);
m_ring.chunck.size = wfx.nSamplesPerSec * (wfx.wBitsPerSample >> 3) / packetperbuffer;
TSK_DEBUG_INFO("#WASAPI: Audio producer ring chunk size = %u", m_ring.chunck.size);
// allocate our chunck buffer
if(!(m_ring.chunck.buffer = tsk_realloc(m_ring.chunck.buffer, m_ring.chunck.size))){
TSK_DEBUG_ERROR("Failed to allocate new buffer");
WASAPI_SET_ERROR(-15);
}
// create ringbuffer
m_ring.size = TDAV_WASAPI_PRODUCER_NOTIF_POS_COUNT * m_ring.chunck.size;
TSK_DEBUG_INFO("#WASAPI: Audio producer ring size = %u", m_ring.size);
if(!m_ring.buffer){
m_ring.buffer = speex_buffer_init(m_ring.size);
}
else {
int sret;
if((sret = speex_buffer_resize(m_ring.buffer, m_ring.size)) < 0){
TSK_DEBUG_ERROR("speex_buffer_resize(%d) failed with error code=%d", m_ring.size, sret);
WASAPI_SET_ERROR(-16);
}
}
if(!m_ring.buffer){
TSK_DEBUG_ERROR("Failed to create a new ring buffer with size = %d", m_ring.size);
WASAPI_SET_ERROR(-17);
}
m_callback.fn = TMEDIA_PRODUCER(wasapi)->enc_cb.callback;
m_callback.pcData = TMEDIA_PRODUCER(wasapi)->enc_cb.callback_data;
bail:
if (pwstrCaptureId){
CoTaskMemFree((LPVOID)pwstrCaptureId);
}
if(ret != 0){
UnPrepare();
}
m_bPrepared = (ret == 0);
tsk_mutex_unlock(m_hMutex);
return ret;
}
int Doubango::VoIP::AudioCapture::UnPrepare()
{
tsk_mutex_lock(m_hMutex);
if(m_hCaptureEvent)
{
CloseHandle(m_hCaptureEvent), m_hCaptureEvent = nullptr;
}
if(m_hShutdownEvent)
{
CloseHandle(m_hShutdownEvent), m_hShutdownEvent = nullptr;
}
if(m_pDevice)
{
m_pDevice->Release(), m_pDevice = nullptr;
}
if(m_pClient)
{
m_pClient->Release(), m_pClient = nullptr;
}
TSK_FREE(m_ring.chunck.buffer);
if(m_ring.buffer){
speex_buffer_destroy(m_ring.buffer);
m_ring.buffer = nullptr;
}
m_callback.fn = nullptr;
m_callback.pcData = nullptr;
m_bPrepared = false;
tsk_mutex_unlock(m_hMutex);
return 0;
}
int Doubango::VoIP::AudioCapture::Start()
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
TSK_DEBUG_INFO("#WASAPI: Audio producer already started");
goto bail;
}
if(!m_bPrepared)
{
TSK_DEBUG_ERROR("Audio producer not prepared");
goto bail;
}
m_pAsyncThread = Windows::System::Threading::ThreadPool::RunAsync(ref new Windows::System::Threading::WorkItemHandler(this, &Doubango::VoIP::AudioCapture::AsyncThread),
Windows::System::Threading::WorkItemPriority::High,
Windows::System::Threading::WorkItemOptions::TimeSliced);
if((m_bStarted = (m_pAsyncThread != nullptr)))
{
HRESULT hr = m_pDevice->Start();
if(!SUCCEEDED(hr))
{
tdav_win32_print_error("Device::Start", hr);
Stop();
}
m_bPaused = false;
}
bail:
tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int Doubango::VoIP::AudioCapture::Stop()
{
m_bStarted = false;
tsk_mutex_lock(m_hMutex);
if (m_hShutdownEvent)
{
SetEvent(m_hShutdownEvent);
}
if (m_pAsyncThread)
{
m_pAsyncThread->Cancel();
m_pAsyncThread->Close();
m_pAsyncThread = nullptr;
}
if(m_pDevice)
{
m_pDevice->Stop();
}
// will be prepared again before next start()
UnPrepare();
tsk_mutex_unlock(m_hMutex);
return 0;
}
int Doubango::VoIP::AudioCapture::Pause()
{
tsk_mutex_lock(m_hMutex);
m_bPaused = true;
tsk_mutex_unlock(m_hMutex);
return 0;
}
void Doubango::VoIP::AudioCapture::AsyncThread(Windows::Foundation::IAsyncAction^ operation)
{
HRESULT hr = S_OK;
BYTE* pbData = nullptr;
UINT32 nFrames = 0;
DWORD dwFlags = 0;
UINT32 incomingBufferSize;
INT32 avail;
UINT32 nNextPacketSize;
HANDLE eventHandles[] = {
m_hCaptureEvent, // WAIT_OBJECT0
m_hShutdownEvent // WAIT_OBJECT1
};
TSK_DEBUG_INFO("#WASAPI: __record_thread -- START");
#define BREAK_WHILE tsk_mutex_unlock(m_hMutex); break;
while(m_bStarted && SUCCEEDED(hr)){
DWORD waitResult = WaitForMultipleObjectsEx(SIZEOF_ARRAY(eventHandles), eventHandles, FALSE, INFINITE, FALSE);
tsk_mutex_lock(m_hMutex);
if(!m_bStarted){
BREAK_WHILE;
}
if(waitResult == WAIT_OBJECT_0 && m_callback.fn) {
hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
while(SUCCEEDED(hr) && nNextPacketSize >0){
hr = m_pClient->GetBuffer(&pbData, &nFrames, &dwFlags, nullptr, nullptr);
if(SUCCEEDED(hr) && pbData && nFrames){
if((dwFlags & AUDCLNT_BUFFERFLAGS_SILENT) != AUDCLNT_BUFFERFLAGS_SILENT){
incomingBufferSize = nFrames * m_nSourceFrameSizeInBytes;
speex_buffer_write(m_ring.buffer, pbData, incomingBufferSize);
avail = speex_buffer_get_available(m_ring.buffer);
while (m_bStarted && avail >= (INT32)m_ring.chunck.size) {
avail -= speex_buffer_read(m_ring.buffer, m_ring.chunck.buffer, m_ring.chunck.size);
m_callback.fn(m_callback.pcData, m_ring.chunck.buffer, m_ring.chunck.size);
}
}
if (SUCCEEDED(hr)){
hr = m_pClient->ReleaseBuffer(nFrames);
}
if (SUCCEEDED(hr)){
hr = m_pClient->GetNextPacketSize(&nNextPacketSize);
}
}
}
}
else if(waitResult != WAIT_OBJECT_0){
BREAK_WHILE;
}
tsk_mutex_unlock(m_hMutex);
}// end-of-while
if (!SUCCEEDED(hr)){
tdav_win32_print_error("AsyncThread: ", hr);
}
TSK_DEBUG_INFO("WASAPI: __record_thread(%s) -- STOP", SUCCEEDED(hr) ? "OK": "NOK");
}
//
// WaveAPI producer object definition
//
/* constructor */
static tsk_object_t* tdav_producer_wasapi_ctor(tsk_object_t * self, va_list * app)
{
tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
if(wasapi){
/* init base */
tdav_producer_audio_init(TDAV_PRODUCER_AUDIO(wasapi));
/* init self */
wasapi->audioCapture = ref new Doubango::VoIP::AudioCapture();
}
return self;
}
/* destructor */
static tsk_object_t* tdav_producer_wasapi_dtor(tsk_object_t * self)
{
tdav_producer_wasapi_t *wasapi = (tdav_producer_wasapi_t*)self;
if(wasapi){
/* stop */
tdav_producer_wasapi_stop((tmedia_producer_t*)self);
/* deinit base */
tdav_producer_audio_deinit(TDAV_PRODUCER_AUDIO(wasapi));
/* deinit self */
if(wasapi->audioCapture){
delete wasapi->audioCapture;
wasapi->audioCapture = nullptr;
}
}
return self;
}
/* object definition */
static const tsk_object_def_t tdav_producer_wasapi_def_s =
{
sizeof(tdav_producer_wasapi_t),
tdav_producer_wasapi_ctor,
tdav_producer_wasapi_dtor,
tdav_producer_audio_cmp,
};
/* plugin definition*/
static const tmedia_producer_plugin_def_t tdav_producer_wasapi_plugin_def_s =
{
&tdav_producer_wasapi_def_s,
tmedia_audio,
"Microsoft Windows Audio Session API (WASAPI) producer",
tdav_producer_wasapi_set,
tdav_producer_wasapi_prepare,
tdav_producer_wasapi_start,
tdav_producer_wasapi_pause,
tdav_producer_wasapi_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_wasapi_plugin_def_t = &tdav_producer_wasapi_plugin_def_s;
#endif /* HAVE_WASAPI */

View File

@ -30,7 +30,7 @@
*/
#include "tinydav/codecs/h264/tdav_codec_h264.h"
#if HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
#include "tinydav/codecs/h264/tdav_codec_h264_rtp.h"
#include "tinydav/video/tdav_converter_video.h"
@ -43,7 +43,9 @@
#include "tsk_memory.h"
#include "tsk_debug.h"
#if HAVE_FFMPEG
#include <libavcodec/avcodec.h>
#endif
typedef struct tdav_codec_h264_s
{
@ -51,9 +53,11 @@ typedef struct tdav_codec_h264_s
// Encoder
struct{
#if HAVE_FFMPEG
AVCodec* codec;
AVCodecContext* context;
AVFrame* picture;
#endif
void* buffer;
int64_t frame_count;
tsk_bool_t force_idr;
@ -63,10 +67,11 @@ typedef struct tdav_codec_h264_s
// decoder
struct{
#if HAVE_FFMPEG
AVCodec* codec;
AVCodecContext* context;
AVFrame* picture;
#endif
void* accumulator;
tsk_size_t accumulator_pos;
tsk_size_t accumulator_size;
@ -107,13 +112,17 @@ static int tdav_codec_h264_set(tmedia_codec_t* self, const tmedia_param_t* param
case tmedia_codec_action_bw_down:
{
h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality + 1), 31);
#if HAVE_FFMPEG
h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
#endif
break;
}
case tmedia_codec_action_bw_up:
{
h264->encoder.quality = TSK_CLAMP(1, (h264->encoder.quality - 1), 31);
#if HAVE_FFMPEG
h264->encoder.context->global_quality = FF_QP2LAMBDA * h264->encoder.quality;
#endif
break;
}
}
@ -201,8 +210,11 @@ static int tdav_codec_h264_close(tmedia_codec_t* self)
static tsk_size_t tdav_codec_h264_encode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size)
{
int ret = 0;
#if HAVE_FFMPEG
int size;
tsk_bool_t send_idr, send_hdr;
#endif
tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
@ -215,6 +227,8 @@ static tsk_size_t tdav_codec_h264_encode(tmedia_codec_t* self, const void* in_da
TSK_DEBUG_ERROR("Codec not opened");
return 0;
}
#if HAVE_FFMPEG
// wrap yuv420 buffer
size = avpicture_fill((AVPicture *)h264->encoder.picture, (uint8_t*)in_data, PIX_FMT_YUV420P, h264->encoder.context->width, h264->encoder.context->height);
@ -260,13 +274,19 @@ static tsk_size_t tdav_codec_h264_encode(tmedia_codec_t* self, const void* in_da
}
h264 ->encoder.force_idr = tsk_false;
#elif HAVE_H264_PASSTHROUGH
tdav_codec_h264_encap(h264, (const uint8_t*)in_data, in_size);
#endif
return 0;
}
static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_data, tsk_size_t in_size, void** out_data, tsk_size_t* out_max_size, const tsk_object_t* proto_hdr)
{
tdav_codec_h264_t* h264 = (tdav_codec_h264_t*)self;
const trtp_rtp_header_t* rtp_hdr = proto_hdr;
const trtp_rtp_header_t* rtp_hdr = (const trtp_rtp_header_t*)proto_hdr;
const uint8_t* pay_ptr = tsk_null;
tsk_size_t pay_size = 0;
@ -275,9 +295,16 @@ static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_da
tsk_size_t retsize = 0, size_to_copy = 0;
static tsk_size_t xmax_size = (1920 * 1080 * 3) >> 3;
static tsk_size_t start_code_prefix_size = sizeof(H264_START_CODE_PREFIX);
#if HAVE_FFMPEG
int got_picture_ptr;
#endif
if(!h264 || !in_data || !in_size || !out_data || !h264->decoder.context){
if(!h264 || !in_data || !in_size || !out_data
#if HAVE_FFMPEG
|| !h264->decoder.context
#endif
)
{
TSK_DEBUG_ERROR("Invalid parameter");
return 0;
}
@ -349,6 +376,7 @@ static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_da
// end-accumulator
if(rtp_hdr->marker){
#if HAVE_FFMPEG
AVPacket packet;
@ -356,7 +384,7 @@ static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_da
av_init_packet(&packet);
packet.size = h264->decoder.accumulator_pos;
packet.data = h264->decoder.accumulator;
ret = avcodec_decode_video2(h264->decoder.context, h264->decoder.picture, &got_picture_ptr, &packet);
ret = avcodec_decode_video2(h264->decoder.context, h264->decoder.picture, &got_picture_ptr, &packet);
if(ret <0){
TSK_DEBUG_INFO("Failed to decode the buffer with error code =%d", ret);
@ -386,6 +414,19 @@ static tsk_size_t tdav_codec_h264_decode(tmedia_codec_t* self, const void* in_da
avpicture_layout((AVPicture *)h264->decoder.picture, h264->decoder.context->pix_fmt, h264->decoder.context->width, h264->decoder.context->height,
*out_data, retsize);
}
#elif HAVE_H264_PASSTHROUGH
if(*out_max_size < h264->decoder.accumulator_pos){
if((*out_data = tsk_realloc(*out_data, h264->decoder.accumulator_pos))){
*out_max_size = h264->decoder.accumulator_pos;
}
else{
*out_max_size = 0;
return 0;
}
}
memcpy(*out_data, h264->decoder.accumulator, h264->decoder.accumulator_pos);
retsize = h264->decoder.accumulator_pos;
#endif
h264->decoder.accumulator_pos = 0;
}
@ -518,7 +559,7 @@ static char* tdav_codec_h264_sdp_att_get(const tmedia_codec_t* self, const char*
/* constructor */
static tsk_object_t* tdav_codec_h264_base_ctor(tsk_object_t * self, va_list * app)
{
tdav_codec_h264_t *h264 = self;
tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
if(h264){
/* init base: called by tmedia_codec_create() */
/* init self */
@ -531,7 +572,7 @@ static tsk_object_t* tdav_codec_h264_base_ctor(tsk_object_t * self, va_list * ap
/* destructor */
static tsk_object_t* tdav_codec_h264_base_dtor(tsk_object_t * self)
{
tdav_codec_h264_t *h264 = self;
tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
if(h264){
/* deinit base */
tdav_codec_h264_common_deinit(self);
@ -597,7 +638,7 @@ static tsk_object_t* tdav_codec_h264_main_ctor(tsk_object_t * self, va_list * ap
/* destructor */
static tsk_object_t* tdav_codec_h264_main_dtor(tsk_object_t * self)
{
tdav_codec_h264_t *h264 = self;
tdav_codec_h264_t *h264 = (tdav_codec_h264_t*)self;
if(h264){
/* deinit base */
tdav_codec_h264_common_deinit(self);
@ -685,6 +726,7 @@ const tmedia_codec_plugin_def_t *tdav_codec_h264_main_plugin_def_t = &tdav_codec
int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
int ret;
tsk_size_t size;
@ -786,10 +828,17 @@ int tdav_codec_h264_open_encoder(tdav_codec_h264_t* self)
}
return ret;
#elif HAVE_H264_PASSTHROUGH
return 0;
#endif
TSK_DEBUG_ERROR("Not expected code called");
return -1;
}
int tdav_codec_h264_close_encoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
if(self->encoder.context){
avcodec_close(self->encoder.context);
av_free(self->encoder.context);
@ -799,6 +848,7 @@ int tdav_codec_h264_close_encoder(tdav_codec_h264_t* self)
av_free(self->encoder.picture);
self->encoder.picture = tsk_null;
}
#endif
if(self->encoder.buffer){
TSK_FREE(self->encoder.buffer);
}
@ -809,6 +859,7 @@ int tdav_codec_h264_close_encoder(tdav_codec_h264_t* self)
int tdav_codec_h264_open_decoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
int ret;
if(self->decoder.context){
@ -842,10 +893,19 @@ int tdav_codec_h264_open_decoder(tdav_codec_h264_t* self)
}
return ret;
#elif HAVE_H264_PASSTHROUGH
return 0;
#endif
TSK_DEBUG_ERROR("Unexpected code called");
return -1;
}
int tdav_codec_h264_close_decoder(tdav_codec_h264_t* self)
{
#if HAVE_FFMPEG
if(self->decoder.context){
avcodec_close(self->decoder.context);
av_free(self->decoder.context);
@ -855,6 +915,7 @@ int tdav_codec_h264_close_decoder(tdav_codec_h264_t* self)
av_free(self->decoder.picture);
self->decoder.picture = tsk_null;
}
#endif
TSK_FREE(self->decoder.accumulator);
self->decoder.accumulator_pos = 0;
@ -887,6 +948,7 @@ int tdav_codec_h264_init(tdav_codec_h264_t* self, profile_idc_t profile)
TMEDIA_CODEC_VIDEO(self)->in.max_mbps = TMEDIA_CODEC_VIDEO(self)->out.max_mbps = H264_MAX_MBPS*1000;
TMEDIA_CODEC_VIDEO(self)->in.max_br = TMEDIA_CODEC_VIDEO(self)->out.max_br = H264_MAX_BR*1000;
#if HAVE_FFMPEG
if(!(self->encoder.codec = avcodec_find_encoder(CODEC_ID_H264))){
TSK_DEBUG_ERROR("Failed to find H.264 encoder");
ret = -2;
@ -896,6 +958,9 @@ int tdav_codec_h264_init(tdav_codec_h264_t* self, profile_idc_t profile)
TSK_DEBUG_ERROR("Failed to find H.264 decoder");
ret = -3;
}
#elif HAVE_H264_PASSTHROUGH
TMEDIA_CODEC(self)->passthrough = tsk_true;
#endif
self->encoder.quality = 1;
@ -910,10 +975,12 @@ int tdav_codec_h264_deinit(tdav_codec_h264_t* self)
return -1;
}
#if HAVE_FFMPEG
self->encoder.codec = tsk_null;
self->decoder.codec = tsk_null;
// FFMpeg resources are destroyed by close()
#endif
return 0;
}

View File

@ -77,6 +77,8 @@
#include "tinydav/audio/directsound/tdav_consumer_dsound.h"
#include "tinydav/audio/coreaudio/tdav_consumer_audioqueue.h"
#include "tinydav/audio/coreaudio/tdav_consumer_audiounit.h"
#include "tinydav/audio/wasapi/tdav_consumer_wasapi.h"
#include "tinydav/video/winm/tdav_consumer_winm.h"
#include "tinydav/t140/tdav_consumer_t140.h"
#if HAVE_TINYDSHOW // DirectShow
# include "tinydshow/plugin/DSConsumer.h"
@ -87,6 +89,8 @@
#include "tinydav/audio/directsound/tdav_producer_dsound.h"
#include "tinydav/audio/coreaudio/tdav_producer_audioqueue.h"
#include "tinydav/audio/coreaudio/tdav_producer_audiounit.h"
#include "tinydav/audio/wasapi/tdav_producer_wasapi.h"
#include "tinydav/video/winm/tdav_producer_winm.h"
#include "tinydav/t140/tdav_producer_t140.h"
#if HAVE_TINYDSHOW // DirectShow
# include "tinydshow/plugin/DSProducer.h"
@ -225,7 +229,11 @@ int tdav_init()
# endif
tmedia_codec_plugin_register(tdav_codec_h263_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h261_plugin_def_t);
#elif HAVE_H264_PASSTHROUGH
tmedia_codec_plugin_register(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_register(tdav_codec_h264_main_plugin_def_t);
#endif
/* === Register converters === */
#if HAVE_LIBYUV
@ -240,9 +248,13 @@ int tdav_init()
tmedia_consumer_plugin_register(tdav_consumer_dsound_plugin_def_t);
#elif HAVE_WAVE_API
tmedia_consumer_plugin_register(tdav_consumer_waveapi_plugin_def_t);
#elif HAVE_WASAPI
tmedia_consumer_plugin_register(tdav_consumer_wasapi_plugin_def_t);
#endif
#if HAVE_TINYDSHOW // DirectShow
tmedia_consumer_plugin_register(tdshow_consumer_plugin_def_t);
#elif HAVE_WINM
tmedia_consumer_plugin_register(tdav_consumer_winm_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
@ -261,9 +273,13 @@ int tdav_init()
tmedia_producer_plugin_register(tdav_producer_dsound_plugin_def_t);
#elif HAVE_WAVE_API // WaveAPI
tmedia_producer_plugin_register(tdav_producer_waveapi_plugin_def_t);
#elif HAVE_WASAPI // WASAPI
tmedia_producer_plugin_register(tdav_producer_wasapi_plugin_def_t);
#endif
#if HAVE_TINYDSHOW // DirectShow
tmedia_producer_plugin_register(tdshow_producer_plugin_def_t);
#elif HAVE_WINM
tmedia_producer_plugin_register(tdav_producer_winm_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
@ -350,6 +366,9 @@ static tdav_codec_decl_t __codecs[] = {
# endif
{ tdav_codec_id_h263, &tdav_codec_h263_plugin_def_t },
{ tdav_codec_id_h261, &tdav_codec_h261_plugin_def_t },
#elif HAVE_H264_PASSTHROUGH
{ tdav_codec_id_h264_bp, &tdav_codec_h264_base_plugin_def_t },
{ tdav_codec_id_h264_mp, &tdav_codec_h264_main_plugin_def_t },
#endif
{ tdav_codec_id_t140, &tdav_codec_t140_plugin_def_t },
@ -494,13 +513,15 @@ tsk_bool_t _tdav_codec_is_supported(tdav_codec_id_t codec, const tmedia_codec_pl
#endif
#if HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)
if(tdav_codec_h264_is_ffmpeg_plugin(plugin)) return tsk_true;
#elif HAVE_H264_PASSTHROUGH
return tsk_true;
#endif
}
else{
#if HAVE_CUDA
if(tdav_codec_h264_cuda_is_supported()) return tsk_true;
#endif
#if HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)
#if (HAVE_FFMPEG && (!defined(HAVE_H264) || HAVE_H264)) || HAVE_H264_PASSTHROUGH
return tsk_true;
#endif
}
@ -599,7 +620,9 @@ int tdav_deinit()
# if !defined(HAVE_THEORA) || HAVE_THEORA
tmedia_codec_plugin_unregister(tdav_codec_theora_plugin_def_t);
# endif
#elif HAVE_H264_PASSTHROUGH
tmedia_codec_plugin_unregister(tdav_codec_h264_base_plugin_def_t);
tmedia_codec_plugin_unregister(tdav_codec_h264_main_plugin_def_t);
#endif
/* === unRegister converters === */
@ -613,15 +636,22 @@ int tdav_deinit()
tmedia_consumer_plugin_unregister(tdav_consumer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H
tmedia_consumer_plugin_unregister(tdav_consumer_dsound_plugin_def_t);
#elif HAVE_WAVE_API
#endif
#if HAVE_WAVE_API
tmedia_consumer_plugin_unregister(tdav_consumer_waveapi_plugin_def_t);
#endif
#if HAVE_WASAPI
tmedia_consumer_plugin_unregister(tdav_consumer_wasapi_plugin_def_t);
#endif
#if HAVE_TINYDSHOW // DirectShow
tmedia_consumer_plugin_unregister(tdshow_consumer_plugin_def_t);
#elif HAVE_WINM
tmedia_consumer_plugin_unregister(tdav_consumer_winm_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit
tmedia_consumer_plugin_unregister(tdav_consumer_audiounit_plugin_def_t);
#elif HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
#endif
#if HAVE_COREAUDIO_AUDIO_QUEUE // CoreAudio based on AudioQueue
tmedia_consumer_plugin_unregister(tdav_consumer_audioqueue_plugin_def_t);
#endif
@ -629,11 +659,17 @@ int tdav_deinit()
tmedia_producer_plugin_unregister(tdav_producer_t140_plugin_def_t); /* T140 */
#if HAVE_DSOUND_H // DirectSound
tmedia_producer_plugin_unregister(tdav_producer_dsound_plugin_def_t);
#elif HAVE_WAVE_API // WaveAPI
#endif
#if HAVE_WAVE_API // WaveAPI
tmedia_producer_plugin_unregister(tdav_producer_waveapi_plugin_def_t);
#endif
#if HAVE_WASAPI // WASAPI
tmedia_producer_plugin_unregister(tdav_producer_wasapi_plugin_def_t);
#endif
#if HAVE_TINYDSHOW // DirectShow
tmedia_producer_plugin_unregister(tdshow_producer_plugin_def_t);
#elif HAVE_WINM
tmedia_producer_plugin_unregister(tdav_producer_winm_plugin_def_t);
#endif
#if HAVE_COREAUDIO_AUDIO_UNIT // CoreAudio based on AudioUnit

View File

@ -64,7 +64,7 @@ static const tsk_bool_t __have_libsrtp = tsk_false;
#define TDAV_FIXME_MEDIA_LEVEL_DTLS_ATT 0
#endif /* TDAV_FIXME_MEDIA_LEVEL_DTLS_ATT */
static void* _tdav_session_av_error_async_thread(void* usrdata);
static void* TSK_STDCALL _tdav_session_av_error_async_thread(void* usrdata);
static int _tdav_session_av_raise_error_async(struct tdav_session_av_s* self, tsk_bool_t is_fatal, const char* reason);
#if HAVE_SRTP
static int _tdav_session_av_srtp_dtls_cb(const void* usrdata, enum trtp_srtp_dtls_event_type_e type, const char* reason);
@ -277,12 +277,12 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
if(param->value_type == tmedia_pvt_pchar){
if(tsk_striequals(param->key, "remote-ip")){
if(param->value){
tsk_strupdate(&self->remote_ip, param->value);
tsk_strupdate(&self->remote_ip, (const char*)param->value);
return tsk_true;
}
}
else if(tsk_striequals(param->key, "local-ip")){
tsk_strupdate(&self->local_ip, param->value);
tsk_strupdate(&self->local_ip, (const char*)param->value);
return tsk_true;
}
else if(tsk_striequals(param->key, "local-ipver")){
@ -342,12 +342,12 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
}
else if(tsk_striequals(param->key, "remote-sdp-message")){
TSK_OBJECT_SAFE_FREE(self->remote_sdp);
self->remote_sdp = tsk_object_ref(param->value);
self->remote_sdp = (struct tsdp_message_s*)tsk_object_ref(param->value);
return tsk_true;
}
else if(tsk_striequals(param->key, "local-sdp-message")){
TSK_OBJECT_SAFE_FREE(self->local_sdp);
self->local_sdp = tsk_object_ref(param->value);
self->local_sdp = (struct tsdp_message_s*)tsk_object_ref(param->value);
return tsk_true;
}
}
@ -1478,7 +1478,7 @@ const tmedia_codec_t* tdav_session_av_get_red_codec(const tdav_session_av_t* sel
return tsk_null;
}
static void* _tdav_session_av_error_async_thread(void* usrdata)
static void* TSK_STDCALL _tdav_session_av_error_async_thread(void* usrdata)
{
if(usrdata){
tdav_session_av_t* self = (tdav_session_av_t*)usrdata;

View File

@ -30,11 +30,15 @@
#if TDAV_UNDER_WINDOWS
#include "tsk_string.h"
#include "tsk_memory.h"
#include "tsk_debug.h"
#include <windows.h>
int tdav_win32_init()
{
#if !TDAV_UNDER_WINDOWS_RT
MMRESULT result;
// Timers accuracy
@ -42,34 +46,52 @@ int tdav_win32_init()
if(result){
TSK_DEBUG_ERROR("timeBeginPeriod(1) returned result=%u", result);
}
#endif
return 0;
}
void tdav_win32_print_error(const char* func, HRESULT hr)
TINYDAV_API void tdav_win32_print_error(const char* func, HRESULT hr)
{
CHAR* message = tsk_null;
CHAR message[1024] = {0};
#if TDAV_UNDER_WINDOWS_RT
// FormatMessageA not allowed on the Store
static WCHAR wBuff[1024] = {0};
FormatMessageW(
FORMAT_MESSAGE_FROM_SYSTEM,
tsk_null,
hr,
0,
wBuff,
sizeof(wBuff)-1,
tsk_null);
WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wBuff, wcslen(wBuff), message, sizeof(message) - 1, NULL, NULL);
#else
#ifdef _WIN32_WCE
FormatMessage
#else
FormatMessageA
#endif
(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
#if !TDAV_UNDER_WINDOWS_RT
FORMAT_MESSAGE_ALLOCATE_BUFFER |
#endif
FORMAT_MESSAGE_FROM_SYSTEM,
tsk_null,
hr,
0,
message,
0,
sizeof(message) - 1,
tsk_null);
#endif
TSK_DEBUG_ERROR("%s():", message);
LocalFree(message);
TSK_DEBUG_ERROR("%s(): %s", func, message);
}
int tdav_win32_deinit()
{
#if !TDAV_UNDER_WINDOWS_RT
MMRESULT result;
// Timers accuracy
@ -77,6 +99,8 @@ int tdav_win32_deinit()
if(result){
TSK_DEBUG_ERROR("timeEndPeriod(1) returned result=%u", result);
}
#endif
return 0;
}

View File

@ -266,13 +266,14 @@ static int tdav_session_video_producer_enc_cb(const void* callback_data, const v
//base->producer->video.rotation = ((__rotation_counter++ % 150) < 75) ? 90 : 0;
#define PRODUCER_NEED_ENCODER (base->producer->encoder.codec_id == tmedia_codec_id_none) // Otherwise, frames from the producer are already encoded
#define PRODUCER_SIZE_CHANGED (video->conv.producerWidth != base->producer->video.width) || (video->conv.producerHeight != base->producer->video.height) \
|| (video->conv.xProducerSize != size)
#define ENCODED_NEED_FLIP TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.flip
#define PRODUCED_FRAME_NEED_ROTATION (base->producer->video.rotation != 0)
#define PRODUCED_FRAME_NEED_CHROMA_CONVERSION (base->producer->video.chroma != TMEDIA_CODEC_VIDEO(video->encoder.codec)->out.chroma)
// Video codecs only accept YUV420P buffers ==> do conversion if needed or producer doesn't have the right size
if(PRODUCED_FRAME_NEED_CHROMA_CONVERSION || PRODUCER_SIZE_CHANGED || ENCODED_NEED_FLIP || PRODUCED_FRAME_NEED_ROTATION){
if(PRODUCER_NEED_ENCODER && (PRODUCED_FRAME_NEED_CHROMA_CONVERSION || PRODUCER_SIZE_CHANGED || ENCODED_NEED_FLIP || PRODUCED_FRAME_NEED_ROTATION)){
// Create video converter if not already done or producer size have changed
if(!video->conv.toYUV420 || PRODUCER_SIZE_CHANGED){
TSK_OBJECT_SAFE_FREE(video->conv.toYUV420);
@ -641,13 +642,14 @@ static int _tdav_session_video_decode(tdav_session_video_t* self, const trtp_rtp
}
// Convert decoded data to the consumer chroma and size
#define CONSUMER_NEED_DECODER (base->consumer->decoder.codec_id == tmedia_codec_id_none) // Otherwise, the consumer requires encoded frames
#define CONSUMER_IN_N_DISPLAY_MISMATCH (base->consumer->video.in.width != base->consumer->video.display.width || base->consumer->video.in.height != base->consumer->video.display.height)
#define CONSUMER_DISPLAY_N_CODEC_MISMATCH (base->consumer->video.display.width != TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.width || base->consumer->video.display.height != TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.height)
#define CONSUMER_DISPLAY_N_CONVERTER_MISMATCH ( (self->conv.fromYUV420 && self->conv.fromYUV420->dstWidth != base->consumer->video.display.width) || (self->conv.fromYUV420 && self->conv.fromYUV420->dstHeight != base->consumer->video.display.height) )
#define CONSUMER_CHROMA_MISMATCH (base->consumer->video.display.chroma != TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.chroma)
#define DECODED_NEED_FLIP (TMEDIA_CODEC_VIDEO(self->decoder.codec)->in.flip)
if((CONSUMER_CHROMA_MISMATCH || CONSUMER_DISPLAY_N_CODEC_MISMATCH || CONSUMER_IN_N_DISPLAY_MISMATCH || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH || DECODED_NEED_FLIP)){
if(CONSUMER_NEED_DECODER && (CONSUMER_CHROMA_MISMATCH || CONSUMER_DISPLAY_N_CODEC_MISMATCH || CONSUMER_IN_N_DISPLAY_MISMATCH || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH || DECODED_NEED_FLIP)){
// Create video converter if not already done
if(!self->conv.fromYUV420 || CONSUMER_DISPLAY_N_CONVERTER_MISMATCH){

View File

@ -0,0 +1,214 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_consumer_winm.cxx
* @brief Microsoft Windows Media (WinM) consumer.
*
*/
#include "tinydav/video/winm/tdav_consumer_winm.h"
#if HAVE_WINM
#include "tsk_string.h"
#include "tsk_debug.h"
#if TDAV_UNDER_WINDOWS_PHONE
#include "Globals.h"
using namespace doubango_rt::BackEnd;
#endif
typedef struct tdav_consumer_winm_s
{
TMEDIA_DECLARE_CONSUMER;
}
tdav_consumer_winm_t;
/* ============ Media Producer Interface ================= */
int tdav_consumer_winm_set(tmedia_consumer_t *self, const tmedia_param_t* param)
{
int ret = 0;
if(!self || !param){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return ret;
}
int tdav_consumer_winm_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
{
tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
if(!consumer || !codec && codec->plugin){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
TMEDIA_CONSUMER(consumer)->decoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
TMEDIA_CONSUMER(consumer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->in.fps;
TMEDIA_CONSUMER(consumer)->video.in.width = TMEDIA_CODEC_VIDEO(codec)->in.width;
TMEDIA_CONSUMER(consumer)->video.in.height = TMEDIA_CODEC_VIDEO(codec)->in.height;
if(!TMEDIA_CONSUMER(consumer)->video.display.width){
TMEDIA_CONSUMER(consumer)->video.display.width = TMEDIA_CONSUMER(consumer)->video.in.width;
}
if(!TMEDIA_CONSUMER(consumer)->video.display.height){
TMEDIA_CONSUMER(consumer)->video.display.height = TMEDIA_CONSUMER(consumer)->video.in.height;
}
return 0;
}
int tdav_consumer_winm_start(tmedia_consumer_t* self)
{
tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
if(!consumer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TDAV_UNDER_WINDOWS_PHONE
if(Globals::Instance->VideoRenderer != nullptr)
{
Globals::Instance->VideoRenderer->Start();
}
#endif
return 0;
}
int tdav_consumer_winm_consume(tmedia_consumer_t* self, const void* buffer, tsk_size_t size, const tsk_object_t* proto_hdr)
{
tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
#if TDAV_UNDER_WINDOWS_PHONE
static const UINT64 hnsPresenationTime = 0;
static const UINT64 hnsSampleDuration = 0;
Globals::Instance->ReceiveVideoFrame((BYTE*)buffer, size, hnsPresenationTime, hnsSampleDuration);
#endif
return 0;
}
int tdav_consumer_winm_pause(tmedia_consumer_t* self)
{
tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
if(!consumer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
return 0;
}
int tdav_consumer_winm_stop(tmedia_consumer_t* self)
{
tdav_consumer_winm_t* consumer = (tdav_consumer_winm_t*)self;
TSK_DEBUG_INFO("tdav_consumer_winm_stop");
if(!self){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TDAV_UNDER_WINDOWS_PHONE
if(Globals::Instance->VideoRenderer != nullptr)
{
Globals::Instance->VideoRenderer->Stop();
}
#endif
return 0;
}
//
// Windows Media video consumer object definition
//
/* constructor */
static tsk_object_t* tdav_consumer_winm_ctor(tsk_object_t * self, va_list * app)
{
tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
if(consumer){
/* init base */
tmedia_consumer_init(TMEDIA_CONSUMER(consumer));
TMEDIA_CONSUMER(consumer)->video.display.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
/* init self */
TMEDIA_CONSUMER(consumer)->video.fps = 15;
TMEDIA_CONSUMER(consumer)->video.display.width = 352;
TMEDIA_CONSUMER(consumer)->video.display.height = 288;
TMEDIA_CONSUMER(consumer)->video.display.auto_resize = tsk_true;
}
return self;
}
/* destructor */
static tsk_object_t* tdav_consumer_winm_dtor(tsk_object_t * self)
{
tdav_consumer_winm_t *consumer = (tdav_consumer_winm_t *)self;
if(consumer){
/* stop */
//if(consumer->started){
tdav_consumer_winm_stop((tmedia_consumer_t*)self);
//}
/* deinit base */
tmedia_consumer_deinit(TMEDIA_CONSUMER(consumer));
/* deinit self */
}
return self;
}
/* object definition */
static const tsk_object_def_t tdav_consumer_winm_def_s =
{
sizeof(tdav_consumer_winm_t),
tdav_consumer_winm_ctor,
tdav_consumer_winm_dtor,
tsk_null,
};
/* plugin definition*/
static const tmedia_consumer_plugin_def_t tdav_consumer_winm_plugin_def_s =
{
&tdav_consumer_winm_def_s,
tmedia_video,
"Microsoft Windows Media consumer (Video)",
tdav_consumer_winm_set,
tdav_consumer_winm_prepare,
tdav_consumer_winm_start,
tdav_consumer_winm_consume,
tdav_consumer_winm_pause,
tdav_consumer_winm_stop
};
extern const tmedia_consumer_plugin_def_t *tdav_consumer_winm_plugin_def_t = &tdav_consumer_winm_plugin_def_s;
#endif /* HAVE_WINM */

View File

@ -0,0 +1,732 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 DOUBANGO.
*/
/**@file tdav_producer_winm.cxx
* @brief Microsoft Windows Media (WinM) video producer.
*
*/
#include "tinydav/video/winm/tdav_producer_winm.h"
#if HAVE_WINM
#include "tsk_string.h"
#include "tsk_debug.h"
#if TDAV_UNDER_WINDOWS_PHONE
#include <windows.h>
#include <implements.h>
#include <Windows.Phone.Media.Capture.h>
#include <Windows.Phone.Media.Capture.Native.h>
using namespace Windows::System::Threading;
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
using namespace Platform;
using namespace Windows::Phone::Media::Capture;
using namespace Windows::Storage::Streams;
struct tdav_producer_winm_s;
namespace Doubango
{
namespace VoIP
{
class CaptureSampleSink :
public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>,
ICameraCaptureSampleSink>
{
DWORD m_dwSampleCount;
const struct tdav_producer_winm_s* m_pProducer;
public:
STDMETHODIMP RuntimeClassInitialize(const struct tdav_producer_winm_s* pProducer)
{
m_dwSampleCount = 0;
m_pProducer = pProducer;
return S_OK;
}
DWORD GetSampleCount()
{
return m_dwSampleCount;
}
IFACEMETHODIMP_(void)
OnSampleAvailable(
ULONGLONG hnsPresentationTime,
ULONGLONG hnsSampleDuration,
DWORD cbSample,
BYTE* pSample)
{
m_dwSampleCount++;
if(m_pProducer && TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback)
{
TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback(TMEDIA_PRODUCER(m_pProducer)->enc_cb.callback_data, pSample, cbSample);
}
}
};
ref class VideoCapturePhone sealed
{
public:
virtual ~VideoCapturePhone();
internal:
VideoCapturePhone();
int Prepare(const struct tdav_producer_winm_s* winm);
int Start();
int Pause();
int Stop();
void SetCameraLocation(Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation);
void ToggleCamera();
private:
int UnPrepare();
void ToggleCameraThread(Windows::Foundation::IAsyncAction^ operation);
tsk_mutex_handle_t* m_hMutex;
const tdav_producer_winm_s* m_pWrappedPlugin;
// Has capture started?
bool m_bStarted, m_bPrepared;
// Events to signal whether capture has stopped/started
HANDLE m_hStopCompleted;
HANDLE m_hStartCompleted;
IAsyncOperation<AudioVideoCaptureDevice^> ^m_pOpenOperation;
Windows::Foundation::IAsyncAction^ m_ToggleThread;
// Native sink and video device
CaptureSampleSink *m_pVideoSink;
IAudioVideoCaptureDeviceNative *m_pVideoDevice;
Windows::Phone::Media::Capture::CameraSensorLocation m_eCameraLocation;
Windows::Phone::Media::Capture::AudioVideoCaptureDevice ^m_pVideoOnlyDevice;
Windows::Foundation::IAsyncAction ^m_pVideoCaptureAction;
};
}
}
using namespace Doubango::VoIP;
#endif
typedef struct tdav_producer_winm_s
{
TMEDIA_DECLARE_PRODUCER;
#if TDAV_UNDER_WINDOWS_PHONE
VideoCapturePhone^ videoCapturePhone;
#endif
}
tdav_producer_winm_t;
/* ============ Media Producer Interface ================= */
static int tdav_producer_winm_set(tmedia_producer_t *self, const tmedia_param_t* param)
{
int ret = 0;
tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
if(!producer || !param){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(param->value_type == tmedia_pvt_int32){
if(tsk_striequals(param->key, "camera-location")){
Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation = (Windows::Phone::Media::Capture::CameraSensorLocation)*((int32_t*)param->value);
if(producer->videoCapturePhone)
{
producer->videoCapturePhone->SetCameraLocation(cameraLocation);
return 0;
}
}
}
return ret;
}
static int tdav_producer_winm_prepare(tmedia_producer_t* self, const tmedia_codec_t* codec)
{
tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
if(!producer || !codec && codec->plugin){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
TMEDIA_PRODUCER(producer)->encoder.codec_id = (tmedia_codec_id_t)(tmedia_codec_id_h264_bp | tmedia_codec_id_h264_mp);
TMEDIA_PRODUCER(producer)->video.fps = TMEDIA_CODEC_VIDEO(codec)->out.fps;
TMEDIA_PRODUCER(producer)->video.width = TMEDIA_CODEC_VIDEO(codec)->out.width;
TMEDIA_PRODUCER(producer)->video.height = TMEDIA_CODEC_VIDEO(codec)->out.height;
#if TDAV_UNDER_WINDOWS_PHONE
return producer->videoCapturePhone->Prepare(producer);
#else
TSK_DEBUG_ERROR("Unexpected code called");
return -1;
#endif
}
static int tdav_producer_winm_start(tmedia_producer_t* self)
{
tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
if(!producer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TDAV_UNDER_WINDOWS_PHONE
return producer->videoCapturePhone->Start();
#else
TSK_DEBUG_ERROR("Unexpected code called");
return -1;
#endif
}
static int tdav_producer_winm_pause(tmedia_producer_t* self)
{
tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
if(!producer){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TDAV_UNDER_WINDOWS_PHONE
return producer->videoCapturePhone->Pause();
#else
TSK_DEBUG_ERROR("Unexpected code called");
return -1;
#endif
}
static int tdav_producer_winm_stop(tmedia_producer_t* self)
{
tdav_producer_winm_t* producer = (tdav_producer_winm_t*)self;
if(!self){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TDAV_UNDER_WINDOWS_PHONE
return producer->videoCapturePhone->Stop();
#else
TSK_DEBUG_ERROR("Unexpected code called");
return -1;
#endif
}
#if TDAV_UNDER_WINDOWS_PHONE
VideoCapturePhone::VideoCapturePhone() :
m_bStarted(false),
m_bPrepared(false),
m_pVideoOnlyDevice(nullptr),
m_pVideoSink(NULL),
m_pVideoDevice(NULL),
m_pWrappedPlugin(NULL),
m_pOpenOperation(nullptr),
m_eCameraLocation(CameraSensorLocation::Front)
{
if(!(m_hMutex = tsk_mutex_create())){
throw ref new Platform::FailureException(L"Failed to create mutex");
}
m_hStopCompleted = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!m_hStopCompleted)
{
throw ref new Platform::Exception(HRESULT_FROM_WIN32(GetLastError()), L"Could not create shutdown event");
}
m_hStartCompleted = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!m_hStartCompleted)
{
throw ref new Platform::Exception(HRESULT_FROM_WIN32(GetLastError()), L"Could not create start event");
}
}
VideoCapturePhone::~VideoCapturePhone()
{
Stop();
if(m_ToggleThread)
{
m_ToggleThread->Cancel();
m_ToggleThread->Close();
m_ToggleThread = nullptr;
}
tsk_mutex_destroy(&m_hMutex);
}
int VideoCapturePhone::Prepare(const struct tdav_producer_winm_s* winm)
{
HRESULT hr = E_FAIL;
int ret = 0;
Windows::Foundation::Size dimensionsRequested, dimensionsClosest;
Collections::IVectorView<Size> ^availableSizes;
Collections::IIterator<Windows::Foundation::Size> ^availableSizesIterator;
bool bClosestFound = false;
#define WINM_SET_ERROR(code) ret = (code); goto bail;
tsk_mutex_lock(m_hMutex);
if(m_bPrepared)
{
TSK_DEBUG_INFO("#WASAPI: Audio producer already prepared");
goto bail;
}
if(!winm)
{
TSK_DEBUG_ERROR("Invalid parameter");
WINM_SET_ERROR(-1);
}
if(m_pVideoCaptureAction || m_pVideoDevice || m_pVideoOnlyDevice || m_pVideoSink || m_pOpenOperation){
TSK_DEBUG_ERROR("Producer already prepared");
WINM_SET_ERROR(-2);
}
dimensionsClosest.Width = dimensionsRequested.Width = (float)TMEDIA_PRODUCER(winm)->video.width;
dimensionsClosest.Height = dimensionsRequested.Height = (float)TMEDIA_PRODUCER(winm)->video.height;
availableSizes = AudioVideoCaptureDevice::GetAvailableCaptureResolutions(m_eCameraLocation);
availableSizesIterator = availableSizes->First();
while(!m_pOpenOperation && availableSizesIterator->HasCurrent)
{
TSK_DEBUG_INFO("Camera Supported size: (%f, %f)", availableSizesIterator->Current.Width, availableSizesIterator->Current.Height);
if(availableSizesIterator->Current.Height == dimensionsRequested.Width && availableSizesIterator->Current.Width == dimensionsRequested.Height)
{
m_pOpenOperation = AudioVideoCaptureDevice::OpenForVideoOnlyAsync(m_eCameraLocation, dimensionsRequested);
TSK_DEBUG_INFO("Camera::Open(%d, %d)", dimensionsRequested.Width, dimensionsRequested.Height);
break;
}
else if(!bClosestFound && (availableSizesIterator->Current.Height <= dimensionsRequested.Height && availableSizesIterator->Current.Width <= dimensionsRequested.Width))
{
dimensionsClosest.Height = availableSizesIterator->Current.Height;
dimensionsClosest.Width = availableSizesIterator->Current.Width;
bClosestFound = true;
}
availableSizesIterator->MoveNext();
}
if(!m_pOpenOperation)
{
m_pOpenOperation = AudioVideoCaptureDevice::OpenForVideoOnlyAsync(m_eCameraLocation, dimensionsClosest);
TSK_DEBUG_INFO("Camera::Open(%f, %f)", dimensionsClosest.Width, dimensionsClosest.Height);
}
bail:
if(ret != 0){
UnPrepare();
}
if((m_bPrepared = (ret == 0)))
{
m_pWrappedPlugin = winm;
}
tsk_mutex_unlock(m_hMutex);
return ret;
}
int VideoCapturePhone::Start()
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
TSK_DEBUG_INFO("#WINM: Video producer already started");
goto bail;
}
if(!m_bPrepared)
{
TSK_DEBUG_ERROR("#WINM: Video producer not prepared");
goto bail;
}
m_bStarted = true;
m_pOpenOperation->Completed = ref new AsyncOperationCompletedHandler<AudioVideoCaptureDevice^>([this] (IAsyncOperation<AudioVideoCaptureDevice^> ^operation, Windows::Foundation::AsyncStatus status)
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
if(status == Windows::Foundation::AsyncStatus::Completed)
{
TSK_DEBUG_INFO("+[VideoCapturePhone::Prepare] => OpenAsyncOperation started");
auto videoDevice = operation->GetResults();
m_pVideoOnlyDevice = videoDevice;
IAudioVideoCaptureDeviceNative *pNativeDevice = NULL;
HRESULT hr = reinterpret_cast<IUnknown*>(videoDevice)->QueryInterface(__uuidof(IAudioVideoCaptureDeviceNative), (void**) &pNativeDevice);
if (NULL == pNativeDevice || FAILED(hr))
{
throw ref new FailureException("Unable to QI IAudioVideoCaptureDeviceNative");
}
// Save off the native device
m_pVideoDevice = pNativeDevice;
// Set Fps
CameraCapturePropertyRange^ cameraCapturePropertyRange = m_pVideoOnlyDevice->GetSupportedPropertyRange(m_eCameraLocation, KnownCameraAudioVideoProperties::VideoFrameRate);
if(cameraCapturePropertyRange)
{
try
{
Windows::Foundation::IPropertyValue^ vMin = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Min);
Windows::Foundation::IPropertyValue^ vMax = dynamic_cast<Windows::Foundation::IPropertyValue^>(cameraCapturePropertyRange->Max);
UINT32 nFps = TSK_CLAMP(vMin->GetUInt32(), (UINT32)TMEDIA_PRODUCER(m_pWrappedPlugin)->video.fps, vMax->GetUInt32());
m_pVideoOnlyDevice->SetProperty(KnownCameraAudioVideoProperties::VideoFrameRate, nFps);
}
catch(...){ }
}
// Set Camera Rotation
try
{
m_pVideoOnlyDevice->SetProperty(
KnownCameraGeneralProperties::EncodeWithOrientation,
m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back ? 90 : -90
);
}
catch(...){ }
// Create the sink
MakeAndInitialize<CaptureSampleSink>(&(m_pVideoSink), m_pWrappedPlugin);
pNativeDevice->SetVideoSampleSink(m_pVideoSink);
// Use the same encoding format as in VideoMediaStreamSource.cs
videoDevice->VideoEncodingFormat = CameraCaptureVideoFormat::H264;
SetEvent(m_hStartCompleted);
// Start recording to our sink
m_pVideoCaptureAction = videoDevice->StartRecordingToSinkAsync();
m_pVideoCaptureAction->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^asyncInfo, Windows::Foundation::AsyncStatus status)
{
if(status == Windows::Foundation::AsyncStatus::Completed)
{
TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync completed");
}
else if(status == Windows::Foundation::AsyncStatus::Error || status == Windows::Foundation::AsyncStatus::Canceled)
{
TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => StartRecordingToSinkAsync did not complete");
}
});
TSK_DEBUG_INFO("-[VideoCapturePhone::Prepare] => OpenAsyncOperation Completed");
}
else if(status == Windows::Foundation::AsyncStatus::Canceled)
{
TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation Canceled");
}
else if(status == Windows::Foundation::AsyncStatus::Error)
{
TSK_DEBUG_INFO("[VideoCapturePhone::Prepare] => OpenAsyncOperation encountered an error");
}
}
tsk_mutex_unlock(m_hMutex);
});
bail:
tsk_mutex_unlock(m_hMutex);
return (m_bStarted ? 0 : -2);
}
int VideoCapturePhone::Pause()
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
}
tsk_mutex_unlock(m_hMutex);
return 0;
}
int VideoCapturePhone::Stop()
{
tsk_mutex_lock(m_hMutex);
TSK_DEBUG_INFO("+[VideoCapturePhone::Stop] => Trying to stop capture");
if (m_pVideoOnlyDevice)
{
TSK_DEBUG_INFO("Destroying VideoCaptureDevice");
try
{
if(m_bStarted)
{
m_pVideoOnlyDevice->StopRecordingAsync()->Completed = ref new AsyncActionCompletedHandler([this] (IAsyncAction ^action, Windows::Foundation::AsyncStatus status){
if(status == Windows::Foundation::AsyncStatus::Completed)
{
TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Video successfully stopped");
}
else
{
TSK_DEBUG_INFO("[VideoCapturePhone::StopRecordingAsync] Error occurred while stopping recording");
}
m_pVideoCaptureAction = nullptr;
m_pVideoOnlyDevice = nullptr;
m_bStarted = false;
SetEvent(m_hStopCompleted);
});
}
}
catch(...)
{
// A Platform::ObjectDisposedException can be raised if the app has had its access
// to video revoked (most commonly when the app is going out of the foreground)
TSK_DEBUG_ERROR("Exception caught while destroying video capture");
m_pVideoCaptureAction = nullptr;
m_pVideoOnlyDevice = nullptr;
m_bStarted = false;
SetEvent(m_hStopCompleted);
}
if (m_pVideoDevice)
{
m_pVideoDevice->Release();
m_pVideoDevice = NULL;
}
if (m_pVideoSink)
{
m_pVideoSink->Release();
m_pVideoSink = NULL;
}
}
else
{
m_bStarted = false;
}
TSK_DEBUG_INFO("-[VideoCapturePhone::Stop] => finished stopping capture\n");
// will be prepared again before next start()
UnPrepare();
tsk_mutex_unlock(m_hMutex);
return 0;
}
void VideoCapturePhone::SetCameraLocation(Windows::Phone::Media::Capture::CameraSensorLocation cameraLocation)
{
if(m_eCameraLocation != cameraLocation)
{
if(m_bStarted)
{
ToggleCamera();
}
else
{
m_eCameraLocation = cameraLocation;
}
}
}
int VideoCapturePhone::UnPrepare()
{
tsk_mutex_lock(m_hMutex);
if(m_bStarted)
{
ResetEvent(m_hStopCompleted);
Stop();
DWORD waitResult = WaitForSingleObjectEx(m_hStopCompleted, 5000, FALSE);
if(waitResult != WAIT_OBJECT_0)
{
TSK_DEBUG_ERROR("Failed to stop video producer");
}
}
if (m_pVideoDevice)
{
m_pVideoDevice->Release();
m_pVideoDevice = NULL;
}
if (m_pVideoSink)
{
m_pVideoSink->Release();
m_pVideoSink = NULL;
}
m_pOpenOperation = nullptr;
m_bPrepared = false;
tsk_mutex_unlock(m_hMutex);
return 0;
}
void VideoCapturePhone::ToggleCamera()
{
tsk_mutex_lock(m_hMutex);
if(m_ToggleThread)
{
m_ToggleThread->Cancel();
m_ToggleThread->Close();
m_ToggleThread = nullptr;
}
m_ToggleThread = ThreadPool::RunAsync(ref new WorkItemHandler(this, &VideoCapturePhone::ToggleCameraThread), WorkItemPriority::High, WorkItemOptions::TimeSliced);
tsk_mutex_unlock(m_hMutex);
}
void VideoCapturePhone::ToggleCameraThread(Windows::Foundation::IAsyncAction^ operation)
{
TSK_DEBUG_INFO("+[VideoCapturePhone::ToggleCamera] => Toggling camera");
ResetEvent(m_hStopCompleted);
Stop();
DWORD waitResult = WaitForSingleObjectEx(m_hStopCompleted, INFINITE, FALSE);
if(waitResult == WAIT_OBJECT_0)
{
ResetEvent(m_hStartCompleted);
if(m_eCameraLocation == Windows::Phone::Media::Capture::CameraSensorLocation::Back)
{
m_eCameraLocation = Windows::Phone::Media::Capture::CameraSensorLocation::Front;
}
else
{
m_eCameraLocation = Windows::Phone::Media::Capture::CameraSensorLocation::Back;
}
Prepare(m_pWrappedPlugin);
Start();
}
else
{
throw ref new Platform::Exception(HRESULT_FROM_WIN32(waitResult), L"Error waiting for capture to stop when toggling cameras");
}
waitResult = WaitForSingleObjectEx(m_hStartCompleted, INFINITE, FALSE);
if(waitResult == WAIT_OBJECT_0)
{
// CameraLocationChanged(newCameraLocation);
}
else
{
throw ref new Platform::Exception(HRESULT_FROM_WIN32(waitResult), L"Error waiting for capture to start when toggling cameras");
}
TSK_DEBUG_INFO("-[VideoCapturePhone::ToggleCamera] => Toggling camera");
}
#endif /* TDAV_UNDER_WINDOWS_PHONE */
//
// Windows Media video producer object definition
//
/* constructor */
static tsk_object_t* tdav_producer_winm_ctor(tsk_object_t * self, va_list * app)
{
tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
if(producer){
/* init base */
tmedia_producer_init(TMEDIA_PRODUCER(producer));
TMEDIA_PRODUCER(producer)->video.chroma = tmedia_chroma_yuv420p; // To avoid chroma conversion
/* init self with default values*/
TMEDIA_PRODUCER(producer)->video.fps = 15;
TMEDIA_PRODUCER(producer)->video.width = 352;
TMEDIA_PRODUCER(producer)->video.height = 288;
#if TDAV_UNDER_WINDOWS_PHONE
producer->videoCapturePhone = ref new VideoCapturePhone();
#endif
}
return self;
}
/* destructor */
static tsk_object_t* tdav_producer_winm_dtor(tsk_object_t * self)
{
tdav_producer_winm_t *producer = (tdav_producer_winm_t *)self;
if(producer){
/* stop */
//if(producer->started){
tdav_producer_winm_stop((tmedia_producer_t*)self);
//}
/* deinit base */
tmedia_producer_deinit(TMEDIA_PRODUCER(producer));
/* deinit self */
#if TDAV_UNDER_WINDOWS_PHONE
if(producer->videoCapturePhone)
{
delete producer->videoCapturePhone;
}
#endif
}
return self;
}
/* object definition */
static const tsk_object_def_t tdav_producer_winm_def_s =
{
sizeof(tdav_producer_winm_t),
tdav_producer_winm_ctor,
tdav_producer_winm_dtor,
tsk_null,
};
/* plugin definition*/
static const tmedia_producer_plugin_def_t tdav_producer_winm_plugin_def_s =
{
&tdav_producer_winm_def_s,
tmedia_video,
"Microsoft Windows Media producer (Video)",
tdav_producer_winm_set,
tdav_producer_winm_prepare,
tdav_producer_winm_start,
tdav_producer_winm_pause,
tdav_producer_winm_stop
};
const tmedia_producer_plugin_def_t *tdav_producer_winm_plugin_def_t = &tdav_producer_winm_plugin_def_s;
#endif /* HAVE_WINM */

View File

@ -0,0 +1,142 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Phone
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyDAV", "tinyDAV.vcxproj", "{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}"
ProjectSection(ProjectDependencies) = postProject
{BE41D117-1D61-4C12-AD9D-B20D02C79687} = {BE41D117-1D61-4C12-AD9D-B20D02C79687}
{1A27423C-6535-4A49-96EC-5D209FE125F2} = {1A27423C-6535-4A49-96EC-5D209FE125F2}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{77A24977-079C-4E02-9717-8B2F684BAA21} = {77A24977-079C-4E02-9717-8B2F684BAA21}
{982D737A-0649-4C32-A00E-08992A0B7673} = {982D737A-0649-4C32-A00E-08992A0B7673}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySIGCOMP", "..\..\tinySIGCOMP\winrt\tinySIGCOMP.vcxproj", "{F623CBDB-707A-4FDC-ACE0-3D616E239F16}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyHTTP", "..\..\tinyHTTP\winrt\tinyHTTP.vcxproj", "{1A27423C-6535-4A49-96EC-5D209FE125F2}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyMEDIA", "..\..\tinyMEDIA\winrt\tinyMEDIA.vcxproj", "{52E43EEB-A549-4159-B254-DCA225D7638B}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyMSRP", "..\..\tinyMSRP\winrt\tinyMSRP.vcxproj", "{BE41D117-1D61-4C12-AD9D-B20D02C79687}"
ProjectSection(ProjectDependencies) = postProject
{1A27423C-6535-4A49-96EC-5D209FE125F2} = {1A27423C-6535-4A49-96EC-5D209FE125F2}
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyNET", "..\..\tinyNET\winrt\tinyNET.vcxproj", "{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyRTP", "..\..\tinyRTP\winrt\tinyRTP.vcxproj", "{77A24977-079C-4E02-9717-8B2F684BAA21}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC} = {06E58F9D-28A1-4DD4-AF11-2F5239222CCC}
{52E43EEB-A549-4159-B254-DCA225D7638B} = {52E43EEB-A549-4159-B254-DCA225D7638B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySAK", "..\..\tinySAK\winrt\tinySAK.vcxproj", "{19279F5B-CDAF-4187-9F09-2A896A828B05}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySDP", "..\..\tinySDP\winrt\tinySDP.vcxproj", "{982D737A-0649-4C32-A00E-08992A0B7673}"
ProjectSection(ProjectDependencies) = postProject
{19279F5B-CDAF-4187-9F09-2A896A828B05} = {19279F5B-CDAF-4187-9F09-2A896A828B05}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|Win32 = Debug|Win32
Release|ARM = Release|ARM
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|ARM.ActiveCfg = Debug|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|ARM.Build.0 = Debug|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|Win32.ActiveCfg = Debug|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Debug|Win32.Build.0 = Debug|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|ARM.ActiveCfg = Release|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|ARM.Build.0 = Release|ARM
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|Win32.ActiveCfg = Release|Win32
{0F2C458A-1EDB-4E09-9A22-C2209731CFF2}.Release|Win32.Build.0 = Release|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|ARM.ActiveCfg = Debug|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|ARM.Build.0 = Debug|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|Win32.ActiveCfg = Debug|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Debug|Win32.Build.0 = Debug|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|ARM.ActiveCfg = Release|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|ARM.Build.0 = Release|ARM
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|Win32.ActiveCfg = Release|Win32
{F623CBDB-707A-4FDC-ACE0-3D616E239F16}.Release|Win32.Build.0 = Release|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|ARM.ActiveCfg = Debug|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|ARM.Build.0 = Debug|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|Win32.ActiveCfg = Debug|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Debug|Win32.Build.0 = Debug|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|ARM.ActiveCfg = Release|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|ARM.Build.0 = Release|ARM
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|Win32.ActiveCfg = Release|Win32
{1A27423C-6535-4A49-96EC-5D209FE125F2}.Release|Win32.Build.0 = Release|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|ARM.ActiveCfg = Debug|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|ARM.Build.0 = Debug|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|Win32.ActiveCfg = Debug|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Debug|Win32.Build.0 = Debug|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|ARM.ActiveCfg = Release|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|ARM.Build.0 = Release|ARM
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|Win32.ActiveCfg = Release|Win32
{52E43EEB-A549-4159-B254-DCA225D7638B}.Release|Win32.Build.0 = Release|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|ARM.ActiveCfg = Debug|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|ARM.Build.0 = Debug|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|Win32.ActiveCfg = Debug|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Debug|Win32.Build.0 = Debug|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|ARM.ActiveCfg = Release|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|ARM.Build.0 = Release|ARM
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|Win32.ActiveCfg = Release|Win32
{BE41D117-1D61-4C12-AD9D-B20D02C79687}.Release|Win32.Build.0 = Release|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|ARM.ActiveCfg = Debug|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|ARM.Build.0 = Debug|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|Win32.ActiveCfg = Debug|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Debug|Win32.Build.0 = Debug|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|ARM.ActiveCfg = Release|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|ARM.Build.0 = Release|ARM
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|Win32.ActiveCfg = Release|Win32
{06E58F9D-28A1-4DD4-AF11-2F5239222CCC}.Release|Win32.Build.0 = Release|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|ARM.ActiveCfg = Debug|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|ARM.Build.0 = Debug|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|Win32.ActiveCfg = Debug|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Debug|Win32.Build.0 = Debug|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|ARM.ActiveCfg = Release|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|ARM.Build.0 = Release|ARM
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|Win32.ActiveCfg = Release|Win32
{77A24977-079C-4E02-9717-8B2F684BAA21}.Release|Win32.Build.0 = Release|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|ARM.ActiveCfg = Debug|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|ARM.Build.0 = Debug|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|Win32.ActiveCfg = Debug|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Debug|Win32.Build.0 = Debug|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|ARM.ActiveCfg = Release|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|ARM.Build.0 = Release|ARM
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|Win32.ActiveCfg = Release|Win32
{19279F5B-CDAF-4187-9F09-2A896A828B05}.Release|Win32.Build.0 = Release|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|ARM.ActiveCfg = Debug|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|ARM.Build.0 = Debug|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|Win32.ActiveCfg = Debug|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Debug|Win32.Build.0 = Debug|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|ARM.ActiveCfg = Release|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|ARM.Build.0 = Release|ARM
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|Win32.ActiveCfg = Release|Win32
{982D737A-0649-4C32-A00E-08992A0B7673}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,315 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0f2c458a-1edb-4e09-9a22-c2209731cff2}</ProjectGuid>
<RootNamespace>tinyDAV</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<WinMDAssembly>true</WinMDAssembly>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<OutDir>$(SolutionDir)$(Configuration)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>HAVE_SRTP=0;HAVE_CUDA=0;HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=0;HAVE_H264=0;HAVE_ILBC=0;HAVE_LIBGSM=0;HAVE_TINYDSHOW=0;HAVE_DSOUND=0;HAVE_WASAPI=1;HAVE_WAVE_API=0;HAVE_FFMPEG=0;HAVE_SPEEX_DSP=1;HAVE_WEBRTC=0;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=0;HAVE_LIBYUV=0;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;_USRDLL;TINYDAV_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\..\thirdparties\common\include;..\..\thirdparties\winrt\include;..\include;..\..\tinyMSRP\include;..\..\tinyRTP\include;..\..\tinyMEDIA\include;..\..\tinySDP\include;..\..\tinyNET\src;..\..\tinyDSHOW\include;..\..\tinySAK\src;..\..\thirdparties\winrt\include\BroadVoice16\bvcommon;..\..\thirdparties\winrt\include\BroadVoice16\bv16;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>PhoneAudioSes.lib;"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyRTP\tinyRTP.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib";"..\..\thirdparties\winrt\lib\x86\libspeex.lib";"..\..\thirdparties\winrt\lib\x86\libspeexdsp.lib";%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>HAVE_SRTP=0;HAVE_CUDA=0;HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=0;HAVE_H264=0;HAVE_ILBC=0;HAVE_LIBGSM=0;HAVE_TINYDSHOW=0;HAVE_DSOUND=0;HAVE_WASAPI=1;HAVE_WAVE_API=0;HAVE_FFMPEG=0;HAVE_SPEEX_DSP=1;HAVE_WEBRTC=0;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=0;HAVE_LIBYUV=0;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;_USRDLL;TINYDAV_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\..\thirdparties\common\include;..\..\thirdparties\winrt\include;..\include;..\..\tinyMSRP\include;..\..\tinyRTP\include;..\..\tinyMEDIA\include;..\..\tinySDP\include;..\..\tinyNET\src;..\..\tinyDSHOW\include;..\..\tinySAK\src;..\..\thirdparties\winrt\include\BroadVoice16\bvcommon;..\..\thirdparties\winrt\include\BroadVoice16\bv16;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>PhoneAudioSes.lib;"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyRTP\tinyRTP.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib"</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PreprocessorDefinitions>HAVE_SRTP=0;HAVE_CUDA=0;HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=0;HAVE_H264=0;HAVE_ILBC=0;HAVE_LIBGSM=0;HAVE_TINYDSHOW=0;HAVE_DSOUND=0;HAVE_WASAPI=1;HAVE_WAVE_API=0;HAVE_FFMPEG=0;HAVE_SPEEX_DSP=1;HAVE_WEBRTC=0;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=0;HAVE_LIBYUV=0;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;_USRDLL;TINYDAV_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\..\thirdparties\common\include;..\..\thirdparties\winrt\include;..\include;..\..\tinyMSRP\include;..\..\tinyRTP\include;..\..\tinyMEDIA\include;..\..\tinySDP\include;..\..\tinyNET\src;..\..\tinyDSHOW\include;..\..\tinySAK\src;..\..\thirdparties\winrt\include\BroadVoice16\bvcommon;..\..\thirdparties\winrt\include\BroadVoice16\bv16;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>PhoneAudioSes.lib;"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyRTP\tinyRTP.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"..\..\thirdparties\winrt\lib\arm\libspeex.lib";"..\..\thirdparties\winrt\lib\arm\libspeexdsp.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib"</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PreprocessorDefinitions>HAVE_SRTP=0;HAVE_CUDA=0;HAVE_G729=0;HAVE_BV16=0;HAVE_OPENCORE_AMR=0;HAVE_H264=0;HAVE_ILBC=0;HAVE_LIBGSM=0;HAVE_TINYDSHOW=0;HAVE_DSOUND=0;HAVE_WASAPI=1;HAVE_WAVE_API=0;HAVE_FFMPEG=0;HAVE_SPEEX_DSP=1;HAVE_WEBRTC=0;HAVE_SPEEX_JB=1;HAVE_LIB_SPEEX=1;HAVE_LIBVPX=0;HAVE_LIBYUV=0;G192BITSTREAM=0;DEBUG_LEVEL=DEBUG_LEVEL_INFO;_USRDLL;TINYDAV_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalIncludeDirectories>..\..\thirdparties\common\include;..\..\thirdparties\winrt\include;..\include;..\..\tinyMSRP\include;..\..\tinyRTP\include;..\..\tinyMEDIA\include;..\..\tinySDP\include;..\..\tinyNET\src;..\..\tinyDSHOW\include;..\..\tinySAK\src;..\..\thirdparties\winrt\include\BroadVoice16\bvcommon;..\..\thirdparties\winrt\include\BroadVoice16\bv16;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>PhoneAudioSes.lib;"$(SolutionDir)$(Configuration)\tinySAK\tinySAK.lib";"$(SolutionDir)$(Configuration)\tinyNET\tinyNET.lib";"$(SolutionDir)$(Configuration)\tinyRTP\tinyRTP.lib";"$(SolutionDir)$(Configuration)\tinyMSRP\tinyMSRP.lib";"..\..\thirdparties\winrt\lib\arm\libspeex.lib";"..\..\thirdparties\winrt\lib\arm\libspeexdsp.lib";"$(SolutionDir)$(Configuration)\tinySDP\tinySDP.lib";"$(SolutionDir)$(Configuration)\tinyMEDIA\tinyMEDIA.lib"</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="platform.winmd">
<IsWinMDFile>true</IsWinMDFile>
<Private>false</Private>
</Reference>
<Reference Include="Windows">
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\tinydav.h" />
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_audiounit.h" />
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_consumer_audioqueue.h" />
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_consumer_audiounit.h" />
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_producer_audioqueue.h" />
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_producer_audiounit.h" />
<ClInclude Include="..\include\tinydav\audio\directsound\tdav_consumer_dsound.h" />
<ClInclude Include="..\include\tinydav\audio\directsound\tdav_producer_dsound.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_consumer_audio.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_jitterbuffer.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_producer_audio.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_session_audio.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_speakup_jitterbuffer.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_speex_denoise.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_speex_jitterbuffer.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_speex_resampler.h" />
<ClInclude Include="..\include\tinydav\audio\tdav_webrtc_denoise.h" />
<ClInclude Include="..\include\tinydav\audio\wasapi\tdav_consumer_wasapi.h" />
<ClInclude Include="..\include\tinydav\audio\wasapi\tdav_producer_wasapi.h" />
<ClInclude Include="..\include\tinydav\audio\waveapi\tdav_consumer_waveapi.h" />
<ClInclude Include="..\include\tinydav\audio\waveapi\tdav_producer_waveapi.h" />
<ClInclude Include="..\include\tinydav\codecs\amr\tdav_codec_amr.h" />
<ClInclude Include="..\include\tinydav\codecs\bv\tdav_codec_bv16.h" />
<ClInclude Include="..\include\tinydav\codecs\bv\tdav_codec_bv32.h" />
<ClInclude Include="..\include\tinydav\codecs\dtmf\tdav_codec_dtmf.h" />
<ClInclude Include="..\include\tinydav\codecs\fec\tdav_codec_red.h" />
<ClInclude Include="..\include\tinydav\codecs\fec\tdav_codec_ulpfec.h" />
<ClInclude Include="..\include\tinydav\codecs\g711\g711.h" />
<ClInclude Include="..\include\tinydav\codecs\g711\tdav_codec_g711.h" />
<ClInclude Include="..\include\tinydav\codecs\g722\g722_enc_dec.h" />
<ClInclude Include="..\include\tinydav\codecs\g722\tdav_codec_g722.h" />
<ClInclude Include="..\include\tinydav\codecs\g729\tdav_codec_g729.h" />
<ClInclude Include="..\include\tinydav\codecs\gsm\tdav_codec_gsm.h" />
<ClInclude Include="..\include\tinydav\codecs\h261\tdav_codec_h261.h" />
<ClInclude Include="..\include\tinydav\codecs\h263\tdav_codec_h263.h" />
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264.h" />
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_common.h" />
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_cuda.h" />
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_rtp.h" />
<ClInclude Include="..\include\tinydav\codecs\ilbc\tdav_codec_ilbc.h" />
<ClInclude Include="..\include\tinydav\codecs\mp4ves\tdav_codec_mp4ves.h" />
<ClInclude Include="..\include\tinydav\codecs\msrp\tdav_codec_msrp.h" />
<ClInclude Include="..\include\tinydav\codecs\speex\tdav_codec_speex.h" />
<ClInclude Include="..\include\tinydav\codecs\t140\tdav_codec_t140.h" />
<ClInclude Include="..\include\tinydav\codecs\theora\tdav_codec_theora.h" />
<ClInclude Include="..\include\tinydav\codecs\vpx\tdav_codec_vp8.h" />
<ClInclude Include="..\include\tinydav\msrp\tdav_consumer_msrp.h" />
<ClInclude Include="..\include\tinydav\msrp\tdav_producer_msrp.h" />
<ClInclude Include="..\include\tinydav\msrp\tdav_session_msrp.h" />
<ClInclude Include="..\include\tinydav\t140\tdav_consumer_t140.h" />
<ClInclude Include="..\include\tinydav\t140\tdav_producer_t140.h" />
<ClInclude Include="..\include\tinydav\t140\tdav_session_t140.h" />
<ClInclude Include="..\include\tinydav\tdav.h" />
<ClInclude Include="..\include\tinydav\tdav_apple.h" />
<ClInclude Include="..\include\tinydav\tdav_session_av.h" />
<ClInclude Include="..\include\tinydav\tdav_win32.h" />
<ClInclude Include="..\include\tinydav\video\jb\tdav_video_frame.h" />
<ClInclude Include="..\include\tinydav\video\jb\tdav_video_jb.h" />
<ClInclude Include="..\include\tinydav\video\tdav_consumer_video.h" />
<ClInclude Include="..\include\tinydav\video\tdav_converter_video.h" />
<ClInclude Include="..\include\tinydav\video\tdav_runnable_video.h" />
<ClInclude Include="..\include\tinydav\video\tdav_session_video.h" />
<ClInclude Include="..\include\tinydav_config.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\audio\coreaudio\tdav_audiounit.c" />
<ClCompile Include="..\src\audio\coreaudio\tdav_consumer_audioqueue.c" />
<ClCompile Include="..\src\audio\coreaudio\tdav_consumer_audiounit.c" />
<ClCompile Include="..\src\audio\coreaudio\tdav_producer_audioqueue.c" />
<ClCompile Include="..\src\audio\coreaudio\tdav_producer_audiounit.c" />
<ClCompile Include="..\src\audio\directsound\tdav_consumer_dsound.c" />
<ClCompile Include="..\src\audio\directsound\tdav_producer_dsound.c" />
<ClCompile Include="..\src\audio\tdav_consumer_audio.c" />
<ClCompile Include="..\src\audio\tdav_jitterbuffer.c" />
<ClCompile Include="..\src\audio\tdav_producer_audio.c" />
<ClCompile Include="..\src\audio\tdav_session_audio.c" />
<ClCompile Include="..\src\audio\tdav_speakup_jitterbuffer.c" />
<ClCompile Include="..\src\audio\tdav_speex_denoise.c" />
<ClCompile Include="..\src\audio\tdav_speex_jitterbuffer.c" />
<ClCompile Include="..\src\audio\tdav_speex_resampler.c" />
<ClCompile Include="..\src\audio\tdav_webrtc_denoise.c" />
<ClCompile Include="..\src\audio\wasapi\tdav_consumer_wasapi.cxx">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\src\audio\wasapi\tdav_producer_wasapi.cxx">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
<MinimalRebuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</MinimalRebuild>
<MinimalRebuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</MinimalRebuild>
<MinimalRebuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</MinimalRebuild>
<MinimalRebuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</MinimalRebuild>
</ClCompile>
<ClCompile Include="..\src\audio\waveapi\tdav_consumer_waveapi.c" />
<ClCompile Include="..\src\audio\waveapi\tdav_producer_waveapi.c" />
<ClCompile Include="..\src\codecs\amr\tdav_codec_amr.c" />
<ClCompile Include="..\src\codecs\bv\tdav_codec_bv16.c" />
<ClCompile Include="..\src\codecs\bv\tdav_codec_bv32.c" />
<ClCompile Include="..\src\codecs\dtmf\tdav_codec_dtmf.c" />
<ClCompile Include="..\src\codecs\fec\tdav_codec_red.c" />
<ClCompile Include="..\src\codecs\fec\tdav_codec_ulpfec.c" />
<ClCompile Include="..\src\codecs\g711\g711.c" />
<ClCompile Include="..\src\codecs\g711\tdav_codec_g711.c" />
<ClCompile Include="..\src\codecs\g722\g722_decode.c" />
<ClCompile Include="..\src\codecs\g722\g722_encode.c" />
<ClCompile Include="..\src\codecs\g722\tdav_codec_g722.c" />
<ClCompile Include="..\src\codecs\g729\tdav_codec_g729.c" />
<ClCompile Include="..\src\codecs\gsm\tdav_codec_gsm.c" />
<ClCompile Include="..\src\codecs\h261\tdav_codec_h261.c" />
<ClCompile Include="..\src\codecs\h263\tdav_codec_h263.c" />
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264.c" />
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264_cuda.cxx" />
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264_rtp.c" />
<ClCompile Include="..\src\codecs\ilbc\tdav_codec_ilbc.c" />
<ClCompile Include="..\src\codecs\mp4ves\tdav_codec_mp4ves.c" />
<ClCompile Include="..\src\codecs\msrp\tdav_codec_msrp.c" />
<ClCompile Include="..\src\codecs\speex\tdav_codec_speex.c" />
<ClCompile Include="..\src\codecs\t140\tdav_codec_t140.c" />
<ClCompile Include="..\src\codecs\theora\tdav_codec_theora.c" />
<ClCompile Include="..\src\codecs\vpx\tdav_codec_vp8.c" />
<ClCompile Include="..\src\msrp\tdav_consumer_msrp.c" />
<ClCompile Include="..\src\msrp\tdav_producer_msrp.c" />
<ClCompile Include="..\src\msrp\tdav_session_msrp.c" />
<ClCompile Include="..\src\t140\tdav_consumer_t140.c" />
<ClCompile Include="..\src\t140\tdav_producer_t140.c" />
<ClCompile Include="..\src\t140\tdav_session_t140.c" />
<ClCompile Include="..\src\tdav.c" />
<ClCompile Include="..\src\tdav_session_av.c" />
<ClCompile Include="..\src\tdav_win32.c" />
<ClCompile Include="..\src\video\jb\tdav_video_frame.c" />
<ClCompile Include="..\src\video\jb\tdav_video_jb.c" />
<ClCompile Include="..\src\video\tdav_consumer_video.c" />
<ClCompile Include="..\src\video\tdav_converter_video.cxx" />
<ClCompile Include="..\src\video\tdav_runnable_video.c" />
<ClCompile Include="..\src\video\tdav_session_video.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,571 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="include">
<UniqueIdentifier>{91ae2aff-abf7-4be7-ae92-929c6c0757d2}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{2bdf9697-d119-4375-838f-8d96f3b92d2c}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav">
<UniqueIdentifier>{ed6bc633-78b1-4c4b-904e-83014ccdaa7f}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio">
<UniqueIdentifier>{ae21225f-9d4f-413f-be58-d4aebb6056ae}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs">
<UniqueIdentifier>{32b13a77-8afa-454c-b450-e132400322aa}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\msrp">
<UniqueIdentifier>{5d0301e5-b817-4cc7-aaca-f5be841c7ad4}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\t140">
<UniqueIdentifier>{cf00c044-d934-420c-aadd-3e371eb1a60a}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\video">
<UniqueIdentifier>{91e1abd4-abe1-4002-83e0-8199a1dcadd1}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\amr">
<UniqueIdentifier>{fb9c9c47-f74a-4183-91a2-07e33c3c4010}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\bv">
<UniqueIdentifier>{b84ecdca-47b8-462d-92d3-a085d58f80dd}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\dtmf">
<UniqueIdentifier>{c8cc313e-1fe5-4e00-a2ad-b562d2df6e9b}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\fec">
<UniqueIdentifier>{e72cf212-b085-4a2c-9334-672ee681fb4b}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\g711">
<UniqueIdentifier>{734bf1ba-5e70-4f42-8bf4-486b03a13294}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\g722">
<UniqueIdentifier>{307e4928-4dce-486c-bb89-d65ff671b435}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\g729">
<UniqueIdentifier>{75adb661-0216-4da7-839e-b32fea9ce316}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\gsm">
<UniqueIdentifier>{f3f9093c-15c3-4975-9637-427a88e522c7}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\h261">
<UniqueIdentifier>{81fe902c-4cbb-49ab-96e1-b7939d26a73b}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\h263">
<UniqueIdentifier>{d51722e9-78f0-4b03-b434-3b9c7e00cce7}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\h264">
<UniqueIdentifier>{effd93f7-1ac8-41e0-8f03-d4106283b1d1}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\ilbc">
<UniqueIdentifier>{64e9a7bf-e6b4-41a2-901f-1eeb1ed77a09}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\mp4ves">
<UniqueIdentifier>{0ff7c06d-017e-48ed-bb99-8d53cbc558d5}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\msrp">
<UniqueIdentifier>{ca98fd86-ede9-4101-ac83-80c3a81fb354}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\silk">
<UniqueIdentifier>{86432ad4-f891-4faa-ade8-abc4be369a7b}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\speex">
<UniqueIdentifier>{c4866ac1-114b-464e-9138-ca6f1565159e}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\t140">
<UniqueIdentifier>{16ae33a2-b133-40a9-a316-2ecea1ae1e5a}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\theora">
<UniqueIdentifier>{5635ab9e-205a-424b-8887-fb3419752f31}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\codecs\vpx">
<UniqueIdentifier>{84e0ef45-0650-4c3b-8635-2bb549a63476}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\video\jb">
<UniqueIdentifier>{1065df10-0638-48fd-9d5d-17f7fbee456f}</UniqueIdentifier>
</Filter>
<Filter Include="src\audio">
<UniqueIdentifier>{df2e307a-0e89-495d-a476-8759233edff9}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs">
<UniqueIdentifier>{c5296e69-98fd-4b7a-a50a-9ab83ea2389e}</UniqueIdentifier>
</Filter>
<Filter Include="src\msrp">
<UniqueIdentifier>{0142f341-cd21-447a-86e1-5afe48552aa1}</UniqueIdentifier>
</Filter>
<Filter Include="src\video">
<UniqueIdentifier>{16a3ac83-8653-47ce-9321-f2a6e0e2c940}</UniqueIdentifier>
</Filter>
<Filter Include="src\video\jb">
<UniqueIdentifier>{de003914-b489-4d75-8956-88d7f8a92ae2}</UniqueIdentifier>
</Filter>
<Filter Include="src\t140">
<UniqueIdentifier>{42776eb4-0f55-4612-a972-d3ba8cbc516d}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\amr">
<UniqueIdentifier>{a4b4e81f-a75f-49bc-b5ea-4c540cc57a59}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\bv">
<UniqueIdentifier>{d87495d4-2f54-4cc1-8c97-2b51dac6f274}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\dtmf">
<UniqueIdentifier>{cb8beb57-a3c6-48c3-854e-2eb806ae6368}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\fec">
<UniqueIdentifier>{1c04d58e-a2f9-4fbf-a09f-82c54152cfc1}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\g711">
<UniqueIdentifier>{5aa9fca2-9736-4847-82b9-8b6ec661f3ea}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\g722">
<UniqueIdentifier>{242aa391-53ba-448b-8675-df3d3b76d457}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\g729">
<UniqueIdentifier>{419d8f63-0cd8-4f93-8e78-72e94a0844c6}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\gsm">
<UniqueIdentifier>{41171757-2466-426b-9605-56de38b572a6}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\h261">
<UniqueIdentifier>{8a8c95e7-a82b-4eac-9e03-590577c59788}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\h263">
<UniqueIdentifier>{75a9530b-ad6b-4877-8631-b2a5ecc323ff}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\h264">
<UniqueIdentifier>{1615bb41-f385-4146-a833-be4d1d596acb}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\ilbc">
<UniqueIdentifier>{d6697037-0de3-4913-aac5-f2711f8a7b4e}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\mp4ves">
<UniqueIdentifier>{55fa33ea-df98-40e0-aace-8fda2c42e5c8}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\msrp">
<UniqueIdentifier>{adc18bff-c4af-4fa7-8819-45617c2a00be}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\silk">
<UniqueIdentifier>{81a86200-e2db-40b0-8b64-5ff4fc3032a0}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\speex">
<UniqueIdentifier>{960f0f40-e50c-46c7-98f3-3c72102f69ba}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\t140">
<UniqueIdentifier>{b04afc73-09b5-4e2c-938b-8eabfca3bcaf}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\theora">
<UniqueIdentifier>{f6669e0f-9d9b-47d6-b23b-45b83524021a}</UniqueIdentifier>
</Filter>
<Filter Include="src\codecs\vpx">
<UniqueIdentifier>{4375a26a-b096-4629-8629-7363e3779259}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\android">
<UniqueIdentifier>{b4fca93a-2d7d-4b7a-887d-c77a3f6ad3c1}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\coreaudio">
<UniqueIdentifier>{9a4b3771-911d-45f4-878c-24b3b72a0095}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\directsound">
<UniqueIdentifier>{c504db68-5fee-43d9-aa41-81181dcebea9}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\oss">
<UniqueIdentifier>{027bad53-6055-4c06-a52c-3c88a5dd51ac}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\waveapi">
<UniqueIdentifier>{a66f8969-d191-4178-9ccf-46a1e6d87e39}</UniqueIdentifier>
</Filter>
<Filter Include="src\audio\coreaudio">
<UniqueIdentifier>{8559189f-951a-48e8-a662-902f38bf40a2}</UniqueIdentifier>
</Filter>
<Filter Include="src\audio\directsound">
<UniqueIdentifier>{90bbc85a-20d3-43aa-b5d5-3ced47011e3a}</UniqueIdentifier>
</Filter>
<Filter Include="src\audio\waveapi">
<UniqueIdentifier>{c4d8c96b-0744-43e0-9915-7af04371a763}</UniqueIdentifier>
</Filter>
<Filter Include="include\tinydav\audio\wasapi">
<UniqueIdentifier>{d2c14c22-142c-47bb-b5a7-e5ef707fa05e}</UniqueIdentifier>
</Filter>
<Filter Include="src\audio\wasapi">
<UniqueIdentifier>{b4d1028f-270b-465d-baf6-255dacdfe8a0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\tinydav.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav_config.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\tdav.h">
<Filter>include\tinydav</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\tdav_apple.h">
<Filter>include\tinydav</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\tdav_session_av.h">
<Filter>include\tinydav</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\tdav_win32.h">
<Filter>include\tinydav</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_consumer_audio.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_jitterbuffer.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_producer_audio.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_session_audio.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_speakup_jitterbuffer.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_speex_denoise.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_speex_jitterbuffer.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_speex_resampler.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\tdav_webrtc_denoise.h">
<Filter>include\tinydav\audio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_audiounit.h">
<Filter>include\tinydav\audio\coreaudio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_consumer_audioqueue.h">
<Filter>include\tinydav\audio\coreaudio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_consumer_audiounit.h">
<Filter>include\tinydav\audio\coreaudio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_producer_audioqueue.h">
<Filter>include\tinydav\audio\coreaudio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\coreaudio\tdav_producer_audiounit.h">
<Filter>include\tinydav\audio\coreaudio</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\directsound\tdav_consumer_dsound.h">
<Filter>include\tinydav\audio\directsound</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\directsound\tdav_producer_dsound.h">
<Filter>include\tinydav\audio\directsound</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\waveapi\tdav_consumer_waveapi.h">
<Filter>include\tinydav\audio\waveapi</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\waveapi\tdav_producer_waveapi.h">
<Filter>include\tinydav\audio\waveapi</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\amr\tdav_codec_amr.h">
<Filter>include\tinydav\codecs\amr</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\bv\tdav_codec_bv16.h">
<Filter>include\tinydav\codecs\bv</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\bv\tdav_codec_bv32.h">
<Filter>include\tinydav\codecs\bv</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\dtmf\tdav_codec_dtmf.h">
<Filter>include\tinydav\codecs\dtmf</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\fec\tdav_codec_red.h">
<Filter>include\tinydav\codecs\fec</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\fec\tdav_codec_ulpfec.h">
<Filter>include\tinydav\codecs\fec</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\g711\g711.h">
<Filter>include\tinydav\codecs\g711</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\g711\tdav_codec_g711.h">
<Filter>include\tinydav\codecs\g711</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\g722\g722_enc_dec.h">
<Filter>include\tinydav\codecs\g722</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\g722\tdav_codec_g722.h">
<Filter>include\tinydav\codecs\g722</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\g729\tdav_codec_g729.h">
<Filter>include\tinydav\codecs\g729</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\gsm\tdav_codec_gsm.h">
<Filter>include\tinydav\codecs\gsm</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h261\tdav_codec_h261.h">
<Filter>include\tinydav\codecs\h261</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h263\tdav_codec_h263.h">
<Filter>include\tinydav\codecs\h263</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264.h">
<Filter>include\tinydav\codecs\h264</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_common.h">
<Filter>include\tinydav\codecs\h264</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_cuda.h">
<Filter>include\tinydav\codecs\h264</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\h264\tdav_codec_h264_rtp.h">
<Filter>include\tinydav\codecs\h264</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\ilbc\tdav_codec_ilbc.h">
<Filter>include\tinydav\codecs\ilbc</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\mp4ves\tdav_codec_mp4ves.h">
<Filter>include\tinydav\codecs\mp4ves</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\msrp\tdav_codec_msrp.h">
<Filter>include\tinydav\codecs\msrp</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\vpx\tdav_codec_vp8.h">
<Filter>include\tinydav\codecs\vpx</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\theora\tdav_codec_theora.h">
<Filter>include\tinydav\codecs\theora</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\t140\tdav_codec_t140.h">
<Filter>include\tinydav\codecs\t140</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\codecs\speex\tdav_codec_speex.h">
<Filter>include\tinydav\codecs\speex</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\msrp\tdav_consumer_msrp.h">
<Filter>include\tinydav\msrp</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\msrp\tdav_producer_msrp.h">
<Filter>include\tinydav\msrp</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\msrp\tdav_session_msrp.h">
<Filter>include\tinydav\msrp</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\tdav_consumer_video.h">
<Filter>include\tinydav\video</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\tdav_converter_video.h">
<Filter>include\tinydav\video</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\tdav_runnable_video.h">
<Filter>include\tinydav\video</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\tdav_session_video.h">
<Filter>include\tinydav\video</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\jb\tdav_video_frame.h">
<Filter>include\tinydav\video\jb</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\video\jb\tdav_video_jb.h">
<Filter>include\tinydav\video\jb</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\t140\tdav_consumer_t140.h">
<Filter>include\tinydav\t140</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\t140\tdav_producer_t140.h">
<Filter>include\tinydav\t140</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\t140\tdav_session_t140.h">
<Filter>include\tinydav\t140</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\wasapi\tdav_consumer_wasapi.h">
<Filter>include\tinydav\audio\wasapi</Filter>
</ClInclude>
<ClInclude Include="..\include\tinydav\audio\wasapi\tdav_producer_wasapi.h">
<Filter>include\tinydav\audio\wasapi</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\tdav.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\tdav_session_av.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\tdav_win32.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_consumer_audio.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_jitterbuffer.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_producer_audio.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_session_audio.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_speakup_jitterbuffer.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_speex_denoise.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_speex_jitterbuffer.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_speex_resampler.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\tdav_webrtc_denoise.c">
<Filter>src\audio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\coreaudio\tdav_audiounit.c">
<Filter>src\audio\coreaudio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\coreaudio\tdav_consumer_audioqueue.c">
<Filter>src\audio\coreaudio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\coreaudio\tdav_consumer_audiounit.c">
<Filter>src\audio\coreaudio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\coreaudio\tdav_producer_audioqueue.c">
<Filter>src\audio\coreaudio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\coreaudio\tdav_producer_audiounit.c">
<Filter>src\audio\coreaudio</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\directsound\tdav_consumer_dsound.c">
<Filter>src\audio\directsound</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\directsound\tdav_producer_dsound.c">
<Filter>src\audio\directsound</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\waveapi\tdav_consumer_waveapi.c">
<Filter>src\audio\waveapi</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\waveapi\tdav_producer_waveapi.c">
<Filter>src\audio\waveapi</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\amr\tdav_codec_amr.c">
<Filter>src\codecs\amr</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\bv\tdav_codec_bv16.c">
<Filter>src\codecs\bv</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\bv\tdav_codec_bv32.c">
<Filter>src\codecs\bv</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\dtmf\tdav_codec_dtmf.c">
<Filter>src\codecs\dtmf</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\fec\tdav_codec_red.c">
<Filter>src\codecs\fec</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\fec\tdav_codec_ulpfec.c">
<Filter>src\codecs\fec</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g711\g711.c">
<Filter>src\codecs\g711</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g711\tdav_codec_g711.c">
<Filter>src\codecs\g711</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g722\g722_decode.c">
<Filter>src\codecs\g722</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g722\g722_encode.c">
<Filter>src\codecs\g722</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g722\tdav_codec_g722.c">
<Filter>src\codecs\g722</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\g729\tdav_codec_g729.c">
<Filter>src\codecs\g729</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\gsm\tdav_codec_gsm.c">
<Filter>src\codecs\gsm</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\h261\tdav_codec_h261.c">
<Filter>src\codecs\h261</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\h263\tdav_codec_h263.c">
<Filter>src\codecs\h263</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264.c">
<Filter>src\codecs\h264</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264_cuda.cxx">
<Filter>src\codecs\h264</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\h264\tdav_codec_h264_rtp.c">
<Filter>src\codecs\h264</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\ilbc\tdav_codec_ilbc.c">
<Filter>src\codecs\ilbc</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\mp4ves\tdav_codec_mp4ves.c">
<Filter>src\codecs\mp4ves</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\msrp\tdav_codec_msrp.c">
<Filter>src\codecs\msrp</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\vpx\tdav_codec_vp8.c">
<Filter>src\codecs\vpx</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\theora\tdav_codec_theora.c">
<Filter>src\codecs\theora</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\t140\tdav_codec_t140.c">
<Filter>src\codecs\t140</Filter>
</ClCompile>
<ClCompile Include="..\src\codecs\speex\tdav_codec_speex.c">
<Filter>src\codecs\speex</Filter>
</ClCompile>
<ClCompile Include="..\src\msrp\tdav_consumer_msrp.c">
<Filter>src\msrp</Filter>
</ClCompile>
<ClCompile Include="..\src\msrp\tdav_producer_msrp.c">
<Filter>src\msrp</Filter>
</ClCompile>
<ClCompile Include="..\src\msrp\tdav_session_msrp.c">
<Filter>src\msrp</Filter>
</ClCompile>
<ClCompile Include="..\src\t140\tdav_consumer_t140.c">
<Filter>src\t140</Filter>
</ClCompile>
<ClCompile Include="..\src\t140\tdav_producer_t140.c">
<Filter>src\t140</Filter>
</ClCompile>
<ClCompile Include="..\src\t140\tdav_session_t140.c">
<Filter>src\t140</Filter>
</ClCompile>
<ClCompile Include="..\src\video\tdav_consumer_video.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\tdav_converter_video.cxx">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\tdav_runnable_video.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\tdav_session_video.c">
<Filter>src\video</Filter>
</ClCompile>
<ClCompile Include="..\src\video\jb\tdav_video_frame.c">
<Filter>src\video\jb</Filter>
</ClCompile>
<ClCompile Include="..\src\video\jb\tdav_video_jb.c">
<Filter>src\video\jb</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\wasapi\tdav_consumer_wasapi.cxx">
<Filter>src\audio\wasapi</Filter>
</ClCompile>
<ClCompile Include="..\src\audio\wasapi\tdav_producer_wasapi.cxx">
<Filter>src\audio\wasapi</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="9,00"
Name="tinyDSHOW"
ProjectGUID="{0CCC02F1-4233-424F-AD5E-A021456E6E8D}"
RootNamespace="tinyDSHOW"
@ -41,7 +41,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\thirdparties\win32\include;&quot;$(PSDK_DIR)include&quot;;&quot;$(DXSDK_DIR)include&quot;;..\thirdparties\win32\include\directshow;include;..\tinySAK\src;..\tinyMEDIA\include;..\tinySDP\include"
AdditionalIncludeDirectories="..\thirdparties\win32\include;..\thirdparties\win32\include\directshow;include;..\tinySAK\src;..\tinyMEDIA\include;..\tinySDP\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TINYDSHOW_EXPORTS;_WIN32_WINNT=0x0501;DEBUG_LEVEL=DEBUG_LEVEL_INFO"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -119,7 +119,7 @@
Optimization="2"
EnableIntrinsicFunctions="false"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="..\thirdparties\win32\include;&quot;$(PSDK_DIR)include&quot;;&quot;$(DXSDK_DIR)include&quot;;..\thirdparties\win32\include\directshow;include;..\tinySAK\src;..\tinyMEDIA\include;..\tinySDP\include"
AdditionalIncludeDirectories="..\thirdparties\win32\include;..\thirdparties\win32\include\directshow;include;..\tinySAK\src;..\tinyMEDIA\include;..\tinySDP\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_WIN32_WINNT=0x0501;TINYDSHOW_EXPORTS"
BasicRuntimeChecks="0"
RuntimeLibrary="2"

View File

@ -27,16 +27,18 @@
#undef _WIN32 /* Because of WINSCW */
#endif
/* Windows (XP/Vista/7/CE and Windows Mobile) macro definition.
*/
// Windows (XP/Vista/7/CE and Windows Mobile) macro definition
#if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
# define THTTP_UNDER_WINDOWS 1
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP || WINAPI_FAMILY == WINAPI_FAMILY_APP)
# define THTTP_UNDER_WINDOWS_RT 1
# endif
#endif
#if (THTTP_UNDER_WINDOWS || defined(__SYMBIAN32__)) && defined(TINYHTTP_EXPORTS)
# define TINYHTTP_API __declspec(dllexport)
# define TINYHTTP_GEXTERN __declspec(dllexport)
#elif (THTTP_UNDER_WINDOWS || defined(__SYMBIAN32__)) /*&& defined(TINYHTTP_IMPORTS)*/
# define TINYHTTP_GEXTERN extern __declspec(dllexport)
#elif (THTTP_UNDER_WINDOWS || defined(__SYMBIAN32__)) && !defined(TINYHTTP_IMPORTS_IGNORE)
# define TINYHTTP_API __declspec(dllimport)
# define TINYHTTP_GEXTERN __declspec(dllimport)
#else

View File

@ -220,7 +220,7 @@ thttp_header_Authorization_t *thttp_header_Authorization_parse(const char *data,
const char *eof = pe;
thttp_header_Authorization_t *hdr_Authorization = thttp_header_authorization_create();
const char *tag_start;
const char *tag_start = tsk_null;
%%write data;
(void)(eof);

View File

@ -84,7 +84,7 @@ thttp_header_Content_Length_t *thttp_header_Content_Length_parse(const char *dat
const char *eof = pe;
thttp_header_Content_Length_t *hdr_clength = thttp_header_content_length_create(0);
const char *tag_start;
const char *tag_start = tsk_null;
%%write data;
(void)(eof);

View File

@ -108,7 +108,7 @@ thttp_header_Content_Type_t *thttp_header_Content_Type_parse(const char *data, t
const char *eof = pe;
thttp_header_Content_Type_t *hdr_ctype = thttp_header_content_type_create_null();
const char *tag_start;
const char *tag_start = tsk_null;
%%write data;
(void)(eof);

View File

@ -101,7 +101,7 @@ thttp_header_Dummy_t *thttp_header_Dummy_parse(const char *data, tsk_size_t size
const char *eof = pe;
thttp_header_Dummy_t *hdr_Dummy = thttp_header_dummy_create_null();
const char *tag_start;
const char *tag_start = tsk_null;
%%write data;
(void)(eof);

View File

@ -108,7 +108,7 @@ thttp_header_ETag_t *thttp_header_ETag_parse(const char *data, tsk_size_t size)
const char *eof = pe;
thttp_header_ETag_t *hdr_ETag = thttp_header_etag_create_null();
const char *tag_start;
const char *tag_start = tsk_null;
%%write data;
(void)(eof);

Some files were not shown because too many files have changed in this diff Show More