Skip to content

Commit 88e8339

Browse files
committed
patch: add sdp_media_session_rattr()
1 parent 9ff9a24 commit 88e8339

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

include/re_sdp.h

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ struct sdp_format *sdp_media_format_apply(const struct sdp_media *m,
126126
sdp_format_h *fmth, void *arg);
127127
const struct list *sdp_media_format_lst(const struct sdp_media *m, bool local);
128128
const char *sdp_media_rattr(const struct sdp_media *m, const char *name);
129+
const char *sdp_media_session_rattr(const struct sdp_media *m,
130+
const struct sdp_session *sess,
131+
const char *name);
129132
const char *sdp_media_rattr_apply(const struct sdp_media *m, const char *name,
130133
sdp_attr_h *attrh, void *arg);
131134
const char *sdp_media_name(const struct sdp_media *m);

src/sdp/media.c

+23
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,29 @@ const char *sdp_media_rattr(const struct sdp_media *m, const char *name)
860860
}
861861

862862

863+
/**
864+
* Get a remote attribute from an SDP Media line or the SDP session
865+
*
866+
* @param m SDP Media line
867+
* @param sess SDP Session
868+
* @param name Attribute name
869+
*
870+
* @return Attribute value, NULL if not found
871+
*/
872+
const char *sdp_media_session_rattr(const struct sdp_media *m,
873+
const struct sdp_session *sess,
874+
const char *name)
875+
{
876+
const char *val;
877+
878+
val = sdp_media_rattr(m, name);
879+
if (!val)
880+
val = sdp_session_rattr(sess, name);
881+
882+
return val;
883+
}
884+
885+
863886
/**
864887
* Apply a function handler to all matching remote attributes
865888
*

0 commit comments

Comments
 (0)