]> sjero.net Git - linphone/commitdiff
Add java interface for chat.
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 5 Sep 2012 09:51:26 +0000 (11:51 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 5 Sep 2012 09:51:26 +0000 (11:51 +0200)
Add -D for exosip
Remove obsolete media_api to avoid confusion

17 files changed:
build/android/common.mk
java/common/org/linphone/core/LinphoneChatRoom.java
media_api/.gitignore [deleted file]
media_api/DESIGN.txt [deleted file]
media_api/Makefile.am [deleted file]
media_api/apitest.c [deleted file]
media_api/apitest.h [deleted file]
media_api/basiccall.c [deleted file]
media_api/basiccall.h [deleted file]
media_api/callmember.c [deleted file]
media_api/callmember.h [deleted file]
media_api/ccl [deleted file]
media_api/common.h [deleted file]
media_api/media_api.c [deleted file]
media_api/media_api.h [deleted file]
media_api/mediaflow.c [deleted file]
media_api/mediaflow.h [deleted file]

index 4fa833b59f726a3060dcfadac3c3ecb5c8f74941..4db1f68090a2452e0058c324429ef79ac2526ded 100644 (file)
@@ -59,6 +59,7 @@ LOCAL_CFLAGS += \
        -DORTP_INET6 \
         -DINET6 \
         -DOSIP_MT \
+       -DHAVE_EXOSIP_RESET_TRANSPORTS \
        -DENABLE_TRACE \
        -DLINPHONE_VERSION=\"$(LINPHONE_VERSION)\" \
        -DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
index f06e8fda528bf92bef229a3e9075a883fbf4fcb4..8c85b64bc9f4e509353cd74dbb008bf85d4a4ddf 100644 (file)
@@ -34,6 +34,16 @@ public interface LinphoneChatRoom {
        * send a message to peer member of this chat room.
        * @param        message to be sent
        */
+       void sendMessage(String message);
+       /**
+        * Send a message to peer member of this chat room.
+        * @param chat message
+        */
+       void sendMessage(LinphoneChatMessage msg, LinphoneChatMessage.StateListener listener);
+       /**
+        * DEPRECATED
+        * @param opaque
+        * @param message
+        */
        void sendMessage(Object opaque, String message);
-
 }
diff --git a/media_api/.gitignore b/media_api/.gitignore
deleted file mode 100644 (file)
index e995588..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-.deps
-Makefile
-Makefile.in
diff --git a/media_api/DESIGN.txt b/media_api/DESIGN.txt
deleted file mode 100644 (file)
index f7c9cfc..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-MEDIA API DESIGN DRAFT
-**********************
-
-
-The objective of the media_api is to construct and run the necessary
-processing on audio and video data flows for a given call (two party call) or
-conference.
-The media_api must support calls where callmember can be remote as well
-local hosted, in other words the media_api can be used inside linphone as
-well as in sip conferencing server. The api must support multiples way of
-getting media data: from disk, from rtp, from soundcard...
-The media_api is object oriented in C, and is based on the mediastreamer library
-to deal with audio or video signals, and on glib for types and usefull routines.
-
-The api must provide object and methods that describes the call, and then functions
-that executes the processing (using the mediastreamer) that is necessary for the
-call described.
-
-Proposed API:
-
-************************************************************************
-object: MediaFlow
-This object reprensent a media that is shared between all members of the call,
-for example voice.
-methods:
-MediaFlow *media_flow_new(char *id_string,gint type,gint duplex);
-type can be FLOW_AUDIO, FLOW_VIDEO.
-if duplex is 1, it means that the media flow is used by every member in both
-receiving and sending mode.
-id_string is just a string to identify the flow.
-
-void media_flow_destroy(MediaFlow *flow);
-destructor
-
-**************************************************************************
-object: CallMember
-This object reprensent a member of a call.
-methods:
-CallMember *call_member_new();
-
-gint call_member_setup_flow(CallMember *member, MediaFlow *flow,
-                                                                                                         char *rx_endpoint, char *tx_endpoint);
-       This is the most important function of the API. It describes the way each
-       call member receives and send a given media flow.
-       The MediaFlow "flow" is added to the list of flows used by the member "member".
-       rx_endpoint is a string that described how data is received by the call member.
-       It should be an url, for example "rtp://213.21.54.127:7080". In this case it
-       means that data will be received on port 7080 at ip address 213.21.54.127.
-       tx_endpoint is a string that described how data is sent by the call member.
-       The role of url is very important. They can be:
-       "rtp://213.21.54.127:7080"
-       "file://tmp/media.out"  -a file on disk
-       "oss://0"               -souncard 0 using oss api
-       "alsa://0"                                                      -soundcard 0 using alsa api.
-       In order to work, the call member must be part of a BasicCall, as well as
-       the flow must be part of the BasicCall too (using basic_call_add_flow())
-       This function may (on the backend) create a MediaEndpoint object that stores
-       the rx_endpoint and tx_endpoint parameter. This object is added to:
-       -the list of MediaEndpoint maintained by the member (list per member)
-       -the list of MediaEndpoint maintained by the flow (list per flow)
-
-
-**************************************************************************
-object: BasicCall
-This object handles simple calls (two party calls). It defines inside itself
-two CallMember objects.
-method:
-BasicCall *basic_call_new();
-
-CallMember *basic_call_get_member(BasicCall *call, gint member_number);
-       Returns a member of a BasicCall according to a number.
-       
-void basic_call_add_flow(BasicCall *call, MediaFlow *flow);
-       Adds a flow to the call's list of flow.
-       
-gint basic_call_start_flow(BasicCall *call, MediaFlow *flow);
-       This function construct the mediastreamer processing chain necessary to make
-       the call running, if not done, and runs it using ms_start()
-       
-gint basic_call_stop_flow(BasicCall *call, MediaFlow *flow);
-
-gint basic_call_start_all_flows(BasicCall *call);
-       
-void basic_call_destroy(BasicCall *call);
-       Destroy all data used by the call: call members, call flows.
-
-**************************************************************************
-object: ConferenceCall
-This object handles conference call (which are quite much complicated than basic
-calls). But this object should have the same method as the BasicCall object.
-
-*******************************************************************
-                       EXAMPLE
-*******************************************************************
-
-Two party call between call member A on machine "linphone.org" and call member B on machine "home.com". 
-The media_api is running on "home.com".
-
-       A (on linphone.org)                                                             B (on home.com)
-
------->(send to rtp://home.com:7080              MSRTPReceiver------>Decode----->(send to oss:/0)
-
-------<(recv on rtp://linphone.org:7020                  MSRTPSender<--------Encode<-----(read on oss://0)
-
-This is how to setup this call using the media_api:
-BasicCall *call;
-CallMember *memberA,*memberB;
-MediaFlow *flow;
-
-/* create a basic call*/
-call=basic_call_new();
-/* get a pointer to the pre-define members of the call */
-memberA=basic_call_get_member(call,0);
-memberB=basic_call_get_member(call,1);
-
-/* create a media flow */
-flow=media_flow_new("voice",FLOW_AUDIO,1);
-/* tell that the flow is used by the call */
-basic_call_add_flow(call,flow);
-/* tell how each member uses the flow (how is the interface ?)*/
-call_member_setup_flow(memberA,flow,"rtp://linphone.org:7020","rtp://home.com:7080");
-/* note: it is not efficient to do name resolution at this stage: that's why in reality numeric ip address
-should be given instead of host name */
-call_member_setup_flow(memberB,flow,"oss://0","oss://0");
-
-/* start the flow */
-basic_call_start_flow(call,flow);
-
-In case where the media api is running on another host called "toto" (in a media translator application for example),
- the only thing that would change is the url given to memberB: tx="rtp://home.com:8820" for example and
- rx="rtp://toto:9522".
-In the sipomatic application (the test application I use to test linphone (it answers to call and plays
-a short annoucement)), I would write rx="file://path_to_annoucement.raw" and tx="file://dev/null" instead of
-"oss://0".
diff --git a/media_api/Makefile.am b/media_api/Makefile.am
deleted file mode 100644 (file)
index 38dcf06..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-## Process this file with automake to produce Makefile.in
-if BUILD_MEDIA_API
-
-#the media_api library is the only one we have to build here
-lib_LTLIBRARIES=libmedia_api.la
-
-#definition of the sources of libmedia_api
-libmedia_api_la_SOURCES=       basiccall.c callmember.c mediaflow.c
-
-# libmedia_api  needs libmediastreamer
-libmedia_api_la_LIBADD=$(top_srcdir)/mediastreamer/libmediastreamer.la
-
-#the media_api test program
-bin_PROGRAMS=apitest
-
-apitest_SOURCES= apitest.c
-# the test program links to libmedia_api
-apitest_LDADD=libmedia_api.la
-
-endif
-
-DEFS=@DEFS@ @SOUNDDEFS@ -DDEBUG -DG_LOG_DOMAIN=\"MediaApi\" 
-
-INCLUDES=-I$(top_srcdir)/mediastreamer \
-               -I$(top_srcdir)/speex \
-               -I$(top_srcdir)/gsmlib \
-               $(ORTP_CFLAGS) \
-               -I$(top_srcdir)/lpc10-1.5 \
-               -I$(top_srcdir)/ffmpeg 
-
-
diff --git a/media_api/apitest.c b/media_api/apitest.c
deleted file mode 100644 (file)
index cd4ac9e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "basiccall.h"
-#include <signal.h>
-static int flag = 1;
-void stop(int sign){
-       flag = 0;
-}
-
-
-int main(){
-       BasicCall *call;
-       char *id;
-       CallMember *memberA, *memberB;
-       MediaFlow *flow, *flow1;
-
-       signal(SIGINT, stop);
-       call = basic_call_new();
-       memberA = basic_call_get_member(call,MemberA);
-       memberB = basic_call_get_member(call,MemberB);
-
-       id = "test_voice";
-       printf("\n");
-       flow = media_flow_new(id, MEDIA_FLOW_VOICE);
-       
-       basic_call_add_flow(call, flow);
-
-       call_member_setup_flow(memberA, flow, "file://temp", "oss://0");
-       call_member_setup_flow(memberB, flow, "oss://0", "oss://0");
-
-       media_flow_setup_fd(flow, memberA, memberB, MEDIA_FLOW_HALF_DUPLEX); 
-       basic_call_start_flow(call, flow);
-
-       while(flag){
-               sleep(1);
-       }
-
-}
diff --git a/media_api/apitest.h b/media_api/apitest.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/media_api/basiccall.c b/media_api/basiccall.c
deleted file mode 100644 (file)
index 8a00447..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-\r
-#include "basiccall.h"\r
-#include "../mediastreamer/mscodec.h"\r
-\r
-#define ONESYNC 10\r
-#define MULTISYNC 20\r
-\r
-BasicCall *basic_call_new(){\r
-       BasicCall *bc = (BasicCall*) g_malloc(sizeof(BasicCall));\r
-       api_trace("basic_call_new: creating a basic call");\r
-       bc->memberA = call_member_new("memberA");\r
-       bc->memberB = call_member_new("memberB");\r
-       return bc;\r
-}\r
-\r
-CallMember *basic_call_get_member(BasicCall *call, int member_nu){\r
-       api_trace("basic_call_get_member: called for %d",member_nu);\r
-       if(member_nu == MemberA){\r
-               return call->memberA;\r
-       }\r
-       else if(member_nu == MemberB){\r
-               return call->memberB;\r
-       }\r
-}\r
-\r
-void basic_call_add_flow(BasicCall *call, MediaFlow *flow){\r
-       api_trace("basic_call_add_flow: called for %s",flow->id);\r
-       call->flows = g_list_append( call->flows, flow);\r
-       return 1;\r
-}\r
-\r
-int find_mediaflow(gconstpointer llist, gconstpointer flow){\r
-       //MediaFlow *mf = (MediaFlow *) ((BasicCallFlow*)llist)->mediaFlow;\r
-       if(((MediaFlow*)flow)->id == ((MediaFlow*)llist)->id){\r
-               return 0;\r
-       }\r
-       return 1;\r
-}\r
-\r
-int basic_call_start_flow(BasicCall *call, MediaFlow *flow){\r
-       int i=0;\r
-       int syncFlag=0;\r
-       int nFlowDirections;\r
-       MSSync *sync;\r
-       Members *source, *destination;\r
-       FlowDirections *fd;\r
-       GList *elem, *selem;\r
-       GList *snd_read = NULL, *snd_write = NULL, *filter = NULL;\r
-       \r
-       //Commented by Sharat\r
-       //This is initialized in media_api.c\r
-       //when should these functions be really called?\r
-       //ms_init(); \r
-       //ortp_init(); \r
-       \r
-       api_trace("basic_call_start_flow: called for flow %s", flow->id);\r
-       \r
-       elem = g_list_find_custom( call->flows, flow, &find_mediaflow);\r
-       if(elem == NULL){\r
-               api_error("basic_call_start_flow: Called for unregistered mediaflow %s", flow->id);\r
-       }\r
-       \r
-       nFlowDirections = g_list_length(flow->flowDirections);\r
-       if(flow->type == MEDIA_FLOW_VOICE){\r
-               syncFlag = ONESYNC;\r
-               sync = ms_timer_new();\r
-       }\r
-       else{\r
-               syncFlag = MULTISYNC;\r
-       }\r
-\r
-       for(i=0;i< nFlowDirections; i++){\r
-               \r
-               if(syncFlag == MULTISYNC){\r
-                       sync = ms_timer_new();\r
-               }\r
-               fd = (FlowDirections*)g_list_nth_data(flow->flowDirections,i);\r
-               source = fd->source;\r
-               destination = fd->destination;\r
-\r
-               media_flow_start_fd(fd, sync);\r
-               if(fd->type == MEDIA_FLOW_DUPLEX){\r
-                       switch(source->tx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_read = g_list_append(snd_read, fd->recv);\r
-                       }\r
-                       switch(destination->rx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_write = g_list_append(snd_write, fd->play);\r
-                       }\r
-                       \r
-                       switch(destination->tx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_read = g_list_append(snd_read, fd->read);\r
-                       }\r
-                       \r
-                       switch(source->rx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_write = g_list_append(snd_write, fd->send);\r
-                       }\r
-                       \r
-               }\r
-               else if(fd->type == MEDIA_FLOW_HALF_DUPLEX){\r
-                       \r
-                       switch(source->tx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_read = g_list_append(snd_read, fd->recv);\r
-                       }\r
-                       switch(destination->rx_endpoint->protocol){\r
-                               case MEDIA_ALSA:\r
-                               case MEDIA_OSS:\r
-                                       snd_write = g_list_append(snd_write, fd->play);\r
-                       }\r
-               }\r
-               if(syncFlag == MULTISYNC){\r
-                       flow->sync = g_list_append(flow->sync, sync);\r
-               }\r
-       }\r
-       if(syncFlag == ONESYNC){\r
-               ms_start(sync);\r
-               flow->sync = g_list_append(flow->sync, sync);\r
-       }\r
-       if(syncFlag == MULTISYNC){\r
-               selem = flow->sync;\r
-               while(selem != NULL){\r
-                       ms_start(selem->data);\r
-                       selem = g_list_next(selem);\r
-               }\r
-       }\r
-       filter = snd_read;\r
-       while(filter != NULL){\r
-               ms_sound_read_start(MS_SOUND_READ((MSFilter*)filter->data));\r
-               filter = g_list_next(filter);\r
-       }\r
-\r
-       filter = snd_write;\r
-       while(filter != NULL){\r
-               ms_sound_write_start(MS_SOUND_WRITE((MSFilter*)filter->data));\r
-               filter = g_list_next(filter);\r
-       }\r
-       return 1;\r
-}\r
-\r
-int basic_call_stop_flow(BasicCall *call, MediaFlow *flow){\r
-\r
-}\r
diff --git a/media_api/basiccall.h b/media_api/basiccall.h
deleted file mode 100644 (file)
index 2351fac..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net \r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-\r
-#include "common.h"\r
-#include "mediaflow.h"\r
-#include "callmember.h"\r
-\r
-//other includes required to be done here\r
-#define MemberA 1\r
-#define MemberB 2\r
-\r
-\r
-struct _BasicCall{\r
-       CallMember *memberA, *memberB;\r
-       GList *flows;                   //linked list of MediaFlows\r
-};\r
-\r
-typedef struct _BasicCall BasicCall;\r
-\r
-\r
-BasicCall *basic_call_new();\r
-\r
-CallMember *basic_call_get_member(BasicCall *call, int member_nu);\r
-\r
-void basic_call_add_flow(BasicCall *call, MediaFlow *flow);\r
-\r
-int basic_call_start_flow(BasicCall *call, MediaFlow *flow);\r
-\r
-int basic_call_stop_flow(BasicCall *call, MediaFlow *flow);\r
-\r
-int basic_call_start_all_flows(BasicCall *call);\r
-\r
-int basic_call_destroy(BasicCall *call);\r
-\r
diff --git a/media_api/callmember.c b/media_api/callmember.c
deleted file mode 100644 (file)
index 643ba7b..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-#include <string.h>\r
-#include "common.h"\r
-#include "callmember.h"\r
-#include "mediaflow.h"\r
-\r
-\r
-CallMember *call_member_new(char *name){\r
-  CallMember *member = (CallMember*) g_malloc(sizeof(CallMember));\r
-  api_trace("call_member_new: creating %s", name);\r
-  member->name = name;\r
-  member->flows = NULL;\r
-  member->profile = NULL;\r
-  return member;\r
-}\r
-\r
-int call_member_set_rtp_profile(CallMember *member, RtpProfile *profile){\r
-       member->profile = profile;\r
-       return 1;\r
-}\r
-\r
-int call_member_setup_flow(CallMember *member, MediaFlow *flow, char* rx, char *tx){\r
-  Members *mem = (Members*) g_malloc(sizeof(Members));\r
-  Flows *flows = (Flows*) g_malloc(sizeof(Flows));\r
-  api_trace("call_member_setup_flow: setting up flow for: CallMember->%s , MediaFlow->%s", member->name, flow->id);\r
-  mem->member = member;\r
-  mem->rx_endpoint = parse_end_point(rx);\r
-  mem->tx_endpoint = parse_end_point(tx);\r
-  flow->members = g_list_append(flow->members, mem);\r
-\r
-  flows->flow = flow;\r
-  flows->rx_endpoint = parse_end_point(rx);\r
-  flows->tx_endpoint = parse_end_point(tx);\r
-  member->flows = g_list_append(member->flows, flows);\r
-  return 1;\r
-}\r
-\r
-EndPoint *parse_end_point(char *endpoint){\r
-       EndPoint *result = (EndPoint*) g_malloc(sizeof(EndPoint));\r
-       int i=0,len1,len2,len, tlen;\r
-       char *str2, temp[30], *host_str;\r
-       //api_trace("parse_end_point: parsing %s\n", endpoint);\r
-       result->pt = -1;\r
-       while(1){\r
-               str2 = (char*) strpbrk(endpoint, ":");\r
-               if(str2 == NULL){ \r
-                       str2 = (char*) strpbrk(endpoint, ";");\r
-                       if(str2 == NULL){\r
-                               len = strlen(endpoint); \r
-                       }\r
-                       else{\r
-                               len1 = strlen(endpoint);\r
-                               len2 = strlen(str2);\r
-                               len = len1-len2;\r
-                       }\r
-               }\r
-               else{\r
-                       len1 = strlen(endpoint);\r
-                       len2 = strlen(str2);\r
-                       len = len1-len2;\r
-               }\r
-               strncpy(temp,endpoint,len);\r
-               temp[len] = '\0';\r
-               tlen = strlen(temp);\r
-               if((tlen >= 2)&&(temp[0] == '/')&&(temp[1] == '/')){\r
-                       host_str = remove_slash(temp);\r
-               }\r
-               switch(i){\r
-                       case 0: if(strcmp(temp,"rtp")==0){\r
-                                       result->protocol=MEDIA_RTP;\r
-                               }\r
-                               else if(strcmp(temp,"oss")==0){\r
-                                       result->protocol=MEDIA_OSS;\r
-                               }\r
-                               else if(strcmp(temp,"alsa")==0){\r
-                                       result->protocol=MEDIA_ALSA;\r
-                               }\r
-                               else if(strcmp(temp,"file")==0){\r
-                                       result->protocol=MEDIA_FILE;\r
-                               }\r
-                               break;\r
-                       case 1: if(result->protocol==MEDIA_FILE){\r
-                                       result->file=host_str;\r
-                               }\r
-                               else{\r
-                                       result->host = host_str;\r
-                               }\r
-                               break;\r
-                       case 2: result->port = to_digits(temp);\r
-                               break;\r
-                       case 3: result->pt = pt_digits(temp);\r
-                               break;\r
-                       default://result->options[result->nOptions++] = temp;\r
-                               break;\r
-               }\r
-               if(str2 != NULL) endpoint = str2+1;\r
-               else break;\r
-               i++;\r
-       }\r
-       return result;          \r
-}\r
-\r
-int to_digits(char *str){\r
-       int nu=0,a,len,i;\r
-       len = strlen(str);\r
-       for(i=0;i<len;i++){\r
-               a=str[i];\r
-               a=a-'0';\r
-               nu = nu*10+a;\r
-       }\r
-       return nu;\r
-}\r
-\r
-int pt_digits(char *str){\r
-       int len;\r
-       len = strlen(str);\r
-       if((len>3)&&(str[0]=='p')&&(str[1]=='t')&&(str[2]=='=')){\r
-               return to_digits(str+3);\r
-       }\r
-       else{\r
-               api_warn("Wrong parameters passed in the endpoints");\r
-               return 0;\r
-               //ERROR handling\r
-       }\r
-}\r
-char *remove_slash(char var[]){\r
-       char *temp = (char*) g_malloc(10*sizeof(char));\r
-       int len,i;\r
-       len=strlen(var);\r
-       for(i=2;i<len;i++){\r
-               temp[i-2]=var[i];\r
-       }\r
-       return temp;\r
-}\r
-\r
diff --git a/media_api/callmember.h b/media_api/callmember.h
deleted file mode 100644 (file)
index 1c40746..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-\r
-struct _CallMember{\r
-       char *name;\r
-       GList *flows;\r
-       RtpProfile *profile;\r
-};\r
-\r
-typedef struct _CallMember CallMember;\r
-\r
-struct _EndPoint{\r
-       int protocol;\r
-       char *host;\r
-       char *file;\r
-       int port;\r
-       int pt;\r
-};\r
-\r
-typedef struct _EndPoint EndPoint;\r
-\r
-struct _Flows{\r
-  struct _MediaFlow *flow;\r
-  EndPoint *rx_endpoint;\r
-  EndPoint *tx_endpoint;\r
-};\r
-\r
-typedef struct _Flows Flows;\r
-\r
-CallMember *call_member_new(char *);\r
-\r
-int call_member_setup_flow(CallMember *member, struct _MediaFlow *flow, char *rx_enndpoint, char *tx_endpoint);\r
-\r
-/* Internal functions */\r
-EndPoint *parse_end_point(char *endpoint);\r
-\r
-char *remove_slash(char[]);\r
-\r
-int to_digits(char*);\r
-\r
-int pt_digits(char*);\r
-\r
diff --git a/media_api/ccl b/media_api/ccl
deleted file mode 100644 (file)
index d814341..0000000
+++ /dev/null
@@ -1 +0,0 @@
-gcc -I/home/skudupa/linphone/mediastreamer -I/home/skudupa/linphone/ffmpeg/libavcodec -I/home/skudupa/linphone/gsmlib -I/home/skudupa/linphone/lpc10-1.5 -I/home/skudupa/linphone/oRTP/src -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/home/skudupa/linphone/oRTP mediaflow.c
diff --git a/media_api/common.h b/media_api/common.h
deleted file mode 100644 (file)
index a2294c2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef COMMON_H
-#define COMMON_H
-
-
-#include "media_api.h"
-#include <glib.h>
-
-#define api_trace g_message
-#define api_error g_error
-#define api_warn g_warning
-
-#define MEDIA_FLOW_DUPLEX 1
-#define MEDIA_FLOW_HALF_DUPLEX 2
-
-//Mediaflow type
-#define MEDIA_FLOW_VIDEO 1
-#define MEDIA_FLOW_VOICE 2
-
-//Mediaflow protocols
-#define MEDIA_RTP 1
-#define MEDIA_OSS 2
-#define MEDIA_ALSA 3
-#define MEDIA_FILE 4
-
-//Mediaflow codec function
-#define MEDIA_API_DECODER 1
-#define MEDIA_API_ENCODER 2
-
-#endif
-
-
diff --git a/media_api/media_api.c b/media_api/media_api.c
deleted file mode 100644 (file)
index 8746e9b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-
-#include "media_api.h"
-
-/* non-standard payload types for oRTP */
-PayloadType lpc1015={
-    PAYLOAD_AUDIO_PACKETIZED,
-    8000,
-    0,
-    NULL,
-    0,
-    2400,
-    "1015/8000/1"
-};
-
-PayloadType speex_nb={
-    PAYLOAD_AUDIO_PACKETIZED,
-    8000,
-    0,
-    NULL,
-    0,
-    15000,
-    "speex/8000/1"
-};
-
-PayloadType speex_nb_lbr={
-    PAYLOAD_AUDIO_PACKETIZED,
-    8000,
-    0,
-    NULL,
-    0,
-    8000,
-    "speex-lbr/8000/1"
-};
-
-void media_api_init()
-{
-       ortp_init();
-       ortp_set_debug_file("oRTP",NULL);
-       rtp_profile_set_payload(&av_profile,115,&lpc1015);
-       rtp_profile_set_payload(&av_profile,110,&speex_nb);
-       rtp_profile_set_payload(&av_profile,111,&speex_nb_lbr);
-       rtp_profile_set_payload(&av_profile,101,&telephone_event);
-       ms_init();
-       ms_speex_codec_init();
-#ifdef HAVE_AVCODEC
-       ms_AVCodec_init();
-#endif
-}
-
-
diff --git a/media_api/media_api.h b/media_api/media_api.h
deleted file mode 100644 (file)
index b7341fc..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-       The objective of the media_api is to construct and run the necessary processing 
-       on audio and video data flows for a given call (two party call) or conference.
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net
-
-       This library is free software; you can redistribute it and/or
-       modify it under the terms of the GNU Lesser General Public
-       License as published by the Free Software Foundation; either
-       version 2.1 of the License, or (at your option) any later version
-
-       This library 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
-       Lesser General Public License for more details.
-
-       You should have received a copy of the GNU Lesser General Public
-       License along with this library; if not, write to the Free Software
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef MEDIA_API_H
-#define MEDIA_API_H
-
-/* some mediastreamer include files....*/
-
-#include "ms.h"
-
-/* audio codecs ; all these header are not really required as we should use ms_codec_new..() to 
-create codec filters*/
-/*Commented by Sharath Udupa
-#include <mscodec.h>
-#include <msMUlawdec.h>
-#include <msMUlawenc.h>
-#include <msAlawdec.h>
-#include <msAlawenc.h>
-#include <msGSMdecoder.h>
-#include <msGSMencoder.h>
-#include <msLPC10decoder.h>
-#include <msLPC10encoder.h>
-
-#ifdef BUILD_FFMPEG
-#include <msavdecoder.h>
-#include <msavencoder.h>*/
-#endif
-
-/* some usefull filters of the mediastreamer */
-#include "mscopy.h"
-#include "msfdispatcher.h"
-#include "msqdispatcher.h"
-
-/* some synchronisation sources */
-#include <msnosync.h>
-#include <mstimer.h>
-
-/* some streams sources and sinks */
-#include <msossread.h>
-#include <msosswrite.h>
-#include <msread.h>
-#include <mswrite.h>
-#include <msringplayer.h>
-#include <msrtprecv.h>
-#include <msrtpsend.h>
-#include <msv4l.h>
-#include <msvideooutput.h>
-
-#endif
-
-
-
diff --git a/media_api/mediaflow.c b/media_api/mediaflow.c
deleted file mode 100644 (file)
index e0e6be4..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a copy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-#include "common.h"\r
-#include "mediaflow.h"\r
-#include "callmember.h"\r
-\r
-\r
-MediaFlow *media_flow_new(char *id_string, int type){\r
-  MediaFlow *flow = (MediaFlow *) g_malloc(sizeof(MediaFlow));  //malloc required?\r
-  api_trace("media_flow_new: creating %s",id_string);\r
-  flow->id = id_string;\r
-  flow->type = type;\r
-  flow->flowDirections = NULL;\r
-  flow->members = NULL;\r
-  return flow;\r
-}\r
-\r
-int media_flow_destroy(MediaFlow *flow){\r
-       g_free(flow);\r
-       return 1;\r
-}\r
-\r
-int media_flow_setup_fd(MediaFlow *flow, CallMember* csource, CallMember *cdestination, int direction){\r
-       GList *source, *destination;\r
-       char *dir;\r
-       FlowDirections *fd = (FlowDirections *) g_malloc(sizeof(FlowDirections));\r
-       if(direction == MEDIA_FLOW_DUPLEX) dir = "DUPLEX";\r
-       else if(direction == MEDIA_FLOW_HALF_DUPLEX) dir = "HALF_DUPLEX";\r
-       api_trace("media_flow_setup_fd: setting up %s flow for %s , %s",dir, csource->name, cdestination->name);\r
-       source = g_list_find_custom(flow->members, csource, &find);\r
-       destination =g_list_find_custom(flow->members, cdestination, &find);\r
-       if(source == NULL){\r
-               api_error("media_flow_setup_fd: Invalid source %s specified", csource->name);\r
-       }\r
-       if(destination == NULL){\r
-               api_error("media_flow_setup_fd: Invalid destination %s specified", cdestination->name);\r
-               //ERROR handling to be done here\r
-       }\r
-       fd->source = (Members*)source->data;\r
-       fd->destination = (Members*)destination->data;\r
-       fd->type = direction;\r
-       flow->flowDirections = g_list_append(flow->flowDirections, fd);\r
-       return 1;\r
-}\r
-\r
-int find(gconstpointer mem, gconstpointer cmember){\r
-       if(!strcmp(((Members*)mem)->member->name, ((CallMember*)cmember)->name)){\r
-               return 0;\r
-       }\r
-       return 1;\r
-}\r
-\r
-int media_flow_start_fd(FlowDirections *fd, MSSync *sync){\r
-       Members *source, *destination;\r
-       source = fd->source;\r
-       destination = fd->destination;\r
-       if(fd->type == MEDIA_FLOW_DUPLEX){\r
-               fd->recv = set_MSFilter(source->tx_endpoint,1,fd);\r
-               fd->dec = set_CODECFilter(source->member->profile, source->tx_endpoint->pt,MEDIA_API_DECODER);\r
-               fd->play = set_MSFilter(destination->rx_endpoint,0,fd);\r
-               \r
-               ms_filter_add_link(fd->recv,fd->dec);\r
-               ms_filter_add_link(fd->dec,fd->play);\r
-               ms_sync_attach(sync, fd->recv);\r
-               \r
-               fd->read = set_MSFilter(destination->tx_endpoint,1,fd);\r
-               fd->enc = set_CODECFilter(destination->member->profile, destination->tx_endpoint->pt,MEDIA_API_ENCODER);\r
-               fd->send = set_MSFilter(source->rx_endpoint,0,fd);\r
-               \r
-               ms_filter_add_link(fd->read, fd->enc);\r
-               ms_filter_add_link(fd->enc, fd->send);\r
-               ms_sync_attach(sync, fd->read);\r
-               \r
-       }\r
-       else if(fd->type == MEDIA_FLOW_HALF_DUPLEX){\r
-       \r
-               fd->recv = set_MSFilter(source->tx_endpoint,1,fd);\r
-               fd->dec = set_CODECFilter(sourcec->member->profile, source->tx_endpoint->pt,MEDIA_API_DECODER);\r
-               fd->play = set_MSFilter(destination->rx_endpoint,0,fd);\r
-               \r
-               ms_filter_add_link(fd->recv,fd->dec);\r
-               ms_filter_add_link(fd->dec,fd->play);\r
-               ms_sync_attach(sync, fd->recv); \r
-       }\r
-       return 1;\r
-}\r
-\r
-\r
-MSFilter *set_MSFilter(EndPoint *endpoint, int type, FlowDirections *fdir){\r
-       MSFilter *filter;\r
-       RtpSession *rtps;\r
-       switch(endpoint->protocol){\r
-               case MEDIA_RTP:\r
-                       rtps = rtp_session_new(RTP_SESSION_RECVONLY);\r
-                       rtp_session_set_local_addr(rtps,"0.0.0.0",8000,8001);\r
-                       rtp_session_set_scheduling_mode(rtps,0);\r
-                       rtp_session_set_blocking_mode(rtps,0);\r
-                       \r
-                       if(type == 1){\r
-                               filter = ms_rtp_recv_new();\r
-                               ms_rtp_recv_set_session(MS_RTP_RECV(filter), rtps);\r
-                               fdir->rtpSessions = g_list_append(fdir->rtpSessions, rtps);\r
-                               return filter;\r
-                       }\r
-                       else{\r
-                               //ms_rtp_send_new\r
-                       }\r
-               case MEDIA_OSS:\r
-                       if(type == 1){\r
-                               filter = ms_oss_read_new();\r
-                               ms_sound_read_set_device(MS_SOUND_READ(filter),0);\r
-                               return filter;\r
-                       }\r
-                       else{\r
-                               filter = ms_oss_write_new();\r
-                               ms_sound_write_set_device(MS_SOUND_WRITE(filter),0);\r
-                               return filter;\r
-                       }\r
-               case MEDIA_FILE:\r
-                       if(type == 1){\r
-                               filter = ms_read_new(endpoint->file);\r
-                               return filter;\r
-                       }\r
-                       if(type == 0){\r
-                               filter = ms_write_new(endpoint->file);\r
-                               return filter;\r
-                       }\r
-\r
-       }\r
-}\r
-\r
-MSFilter *set_CODECFilter(RtpProfile *profile, int pt, int mode){\r
-       PayloadType *payload;\r
-       \r
-       switch(mode){\r
-               case MEDIA_API_DECODER: \r
-                       payload = rtp_profile_get_payload(profile, pt);\r
-                       if(payload == NULL){\r
-                               api_error("media_api: undefined payload in URL\n");\r
-                               return NULL;\r
-                       }\r
-                       return ms_decoder_new_with_string_id(payload->mime_type);\r
-                       \r
-                       //Commented this to include the new RtpProfile\r
-                       /*if(pt != -1) return ms_decoder_new_with_pt(pt);\r
-                        *else return ms_copy_new();\r
-                        */\r
-               case MEDIA_API_ENCODER: \r
-                       \r
-                       payload = rtp_profile_get_payload(profile, pt);\r
-                       if(payload == NULL){\r
-                               api_error("media_api: undefined payload in URL\n");\r
-                               return NULL;\r
-                       }\r
-                       return ms_encoder_new_with_string_id(payload->mime_type);\r
-                       /*if(pt != -1) return ms_encoder_new_with_pt(pt);\r
-                        *else return ms_copy_new();\r
-                        */\r
-       }\r
-}\r
-       \r
-\r
diff --git a/media_api/mediaflow.h b/media_api/mediaflow.h
deleted file mode 100644 (file)
index 598df4d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*\r
-       The objective of the media_api is to construct and run the necessary processing \r
-       on audio and video data flows for a given call (two party call) or conference.\r
-       Copyright (C) 2001  Sharath Udupa skuds@gmx.net\r
-\r
-       This library is free software; you can redistribute it and/or\r
-       modify it under the terms of the GNU Lesser General Public\r
-       License as published by the Free Software Foundation; either\r
-       version 2.1 of the License, or (at your option) any later version.\r
-\r
-       This library is distributed in the hope that it will be useful,\r
-       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
-       Lesser General Public License for more details.\r
-\r
-       You should have received a c:opy of the GNU Lesser General Public\r
-       License along with this library; if not, write to the Free Software\r
-       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
-*/\r
-\r
-struct _MediaFlow{\r
-       char *id;\r
-       int type;\r
-       GList *members;\r
-       GList *flowDirections;\r
-       GList *sync; //holds all the filters in this MediaFlow\r
-};\r
-\r
-typedef struct _MediaFlow MediaFlow;\r
-\r
-struct _Members{\r
-  struct _CallMember *member;\r
-  struct _EndPoint *rx_endpoint;\r
-  struct _EndPoint *tx_endpoint;\r
-};\r
-\r
-typedef struct _Members Members;\r
-\r
-struct _FlowDirections{\r
-       Members *source, *destination;\r
-       MSFilter *recv,\r
-                *dec,\r
-                *play;\r
-       MSFilter *read,         //Filters used \r
-                *enc,          //if type==DUPLEX\r
-                *send;\r
-       GList *rtpSessions;\r
-       int type;\r
-};\r
-\r
-typedef struct _FlowDirections FlowDirections;\r
-\r
-\r
-MediaFlow *media_flow_new(char *id_string, int type);\r
-\r
-int media_flow_setup_fd(MediaFlow*, struct _CallMember *, struct _CallMember *, int);\r
-\r
-int media_flow_start_fd(FlowDirections *fd, MSSync *sync);\r
-\r
-int media_flow_destroy(MediaFlow *flow);\r
-\r
-/* Internal functions */\r
-int find(gconstpointer, gconstpointer);\r
-\r
-MSFilter *set_MSFilter(struct _EndPoint *, int, FlowDirections *);\r
-\r
-MSFilter *set_CODECFilter(RtpProfile* , int, int);\r
-\r