move CNG into the core and rearrange a few things

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1066 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-04-06 19:50:53 +00:00
parent a55bb56ff2
commit 0af60e1b2f
9 changed files with 82 additions and 168 deletions
+2 -2
View File
@@ -56,8 +56,8 @@ struct switch_frame {
switch_size_t samples;
/*! the rate of the frame */
int rate;
/*! the timestamp of the frame */
int32_t timestamp;
/*! frame flags */
switch_frame_flag flags;
};
#ifdef __cplusplus
+5 -2
View File
@@ -45,6 +45,7 @@ extern "C" {
#endif
#endif
#define SWITCH_RTP_MAX_BUF_LEN 16384
///\defgroup rtp RTP (RealTime Transport Protocol)
///\ingroup core1
@@ -134,9 +135,10 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, swit
\param data the data to read
\param datalen the length of the data
\param payload_type the IANA payload of the packet
\param flags flags
\return the number of bytes read
*/
SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t datalen, int *payload_type);
SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t datalen, int *payload_type, switch_frame_flag *flags);
/*!
\brief Read data from a given RTP session without copying
@@ -145,7 +147,7 @@ SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_
\param payload_type the IANA payload of the packet
\return the number of bytes read
*/
SWITCH_DECLARE(int) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, int *payload_type);
SWITCH_DECLARE(int) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, int *payload_type, switch_frame_flag *flags);
/*!
\brief Write data to a given RTP session
@@ -153,6 +155,7 @@ SWITCH_DECLARE(int) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **dat
\param data data to write
\param datalen the size of the data
\param ts then number of bytes to increment the timestamp by
\param flags flags
\return the number of bytes written
*/
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, int datalen, uint32_t ts);
+25 -14
View File
@@ -250,27 +250,38 @@ typedef enum {
\brief Channel Flags
<pre>
CF_SEND_AUDIO = (1 << 0) - Channel will send audio
CF_RECV_AUDIO = (1 << 1) - Channel will receive audio
CF_ANSWERED = (1 << 2) - Channel is answered
CF_OUTBOUND = (1 << 3) - Channel is an outbound channel
CF_EARLY_MEDIA = (1 << 4) - Channel is ready for audio before answer
CF_ORIGINATOR = (1 << 5) - Channel is an originator
CF_TRANSFER = (1 << 6) - Channel is being transfered
CF_ANSWERED = (1 << 0) - Channel is answered
CF_OUTBOUND = (1 << 1) - Channel is an outbound channel
CF_EARLY_MEDIA = (1 << 2) - Channel is ready for audio before answer
CF_ORIGINATOR = (1 << 3) - Channel is an originator
CF_TRANSFER = (1 << 4) - Channel is being transfered
CF_ACCEPT_CNG = (1 << 5) - Channel will accept CNG frames
</pre>
*/
typedef enum {
CF_SEND_AUDIO = (1 << 0),
CF_RECV_AUDIO = (1 << 1),
CF_ANSWERED = (1 << 2),
CF_OUTBOUND = (1 << 3),
CF_EARLY_MEDIA = (1 << 4),
CF_ORIGINATOR = (1 << 5),
CF_TRANSFER = (1 << 6)
CF_ANSWERED = (1 << 0),
CF_OUTBOUND = (1 << 1),
CF_EARLY_MEDIA = (1 << 2),
CF_ORIGINATOR = (1 << 3),
CF_TRANSFER = (1 << 4),
CF_ACCEPT_CNG = (1 << 5)
} switch_channel_flag;
/*!
\enum switch_frame_flag
\brief Frame Flags
<pre>
CF_CNG = (1 << 0) - Frame represents comfort noise
</pre>
*/
typedef enum {
SFF_CNG = (1 << 0)
} switch_frame_flag;
/*!
\enum switch_signal
\brief Signals to send to channels