From f5ca7cbda0e310413076dd3323a66da803e2b32c Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 19 Feb 2006 02:24:27 +0000 Subject: Fixing Makefiles for the new pjmedia-codec and pjsip-simple libraries git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@198 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-codec/gsm.c | 6 +- pjmedia/src/pjmedia-codec/gsm/config.h | 18 +++--- pjmedia/src/pjmedia-codec/pjmedia-codec-lib.c | 81 +++++++++++++++++++++++++++ pjmedia/src/pjmedia-codec/pjmedia-codec.c | 81 --------------------------- 4 files changed, 94 insertions(+), 92 deletions(-) create mode 100644 pjmedia/src/pjmedia-codec/pjmedia-codec-lib.c delete mode 100644 pjmedia/src/pjmedia-codec/pjmedia-codec.c (limited to 'pjmedia/src/pjmedia-codec') diff --git a/pjmedia/src/pjmedia-codec/gsm.c b/pjmedia/src/pjmedia-codec/gsm.c index cc41612a..3ef6dac4 100644 --- a/pjmedia/src/pjmedia-codec/gsm.c +++ b/pjmedia/src/pjmedia-codec/gsm.c @@ -280,6 +280,8 @@ static pj_status_t gsm_alloc_codec( pjmedia_codec_factory *factory, codec = pj_pool_zalloc(gsm_codec_factory.pool, sizeof(pjmedia_codec)); PJ_ASSERT_RETURN(codec != NULL, PJ_ENOMEM); + codec->op = &gsm_op; + codec->factory = factory; } pj_mutex_unlock(gsm_codec_factory.mutex); @@ -413,7 +415,7 @@ static pj_status_t gsm_codec_encode( pjmedia_codec *codec, if (input->size < 320) return PJMEDIA_CODEC_EPCMTOOSHORT; - gsm_encode(codec->codec_data, (const short*)input->buf, + gsm_encode(codec->codec_data, (short*)input->buf, (unsigned char*)output->buf); output->size = 33; @@ -440,7 +442,7 @@ static pj_status_t gsm_codec_decode( pjmedia_codec *codec, return PJMEDIA_CODEC_EFRMTOOSHORT; gsm_decode(codec->codec_data, - (const unsigned char*)input->buf, + (unsigned char*)input->buf, (short*)output->buf); output->size = 320; diff --git a/pjmedia/src/pjmedia-codec/gsm/config.h b/pjmedia/src/pjmedia-codec/gsm/config.h index cea29465..c31d5141 100644 --- a/pjmedia/src/pjmedia-codec/gsm/config.h +++ b/pjmedia/src/pjmedia-codec/gsm/config.h @@ -9,30 +9,30 @@ #ifndef CONFIG_H #define CONFIG_H -/*efine SIGHANDLER_T int /* signal handlers are void */ -/*efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */ +/*efine SIGHANDLER_T int //* signal handlers are void */ +/*efine HAS_SYSV_SIGNAL 1 //* sigs not blocked/reset? */ #define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ -/*efine HAS_LIMITS_H 1 /* /usr/include/limits.h */ +/*efine HAS_LIMITS_H 1 //* /usr/include/limits.h */ #define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ -/*efine HAS_ERRNO_DECL 1 /* errno.h declares errno */ +/*efine HAS_ERRNO_DECL 1 //* errno.h declares errno */ #define HAS_FSTAT 1 /* fstat syscall */ #define HAS_FCHMOD 1 /* fchmod syscall */ #define HAS_CHMOD 1 /* chmod syscall */ #define HAS_FCHOWN 1 /* fchown syscall */ #define HAS_CHOWN 1 /* chown syscall */ -/*efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */ +/*efine HAS__FSETMODE 1 //* _fsetmode -- set file mode */ #define HAS_STRING_H 1 /* /usr/include/string.h */ -/*efine HAS_STRINGS_H 1 /* /usr/include/strings.h */ +/*efine HAS_STRINGS_H 1 //* /usr/include/strings.h */ #define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ #define HAS_UTIME 1 /* POSIX utime(path, times) */ -/*efine HAS_UTIMES 1 /* use utimes() syscall instead */ +/*efine HAS_UTIMES 1 //* use utimes() syscall instead */ #define HAS_UTIME_H 1 /* UTIME header file */ -/*efine HAS_UTIMBUF 1 /* struct utimbuf */ -/*efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */ +/*efine HAS_UTIMBUF 1 //* struct utimbuf */ +/*efine HAS_UTIMEUSEC 1 //* microseconds in utimbuf? */ #endif /* CONFIG_H */ diff --git a/pjmedia/src/pjmedia-codec/pjmedia-codec-lib.c b/pjmedia/src/pjmedia-codec/pjmedia-codec-lib.c new file mode 100644 index 00000000..25a3028d --- /dev/null +++ b/pjmedia/src/pjmedia-codec/pjmedia-codec-lib.c @@ -0,0 +1,81 @@ +/* $Id$ */ +/* + * Copyright (C)2003-2006 Benny Prijono + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include + +/* Include factories: */ +#include +#include + + +static pjmedia_endpt *the_endpt; +static struct codec_list +{ + pj_status_t (*init)(pjmedia_endpt*); + pj_status_t (*deinit)(void); +} codec_list[] = +{ + +#if PJMEDIA_CODEC_HAS_GSM + { &pjmedia_codec_gsm_init, &pjmedia_codec_gsm_deinit}, +#endif + + { NULL, NULL } +}; + +/* + * Initialize pjmedia-codec library, and register all codec factories + * in this library. + */ +PJ_DEF(pj_status_t) pjmedia_codec_init(pjmedia_endpt *endpt) +{ + pj_status_t status; + unsigned i; + + the_endpt = endpt; + + for (i=0; codec_list[i].init; ++i) { + status = (*codec_list[i].init)(the_endpt); + if (status != PJ_SUCCESS) + return status; + } + return PJ_SUCCESS; +} + + +/* + * Deinitialize pjmedia-codec library, and unregister all codec factories + * in this library. + */ +PJ_DEF(pj_status_t) pjmedia_codec_deinit(void) +{ + pj_status_t status; + unsigned i; + + for (i=0; codec_list[i].init; ++i) { + status = (*codec_list[i].deinit)(); + if (status != PJ_SUCCESS) + return status; + } + + return PJ_SUCCESS; +} + + + + diff --git a/pjmedia/src/pjmedia-codec/pjmedia-codec.c b/pjmedia/src/pjmedia-codec/pjmedia-codec.c deleted file mode 100644 index 25a3028d..00000000 --- a/pjmedia/src/pjmedia-codec/pjmedia-codec.c +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id$ */ -/* - * Copyright (C)2003-2006 Benny Prijono - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include - -/* Include factories: */ -#include -#include - - -static pjmedia_endpt *the_endpt; -static struct codec_list -{ - pj_status_t (*init)(pjmedia_endpt*); - pj_status_t (*deinit)(void); -} codec_list[] = -{ - -#if PJMEDIA_CODEC_HAS_GSM - { &pjmedia_codec_gsm_init, &pjmedia_codec_gsm_deinit}, -#endif - - { NULL, NULL } -}; - -/* - * Initialize pjmedia-codec library, and register all codec factories - * in this library. - */ -PJ_DEF(pj_status_t) pjmedia_codec_init(pjmedia_endpt *endpt) -{ - pj_status_t status; - unsigned i; - - the_endpt = endpt; - - for (i=0; codec_list[i].init; ++i) { - status = (*codec_list[i].init)(the_endpt); - if (status != PJ_SUCCESS) - return status; - } - return PJ_SUCCESS; -} - - -/* - * Deinitialize pjmedia-codec library, and unregister all codec factories - * in this library. - */ -PJ_DEF(pj_status_t) pjmedia_codec_deinit(void) -{ - pj_status_t status; - unsigned i; - - for (i=0; codec_list[i].init; ++i) { - status = (*codec_list[i].deinit)(); - if (status != PJ_SUCCESS) - return status; - } - - return PJ_SUCCESS; -} - - - - -- cgit v1.2.3