diff options
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia-codec.h | 51 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/config.h | 34 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/gsm.h | 52 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/types.h | 25 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/codec.h | 36 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/endpoint.h | 9 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/errno.h | 20 |
7 files changed, 227 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia-codec.h b/pjmedia/include/pjmedia-codec.h new file mode 100644 index 00000000..f39048c7 --- /dev/null +++ b/pjmedia/include/pjmedia-codec.h @@ -0,0 +1,51 @@ +/* $Id$ */ +/* + * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> + * + * 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 + */ +#ifndef __PJMEDIA_CODEC1_H__ +#define __PJMEDIA_CODEC1_H__ + +#include <pjmedia-codec/types.h> + +PJ_BEGIN_DECL + + +/** + * Initialize pjmedia-codec library, and register all codec factories + * in this library. + * + * @param endpt The pjmedia endpoint. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_init(pjmedia_endpt *endpt); + + +/** + * Deinitialize pjmedia-codec library, and unregister all codec factories + * in this library. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_deinit(void); + + +PJ_END_DECL + + +#endif /* __PJMEDIA_CODEC_H__ */ + diff --git a/pjmedia/include/pjmedia-codec/config.h b/pjmedia/include/pjmedia-codec/config.h new file mode 100644 index 00000000..4c2bce2d --- /dev/null +++ b/pjmedia/include/pjmedia-codec/config.h @@ -0,0 +1,34 @@ +/* $Id$ */ +/* + * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> + * + * 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 + */ +#ifndef __PJMEDIA_CODEC_CONFIG_H__ +#define __PJMEDIA_CODEC_CONFIG_H__ + +#include <pjmedia/types.h> + + +/* + * Include GSM codec? + */ +#ifndef PJMEDIA_CODEC_HAS_GSM +# define PJMEDIA_CODEC_HAS_GSM 1 +#endif + + + +#endif /* __PJMEDIA_CODEC_CONFIG_H__ */ diff --git a/pjmedia/include/pjmedia-codec/gsm.h b/pjmedia/include/pjmedia-codec/gsm.h new file mode 100644 index 00000000..abcc9fbb --- /dev/null +++ b/pjmedia/include/pjmedia-codec/gsm.h @@ -0,0 +1,52 @@ +/* $Id$ */ +/* + * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> + * + * 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 + */ +#ifndef __PJMEDIA_CODEC_GSM_H__ +#define __PJMEDIA_CODEC_GSM_H__ + +#include <pjmedia-codec/types.h> + + +PJ_BEGIN_DECL + + +/** + * Initialize and register GSM codec factory to pjmedia endpoint. + * + * @param endpt The pjmedia endpoint. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_gsm_init( pjmedia_endpt *endpt ); + + + +/** + * Unregister GSM codec factory from pjmedia endpoint and deinitialize + * the GSM codec library. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_gsm_deinit(void); + + +PJ_END_DECL + + +#endif /* __PJMEDIA_CODEC_GSM_H__ */ + diff --git a/pjmedia/include/pjmedia-codec/types.h b/pjmedia/include/pjmedia-codec/types.h new file mode 100644 index 00000000..ce5c258c --- /dev/null +++ b/pjmedia/include/pjmedia-codec/types.h @@ -0,0 +1,25 @@ +/* $Id$ */ +/* + * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> + * + * 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 + */ +#ifndef __PJMEDIA_CODEC_TYPES_H__ +#define __PJMEDIA_CODEC_TYPES_H__ + +#include <pjmedia/types.h> + + +#endif /* __PJMEDIA_CODEC_TYPES_H__ */ diff --git a/pjmedia/include/pjmedia/codec.h b/pjmedia/include/pjmedia/codec.h index f10e9ab5..ade7ef46 100644 --- a/pjmedia/include/pjmedia/codec.h +++ b/pjmedia/include/pjmedia/codec.h @@ -182,6 +182,27 @@ struct pjmedia_codec_op pj_status_t (*close)(pjmedia_codec *codec); + /** + * Instruct the codec to inspect the specified payload/packet and + * split the packet info individual frames. + * + * @param codec The codec instance + * @param pkt The input packet. + * @param pkt_size Size of the packet. + * @param frame_cnt On input, specifies the maximum number of frames + * in the array. On output, the codec must fill + * with number of frames detected in the packet. + * @param frames On output, specifies the frames that have been + * detected in the packet. + * + * @return PJ_SUCCESS on success. + */ + pj_status_t (*get_frames)(pjmedia_codec *codec, + void *pkt, + pj_size_t pkt_size, + unsigned *frame_cnt, + pjmedia_frame frames[]); + /** * Instruct the codec to encode the specified input frame. * @@ -399,6 +420,21 @@ PJ_DECL(pj_status_t) pjmedia_codec_mgr_enum_codecs( pjmedia_codec_mgr *mgr, pjmedia_codec_info info[]); /** + * Get default codec param for the specified codec info. + * + * @param mgr The codec manager. + * @param info The codec info, which default parameter's is being + * queried. + * @param param On return, will be filled with the default codec + * parameter. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_mgr_get_default_param(pjmedia_codec_mgr *mgr, + const pjmedia_codec_info *info, + pjmedia_codec_param *param ); + +/** * Request the codec manager to allocate one instance of codec with the * specified codec info. The codec will enumerate all codec factories * until it finds factory that is able to create the specified codec. diff --git a/pjmedia/include/pjmedia/endpoint.h b/pjmedia/include/pjmedia/endpoint.h index 27e8f4bf..da3dbdb8 100644 --- a/pjmedia/include/pjmedia/endpoint.h +++ b/pjmedia/include/pjmedia/endpoint.h @@ -118,6 +118,15 @@ PJ_DECL(pj_status_t) pjmedia_endpt_create_sdp( pjmedia_endpt *endpt, pjmedia_sdp_session **p_sdp ); +/** + * Dump media endpoint capabilities. + * + * @param endpt The media endpoint. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt); + PJ_END_DECL diff --git a/pjmedia/include/pjmedia/errno.h b/pjmedia/include/pjmedia/errno.h index 8e5479aa..28cad73e 100644 --- a/pjmedia/include/pjmedia/errno.h +++ b/pjmedia/include/pjmedia/errno.h @@ -248,6 +248,21 @@ PJ_BEGIN_DECL * Unsupported codec. */ #define PJMEDIA_CODEC_EUNSUP (PJMEDIA_ERRNO_START+80) /* 220080 */ +/** + * @hideinitializer + * Unable to create codec. + */ +#define PJMEDIA_CODEC_EFAILED (PJMEDIA_ERRNO_START+81) /* 220081 */ +/** + * @hideinitializer + * Codec frame is too short. + */ +#define PJMEDIA_CODEC_EFRMTOOSHORT (PJMEDIA_ERRNO_START+82) /* 220082 */ +/** + * @hideinitializer + * PCM buffer is too short. + */ +#define PJMEDIA_CODEC_EPCMTOOSHORT (PJMEDIA_ERRNO_START+83) /* 220083 */ /************************************************************ @@ -273,6 +288,11 @@ PJ_BEGIN_DECL * Missing rtpmap. */ #define PJMEDIA_EMISSINGRTPMAP (PJMEDIA_ERRNO_START+103) /* 220103 */ +/** + * @hideinitializer + * Invalid media type. + */ +#define PJMEDIA_EINVALIMEDIATYPE (PJMEDIA_ERRNO_START+104) /* 220104 */ |