summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-03-04 14:52:44 +0000
committerBenny Prijono <bennylp@teluu.com>2006-03-04 14:52:44 +0000
commit8c25bb977ff1317989406988ecf39fc0a32ccd32 (patch)
tree209a2fc305b8ec42aeaa248f73f57a2817583a2f /pjmedia/include
parentb572c1c64cab8d78d606b97ac5b95ee9c210ecd7 (diff)
Major modification in conference bridge to allow ports with different ptime and sampling rate. Also introduced sampling rate converter
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@277 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/conference.h2
-rw-r--r--pjmedia/include/pjmedia/resample.h76
2 files changed, 78 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/conference.h b/pjmedia/include/pjmedia/conference.h
index 775e2ff7..3b850cbd 100644
--- a/pjmedia/include/pjmedia/conference.h
+++ b/pjmedia/include/pjmedia/conference.h
@@ -45,6 +45,8 @@ typedef struct pjmedia_conf_port_info
pjmedia_port_op tx_setting;
pjmedia_port_op rx_setting;
pj_bool_t *listener;
+ unsigned clock_rate;
+ unsigned samples_per_frame;
} pjmedia_conf_port_info;
diff --git a/pjmedia/include/pjmedia/resample.h b/pjmedia/include/pjmedia/resample.h
new file mode 100644
index 00000000..63b3351d
--- /dev/null
+++ b/pjmedia/include/pjmedia/resample.h
@@ -0,0 +1,76 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJMEDIA_RESAMPLE_H__
+#define __PJMEDIA_RESAMPLE_H__
+
+
+
+/**
+ * @file reample.h
+ * @brief Sample rate converter.
+ */
+#include "pjmedia/types.h"
+
+PJ_BEGIN_DECL
+
+/**
+ * Opaque resample session.
+ */
+typedef struct pjmedia_resample pjmedia_resample;
+
+/**
+ * Create a frame based resample session.
+ *
+ * @param pool Pool to allocate the structure and buffers.
+ * @param high_quality If true, then high quality conversion will be
+ * used, at the expense of more CPU and memory,
+ * because temporary buffer needs to be created.
+ * @param large_filter If true, large filter size will be used.
+ * @param rate_in Clock rate of the input samples.
+ * @param rate_out Clock rate of the output samples.
+ * @param samples_per_frame Number of samples per frame in the input.
+ * @param p_resample Pointer to receive the resample session.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_resample_create(pj_pool_t *pool,
+ pj_bool_t high_quality,
+ pj_bool_t large_filter,
+ unsigned rate_in,
+ unsigned rate_out,
+ unsigned samples_per_frame,
+ pjmedia_resample **p_resample);
+
+
+/**
+ * Resample a frame.
+ *
+ * @param resample The resample session.
+ * @param input Buffer containing the input samples.
+ * @param output Buffer to store the output samples.
+ */
+PJ_DECL(void) pjmedia_resample_run( pjmedia_resample *resample,
+ const pj_int16_t *input,
+ pj_int16_t *output );
+
+
+PJ_END_DECL
+
+#endif /* __PJMEDIA_RESAMPLE_H__ */
+