Skip to content

Commit

Permalink
sdp: add sdp media lattr apply function the same way as for rattr (#1089
Browse files Browse the repository at this point in the history
)
  • Loading branch information
cHuberCoffee authored Mar 20, 2024
1 parent 16c61a0 commit 710ab3a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/re_sdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ const char *sdp_media_rattr(const struct sdp_media *m, const char *name);
const char *sdp_media_session_rattr(const struct sdp_media *m,
const struct sdp_session *sess,
const char *name);
const char *sdp_media_lattr_apply(const struct sdp_media *m, const char *name,
sdp_attr_h *attrh, void *arg);
const char *sdp_media_rattr_apply(const struct sdp_media *m, const char *name,
sdp_attr_h *attrh, void *arg);
const char *sdp_media_name(const struct sdp_media *m);
Expand Down
20 changes: 20 additions & 0 deletions src/sdp/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,26 @@ const char *sdp_media_session_rattr(const struct sdp_media *m,
}


/**
* Apply a function handler to all matching local attributes
*
* @param m SDP Media line
* @param name Attribute name
* @param attrh Attribute handler
* @param arg Handler argument
*
* @return Attribute value if match
*/
const char *sdp_media_lattr_apply(const struct sdp_media *m, const char *name,
sdp_attr_h *attrh, void *arg)
{
if (!m)
return NULL;

return sdp_attr_apply(&m->lattrl, name, attrh, arg);
}


/**
* Apply a function handler to all matching remote attributes
*
Expand Down

0 comments on commit 710ab3a

Please sign in to comment.