[Freeswitch-svn] [commit] r5176 - in freeswitch/trunk: docs src src/include src/include/private

Freeswitch SVN anthm at freeswitch.org
Mon May 14 13:10:46 EDT 2007


Author: anthm
Date: Mon May 14 13:10:46 2007
New Revision: 5176

Added:
   freeswitch/trunk/src/include/private/switch_core_pvt.h
Removed:
   freeswitch/trunk/src/include/private/switch_core.h
   freeswitch/trunk/src/include/switch_sqlite.h
Modified:
   freeswitch/trunk/docs/Doxygen.conf
   freeswitch/trunk/src/include/switch_apr.h
   freeswitch/trunk/src/include/switch_core_event_hook.h
   freeswitch/trunk/src/include/switch_regex.h
   freeswitch/trunk/src/include/switch_scheduler.h
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_core_asr.c
   freeswitch/trunk/src/switch_core_codec.c
   freeswitch/trunk/src/switch_core_db.c
   freeswitch/trunk/src/switch_core_directory.c
   freeswitch/trunk/src/switch_core_event_hook.c
   freeswitch/trunk/src/switch_core_file.c
   freeswitch/trunk/src/switch_core_hash.c
   freeswitch/trunk/src/switch_core_io.c
   freeswitch/trunk/src/switch_core_media_bug.c
   freeswitch/trunk/src/switch_core_memory.c
   freeswitch/trunk/src/switch_core_port_allocator.c
   freeswitch/trunk/src/switch_core_rwlock.c
   freeswitch/trunk/src/switch_core_session.c
   freeswitch/trunk/src/switch_core_speech.c
   freeswitch/trunk/src/switch_core_sqldb.c
   freeswitch/trunk/src/switch_core_state_machine.c
   freeswitch/trunk/src/switch_core_timer.c

Log:
dox

Modified: freeswitch/trunk/docs/Doxygen.conf
==============================================================================
--- freeswitch/trunk/docs/Doxygen.conf	(original)
+++ freeswitch/trunk/docs/Doxygen.conf	Mon May 14 13:10:46 2007
@@ -83,7 +83,7 @@
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = ../src ../src/include 
+INPUT                  = ../src ../src/include ../src/include/private
 FILE_PATTERNS          = *.c \
                          *.cc \
                          *.cxx \

Added: freeswitch/trunk/src/include/private/switch_core_pvt.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/include/private/switch_core_pvt.h	Mon May 14 13:10:46 2007
@@ -0,0 +1,162 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct at yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct at yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * Anthony Minessale II <anthmct at yahoo.com>
+ *
+ *
+ * switch_core.h -- Core Library Private Data (not to be installed into the system)
+ * If the last line didn't make sense, stop reading this file, go away!,
+ * this file does not exist!!!!
+ *
+ */
+#ifndef WIN32
+#include <switch_private.h>
+#endif
+
+/* for apr_pool_create and apr_pool_destroy */
+/* functions only used in this file so not exposed */
+#include <apr_pools.h>
+
+/* for apr_hash_make, apr_hash_pool_get, apr_hash_set */
+/* functions only used in this file so not exposed */
+#include <apr_hash.h>
+
+/* for apr_pvsprintf */
+/* function only used in this file so not exposed */
+#include <apr_strings.h>
+
+/* for apr_initialize and apr_terminate */
+/* function only used in this file so not exposed */
+#include <apr_general.h>
+
+#include <apr_portable.h>
+typedef apr_os_thread_t switch_thread_id_t;
+#define switch_thread_self apr_os_thread_current
+
+
+#ifdef HAVE_MLOCKALL
+#include <sys/mman.h>
+#endif
+
+/* #define DEBUG_ALLOC */
+#define DO_EVENTS
+
+#define SWITCH_EVENT_QUEUE_LEN 256
+#define SWITCH_MESSAGE_QUEUE_LEN 256
+#define SWITCH_SQL_QUEUE_LEN 2000
+
+#define SWITCH_BUFFER_BLOCK_FRAMES 25
+#define SWITCH_BUFFER_START_FRAMES 50
+
+typedef enum {
+	SSF_NONE = 0,
+	SSF_DESTROYED = (1 << 0)
+} switch_session_flag_t;
+
+
+struct switch_core_session {
+	switch_size_t id;
+	char name[80];
+	switch_session_flag_t flags;
+	int thread_running;
+	switch_memory_pool_t *pool;
+	switch_channel_t *channel;
+	switch_thread_t *thread;
+	const switch_endpoint_interface_t *endpoint_interface;
+	switch_io_event_hooks_t event_hooks;
+	switch_codec_t *read_codec;
+	switch_codec_t *write_codec;
+
+	switch_buffer_t *raw_write_buffer;
+	switch_frame_t raw_write_frame;
+	switch_frame_t enc_write_frame;
+	uint8_t raw_write_buf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+	uint8_t enc_write_buf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+
+	switch_buffer_t *raw_read_buffer;
+	switch_frame_t raw_read_frame;
+	switch_frame_t enc_read_frame;
+	uint8_t raw_read_buf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+	uint8_t enc_read_buf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+
+
+	switch_audio_resampler_t *read_resampler;
+	switch_audio_resampler_t *write_resampler;
+
+	switch_mutex_t *mutex;
+	switch_thread_cond_t *cond;
+
+	switch_thread_rwlock_t *rwlock;
+
+	void *streams[SWITCH_MAX_STREAMS];
+	int stream_count;
+
+	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
+	void *private_info;
+	switch_queue_t *event_queue;
+	switch_queue_t *message_queue;
+	switch_queue_t *private_event_queue;
+	switch_thread_rwlock_t *bug_rwlock;
+	switch_media_bug_t *bugs;
+	switch_app_log_t *app_log;
+	uint32_t stack_count;
+};
+
+struct switch_media_bug {
+	switch_buffer_t *raw_write_buffer;
+	switch_buffer_t *raw_read_buffer;
+	switch_frame_t *replace_frame_in;
+	switch_frame_t *replace_frame_out;
+	switch_media_bug_callback_t callback;
+	switch_mutex_t *read_mutex;
+	switch_mutex_t *write_mutex;
+	switch_core_session_t *session;
+	void *user_data;
+	uint32_t flags;
+	uint8_t ready;
+	struct switch_media_bug *next;
+};
+
+struct switch_runtime {
+	switch_time_t initiated;
+	switch_hash_t *global_vars;
+	switch_memory_pool_t *memory_pool;
+	const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
+	int state_handler_index;
+	FILE *console;
+	uint8_t running;
+	char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
+	uint32_t no_new_sessions;
+	uint32_t shutting_down;
+	uint32_t crash_prot;
+};
+
+extern struct switch_runtime runtime;
+
+void switch_core_sqldb_start(switch_memory_pool_t *pool);
+void switch_core_sqldb_stop(void);
+void switch_core_session_init(switch_memory_pool_t *pool);
+void switch_core_state_machine_init(switch_memory_pool_t *pool);
+switch_memory_pool_t *switch_core_memory_init(void);

Modified: freeswitch/trunk/src/include/switch_apr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_apr.h	(original)
+++ freeswitch/trunk/src/include/switch_apr.h	Mon May 14 13:10:46 2007
@@ -167,7 +167,7 @@
 
 /**
  * Continue iterating over the entries in a hash table.
- * @param hi The iteration state
+ * @param ht The iteration state
  * @return a pointer to the updated iteration state.  NULL if there are no more  
  *         entries.
  */
@@ -520,7 +520,7 @@
  * create a FIFO queue
  * @param queue The new queue
  * @param queue_capacity maximum size of the queue
- * @param a pool to allocate queue from
+ * @param pool a pool to allocate queue from
  */
 SWITCH_DECLARE(switch_status_t) switch_queue_create(switch_queue_t ** queue, unsigned int queue_capacity, switch_memory_pool_t *pool);
 
@@ -684,7 +684,7 @@
 
 /**
  * Close the specified file.
- * @param file The file descriptor to close.
+ * @param thefile The file descriptor to close.
  */
 SWITCH_DECLARE(switch_status_t) switch_file_close(switch_file_t * thefile);
 
