Przeglądaj źródła

core: sdp parser - keep link to start and lenght of sdp content

- useful in multi-part bodies and sdp operations
Daniel-Constantin Mierla 13 lat temu
rodzic
commit
d768eb5cc5
2 zmienionych plików z 6 dodań i 0 usunięć
  1. 5 0
      parser/sdp/sdp.c
  2. 1 0
      parser/sdp/sdp.h

+ 5 - 0
parser/sdp/sdp.c

@@ -371,6 +371,11 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_
 	int parse_payload_attr;
 	str fmtp_string;
 
+	/* hook the start and lenght of sdp body inside structure
+	 * - shorcut useful for multi-part bodies and sdp operations
+	 */
+	_sdp->text = *sdp_body;
+
 	/*
 	 * Parsing of SDP body.
 	 * Each session starts with v-line and each session may contain a few

+ 1 - 0
parser/sdp/sdp.h

@@ -101,6 +101,7 @@ typedef struct sdp_session_cell {
 typedef struct sdp_info {
 	msg_body_type_t type;
 	free_msg_body_f free;
+	str text; /**< link to start of sdp and its length */
 	int sessions_num;	/**< number of SDP sessions */
 	int streams_num;  /**< total number of streams for all SDP sessions */
 	struct sdp_session_cell *sessions;