blob: 7b237c3c558e04b87c8f0dbc7e1f41648f2aa0d8 [file] [log] [blame]
Nanang Izzuddin8cdba462009-01-29 20:06:28 +00001/* $Id$ */
2/*
3 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __PJMEDIA_CODECS_PASSTHROUGH_H__
21#define __PJMEDIA_CODECS_PASSTHROUGH_H__
22
23/**
24 * @file pjmedia-codec/passthrough.h
25 * @brief Passthrough codecs.
26 */
27
28#include <pjmedia-codec/types.h>
29
30/**
31 * @defgroup PJMED_PASSTHROUGH_CODEC Passthrough Codecs
32 * @ingroup PJMEDIA_CODEC
33 * @brief Implementation of passthrough codecs
34 * @{
35 *
36 * This section describes functions to register and register passthrough
37 * codecs factory to the codec manager. After the codec factory has been
38 * registered, application can use @ref PJMEDIA_CODEC API to manipulate
39 * the codec. This codec factory contains various codecs, e.g: G.729, iLBC,
40 * AMR, and G.711.
41 *
42 * Passthrough codecs are codecs wrapper that does not perform encoding
43 * or decoding, it just pack and parse encoded audio data from/into RTP
44 * payload. This will accomodate pjmedia ports which work with encoded
45 * audio data, e.g: encoded audio files, sound device with capability
46 * of playing/recording encoded audio data.
47 */
48
49PJ_BEGIN_DECL
50
Nanang Izzuddinabf58db2009-06-30 15:02:06 +000051
52/**
53 * Codec passthrough configuration settings.
54 */
55typedef struct pjmedia_codec_passthrough_setting
56{
57 unsigned fmt_cnt; /**< Number of encoding formats
58 to be enabled. */
59 pjmedia_format *fmts; /**< Encoding formats to be
60 enabled. */
61} pjmedia_codec_passthrough_setting;
62
63
Nanang Izzuddin8cdba462009-01-29 20:06:28 +000064/**
Nanang Izzuddinabf58db2009-06-30 15:02:06 +000065 * Initialize and register passthrough codecs factory to pjmedia endpoint,
66 * all supported encoding formats will be enabled.
Nanang Izzuddin8cdba462009-01-29 20:06:28 +000067 *
68 * @param endpt The pjmedia endpoint.
69 *
70 * @return PJ_SUCCESS on success.
71 */
72PJ_DECL(pj_status_t) pjmedia_codec_passthrough_init( pjmedia_endpt *endpt );
73
74
Nanang Izzuddinabf58db2009-06-30 15:02:06 +000075/**
76 * Initialize and register passthrough codecs factory to pjmedia endpoint
77 * with only specified encoding formats enabled.
78 *
79 * @param endpt The pjmedia endpoint.
80 * @param setting The settings, see @pjmedia_codec_passthrough_setting.
81 *
82 * @return PJ_SUCCESS on success.
83 */
84PJ_DECL(pj_status_t) pjmedia_codec_passthrough_init2(
85 pjmedia_endpt *endpt,
86 const pjmedia_codec_passthrough_setting *setting);
87
Nanang Izzuddin8cdba462009-01-29 20:06:28 +000088
89/**
90 * Unregister passthrough codecs factory from pjmedia endpoint.
91 *
92 * @return PJ_SUCCESS on success.
93 */
94PJ_DECL(pj_status_t) pjmedia_codec_passthrough_deinit(void);
95
96
97PJ_END_DECL
98
99
100/**
101 * @}
102 */
103
104#endif /* __PJMEDIA_CODECS_PASSTHROUGH_H__ */
105