* rtp.h: rtp stream output module header
*****************************************************************************
* Copyright (C) 2003-2007 the VideoLAN team
- * $Id: rtp.c 21407 2007-08-22 20:10:41Z courmisch $
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* RĂ©mi Denis-Courmont
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-typedef struct rtsp_client_t rtsp_client_t;
+typedef struct rtsp_stream_t rtsp_stream_t;
+typedef struct rtsp_stream_id_t rtsp_stream_id_t;
-int RtspSetup( sout_stream_t *p_stream, vlc_url_t * );
+rtsp_stream_t *RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url );
+void RtspUnsetup( rtsp_stream_t *rtsp );
-int RtspCallbackId( httpd_callback_sys_t *, httpd_client_t *,
- httpd_message_t *, httpd_message_t * );
+rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
+ unsigned i, uint32_t ssrc,
+ const char *dst, int ttl,
+ unsigned loport, unsigned hiport );
+void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t * );
-void RtspClientDel( sout_stream_t *, rtsp_client_t * );
+char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url );
-char *SDPGenerate( const sout_stream_t *p_stream,
- const char *psz_destination, vlc_bool_t b_rtsp );
+int rtp_add_sink( sout_stream_id_t *id, int fd, bool rtcp_mux );
+void rtp_del_sink( sout_stream_id_t *id, int fd );
+uint16_t rtp_get_seq( const sout_stream_id_t *id );
+unsigned rtp_get_num( const sout_stream_id_t *id );
-typedef int (*pf_rtp_packetizer_t)( sout_stream_t *, sout_stream_id_t *,
- block_t * );
+/* RTP packetization */
+void rtp_packetize_common (sout_stream_id_t *id, block_t *out,
+ int b_marker, int64_t i_pts);
+void rtp_packetize_send (sout_stream_id_t *id, block_t *out);
+size_t rtp_mtu (const sout_stream_id_t *id);
-struct sout_stream_id_t
-{
- sout_stream_t *p_stream;
- /* rtp field */
- uint8_t i_payload_type;
- uint16_t i_sequence;
- uint32_t i_timestamp_start;
- uint8_t ssrc[4];
+int rtp_packetize_mpa (sout_stream_id_t *, block_t *);
+int rtp_packetize_mpv (sout_stream_id_t *, block_t *);
+int rtp_packetize_ac3 (sout_stream_id_t *, block_t *);
+int rtp_packetize_split(sout_stream_id_t *, block_t *);
+int rtp_packetize_mp4a (sout_stream_id_t *, block_t *);
+int rtp_packetize_mp4a_latm (sout_stream_id_t *, block_t *);
+int rtp_packetize_h263 (sout_stream_id_t *, block_t *);
+int rtp_packetize_h264 (sout_stream_id_t *, block_t *);
+int rtp_packetize_amr (sout_stream_id_t *, block_t *);
+int rtp_packetize_spx (sout_stream_id_t *, block_t *);
+int rtp_packetize_t140 (sout_stream_id_t *, block_t *);
+int rtp_packetize_g726_16 (sout_stream_id_t *, block_t *);
+int rtp_packetize_g726_24 (sout_stream_id_t *, block_t *);
+int rtp_packetize_g726_32 (sout_stream_id_t *, block_t *);
+int rtp_packetize_g726_40 (sout_stream_id_t *, block_t *);
- /* for sdp */
- int i_clock_rate;
- char *psz_rtpmap;
- char *psz_fmtp;
- char *psz_destination;
- int i_port;
- int i_cat;
- int i_bitrate;
-
- /* Packetizer specific fields */
- pf_rtp_packetizer_t pf_packetize;
- int i_mtu;
-
- /* for sending the packets */
- sout_access_out_t *p_access;
-
- vlc_mutex_t lock_rtsp;
- int i_rtsp_access;
- sout_access_out_t **rtsp_access;
-
- /* */
- sout_input_t *p_input;
-
- /* RTSP url control */
- httpd_url_t *p_rtsp_url;
-};
+/* RTCP */
+typedef struct rtcp_sender_t rtcp_sender_t;
+rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
+ bool mux);
+void CloseRTCP (rtcp_sender_t *rtcp);
+void SendRTCP (rtcp_sender_t *restrict rtcp, const block_t *rtp);