Commit fc3a434d authored by Ghislain MARY's avatar Ghislain MARY

Handle RTCP FB message sending internally instead of letting the application do it.

parent 0ef0ad68
......@@ -70,6 +70,29 @@ static void event_cb(void *ud, MSFilter* f, unsigned int event, void *eventdata)
}
}
static void internal_event_cb(void *ud, MSFilter *f, unsigned int event, void *eventdata) {
VideoStream *stream = (VideoStream *)ud;
const MSVideoCodecSLI *sli;
const MSVideoCodecRPSI *rpsi;
switch (event) {
case MS_VIDEO_DECODER_SEND_PLI:
ms_message("Send PLI on videostream [%p]", stream);
video_stream_send_pli(stream);
break;
case MS_VIDEO_DECODER_SEND_SLI:
sli = (const MSVideoCodecSLI *)eventdata;
ms_message("Send SLI on videostream [%p]", stream);
video_stream_send_sli(stream, sli->first, sli->number, sli->picture_id);
break;
case MS_VIDEO_DECODER_SEND_RPSI:
rpsi = (const MSVideoCodecRPSI *)eventdata;
ms_message("Send RPSI on videostream [%p]", stream);
video_stream_send_rpsi(stream, rpsi->bit_string, rpsi->bit_string_len);
break;
}
}
static void video_stream_process_rtcp(MediaStream *media_stream, mblk_t *m){
VideoStream *stream = (VideoStream *)media_stream;
unsigned int i;
......@@ -503,7 +526,8 @@ int video_stream_start (VideoStream *stream, RtpProfile *profile, const char *re
ms_fatal("No video display filter could be instantiated. Please check build-time configuration");
}
ms_filter_add_notify_callback(stream->ms.decoder, event_cb, stream,FALSE);
ms_filter_add_notify_callback(stream->ms.decoder, event_cb, stream, FALSE);
ms_filter_add_notify_callback(stream->ms.decoder, internal_event_cb, stream, FALSE);
stream->ms.rtprecv = ms_filter_new (MS_RTP_RECV_ID);
ms_filter_call_method(stream->ms.rtprecv,MS_RTP_RECV_SET_SESSION,stream->ms.sessions.rtp_session);
......
......@@ -535,30 +535,9 @@ static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const u
case MS_VIDEO_DECODER_DECODING_ERRORS:
ms_warning("Decoding error on videostream [%p]", md->video);
break;
case MS_VIDEO_DECODER_SEND_PLI:
ms_message("Send PLI on videostream [%p]", md->video);
video_stream_send_pli(md->video);
break;
case MS_VIDEO_DECODER_SEND_SLI:
{
const MSVideoCodecSLI *sli = (const MSVideoCodecSLI *)args;
ms_message("Send SLI on videostream [%p]", md->video);
video_stream_send_sli(md->video, sli->first, sli->number, sli->picture_id);
}
break;
case MS_VIDEO_DECODER_SEND_RPSI:
{
const MSVideoCodecRPSI *rpsi = (const MSVideoCodecRPSI *)args;
ms_message("Send RPSI on videostream [%p]", md->video);
video_stream_send_rpsi(md->video, rpsi->bit_string, rpsi->bit_string_len);
}
break;
case MS_VIDEO_DECODER_FIRST_IMAGE_DECODED:
ms_message("First video frame decoded successfully on videostream [%p]", md->video);
break;
default:
ms_warning("Unhandled event %i for videostream [%p]", event_id, md->video);
break;
}
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment