Merge pull request #1226 in FS/freeswitch from bugfix/FS-10126-general-video-improvements to master

* commit 'f4ad4ed6c47b8961a180dfadc02f972a811878d2':
  FS-10126: [freeswitch-core] General Video Improvements #resolve
This commit is contained in:
Anthony Minessale II committed 2017-03-15 15:20:34 -05:00
commit 69f87f0bb0
12 files changed
+596 -158

No files matched your search

@@ -95,7 +95,6 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
if (conference->canvases[node->canvas_id]->timer.timer_interface) {
conference->canvases[node->canvas_id]->timer.interval = conference->video_fps.ms;
conference->canvases[node->canvas_id]->timer.samples = conference->video_fps.samples;
switch_core_timer_sync(&conference->canvases[node->canvas_id]->timer);
conference->canvases[node->canvas_id]->send_keyframe = 1;
}
conference->playing_video_file = 0;
@@ -1723,7 +1723,7 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
}
if (frame->timestamp) {
switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME);
switch_set_flag(frame, SFF_RAW_RTP_PARSE_FRAME|SFF_USE_VIDEO_TIMESTAMP);
}
frame->packetlen = frame->datalen + 12;
@@ -1753,7 +1753,9 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY ||
switch_channel_test_flag(imember->channel, CF_VIDEO_WRITING) ||
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
switch_core_session_rwunlock(imember->session);
continue;
}
@@ -3476,6 +3478,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
if (!imember->rec &&
(!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY) || !imember->canvas ||
switch_channel_test_flag(imember->channel, CF_VIDEO_WRITING) ||
switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS)) {
continue;
}
@@ -3680,7 +3683,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY ||
switch_channel_test_flag(imember->channel, CF_VIDEO_WRITING) ||
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
switch_core_session_rwunlock(imember->session);
continue;
}
@@ -3695,13 +3700,14 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
conference_video_set_canvas_fgimg(canvas, NULL);
}
switch_set_flag(&write_frame, SFF_RAW_RTP);
switch_set_flag(&write_frame, SFF_RAW_RTP|SFF_USE_VIDEO_TIMESTAMP|SFF_RAW_RTP_PARSE_FRAME);
write_frame.img = write_img;
write_frame.packet = packet;
write_frame.data = ((uint8_t *)packet) + 12;
write_frame.datalen = 0;
write_frame.buflen = SWITCH_RTP_MAX_BUF_LEN - 12;
write_frame.packetlen = 0;
write_frame.timestamp = timestamp;
//switch_core_session_write_video_frame(imember->session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
@@ -4034,7 +4040,9 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY ||
switch_channel_test_flag(imember->channel, CF_VIDEO_WRITING) ||
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
switch_core_session_rwunlock(imember->session);
continue;
}
@@ -5754,6 +5754,50 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_vid_params_t_fps_get(void * j
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_vid_params_t_d_width_set(void * jarg1, unsigned long jarg2) {
switch_vid_params_s *arg1 = (switch_vid_params_s *) 0 ;
uint32_t arg2 ;
arg1 = (switch_vid_params_s *)jarg1;
arg2 = (uint32_t)jarg2;
if (arg1) (arg1)->d_width = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_vid_params_t_d_width_get(void * jarg1) {
unsigned long jresult ;
switch_vid_params_s *arg1 = (switch_vid_params_s *) 0 ;
uint32_t result;
arg1 = (switch_vid_params_s *)jarg1;
result = (uint32_t) ((arg1)->d_width);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_vid_params_t_d_height_set(void * jarg1, unsigned long jarg2) {
switch_vid_params_s *arg1 = (switch_vid_params_s *) 0 ;
uint32_t arg2 ;
arg1 = (switch_vid_params_s *)jarg1;
arg2 = (uint32_t)jarg2;
if (arg1) (arg1)->d_height = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_vid_params_t_d_height_get(void * jarg1) {
unsigned long jresult ;
switch_vid_params_s *arg1 = (switch_vid_params_s *) 0 ;
uint32_t result;
arg1 = (switch_vid_params_s *)jarg1;
result = (uint32_t) ((arg1)->d_height);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_vid_params_t() {
void * jresult ;
switch_vid_params_s *result = 0 ;
@@ -12952,6 +12996,34 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_read_frame(void * jarg1, v
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_transcoding(void * jarg1, void * jarg2, int jarg3) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
switch_media_type_t arg3 ;
switch_bool_t result;
arg1 = (switch_core_session_t *)jarg1;
arg2 = (switch_core_session_t *)jarg2;
arg3 = (switch_media_type_t)jarg3;
result = (switch_bool_t)switch_core_session_transcoding(arg1,arg2,arg3);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_passthru(void * jarg1, int jarg2, int jarg3) {
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
switch_media_type_t arg2 ;
switch_bool_t arg3 ;
arg1 = (switch_core_session_t *)jarg1;
arg2 = (switch_media_type_t)jarg2;
arg3 = (switch_bool_t)jarg3;
switch_core_session_passthru(arg1,arg2,arg3);
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_read_video_frame(void * jarg1, void * jarg2, unsigned long jarg3, int jarg4) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
@@ -24674,6 +24746,28 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_timer_samplecount_get(void *
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_timer_last_samplecount_set(void * jarg1, unsigned long jarg2) {
switch_timer *arg1 = (switch_timer *) 0 ;
uint32_t arg2 ;
arg1 = (switch_timer *)jarg1;
arg2 = (uint32_t)jarg2;
if (arg1) (arg1)->last_samplecount = arg2;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_timer_last_samplecount_get(void * jarg1) {
unsigned long jresult ;
switch_timer *arg1 = (switch_timer *) 0 ;
uint32_t result;
arg1 = (switch_timer *)jarg1;
result = (uint32_t) ((arg1)->last_samplecount);
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_timer_timer_interface_set(void * jarg1, void * jarg2) {
switch_timer *arg1 = (switch_timer *) 0 ;
switch_timer_interface_t *arg2 = (switch_timer_interface_t *) 0 ;
+66 -3
View File
@@ -2122,6 +2122,15 @@ else
return ret;
}
public static switch_bool_t switch_core_session_transcoding(SWIGTYPE_p_switch_core_session session_a, SWIGTYPE_p_switch_core_session session_b, switch_media_type_t type) {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_session_transcoding(SWIGTYPE_p_switch_core_session.getCPtr(session_a), SWIGTYPE_p_switch_core_session.getCPtr(session_b), (int)type);
return ret;
}
public static void switch_core_session_passthru(SWIGTYPE_p_switch_core_session session, switch_media_type_t type, switch_bool_t on) {
freeswitchPINVOKE.switch_core_session_passthru(SWIGTYPE_p_switch_core_session.getCPtr(session), (int)type, (int)on);
}
public static switch_status_t switch_core_session_read_video_frame(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_p_switch_frame frame, uint flags, int stream_id) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_read_video_frame(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_p_switch_frame.getCPtr(frame), flags, stream_id);
return ret;
@@ -9559,6 +9568,18 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_vid_params_t_fps_get")]
public static extern uint switch_vid_params_t_fps_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_vid_params_t_d_width_set")]
public static extern void switch_vid_params_t_d_width_set(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_vid_params_t_d_width_get")]
public static extern uint switch_vid_params_t_d_width_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_vid_params_t_d_height_set")]
public static extern void switch_vid_params_t_d_height_set(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_vid_params_t_d_height_get")]
public static extern uint switch_vid_params_t_d_height_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_vid_params_t")]
public static extern IntPtr new_switch_vid_params_t();
@@ -11338,6 +11359,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_read_frame")]
public static extern int switch_core_session_read_frame(HandleRef jarg1, HandleRef jarg2, uint jarg3, int jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_transcoding")]
public static extern int switch_core_session_transcoding(HandleRef jarg1, HandleRef jarg2, int jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_passthru")]
public static extern void switch_core_session_passthru(HandleRef jarg1, int jarg2, int jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_read_video_frame")]
public static extern int switch_core_session_read_video_frame(HandleRef jarg1, HandleRef jarg2, uint jarg3, int jarg4);
@@ -14065,6 +14092,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_timer_samplecount_get")]
public static extern uint switch_timer_samplecount_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_timer_last_samplecount_set")]
public static extern void switch_timer_last_samplecount_set(HandleRef jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_timer_last_samplecount_get")]
public static extern uint switch_timer_last_samplecount_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_timer_timer_interface_set")]
public static extern void switch_timer_timer_interface_set(HandleRef jarg1, HandleRef jarg2);
@@ -35952,7 +35985,8 @@ namespace FreeSWITCH.Native {
SFF_USE_VIDEO_TIMESTAMP = (1 << 16),
SFF_ENCODED = (1 << 17),
SFF_TEXT_LINE_BREAK = (1 << 18),
SFF_IS_KEYFRAME = (1 << 19)
SFF_IS_KEYFRAME = (1 << 19),
SFF_EXTERNAL = (1 << 20)
}
}
@@ -40382,11 +40416,10 @@ public enum switch_rtp_flag_t {
SWITCH_RTP_FLAG_MUTE,
SWITCH_RTP_FLAG_NACK,
SWITCH_RTP_FLAG_TMMBR,
SWITCH_RTP_FLAG_GEN_TS_DELTA,
SWITCH_RTP_FLAG_GEN_TS_MANUAL,
SWITCH_RTP_FLAG_DETECT_SSRC,
SWITCH_RTP_FLAG_TEXT,
SWITCH_RTP_FLAG_OLD_FIR,
SWITCH_RTP_FLAG_PASSTHRU,
SWITCH_RTP_FLAG_INVALID
}
@@ -43410,6 +43443,16 @@ public class switch_timer : IDisposable {
}
}
public uint last_samplecount {
set {
freeswitchPINVOKE.switch_timer_last_samplecount_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_timer_last_samplecount_get(swigCPtr);
return ret;
}
}
public switch_timer_interface timer_interface {
set {
freeswitchPINVOKE.switch_timer_timer_interface_set(swigCPtr, switch_timer_interface.getCPtr(value));
@@ -44192,6 +44235,26 @@ public class switch_vid_params_t : IDisposable {
}
}
public uint d_width {
set {
freeswitchPINVOKE.switch_vid_params_t_d_width_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_vid_params_t_d_width_get(swigCPtr);
return ret;
}
}
public uint d_height {
set {
freeswitchPINVOKE.switch_vid_params_t_d_height_set(swigCPtr, value);
}
get {
uint ret = freeswitchPINVOKE.switch_vid_params_t_d_height_get(swigCPtr);
return ret;
}
}
public switch_vid_params_t() : this(freeswitchPINVOKE.new_switch_vid_params_t(), true) {
}