blob: 577075e76408defe5255255c87be4ff718ccd3b4 [file] [log] [blame]
Benny Prijono35fc1eb2011-07-15 09:51:46 +00001/* $Id$ */
2/*
3 * Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJMEDIA_CODEC_ALL_CODECS_H__
20#define __PJMEDIA_CODEC_ALL_CODECS_H__
21
22/**
23 * @file pjmedia-codec/all_codecs.h
24 * @brief Helper function to register all codecs
25 */
26#include <pjmedia/endpoint.h>
27#include <pjmedia-codec/passthrough.h>
28
29
30PJ_BEGIN_DECL
31
32/**
33 * @defgroup PJMEDIA_CODEC_REGISTER_ALL Codec registration helper
34 * @ingroup PJMEDIA_CODEC_CODECS
35 * @brief Helper function to register all codecs
36 * @{
37 *
38 * Helper function to register all codecs that are implemented in
39 * PJMEDIA-CODEC library.
40 */
41
42/**
43 * Codec configuration. Call #pjmedia_audio_codec_config_default() to initialize
44 * this structure with the default values.
45 */
46typedef struct pjmedia_audio_codec_config
47{
48 /** Speex codec settings. See #pjmedia_codec_speex_init() for more info */
49 struct {
50 unsigned option; /**< Bitmask of options. */
51 unsigned quality; /**< Codec quality. */
52 unsigned complexity; /**< Codec complexity. */
53 } speex;
54
55 /** iLBC settings */
56 struct {
57 unsigned mode; /**< iLBC mode. */
58 } ilbc;
59
60 /** Passthrough */
61 struct {
62 pjmedia_codec_passthrough_setting setting; /**< Passthrough */
63 } passthrough;
64
65} pjmedia_audio_codec_config;
66
67
68/**
69 * Initialize pjmedia_audio_codec_config structure with default values.
70 *
71 * @param cfg The codec config to be initialized.
72 */
73PJ_DECL(void) pjmedia_audio_codec_config_default(pjmedia_audio_codec_config *cfg);
74
75/**
76 * Register all known audio codecs implemented in PJMEDA-CODEC library to the
77 * specified media endpoint.
78 *
79 * @param endpt The media endpoint.
80 * @param c Optional codec configuration, or NULL to use default
81 * values.
82 *
83 * @return PJ_SUCCESS on success or the appropriate error code.
84 */
85PJ_DECL(pj_status_t)
86pjmedia_codec_register_audio_codecs(pjmedia_endpt *endpt,
87 const pjmedia_audio_codec_config *c);
88
89
90/**
91 * @} PJMEDIA_CODEC_REGISTER_ALL
92 */
93
94
95PJ_END_DECL
96
97#endif /* __PJMEDIA_CODEC_ALL_CODECS_H__ */