uint32_t record_pre_buffer_count;
uint32_t record_pre_buffer_max;
switch_frame_t *ping_frame;
+ switch_frame_t *video_ping_frame;
switch_frame_t *read_demux_frame;
switch_queue_t *read_video_queue;
switch_queue_t *write_video_queue;
SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_video_ping_frame(switch_media_bug_t *bug)
{
- return bug->ping_frame;
+ return bug->video_ping_frame;
}
SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_write_replace_frame(switch_media_bug_t *bug)
}
switch_thread_rwlock_rdlock(bug->session->bug_rwlock);
- //switch_mutex_lock(bug->read_mutex);
frame.img = other_q ? IMG : img;
- bug->ping_frame = &frame;
+ bug->video_ping_frame = &frame;
if (bug->callback) {
if (bug->callback(bug, bug->user_data, SWITCH_ABC_TYPE_STREAM_VIDEO_PING) == SWITCH_FALSE
|| (bug->stop_time && bug->stop_time <= switch_epoch_time_now(NULL))) {
ok = SWITCH_FALSE;
}
}
- bug->ping_frame = NULL;
- //switch_mutex_unlock(bug->read_mutex);
+ bug->video_ping_frame = NULL;
switch_thread_rwlock_unlock(bug->session->bug_rwlock);
if (!ok) {
for (bp = orig_session->bugs; bp; bp = bp->next) {
if (!switch_test_flag(bp, SMBF_PRUNE) && !switch_test_flag(bp, SMBF_LOCK) && !strcmp(bp->function, "patch:video")) {
if (bp->ready && frame->img && switch_test_flag(bp, SMBF_VIDEO_PATCH)) {
- bp->ping_frame = frame;
+ bp->video_ping_frame = frame;
if (bp->callback) {
if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_VIDEO_PATCH) == SWITCH_FALSE
|| (bp->stop_time && bp->stop_time <= switch_epoch_time_now(NULL))) {
ok = SWITCH_FALSE;
}
}
- bp->ping_frame = NULL;
+ bp->video_ping_frame = NULL;
}
if (ok == SWITCH_FALSE) {
case SWITCH_ABC_TYPE_READ_VIDEO_PING:
case SWITCH_ABC_TYPE_STREAM_VIDEO_PING:
if (rh->fh) {
- if (!bug->ping_frame) break;
+ if (!bug->video_ping_frame) break;
- if ((len || bug->ping_frame->img) && switch_core_file_write_video(rh->fh, bug->ping_frame) != SWITCH_STATUS_SUCCESS && rh->hangup_on_error) {
+ if ((len || bug->video_ping_frame->img) && switch_core_file_write_video(rh->fh, bug->video_ping_frame) != SWITCH_STATUS_SUCCESS &&
+ rh->hangup_on_error) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing video to %s\n", rh->file);
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
case SWITCH_ABC_TYPE_STREAM_VIDEO_PING:
{
- if (!bug->ping_frame || !bug->ping_frame->img) {
+ if (!bug->video_ping_frame || !bug->video_ping_frame->img) {
break;
}
if (ep->eavesdropper && switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) {
- if (switch_core_session_write_video_frame(ep->eavesdropper, bug->ping_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
+ if (switch_core_session_write_video_frame(ep->eavesdropper, bug->video_ping_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error writing video to %s\n", switch_core_session_get_name(ep->eavesdropper));
ep->errs++;