comparison src/mediastreamer/msbuffer.h @ 12024:e67993da8a22

[gaim-migrate @ 14317] I strongly suspect CruiseControl is going to yell at me for this. A voice chat API, GUI + mediastreamer. This is what I'm using for Google Talk. This doesn't actually do anything at all. There's no code in the Jabber plugin yet to use this API (although it Works For Me). All it will do is compile and link. If you're lucky. To build this, you should install oRTP from Linphone, Speex and iLBC (also from linphone, I believe). To not build this, ./configure --disable-vv. Most of the configure.ac and Makefile.am hackery was lifted right out of Linphone with a few modifications. It seems to work if you have everything installed or if you --disable-vv. I haven't really tested not having everything installed and not --disabling-vv. It's kinda funky to include all of mediastreamer in the source tree like this, but linphone doesn't build it as a separate library. I'll probably wind up writing them a patch to build it as a .so so we can link it dynamically instead. This code certainly isn't finished. It'll adapt as I progress on the Google code, but it's certainly of more use here in CVS than in my personal tree. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 09 Nov 2005 08:07:20 +0000
parents
children fc464a0abccc
comparison
equal deleted inserted replaced
12023:80faf1ca5280 12024:e67993da8a22
1 /*
2 The mediastreamer library aims at providing modular media processing and I/O
3 for linphone, but also for any telephony application.
4 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21
22 #ifndef MSBUFFER_H
23 #define MSBUFFER_H
24 #include <config.h>
25
26 #ifdef HAVE_GLIB
27 #include <glib.h>
28 #else
29 #include <uglib.h>
30 #endif
31
32
33 #define MS_BUFFER_LARGE 4092
34
35
36 typedef struct _MSBuffer
37 {
38 gchar *buffer;
39 guint32 size;
40 guint16 ref_count;
41 guint16 flags;
42 #define MS_BUFFER_CONTIGUOUS (1)
43 }MSBuffer;
44
45 MSBuffer * ms_buffer_new(guint32 size);
46 void ms_buffer_destroy(MSBuffer *buf);
47
48 struct _MSMessage
49 {
50 MSBuffer *buffer; /* points to a MSBuffer */
51 void *data; /*points to buffer->buffer */
52 guint32 size; /* the size of the buffer to read in data. It may not be the
53 physical size (I mean buffer->buffer->size */
54 struct _MSMessage *next;
55 struct _MSMessage *prev; /* MSMessage are queued into MSQueues */
56 };
57
58 typedef struct _MSMessage MSMessage;
59
60
61 MSBuffer *ms_buffer_alloc(gint flags);
62 MSMessage *ms_message_new(gint size);
63
64 #define ms_message_set_buf(m,b) do { (b)->ref_count++; (m)->buffer=(b); (m)->data=(b)->buffer; (m)->size=(b)->size; }while(0)
65 #define ms_message_unset_buf(m) do { (m)->buffer->ref_count--; (m)->buffer=NULL; (m)->size=0; (m)->data=NULL; } while(0)
66
67 #define ms_message_size(m) (m)->size
68 void ms_message_destroy(MSMessage *m);
69
70 MSMessage * ms_message_dup(MSMessage *m);
71
72 /* allocate a single message without buffer */
73 MSMessage *ms_message_alloc();
74
75 #endif