initial commit
This commit is contained in:
commit
636959b37b
2474 files changed
+1343178
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,61 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_AMR_SDP_MATCH_H__
|
||||
#define __PJMEDIA_CODEC_AMR_SDP_MATCH_H__
|
||||
|
||||
|
||||
/**
|
||||
* @file g7221_sdp_match.h
|
||||
* @brief Special SDP format match for AMR-NB and AMR-WB.
|
||||
*/
|
||||
|
||||
#include <pjmedia/sdp_neg.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/* Match AMR-NB and AMR-WB format in the SDP media offer and answer. This
|
||||
* function will match some AMR settings in the SDP format parameters, i.e:
|
||||
* octet-align, crc, robust-sorting, interleaving. Note that, for answerer,
|
||||
* if octet-align mode needs to be adaptable to offerer setting, application
|
||||
* should set #PJMEDIA_SDP_NEG_FMT_MATCH_ALLOW_MODIFY_ANSWER in the option.
|
||||
*
|
||||
* @param pool The memory pool.
|
||||
* @param offer The SDP media offer.
|
||||
* @param o_fmt_idx Index of the AMR format in the SDP media offer.
|
||||
* @param answer The SDP media answer.
|
||||
* @param a_fmt_idx Index of the AMR format in the SDP media answer.
|
||||
* @param option The format matching option, see
|
||||
* #pjmedia_sdp_neg_fmt_match_flag.
|
||||
*
|
||||
* @return PJ_SUCCESS when the formats in offer and answer match.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_amr_match_sdp( pj_pool_t *pool,
|
||||
pjmedia_sdp_media *offer,
|
||||
unsigned o_fmt_idx,
|
||||
pjmedia_sdp_media *answer,
|
||||
unsigned a_fmt_idx,
|
||||
unsigned option);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_AMR_SDP_MATCH_H__ */
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright (C)2020 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_AND_AUD_MEDIACODEC_H__
|
||||
#define __PJMEDIA_CODEC_AND_AUD_MEDIACODEC_H__
|
||||
|
||||
/**
|
||||
* @file and_aud_mediacodec.h
|
||||
* @brief Android audio MediaCodec codecs.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_AUD_MEDIACODEC Audio MediaCodec Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @{
|
||||
*
|
||||
* Audio MediaCodec codec wrapper for Android.
|
||||
*
|
||||
* This codec wrapper contains varius codecs: i.e: AMR and AMR-WB.
|
||||
*
|
||||
* \section pjmedia_codec_mediacodec_AMR MediaCodec AMRNB/AMR-WB
|
||||
*
|
||||
* MediaCodec AMR supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* 20ms frame length and producing various bitrates that ranges from 4.75kbps
|
||||
* to 12.2kbps.
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
* Note that MediaCodec doesn't provide internal VAD/PLC feature, they will be
|
||||
* provided by PJMEDIA instead.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* By default, encoding bitrate is 7400bps. This default setting can be
|
||||
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
|
||||
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
|
||||
* #pjmedia_codec_param. Valid bitrates could be seen in
|
||||
* #pjmedia_codec_amrnb_bitrates.
|
||||
*
|
||||
* \subsubsection payload_format Payload Format
|
||||
*
|
||||
* There are two AMR payload format types, bandwidth-efficient and
|
||||
* octet-aligned. Default setting is using octet-aligned. This default payload
|
||||
* format can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, payload format can be set by specifying SDP
|
||||
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
|
||||
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
|
||||
* and "1" (for octet-aligned mode).
|
||||
*
|
||||
* \subsubsection mode_set Mode-Set
|
||||
*
|
||||
* Mode-set is used for restricting AMR modes in decoding direction.
|
||||
*
|
||||
* By default, no mode-set restriction applied. This default setting can be
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, mode-set could be specified via format parameters
|
||||
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
|
||||
* value is a comma separated list of modes from the set 0 - 7, e.g:
|
||||
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
|
||||
*
|
||||
* Here is an example of modifying AMR default codec param:
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// set default encoding bitrate to the highest 12.2kbps
|
||||
param.info.avg_bps = 12200;
|
||||
|
||||
// restrict decoding bitrate to 10.2kbps and 12.2kbps only
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("mode-set");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("6,7");
|
||||
|
||||
// also set to use bandwidth-efficient payload format
|
||||
param.setting.dec_fmtp.param[1].name = pj_str("octet-align");
|
||||
param.setting.dec_fmtp.param[1].val = pj_str("0");
|
||||
|
||||
param.setting.dec_fmtp.cnt = 2;
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Initialize and register Android audio MediaCodec factory to pjmedia
|
||||
* endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_and_media_aud_init( pjmedia_endpt *endpt );
|
||||
|
||||
/**
|
||||
* Unregister Android audio MediaCodec factory from pjmedia endpoint
|
||||
* and deinitialize the codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_and_media_aud_deinit( void );
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_AND_AUD_MEDIACODEC_H__ */
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright (C)2020 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_AND_VID_MEDIACODEC_H__
|
||||
#define __PJMEDIA_CODEC_AND_VID_MEDIACODEC_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
#include <pjmedia/vid_codec.h>
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/and_vid_mediacodec.h
|
||||
* @brief Android video Mediacodec codecs.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_HAS_ANDROID_MEDIACODEC Android Mediacodec Codec
|
||||
* @ingroup PJMEDIA_CODEC_VID_CODECS
|
||||
* @{
|
||||
*
|
||||
*
|
||||
* Video MediaCodec codec wrapper for Android.
|
||||
*
|
||||
* This codec wrapper contains varius codecs: i.e: H.264/AVC, VP8 and VP9.
|
||||
* The H.264 codec wrapper only supports non-interleaved packetization
|
||||
* mode. If remote uses a different mode (e.g: single-nal), this will cause
|
||||
* unpacketization issue and affect decoding process.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialize and register Android Mediacodec video codec factory.
|
||||
*
|
||||
* @param mgr The video codec manager instance where this codec will
|
||||
* be registered to. Specify NULL to use default instance
|
||||
* (in that case, an instance of video codec manager must
|
||||
* have been created beforehand).
|
||||
* @param pf Pool factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_and_media_vid_init(
|
||||
pjmedia_vid_codec_mgr *mgr,
|
||||
pj_pool_factory *pf);
|
||||
|
||||
/**
|
||||
* Unregister Android Mediacodec video codecs factory from the video codec
|
||||
* manager and deinitialize the codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_and_media_vid_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_AND_VID_MEDIACODEC_H__ */
|
||||
@@ -0,0 +1,98 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_ALL_CODECS_H__
|
||||
#define __PJMEDIA_CODEC_ALL_CODECS_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/all_codecs.h
|
||||
* @brief Helper function to register all codecs
|
||||
*/
|
||||
#include <pjmedia/endpoint.h>
|
||||
#include <pjmedia-codec/passthrough.h>
|
||||
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_REGISTER_ALL Codec registration helper
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Helper function to register all codecs
|
||||
* @{
|
||||
*
|
||||
* Helper function to register all codecs that are implemented in
|
||||
* PJMEDIA-CODEC library.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Codec configuration. Call #pjmedia_audio_codec_config_default() to initialize
|
||||
* this structure with the default values.
|
||||
*/
|
||||
typedef struct pjmedia_audio_codec_config
|
||||
{
|
||||
/** Speex codec settings. See #pjmedia_codec_speex_init() for more info */
|
||||
struct {
|
||||
unsigned option; /**< Bitmask of options. */
|
||||
int quality; /**< Codec quality. */
|
||||
int complexity; /**< Codec complexity. */
|
||||
} speex;
|
||||
|
||||
/** iLBC settings */
|
||||
struct {
|
||||
unsigned mode; /**< iLBC mode. */
|
||||
} ilbc;
|
||||
|
||||
/** Passthrough */
|
||||
struct {
|
||||
pjmedia_codec_passthrough_setting setting; /**< Passthrough */
|
||||
} passthrough;
|
||||
|
||||
} pjmedia_audio_codec_config;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize pjmedia_audio_codec_config structure with default values.
|
||||
*
|
||||
* @param cfg The codec config to be initialized.
|
||||
*/
|
||||
PJ_DECL(void)
|
||||
pjmedia_audio_codec_config_default(pjmedia_audio_codec_config *cfg);
|
||||
|
||||
/**
|
||||
* Register all known audio codecs implemented in PJMEDA-CODEC library to the
|
||||
* specified media endpoint.
|
||||
*
|
||||
* @param endpt The media endpoint.
|
||||
* @param c Optional codec configuration, or NULL to use default
|
||||
* values.
|
||||
*
|
||||
* @return PJ_SUCCESS on success or the appropriate error code.
|
||||
*/
|
||||
PJ_DECL(pj_status_t)
|
||||
pjmedia_codec_register_audio_codecs(pjmedia_endpt *endpt,
|
||||
const pjmedia_audio_codec_config *c);
|
||||
|
||||
|
||||
/**
|
||||
* @} PJMEDIA_CODEC_REGISTER_ALL
|
||||
*/
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_ALL_CODECS_H__ */
|
||||
@@ -0,0 +1,121 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2017 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_BCG729_H__
|
||||
#define __PJMEDIA_CODEC_BCG729_H__
|
||||
|
||||
/**
|
||||
* @file bcg729.h
|
||||
* @brief BCG729 codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_BCG729 BCG729 Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of BCG729 codecs.
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register BCG729 codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* This codec factory contains G.729 codec.
|
||||
*
|
||||
* \section pjmedia_codec_bcg729 BCG729
|
||||
*
|
||||
* BCG729 is compliant with ITU-T G.729 and Annexes A, B specifications.
|
||||
*
|
||||
* BCGG729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* frame length 10ms, and resulting in bitrate 8000bps.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* Note that G.729 VAD status should be signalled in SDP, see more
|
||||
* description below.
|
||||
*
|
||||
* \subsubsection annexb Annex B
|
||||
*
|
||||
* The capability of VAD/DTX is specified in Annex B.
|
||||
*
|
||||
* By default, Annex B is enabled. This default setting of Annex B can
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, Annex B is configured via VAD setting and
|
||||
* format parameter "annexb" in the SDP "a=fmtp" attribute in
|
||||
* decoding fmtp field. Valid values are "yes" and "no",
|
||||
* the implementation default is "yes". When this parameter is omitted
|
||||
* in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
|
||||
*
|
||||
* Here is an example of modifying default setting of Annex B to
|
||||
* be disabled using #pjmedia_codec_mgr_set_default_param():
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// Set VAD
|
||||
param.setting.vad = 0;
|
||||
// Set SDP format parameter
|
||||
param.setting.dec_fmtp.cnt = 1;
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("annexb");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("no");
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*
|
||||
* \note
|
||||
* The difference of Annex B status in SDP offer/answer may be considered as
|
||||
* incompatible codec in SDP negotiation.
|
||||
*
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Initialize and register BCG729 codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_bcg729_init(pjmedia_endpt *endpt);
|
||||
|
||||
/**
|
||||
* Unregister BCG729 codec factory from pjmedia endpoint and deinitialize
|
||||
* the BCG729 codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_bcg729_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_BCG729_H__ */
|
||||
|
||||
@@ -0,0 +1,690 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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__
|
||||
|
||||
/**
|
||||
* @file config.h
|
||||
* @brief PJMEDIA-CODEC compile time settings
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup pjmedia_codec_config PJMEDIA-CODEC Compile Time Settings
|
||||
* @ingroup PJMEDIA_CODEC
|
||||
* @brief Various compile time settings such as to enable/disable codecs
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <pjmedia/types.h>
|
||||
|
||||
/*
|
||||
* Include config_auto.h if autoconf is used (PJ_AUTOCONF is set)
|
||||
*/
|
||||
#if defined(PJ_AUTOCONF)
|
||||
# include <pjmedia-codec/config_auto.h>
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Unless specified otherwise, L16 codec is included by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_L16_CODEC
|
||||
# define PJMEDIA_HAS_L16_CODEC 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 8KHz, mono. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_8KHZ_MONO
|
||||
# define PJMEDIA_CODEC_L16_HAS_8KHZ_MONO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 8KHz, stereo. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_8KHZ_STEREO
|
||||
# define PJMEDIA_CODEC_L16_HAS_8KHZ_STEREO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 16KHz, mono. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_16KHZ_MONO
|
||||
# define PJMEDIA_CODEC_L16_HAS_16KHZ_MONO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 16KHz, stereo. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_16KHZ_STEREO
|
||||
# define PJMEDIA_CODEC_L16_HAS_16KHZ_STEREO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 48KHz, mono. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_48KHZ_MONO
|
||||
# define PJMEDIA_CODEC_L16_HAS_48KHZ_MONO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Settings to enable L16 codec 48KHz, stereo. By default it is disabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_L16_HAS_48KHZ_STEREO
|
||||
# define PJMEDIA_CODEC_L16_HAS_48KHZ_STEREO 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Unless specified otherwise, GSM codec is included by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_GSM_CODEC
|
||||
# define PJMEDIA_HAS_GSM_CODEC 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Unless specified otherwise, Speex codec is included by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_SPEEX_CODEC
|
||||
# define PJMEDIA_HAS_SPEEX_CODEC 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Speex codec default complexity setting.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY
|
||||
# define PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Speex codec default quality setting. Please note that pjsua-lib may override
|
||||
* this setting via its codec quality setting (i.e PJSUA_DEFAULT_CODEC_QUALITY).
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY
|
||||
# define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 8
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Unless specified otherwise, iLBC codec is included by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_ILBC_CODEC
|
||||
# define PJMEDIA_HAS_ILBC_CODEC 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Unless specified otherwise, G.722 codec is included by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_G722_CODEC
|
||||
# define PJMEDIA_HAS_G722_CODEC 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initial memory block for G.722 codec implementation.
|
||||
*/
|
||||
#ifndef PJMEDIA_POOL_LEN_G722_CODEC
|
||||
# define PJMEDIA_POOL_LEN_G722_CODEC 1000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Memory increment for G.722 codec implementation.
|
||||
*/
|
||||
#ifndef PJMEDIA_POOL_INC_G722_CODEC
|
||||
# define PJMEDIA_POOL_INC_G722_CODEC 1000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Default G.722 codec encoder and decoder level adjustment. The G.722
|
||||
* specifies that it uses 14 bit PCM for input and output, while PJMEDIA
|
||||
* normally uses 16 bit PCM, so the conversion is done by applying
|
||||
* level adjustment. If the value is non-zero, then PCM input samples to
|
||||
* the encoder will be shifted right by this value, and similarly PCM
|
||||
* output samples from the decoder will be shifted left by this value.
|
||||
*
|
||||
* This can be changed at run-time after initialization by calling
|
||||
* #pjmedia_codec_g722_set_pcm_shift().
|
||||
*
|
||||
* Default: 2.
|
||||
*/
|
||||
#ifndef PJMEDIA_G722_DEFAULT_PCM_SHIFT
|
||||
# define PJMEDIA_G722_DEFAULT_PCM_SHIFT 2
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Specifies whether G.722 PCM shifting should be stopped when clipping
|
||||
* detected in the decoder. Enabling this feature can be useful when
|
||||
* talking to G.722 implementation that uses 16 bit PCM for G.722 input/
|
||||
* output (for any reason it seems to work) and the PCM shifting causes
|
||||
* audio clipping.
|
||||
*
|
||||
* See also #PJMEDIA_G722_DEFAULT_PCM_SHIFT.
|
||||
*
|
||||
* Default: enabled.
|
||||
*/
|
||||
#ifndef PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING
|
||||
# define PJMEDIA_G722_STOP_PCM_SHIFT_ON_CLIPPING 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable the features provided by Intel IPP libraries, for example
|
||||
* codecs such as G.729, G.723.1, G.726, G.728, G.722.1, and AMR.
|
||||
*
|
||||
* By default this is disabled. Please follow the instructions in
|
||||
* http://trac.pjsip.org/repos/wiki/Intel_IPP_Codecs on how to setup
|
||||
* Intel IPP with PJMEDIA.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP
|
||||
# define PJMEDIA_HAS_INTEL_IPP 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Visual Studio only: when this option is set, the Intel IPP libraries
|
||||
* will be automatically linked to application using pragma(comment)
|
||||
* constructs. This is convenient, however it will only link with
|
||||
* the stub libraries and the Intel IPP DLL's will be required when
|
||||
* distributing the application.
|
||||
*
|
||||
* If application wants to link with the different types of the Intel IPP
|
||||
* libraries (for example, the static libraries), it must set this option
|
||||
* to zero and specify the Intel IPP libraries in the application's input
|
||||
* library specification manually.
|
||||
*
|
||||
* Default 1.
|
||||
*/
|
||||
#ifndef PJMEDIA_AUTO_LINK_IPP_LIBS
|
||||
# define PJMEDIA_AUTO_LINK_IPP_LIBS 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB
|
||||
* codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP
|
||||
* is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_AMR 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR
|
||||
* option must also be enabled to use this codec. This option is only used
|
||||
* when PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_AMRWB 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP G.729 codec. This option is only used when
|
||||
* PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G729
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_G729 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP G.723.1 codec. This option is only used when
|
||||
* PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_G723_1 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP G.726 codec. This option is only used when
|
||||
* PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G726
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_G726 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP G.728 codec. This option is only used when
|
||||
* PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G728
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_G728 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable Intel IPP G.722.1 codec. This option is only used when
|
||||
* PJMEDIA_HAS_INTEL_IPP is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1
|
||||
# define PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Passthrough codecs.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODECS
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODECS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable AMR passthrough codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable G.729 passthrough codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable iLBC passthrough codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable PCMU passthrough codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable PCMA passthrough codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA
|
||||
# define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
|
||||
#endif
|
||||
|
||||
/* If passthrough and PCMU/PCMA are enabled, disable the software
|
||||
* G.711 codec
|
||||
*/
|
||||
#if PJMEDIA_HAS_PASSTHROUGH_CODECS && \
|
||||
(PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU || PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA)
|
||||
# undef PJMEDIA_HAS_G711_CODEC
|
||||
# define PJMEDIA_HAS_G711_CODEC 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* G.722.1 codec is disabled by default.
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_G7221_CODEC
|
||||
# define PJMEDIA_HAS_G7221_CODEC 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable OpenCORE AMR-NB codec.
|
||||
* See https://trac.pjsip.org/repos/ticket/1388 for some info.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
|
||||
# define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable OpenCORE AMR-WB codec.
|
||||
* See https://trac.pjsip.org/repos/ticket/1608 for some info.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC
|
||||
# define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Link with libopencore-amrXX via pragma comment on Visual Studio.
|
||||
* This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC
|
||||
* is enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS
|
||||
# define PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Link with libopencore-amrXX.a that has been produced with gcc.
|
||||
* This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC
|
||||
* and PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS are enabled.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC
|
||||
# define PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Default G.722.1 codec encoder and decoder level adjustment.
|
||||
* If the value is non-zero, then PCM input samples to the encoder will
|
||||
* be shifted right by this value, and similarly PCM output samples from
|
||||
* the decoder will be shifted left by this value.
|
||||
*
|
||||
* This can be changed at run-time after initialization by calling
|
||||
* #pjmedia_codec_g7221_set_pcm_shift().
|
||||
*/
|
||||
#ifndef PJMEDIA_G7221_DEFAULT_PCM_SHIFT
|
||||
# define PJMEDIA_G7221_DEFAULT_PCM_SHIFT 1
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP,
|
||||
* may cause problem in SDP, i.e: payload types duplications. So, let's
|
||||
* just trap such case here at compile time.
|
||||
*
|
||||
* Application can control which implementation to be used by manipulating
|
||||
* PJMEDIA_HAS_G7221_CODEC and PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in
|
||||
* config_site.h.
|
||||
*/
|
||||
#if (PJMEDIA_HAS_G7221_CODEC != 0) && (PJMEDIA_HAS_INTEL_IPP != 0) && \
|
||||
(PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 != 0)
|
||||
# error Only one G.722.1 implementation can be enabled at the same time. \
|
||||
Please use PJMEDIA_HAS_G7221_CODEC and \
|
||||
PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 in your config_site.h \
|
||||
to control which implementation to be used.
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable SILK codec.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_SILK_CODEC
|
||||
# define PJMEDIA_HAS_SILK_CODEC 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* SILK codec default complexity setting, valid values are 0 (lowest), 1,
|
||||
* and 2.
|
||||
*
|
||||
* Default: 2
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY
|
||||
# define PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY 2
|
||||
#endif
|
||||
|
||||
/**
|
||||
* SILK codec default quality setting, valid values are ranging from
|
||||
* 0 (lowest) to 10. Please note that pjsua-lib may override this setting
|
||||
* via its codec quality setting (i.e PJSUA_DEFAULT_CODEC_QUALITY).
|
||||
*
|
||||
* Default: 10
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_SILK_DEFAULT_QUALITY
|
||||
# define PJMEDIA_CODEC_SILK_DEFAULT_QUALITY 10
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable OPUS codec.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_OPUS_CODEC
|
||||
# define PJMEDIA_HAS_OPUS_CODEC 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* OPUS codec sample rate.
|
||||
*
|
||||
* Default: 48000
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_OPUS_DEFAULT_SAMPLE_RATE
|
||||
# define PJMEDIA_CODEC_OPUS_DEFAULT_SAMPLE_RATE 48000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* OPUS codec default maximum average bit rate.
|
||||
*
|
||||
* Default: 0 (leave it to default value specified by Opus, which will
|
||||
* take into account factors such as media content (speech/music), sample
|
||||
* rate, channel count, etc).
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_OPUS_DEFAULT_BIT_RATE
|
||||
# define PJMEDIA_CODEC_OPUS_DEFAULT_BIT_RATE 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* OPUS default encoding complexity, which is an integer from
|
||||
* 0 to 10, where 0 is the lowest complexity and 10 is the highest.
|
||||
*
|
||||
* Default: 5
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_OPUS_DEFAULT_COMPLEXITY
|
||||
# define PJMEDIA_CODEC_OPUS_DEFAULT_COMPLEXITY 5
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* OPUS default CBR (constant bit rate) setting
|
||||
*
|
||||
* Default: PJ_FALSE (which means Opus will use VBR (variable bit rate))
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_OPUS_DEFAULT_CBR
|
||||
# define PJMEDIA_CODEC_OPUS_DEFAULT_CBR PJ_FALSE
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Enable G.729 codec using BCG729 backend.
|
||||
*
|
||||
* Default: 0
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_BCG729
|
||||
# define PJMEDIA_HAS_BCG729 0
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Specify if FFMPEG codecs are available.
|
||||
*
|
||||
* Default: PJMEDIA_HAS_LIBAVFORMAT
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_FFMPEG_CODEC
|
||||
# define PJMEDIA_HAS_FFMPEG_CODEC PJMEDIA_HAS_LIBAVFORMAT
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Specify if FFMPEG video codecs are available.
|
||||
*
|
||||
* Default: PJMEDIA_HAS_FFMPEG_CODEC
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_FFMPEG_VID_CODEC
|
||||
# define PJMEDIA_HAS_FFMPEG_VID_CODEC PJMEDIA_HAS_FFMPEG_CODEC
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable FFMPEG H263+/H263-1998 codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_FFMPEG_CODEC_H263P
|
||||
# define PJMEDIA_HAS_FFMPEG_CODEC_H263P PJMEDIA_HAS_FFMPEG_VID_CODEC
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable FFMPEG H264 codec (requires libx264).
|
||||
*
|
||||
* Default: disabled when OpenH264 is used, otherwise it is set to
|
||||
* PJMEDIA_HAS_FFMPEG_VID_CODEC
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_FFMPEG_CODEC_H264
|
||||
# if defined(PJMEDIA_HAS_OPENH264_CODEC) && PJMEDIA_HAS_OPENH264_CODEC != 0
|
||||
# define PJMEDIA_HAS_FFMPEG_CODEC_H264 0
|
||||
# else
|
||||
# define PJMEDIA_HAS_FFMPEG_CODEC_H264 PJMEDIA_HAS_FFMPEG_VID_CODEC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Determine the log level of the native openH264 log which will be forwarded
|
||||
* to the library's log.
|
||||
* Set to WELS_LOG_QUIET to disable logging, or WELS_LOG_DETAIL for debugging.
|
||||
*
|
||||
* Default: WELS_LOG_ERROR.
|
||||
*/
|
||||
#ifndef PJMEDIA_CODEC_OPENH264_LOG_LEVEL
|
||||
# define PJMEDIA_CODEC_OPENH264_LOG_LEVEL WELS_LOG_ERROR
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable VPX VP8 codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_VPX_CODEC_VP8
|
||||
# define PJMEDIA_HAS_VPX_CODEC_VP8 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable VPX VP9 codec.
|
||||
*
|
||||
* Default: 0 (disabled)
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_VPX_CODEC_VP9
|
||||
# define PJMEDIA_HAS_VPX_CODEC_VP9 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Android MediaCodec AMRNB codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_AND_MEDIA_AMRNB
|
||||
# define PJMEDIA_HAS_AND_MEDIA_AMRNB 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Android MediaCodec AMRWB codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_AND_MEDIA_AMRWB
|
||||
# define PJMEDIA_HAS_AND_MEDIA_AMRWB 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Android MediaCodec AVC/H264 codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_AND_MEDIA_H264
|
||||
# define PJMEDIA_HAS_AND_MEDIA_H264 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Android MediaCodec VP8 codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_AND_MEDIA_VP8
|
||||
# define PJMEDIA_HAS_AND_MEDIA_VP8 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Enable Android MediaCodec VP9 codec.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_HAS_AND_MEDIA_VP9
|
||||
# define PJMEDIA_HAS_AND_MEDIA_VP9 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Prioritize to use software video encoder on Android MediaCodec.
|
||||
* Set to 0 to prioritize Hardware encoder.
|
||||
* Note: based on test, software encoder configuration provided the most stable
|
||||
* configuration.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_AND_MEDIA_PRIO_SW_VID_ENC
|
||||
# define PJMEDIA_AND_MEDIA_PRIO_SW_VID_ENC 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Prioritize to use software video encoder on Android MediaCodec.
|
||||
* Set to 0 to prioritize Hardware encoder.
|
||||
* Note: based on test, software decoder configuration provided the most stable
|
||||
* configuration.
|
||||
*
|
||||
* Default: 1
|
||||
*/
|
||||
#ifndef PJMEDIA_AND_MEDIA_PRIO_SW_VID_DEC
|
||||
# define PJMEDIA_AND_MEDIA_PRIO_SW_VID_DEC 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_CONFIG_H__ */
|
||||
@@ -0,0 +1,104 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_AUTO_H_
|
||||
#define __PJMEDIA_CODEC_CONFIG_AUTO_H_
|
||||
|
||||
/**
|
||||
* @file config_auto.h
|
||||
* @brief PJMEDIA-CODEC configuration as set by autoconf script
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note:
|
||||
* The configuration in config_site.h overrides any other settings,
|
||||
* including the setting as detected by autoconf.
|
||||
*/
|
||||
|
||||
/* L16 codec */
|
||||
#ifndef PJMEDIA_HAS_L16_CODEC
|
||||
#undef PJMEDIA_HAS_L16_CODEC
|
||||
#endif
|
||||
|
||||
|
||||
/* GSM codec */
|
||||
#ifndef PJMEDIA_HAS_GSM_CODEC
|
||||
#undef PJMEDIA_HAS_GSM_CODEC
|
||||
#endif
|
||||
|
||||
#undef PJMEDIA_EXTERNAL_GSM_CODEC
|
||||
#undef PJMEDIA_EXTERNAL_GSM_GSM_H
|
||||
#undef PJMEDIA_EXTERNAL_GSM_H
|
||||
|
||||
/* Speex codec */
|
||||
#ifndef PJMEDIA_HAS_SPEEX_CODEC
|
||||
#undef PJMEDIA_HAS_SPEEX_CODEC
|
||||
#endif
|
||||
|
||||
#undef PJMEDIA_EXTERNAL_SPEEX_CODEC
|
||||
|
||||
/* iLBC codec */
|
||||
#ifndef PJMEDIA_HAS_ILBC_CODEC
|
||||
#undef PJMEDIA_HAS_ILBC_CODEC
|
||||
#endif
|
||||
|
||||
|
||||
/* G722 codec */
|
||||
#ifndef PJMEDIA_HAS_G722_CODEC
|
||||
#undef PJMEDIA_HAS_G722_CODEC
|
||||
#endif
|
||||
|
||||
/* G7221 codec */
|
||||
#ifndef PJMEDIA_HAS_G7221_CODEC
|
||||
#undef PJMEDIA_HAS_G7221_CODEC
|
||||
#endif
|
||||
|
||||
/* OpenCORE AMR-NB codec */
|
||||
#ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
|
||||
#undef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
|
||||
#endif
|
||||
|
||||
/* OpenCORE AMR-WB codec */
|
||||
#ifndef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC
|
||||
#undef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC
|
||||
#endif
|
||||
|
||||
/* SILK codec */
|
||||
#ifndef PJMEDIA_HAS_SILK_CODEC
|
||||
#undef PJMEDIA_HAS_SILK_CODEC
|
||||
#endif
|
||||
|
||||
/* OPUS codec */
|
||||
#ifndef PJMEDIA_HAS_OPUS_CODEC
|
||||
#undef PJMEDIA_HAS_OPUS_CODEC
|
||||
#endif
|
||||
|
||||
/* G.729 codec with BCG729 backend */
|
||||
#ifndef PJMEDIA_HAS_BCG729
|
||||
#undef PJMEDIA_HAS_BCG729
|
||||
#endif
|
||||
|
||||
/* Android MediCodec codecs */
|
||||
#ifndef PJMEDIA_HAS_ANDROID_MEDIACODEC
|
||||
#undef PJMEDIA_HAS_ANDROID_MEDIACODEC
|
||||
#endif
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_CODECS_FFMPEG_VID_H__
|
||||
#define __PJMEDIA_CODECS_FFMPEG_VID_H__
|
||||
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
#include <pjmedia/vid_codec.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_VID_FFMPEG FFmpeg Codecs
|
||||
* @ingroup PJMEDIA_CODEC_VID_CODECS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialize and register FFMPEG video codecs factory to pjmedia endpoint.
|
||||
*
|
||||
* @param mgr The video codec manager instance where this codec will
|
||||
* be registered to. Specify NULL to use default instance
|
||||
* (in that case, an instance of video codec manager must
|
||||
* have been created beforehand).
|
||||
* @param pf Pool factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ffmpeg_vid_init(pjmedia_vid_codec_mgr *mgr,
|
||||
pj_pool_factory *pf);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister FFMPEG video codecs factory from the video codec manager and
|
||||
* deinitialize the codecs library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ffmpeg_vid_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODECS_FFMPEG_VID_H__ */
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_G722_H__
|
||||
#define __PJMEDIA_CODEC_G722_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/g722.h
|
||||
* @brief G.722 codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_G722 G.722 Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of G.722 Codec
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register G.722 codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* The G.722 implementation uses 16-bit PCM with sampling rate 16000Hz and
|
||||
* 20ms frame length resulting in 64kbps bitrate.
|
||||
*
|
||||
* The G.722 codec implementation is provided as part of pjmedia-codec
|
||||
* library, and does not depend on external G.722 codec implementation.
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* Currently none.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register G.722 codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g722_init(pjmedia_endpt *endpt);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister G.722 codec factory from pjmedia endpoint and cleanup
|
||||
* resources allocated by the factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g722_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* Set the G.722 codec encoder and decoder level adjustment.
|
||||
* If the value is non-zero, then PCM input samples to the encoder will
|
||||
* be shifted right by this value, and similarly PCM output samples from
|
||||
* the decoder will be shifted left by this value.
|
||||
*
|
||||
* Default value is PJMEDIA_G722_DEFAULT_PCM_SHIFT.
|
||||
*
|
||||
* @param val The value
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g722_set_pcm_shift(unsigned val);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_G722_H__ */
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_CODECS_G7221_H__
|
||||
#define __PJMEDIA_CODECS_G7221_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/g7221.h
|
||||
* @brief G722.1 codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_G7221_CODEC G.722.1 Codec (Siren7/Siren14)
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of G.722.1 codec
|
||||
* @{
|
||||
*
|
||||
* <b>G.722.1 licensed from Polycom®</b><br />
|
||||
* <b>G.722.1 Annex C licensed from Polycom®</b>
|
||||
*
|
||||
* This section describes functions to initialize and register G.722.1 codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* PJMEDIA G722.1 codec implementation is based on ITU-T Recommendation
|
||||
* G.722.1 (05/2005) C fixed point implementation including its Annex C.
|
||||
*
|
||||
* G.722.1 is a low complexity codec that supports 7kHz and 14kHz audio
|
||||
* bandwidth working at bitrates ranging from 16kbps to 48kbps. It may be
|
||||
* used with speech or music inputs.
|
||||
*
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* The following settings are applicable for this codec.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* The codec implementation supports standard and non-standard bitrates.
|
||||
* Use #pjmedia_codec_g7221_set_mode() to enable or disable the bitrates.
|
||||
*
|
||||
* By default, only standard bitrates are enabled upon initialization:
|
||||
* - for 7kHz audio bandwidth (16kHz sampling rate): 24kbps and 32kbps,
|
||||
* - for 14kHz audio bandwidth (32kHz sampling rate): 24kbps, 32kbps, and
|
||||
* 48kbps.
|
||||
*
|
||||
* The usage of non-standard bitrates must follow these requirements:
|
||||
* - for 7kHz audio bandwidth (16kHz sampling rate): 16000 to 32000 bps,
|
||||
* multiplication of 400
|
||||
* - for 14kHz audio bandwidth (32kHz sampling rate): 24000 to 48000 bps,
|
||||
* multiplication of 400
|
||||
*
|
||||
* The bitrate is set via <tt>param.setting.dec_fmtp</tt>, if it does not
|
||||
* contain bitrate info, the codec will check <tt>param.info.avg_bps</tt>.
|
||||
*
|
||||
* \note
|
||||
* Currently only up to two non-standard modes can be enabled.
|
||||
*
|
||||
* \remark
|
||||
* There is a flaw in the codec manager as currently it could not
|
||||
* differentiate G.722.1 codecs by bitrates, hence invoking
|
||||
* #pjmedia_codec_mgr_set_default_param() may only affect a G.722.1 codec
|
||||
* with the highest priority (or first index found in codec enumeration
|
||||
* when they have same priority) and invoking
|
||||
* #pjmedia_codec_mgr_set_codec_priority() will set priority of all G.722.1
|
||||
* codecs with sampling rate as specified.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Initialize and register G.722.1 codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g7221_init( pjmedia_endpt *endpt );
|
||||
|
||||
|
||||
/**
|
||||
* Enable and disable G.722.1 mode. By default, the standard modes are
|
||||
* enabled upon initialization, i.e.:
|
||||
* - sampling rate 16kHz, bitrate 24kbps and 32kbps.
|
||||
* - sampling rate 32kHz, bitrate 24kbps, 32kbps, and 48kbps.
|
||||
* This function can also be used for enabling non-standard modes.
|
||||
* Note that currently only up to two non-standard modes can be enabled
|
||||
* at one time.
|
||||
*
|
||||
* @param sample_rate PCM sampling rate, in Hz, valid values are only
|
||||
* 16000 and 32000.
|
||||
* @param bitrate G722.1 bitrate, in bps, the valid values are
|
||||
* standard and non-standard bitrates as described
|
||||
* above.
|
||||
* @param enabled PJ_TRUE for enabling specified mode.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g7221_set_mode(unsigned sample_rate,
|
||||
unsigned bitrate,
|
||||
pj_bool_t enabled);
|
||||
|
||||
/**
|
||||
* Set the G.722.1 codec encoder and decoder level adjustment.
|
||||
* If the value is non-zero, then PCM input samples to the encoder will
|
||||
* be shifted right by this value, and similarly PCM output samples from
|
||||
* the decoder will be shifted left by this value.
|
||||
*
|
||||
* \note
|
||||
* This function is also applicable for G722.1 implementation with IPP
|
||||
* back-end.
|
||||
*
|
||||
* Default value is PJMEDIA_G7221_DEFAULT_PCM_SHIFT.
|
||||
*
|
||||
* @param val The value
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g7221_set_pcm_shift(int val);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unregister G.722.1 codecs factory from pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g7221_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODECS_G7221_H__ */
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_G7221_SDP_MATCH_H__
|
||||
#define __PJMEDIA_CODEC_G7221_SDP_MATCH_H__
|
||||
|
||||
|
||||
/**
|
||||
* @file g7221_sdp_match.h
|
||||
* @brief Special SDP format match for G722.1.
|
||||
*/
|
||||
|
||||
#include <pjmedia/sdp_neg.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Match G.722.1 format in the SDP media offer and answer. This function
|
||||
* will match G.722.1 bitrate setting in the SDP format parameter of
|
||||
* offer and answer.
|
||||
*
|
||||
* @param pool The memory pool.
|
||||
* @param offer The SDP media offer.
|
||||
* @param o_fmt_idx Index of the G.722.1 format in the SDP media offer.
|
||||
* @param answer The SDP media answer.
|
||||
* @param a_fmt_idx Index of the G.722.1 format in the SDP media answer.
|
||||
* @param option The format matching option, see
|
||||
* #pjmedia_sdp_neg_fmt_match_flag.
|
||||
*
|
||||
* @return PJ_SUCCESS when the formats in offer and answer match.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_g7221_match_sdp( pj_pool_t *pool,
|
||||
pjmedia_sdp_media *offer,
|
||||
unsigned o_fmt_idx,
|
||||
pjmedia_sdp_media *answer,
|
||||
unsigned a_fmt_idx,
|
||||
unsigned option);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_G7221_SDP_MATCH_H__ */
|
||||
@@ -0,0 +1,87 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/gsm.h
|
||||
* @brief GSM 06.10 codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_GSM GSM 06.10 Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of GSM FR based on GSM 06.10 library
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register GSM codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* The GSM codec supports 16-bit PCM with sampling rate of 8000Hz resulting
|
||||
* in 13.2kbps bitrate.
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* Currently none.
|
||||
*/
|
||||
|
||||
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__ */
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_H263_PACKETIZER_H__
|
||||
#define __PJMEDIA_H263_PACKETIZER_H__
|
||||
|
||||
|
||||
/**
|
||||
* @file h263_packetizer.h
|
||||
* @brief Packetizes/unpacketizes H.263 bitstream into RTP payload.
|
||||
*/
|
||||
|
||||
#include <pj/pool.h>
|
||||
#include <pj/types.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Opaque declaration for H.263 packetizer.
|
||||
*/
|
||||
typedef struct pjmedia_h263_packetizer pjmedia_h263_packetizer;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration of H.263 packetization modes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/**
|
||||
* H.263 RTP packetization using RFC 4629.
|
||||
*/
|
||||
PJMEDIA_H263_PACKETIZER_MODE_RFC4629,
|
||||
|
||||
/**
|
||||
* H.263 RTP packetization using legacy RFC 2190.
|
||||
* This is currently not supported.
|
||||
*/
|
||||
PJMEDIA_H263_PACKETIZER_MODE_RFC2190,
|
||||
|
||||
} pjmedia_h263_packetizer_mode;
|
||||
|
||||
|
||||
/**
|
||||
* H.263 packetizer configuration.
|
||||
*/
|
||||
typedef struct pjmedia_h263_packetizer_cfg
|
||||
{
|
||||
/**
|
||||
* Maximum payload length.
|
||||
* Default: PJMEDIA_MAX_MTU
|
||||
*/
|
||||
int mtu;
|
||||
|
||||
/**
|
||||
* Packetization mode.
|
||||
* Default: PJMEDIA_H263_PACKETIZER_MODE_RFC4629
|
||||
*/
|
||||
pjmedia_h263_packetizer_mode mode;
|
||||
|
||||
} pjmedia_h263_packetizer_cfg;
|
||||
|
||||
|
||||
/**
|
||||
* Create H.263 packetizer.
|
||||
*
|
||||
* @param pool The memory pool.
|
||||
* @param cfg Packetizer settings, if NULL, default setting
|
||||
* will be used.
|
||||
* @param p_pktz Pointer to receive the packetizer.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h263_packetizer_create(
|
||||
pj_pool_t *pool,
|
||||
const pjmedia_h263_packetizer_cfg *cfg,
|
||||
pjmedia_h263_packetizer **p_pktz);
|
||||
|
||||
|
||||
/**
|
||||
* Generate an RTP payload from a H.263 picture bitstream. Note that this
|
||||
* function will apply in-place processing, so the bitstream may be modified
|
||||
* during the packetization.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param bits The picture bitstream to be packetized.
|
||||
* @param bits_len The length of the bitstream.
|
||||
* @param bits_pos The bitstream offset to be packetized.
|
||||
* @param payload The output payload.
|
||||
* @param payload_len The output payload length.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h263_packetize(pjmedia_h263_packetizer *pktz,
|
||||
pj_uint8_t *bits,
|
||||
pj_size_t bits_len,
|
||||
unsigned *bits_pos,
|
||||
const pj_uint8_t **payload,
|
||||
pj_size_t *payload_len);
|
||||
|
||||
|
||||
/**
|
||||
* Append an RTP payload to an H.263 picture bitstream. Note that in case of
|
||||
* noticing packet lost, application should keep calling this function with
|
||||
* payload pointer set to NULL, as the packetizer need to update its internal
|
||||
* state.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param payload The payload to be unpacketized.
|
||||
* @param payload_len The payload length.
|
||||
* @param bits The bitstream buffer.
|
||||
* @param bits_size The bitstream buffer size.
|
||||
* @param bits_pos The bitstream offset to put the unpacketized payload
|
||||
* in the bitstream, upon return, this will be updated
|
||||
* to the latest offset as a result of the unpacketized
|
||||
* payload.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h263_unpacketize(pjmedia_h263_packetizer *pktz,
|
||||
const pj_uint8_t *payload,
|
||||
pj_size_t payload_len,
|
||||
pj_uint8_t *bits,
|
||||
pj_size_t bits_size,
|
||||
unsigned *bits_pos);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_H263_PACKETIZER_H__ */
|
||||
@@ -0,0 +1,164 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2011 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_H264_PACKETIZER_H__
|
||||
#define __PJMEDIA_H264_PACKETIZER_H__
|
||||
|
||||
/**
|
||||
* @file h264_packetizer.h
|
||||
* @brief Packetizes H.264 bitstream into RTP payload and vice versa.
|
||||
*/
|
||||
|
||||
#include <pj/types.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Opaque declaration for H.264 packetizer.
|
||||
*/
|
||||
typedef struct pjmedia_h264_packetizer pjmedia_h264_packetizer;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration of H.264 packetization modes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
/**
|
||||
* Single NAL unit packetization mode will only generate payloads
|
||||
* containing a complete single NAL unit packet. As H.264 NAL unit
|
||||
* size can be very large, this mode is usually not applicable for
|
||||
* network environments with MTU size limitation.
|
||||
*/
|
||||
PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL,
|
||||
|
||||
/**
|
||||
* Non-interleaved packetization mode will generate payloads with the
|
||||
* following possible formats:
|
||||
* - single NAL unit packets,
|
||||
* - NAL units aggregation STAP-A packets,
|
||||
* - fragmented NAL unit FU-A packets.
|
||||
*/
|
||||
PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED,
|
||||
|
||||
/**
|
||||
* Interleaved packetization mode will generate payloads with the
|
||||
* following possible formats:
|
||||
* - single NAL unit packets,
|
||||
* - NAL units aggregation STAP-A & STAP-B packets,
|
||||
* - fragmented NAL unit FU-A & FU-B packets.
|
||||
* This packetization mode is currently unsupported.
|
||||
*/
|
||||
PJMEDIA_H264_PACKETIZER_MODE_INTERLEAVED,
|
||||
} pjmedia_h264_packetizer_mode;
|
||||
|
||||
|
||||
/**
|
||||
* H.264 packetizer setting.
|
||||
*/
|
||||
typedef struct pjmedia_h264_packetizer_cfg
|
||||
{
|
||||
/**
|
||||
* Maximum payload length.
|
||||
* Default: PJMEDIA_MAX_MTU
|
||||
*/
|
||||
int mtu;
|
||||
|
||||
/**
|
||||
* Packetization mode.
|
||||
* Default: PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED
|
||||
*/
|
||||
pjmedia_h264_packetizer_mode mode;
|
||||
|
||||
/**
|
||||
* NAL start code size used for unpacketizing.
|
||||
* Valid options are 3 (0, 0, 1) or 4 (0, 0, 0, 1).
|
||||
* Default: 3 (0, 0, 1)
|
||||
*/
|
||||
unsigned unpack_nal_start;
|
||||
}
|
||||
pjmedia_h264_packetizer_cfg;
|
||||
|
||||
|
||||
/**
|
||||
* Create H.264 packetizer.
|
||||
*
|
||||
* @param pool The memory pool.
|
||||
* @param cfg Packetizer settings, if NULL, default setting
|
||||
* will be used.
|
||||
* @param p_pktz Pointer to receive the packetizer.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h264_packetizer_create(
|
||||
pj_pool_t *pool,
|
||||
const pjmedia_h264_packetizer_cfg *cfg,
|
||||
pjmedia_h264_packetizer **p_pktz);
|
||||
|
||||
|
||||
/**
|
||||
* Generate an RTP payload from a H.264 picture bitstream. Note that this
|
||||
* function will apply in-place processing, so the bitstream may be modified
|
||||
* during the packetization.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param bits The picture bitstream to be packetized.
|
||||
* @param bits_len The length of the bitstream.
|
||||
* @param bits_pos The bitstream offset to be packetized.
|
||||
* @param payload The output payload.
|
||||
* @param payload_len The output payload length.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz,
|
||||
pj_uint8_t *bits,
|
||||
pj_size_t bits_len,
|
||||
unsigned *bits_pos,
|
||||
const pj_uint8_t **payload,
|
||||
pj_size_t *payload_len);
|
||||
|
||||
|
||||
/**
|
||||
* Append an RTP payload to an H.264 picture bitstream. Note that in case of
|
||||
* noticing packet lost, application should keep calling this function with
|
||||
* payload pointer set to NULL, as the packetizer need to update its internal
|
||||
* state.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param payload The payload to be unpacketized.
|
||||
* @param payload_len The payload length.
|
||||
* @param bits The bitstream buffer.
|
||||
* @param bits_size The bitstream buffer size.
|
||||
* @param bits_pos The bitstream offset to put the unpacketized payload
|
||||
* in the bitstream, upon return, this will be updated
|
||||
* to the latest offset as a result of the unpacketized
|
||||
* payload.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz,
|
||||
const pj_uint8_t *payload,
|
||||
pj_size_t payload_len,
|
||||
pj_uint8_t *bits,
|
||||
pj_size_t bits_len,
|
||||
unsigned *bits_pos);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_H264_PACKETIZER_H__ */
|
||||
@@ -0,0 +1,119 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_ILBC_H__
|
||||
#define __PJMEDIA_CODEC_ILBC_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/ilbc.h
|
||||
* @brief iLBC codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_ILBC iLBC Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of iLBC Codec
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register iLBC codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* The iLBC codec is developed by Global IP Solutions (GIPS), formerly
|
||||
* Global IP Sound. The iLBC offers low bitrate and graceful audio quality
|
||||
* degradation on frame losses.
|
||||
*
|
||||
* The iLBC codec supports 16-bit PCM audio signal with sampling rate of
|
||||
* 8000Hz operating at two modes: 20ms and 30ms frame length modes, resulting
|
||||
* in bitrates of 15.2kbps for 20ms mode and 13.33kbps for 30ms mode.
|
||||
*
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* The following settings are applicable for this codec.
|
||||
*
|
||||
* \subsubsection mode Mode
|
||||
*
|
||||
* The default mode should be set upon initialization, see
|
||||
* #pjmedia_codec_ilbc_init(). After the codec is initialized, the default
|
||||
* mode can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, iLBC mode can be set by specifying SDP
|
||||
* format parameter "mode" in the SDP "a=fmtp" attribute for decoding
|
||||
* direction. Valid values are "20" and "30" (for 20ms and 30ms mode
|
||||
* respectively).
|
||||
*
|
||||
* Here is an example to set up #pjmedia_codec_param to use mode 20ms:
|
||||
* \code
|
||||
pjmedia_codec_param param;
|
||||
...
|
||||
// setting iLBC mode in SDP
|
||||
param.setting.dec_fmtp.cnt = 1;
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("mode");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("20");
|
||||
...
|
||||
\endcode
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register iLBC codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
* @param mode Default decoder mode to be used. Valid values are
|
||||
* 20 and 30 ms. Note that encoder mode follows the
|
||||
* setting advertised in the remote's SDP.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ilbc_init( pjmedia_endpt *endpt,
|
||||
int mode );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unregister iLBC codec factory from pjmedia endpoint and deinitialize
|
||||
* the iLBC codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ilbc_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_ILBC_H__ */
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_CODECS_IPP_H__
|
||||
#define __PJMEDIA_CODECS_IPP_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/ipp_codecs.h
|
||||
* @brief IPP codecs wrapper.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_IPP_CODEC IPP Codecs
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of IPP codecs
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register IPP codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* This codec factory contains various codecs, i.e: G.729, G.723.1, G.726,
|
||||
* G.728, G.722.1, AMR, and AMR-WB.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_g729 IPP G.729
|
||||
*
|
||||
* IPP G.729 is compliant with ITU-T G.729 and Annexes A, B, C, C+, D,
|
||||
* E, I specifications. However, currently the pjmedia implementation is
|
||||
* using Annexes A and B only.
|
||||
*
|
||||
* IPP G.729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* frame length 10ms, and resulting in bitrate 8000bps (annexes D and E
|
||||
* introduce bitrates 6400bps and 11800bps).
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* Note that G.729 VAD status should be signalled in SDP, see more
|
||||
* description below.
|
||||
*
|
||||
* \subsubsection annexb Annex B
|
||||
*
|
||||
* The capability of VAD/DTX is specified in Annex B.
|
||||
*
|
||||
* By default, Annex B is enabled. This default setting of Annex B can
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, Annex B is configured via VAD setting and
|
||||
* format parameter "annexb" in the SDP "a=fmtp" attribute in
|
||||
* decoding fmtp field. Valid values are "yes" and "no",
|
||||
* the implementation default is "yes". When this parameter is omitted
|
||||
* in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
|
||||
*
|
||||
* Here is an example of modifying default setting of Annex B to
|
||||
* be disabled using #pjmedia_codec_mgr_set_default_param():
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// Set VAD
|
||||
param.setting.vad = 0;
|
||||
// Set SDP format parameter
|
||||
param.setting.dec_fmtp.cnt = 1;
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("annexb");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("no");
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*
|
||||
* \note
|
||||
* The difference of Annex B status in SDP offer/answer may be considered as
|
||||
* incompatible codec in SDP negotiation.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_g7231 IPP G.723.1
|
||||
*
|
||||
* IPP G.723.1 speech codec is compliant with ITU-T G.723.1 and Annex A
|
||||
* specifications.
|
||||
*
|
||||
* IPP G.723.1 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* frame length 30ms, and resulting in bitrates 5300bps and 6300bps.
|
||||
*
|
||||
* By default, pjmedia implementation uses encoding bitrate of 6300bps.
|
||||
* The bitrate is signalled in-band in G.723.1 frames and interoperable.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_g726 IPP G.726
|
||||
*
|
||||
* IPP G.726 is compliant with ITU-T G.726 and G.726 Annex A specifications.
|
||||
*
|
||||
* IPP G.726 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* 10ms frame length and producing 16kbps, 24kbps, 32kbps, 48kbps bitrates.
|
||||
* The bitrate is specified explicitly in its encoding name, i.e: G726-16,
|
||||
* G726-24, G726-32, G726-48.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_g728 IPP G.728
|
||||
*
|
||||
* IPP G.728 is compliant with ITU-T G.728 with I, G, H Appendixes
|
||||
* specifications for Low-Delay CELP coder.
|
||||
*
|
||||
* IPP G.728 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* 20ms frame length and producing 9.6kbps, 12.8kbps, and 16kbps bitrates.
|
||||
*
|
||||
* The pjmedia implementation currently uses 16kbps bitrate only.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_g7221 IPP G.722.1
|
||||
*
|
||||
* The pjmedia implementation of IPP G.722.1 supports 16-bit PCM audio
|
||||
* signal with sampling rate 16000Hz, 20ms frame length and producing
|
||||
* 16kbps, 24kbps, and 32kbps bitrates.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* The codec implementation supports only standard bitrates, i.e:
|
||||
* 24kbps and 32kbps. Both are enabled by default.
|
||||
*
|
||||
* \remark
|
||||
* There is a flaw in the codec manager as currently it could not
|
||||
* differentiate G.722.1 codecs by bitrates, hence invoking
|
||||
* #pjmedia_codec_mgr_set_default_param() may only affect a G.722.1 codec
|
||||
* with the highest priority (or first index found in codec enumeration
|
||||
* when they have same priority) and invoking
|
||||
* #pjmedia_codec_mgr_set_codec_priority() will set priority of all G.722.1
|
||||
* codecs with sampling rate as specified.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_amr IPP AMR
|
||||
*
|
||||
* The IPP AMR is compliant with GSM06.90-94 specifications for GSM Adaptive
|
||||
* Multi-Rate codec.
|
||||
*
|
||||
* IPP AMR supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* 20ms frame length and producing various bitrates that ranges from 4.75kbps
|
||||
* to 12.2kbps.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* By default, encoding bitrate is 7400bps. This default setting can be
|
||||
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
|
||||
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
|
||||
* #pjmedia_codec_param. Valid bitrates could be seen in
|
||||
* #pjmedia_codec_amrnb_bitrates.
|
||||
*
|
||||
* \subsubsection payload_format Payload Format
|
||||
*
|
||||
* There are two AMR payload format types, bandwidth-efficient and
|
||||
* octet-aligned. Default setting is using octet-aligned. This default payload
|
||||
* format can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, payload format can be set by specifying SDP
|
||||
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
|
||||
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
|
||||
* and "1" (for octet-aligned mode).
|
||||
*
|
||||
* \subsubsection mode_set Mode-Set
|
||||
*
|
||||
* Mode-set is used for restricting AMR modes in decoding direction.
|
||||
*
|
||||
* By default, no mode-set restriction applied. This default setting can be
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, mode-set could be specified via format parameters
|
||||
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
|
||||
* value is a comma separated list of modes from the set 0 - 7, e.g:
|
||||
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
|
||||
*
|
||||
* Here is an example of modifying AMR default codec param:
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// set default encoding bitrate to the highest 12.2kbps
|
||||
param.info.avg_bps = 12200;
|
||||
|
||||
// restrict decoding bitrate to 10.2kbps and 12.2kbps only
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("mode-set");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("6,7");
|
||||
|
||||
// also set to use bandwidth-efficient payload format
|
||||
param.setting.dec_fmtp.param[1].name = pj_str("octet-align");
|
||||
param.setting.dec_fmtp.param[1].val = pj_str("0");
|
||||
|
||||
param.setting.dec_fmtp.cnt = 2;
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_ipp_amrwb IPP AMR-WB
|
||||
*
|
||||
* The IPP AMR-WB is compliant with 3GPP TS 26.190-192, 194, 201
|
||||
* specifications for Adaptive Multi-Rate WideBand codec.
|
||||
*
|
||||
* IPP AMR-WB supports 16-bit PCM audio signal with sampling rate 16000Hz,
|
||||
* 20ms frame length and producing various bitrates. Valid bitrates could be
|
||||
* seen in #pjmedia_codec_amrwb_bitrates. The pjmedia implementation default
|
||||
* bitrate is 15850bps.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* By default, encoding bitrate is 15850bps. This default setting can be
|
||||
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
|
||||
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
|
||||
* #pjmedia_codec_param.
|
||||
*
|
||||
* \subsubsection payload_format Payload Format
|
||||
*
|
||||
* There are two AMR payload format types, bandwidth-efficient and
|
||||
* octet-aligned. Default setting is using octet-aligned. This default payload
|
||||
* format can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, payload format can be set by specifying SDP
|
||||
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
|
||||
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
|
||||
* and "1" (for octet-aligned mode).
|
||||
*
|
||||
* \subsubsection mode_set Mode-Set
|
||||
*
|
||||
* Mode-set is used for restricting AMR modes in decoding direction.
|
||||
*
|
||||
* By default, no mode-set restriction applied. This default setting can be
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, mode-set could be specified via format parameters
|
||||
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
|
||||
* value is a comma separated list of modes from the set 0 - 7, e.g:
|
||||
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register IPP codecs factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ipp_init( pjmedia_endpt *endpt );
|
||||
|
||||
|
||||
/**
|
||||
* Unregister IPP codecs factory from pjmedia endpoint and deinitialize
|
||||
* the IPP codecs library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_ipp_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODECS_IPP_H__ */
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_L16_H__
|
||||
#define __PJMEDIA_CODEC_L16_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_L16 L16 Codec Family
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of PCM/16bit/linear codecs
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register L16 codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* Note that the L16 codec factory registers several (about fourteen!)
|
||||
* L16 codec types to codec manager (different combinations of clock
|
||||
* rate and number of channels).
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* Currently none.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register L16 codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
* @param options Must be zero for now.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_l16_init( pjmedia_endpt *endpt,
|
||||
unsigned options);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unregister L16 codec factory from pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_l16_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_L16_H__ */
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2011-2013 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2011 Dan Arrhenius <dan@keystream.se>
|
||||
*
|
||||
* 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_OPENCORE_AMR_H__
|
||||
#define __PJMEDIA_CODEC_OPENCORE_AMR_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_OC_AMR OpenCORE AMR Codec
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief AMRCodec wrapper for OpenCORE AMR codec
|
||||
* @{
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Bitmask options to be passed during AMR codec factory initialization.
|
||||
*/
|
||||
enum pjmedia_amr_options
|
||||
{
|
||||
PJMEDIA_AMR_NO_NB = 1, /**< Disable narrowband mode. */
|
||||
PJMEDIA_AMR_NO_WB = 2, /**< Disable wideband mode. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Settings. Use #pjmedia_codec_opencore_amrnb/wb_set_config() to
|
||||
* activate.
|
||||
*/
|
||||
typedef struct pjmedia_codec_amr_config
|
||||
{
|
||||
/**
|
||||
* Control whether to use octent align.
|
||||
*/
|
||||
pj_bool_t octet_align;
|
||||
|
||||
/**
|
||||
* Set the bitrate.
|
||||
*/
|
||||
unsigned bitrate;
|
||||
|
||||
} pjmedia_codec_amr_config;
|
||||
|
||||
typedef pjmedia_codec_amr_config pjmedia_codec_amrnb_config;
|
||||
typedef pjmedia_codec_amr_config pjmedia_codec_amrwb_config;
|
||||
|
||||
/**
|
||||
* Initialize and register AMR codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
* @param options Bitmask of pjmedia_amr_options (default=0).
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_init(pjmedia_endpt* endpt,
|
||||
unsigned options);
|
||||
|
||||
/**
|
||||
* Initialize and register AMR codec factory using default settings to
|
||||
* pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t)
|
||||
pjmedia_codec_opencore_amr_init_default(pjmedia_endpt* endpt);
|
||||
|
||||
/**
|
||||
* Unregister AMR codec factory from pjmedia endpoint and deinitialize
|
||||
* the OpenCORE codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_deinit(void);
|
||||
|
||||
/**
|
||||
* Initialize and register AMR-NB codec factory to pjmedia endpoint. Calling
|
||||
* this function will automatically initialize AMR codec factory without
|
||||
* the wideband mode (i.e. it is equivalent to calling
|
||||
* #pjmedia_codec_opencore_amr_init() with PJMEDIA_AMR_NO_WB). Application
|
||||
* should call #pjmedia_codec_opencore_amr_init() instead if wishing to use
|
||||
* both modes.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_init(pjmedia_endpt* endpt);
|
||||
|
||||
/**
|
||||
* Unregister AMR-NB codec factory from pjmedia endpoint and deinitialize
|
||||
* the OpenCORE codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* Set AMR-NB parameters.
|
||||
*
|
||||
* @param cfg The settings;
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config(
|
||||
const pjmedia_codec_amrnb_config* cfg);
|
||||
|
||||
|
||||
/**
|
||||
* Set AMR-WB parameters.
|
||||
*
|
||||
* @param cfg The settings;
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_set_config(
|
||||
const pjmedia_codec_amrwb_config* cfg);
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2014 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_OPENH264_H__
|
||||
#define __PJMEDIA_CODEC_OPENH264_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
#include <pjmedia/vid_codec.h>
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/openh264.h
|
||||
* @brief Open H.264 codec
|
||||
*/
|
||||
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_OPENH264 Open H.264 Codec
|
||||
* @ingroup PJMEDIA_CODEC_VID_CODECS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialize and register OpenH264 codec factory.
|
||||
*
|
||||
* @param mgr The video codec manager instance where this codec will
|
||||
* be registered to. Specify NULL to use default instance
|
||||
* (in that case, an instance of video codec manager must
|
||||
* have been created beforehand).
|
||||
* @param pf Pool factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_openh264_vid_init(pjmedia_vid_codec_mgr *mgr,
|
||||
pj_pool_factory *pf);
|
||||
|
||||
/**
|
||||
* Unregister OpenH264 video codecs factory from the video codec manager and
|
||||
* deinitialize the codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_openh264_vid_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* @} PJMEDIA_CODEC_OPENH264
|
||||
*/
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_OPENH264_H__ */
|
||||
@@ -0,0 +1,160 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2015-2016 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2012-2015 Zaark Technology AB
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
/* This file is the header of Opus codec wrapper and was contributed by
|
||||
* Zaark Technology AB
|
||||
*/
|
||||
|
||||
#ifndef __PJMEDIA_CODEC_OPUS_H__
|
||||
#define __PJMEDIA_CODEC_OPUS_H__
|
||||
|
||||
/**
|
||||
* @file opus.h
|
||||
* @brief Opus codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_OPUS Opus Codec Family
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Opus codec wrapper
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register Opus codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* Opus codec uses multiple bit rates, and supports fullband (48 kHz
|
||||
* sampling rate), super wideband (24 kHz sampling rate), wideband (16 kHz
|
||||
* sampling rate), medium band (12kHz sampling rate), and narrowband
|
||||
* (8 kHz sampling rate).
|
||||
*
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param
|
||||
* (see the documentation of #pjmedia_codec_param for more info).
|
||||
*
|
||||
* For Opus codec specific settings, such as sample rate,
|
||||
* channel count, bit rate, complexity, and CBR, can be configured
|
||||
* in #pjmedia_codec_opus_config.
|
||||
* The default setting of sample rate is specified in
|
||||
* #PJMEDIA_CODEC_OPUS_DEFAULT_SAMPLE_RATE. The default setting of
|
||||
* bitrate is specified in #PJMEDIA_CODEC_OPUS_DEFAULT_BIT_RATE.
|
||||
* And the default setting of complexity is specified in
|
||||
* #PJMEDIA_CODEC_OPUS_DEFAULT_COMPLEXITY.
|
||||
*
|
||||
* After modifying any of these settings, application needs to call
|
||||
* #pjmedia_codec_opus_set_default_param(), which will generate the
|
||||
* appropriate decoding fmtp attributes.
|
||||
*
|
||||
* Here is an example of modifying the codec settings:
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
pjmedia_codec_opus_config opus_cfg;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
pjmedia_codec_opus_get_config(&opus_cfg);
|
||||
...
|
||||
// Set VAD
|
||||
param.setting.vad = 1;
|
||||
// Set PLC
|
||||
param.setting.vad = 1;
|
||||
// Set sample rate
|
||||
opus_cfg.sample_rate = 16000;
|
||||
// Set channel count
|
||||
opus_cfg.channel_cnt = 2;
|
||||
// Set bit rate
|
||||
opus_cfg.bit_rate = 20000;
|
||||
...
|
||||
pjmedia_codec_opus_set_default_param(&opus_cfg, ¶m);
|
||||
\endcode
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Opus codec configuration.
|
||||
*/
|
||||
typedef struct pjmedia_codec_opus_config
|
||||
{
|
||||
unsigned sample_rate; /**< Sample rate in Hz. */
|
||||
unsigned channel_cnt; /**< Number of channels. */
|
||||
unsigned frm_ptime; /**< Frame time in msec. */
|
||||
unsigned bit_rate; /**< Encoder bit rate in bps. */
|
||||
unsigned packet_loss; /**< Encoder's expected packet loss pct. */
|
||||
unsigned complexity; /**< Encoder complexity, 0-10(10 is highest)*/
|
||||
pj_bool_t cbr; /**< Constant bit rate? */
|
||||
} pjmedia_codec_opus_config;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register Opus codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opus_init( pjmedia_endpt *endpt );
|
||||
|
||||
/**
|
||||
* Unregister Opus codec factory from pjmedia endpoint and deinitialize
|
||||
* the Opus codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_opus_deinit( void );
|
||||
|
||||
/**
|
||||
* Get the default Opus configuration.
|
||||
*
|
||||
* @param cfg Opus codec configuration.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t)
|
||||
pjmedia_codec_opus_get_config( pjmedia_codec_opus_config *cfg );
|
||||
|
||||
/**
|
||||
* Set the default Opus configuration and set the default Opus codec param.
|
||||
* Note that the function will call #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* @param cfg Opus codec configuration.
|
||||
* @param param On input, the default Opus codec parameter to be set.
|
||||
* On output, the current default Opus codec parameter
|
||||
* after setting. This may be different from the input
|
||||
* because some settings can be rejected, or overwritten
|
||||
* by the Opus codec configuration above.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t)
|
||||
pjmedia_codec_opus_set_default_param(const pjmedia_codec_opus_config *cfg,
|
||||
pjmedia_codec_param *param );
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_OPUS_H__ */
|
||||
@@ -0,0 +1,277 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_CODECS_PASSTHROUGH_H__
|
||||
#define __PJMEDIA_CODECS_PASSTHROUGH_H__
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/passthrough.h
|
||||
* @brief Passthrough codecs.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_PASSTHROUGH_CODEC Passthrough Codecs
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of passthrough codecs
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register passthrough
|
||||
* codecs factory to the codec manager. After the codec factory has been
|
||||
* registered, application can use @ref PJMEDIA_CODEC API to manipulate
|
||||
* the codec.
|
||||
*
|
||||
* Passthrough codecs are codecs wrapper that does NOT perform encoding
|
||||
* or decoding, it just PACK and PARSE encoded audio data from/into RTP
|
||||
* payload. This will accomodate pjmedia ports which work with encoded
|
||||
* audio data, e.g: encoded audio files, sound device with capability
|
||||
* of playing/recording encoded audio data.
|
||||
*
|
||||
* This codec factory contains various codecs, i.e: G.729, iLBC,
|
||||
* AMR, and G.711.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_passthrough_g729 Passthrough G.729
|
||||
*
|
||||
* G.729 supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* frame length 10ms, and resulting in bitrate 8000bps.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* Note that G.729 VAD status should be signalled in SDP, see more
|
||||
* description below.
|
||||
*
|
||||
* \subsubsection annexb Annex B
|
||||
*
|
||||
* The capability of VAD/DTX is specified in Annex B.
|
||||
*
|
||||
* By default, Annex B is enabled. This default setting of Annex B can
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, Annex B is configured via VAD setting and
|
||||
* format parameter "annexb" in the SDP "a=fmtp" attribute in
|
||||
* decoding fmtp field. Valid values are "yes" and "no",
|
||||
* the implementation default is "yes". When this parameter is omitted
|
||||
* in the SDP, the value will be "yes" (RFC 4856 Section 2.1.9).
|
||||
*
|
||||
* Here is an example of modifying default setting of Annex B to
|
||||
* be disabled using #pjmedia_codec_mgr_set_default_param():
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// Set VAD
|
||||
param.setting.vad = 0;
|
||||
// Set SDP format parameter
|
||||
param.setting.dec_fmtp.cnt = 1;
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("annexb");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("no");
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*
|
||||
* \note
|
||||
* The difference of Annex B status in SDP offer/answer may be considered as
|
||||
* incompatible codec in SDP negotiation.
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_passthrough_ilbc Passthrough iLBC
|
||||
*
|
||||
* The iLBC codec is developed by Global IP Solutions (GIPS), formerly
|
||||
* Global IP Sound. The iLBC offers low bitrate and graceful audio quality
|
||||
* degradation on frame losses.
|
||||
*
|
||||
* The iLBC codec supports 16-bit PCM audio signal with sampling rate of
|
||||
* 8000Hz operating at two modes: 20ms and 30ms frame length modes, resulting
|
||||
* in bitrates of 15.2kbps for 20ms mode and 13.33kbps for 30ms mode.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsubsection mode Mode
|
||||
*
|
||||
* The default mode should be set upon initialization, see
|
||||
* #pjmedia_codec_passthrough_init2(). After the codec is initialized, the
|
||||
* default mode can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, iLBC mode can be set by specifying SDP
|
||||
* format parameter "mode" in the SDP "a=fmtp" attribute for decoding
|
||||
* direction. Valid values are "20" and "30" (for 20ms and 30ms mode
|
||||
* respectively).
|
||||
*
|
||||
* Here is an example to set up #pjmedia_codec_param to use mode 20ms:
|
||||
* \code
|
||||
pjmedia_codec_param param;
|
||||
...
|
||||
// setting iLBC mode in SDP
|
||||
param.setting.dec_fmtp.cnt = 1;
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("mode");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("20");
|
||||
...
|
||||
\endcode
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_passthrough_amr Passthrough AMR
|
||||
*
|
||||
* IPP AMR supports 16-bit PCM audio signal with sampling rate 8000Hz,
|
||||
* 20ms frame length and producing various bitrates that ranges from 4.75kbps
|
||||
* to 12.2kbps.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsubsection bitrate Bitrate
|
||||
*
|
||||
* By default, encoding bitrate is 7400bps. This default setting can be
|
||||
* modified using #pjmedia_codec_mgr_set_default_param() by specifying
|
||||
* prefered AMR bitrate in field <tt>info::avg_bps</tt> of
|
||||
* #pjmedia_codec_param. Valid bitrates could be seen in
|
||||
* #pjmedia_codec_amrnb_bitrates.
|
||||
*
|
||||
* \subsubsection payload_format Payload Format
|
||||
*
|
||||
* There are two AMR payload format types, bandwidth-efficient and
|
||||
* octet-aligned. Default setting is using octet-aligned. This default payload
|
||||
* format can be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, payload format can be set by specifying SDP
|
||||
* format parameters "octet-align" in the SDP "a=fmtp" attribute for
|
||||
* decoding direction. Valid values are "0" (for bandwidth efficient mode)
|
||||
* and "1" (for octet-aligned mode).
|
||||
*
|
||||
* \subsubsection mode_set Mode-Set
|
||||
*
|
||||
* Mode-set is used for restricting AMR modes in decoding direction.
|
||||
*
|
||||
* By default, no mode-set restriction applied. This default setting can be
|
||||
* be modified using #pjmedia_codec_mgr_set_default_param().
|
||||
*
|
||||
* In #pjmedia_codec_param, mode-set could be specified via format parameters
|
||||
* "mode-set" in the SDP "a=fmtp" attribute for decoding direction. Valid
|
||||
* value is a comma separated list of modes from the set 0 - 7, e.g:
|
||||
* "4,5,6,7". When this parameter is omitted, no mode-set restrictions applied.
|
||||
*
|
||||
* Here is an example of modifying AMR default codec param:
|
||||
\code
|
||||
pjmedia_codec_param param;
|
||||
|
||||
pjmedia_codec_mgr_get_default_param(.., ¶m);
|
||||
...
|
||||
// set default encoding bitrate to the highest 12.2kbps
|
||||
param.info.avg_bps = 12200;
|
||||
|
||||
// restrict decoding bitrate to 10.2kbps and 12.2kbps only
|
||||
param.setting.dec_fmtp.param[0].name = pj_str("mode-set");
|
||||
param.setting.dec_fmtp.param[0].val = pj_str("6,7");
|
||||
|
||||
// also set to use bandwidth-efficient payload format
|
||||
param.setting.dec_fmtp.param[1].name = pj_str("octet-align");
|
||||
param.setting.dec_fmtp.param[1].val = pj_str("0");
|
||||
|
||||
param.setting.dec_fmtp.cnt = 2;
|
||||
...
|
||||
pjmedia_codec_mgr_set_default_param(.., ¶m);
|
||||
\endcode
|
||||
*
|
||||
*
|
||||
* \section pjmedia_codec_passthrough_g711 Passthrough G.711
|
||||
*
|
||||
* The G.711 is an ultra low complexity codecs and in trade-off it results
|
||||
* in high bitrate, i.e: 64kbps for 16-bit PCM with sampling rate 8000Hz.
|
||||
*
|
||||
* The factory contains two main compression algorithms, PCMU/u-Law and
|
||||
* PCMA/A-Law.
|
||||
*
|
||||
* \subsection codec_setting Codec Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Codec passthrough configuration settings.
|
||||
*/
|
||||
typedef struct pjmedia_codec_passthrough_setting
|
||||
{
|
||||
unsigned fmt_cnt; /**< Number of encoding formats
|
||||
to be enabled. */
|
||||
pjmedia_format *fmts; /**< Encoding formats to be
|
||||
enabled. */
|
||||
unsigned ilbc_mode; /**< iLBC default mode. */
|
||||
} pjmedia_codec_passthrough_setting;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register passthrough codecs factory to pjmedia endpoint,
|
||||
* all supported encoding formats will be enabled.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_passthrough_init( pjmedia_endpt *endpt );
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register passthrough codecs factory to pjmedia endpoint
|
||||
* with only specified encoding formats enabled.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
* @param setting The settings.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_passthrough_init2(
|
||||
pjmedia_endpt *endpt,
|
||||
const pjmedia_codec_passthrough_setting *setting);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister passthrough codecs factory from pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_passthrough_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODECS_PASSTHROUGH_H__ */
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2012-2012 Teluu Inc. (http://www.teluu.com)
|
||||
* Contributed by Regis Montoya (aka r3gis - www.r3gis.fr)
|
||||
*
|
||||
* 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_SILK_H__
|
||||
#define __PJMEDIA_CODEC_SILK_H__
|
||||
|
||||
/**
|
||||
* @file silk.h
|
||||
* @brief SILK codec.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_SILK SILK Codec Family
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of SILK codecs (narrow/medium/wide/superwide-band).
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register SILK codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* The SILK codec uses multiple bit rates, and supports super wideband
|
||||
* (24 kHz sampling rate), wideband (16 kHz sampling rate), medium (12kHz
|
||||
* sampling rate), and narrowband (telephone quality, 8 kHz sampling rate).
|
||||
*
|
||||
* By default, the SILK codec factory registers two SILK codecs:
|
||||
* "SILK/8000" narrowband codec and "SILK/16000" wideband codec. This behavior
|
||||
* can be changed by specifying #pjmedia_codec_silk_options flags during
|
||||
* initialization.
|
||||
*
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* The following settings are applicable for this codec.
|
||||
*
|
||||
* \subsubsection quality_vs_complexity Quality vs Complexity
|
||||
*
|
||||
* The SILK codec quality versus computational complexity and bandwidth
|
||||
* requirement can be adjusted by modifying the quality and complexity
|
||||
* setting, by calling #pjmedia_codec_silk_set_config().
|
||||
*
|
||||
* The default setting of quality is specified in
|
||||
* #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY. And the default setting of
|
||||
* complexity is specified in #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
typedef struct pjmedia_codec_silk_setting
|
||||
{
|
||||
pj_bool_t enabled; /**< Enable/disable. */
|
||||
int quality; /**< Encoding quality, or use -1 for default
|
||||
(@see PJMEDIA_CODEC_SILK_DEFAULT_QUALITY). */
|
||||
int complexity; /**< Encoding complexity, or use -1 for default
|
||||
(@see PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY)*/
|
||||
} pjmedia_codec_silk_setting;
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register SILK codec factory to pjmedia endpoint. By default,
|
||||
* only narrowband (8kHz sampling rate) and wideband (16kHz sampling rate)
|
||||
* will be enabled. Quality and complexity for those sampling rate modes
|
||||
* will be set to the default values (see #PJMEDIA_CODEC_SILK_DEFAULT_QUALITY
|
||||
* and #PJMEDIA_CODEC_SILK_DEFAULT_COMPLEXITY), application may modify these
|
||||
* settings via #pjmedia_codec_silk_set_config().
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_silk_init(pjmedia_endpt *endpt);
|
||||
|
||||
|
||||
/**
|
||||
* Change the configuration setting of the SILK codec for the specified
|
||||
* clock rate.
|
||||
*
|
||||
* @param clock_rate PCM sampling rate, in Hz, valid values are 8000,
|
||||
* 12000, 16000 and 24000.
|
||||
* @param opt The setting to be applied for the specified
|
||||
* clock rate.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_silk_set_config(
|
||||
unsigned clock_rate,
|
||||
const pjmedia_codec_silk_setting *opt);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister SILK codec factory from pjmedia endpoint and deinitialize
|
||||
* the SILK codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_silk_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_SILK_H__ */
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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_SPEEX_H__
|
||||
#define __PJMEDIA_CODEC_SPEEX_H__
|
||||
|
||||
/**
|
||||
* @file speex.h
|
||||
* @brief Speex codec header.
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
|
||||
/**
|
||||
* @defgroup PJMED_SPEEX Speex Codec Family
|
||||
* @ingroup PJMEDIA_CODEC_CODECS
|
||||
* @brief Implementation of Speex codecs (narrow/wide/ultrawide-band).
|
||||
* @{
|
||||
*
|
||||
* This section describes functions to initialize and register speex codec
|
||||
* factory to the codec manager. After the codec factory has been registered,
|
||||
* application can use @ref PJMEDIA_CODEC API to manipulate the codec.
|
||||
*
|
||||
* The Speex codec uses multiple bit rates, and supports ultra-wideband
|
||||
* (32 kHz sampling rate), wideband (16 kHz sampling rate) and narrowband
|
||||
* (telephone quality, 8 kHz sampling rate)
|
||||
*
|
||||
* By default, the speex codec factory registers three Speex codecs:
|
||||
* "speex/8000" narrowband codec, "speex/16000" wideband codec, and
|
||||
* "speex/32000" ultra-wideband codec. This behavior can be changed by
|
||||
* specifying #pjmedia_speex_options flags during initialization.
|
||||
*
|
||||
*
|
||||
* \section codec_setting Codec Settings
|
||||
*
|
||||
* \subsection general_setting General Settings
|
||||
*
|
||||
* General codec settings for this codec such as VAD and PLC can be
|
||||
* manipulated through the <tt>setting</tt> field in #pjmedia_codec_param.
|
||||
* Please see the documentation of #pjmedia_codec_param for more info.
|
||||
*
|
||||
* \subsection specific_setting Codec Specific Settings
|
||||
*
|
||||
* The following settings are applicable for this codec.
|
||||
*
|
||||
* \subsubsection quality_vs_complexity Quality vs Complexity
|
||||
*
|
||||
* The Speex codec quality versus computational complexity and bandwidth
|
||||
* requirement can be adjusted by modifying the quality and complexity
|
||||
* setting, by calling #pjmedia_codec_speex_set_param(). The RFC 5574
|
||||
* Section 5 shows the relationship between quality setting and the
|
||||
* resulting bitrate.
|
||||
*
|
||||
* The default setting of quality is specified in
|
||||
* #PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY. And the default setting of
|
||||
* complexity is specified in #PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY.
|
||||
*/
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
|
||||
/**
|
||||
* Bitmask options to be passed during Speex codec factory initialization.
|
||||
*/
|
||||
enum pjmedia_speex_options
|
||||
{
|
||||
PJMEDIA_SPEEX_NO_NB = 1, /**< Disable narrowband mode. */
|
||||
PJMEDIA_SPEEX_NO_WB = 2, /**< Disable wideband mode. */
|
||||
PJMEDIA_SPEEX_NO_UWB = 4, /**< Disable ultra-wideband mode. */
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Initialize and register Speex codec factory to pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
* @param options Bitmask of pjmedia_speex_options (default=0).
|
||||
* @param quality Specify encoding quality, or use -1 for default
|
||||
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY).
|
||||
* @param complexity Specify encoding complexity , or use -1 for default
|
||||
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY).
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_speex_init( pjmedia_endpt *endpt,
|
||||
unsigned options,
|
||||
int quality,
|
||||
int complexity );
|
||||
|
||||
|
||||
/**
|
||||
* Initialize Speex codec factory using default settings and register to
|
||||
* pjmedia endpoint.
|
||||
*
|
||||
* @param endpt The pjmedia endpoint.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_speex_init_default(pjmedia_endpt *endpt);
|
||||
|
||||
|
||||
/**
|
||||
* Change the settings of Speex codec.
|
||||
*
|
||||
* @param clock_rate Clock rate of Speex mode to be set.
|
||||
* @param quality Specify encoding quality, or use -1 for default
|
||||
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY).
|
||||
* @param complexity Specify encoding complexity , or use -1 for default
|
||||
* (@see PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY).
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_speex_set_param(unsigned clock_rate,
|
||||
int quality,
|
||||
int complexity);
|
||||
|
||||
|
||||
/**
|
||||
* Unregister Speex codec factory from pjmedia endpoint and deinitialize
|
||||
* the Speex codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_speex_deinit(void);
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_SPEEX_H__ */
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
||||
* Copyright (C) 2003-2008 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__
|
||||
|
||||
/**
|
||||
* @file types.h
|
||||
* @brief PJMEDIA-CODEC types and constants
|
||||
*/
|
||||
|
||||
#include <pjmedia-codec/config.h>
|
||||
#include <pjmedia/codec.h>
|
||||
|
||||
/**
|
||||
* @defgroup pjmedia_codec_types PJMEDIA-CODEC Types and Constants
|
||||
* @ingroup PJMEDIA_CODEC
|
||||
* @brief Constants used by PJMEDIA-CODEC
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* These are the dynamic payload types that are used by audio codecs in
|
||||
* this library. Also see the header file <pjmedia/codec.h> for list
|
||||
* of static payload types.
|
||||
*
|
||||
* These enumeration is for older audio codecs only, newer audio codec using
|
||||
* dynamic payload type can simply assign PJMEDIA_RTP_PT_DYNAMIC in its
|
||||
* payload type (i.e: pjmedia_codec_info.pt). Endpoint will automatically
|
||||
* rearrange dynamic payload types in SDP generation.
|
||||
*/
|
||||
enum pjmedia_audio_pt
|
||||
{
|
||||
/* According to IANA specifications, dynamic payload types are to be in
|
||||
* the range 96-127 (inclusive), but this enum allows the value to be
|
||||
* outside that range, later endpoint will rearrange dynamic payload types
|
||||
* in SDP generation to be inside the 96-127 range and not equal to
|
||||
* PJMEDIA_RTP_PT_TELEPHONE_EVENTS.
|
||||
*
|
||||
* PJMEDIA_RTP_PT_DYNAMIC is defined in <pjmedia/codec.h>. It is defined
|
||||
* to be 96.
|
||||
*/
|
||||
PJMEDIA_RTP_PT_START = (PJMEDIA_RTP_PT_DYNAMIC-1),
|
||||
|
||||
PJMEDIA_RTP_PT_SPEEX_NB, /**< Speex narrowband/8KHz */
|
||||
PJMEDIA_RTP_PT_SPEEX_WB, /**< Speex wideband/16KHz */
|
||||
PJMEDIA_RTP_PT_SPEEX_UWB, /**< Speex 32KHz */
|
||||
PJMEDIA_RTP_PT_SILK_NB, /**< SILK narrowband/8KHz */
|
||||
PJMEDIA_RTP_PT_SILK_MB, /**< SILK mediumband/12KHz */
|
||||
PJMEDIA_RTP_PT_SILK_WB, /**< SILK wideband/16KHz */
|
||||
PJMEDIA_RTP_PT_SILK_SWB, /**< SILK 24KHz */
|
||||
PJMEDIA_RTP_PT_ILBC, /**< iLBC (13.3/15.2Kbps) */
|
||||
PJMEDIA_RTP_PT_AMR, /**< AMR (4.75 - 12.2Kbps) */
|
||||
PJMEDIA_RTP_PT_AMRWB, /**< AMRWB (6.6 - 23.85Kbps)*/
|
||||
PJMEDIA_RTP_PT_AMRWBE, /**< AMRWBE */
|
||||
PJMEDIA_RTP_PT_G726_16, /**< G726 @ 16Kbps */
|
||||
PJMEDIA_RTP_PT_G726_24, /**< G726 @ 24Kbps */
|
||||
PJMEDIA_RTP_PT_G726_32, /**< G726 @ 32Kbps */
|
||||
PJMEDIA_RTP_PT_G726_40, /**< G726 @ 40Kbps */
|
||||
PJMEDIA_RTP_PT_G722_1_16, /**< G722.1 (16Kbps) */
|
||||
PJMEDIA_RTP_PT_G722_1_24, /**< G722.1 (24Kbps) */
|
||||
PJMEDIA_RTP_PT_G722_1_32, /**< G722.1 (32Kbps) */
|
||||
PJMEDIA_RTP_PT_G7221C_24, /**< G722.1 Annex C (24Kbps)*/
|
||||
PJMEDIA_RTP_PT_G7221C_32, /**< G722.1 Annex C (32Kbps)*/
|
||||
PJMEDIA_RTP_PT_G7221C_48, /**< G722.1 Annex C (48Kbps)*/
|
||||
PJMEDIA_RTP_PT_G7221_RSV1, /**< G722.1 reserve */
|
||||
PJMEDIA_RTP_PT_G7221_RSV2, /**< G722.1 reserve */
|
||||
PJMEDIA_RTP_PT_OPUS, /**< OPUS */
|
||||
#if PJMEDIA_CODEC_L16_HAS_8KHZ_MONO
|
||||
PJMEDIA_RTP_PT_L16_8KHZ_MONO, /**< L16 @ 8KHz, mono */
|
||||
#endif
|
||||
#if PJMEDIA_CODEC_L16_HAS_8KHZ_STEREO
|
||||
PJMEDIA_RTP_PT_L16_8KHZ_STEREO, /**< L16 @ 8KHz, stereo */
|
||||
#endif
|
||||
//PJMEDIA_RTP_PT_L16_11KHZ_MONO, /**< L16 @ 11KHz, mono */
|
||||
//PJMEDIA_RTP_PT_L16_11KHZ_STEREO, /**< L16 @ 11KHz, stereo */
|
||||
#if PJMEDIA_CODEC_L16_HAS_16KHZ_MONO
|
||||
PJMEDIA_RTP_PT_L16_16KHZ_MONO, /**< L16 @ 16KHz, mono */
|
||||
#endif
|
||||
#if PJMEDIA_CODEC_L16_HAS_16KHZ_STEREO
|
||||
PJMEDIA_RTP_PT_L16_16KHZ_STEREO, /**< L16 @ 16KHz, stereo */
|
||||
#endif
|
||||
//PJMEDIA_RTP_PT_L16_22KHZ_MONO, /**< L16 @ 22KHz, mono */
|
||||
//PJMEDIA_RTP_PT_L16_22KHZ_STEREO, /**< L16 @ 22KHz, stereo */
|
||||
//PJMEDIA_RTP_PT_L16_32KHZ_MONO, /**< L16 @ 32KHz, mono */
|
||||
//PJMEDIA_RTP_PT_L16_32KHZ_STEREO, /**< L16 @ 32KHz, stereo */
|
||||
#if PJMEDIA_CODEC_L16_HAS_48KHZ_MONO
|
||||
PJMEDIA_RTP_PT_L16_48KHZ_MONO, /**< L16 @ 48KHz, mono */
|
||||
#endif
|
||||
#if PJMEDIA_CODEC_L16_HAS_48KHZ_STEREO
|
||||
PJMEDIA_RTP_PT_L16_48KHZ_STEREO, /**< L16 @ 48KHz, stereo */
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* These are the dynamic payload types that are used by video codecs in
|
||||
* this library.
|
||||
*/
|
||||
enum pjmedia_video_pt
|
||||
{
|
||||
/* Video payload types */
|
||||
PJMEDIA_RTP_PT_VID_START = (PJMEDIA_RTP_PT_DYNAMIC-1),
|
||||
PJMEDIA_RTP_PT_H263P, /* used by ffmpeg avcodec */
|
||||
PJMEDIA_RTP_PT_H264, /* used by OpenH264 */
|
||||
PJMEDIA_RTP_PT_H264_RSV1, /* used by video toolbox */
|
||||
PJMEDIA_RTP_PT_H264_RSV2, /* used by MediaCodec */
|
||||
PJMEDIA_RTP_PT_H264_RSV3, /* used by ffmpeg avcodec */
|
||||
PJMEDIA_RTP_PT_H264_RSV4,
|
||||
|
||||
PJMEDIA_RTP_PT_VP8, /* used by VPX */
|
||||
PJMEDIA_RTP_PT_VP8_RSV1, /* used by MediaCodec */
|
||||
PJMEDIA_RTP_PT_VP8_RSV2,
|
||||
PJMEDIA_RTP_PT_VP9, /* used by VPX */
|
||||
PJMEDIA_RTP_PT_VP9_RSV1, /* used by MediaCodec */
|
||||
PJMEDIA_RTP_PT_VP9_RSV2,
|
||||
|
||||
/* Caution!
|
||||
* Ensure the value of the last pt above is <= 127.
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_TYPES_H__ */
|
||||
@@ -0,0 +1,71 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2017 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_VID_TOOLBOX_H__
|
||||
#define __PJMEDIA_CODEC_VID_TOOLBOX_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
#include <pjmedia/vid_codec.h>
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/vid_toolbox.h
|
||||
* @brief Video Toolbox codec
|
||||
*/
|
||||
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_VID_TOOLBOX Video Toolbox Codec
|
||||
* @ingroup PJMEDIA_CODEC_VID_CODECS
|
||||
* @{
|
||||
*
|
||||
* Video Toolbox H.264 codec wrapper for Mac and iOS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialize and register Video Toolbox codec factory.
|
||||
*
|
||||
* @param mgr The video codec manager instance where this codec will
|
||||
* be registered to. Specify NULL to use default instance
|
||||
* (in that case, an instance of video codec manager must
|
||||
* have been created beforehand).
|
||||
* @param pf Pool factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_vid_toolbox_init(pjmedia_vid_codec_mgr *mgr,
|
||||
pj_pool_factory *pf);
|
||||
|
||||
/**
|
||||
* Unregister Video Toolbox video codecs factory from the video codec manager
|
||||
* and deinitialize the codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_vid_toolbox_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* @} PJMEDIA_CODEC_VIDEO_TOOLBOX
|
||||
*/
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_VID_TOOLBOX_H__ */
|
||||
@@ -0,0 +1,69 @@
|
||||
/* $Id$ */
|
||||
/*
|
||||
* Copyright (C) 2019 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_VPX_H__
|
||||
#define __PJMEDIA_CODEC_VPX_H__
|
||||
|
||||
#include <pjmedia-codec/types.h>
|
||||
#include <pjmedia/vid_codec.h>
|
||||
|
||||
/**
|
||||
* @file pjmedia-codec/vpx.h
|
||||
* @brief VPX codec
|
||||
*/
|
||||
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* @defgroup PJMEDIA_CODEC_VPX VPX Codec
|
||||
* @ingroup PJMEDIA_CODEC_VID_CODECS
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Initialize and register VPX codec factory.
|
||||
*
|
||||
* @param mgr The video codec manager instance where this codec will
|
||||
* be registered to. Specify NULL to use default instance
|
||||
* (in that case, an instance of video codec manager must
|
||||
* have been created beforehand).
|
||||
* @param pf Pool factory.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_vpx_vid_init(pjmedia_vid_codec_mgr *mgr,
|
||||
pj_pool_factory *pf);
|
||||
|
||||
/**
|
||||
* Unregister VPX video codecs factory from the video codec manager and
|
||||
* deinitialize the codec library.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_codec_vpx_vid_deinit(void);
|
||||
|
||||
|
||||
/**
|
||||
* @} PJMEDIA_CODEC_VPX
|
||||
*/
|
||||
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_CODEC_VPX_H__ */
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Teluu Inc. (http://www.teluu.com)
|
||||
*
|
||||
* 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_VPX_PACKETIZER_H__
|
||||
#define __PJMEDIA_VPX_PACKETIZER_H__
|
||||
|
||||
/**
|
||||
* @file vpx_packetizer.h
|
||||
* @brief Packetizes VPX bitstream into RTP payload and vice versa.
|
||||
*/
|
||||
|
||||
#include <pj/types.h>
|
||||
|
||||
PJ_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Opaque declaration for VPX packetizer.
|
||||
*/
|
||||
typedef struct pjmedia_vpx_packetizer pjmedia_vpx_packetizer;
|
||||
|
||||
|
||||
/**
|
||||
* VPX packetizer setting.
|
||||
*/
|
||||
typedef struct pjmedia_vpx_packetizer_cfg
|
||||
{
|
||||
/**
|
||||
* VPX format id.
|
||||
* Default: PJMEDIA_FORMAT_VP8
|
||||
*/
|
||||
pj_uint32_t fmt_id;
|
||||
|
||||
/**
|
||||
* MTU size.
|
||||
* Default: PJMEDIA_MAX_VID_PAYLOAD_SIZE
|
||||
*/
|
||||
unsigned mtu;
|
||||
}
|
||||
pjmedia_vpx_packetizer_cfg;
|
||||
|
||||
/**
|
||||
* Use this function to initialize VPX packetizer config.
|
||||
*
|
||||
* @param cfg The VPX packetizer config to be initialized.
|
||||
*/
|
||||
PJ_DECL(void) pjmedia_vpx_packetizer_cfg_default(
|
||||
pjmedia_vpx_packetizer_cfg *cfg);
|
||||
|
||||
|
||||
/**
|
||||
* Create VPX packetizer.
|
||||
*
|
||||
* @param pool The memory pool.
|
||||
* @param cfg Packetizer settings, if NULL, default setting
|
||||
* will be used.
|
||||
* @param p_pktz Pointer to receive the packetizer.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_vpx_packetizer_create(
|
||||
pj_pool_t *pool,
|
||||
const pjmedia_vpx_packetizer_cfg *cfg,
|
||||
pjmedia_vpx_packetizer **p_pktz);
|
||||
|
||||
|
||||
/**
|
||||
* Generate an RTP payload from a VPX picture bitstream. Note that this
|
||||
* function will apply in-place processing, so the bitstream may be modified
|
||||
* during the packetization.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param bits_len The length of the bitstream.
|
||||
* @param bits_pos The bitstream offset to be packetized.
|
||||
* @param is_keyframe The frame is keyframe.
|
||||
* @param payload The output payload.
|
||||
* @param payload_len The output payload length, on input it represents max
|
||||
* payload length.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_vpx_packetize(const pjmedia_vpx_packetizer *pktz,
|
||||
pj_size_t bits_len,
|
||||
unsigned *bits_pos,
|
||||
pj_bool_t is_keyframe,
|
||||
pj_uint8_t **payload,
|
||||
pj_size_t *payload_len);
|
||||
|
||||
|
||||
/**
|
||||
* Append an RTP payload to an VPX picture bitstream. Note that in case of
|
||||
* noticing packet lost, application should keep calling this function with
|
||||
* payload pointer set to NULL, as the packetizer need to update its internal
|
||||
* state.
|
||||
*
|
||||
* @param pktz The packetizer.
|
||||
* @param payload The payload to be unpacketized.
|
||||
* @param payload_len The payload length.
|
||||
* @param payload_desc_len The payload description length.
|
||||
*
|
||||
* @return PJ_SUCCESS on success.
|
||||
*/
|
||||
PJ_DECL(pj_status_t) pjmedia_vpx_unpacketize(pjmedia_vpx_packetizer *pktz,
|
||||
const pj_uint8_t *payload,
|
||||
pj_size_t payload_len,
|
||||
unsigned *payload_desc_len);
|
||||
|
||||
PJ_END_DECL
|
||||
|
||||
#endif /* __PJMEDIA_VPX_PACKETIZER_H__ */
|
||||
Reference in new issue
Block a user