Commit 24a19ac7 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

DBus communication for codecs handling

parent 22c7a6a2
...@@ -584,22 +584,44 @@ sflphone_fill_codec_list() ...@@ -584,22 +584,44 @@ sflphone_fill_codec_list()
codec_list_clear(); codec_list_clear();
gchar** codecs = (gchar**)dbus_codec_list(); gchar** codecs = (gchar**)dbus_codec_list();
gchar** order = (gchar**)dbus_get_active_codec_list();
gchar** details; gchar** details;
gchar** pl; gchar** pl;
for(pl=codecs; *codecs; codecs++)
for(pl=order; *order; order++)
{ {
codec_t * c = g_new0(codec_t, 1); codec_t * c = g_new0(codec_t, 1);
c->_payload = atoi(*codecs); c->_payload = atoi(*order);
details = (gchar **)dbus_codec_details(c->_payload); details = (gchar **)dbus_codec_details(c->_payload);
printf("Codec details: %s / %s / %s / %s\n",details[0],details[1],details[2],details[3]); //printf("Codec details: %s / %s / %s / %s\n",details[0],details[1],details[2],details[3]);
c->name = details[0]; c->name = details[0];
//codec_set_active(details[0]); c->is_active = TRUE;
c->sample_rate = atoi(details[1]); c->sample_rate = atoi(details[1]);
c->_bitrate = atof(details[2]); c->_bitrate = atof(details[2]);
c->_bandwidth = atof(details[3]); c->_bandwidth = atof(details[3]);
codec_list_add(c); codec_list_add(c);
} }
for(pl=codecs; *codecs; codecs++)
{
//codec_t * c = g_new0(codec_t, 1);
//c->_payload = atoi(*codecs);
details = (gchar **)dbus_codec_details(atoi(*codecs));
//c->name = details[0];
if(codec_list_get(details[0])!=NULL){
// does nothing - the codec is already in the list, so is active.
}
else{
codec_t* c = g_new0(codec_t, 1);
c->_payload = atoi(*codecs);
c->name = details[0];
c->is_active = FALSE;
c->sample_rate = atoi(details[1]);
c->_bitrate = atof(details[2]);
c->_bandwidth = atof(details[3]);
codec_list_add(c);
}
}
} }
......
...@@ -390,44 +390,6 @@ static ...@@ -390,44 +390,6 @@ static
inline inline
#endif #endif
gboolean gboolean
org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list (DBusGProxy *proxy, char *** OUT_list, GError **error)
{
return dbus_g_proxy_call (proxy, "getSampleRateList", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_list, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_reply) (DBusGProxy *proxy, char * *OUT_list, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char ** OUT_list;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_list, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_reply)data->cb) (proxy, OUT_list, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getSampleRateList", org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_playback_device_list (DBusGProxy *proxy, char *** OUT_list, GError **error) org_sflphone_SFLphone_ConfigurationManager_get_playback_device_list (DBusGProxy *proxy, char *** OUT_list, GError **error)
{ {
...@@ -580,22 +542,22 @@ static ...@@ -580,22 +542,22 @@ static
inline inline
#endif #endif
gboolean gboolean
org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list (DBusGProxy *proxy, char *** OUT_list, GError **error) org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list (DBusGProxy *proxy, char *** OUT_list, GError **error)
{ {
return dbus_g_proxy_call (proxy, "getDefaultCodecList", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_list, G_TYPE_INVALID); return dbus_g_proxy_call (proxy, "getActiveCodecList", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_list, G_TYPE_INVALID);
} }
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply) (DBusGProxy *proxy, char * *OUT_list, GError *error, gpointer userdata); typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_reply) (DBusGProxy *proxy, char * *OUT_list, GError *error, gpointer userdata);
static void static void
org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{ {
DBusGAsyncData *data = (DBusGAsyncData*) user_data; DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL; GError *error = NULL;
char ** OUT_list; char ** OUT_list;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_list, G_TYPE_INVALID); dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_list, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply)data->cb) (proxy, OUT_list, error, data->userdata); (*(org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_reply)data->cb) (proxy, OUT_list, error, data->userdata);
return; return;
} }
...@@ -604,187 +566,35 @@ static ...@@ -604,187 +566,35 @@ static
inline inline
#endif #endif
DBusGProxyCall* DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_reply callback, gpointer userdata) org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_reply callback, gpointer userdata)
{ {
DBusGAsyncData *stuff; DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1); stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback); stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata; stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getDefaultCodecList", org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list_async_callback, stuff, g_free, G_TYPE_INVALID); return dbus_g_proxy_begin_call (proxy, "getActiveCodecList", org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list_async_callback, stuff, g_free, G_TYPE_INVALID);
} }
static static
#ifdef G_HAVE_INLINE #ifdef G_HAVE_INLINE
inline inline
#endif #endif
gboolean gboolean
org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order (DBusGProxy *proxy, const char * IN_codec_name, GError **error) org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list (DBusGProxy *proxy, const char ** IN_list, GError **error)
{ {
return dbus_g_proxy_call (proxy, "setCodecPreferedOrder", error, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID, G_TYPE_INVALID); return dbus_g_proxy_call (proxy, "setActiveCodecList", error, G_TYPE_STRV, IN_list, G_TYPE_INVALID, G_TYPE_INVALID);
} }
typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void static void
org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{ {
DBusGAsyncData *data = (DBusGAsyncData*) user_data; DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL; GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_reply)data->cb) (proxy, error, data->userdata); (*(org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_async (DBusGProxy *proxy, const char * IN_codec_name, org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "setCodecPreferedOrder", org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order_async_callback, stuff, g_free, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order (DBusGProxy *proxy, char ** OUT_codec_name, GError **error)
{
return dbus_g_proxy_call (proxy, "getCodecPreferedOrder", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_codec_name, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_reply) (DBusGProxy *proxy, char * OUT_codec_name, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_codec_name;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_codec_name, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_reply)data->cb) (proxy, OUT_codec_name, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getCodecPreferedOrder", org_sflphone_SFLphone_ConfigurationManager_get_codec_prefered_order_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate (DBusGProxy *proxy, const char * IN_codec_name, char ** OUT_bitrate, GError **error)
{
return dbus_g_proxy_call (proxy, "getCodecBitRate", error, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID, G_TYPE_STRING, OUT_bitrate, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_reply) (DBusGProxy *proxy, char * OUT_bitrate, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_bitrate;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_bitrate, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_reply)data->cb) (proxy, OUT_bitrate, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_async (DBusGProxy *proxy, const char * IN_codec_name, org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getCodecBitRate", org_sflphone_SFLphone_ConfigurationManager_get_codec_bit_rate_async_callback, stuff, g_free, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth (DBusGProxy *proxy, const char * IN_codec_name, char ** OUT_bandwidth, GError **error)
{
return dbus_g_proxy_call (proxy, "getCodecBandwidth", error, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID, G_TYPE_STRING, OUT_bandwidth, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_reply) (DBusGProxy *proxy, char * OUT_bandwidth, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_bandwidth;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_bandwidth, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_reply)data->cb) (proxy, OUT_bandwidth, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_async (DBusGProxy *proxy, const char * IN_codec_name, org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getCodecBandwidth", org_sflphone_SFLphone_ConfigurationManager_get_codec_bandwidth_async_callback, stuff, g_free, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate (DBusGProxy *proxy, const char * IN_codec_name, char ** OUT_clockrate, GError **error)
{
return dbus_g_proxy_call (proxy, "getCodecClockRate", error, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID, G_TYPE_STRING, OUT_clockrate, G_TYPE_INVALID);
}
typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_reply) (DBusGProxy *proxy, char * OUT_clockrate, GError *error, gpointer userdata);
static void
org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_clockrate;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_clockrate, G_TYPE_INVALID);
(*(org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_reply)data->cb) (proxy, OUT_clockrate, error, data->userdata);
return; return;
} }
...@@ -793,14 +603,14 @@ static ...@@ -793,14 +603,14 @@ static
inline inline
#endif #endif
DBusGProxyCall* DBusGProxyCall*
org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_async (DBusGProxy *proxy, const char * IN_codec_name, org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_reply callback, gpointer userdata) org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_async (DBusGProxy *proxy, const char ** IN_list, org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_reply callback, gpointer userdata)
{ {
DBusGAsyncData *stuff; DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1); stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback); stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata; stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "getCodecClockRate", org_sflphone_SFLphone_ConfigurationManager_get_codec_clock_rate_async_callback, stuff, g_free, G_TYPE_STRING, IN_codec_name, G_TYPE_INVALID); return dbus_g_proxy_begin_call (proxy, "setActiveCodecList", org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list_async_callback, stuff, g_free, G_TYPE_STRV, IN_list, G_TYPE_INVALID);
} }
#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_sflphone_SFLphone_ConfigurationManager */ #endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_sflphone_SFLphone_ConfigurationManager */
......
...@@ -388,7 +388,7 @@ bold_if_default_account(GtkTreeViewColumn *col, ...@@ -388,7 +388,7 @@ bold_if_default_account(GtkTreeViewColumn *col,
/** /**
* TODO Action when restore default codecs is done * TODO Action when restore default codecs is done
*/
void void
default_codecs(GtkWidget* widget, gpointer data) default_codecs(GtkWidget* widget, gpointer data)
{ {
...@@ -427,7 +427,7 @@ default_codecs(GtkWidget* widget, gpointer data) ...@@ -427,7 +427,7 @@ default_codecs(GtkWidget* widget, gpointer data)
codecStore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView))); codecStore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView)));
gtk_list_store_reorder(codecStore, new_order); gtk_list_store_reorder(codecStore, new_order);
} }
*/
/** /**
* Create table widget for codecs * Create table widget for codecs
*/ */
......
...@@ -717,14 +717,15 @@ dbus_codec_details( int payload ) ...@@ -717,14 +717,15 @@ dbus_codec_details( int payload )
} }
gchar **
dbus_default_codec_list() gchar**
dbus_get_active_codec_list()
{ {
g_print("Before"); g_print("Before");
gchar ** array;
GError *error = NULL; GError *error = NULL;
char ** array; org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list (
org_sflphone_SFLphone_ConfigurationManager_get_default_codec_list (
configurationManagerProxy, configurationManagerProxy,
&array, &array,
&error); &error);
...@@ -732,67 +733,39 @@ dbus_default_codec_list() ...@@ -732,67 +733,39 @@ dbus_default_codec_list()
g_print("After"); g_print("After");
if (error) if (error)
{ {
g_printerr ("Failed to call get_default_codec_list() on ConfigurationManager: %s\n", g_printerr ("Failed to call get_active_codec_list() on ConfigurationManager: %s\n",
error->message); error->message);
g_error_free (error); g_error_free (error);
} }
else else
{ {
g_print ("DBus called get_default_codec_list() on ConfigurationManager\n"); g_print ("DBus called get_active_codec_list() on ConfigurationManager\n");
} }
return array; return array;
} }
void void
dbus_set_prefered_codec(const gchar* codec) dbus_set_active_codec_list(const gchar** list)
{ {
g_print("Before"); g_print("Before");
GError *error = NULL; GError *error = NULL;
org_sflphone_SFLphone_ConfigurationManager_set_codec_prefered_order ( org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list (
configurationManagerProxy, configurationManagerProxy,
codec, list,
&error); &error);
g_print("After"); g_print("After");
if (error) if (error)
{ {
g_printerr ("Failed to call set_prefered_codec() on ConfigurationManager: %s\n", g_printerr ("Failed to call set_active_codec_list() on ConfigurationManager: %s\n",
error->message); error->message);
g_error_free (error); g_error_free (error);
} }
else else
{ {
g_print ("DBus called set_prefered_codec() on ConfigurationManager\n"); g_print ("DBus called set_active_codec_list() on ConfigurationManager\n");
} }
} }
gchar**
dbus_get_sample_rate_list()
{
g_print("Before");
gchar ** array;
GError *error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_sample_rate_list (
configurationManagerProxy,
&array,
&error);
g_print("After");
if (error)
{
g_printerr ("Failed to call get_sample_rate_list() on ConfigurationManager: %s\n",
error->message);
g_error_free (error);
}
else
{
g_print ("DBus called get_sample_rate_list() on ConfigurationManager\n");
}
return array;
}
...@@ -56,8 +56,7 @@ void dbus_set_default_account(gchar * accountID); ...@@ -56,8 +56,7 @@ void dbus_set_default_account(gchar * accountID);
gchar** dbus_codec_list(); gchar** dbus_codec_list();
gchar** dbus_codec_details(int payload); gchar** dbus_codec_details(int payload);
gchar** dbus_default_codec_list(); gchar** dbus_default_codec_list();
gchar** dbus_get_sample_rate_list(); void set_active_codec_list( const gchar** list );
/* Instance */ /* Instance */
void dbus_register( int pid, gchar * name); void dbus_register( int pid, gchar * name);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <iostream> #include <iostream>
#include <cstdlib>
#include "audiocodec.h" #include "audiocodec.h"
#include "codecDescriptor.h" #include "codecDescriptor.h"
...@@ -29,25 +30,25 @@ ...@@ -29,25 +30,25 @@
CodecDescriptor::CodecDescriptor() CodecDescriptor::CodecDescriptor()
{ {
// Default codecs init();
_codecMap[PAYLOAD_CODEC_ULAW] = "PCMU"; //#ifdef HAVE_SPEEX
_codecMap[PAYLOAD_CODEC_GSM] = "GSM"; //_codecMap[PAYLOAD_CODEC_SPEEX] = new CodecSpeex(PAYLOAD_CODEC_SPEEX); // TODO: this is a variable payload!
_codecMap[PAYLOAD_CODEC_ALAW] = "PCMA"; //#endif
#ifdef HAVE_SPEEX
_codecMap[PAYLOAD_CODEC_SPEEX] = new CodecSpeex(PAYLOAD_CODEC_SPEEX); // TODO: this is a variable payload!
#endif
_codecMap[PAYLOAD_CODEC_ILBC_20] = "iLBC";
} }
void void
CodecDescriptor::init() CodecDescriptor::init()
{ {