linphone_call_init_media_streams(call);
调用:
void linphone_call_init_video_stream(LinphoneCall *call)
调用:
video_stream_set_event_callback(call->videostream,video_stream_event_cb, call);
调用:
#ifdef VIDEO_ENABLED
static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args){
LinphoneCall* call = (LinphoneCall*) user_pointer;
switch (event_id) {
case MS_VIDEO_DECODER_DECODING_ERRORS:
ms_warning("MS_VIDEO_DECODER_DECODING_ERRORS");
if (call->videostream && (video_stream_is_decoding_error_to_be_reported(call->videostream, 5000) == TRUE)) {
video_stream_decoding_error_reported(call->videostream);
linphone_call_send_vfu_request(call);
}
break;
case MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS:
ms_message("MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS");
if (call->videostream) {
video_stream_decoding_error_recovered(call->videostream);
}
break;
case MS_VIDEO_DECODER_FIRST_IMAGE_DECODED:
ms_message("First video frame decoded successfully");
if (call->nextVideoFrameDecoded._func != NULL)
call->nextVideoFrameDecoded._func(call, call->nextVideoFrameDecoded._user_data);
break;
case MS_VIDEO_DECODER_SEND_PLI:
case MS_VIDEO_DECODER_SEND_SLI:
case MS_VIDEO_DECODER_SEND_RPSI:
/* Handled internally by mediastreamer2. */
break;
default:
ms_warning("Unhandled event %i", event_id);
break;
}
}
#endif