RTS API Documentation
1.10.11
|
Go to the source code of this file.
Macros | |
#define | MAX_BUG_BUFFER 1024 * 512 |
#define MAX_BUG_BUFFER 1024 * 512 |
Definition at line 793 of file switch_core_media_bug.c.
Referenced by switch_core_media_bug_add().
|
static |
Definition at line 573 of file switch_core_media_bug.c.
References switch_img_free(), switch_queue_size(), switch_queue_trypop(), and SWITCH_STATUS_SUCCESS.
Referenced by video_bug_thread().
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 794 of file switch_core_media_bug.c.
References switch_core_session::bug_rwlock, switch_core_session::bugs, switch_media_bug::callback, CF_VIDEO_DECODED_READ, CF_VIDEO_READ_TAPPED, CF_VIDEO_WRITE_TAPPED, switch_core_session::channel, switch_codec_implementation::decoded_bytes_per_packet, switch_media_bug::flags, switch_media_bug::function, MAX_BUG_BUFFER, switch_media_bug::next, pool, switch_core_session::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_FIRST, SMBF_ONE_ONLY, SMBF_READ_PING, SMBF_READ_REPLACE, SMBF_READ_STREAM, SMBF_READ_TEXT_STREAM, SMBF_READ_VIDEO_PATCH, 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_CODEC_FLAG_VIDEO_PATCHING, 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_zmalloc, switch_media_bug::target, switch_media_bug::text_buffer, switch_media_bug::text_framedata, switch_media_bug::text_framesize, switch_media_bug::thread_id, switch_media_bug::user_data, switch_media_bug::video_bug_thread, video_bug_thread(), switch_core_session::video_read_codec, 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 115 of file switch_core_media_bug.c.
References switch_clear_flag.
switch_status_t switch_core_media_bug_close | ( | switch_media_bug_t ** | bug, |
switch_bool_t | destroy | ||
) |
Definition at line 1290 of file switch_core_media_bug.c.
References switch_media_bug::callback, CF_VIDEO_DECODED_READ, CF_VIDEO_READ_TAPPED, CF_VIDEO_WRITE_TAPPED, 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_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_LOG_DEBUG, switch_log_printf(), switch_queue_push(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_self(), switch_media_bug::thread_id, switch_media_bug::user_data, and switch_media_bug::write_video_queue.
Referenced by switch_core_media_bug_prune(), switch_core_media_bug_remove(), switch_core_media_bug_remove_all_function(), 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, SMBF_READ_VIDEO_PATCH, switch_media_bug::spy_img, switch_media_bug::spy_video_queue, switch_buffer_destroy(), switch_channel_event_set_data(), switch_clear_flag, SWITCH_CODEC_FLAG_VIDEO_PATCHING, switch_event_add_header(), switch_event_create, switch_event_fire, SWITCH_EVENT_MEDIA_BUG_STOP, switch_img_free(), switch_queue_trypop(), switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_join(), switch_media_bug::target, switch_media_bug::text_buffer, switch_media_bug::text_framedata, switch_media_bug::video_bug_thread, and switch_core_session::video_read_codec.
Referenced by switch_core_media_bug_add(), switch_core_media_bug_close(), switch_core_media_bug_remove_all_function(), switch_core_media_bug_remove_callback(), and switch_core_media_bug_transfer_callback().
void switch_core_media_bug_flush | ( | switch_media_bug_t * | bug | ) |
Definition at line 185 of file switch_core_media_bug.c.
References switch_media_bug::raw_read_buffer, switch_media_bug::raw_write_buffer, switch_media_bug::read_mutex, switch_media_bug::record_frame_size, switch_media_bug::record_pre_buffer_count, switch_buffer_zero(), switch_mutex_lock(), switch_mutex_unlock(), and switch_media_bug::write_mutex.
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 1027 of file switch_core_media_bug.c.
References switch_core_session::bug_rwlock, switch_core_session::bugs, 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 155 of file switch_core_media_bug.c.
References switch_media_bug::read_replace_frame_in.
switch_core_session_t* switch_core_media_bug_get_session | ( | switch_media_bug_t * | bug | ) |
Definition at line 130 of file switch_core_media_bug.c.
References switch_media_bug::session.
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 | ) |
switch_frame_t* switch_core_media_bug_get_write_replace_frame | ( | switch_media_bug_t * | bug | ) |
Definition at line 145 of file switch_core_media_bug.c.
References switch_media_bug::write_replace_frame_in.
switch_status_t switch_core_media_bug_read | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame, | ||
switch_bool_t | fill | ||
) |
Definition at line 232 of file switch_core_media_bug.c.
References switch_codec_implementation::actual_samples_per_second, switch_frame::buflen, switch_core_session::channel, switch_frame::channels, switch_frame::codec, switch_frame::data, switch_media_bug::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_frame::flags, memset(), switch_codec_implementation::number_of_channels, switch_frame::rate, switch_media_bug::raw_read_buffer, switch_media_bug::raw_write_buffer, switch_rtp_engine_s::read_impl, switch_media_bug::read_mutex, switch_media_bug::record_frame_size, switch_media_bug::record_pre_buffer_count, switch_media_bug::record_pre_buffer_max, switch_frame::samples, switch_media_bug::session, 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, switch_test_flag, switch_media_bug::tmp, and switch_media_bug::write_mutex.
switch_status_t switch_core_media_bug_remove | ( | switch_core_session_t * | session, |
switch_media_bug_t ** | bug | ||
) |
Definition at line 1339 of file switch_core_media_bug.c.
References switch_core_session::bug_codec, switch_core_session::bug_rwlock, switch_core_session::bugs, 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(), SWITCH_TRUE, 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 1237 of file switch_core_media_bug.c.
References switch_core_session::bug_codec, switch_core_session::bug_rwlock, switch_core_session::bugs, switch_media_bug::function, switch_media_bug::next, SMBF_LOCK, SSF_DESTROYABLE, SWITCH_CHANNEL_SESSION_LOG, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_media_bug_close(), switch_core_media_bug_destroy(), SWITCH_FALSE, 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, and zstr.
uint32_t switch_core_media_bug_set_flag | ( | switch_media_bug_t * | bug, |
uint32_t | flag | ||
) |
Definition at line 107 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 175 of file switch_core_media_bug.c.
References switch_media_bug::read_demux_frame.
void switch_core_media_bug_set_read_replace_frame | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame | ||
) |
Definition at line 170 of file switch_core_media_bug.c.
References switch_media_bug::read_replace_frame_out.
void switch_core_media_bug_set_write_replace_frame | ( | switch_media_bug_t * | bug, |
switch_frame_t * | frame | ||
) |
Definition at line 150 of file switch_core_media_bug.c.
References switch_media_bug::write_replace_frame_out.
uint32_t switch_core_media_bug_test_flag | ( | switch_media_bug_t * | bug, |
uint32_t | flag | ||
) |
Definition at line 102 of file switch_core_media_bug.c.
References switch_test_flag.
Referenced by switch_core_media_bug_add(), switch_core_media_bug_prune(), switch_core_media_bug_remove(), and video_bug_thread().
|
static |
Definition at line 590 of file switch_core_media_bug.c.
References buf, switch_frame::buflen, buflen, switch_core_session::bug_rwlock, switch_media_bug::callback, CF_ANSWERED, switch_core_session::channel, vpx_image::d_h, vpx_image::d_w, switch_frame::data, switch_frame::flags, flush_video_queue(), switch_mm_s::fps, switch_frame::img, switch_fps_s::ms, switch_frame::packet, switch_frame::packetlen, POS_CENTER_MID, switch_media_bug::read_video_queue, switch_media_bug::ready, switch_fps_s::samples, switch_media_bug::session, SFF_RAW_RTP, SMBF_ANSWER_REQ, SMBF_PRUNE, SMBF_READ_VIDEO_STREAM, SMBF_WRITE_VIDEO_STREAM, switch_media_bug::stop_time, SWITCH_ABC_TYPE_STREAM_VIDEO_PING, switch_calc_video_fps, switch_channel_test_flag(), switch_color_set_rgb(), switch_core_media_bug_get_media_params(), switch_core_media_bug_test_flag(), switch_core_session_alloc, switch_core_timer_destroy(), switch_core_timer_init(), switch_core_timer_next(), switch_epoch_time_now(), SWITCH_FALSE, SWITCH_FIT_SIZE, switch_img_alloc(), switch_img_fill(), switch_img_find_position(), switch_img_fit(), SWITCH_IMG_FMT_I420, switch_img_free(), switch_img_patch(), 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_mm_s::vh, switch_media_bug::video_ping_frame, switch_mm_s::vw, and switch_media_bug::write_video_queue.
Referenced by switch_core_media_bug_add().