Revision 0351dafc sdp.h

View differences:

sdp.h
2 2
 * \author   Lorenzo Miniero <lorenzo@meetecho.com>
3 3
 * \copyright GNU General Public License v3
4 4
 * \brief    SDP processing (headers)
5
 * \details  Implementation (based on the Sofia-SDP stack) of the SDP
5
 * \details  Implementation of an SDP
6 6
 * parser/merger/generator in the gateway. Each SDP coming from peers is
7 7
 * stripped/anonymized before it is passed to the plugins: all
8 8
 * DTLS/ICE/transport related information is removed, only leaving the
9 9
 * relevant information in place. SDP coming from plugins is stripped/anonymized
10 10
 * as well, and merged with the proper DTLS/ICE/transport information before
11
 * it is sent to the peers.
11
 * it is sent to the peers. The actual SDP processing (parsing SDP strings,
12
 * representation of SDP as an internal format, and so on) is done via
13
 * the tools provided in sdp-utils.h.
12 14
 * 
13 15
 * \todo Right now, we only support sessions with up to a single audio
14 16
 * and/or a single video stream (as in, a single audio and/or video
......
24 26

  
25 27

  
26 28
#include <inttypes.h>
27
#include <sofia-sip/sdp.h>
28 29

  
30
#include "sdp-utils.h"
29 31

  
30 32
/** @name Janus SDP setup
31 33
 */
......
38 40
///@}
39 41

  
40 42

  
41
/* Parser stuff */
42
/*! \brief Janus SDP instance */
43
typedef struct janus_sdp {
44
	/*! \brief Sofia-SDP parser instance */
45
	void *parser;
46
	/*! \brief Sofia-SDP session description */
47
	void *sdp;
48
} janus_sdp;
49

  
50
/*! \brief Method to free a Janus SDP instance
51
 * @param[in] sdp The Janus SDP instance to free */
52
void janus_sdp_free(janus_sdp *sdp);
53

  
54

  
55 43
/** @name Janus SDP helper methods
56 44
 */
57 45
///@{
......
64 52
 * @param[out] bundle Whether BUNDLE has been negotiated or not
65 53
 * @param[out] rtcpmux Whether rtcp-mux has been negotiated or not
66 54
 * @param[out] trickle Whether ICE trickling is being used (no candidates) or not
67
 * @returns The Janus SDP instance in case of success, NULL in case the SDP is invalid */
55
 * @returns The Janus SDP object in case of success, NULL in case the SDP is invalid */
68 56
janus_sdp *janus_sdp_preparse(const char *jsep_sdp, int *audio, int *video, int *data, int *bundle, int *rtcpmux, int *trickle);
69 57

  
70 58
/*! \brief Method to parse a session description
71 59
 * \details This method will parse a session description coming from a peer, and set up the ICE candidates accordingly
72
 * @param[in] session The ICE session this session description will modify
73
 * @param[in] sdp The Janus SDP instance to parse
60
 * @param[in] handle Opaque pointer to the ICE handle this session description will modify
61
 * @param[in] sdp The Janus SDP object to parse
74 62
 * @returns 0 in case of success, -1 in case of an error */
75
int janus_sdp_parse(janus_ice_handle *session, janus_sdp *sdp);
63
int janus_sdp_parse(void *handle, janus_sdp *sdp);
76 64

  
77 65
/*! \brief Method to parse a single candidate
78 66
 * \details This method will parse a single remote candidate provided by a peer, whether it is trickling or not
79
 * @param[in] stream The ICE stream this candidate refers to
67
 * @param[in] stream Opaque pointer to the ICE stream this candidate refers to
80 68
 * @param[in] candidate The remote candidate to process
81 69
 * @param[in] trickle Whether this is a trickle candidate, or coming from the SDP
82 70
 * @returns 0 in case of success, a non-zero integer in case of an error */
83
int janus_sdp_parse_candidate(janus_ice_stream *stream, const char *candidate, int trickle);
71
int janus_sdp_parse_candidate(void *stream, const char *candidate, int trickle);
84 72

  
85 73
/*! \brief Method to parse a SSRC attribute
86 74
 * \details This method will parse a SSRC attribute, and set it for the peer
87
 * @param[in] stream The ICE stream this candidate refers to
75
 * @param[in] stream Opaque pointer to the ICE stream this candidate refers to
88 76
 * @param[in] ssrc_attr The SSRC attribute value to parse
89 77
 * @param[in] video Whether this is a video SSRC or not
90 78
 * @returns 0 in case of success, a non-zero integer in case of an error */
91
int janus_sdp_parse_ssrc(janus_ice_stream *stream, const char *ssrc_attr, int video);
79
int janus_sdp_parse_ssrc(void *stream, const char *ssrc_attr, int video);
92 80

  
93 81
/*! \brief Method to strip/anonymize a session description
94 82
 * @param[in] sdp The session description to strip/anonymize
......
96 84
char *janus_sdp_anonymize(const char *sdp);
97 85

  
98 86
/*! \brief Method to merge a stripped session description and the right transport information
99
 * @param[in] session The ICE session this session description is related to
87
 * @param[in] handle Opaque pointer to the ICE handle this session description is related to
100 88
 * @param[in] sdp The stripped session description to merge
101 89
 * @returns A string containing the full session description in case of success, NULL if the SDP is invalid */
102
char *janus_sdp_merge(janus_ice_handle *session, const char *sdp);
90
char *janus_sdp_merge(void *handle, const char *sdp);
103 91
///@}
104 92

  
105 93
#endif

Also available in: Unified diff