fix problem with the "next video frame decoded" notification, whose request was not surviving to a restart of the VideoStream.

This commit is contained in:
Simon Morlat 2015-10-03 10:38:47 +02:00
parent 1d20416098
commit 195a72ed6e
2 changed files with 15 additions and 6 deletions

View file

@ -42,6 +42,7 @@ static const char *EC_STATE_STORE = ".linphone.ecstate";
static void linphone_call_stats_uninit(LinphoneCallStats *stats);
static void linphone_call_get_local_ip(LinphoneCall *call, const LinphoneAddress *remote_addr);
static void _linphone_call_set_next_video_frame_decoded_trigger(LinphoneCall *call);
MSWebCam *get_nowebcam_device(){
@ -2083,8 +2084,11 @@ static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const u
break;
case MS_VIDEO_DECODER_FIRST_IMAGE_DECODED:
ms_message("First video frame decoded successfully");
if (call->nextVideoFrameDecoded._func != NULL)
if (call->nextVideoFrameDecoded._func != NULL){
call->nextVideoFrameDecoded._func(call, call->nextVideoFrameDecoded._user_data);
call->nextVideoFrameDecoded._func = NULL;
call->nextVideoFrameDecoded._user_data = NULL;
}
break;
case MS_VIDEO_DECODER_SEND_PLI:
case MS_VIDEO_DECODER_SEND_SLI:
@ -2098,13 +2102,17 @@ static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const u
}
#endif
static void _linphone_call_set_next_video_frame_decoded_trigger(LinphoneCall *call){
#ifdef VIDEO_ENABLED
if (call->nextVideoFrameDecoded._func && call->videostream && call->videostream->ms.decoder)
ms_filter_call_method_noarg(call->videostream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
#endif
}
void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call, LinphoneCallCbFunc cb, void* user_data) {
call->nextVideoFrameDecoded._func = cb;
call->nextVideoFrameDecoded._user_data = user_data;
#ifdef VIDEO_ENABLED
if (call->videostream && call->videostream->ms.decoder)
ms_filter_call_method_noarg(call->videostream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
#endif
_linphone_call_set_next_video_frame_decoded_trigger(call);
}
static void port_config_set_random_choosed(LinphoneCall *call, int stream_index, RtpSession *session){
@ -3177,6 +3185,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, LinphoneCallSta
}
}
ms_media_stream_sessions_set_encryption_mandatory(&call->videostream->ms.sessions,linphone_core_is_media_encryption_mandatory(call->core));
_linphone_call_set_next_video_frame_decoded_trigger(call);
}
}else ms_warning("No video stream accepted.");
}else{

@ -1 +1 @@
Subproject commit 2d9fecdba913b408657e107f581691d1379613f3
Subproject commit f3debaa3892717512f1bee4ce2e9fbc2cca01e8a