Decklink: Fix swapped format arguments
[vlc.git] / modules / stream_out / rtp.h
blobdcbf264b8bca2fc0fd7966a8c319eeb994316178
1 /*****************************************************************************
2 * rtp.h: rtp stream output module header
3 *****************************************************************************
4 * Copyright (C) 2003-2007 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * RĂ©mi Denis-Courmont
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 typedef struct rtsp_stream_t rtsp_stream_t;
26 typedef struct rtsp_stream_id_t rtsp_stream_id_t;
27 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
29 rtsp_stream_t *RtspSetup( vlc_object_t *owner, vod_media_t *media,
30 const char *path );
31 void RtspUnsetup( rtsp_stream_t *rtsp );
33 rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_sys_t *sid,
34 uint32_t ssrc, unsigned clock_rate,
35 int mcast_fd );
36 void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t * );
38 char *RtspAppendTrackPath( rtsp_stream_id_t *id, const char *base );
40 int RtspTrackAttach( rtsp_stream_t *rtsp, const char *name,
41 rtsp_stream_id_t *id, sout_stream_id_sys_t *sout_id,
42 uint32_t *ssrc, uint16_t *seq_init );
43 void RtspTrackDetach( rtsp_stream_t *rtsp, const char *name,
44 sout_stream_id_sys_t *sout_id);
46 char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url );
47 char *SDPGenerateVoD( const vod_media_t *p_media, const char *rtsp_url );
49 uint32_t rtp_compute_ts( unsigned i_clock_rate, vlc_tick_t i_pts );
50 int rtp_add_sink( sout_stream_id_sys_t *id, int fd, bool rtcp_mux, uint16_t *seq );
51 void rtp_del_sink( sout_stream_id_sys_t *id, int fd );
52 uint16_t rtp_get_seq( sout_stream_id_sys_t *id );
53 vlc_tick_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t *id,
54 const vod_media_t *p_media, const char *psz_vod_session,
55 vlc_tick_t *p_npt );
57 /* RTP packetization */
58 void rtp_packetize_common (sout_stream_id_sys_t *id, block_t *out,
59 bool b_m_bit, vlc_tick_t i_pts);
60 void rtp_packetize_send (sout_stream_id_sys_t *id, block_t *out);
61 size_t rtp_mtu (const sout_stream_id_sys_t *id);
63 int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
64 vlc_tick_t i_pts );
66 /* RTCP */
67 typedef struct rtcp_sender_t rtcp_sender_t;
68 rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
69 bool mux);
70 void CloseRTCP (rtcp_sender_t *rtcp);
71 void SendRTCP (rtcp_sender_t *restrict rtcp, const block_t *rtp);
73 typedef int (*pf_rtp_packetizer_t)( sout_stream_id_sys_t *, block_t * );
75 typedef struct rtp_format_t
77 /* Used for SDP and packetization */
78 uint8_t payload_type;
79 unsigned clock_rate;
80 unsigned channels;
81 enum es_format_category_e cat;
82 /* Used in SDP only */
83 unsigned bitrate;
84 const char *ptname;
85 char *fmtp;
86 /* Used for packetization only */
87 pf_rtp_packetizer_t pf_packetize;
88 } rtp_format_t;
90 int rtp_get_fmt( vlc_object_t *obj, const es_format_t *p_fmt, const char *mux,
91 rtp_format_t *p_rtp_fmt );
93 /* Only used by rtp_packetize_rawvideo */
94 void rtp_get_video_geometry( sout_stream_id_sys_t *id, int *width, int *height );
95 uint16_t rtp_get_extended_sequence( sout_stream_id_sys_t *id );
97 /* VoD */
98 int OpenVoD ( vlc_object_t * );
99 void CloseVoD( vlc_object_t * );
101 int vod_check_range(vod_media_t *p_media, const char *psz_session,
102 vlc_tick_t start, vlc_tick_t end);
103 void vod_play(vod_media_t *p_media, const char *psz_session,
104 vlc_tick_t *start, vlc_tick_t end);
105 void vod_pause(vod_media_t *p_media, const char *psz_session, vlc_tick_t *npt);
106 void vod_stop(vod_media_t *p_media, const char *psz_session);
108 const char *vod_get_mux(const vod_media_t *p_media);
109 int vod_init_id(vod_media_t *p_media, const char *psz_session, int es_id,
110 sout_stream_id_sys_t *sout_id, rtp_format_t *rtp_fmt,
111 uint32_t *ssrc, uint16_t *seq_init);
112 void vod_detach_id(vod_media_t *p_media, const char *psz_session,
113 sout_stream_id_sys_t *sout_id);