@@ -771,7 +771,7 @@
 /**
  * Create and initialize a new threadattr variable
  * @param new_attr The newly created threadattr.
- * @param cont The pool to use
+ * @param pool The pool to use
  */
 SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t ** new_attr, switch_memory_pool_t *pool);
 
@@ -904,7 +904,7 @@
  *                 made the connection request.  This is the socket which should
  *                 be used for all future communication.
  * @param sock The socket we are listening on.
- * @param connection_pool The pool for the new socket.
+ * @param pool The pool for the new socket.
  */
 SWITCH_DECLARE(switch_status_t) switch_socket_accept(switch_socket_t ** new_sock, switch_socket_t * sock, switch_memory_pool_t *pool);
 
@@ -943,7 +943,7 @@
  *                                 isn't NULL and APR_HAVE_IPV6; mutually exclusive
  *                                 with APR_IPV4_ADDR_OK
  * </PRE>
- * @param p The pool for the apr_sockaddr_t and associated storage.
+ * @param pool The pool for the apr_sockaddr_t and associated storage.
  */
 SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t ** sa, const char *hostname,
 														 int32_t family, switch_port_t port, int32_t flags, switch_memory_pool_t *pool);
@@ -1149,7 +1149,6 @@
 
 
 /** @} */
-/** @} */
 
 SWITCH_END_EXTERN_C
 #endif

Modified: freeswitch/trunk/src/include/switch_core_event_hook.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core_event_hook.h	(original)
+++ freeswitch/trunk/src/include/switch_core_event_hook.h	Mon May 14 13:10:46 2007
@@ -226,7 +226,7 @@
 /*! 
   \brief Add an event hook to be executed when a session writes a video frame
   \param session session to bind hook to
-  \param write_frame hook to bind
+  \param video_write_frame hook to bind
   \return SWITCH_STATUS_SUCCESS on suceess
 */
 SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_video_write_frame(switch_core_session_t *session, switch_video_write_frame_hook_t video_write_frame);

Modified: freeswitch/trunk/src/include/switch_regex.h
==============================================================================
--- freeswitch/trunk/src/include/switch_regex.h	(original)
+++ freeswitch/trunk/src/include/switch_regex.h	Mon May 14 13:10:46 2007
@@ -36,7 +36,7 @@
 
 SWITCH_BEGIN_EXTERN_C
 /**
- * @defgroup switch_regex
+ * @defgroup switch_regex Regular Expressions
  * @ingroup FREESWITCH
  * @{
  */

Modified: freeswitch/trunk/src/include/switch_scheduler.h
==============================================================================
--- freeswitch/trunk/src/include/switch_scheduler.h	(original)
+++ freeswitch/trunk/src/include/switch_scheduler.h	Mon May 14 13:10:46 2007
@@ -51,7 +51,7 @@
 
 /*!
   \brief Schedule a task in the future
-  \param runtime the time in epoch seconds to execute the task.
+  \param task_runtime the time in epoch seconds to execute the task.
   \param func the callback function to execute when the task is executed.
   \param desc an arbitrary description of the task.
   \param group a group id tag to link multiple tasks to a single entity.

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon May 14 13:10:46 2007
@@ -35,7 +35,7 @@
 
 #include <switch.h>
 #include <switch_version.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE_DATA switch_directories SWITCH_GLOBAL_dirs = { 0 };
 

Modified: freeswitch/trunk/src/switch_core_asr.c
==============================================================================
--- freeswitch/trunk/src/switch_core_asr.c	(original)
+++ freeswitch/trunk/src/switch_core_asr.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
 													 char *module_name,

Modified: freeswitch/trunk/src/switch_core_codec.c
==============================================================================
--- freeswitch/trunk/src/switch_core_codec.c	(original)
+++ freeswitch/trunk/src/switch_core_codec.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_set_read_codec(switch_core_session_t *session, switch_codec_t *codec)
 {

Modified: freeswitch/trunk/src/switch_core_db.c
==============================================================================
--- freeswitch/trunk/src/switch_core_db.c	(original)
+++ freeswitch/trunk/src/switch_core_db.c	Mon May 14 13:10:46 2007
@@ -31,7 +31,7 @@
  */
 
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 #include <sqlite3.h>
 

Modified: freeswitch/trunk/src/switch_core_directory.c
==============================================================================
--- freeswitch/trunk/src/switch_core_directory.c	(original)
+++ freeswitch/trunk/src/switch_core_directory.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_directory_open(switch_directory_handle_t *dh,
 														   char *module_name, char *source, char *dsn, char *passwd, switch_memory_pool_t *pool)

Modified: freeswitch/trunk/src/switch_core_event_hook.c
==============================================================================
--- freeswitch/trunk/src/switch_core_event_hook.c	(original)
+++ freeswitch/trunk/src/switch_core_event_hook.c	Mon May 14 13:10:46 2007
@@ -29,7 +29,7 @@
  *
  */
 #include "switch.h"
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_event_hook_add_outgoing(switch_core_session_t *session, switch_outgoing_channel_hook_t outgoing_channel)
 {

Modified: freeswitch/trunk/src/switch_core_file.c
==============================================================================
--- freeswitch/trunk/src/switch_core_file.c	(original)
+++ freeswitch/trunk/src/switch_core_file.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
 													  char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool)

Modified: freeswitch/trunk/src/switch_core_hash.c
==============================================================================
--- freeswitch/trunk/src/switch_core_hash.c	(original)
+++ freeswitch/trunk/src/switch_core_hash.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_hash_init(switch_hash_t ** hash, switch_memory_pool_t *pool)
 {

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, int stream_id)

Modified: freeswitch/trunk/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/trunk/src/switch_core_media_bug.c	(original)
+++ freeswitch/trunk/src/switch_core_media_bug.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include "switch.h"
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 static void switch_core_media_bug_destroy(switch_media_bug_t *bug)
 {

Modified: freeswitch/trunk/src/switch_core_memory.c
==============================================================================
--- freeswitch/trunk/src/switch_core_memory.c	(original)
+++ freeswitch/trunk/src/switch_core_memory.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 static struct {
 	switch_memory_pool_t *memory_pool;

Modified: freeswitch/trunk/src/switch_core_port_allocator.c
==============================================================================
--- freeswitch/trunk/src/switch_core_port_allocator.c	(original)
+++ freeswitch/trunk/src/switch_core_port_allocator.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 struct switch_core_port_allocator {
 	switch_port_t start;

Modified: freeswitch/trunk/src/switch_core_rwlock.c
==============================================================================
--- freeswitch/trunk/src/switch_core_rwlock.c	(original)
+++ freeswitch/trunk/src/switch_core_rwlock.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 #ifdef SWITCH_DEBUG_RWLOCKS
 SWITCH_DECLARE(switch_status_t) switch_core_session_perform_read_lock(switch_core_session_t *session, const char *file, const char *func, int line)

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 static struct {
 	switch_memory_pool_t *memory_pool;

Modified: freeswitch/trunk/src/switch_core_speech.c
==============================================================================
--- freeswitch/trunk/src/switch_core_speech.c	(original)
+++ freeswitch/trunk/src/switch_core_speech.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_speech_feed_tts(switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags)
 {

Modified: freeswitch/trunk/src/switch_core_sqldb.c
==============================================================================
--- freeswitch/trunk/src/switch_core_sqldb.c	(original)
+++ freeswitch/trunk/src/switch_core_sqldb.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 static struct {
 	switch_core_db_t *db;

Modified: freeswitch/trunk/src/switch_core_state_machine.c
==============================================================================
--- freeswitch/trunk/src/switch_core_state_machine.c	(original)
+++ freeswitch/trunk/src/switch_core_state_machine.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 static void switch_core_standard_on_init(switch_core_session_t *session)
 {

Modified: freeswitch/trunk/src/switch_core_timer.c
==============================================================================
--- freeswitch/trunk/src/switch_core_timer.c	(original)
+++ freeswitch/trunk/src/switch_core_timer.c	Mon May 14 13:10:46 2007
@@ -32,7 +32,7 @@
  *
  */
 #include <switch.h>
-#include "private/switch_core.h"
+#include "private/switch_core_pvt.h"
 
 SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
 {



More information about the Freeswitch-svn mailing list