FreeSWITCH API Documentation
1.7.0
|
Go to the source code of this file.
Macros | |
#define | MAX_BUG_BUFFER 1024 * 512 |
#define MAX_BUG_BUFFER 1024 * 512 |
Definition at line 665 of file switch_core_media_bug.c.
Referenced by switch_core_media_bug_add().
switch_status_t switch_core_media_bug_add | ( | switch_core_session_t * | session, |
const char * | function, | ||
const char * | target, | ||
switch_media_bug_callback_t | callback, | ||
void * | user_data, | ||
time_t | stop_time, | ||
switch_media_bug_flag_t | flags, | ||
switch_media_bug_t ** | new_bug | ||
) |
Definition at line 666 of file switch_core_media_bug.c.
References switch_media_bug::callback, CF_VIDEO_DECODED_READ, switch_codec_implementation::decoded_bytes_per_packet, switch_media_bug::flags, switch_media_bug::function, MAX_BUG_BUFFER, switch_media_bug::next, pool, switch_media_bug::raw_read_buffer, switch_media_bug::raw_write_buffer, switch_media_bug::read_impl, switch_media_bug::read_mutex, switch_media_bug::read_video_queue, switch_media_bug::ready, switch_media_bug::session, SMBF_ANSWER_REQ, SMBF_ONE_ONLY, SMBF_READ_PING, SMBF_READ_REPLACE, SMBF_READ_STREAM, SMBF_READ_VIDEO_PING, SMBF_READ_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM_BLEG, SMBF_TAP_NATIVE_READ, SMBF_TAP_NATIVE_WRITE, SMBF_THREAD_LOCK, SMBF_WRITE_REPLACE, SMBF_WRITE_STREAM, SMBF_WRITE_VIDEO_PING, SMBF_WRITE_VIDEO_STREAM, switch_media_bug::spy_video_queue, SSF_MEDIA_BUG_TAP_ONLY, switch_media_bug::stop_time, SWITCH_ABC_TYPE_INIT, SWITCH_BUFFER_BLOCK_FRAMES, switch_buffer_create_dynamic(), SWITCH_BUFFER_START_FRAMES, switch_channel_event_set_data(), switch_channel_get_name(), switch_channel_get_variable, switch_channel_media_ready, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag_recursive(), switch_clear_flag, switch_core_media_bug_destroy(), switch_core_media_bug_test_flag(), switch_core_media_hard_mute(), SWITCH_CORE_QUEUE_LEN, switch_core_session_alloc, switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_get_write_impl(), switch_core_session_strdup, switch_event_add_header(), switch_event_create, switch_event_fire, SWITCH_EVENT_MEDIA_BUG_START, SWITCH_FALSE, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_queue_create(), switch_set_flag, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_create(), switch_thread_rwlock_unlock(), switch_thread_rwlock_wrlock(), switch_thread_self(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), switch_true(), switch_media_bug::target, switch_media_bug::thread_id, switch_media_bug::user_data, switch_media_bug::video_bug_thread, video_bug_thread(), switch_media_bug::write_impl, switch_media_bug::write_mutex, switch_media_bug::write_video_queue, and zstr.
Referenced by switch_core_media_bug_transfer_callback().
uint32_t switch_core_media_bug_clear_flag | ( | switch_media_bug_t * | bug, |
uint32_t | flag | ||
) |
Definition at line 81 of file switch_core_media_bug.c.
References switch_clear_flag.
switch_status_t switch_core_media_bug_close | ( | switch_media_bug_t ** | bug | ) |
Definition at line 1139 of file switch_core_media_bug.c.
References switch_media_bug::callback, CF_VIDEO_DECODED_READ, switch_core_session::channel, switch_media_bug::read_video_queue, switch_media_bug::ready, switch_media_bug::session, SMBF_LOCK, SMBF_READ_VIDEO_PING, SMBF_READ_VIDEO_STREAM, SMBF_WRITE_VIDEO_PING, SMBF_WRITE_VIDEO_STREAM, switch_media_bug::spy_img, switch_media_bug::spy_video_queue, SWITCH_ABC_TYPE_CLOSE, switch_channel_clear_flag_recursive(), switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_core_media_bug_destroy(), switch_core_media_bug_get_session(), switch_img_free(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_queue_push(), switch_queue_trypop(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_join(), switch_thread_self(), switch_media_bug::thread_id, switch_media_bug::user_data, switch_media_bug::video_bug_thread, and switch_media_bug::write_video_queue.
Referenced by switch_core_media_bug_prune(), switch_core_media_bug_remove(), and switch_core_media_bug_remove_callback().
|
static |
Definition at line 38 of file switch_core_media_bug.c.
References switch_core_session::channel, switch_media_bug::function, switch_media_bug::raw_read_buffer, switch_media_bug::raw_write_buffer, switch_media_bug::session, switch_buffer_destroy(), switch_channel_event_set_data(), switch_event_add_header(), switch_event_create, switch_event_fire, SWITCH_EVENT_MEDIA_BUG_STOP, SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, and switch_media_bug::target.
Referenced by switch_core_media_bug_add(), switch_core_media_bug_close(), switch_core_media_bug_remove_all_function(), and switch_core_media_bug_transfer_callback().
void switch_core_media_bug_flush | ( | switch_media_bug_t * | bug | ) |
Definition at line 136 of file switch_core_media_bug.c.
References switch_buffer_zero(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_media_bug_flush_all(), and switch_core_media_bug_read().
switch_status_t switch_core_media_bug_flush_all | ( | switch_core_session_t * | session | ) |
Definition at line 861 of file switch_core_media_bug.c.
References switch_media_bug::next, switch_core_media_bug_flush(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_unlock(), and switch_thread_rwlock_wrlock().
switch_frame_t* switch_core_media_bug_get_read_replace_frame | ( | switch_media_bug_t * | bug | ) |
Definition at line 106 of file switch_core_media_bug.c.
switch_core_session_t* switch_core_media_bug_get_session | ( | switch_media_bug_t * | bug | ) |
Definition at line 86 of file switch_core_media_bug.c.
Referenced by switch_core_media_bug_close(), and switch_core_media_bug_read().
void* switch_core_media_bug_get_user_data | ( | switch_media_bug_t * | bug | ) |
Definition at line 131 of file switch_core_media_bug.c.
switch_frame_t* switch_core_media_bug_get_write_replace_frame | ( | switch_media_bug_t * | bug | ) |
Definition at line 96 of file switch_core_media_bug.c.
switch_status_t switch_core_media_bug_read | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame, | ||
switch_bool_t | fill | ||
) |
Definition at line 183 of file switch_core_media_bug.c.
References switch_codec_implementation::actual_samples_per_second, switch_codec_implementation::decoded_bytes_per_packet, memset(), switch_codec_implementation::number_of_channels, SMBF_READ_STREAM, SMBF_STEREO, SMBF_STEREO_SWAP, SMBF_WRITE_STREAM, switch_assert, switch_buffer_inuse(), switch_buffer_read(), switch_buffer_toss(), switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_core_media_bug_flush(), switch_core_media_bug_get_session(), switch_core_session_get_read_impl(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_normalize_to_16bit, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_SMAX, SWITCH_SMIN, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_test_flag.
switch_status_t switch_core_media_bug_remove | ( | switch_core_session_t * | session, |
switch_media_bug_t ** | bug | ||
) |
Definition at line 1199 of file switch_core_media_bug.c.
References switch_media_bug::next, switch_media_bug::ready, SMBF_LOCK, SMBF_TAP_NATIVE_READ, SMBF_TAP_NATIVE_WRITE, SSF_MEDIA_BUG_TAP_ONLY, switch_clear_flag, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_media_bug_close(), switch_core_media_bug_test_flag(), switch_set_flag, SWITCH_STATUS_FALSE, switch_test_flag, switch_thread_rwlock_unlock(), switch_thread_rwlock_wrlock(), switch_thread_self(), and switch_media_bug::thread_id.
switch_status_t switch_core_media_bug_remove_all_function | ( | switch_core_session_t * | session, |
const char * | function | ||
) |
Definition at line 1096 of file switch_core_media_bug.c.
References switch_media_bug::callback, switch_media_bug::function, switch_media_bug::next, SMBF_LOCK, SSF_DESTROYABLE, SWITCH_ABC_TYPE_CLOSE, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_media_bug_destroy(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_rwlock_unlock(), switch_thread_rwlock_wrlock(), switch_thread_self(), switch_media_bug::thread_id, switch_media_bug::user_data, and zstr.
uint32_t switch_core_media_bug_set_flag | ( | switch_media_bug_t * | bug, |
uint32_t | flag | ||
) |
Definition at line 73 of file switch_core_media_bug.c.
References SMBF_LOCK, SMBF_PRUNE, switch_clear_flag, and switch_set_flag.
void switch_core_media_bug_set_read_demux_frame | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame | ||
) |
Definition at line 126 of file switch_core_media_bug.c.
void switch_core_media_bug_set_read_replace_frame | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame | ||
) |
Definition at line 121 of file switch_core_media_bug.c.
void switch_core_media_bug_set_write_replace_frame | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame | ||
) |
Definition at line 101 of file switch_core_media_bug.c.
uint32_t switch_core_media_bug_test_flag | ( | switch_media_bug_t * | bug, |
uint32_t | flag | ||
) |
Definition at line 68 of file switch_core_media_bug.c.
References switch_test_flag.
Referenced by switch_core_media_bug_add(), switch_core_media_bug_prune(), and switch_core_media_bug_remove().
|
static |
Definition at line 525 of file switch_core_media_bug.c.
References buf, switch_frame::buflen, buflen, switch_core_session::bug_rwlock, switch_media_bug::callback, vpx_image::d_h, vpx_image::d_w, switch_frame::data, switch_frame::flags, switch_frame::img, switch_frame::packet, switch_frame::packetlen, switch_media_bug::read_video_queue, switch_media_bug::ready, switch_media_bug::session, SFF_RAW_RTP, SMBF_PRUNE, SMBF_READ_VIDEO_STREAM, SMBF_WRITE_VIDEO_STREAM, switch_media_bug::stop_time, SWITCH_ABC_TYPE_STREAM_VIDEO_PING, switch_core_session_alloc, switch_epoch_time_now(), SWITCH_FALSE, switch_img_alloc(), SWITCH_IMG_FMT_I420, switch_img_free(), switch_img_patch(), switch_img_scale(), switch_queue_pop(), switch_queue_size(), switch_queue_trypop(), SWITCH_RTP_MAX_BUF_LEN, switch_set_flag, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_rwlock_rdlock(), switch_thread_rwlock_unlock(), switch_media_bug::user_data, switch_media_bug::video_ping_frame, and switch_media_bug::write_video_queue.
Referenced by switch_core_media_bug_add().