git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1181 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-04-18 00:24:52 +00:00
parent c0ac721693
commit 021ea0e724
10 changed files with 326 additions and 323 deletions
+10
View File
@@ -46,6 +46,12 @@ extern "C" {
struct switch_frame {
/*! a pointer to the codec information */
switch_codec *codec;
/*! the originating source of the frame */
const char *source;
/*! the raw packet */
void *packet;
/*! the size of the raw packet when applicable*/
uint32_t packetlen;
/*! the frame data */
void *data;
/*! the size of the buffer that is in use */
@@ -56,6 +62,10 @@ struct switch_frame {
uint32_t samples;
/*! the rate of the frame */
uint32_t rate;
/*! the payload of the frame */
uint32_t payload;
/*! the timestamp of the frame */
uint32_t timestamp;
/*! frame flags */
switch_frame_flag flags;
};
+12 -2
View File
@@ -244,15 +244,24 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *dat
*/
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_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
\param rtp_session the RTP session to read from
\param frame a frame to populate with information
\return the number of bytes read
*/
SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_session, switch_frame *frame);
/*!
\brief Write data to a given RTP session
\param rtp_session the RTP session to write to
\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 frame flags
\return the number of bytes written
*/
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts);
SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags);
/*!
\brief Write data with a specified payload and sequence number to a given RTP session
@@ -262,9 +271,10 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32
\param payload the IANA payload number
\param ts then number of bytes to increment the timestamp by
\param mseq the specific sequence number to use
\param flags frame flags
\return the number of bytes written
*/
SWITCH_DECLARE(int) switch_rtp_write_payload(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t payload, uint32_t ts, uint16_t mseq);
SWITCH_DECLARE(int) switch_rtp_write_payload(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags);
/*!
\brief Retrieve the SSRC from a given RTP session
+7 -3
View File
@@ -103,6 +103,7 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
SWITCH_RTP_FLAG_USE_TIMER - Timeout Reads and replace with a CNG Frame
SWITCH_RTP_FLAG_SECURE - Secure RTP
SWITCH_RTP_FLAG_AUTOADJ - Auto-Adjust the dest based on the source
SWITCH_RTP_FLAG_RAW_WRITE - Try to forward packets unscathed
</pre>
*/
typedef enum {
@@ -110,7 +111,8 @@ typedef enum {
SWITCH_RTP_FLAG_IO = (1 << 1),
SWITCH_RTP_FLAG_USE_TIMER = (1 << 2),
SWITCH_RTP_FLAG_SECURE = (1 << 3),
SWITCH_RTP_FLAG_AUTOADJ = (1 << 4)
SWITCH_RTP_FLAG_AUTOADJ = (1 << 4),
SWITCH_RTP_FLAG_RAW_WRITE = (1 << 5)
} switch_rtp_flag_t;
/*!
@@ -316,11 +318,13 @@ typedef enum {
\brief Frame Flags
<pre>
CF_CNG = (1 << 0) - Frame represents comfort noise
SFF_CNG = (1 << 0) - Frame represents comfort noise
SFF_RAW_RTP = (1 << 1) - Frame has raw rtp accessible
</pre>
*/
typedef enum {
SFF_CNG = (1 << 0)
SFF_CNG = (1 << 0),
SFF_RAW_RTP = (1 << 1)
} switch_frame_flag;