summaryrefslogtreecommitdiff
path: root/pjmedia/include/pjmedia-codec/opencore_amrnb.h
blob: aedb460bf646e44543c31309637759a34b6887c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* $Id: opencore_amrnb.h 3841 2011-10-24 09:28:13Z ming $ */
/*
 * Copyright (C) 2011 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_AMRNB_H__
#define __PJMEDIA_CODEC_OPENCORE_AMRNB_H__

#include <pjmedia-codec/types.h>

/**
 * @defgroup PJMED_OC_AMRNB OpenCORE AMR-NB Codec
 * @ingroup PJMEDIA_CODEC_CODECS
 * @brief AMRCodec wrapper for OpenCORE AMR-NB codec
 * @{
 */

PJ_BEGIN_DECL

/**
 * Settings. Use #pjmedia_codec_opencore_amrnb_set_config() to
 * activate.
 */
typedef struct pjmedia_codec_amrnb_config
{
    /**
     * Control whether to use octent align.
     */
    pj_bool_t octet_align;

    /**
     * Set the bitrate.
     */
    unsigned bitrate;

} pjmedia_codec_amrnb_config;


/**
 * Initialize and register AMR-NB codec factory to pjmedia endpoint.
 *
 * @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);

PJ_END_DECL


/**
 * @}
 */

#endif	/* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */