]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add dynamic buffers
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 8 Sep 2006 19:17:23 +0000 (19:17 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 8 Sep 2006 19:17:23 +0000 (19:17 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2585 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/switch_core.c

index 44e3146c1ebfc5f41c1bf48c82c92e7924b9c7ae..9b4dd87bfd603474a42c6de382a108effabb6371 100644 (file)
@@ -739,7 +739,9 @@ typedef struct switch_file_interface switch_file_interface_t;
 typedef struct switch_speech_interface switch_speech_interface_t;
 typedef struct switch_directory_interface switch_directory_interface_t;
 typedef struct switch_core_port_allocator switch_core_port_allocator_t;
-
+typedef struct switch_audio_bug switch_audio_bug_t;
+typedef void (*switch_audio_bug_read_callback_t)(switch_audio_bug_t *);
+typedef void (*switch_audio_bug_write_callback_t)(switch_audio_bug_t *);
 typedef void (*switch_application_function_t)(switch_core_session_t *, char *);
 typedef void (*switch_event_callback_t)(switch_event_t *);
 typedef switch_caller_extension_t *(*switch_dialplan_hunt_function_t)(switch_core_session_t *);
@@ -784,6 +786,8 @@ typedef switch_xml_t (*switch_xml_search_function_t)(char *section,
 struct switch_channel;
 /*! \brief A core session representing a call and all of it's resources */
 struct switch_core_session;
+/*! \brief An audio bug */
+struct switch_audio_bug;
 
 SWITCH_END_EXTERN_C
 
index 7418ad4cff02da938a2bb6e3e39f0871785a680f..95ff1364bd3746c523d7f2a352b9a2b1ce1d21b7 100644 (file)
 #define SWITCH_EVENT_QUEUE_LEN 256
 #define SWITCH_SQL_QUEUE_LEN 2000
 
+
+struct switch_audio_bug {
+       switch_codec_t *read_codec;
+    switch_codec_t *write_codec;
+       switch_buffer_t *raw_write_buffer;
+       switch_buffer_t *raw_read_buffer;
+       uint8_t data[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+       switch_audio_bug_read_callback_t read_callback;
+       switch_audio_bug_read_callback_t write_callback;
+       struct switch_audio_bug *next;
+};
+       
 struct switch_core_session {
        uint32_t id;
        char name[80];
@@ -1565,8 +1577,8 @@ SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session)
        session->write_resampler = NULL;
 
        /* wipe theese, they will be recreated if need be */
-       switch_buffer_destroy(&(*session)->raw_read_buffer);
-       switch_buffer_destroy(&(*session)->raw_write_buffer);
+       switch_buffer_destroy(&session->raw_read_buffer);
+       switch_buffer_destroy(&session->raw_write_buffer);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_session_t *session, switch_frame_t *frame,