* Anthony Minessale II <anthm@freeswitch.org>
* Michael Jerris <mike@jerris.com>
* Paul D. Tinsley <pdt at jackhammer.org>
+ * Seven Du <dujinfang@gmail.com>
*
*
* switch_core_io.c -- Main Core Library (Media I/O)
return SWITCH_STATUS_FALSE;
}
+ if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+
if (session->endpoint_interface->io_routines->write_video_frame) {
if ((status = session->endpoint_interface->io_routines->write_video_frame(session, frame, flags, stream_id)) == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.video_write_frame; ptr; ptr = ptr->next) {
return SWITCH_STATUS_FALSE;
}
+ if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) {
+ *frame = &runtime.dummy_cng_frame;
+ switch_yield(20000);
+ return SWITCH_STATUS_SUCCESS;
+ }
+
if (session->endpoint_interface->io_routines->read_video_frame) {
if ((status = session->endpoint_interface->io_routines->read_video_frame(session, frame, flags, stream_id)) == SWITCH_STATUS_SUCCESS) {
for (ptr = session->event_hooks.video_read_frame; ptr; ptr = ptr->next) {
*frame = &runtime.dummy_cng_frame;
return SWITCH_STATUS_SUCCESS;
}
+
+ if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) {
+ switch_yield(20000);
+ *frame = &runtime.dummy_cng_frame;
+ // switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Media Paused!!!!\n");
+ return SWITCH_STATUS_SUCCESS;
+ }
+
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no read codec.\n", switch_channel_get_name(session->channel));
switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
return SWITCH_STATUS_FALSE;
}
}
+ if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+
if (!(session->write_codec && switch_core_codec_ready(session->write_codec)) && !pass_cng) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel));
switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);