diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2007-04-27 15:09:12 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2007-04-27 15:09:12 +0000 |
commit | a468f02d2aeabcf7e31d9e4cf576ab3474e8a1f7 (patch) | |
tree | 05189a20db17aeeace5ceeae55977bceeaf46667 /gst/rtpmanager/rtpsession.h | |
parent | e72bd2abf931cb60b32ae8f0e8e702e6fdbc1500 (diff) | |
download | gst-plugins-bad-a468f02d2aeabcf7e31d9e4cf576ab3474e8a1f7.tar.gz gst-plugins-bad-a468f02d2aeabcf7e31d9e4cf576ab3474e8a1f7.tar.bz2 gst-plugins-bad-a468f02d2aeabcf7e31d9e4cf576ab3474e8a1f7.zip |
gst/rtpmanager/gstrtpsession.c: Move reconsideration code to the rtpsession object.
Original commit message from CVS:
* gst/rtpmanager/gstrtpsession.c: (rtcp_thread),
(gst_rtp_session_send_rtcp), (gst_rtp_session_reconsider):
Move reconsideration code to the rtpsession object.
Simplify timout handling and add reconsideration.
* gst/rtpmanager/rtpsession.c: (rtp_session_class_init),
(rtp_session_init), (rtp_session_finalize), (on_bye_ssrc),
(on_bye_timeout), (on_timeout), (rtp_session_set_callbacks),
(obtain_source), (rtp_session_create_source),
(update_arrival_stats), (rtp_session_process_rtp),
(rtp_session_process_sr), (rtp_session_process_rr),
(rtp_session_process_bye), (rtp_session_process_rtcp),
(calculate_rtcp_interval), (rtp_session_send_bye),
(rtp_session_next_timeout), (session_start_rtcp),
(session_report_blocks), (session_cleanup), (session_sdes),
(session_bye), (is_rtcp_time), (rtp_session_on_timeout):
* gst/rtpmanager/rtpsession.h:
Handle timeout of inactive sources and senders.
Implement BYE scheduling.
* gst/rtpmanager/rtpsource.c: (calculate_jitter),
(rtp_source_process_sr), (rtp_source_get_last_sr),
(rtp_source_get_last_rb):
* gst/rtpmanager/rtpsource.h:
Add members to check for timeouts.
* gst/rtpmanager/rtpstats.c: (rtp_stats_init_defaults),
(rtp_stats_calculate_rtcp_interval), (rtp_stats_add_rtcp_jitter),
(rtp_stats_calculate_bye_interval):
* gst/rtpmanager/rtpstats.h:
Use RFC algorithm for calculating the reporting interval.
Diffstat (limited to 'gst/rtpmanager/rtpsession.h')
-rw-r--r-- | gst/rtpmanager/rtpsession.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/gst/rtpmanager/rtpsession.h b/gst/rtpmanager/rtpsession.h index 3554016f..c9a2114f 100644 --- a/gst/rtpmanager/rtpsession.h +++ b/gst/rtpmanager/rtpsession.h @@ -106,6 +106,17 @@ typedef gint (*RTPSessionClockRate) (RTPSession *sess, guint8 payload, gpointer typedef GstClockTime (*RTPSessionGetTime) (RTPSession *sess, gpointer user_data); /** + * RTPSessionReconsider: + * @sess: an #RTPSession + * @user_data: user data specified when registering + * + * This callback will be called when @sess needs to cancel the previous timeout. + * The currently running timeout should be canceled and a new reporting interval + * should be requested from @sess. + */ +typedef void (*RTPSessionReconsider) (RTPSession *sess, gpointer user_data); + +/** * RTPSessionCallbacks: * @RTPSessionProcessRTP: callback to process RTP packets * @RTPSessionSendRTP: callback for sending RTP packets @@ -122,6 +133,7 @@ typedef struct { RTPSessionSendRTCP send_rtcp; RTPSessionClockRate clock_rate; RTPSessionGetTime get_time; + RTPSessionReconsider reconsider; } RTPSessionCallbacks; /** @@ -164,6 +176,14 @@ struct _RTPSession { GHashTable *cnames; guint total_sources; + GstClockTime next_rtcp_check_time; + GstClockTime last_rtcp_send_time; + gboolean first_rtcp; + + GstBuffer *bye_packet; + gchar *bye_reason; + gboolean sent_bye; + RTPSessionCallbacks callbacks; gpointer user_data; @@ -185,6 +205,8 @@ struct _RTPSessionClass { void (*on_ssrc_collision) (RTPSession *sess, RTPSource *source); void (*on_ssrc_validated) (RTPSession *sess, RTPSource *source); void (*on_bye_ssrc) (RTPSession *sess, RTPSource *source); + void (*on_bye_timeout) (RTPSession *sess, RTPSource *source); + void (*on_timeout) (RTPSession *sess, RTPSource *source); }; GType rtp_session_get_type (void); @@ -229,8 +251,11 @@ GstFlowReturn rtp_session_process_rtcp (RTPSession *sess, GstBuffer /* processing packets for sending */ GstFlowReturn rtp_session_send_rtp (RTPSession *sess, GstBuffer *buffer); +/* stopping the session */ +GstFlowReturn rtp_session_send_bye (RTPSession *sess, const gchar *reason); + /* get interval for next RTCP interval */ -gdouble rtp_session_get_reporting_interval (RTPSession *sess); -GstFlowReturn rtp_session_perform_reporting (RTPSession *sess); +GstClockTime rtp_session_next_timeout (RTPSession *sess, GstClockTime time); +GstFlowReturn rtp_session_on_timeout (RTPSession *sess, GstClockTime time); #endif /* __RTP_SESSION_H__ */ |