summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-02-11 05:15:29 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-02-11 05:15:29 +0000
commit33ccbcef51df23a167a5411ca97e7cdd9b604652 (patch)
treecfad58562a8431fe9fa3c761cec05e924140afcf /pjmedia/include
parentdbae9140153559747dcb6b12c3fda2c139836733 (diff)
Close #1814: Add audio frame preview callbacks.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4982 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/sound_port.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/sound_port.h b/pjmedia/include/pjmedia/sound_port.h
index 07d15c4a..b09cb7bd 100644
--- a/pjmedia/include/pjmedia/sound_port.h
+++ b/pjmedia/include/pjmedia/sound_port.h
@@ -96,6 +96,38 @@ typedef struct pjmedia_snd_port_param
*/
unsigned ec_options;
+ /**
+ * Arbitrary user data for playback and record preview callbacks below.
+ */
+ void *user_data;
+
+ /**
+ * Optional callback for audio frame preview right before queued to
+ * the speaker.
+ * Notes:
+ * - application MUST NOT block or perform long operation in the callback
+ * as the callback may be executed in sound device thread
+ * - when using software echo cancellation, application MUST NOT modify
+ * the audio data from within the callback, otherwise the echo canceller
+ * will not work properly.
+ * - the return value of the callback will be ignored
+ */
+ pjmedia_aud_play_cb on_play_frame;
+
+ /**
+ * Optional callback for audio frame preview recorded from the microphone
+ * before being processed by any media component such as software echo
+ * canceller.
+ * Notes:
+ * - application MUST NOT block or perform long operation in the callback
+ * as the callback may be executed in sound device thread
+ * - when using software echo cancellation, application MUST NOT modify
+ * the audio data from within the callback, otherwise the echo canceller
+ * will not work properly.
+ * - the return value of the callback will be ignored
+ */
+ pjmedia_aud_rec_cb on_rec_frame;
+
} pjmedia_snd_port_param;
/**